From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 383E5428BE; Mon, 3 Apr 2023 15:19:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25B32427E9; Mon, 3 Apr 2023 15:19:54 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2083.outbound.protection.outlook.com [40.107.105.83]) by mails.dpdk.org (Postfix) with ESMTP id 40EA241153 for ; Mon, 3 Apr 2023 15:19:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izH1AyQdbEIhjWwVo3z8NKRUrEyi/2hK0ocLanWbwvNZS1nVvIAZRcpVEXO7GrB/snH5Bv2+gEHQDiwh/hnkCfrtOPUeCYcndncmvMbeLVk3cygivqmbTqXLcDgLxoXeNso90FiB077wLpGQdgTg05bkphPf25BgdPlsnAlhcKVZLkMxkxe+oTrR2UwckSdxWLy+752lAUUf107C+kMTZ0c7xGGBpvQFAcMmnXVrtlf2Z0sNDC4g1ukMN5X8CUZLjrwYZh820k6WUwCW9jBi4x0KxLu6yqjT22soJ6o80jSXg5GUbtmX3GjcJkPLUaQClo1sMlCfVbfNAX9PAlLx2Q== 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=jqHCsXTyVV+m0qpZ7XsgyN4o4vnqMCKJjAgOBowrElI=; b=LjzWdF0rvzGdhIj8Rl4dDnTiw4VuESHR6d1SGlN1qUpHEIY2GmDs23wW+L4vLMvnvy51M20RVj8q/mYMYbf2sUzQnHvUFa91kXexJJg9cSmcqX9LMQ65cpjykGWxCVvDSoAWF003zoTmkYCc5xPsOQ1pFKVQYJKQZMgt1IiCiAHjEPLbaIn/xyv8f6fxACgRbWpMH+/08bOyKhX0YTHoAXKoQpZggZ6rUuHx7NyjhKkwJDd2Apoe4Vhx9R7bj0BATobwXPL9NerIzI3SaK3dTq2tkXQzOlpbLO+y15F111mpXhRCDy5kBtKSQs91ELUtlgw3r/TvxmtJKJYlUSUq9w== 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=jqHCsXTyVV+m0qpZ7XsgyN4o4vnqMCKJjAgOBowrElI=; b=MHgQ4PuN/hrW6qW0J3V2gt6I6rcPc9E17Cw4bTNd8+KRllMNCEdT3+VwzSXU/rp/44//R4J7vX7o4lXtLeF/Yl1sArGXYZbMI4lFQYc/SlsT4cEnR7Hf4k9RSu51RACOKZk1wbn60kbH7kkZxZ+mjI19RUlf6vRWKTYBVuwqtdY= Received: from DB3PR08CA0014.eurprd08.prod.outlook.com (2603:10a6:8::27) by DB9PR07MB9293.eurprd07.prod.outlook.com (2603:10a6:10:459::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.29; Mon, 3 Apr 2023 13:19:51 +0000 Received: from DB5EUR02FT048.eop-EUR02.prod.protection.outlook.com (2603:10a6:8:0:cafe::f6) by DB3PR08CA0014.outlook.office365.com (2603:10a6:8::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Mon, 3 Apr 2023 13:19:51 +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 DB5EUR02FT048.mail.protection.outlook.com (10.13.58.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.6222.37 via Frontend Transport; Mon, 3 Apr 2023 13:19:50 +0000 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESSMB504.ericsson.se (153.88.183.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 3 Apr 2023 15:19:48 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.186) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Mon, 3 Apr 2023 15:19:48 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 2B99B380061; Mon, 3 Apr 2023 15:19:48 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: Jerin Jacob CC: , Peter Nilsson J , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH 2/2] event/dsw: replace burst with bulk enqueue Date: Mon, 3 Apr 2023 15:13:46 +0200 Message-ID: <20230403131346.1070133-2-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403131346.1070133-1-mattias.ronnblom@ericsson.com> References: <20230403131346.1070133-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5EUR02FT048:EE_|DB9PR07MB9293:EE_ X-MS-Office365-Filtering-Correlation-Id: a8743e14-1e0f-4cec-8294-08db34461b16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c1Wa0el2/WuRRIZQ3DX64fq4KTwJqkSPdILXL5ykZ+dEW2sEITJgFbZN0DAHslubSjObwUeXhdXgZihbD9xLdU/GzugpT1DMjeDNH2IEADSeWh+GQz89X8EyTE+hmNuD5GnseReW4c151gd4FITQxE7xtEm0KRyS1uHaH8BS6F2H0zO4UfSLZjAF1Giwnjhrcv5ocIGmmtOm21TwiO0jgu1N/1bkY/lKOjrK2TKaiAu+N9k9xvQrElhwZwaL9/fgbTOo8u/WjNKsWp5A9n45B8Fms0Kpf5srLs+/PX9rOR7thv8agMyPIeFVpVQf0KZyztDxEE+t55NeiMW4iavw13lLa8ZByNZL4RE8s3tkgQWb8X7Lm2/t29sseevcj2P6SNF2CttBck78ZWX6WfPMoEPXgoTiNRduCBNkSauv9RER4It38fxi3GE2irSK7kU212DInVopuocqkJARWKmdF8faUwyb9uXV1aS/36RlckuSA7OidFwWfgrtln5NoPX//i7idqswCofY+t+jj8aADUht+qB0m/BcLR8s7yOR370hIf/naMwZTYm8oXJBdtMn4++LSFnxkFY1H+cu011T85CzAySgmKFnLD68FXe1UO8oMF7NAtlyX+rZwp55AvaZ9dB0zfGA8iUnoBEKu78B+nIYhVamlGzc+fCI583U8pxx9js8tuK/y5/eFEBHy2Oxn76wL5pQQhFlyPwFBvW+db9CLcms0Xa3pgCK/kydqHvuATd7t/9jobzDxWF3+g9U 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)(39860400002)(136003)(451199021)(46966006)(36840700001)(40470700004)(86362001)(2906002)(36756003)(82310400005)(40460700003)(40480700001)(2616005)(186003)(6266002)(336012)(83380400001)(47076005)(1076003)(107886003)(26005)(8676002)(4326008)(478600001)(70586007)(36860700001)(70206006)(6916009)(41300700001)(356005)(7636003)(82740400003)(5660300002)(82960400001)(316002)(54906003)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 13:19:50.8934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8743e14-1e0f-4cec-8294-08db34461b16 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: DB5EUR02FT048.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9293 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 An enqueue operation to a DSW port's input ring is guaranteed to succeed, an thus a bulk type enqueue (instead of a burst enqueue) may be used. There is also need not check the return code of such calls. This change shaves off a handful of CPU cycles worth of latency per enqueued event. Signed-off-by: Mattias Rönnblom --- drivers/event/dsw/dsw_event.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c index 9932caf2ee..90d298a255 100644 --- a/drivers/event/dsw/dsw_event.c +++ b/drivers/event/dsw/dsw_event.c @@ -590,7 +590,6 @@ dsw_port_transmit_buffered(struct dsw_evdev *dsw, struct dsw_port *source_port, struct dsw_port *dest_port = &(dsw->ports[dest_port_id]); uint16_t *buffer_len = &source_port->out_buffer_len[dest_port_id]; struct rte_event *buffer = source_port->out_buffer[dest_port_id]; - uint16_t enqueued = 0; if (*buffer_len == 0) return; @@ -598,13 +597,8 @@ dsw_port_transmit_buffered(struct dsw_evdev *dsw, struct dsw_port *source_port, /* The rings are dimensioned to fit all in-flight events (even * on a single ring), so looping will work. */ - do { - enqueued += - rte_event_ring_enqueue_burst(dest_port->in_ring, - buffer+enqueued, - *buffer_len-enqueued, - NULL); - } while (unlikely(enqueued != *buffer_len)); + rte_event_ring_enqueue_bulk(dest_port->in_ring, buffer, *buffer_len, + NULL); (*buffer_len) = 0; } -- 2.34.1