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 BF4ABA034F; Wed, 10 Nov 2021 12:14:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F3F74068B; Wed, 10 Nov 2021 12:14:05 +0100 (CET) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80057.outbound.protection.outlook.com [40.107.8.57]) by mails.dpdk.org (Postfix) with ESMTP id 9F6C940683 for ; Wed, 10 Nov 2021 12:14:03 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IO9fHLLgJMr5h1sSyKYG9A2dnMBJGXX3vEOENNKrMjDUbWNvuRkN3deGt8gKw1M6qQvhSQZ8Dyp+qLEVFsRNoM6FgMpaUPdE5dynAIvoQuAd9/fyUArDKjiuWxEC2nI4mA1L7W8TUcPvSsI5NMwKpvh6lvOkHldJZc4upw4PDIZHoOOZrk+CvJFAL5oSFRexTv91oNXDbfe4+bHydDK+mfpyGfBuuD14FbywXGm4etLUCDcW0x+RLrGlwwq7PdsX4Xaci+qwswmr+TCBi5KITVuHPCcMMML43d1ak87GZGA/ULsURL0FdoU10o3X66rqhNsLuBPifkKSygi1R/pCRA== 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=CXldc3WRoWtmPgyrZuawv5gmAR1+O502ir0xkQj9+v0=; b=m1xZ6xHqsQgj60EA5Fp5kov0QKLDajj4EUJW5myBtc7pbUIP7ycQCBI2t8lxkPBmc+CDiI1F9EL8enc4tqGKFejPstkZKkJoKb5T2OKl8ipsmmaEyPh3RfhMJqhUvdSgb3JJrBPnd4V4fkY/BYAtUO/W2TRBpEtjwms74u4AdVYoXMyW5lLm/Hg7U5rDx7PC+eHjUW5jz4QZnVz+XqIBBHJYBwHfAURnKAYfLMzY4jJvmUkJ07fm2r3Qo1n3s7Bm/k/SGqKnwunoNVGnDTMWuhYPu9norfPyCwFJdWeeF9W63bUwFxmnfNAEp/GpiI5lm9JvfjPkKJuH49YOPSuG4Q== 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=CXldc3WRoWtmPgyrZuawv5gmAR1+O502ir0xkQj9+v0=; b=OELT7RLzBRFcLjpabF9PtKMLcop5US3EqRlXn1hFlvHnerQxn1ihOgu6U9zqtdga2m0qR0kLaWeYv3HIucX+9mPQsSydXi85MleKBpTUMYKJon1nGvL6CBgaNKbaWOhRwn/jVJxVHoPuP4w0M3nEkB0jtHYPyhhCx2TdhLmwJYs= Received: from AM6P195CA0033.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::46) by PA4PR07MB7390.eurprd07.prod.outlook.com (2603:10a6:102:cf::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.14; Wed, 10 Nov 2021 11:14:01 +0000 Received: from VE1EUR02FT056.eop-EUR02.prod.protection.outlook.com (2603:10a6:209:81:cafe::32) by AM6P195CA0033.outlook.office365.com (2603:10a6:209:81::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 11:14:01 +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; Received: from oa.msg.ericsson.com (192.176.1.74) by VE1EUR02FT056.mail.protection.outlook.com (10.152.13.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 11:14:01 +0000 Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESBMR503.ericsson.se (153.88.183.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Wed, 10 Nov 2021 12:14:01 +0100 Received: from ESESBMB502.ericsson.se (153.88.183.169) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Wed, 10 Nov 2021 12:14:00 +0100 Received: from seliiuapp00218.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.185) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Wed, 10 Nov 2021 12:14:00 +0100 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliiuapp00218.seli.gic.ericsson.se (Postfix) with ESMTP id D4F08601E2; Wed, 10 Nov 2021 12:14:00 +0100 (CET) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: , , , CC: "dev @ dpdk . org" , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Wed, 10 Nov 2021 12:14:00 +0100 Message-ID: <20211110111400.21475-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 273e0220-9284-41dc-2496-08d9a43b32e7 X-MS-TrafficTypeDiagnostic: PA4PR07MB7390: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vrYawU2NANAEAwB4zYizIktWUiHReLpf42QKeQRiptRUx/Rc8Dpw90uJDwGgtJWrySwbcmvrQJaF3EVrKFAJa4NgvLtciaW1IMhsSGFTw2ztzPuO8IXDQjuheAOylVRuCgUgj9IBE/tWcYLPQnK8cHhDXmOPxm4kt8wiXYhHYfVJ2HffN75B1GCiwfigLpyIBfHmnjkFt/3hk8vMv6rnmJCaux/es10hygCFzafuqQZG5UN6ej9IOw0XnO3lm6R5cORbFMQ3e6oUym3VxAEXOVQKSu8XWkW+bB2OVuBLVVYViqKuwOR5siZHUf1WdTrjimrBWoFyEXwpL+OjZaDTfj9MmSQlA+bdbXbi2aryao7Xqb9mMdJan5wqQI1/2b0wyhxwV9iSwnDZL6Ccx8My6eKGqXRunJWTsKJKeoZ0y9nsFdpYnEQLeBVvNbQU1CK6xqKjkn0pa/o1PcxWBjTMgsvGkuv0eLvScSS03BKkH8zyNTbjimFOjwvwexvGm3NYJZLUNWT4dM1m7kExav9nvDFpBMtV9aDvNa+D/M8V0w27UJ9S9cdaqC7Go7Tj9+m0jGL590FwUipq8z6+WepVIbDoic2L8SkeuOmE/7oRvlNixcyXef0Enrkk065UOVNQuJIyolr4QCnqbuoIPl4jaMYVLMCkgmGojjMoBA16rdVEREVs2zbbFio4a7bNEKB/yUfpqHYCO70lpEs/g9PKAhxgjjhxwCYzpfUKFjuu3Js= 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:(4636009)(46966006)(36840700001)(508600001)(186003)(5660300002)(356005)(82960400001)(7636003)(36756003)(47076005)(8676002)(336012)(26005)(82310400003)(8936002)(6266002)(107886003)(316002)(110136005)(1076003)(54906003)(2616005)(2906002)(70206006)(83380400001)(70586007)(36860700001)(86362001)(4326008)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 11:14:01.3000 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 273e0220-9284-41dc-2496-08d9a43b32e7 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: VE1EUR02FT056.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB7390 Subject: [dpdk-dev] [PATCH v2] eventdev: fix Rx adapter stalls on event device backpressure 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 Sender: "dev" In the Eventdev Ethernet RX Adapter, correctly handle the case where the circular enqueue buffer head and last index point to the same element. This bug may be triggered in case there is backpressure from the event device to the RX adapter. v2: * Corrected bug description Fixes: 8113fd15e229 ("eventdev/eth_rx: make enqueue buffer circular") Cc: ganapati.kundapura@intel.com Signed-off-by: Mattias Rönnblom --- lib/eventdev/rte_event_eth_rx_adapter.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 56318b5a6f..809416d9b7 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -777,19 +777,25 @@ rxa_flush_event_buffer(struct event_eth_rx_adapter *rx_adapter, struct eth_event_enqueue_buffer *buf, struct rte_event_eth_rx_adapter_stats *stats) { - uint16_t count = buf->last ? buf->last - buf->head : buf->count; + uint16_t count = buf->count; + uint16_t n = 0; if (!count) return 0; - uint16_t n = rte_event_enqueue_new_burst(rx_adapter->eventdev_id, - rx_adapter->event_port_id, - &buf->events[buf->head], - count); - if (n != count) - stats->rx_enq_retry++; + if (buf->last) + count = buf->last - buf->head; + + if (count) { + n = rte_event_enqueue_new_burst(rx_adapter->eventdev_id, + rx_adapter->event_port_id, + &buf->events[buf->head], + count); + if (n != count) + stats->rx_enq_retry++; - buf->head += n; + buf->head += n; + } if (buf->last && n == count) { uint16_t n1; -- 2.25.1