From patchwork Thu May 11 08:24:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 126817 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 50F6442A1B; Thu, 11 May 2023 10:30:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3209242D62; Thu, 11 May 2023 10:30:46 +0200 (CEST) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2066.outbound.protection.outlook.com [40.107.241.66]) by mails.dpdk.org (Postfix) with ESMTP id B502242D5E for ; Thu, 11 May 2023 10:30:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P8p/e7h6sM6rxwZwwp2MPA9nnK/skSaq9nAWKcdXu0jjr/BodvtWbkpbri6Ze5ElzKRS7uS9boNbAFZOCRgBFUZl6VJ7XJFSIawMHM568BbjHpYKInhz8n7F9ZaRkBC0b9VzFESSQ6tZPfhkW+JBaGkXHSn9dvUTpaKGZbyVSun1IaGs1sQA0u1AzSGQLE2tRSddF/vdt3HSxsI0pX2u86BkX5cUWlT3LWhTR/JekzhrXIJ5iFfvXpZdxl8kqRKTiaZUMJPGXfmDiM1z0Fh1umJ+wsIznjxqi/+YOqn6fXrycA9cE1VhhVBzRfMIMHgIikJpRWhnrUY6EWMcVF0lVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9SnCCKCS+qVhXVKArTequLIQXc6rkd8/q1ngpSQWZFI=; b=Mf7kRV0oW/dvltsoqCLEx4B7bfHAGRfyPwV8woFV7G61msI1db/RMGf5DLui/bP6GDZ70BwdQTsrJMhi+T86mwdyDQwfMeSAk1h9nkFqMI0ULOuleIOVEHT3CelpiBFxwbzmFt2iX/MzmV5F5OHdsEMjz1QwTUzlbowXColsEQbQq6/Bz70NuW53vc6TZneZJb98bL3HHMZ64L/5iEmafjBy/8ixRRmME7l8QBrZEwHXwPyy8kKJT8xSVSEoZog2+R1HtqxMBmPtxar5CMKUjpz0G/NYgFMjm4raePqyF0VHtiK0hKNnCzSPmR2tmXZxS+BHwd0ZBoaPrB10a0DKsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9SnCCKCS+qVhXVKArTequLIQXc6rkd8/q1ngpSQWZFI=; b=J/Qohu7yptWa/sTQk8oEfOdIAO8YwGaF7gO06RmduCsmEAhRQU2ajzhu7GFwjqWlyEU+HMQ5uYvQpcssnCYgtnrt5LJDXPRkSqjqY3v8IHgX68A59qpf056xHGF0EV7sNGo5nWBulT9QJAzAcdccBV4NmjM3NNIwZGG/RoOYUW4= Received: from AM6P194CA0050.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::27) by DB9PR07MB8773.eurprd07.prod.outlook.com (2603:10a6:10:30d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.20; Thu, 11 May 2023 08:30:43 +0000 Received: from AM0EUR02FT048.eop-EUR02.prod.protection.outlook.com (2603:10a6:209:84:cafe::65) by AM6P194CA0050.outlook.office365.com (2603:10a6:209:84::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.21 via Frontend Transport; Thu, 11 May 2023 08:30:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by AM0EUR02FT048.mail.protection.outlook.com (10.13.54.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6387.18 via Frontend Transport; Thu, 11 May 2023 08:30:43 +0000 Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESSMB501.ericsson.se (153.88.183.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 11 May 2023 10:30:42 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.190) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 11 May 2023 10:30:42 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id BDCA91C006A; Thu, 11 May 2023 10:30:42 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: CC: Jerin Jacob , , , =?utf-8?q?Morten_Br=C3=B8rup?= , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH v3] eventdev: avoid non-burst shortcut for variable-size bursts Date: Thu, 11 May 2023 10:24:15 +0200 Message-ID: <20230511082415.6720-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511081641.6693-1-mattias.ronnblom@ericsson.com> References: <20230511081641.6693-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0EUR02FT048:EE_|DB9PR07MB8773:EE_ X-MS-Office365-Filtering-Correlation-Id: 990d1baf-beda-4838-2e18-08db51fa02ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Me2QLN+aRG7Kuff6Rwkye9N0ReegbIY3gXPe1RGlIoQMsBANxMyoSvDWHrYjQuoDmGUeOrZCM745wGTgJqDVqsjvW++VUnRvSE3GDWf8MUKyNVdQilV0xucWi2VTbYLwG3uAb0muo52Vnx9cY++VNdVDaSH1gRWXED4/5Zfte7I+Y4WO+SoaX0OBzqY+jkuZMQm6+5WThbZ8KBPg6HFBQ2MMaCeLZDSorp4Lr3fW1AmQvVrLKnyMIwfFPq4ZWxIiqTUtEhjxEnyIch832rmbsIy1CxJYWP/RabLqrFxSUuP4dc39IyTCj11pl++3q1Sfw1G1rm9BfAAvJaVJ16r7uO5ssHTGKXAfCXHyT5BW9EFE7EKMDOljSiu/uH2blel4KEx9mIj3JRKt+0hp1LZy5f5voH+kD9ARAHByCLimS/izn0wOH53DFk2LA3zTBCNyyhnOEBJlxSh7AE3zoqe/ngoZeR2S4bnW9N+poyjjN3UJyblt7xHfPpXlvqkJPCkBQ4rDMQqc8CB5oogchSFftmJ2CtLxWvU2re7/jFqNjKkVMjctO1RPMFp5vjQWNL1wnlBfMQbWCZivsgas300S3vSheWB25wkc6rGH8PKj7A0/GaS0g5ALu+wMohS7bJo+ccbaBvxkZ2L/Se83satMjHpyXooFkEYUFAPJF76t8AD2c6CZ/pd22J5lM9YVPmabXOCClV0tNcyNoxM5nw1dKhrzwBeGFLSFjBIRPfX9lj7Fg8ZKCDNn/0tdNHvGdX6O X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(5660300002)(70586007)(54906003)(478600001)(6666004)(41300700001)(8676002)(8936002)(316002)(26005)(1076003)(4326008)(6916009)(70206006)(107886003)(6266002)(186003)(2906002)(2616005)(336012)(40460700003)(83380400001)(47076005)(36860700001)(356005)(7636003)(82960400001)(82740400003)(40480700001)(86362001)(82310400005)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:30:43.1075 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 990d1baf-beda-4838-2e18-08db51fa02ae X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: AM0EUR02FT048.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB8773 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use non-burst event enqueue and dequeue calls from burst enqueue and dequeue only when the burst size is compile-time constant (and equal to one). Signed-off-by: Mattias Rönnblom Acked-by: Morten Brørup --- v3: Actually include the change v2 claimed to contain. v2: Wrap builtin call in __extension__, to avoid compiler warnings if application is compiled with -pedantic. (Morten Brørup) --- lib/eventdev/rte_eventdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index a90e23ac8b..a471caeb6d 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -1944,7 +1944,7 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, * Allow zero cost non burst mode routine invocation if application * requests nb_events as const one */ - if (nb_events == 1) + if (__extension__(__builtin_constant_p(nb_events)) && nb_events == 1) return (fp_ops->enqueue)(port, ev); else return fn(port, ev, nb_events); @@ -2200,7 +2200,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], * Allow zero cost non burst mode routine invocation if application * requests nb_events as const one */ - if (nb_events == 1) + if (__extension__(__builtin_constant_p(nb_events)) && nb_events == 1) return (fp_ops->dequeue)(port, ev, timeout_ticks); else return (fp_ops->dequeue_burst)(port, ev, nb_events,