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 6154CA054F; Tue, 2 Mar 2021 18:18:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A704322A308; Tue, 2 Mar 2021 18:18:27 +0100 (CET) Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by mails.dpdk.org (Postfix) with ESMTP id 432BD40142; Tue, 2 Mar 2021 18:18:25 +0100 (CET) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 02 Mar 2021 09:18:24 -0800 Received: from HQMAIL107.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 02 Mar 2021 09:18:24 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 02 Mar 2021 09:18:24 -0800 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 2 Mar 2021 17:18:22 +0000 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 2 Mar 2021 17:18:17 +0000 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.53) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 2 Mar 2021 17:18:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i3e6pMIPHrG+OYJ4LYcjgVyX0BRicJEtgTEXIGn6YXIhxrvnKxWagbfgLoyE9yxf4oeqjnxNc2SRMZoXcqiBr2sP9wmaYk0VATwkcNccms8CEkoSsmPQaK4S68bZsOJ6Ine6ercL6zOVAg4NJNp6yYLLYMasGPuk1hu6LJ6SiNKgCt2l8C9HCYEGEvKRCAUYrH2Ku9d93B5vRY4L9N4uN8zEWfTmqGemWbZD6tpjHhkalZRc+ucwFU8jMRD9K0EAggxlSQQGADAa9iVtIY593QxEfkJcILdKdkPtHJiBeLcRYmNSOEfNXe4ZRvk5tF7te961ovH/a7jC2Nnl6awiSQ== 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=nmXcFqeFYDlu3jy/X90Vr3DWq3F/DcNK6xaH6PIfg9s=; b=j4xdTIEhkQ9lWcxOzvpvl8TRVWQWDeqLtOmEhUXhvNIhobkmUjbJMph3HHFSMtpbbrYAXBZwycIkk5bmE7T8BsEz83KElBkpXbKJgMbzs9TxdfzryB+D4m1tB9nKz1g0ce6ZV9+vT4fnytFDU8fXD4tVrVgTjwDHqMNFKH+hCxP2LNJp+wpwldCd9FlFR01t882PnyPLY5orEyEHjuIde+sBW62z/gFUE4iJuzTfy+9LOj+dL6MKIAHr2opXdgtwbmGFUylQhacppCYgXP+QcRFp/ByR+2zx/Tb73qDgK3Zzv4eNQDRU0gJsqEpdI5WLxiuE8b7EVscRmoPhhkGVwQ== 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 DM6PR12MB3753.namprd12.prod.outlook.com (2603:10b6:5:1c7::18) by DM6PR12MB2923.namprd12.prod.outlook.com (2603:10b6:5:180::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.23; Tue, 2 Mar 2021 17:18:12 +0000 Received: from DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::20f7:11fc:9d46:9258]) by DM6PR12MB3753.namprd12.prod.outlook.com ([fe80::20f7:11fc:9d46:9258%6]) with mapi id 15.20.3890.029; Tue, 2 Mar 2021 17:18:12 +0000 From: Slava Ovsiienko To: Jiawei Zhu <17826875952@163.com>, "dev@dpdk.org" CC: "zhujiawei12@huawei.com" , Matan Azrad , Shahaf Shuler , "stable@dpdk.org" Thread-Topic: [PATCH v3] net/mlx5: fix wrong segmented packet in Rx Thread-Index: AQHXD4JbU8WFhdIvPUugIt631EC61qpw8LnQ Date: Tue, 2 Mar 2021 17:18:12 +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: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5616d5f6-107b-4135-f4e4-08d8dd9f2896 x-ms-traffictypediagnostic: DM6PR12MB2923: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-header: ProcessedBy-CMR-outbound x-ms-oob-tlc-oobclassifiers: OLM:644; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RqhMQfRcLrpjR5d0ElKGjluOvhACoj7iFDnsQKU5Ia78c1l8BX5efo+8R3cfEp18BgWes/y+ELiv/xgvVptcRatpgMIXH2c/gcL2PB05hWGwMAvXlbQVHWdwerUum8bLZroxcmT3cQDB7sGM9LJwyAzOb2HzFlBOA+6KRJrJ16yYufbyD9Lgo6oRaxKNNjTH6ZaQf6vc6Lo+bSO0n/pKVyX1c6V/pQBdQZ4CRPR7DHVcAZUcvjY2qt/+04FEOb+HhlwZv1fwmJWFtlmxxcN+eO/tjrMdNhcxXSYLPB4CFuJSsggK8rFWy3Fh5CW9KVWFIFiWRZVhiwOZZ7vcVh3SpjQwcOuns1adz/zbx2NemDcPA2sKDfXyS29ztV5T/l2zAHOPyxlqfJUry2hpm0aX0jWEtAk2GpmjaLzDWo5483J9T5dnLvTDYftG43pweXvEqqTsjq5xbQnDCl5PL48n/NO3troNrrOLWHVN5/WutPKqbV8GLS5xdhtpF7KWD12LrZEROA108org49dRVmF7YXgUa4Yl3kIqb4GwTxD+XBydVldK18pkNnGu0UHJtn8l x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3753.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(366004)(136003)(39860400002)(346002)(396003)(71200400001)(8676002)(5660300002)(186003)(2906002)(33656002)(7696005)(26005)(64756008)(110136005)(9686003)(66946007)(66446008)(54906003)(8936002)(86362001)(55016002)(66476007)(53546011)(52536014)(6506007)(83380400001)(4326008)(478600001)(316002)(66556008)(76116006)(83323001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?e66rVmZle0Ng06ZmRv2eXAgNAJku+g6+Og9VwfeyEO3gK8Vcsd29P/D3CdG7?= =?us-ascii?Q?I+rZ4RLku9t0Gl4fQiT9kST0krw3YaVwp3NPXtThtNQyRv79+IXr6ZVHLAg4?= =?us-ascii?Q?GhFeHdbY+ui1Vk5pioiMkc37VSRXm5+BGKW1ELssCDtGz3mlAeXC6250qbL8?= =?us-ascii?Q?lRaEe6R+VCvPv1hGU5UZmNVaaMYoUqRdns2+d/MP825BlLOy9CH7aAGsMi+7?= =?us-ascii?Q?o0wOViIX++EfXP/b5xTOgqpCNKdk9zbO2pSaFeax4IceUNRR/6Tnx5ZAQsR3?= =?us-ascii?Q?7P5q243LzuAKC5SA4+WzFK0ZZKLHmX/Xr45OTLIGfgq0Np9OqFj52dErdV/t?= =?us-ascii?Q?DspRMTEGBUzDOOVEfD4F8M7oUoWorF0upxr/fQCKoI9J8TdCo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jyjbx6kBxs848LA+yq0ugufzRyAQJN1IfU8Hc5z?= =?us-ascii?Q?I6g=3D?= 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: DM6PR12MB3753.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5616d5f6-107b-4135-f4e4-08d8dd9f2896 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2021 17:18:12.2226 (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: Wv7zK5eTLTmcYoHcvsgRJzFsWR/euHvMct3mnbh0A/xRedxlKHiehFCxuTpxpJAvXKO50S9seBrtScq9KMtfdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2923 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1614705504; bh=nmXcFqeFYDlu3jy/X90Vr3DWq3F/DcNK6xaH6PIfg9s=; 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=bVfl+pEofNkRp5cpO/t9MJ/5ToRq8TZez18okwL2nzyimlBlWKWNTtEdg6LtjmdaD izQMXPbBnntwxk0AlLKDYXd2qqCSNfQSiz/Bp/JyJuk6hqYuWuQWRknLzzGOnuzobl QYVDf7Mw+03pdRfa1Q0hSTJwnTJYBnReTW+leNhkJzKl/RD7gTEIdYMk0fkZ/50D9H FEVDFZGAgbZ+DFAfG1mCan1MBCXTjz6MMk1etACSaqqCym88Aj8ChsfS0iAzXolABl 2TQSuhwxqkaF1dPHNro8x+0I30/rMm0bxPZd52royqwbH+Qe0jAPCSVhrsBcHdZaCU E7JaP6Xpsbjlw== 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" > -----Original Message----- > From: Jiawei Zhu <17826875952@163.com> > Sent: Monday, March 1, 2021 19:20 > To: dev@dpdk.org > Cc: zhujiawei12@huawei.com; Matan Azrad ; Shahaf > Shuler ; Slava Ovsiienko ; > Jiawei Zhu <17826875952@163.com>; stable@dpdk.org > Subject: [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. Acked-by: Viacheslav Ovsiienko Thank you for the nice catch and working on the patch update. With best regards, Slava