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 ABFCEA0C43; Mon, 18 Oct 2021 13:09:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 972BB40142; Mon, 18 Oct 2021 13:09:32 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id C3BD64003C for ; Mon, 18 Oct 2021 13:09:30 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="215390049" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="215390049" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 04:09:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="444014979" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 18 Oct 2021 04:09:29 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 18 Oct 2021 04:09:29 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 18 Oct 2021 04:09:29 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 18 Oct 2021 04:09:29 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 18 Oct 2021 04:09:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n/SviJcWyilzmLl5i6csSNrH7N6ce/WJnBvdi955uLmZqWvfeiNbgu3++sj70wWi1IzpY7qafLP2MeinOWxDcuu8gAZFo/P0kof0QDoOpIxNQamGOzCda+tbXcXyWuHF/pkl163Ucf6a9dtIQkXaz1F5CcZUj+N9EZN4jfNTesWx8AY1ub7j21eUXKlcIFEIGy3MMndVRG9J2i/gikWJDsfqtUUpPWQHE+Agc4WWyk+7S3y2pVHk6SJxfBAp0P+pW5DfwU/LrtqI5zpsV2pCtQ1pflPY9Rb4TKBWCTx2aB6wwBnaygaQ2gnPd37Mabkq/tHYaLwwZBaxRIU53q4hcA== 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=OiWMmQfhQB/6AUjgrI5ZSYVB4Kmtz8UbsM22tmp1IgE=; b=W0LAMdHQcLV0EluHeqFbVLiCSMmO4TNIfaqbHT7R5fxK36fgzVlxid7PLuYe1RaI2FX31GpmTO7fXf4fY28Bcgqfwb+MRn07XXN4WRxK63Ec4VC+1mWn70Ue6ahwH5JrZyqWG7BsboiX0kFoVGk+bHSkuhNm+XTBOKX0lPKhgcTD99UBOMRZT9+oJawI7Gc5a4efHuUp+y0uM3RXtg76U5YBF04LnUXfuEu32eiHCDQVSCPXg5zYqINdfD8z2i3/8o8Ciltwsxj+dyt8RTRQv94mDFfhoJudmX+bOSKN5/+u6nsEL5EdnUfW8oXXRVjEXHx+UjnoQ7dea/x4GsyCuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OiWMmQfhQB/6AUjgrI5ZSYVB4Kmtz8UbsM22tmp1IgE=; b=ChOhXfgf7fXRJ8aQu2979NkZcxOdYb4vZ3n9uDPHZR/dWxUzxriXtxQgp+U1PiNtS6JOCishFbW6gjC6ZBxYQUSKxqXhToTSdEgX4oLhDV5UXW/uY+0OW787OwdHWHTzx3Ih/E7096pjSwg46R15v7lG5QDq7vDuV0BUjaVrIX0= Received: from DM6PR11MB4348.namprd11.prod.outlook.com (2603:10b6:5:1db::18) by DM4PR11MB5518.namprd11.prod.outlook.com (2603:10b6:5:39f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Mon, 18 Oct 2021 11:09:26 +0000 Received: from DM6PR11MB4348.namprd11.prod.outlook.com ([fe80::e00e:1103:ed26:7d97]) by DM6PR11MB4348.namprd11.prod.outlook.com ([fe80::e00e:1103:ed26:7d97%6]) with mapi id 15.20.4608.018; Mon, 18 Oct 2021 11:09:26 +0000 From: "Jayatheerthan, Jay" To: "Naga Harish K, S V" , "jerinj@marvell.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH] eventdev/rx_adapter: fix wrr buffer overrun issue Thread-Index: AQHXw/nD7NDajkDCrEWTL8AabQXAEKvYmQFQ Date: Mon, 18 Oct 2021 11:09:26 +0000 Message-ID: References: <20211018082541.2742861-1-s.v.naga.harish.k@intel.com> In-Reply-To: <20211018082541.2742861-1-s.v.naga.harish.k@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 064d987f-91d3-49fc-28db-08d99227bfa5 x-ms-traffictypediagnostic: DM4PR11MB5518: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1417; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zLRmxyzByp5oZmP1BF5oR5t75RjIFXZXdmwvHDDyeQUMhSUoTxNojZwWEKXvJ0iMSnWmipJtIfPtrlE12FuqCuclU/xFM/09aiWEZ7NlAXN7OMEhbmzgQYneN/vCzEh90YHu6b6bytiKZKGjzVAbvwt0T3dut72L9sLeDVLVAI9X7Jbt2jm/Dv9RKsczwL8L6qdSooAOBAhzeiUV4PZyfo5f0W7K23UWFf0cFnxNTe7vrZhxuwRD16aBH/+PRKLI7md/ESFFIXvQLSnmkGdDXU8djjNnMOUILeEDbsr+FK4A/Nu6qw/qOd+A91ib7ZNLunwFZluWXrqt1UY9ZNadol8eO2AEFjX1Mc7lBUQbVADNXsLAblDD2RIt1GxvCEfqcNK6gDkwngFzPLW80678KLpI97uvSg2686WhLP3jizUWujp0WF6bzf4O3C3282K+5rufhJgob0Eh4wgnS2eucXNlaU2wOiwzmr3rENqUTJ/fUalUGmVlNp9txmJgQ1mdSqru7Scug7oEG8szW3pFbKJIMFEpJi3G0zY9no4W5m4DFzDsJz3GAmiOM6JymM6K6Xy1qckdeHt7Jw+NtfhQ9voc5q8VmaAsXBBNd9gk3Gceutxldc9oPNbbQ9un0JTgc/9sCIIpoE3GFGidiutDlrN+O8XCAZeo0CNsaTQk2fCX3qQCWrS1iqb1N6YMPUIPxTXCJUWRxZvSQWRlxT3cxA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4348.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(7696005)(76116006)(82960400001)(66946007)(5660300002)(508600001)(38070700005)(2906002)(8676002)(8936002)(186003)(52536014)(38100700002)(6506007)(53546011)(316002)(66556008)(55236004)(66476007)(64756008)(122000001)(4326008)(110136005)(83380400001)(71200400001)(9686003)(55016002)(33656002)(86362001)(66446008)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nz2b9N8cfsJ6iH5wK9d70qsaoODD03x8W9QsV2mk6joOW1Bu4kpXru4HJ8qi?= =?us-ascii?Q?Nl9URwUMrse8I/NmYAy2lI6fOMgC/k3WptUWMzzJlcmzsohYEl/DjKewkNCg?= =?us-ascii?Q?Ezy7rnidZMGbNFTf2aqfvSVgO1m0pnII2wXY21Pf7nt1unD31g/TaQZwXqAy?= =?us-ascii?Q?6YMk2S9JVpfi0H3dcEo4XUS4ca7TRCmUhot8hgjG9kek6ygIP3VG+EK9u5dM?= =?us-ascii?Q?1mryQPgznEFLtVtlReeW4Xlvz4CbV2taTerDnsn1gpqvuRUTe/nn9FqMg6uF?= =?us-ascii?Q?A9gPExXdP0p7dwYsj2dhb8ukk4p5dsnjZQ7rUhEAyO4sg+Kj63SBEdHjqstD?= =?us-ascii?Q?sCiGyjiX2+9FETju4DA8ejF0v63TeKPzht0eZzd5TRiuZJufbHnloWFTX7+3?= =?us-ascii?Q?nQnWBpNqQgwGZx+b5CnnRSAcG+zzQEgl5WBcxnBPncU3564t88yjjMIdRFRM?= =?us-ascii?Q?j+iUZv8ToNAcOPzr3ZZ7gi5iPTpxbqLe9Cura1yLawppGfm5srOHVN15bAf7?= =?us-ascii?Q?raGG93jzEvcYbrlrKHNbiN6QWWe40BP+8Dk8eAeQXe+u7YI3Z9IICJzT9OEj?= =?us-ascii?Q?U1XyAPzFSZdeoz8XwK3djebjgKYWtWgOxAppX1R0s6ZKyTGfaz//TQl/71AV?= =?us-ascii?Q?BVaKv3Yyap0Cdvo6IM81ua6NbP/D1dyU/RLabLbP0di5CLG3AHl2vhMhA44k?= =?us-ascii?Q?FS4xHURYmmJxNHl6TMw0yo95SGR/o+gulwukbych5rYcI+AaV7DBOr0FEjoF?= =?us-ascii?Q?CjiT9eKwMVpoDyghaagE9aLb8TR/Z77vjH4ezQYwf8vCFwIaxdib8rkc6FtR?= =?us-ascii?Q?vyb1rwXnoN6ZiZfT8XPm6NFA/r6nme3OjlYEIREKS85SY7iOsHyi2+0GjWer?= =?us-ascii?Q?CRhlFu02MUxevOmtUkUzlZaT+vPNMkDIB7zxzKGcXLnox3cajnrRph8Rtybh?= =?us-ascii?Q?LO+ZwFg2N0NDp+yBpJzyEM92bdW+xBuXm76jeOx49/BKwOOqLP27y8Iad35n?= =?us-ascii?Q?97BSSZV8NWksymAGnPA/aUeoIrNfXa7qpblUGuYJgxGqKmnAH6KfJP80AV2Y?= =?us-ascii?Q?sFqP53dUSAU0GO4pKYFoSurVNAES1sNzkjb7YwztwnZO/YY9F+Vkn+MRybF9?= =?us-ascii?Q?paJKaJ2bxBvnU+hdJir38fER8HWk/JPv4ITT8WyZJbsZioKyDLpeCuvwt4Zn?= =?us-ascii?Q?NT8W2/RjIa9o4dzP8rt9oerVfZSK9txEeREJoluNoPBkfaVGKwWnzMdrSUcd?= =?us-ascii?Q?mPGwu0Zuh1YdmSey4UPSxmQwUM1y07sv634gK5nWMsvPm3onNNkMyGRk3+Zh?= =?us-ascii?Q?YoA2CC9RMH0fkCJ/DJnk0pwq?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4348.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 064d987f-91d3-49fc-28db-08d99227bfa5 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2021 11:09:26.3239 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PS4oBeJB+6Gz6gV7mLG3YUrVtf0QVNpDYRgaPEt+UnmUvzQ/2KQQCz7+NqFG3cmrG/iKz95shBO+jwzCRJVqUNEWk0U3z4iYk0ZNnbVEVo4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5518 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] eventdev/rx_adapter: fix wrr buffer overrun issue 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" Acked-by: Jay Jayatheerthan > -----Original Message----- > From: Naga Harish K, S V > Sent: Monday, October 18, 2021 1:56 PM > To: jerinj@marvell.com; Jayatheerthan, Jay > Cc: dev@dpdk.org > Subject: [PATCH] eventdev/rx_adapter: fix wrr buffer overrun issue >=20 > when a poll queue is removed from a rx_adapter instance, the wrr poll > array is recomputed. The wrr array length is reduced in this case. The > next wrr position to poll is stored in wrr_pos variable of rx_adapter > instance. This wrr_pos can become invalid in some cases after wrr is > recomputed. Using this variable to get the next queue and device pair > may leed to wrr buffer overruns. >=20 > Resetting the wrr_pos to zero after recomputation of wrr array fixes > the buffer overrun issue. >=20 > Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter implementation") >=20 > Signed-off-by: Naga Harish K S V > --- > lib/eventdev/rte_event_eth_rx_adapter.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_e= vent_eth_rx_adapter.c > index bd68b8efe1..82a652d305 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -2773,6 +2773,11 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uin= t16_t eth_dev_id, > rx_adapter->eth_rx_poll =3D rx_poll; > rx_adapter->wrr_sched =3D rx_wrr; > rx_adapter->wrr_len =3D nb_wrr; > + /* > + * reset next poll start position (wrr_pos) to avoid buffer > + * overrun when wrr_len is reduced in case of queue delete > + */ > + rx_adapter->wrr_pos =3D 0; > rx_adapter->num_intr_vec +=3D num_intr_vec; >=20 > if (dev_info->nb_dev_queues =3D=3D 0) { > -- > 2.25.1