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 C4BEEA0561; Thu, 4 Mar 2021 10:00:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 155ED40692; Thu, 4 Mar 2021 10:00:28 +0100 (CET) Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by mails.dpdk.org (Postfix) with ESMTP id 8003440147; Thu, 4 Mar 2021 10:00:26 +0100 (CET) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 04 Mar 2021 01:00:25 -0800 Received: from HQMAIL105.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 04 Mar 2021 01:00:25 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 04 Mar 2021 01:00:25 -0800 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Mar 2021 09:00:24 +0000 Received: from HKMAIL103.nvidia.com (10.18.16.12) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Mar 2021 09:00:19 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.42) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 4 Mar 2021 09:00:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ykf3cSpq94Qw6C6KlrMW3uTm9eDZ7AWRqkO5pN56mXT7MkeKN9GxF/Mo/8wUhZ625xa23R746aJ9ckr1MX2bFnKB/Y+Zpy9khtOotZMckcLAwjBsvab5WDOTcnRMgvBWjbsyOp85dsS0ChGelwskZ7TUXuHkpoWoWr8s/6LOxwzf3qmq3m6FxyG7N4eDlLxEm0zTUhwZYSeYW3JSh9l4Zx4Dj5y8A0/ayqjgrzzPlgBl88LNLr1fba5GgzrIBGqCLxzTfbMpQBfh0TZNIhhReA3mQwM70TPnXugjT3NbgbB81mmDb1iQoAWdetpzA0VSbu9SuZtWIJculwhhbGPhCw== 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-SenderADCheck; bh=/XlJ0eE/3nY3fb+z0uyD+6nzc57Hbq/Qteymz6fVtMo=; b=Sox+TYVzHek+trUviDtoXD/Lll2xNCt0Z5Tu2TQpFg+fAdtMFVqHbSLMKVjuykg8L5F9xKkMj6jARHAqdeeSY3hGvKp/h29ArvGqZPhA87robIHYb1CKJa70//uhV+WLCVKtpluff1kz7eOisKeXwhYxcpqJDikqu8yDWFxo5AOEZDpx8TQwF2xcvwYwDnqW2eLapWj+7o6nujWb6qJUT0JmzOERKmEao03c1iuyyc8Jgh6P1Nwr9OMf9TWl2VjD9DNOlNeeAAvLZLTZV+ErccEvynbcAeKp2xcKfPXJKc1JL9iio25sgPpE1WURGLRcnkeSyS1pq/YWKdXvFnnXyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB2748.namprd12.prod.outlook.com (2603:10b6:5:43::28) by DM6PR12MB3164.namprd12.prod.outlook.com (2603:10b6:5:188::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Thu, 4 Mar 2021 09:00:16 +0000 Received: from DM6PR12MB2748.namprd12.prod.outlook.com ([fe80::3d94:1f7f:178f:aba2]) by DM6PR12MB2748.namprd12.prod.outlook.com ([fe80::3d94:1f7f:178f:aba2%6]) with mapi id 15.20.3846.052; Thu, 4 Mar 2021 09:00:16 +0000 From: Raslan Darawsheh To: Jiawei Zhu <17826875952@163.com>, "dev@dpdk.org" CC: "zhujiawei12@huawei.com" , Matan Azrad , Shahaf Shuler , Slava Ovsiienko , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] net/mlx5: fix wrong segmented packet in Rx Thread-Index: AQHXD4Jmq/s/lxWa7Uy7atevrW+s9qpzimqA Date: Thu, 4 Mar 2021 09:00:16 +0000 Message-ID: References: <1614617885-2650-1-git-send-email-17826875952@163.com> <1614619190-3846-1-git-send-email-17826875952@163.com> In-Reply-To: <1614619190-3846-1-git-send-email-17826875952@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 163.com; dkim=none (message not signed) header.d=none;163.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [188.161.230.51] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 11dbcaec-598b-406d-88fd-08d8deebee31 x-ms-traffictypediagnostic: DM6PR12MB3164: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-header: ProcessedBy-CMR-outbound x-ms-oob-tlc-oobclassifiers: OLM:1443; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: hIs21/SaDkkekEMiktQjwineyc90SUYfIw2icVVNQOYPjqhzJ5LxsLUehG7ucM9m8UqAITu7TbfAyDW2dP+0XueLQFx0dF9VHz9uI1m5RPNez5iAtSpaax/MinA9dGLGezOxM/rZuykbfv6ea5Ra76SNMXd44Nx/p7Ma7817cvggbPD0+mzwF0OFAibGXY2vVD7SpkiN3Wk2j/LiGyU+TzBFEHZhFc04MvE+51Lij6f1POgyQSFze96Hb4ljxcpYWGXrTrzWVx9ZqScaX/W3Vv+MpVD0AIby7HoXqjtxlJ4NmPNAG6Tlgeq7uF+V2IjvnduVfU+bp96SgeamMCvdbDD2tYOiIC0CYCfcA0PCACCv46ZzPJv/GmKCEWGNUkw8CvwOhpF8UFhhYnRRPQp044rku1ek6GEMl9+n5YtThiX/7k2gRVVzKZLhSljGkByuTEZ7BVzZpWg2j7CgxHZRaYbg1bXrz40QEABz5UpDy3U+segKQqH4PGNPoCDuluyHyRrkvdEPDua3FYUv4U/KMpc5mCjnklk+SRDrZHy1dpPI+6DUsrHA4/3yaxG14CYPw2iIqlglKTbJaSjZ6Wey/A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2748.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(396003)(366004)(136003)(39860400002)(52536014)(6506007)(53546011)(7696005)(316002)(66946007)(55016002)(66476007)(8676002)(64756008)(9686003)(4326008)(66556008)(66446008)(110136005)(26005)(54906003)(2906002)(83380400001)(71200400001)(186003)(86362001)(76116006)(478600001)(8936002)(5660300002)(33656002)(83323001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?oEGl4wJiXwNEQibYuktct1TvcDzEdCLMRAs2cT5GbIfECa/0AYtyLBZOiRzk?= =?us-ascii?Q?mf0diANjAeiz3moZuwx2ny0KGHUfBhWV15ePIQ54R5qfEXcfARUVeUuAkqbs?= =?us-ascii?Q?c3SVEcWrAF6nA5esiA0M4sle3aCbWqZoOFQiwNgdqoVxtgjGrdoDxcog2Bmn?= =?us-ascii?Q?bFOi0KnB/XfgOZv5PBmL65uRTXZGSnBGYLFkOMe3b4KUXFgB9mGxXONvlHQf?= =?us-ascii?Q?E/gNXk+GydJLMh7tJgpuJC5wN26HeGV1LNLr16UyscQlvMtiM3X6vYEV5Es2?= =?us-ascii?Q?RL5AG7u4WBuXv6J33omCBOaE5ptQnMMrEZ/mB8JxWhO5gICeUpYbT+Y6lNCN?= =?us-ascii?Q?563TKlJIjCkmrGA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?= =?us-ascii?Q?My72Q5NpnWyG64pY5VZp40WlFFeNkb29q+5VitG0A1BYqNvhz+3GV/PvUg+v?= =?us-ascii?Q?TcvhxYN2ryl6KjF0eHNjar4R?= 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: DM6PR12MB2748.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11dbcaec-598b-406d-88fd-08d8deebee31 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2021 09:00:16.7270 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Tc/6i9JTJVLZVma0zl8IKpc/T8XXceUYgjHfF1WGcThXDle0raAxlVq7ruKVhUCgiWY2/7zh7fy0oUUuXrqXqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3164 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1614848425; bh=/XlJ0eE/3nY3fb+z0uyD+6nzc57Hbq/Qteymz6fVtMo=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ms-exchange-transport-forked: x-microsoft-antispam-prvs:x-header:x-ms-oob-tlc-oobclassifiers: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:Content-Type: Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=K3J9nhjeTnlEqGQND0H5tpYU6MxPPQOPvGSF4lTRxqCwnUvCBdPjfQIyJPktbxSN6 Fxb06eykxwHOkF0mj4/j99AaAAA1smRxTu+mdKgLWpctMHm5wNHzvp93eAqr6PMfX6 +vGqpTqZZpeHlSouBwMCsAFeRV05A2Y6PXg3024172NX63t8WdBXOrEq/8jTuMuCwU U7vrZXReBbT4tqZXwjnlXT3F1ZDP2W/KN80y6OG39rpafE1uI/dKaFXrgUEa4tjviB TeAep+tslPAoUcIp6zFSfUzP8Wyt2ddcSfzEz3mg6rR7AgVHdm6qUB9BHwqhOwP4gg zntXwqIxa5B5w== Subject: Re: [dpdk-dev] [PATCH v3] net/mlx5: fix wrong segmented packet in Rx 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" Hi, > -----Original Message----- > From: dev On Behalf Of Jiawei Zhu > Sent: Monday, March 1, 2021 7:20 PM > To: dev@dpdk.org > Cc: zhujiawei12@huawei.com; Matan Azrad ; Shahaf > Shuler ; Slava Ovsiienko ; > Jiawei Zhu <17826875952@163.com>; stable@dpdk.org > Subject: [dpdk-dev] [PATCH v3] net/mlx5: fix wrong segmented packet in Rx >=20 > The issue occurred if mbuf starvation happened > in the middle of segmented packet reception. > In such a situation, after release the segments of > packet being received, code did not advance the > consumer index to the next stride. This caused > the receiving of the wrong segmented packet data. >=20 > The possible error scenario: > - we assume segs_n is 4 and we are receiving 4 > segments of multi-segment packet. > - we fail to allocate mbuf while receiving the 3rd segment, > and this frees the mbufs of the packet chain we have built. > There are the 1st and 2nd segments in the chain. > - the 1st and the 2nd segments of this stride of Rx queue > are filled up (in elts array) with the new allocated > mbufs and their data are random (the 3rd and 4th > segments still contain the valid data of the packet though). > - on the next iteration of stride processing we get > the wrong two segments of the multi-segment packet. >=20 > Hence, we should skip these mbufs in the stride and > we should advance the consumer index on loop exit. >=20 > Fixes: 15a756b63734 ("net/mlx5: fix possible NULL dereference in Rx path"= ) > Cc: stable@dpdk.org >=20 > Signed-off-by: Jiawei Zhu <17826875952@163.com> > --- > v3: > * Reword the commit message a little bit. >=20 > v2: > * Added extra explanation in commit message. > --- > drivers/net/mlx5/mlx5_rxtx.c | 3 +++ > 1 file changed, 3 insertions(+) Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh