From patchwork Thu May 11 08:16:41 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: 126815 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 5242A41E63; Thu, 11 May 2023 10:23:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4311842D62; Thu, 11 May 2023 10:23:14 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2081.outbound.protection.outlook.com [40.107.15.81]) by mails.dpdk.org (Postfix) with ESMTP id 9901642D5E for ; Thu, 11 May 2023 10:23:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWeVQCRJa2G7mVL1GZMBWL64pV4kYhXJpg+idorgpMGoy41VLrKG7+4mmpw+u9Y1WKcnbJuz6vLTdpC2n9q0j4UIPFqQZ8mocbH3vAGSN31Btfy7Z7+6U3vtheWAriq+xPmneZ79JvnWd3ccY3KKc0gdXEvhfLWEr1k0nnKOznJrwYp9k/yuKwoB+GZk4/sypLvtDJXHcpjvkXA6QjwlnLoHK2P8VAVa8OGF6gzD441cMr+ptSWhhnlS5sJGaWgmO+QgzlI9Tugk5WXMG6NamU3khmTt7RkKP/0Mw2qlAKQiKJEqz7zHgAUjgMar5NueUEphEwPVxBTi86sXTJD1CA== 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=dRy6Ott0Z5B62nvwZu/RfV+mVbj52V+61ARo9c8WCwo=; b=fqDo1aaQh+GfvJnK1nIAMGBVnsz2d3QnPkoKlWC0UWlBKdQzf1z8WgRn2daBrhuTrc00lDQzz1hYNvwL5SvC0JevCekc/Nf7RD4MIhbUoB7W9ZWhKP14q1oXQ2V+vWea+oxfkXSVXK5xCzwYKo8LTopJW7nZ9NktGhKnjsI21xKtLgrGw2UgWC2m/HaCFbVVc9PGaJw4Hc+eoCBfiejXVFneMoq7nuSHJR3QZydHGFythwqW1G3LTLbfmlWjeqJ3cB5ga/WIYWbbZ7KSL7iQcNXjRzAI9H5zWnjHtQW5zMpg+5QH4mt+BOp2Ctmf55s+GOpXh0n8uxYkOaC5Ey4SUw== 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=dRy6Ott0Z5B62nvwZu/RfV+mVbj52V+61ARo9c8WCwo=; b=B1NjVrGxZFAWPRAqRhAF1y9BtXgXSX0Zba4+FyrAY3xa4rgIfmDwQoiPOvvJ+dWQFC7dz11IRjInrRq37tuiyss5yn6A+D70RUV+viH0lfQzkHh+K9ScGnap/18HHwg22PBl31IAPpJsBasxUdBrW7ogl/hX6KqkP4YIjdbxF5E= Received: from AM5PR0601CA0032.eurprd06.prod.outlook.com (2603:10a6:203:68::18) by GV1PR07MB9167.eurprd07.prod.outlook.com (2603:10a6:150:80::8) 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:23:11 +0000 Received: from AM0EUR02FT016.eop-EUR02.prod.protection.outlook.com (2603:10a6:203:68:cafe::24) by AM5PR0601CA0032.outlook.office365.com (2603:10a6:203:68::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.22 via Frontend Transport; Thu, 11 May 2023 08:23:11 +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 AM0EUR02FT016.mail.protection.outlook.com (10.13.54.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6387.21 via Frontend Transport; Thu, 11 May 2023 08:23:11 +0000 Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESBMB502.ericsson.se (153.88.183.169) 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:23:09 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.187) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 11 May 2023 10:23:10 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 3F0FC380061; Thu, 11 May 2023 10:23:10 +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 v2] eventdev: avoid non-burst shortcut for variable-size bursts Date: Thu, 11 May 2023 10:16:41 +0200 Message-ID: <20230511081641.6693-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D878FE@smartserver.smartshare.dk> References: <98CBD80474FA8B44BF855DF32C47DC35D878FE@smartserver.smartshare.dk> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0EUR02FT016:EE_|GV1PR07MB9167:EE_ X-MS-Office365-Filtering-Correlation-Id: 6483f72a-308b-454d-175c-08db51f8f535 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RbouJrZhdYDK9ZSE2aYpEGMAepw7Wi8EUN2Fv0BiI8kPq6xYocDL5nUYVWCzo6lDBo5jH/uYMjNFADM4oiGZ5Yg0/9YLXJtELmkVK0G6vCIP9z/F9cZa48lE56aZFKXIZGAsHJXt9nrHyyvsSwa6WPO9zUDeSyxT5aMz3mjefOZ8fbrRjtGuZk3K0ZWgg0vGMsxuqXto7323J5a+1WpqJSRoKpImx/jP2TPQ2oqYYKTetkrH742ICtj7lQnxwtPdr0MinOGfNfcAzPGLjRmX3sOQzQQUEOPGQdYrG4SKAJbWtv1aiiA7Ji1ey79a/k3H1LTvDrD1An5pj5fqJnQXpTwYrBhs4ySkh+nW894LBz/9u38Z6W/VgG16hEealljAHrDH9A5kxpu/nwd/EOPE4ZyuH1aN4cYm5xl+LsRL9qIW992DGrtFwgi4p3SpLs/I4Yb1GRrKFYf3seeLw8BdNm6NLXBzmABPIw/KagxgMaJ2VjYn5VIpSgp/tmymrCjChQeYE7DuctX8Co6N3VbabZzTp4mU0/n90YuEK+9g/ezjHW4lgiF6ZmTCE+XPfuWXxYwce6qYBg3LWP4Hb7xd3yglSYMxTkhHfymt0HLTdKD0a95gfY/ZHe/HuRGLEyhfXtJvRLmeqY3TsrkS2Ps7XM12m7yGTsBF471xf0xkuqeHlR2hUUcE2U2XsenYmgmaRIcZhEHrSk69fh/gYs+QcYhjSe2hgKsFHGDKBykPSpfBrntXoO2dhfSKF8B/M7KK/eMy63VMO6IZXnLch1fAVTF3EAJdQGo4oDABX673tjM= 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)(396003)(346002)(136003)(376002)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(8676002)(8936002)(40460700003)(2616005)(36756003)(2906002)(5660300002)(6666004)(107886003)(6266002)(82310400005)(86362001)(186003)(1076003)(26005)(40480700001)(478600001)(83380400001)(70206006)(4326008)(70586007)(316002)(6916009)(7636003)(356005)(82960400001)(82740400003)(41300700001)(54906003)(47076005)(336012)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:23:11.0068 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6483f72a-308b-454d-175c-08db51f8f535 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: AM0EUR02FT016.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR07MB9167 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 --- 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..8af15816db 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 (__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 (__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,