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 5EB9CA054F for ; Wed, 24 Feb 2021 14:20:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4EAAA1608CF; Wed, 24 Feb 2021 14:20:26 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by mails.dpdk.org (Postfix) with ESMTP id 6887F4069B; Wed, 24 Feb 2021 14:20:23 +0100 (CET) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 24 Feb 2021 05:20:22 -0800 Received: from HQMAIL107.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 24 Feb 2021 05:20:22 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 24 Feb 2021 05:20:22 -0800 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 24 Feb 2021 13:20:21 +0000 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 24 Feb 2021 13:20:18 +0000 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.57) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 24 Feb 2021 13:20:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NxIaGWZ4nf2OfE020875MPxABr7523jAnOkvpb3MJWfNdfSayvMn7Lvy/mVo08pdaNMQhXgdXQWP8Wm0wOZm61tBih6sjl0v5qN+0IikAjZNEL92JEaC45NVMi6Y/+RbMoxscfl5RbYcNPaep1NmBI1Vtqo6aZCCMfwLCI1mwAJdTQZWCosScZypUYsVX+nkT9odFRiJB+LHaS6UeeGKVR9vMvS59tSuhkes7sfWDZGC3jneAChCc04H94y0f7MhPTEzS9fhf4VvOEa4yzqQeSTEm03Ps+jnjf9uR3T+eDxNZx4St+QeTnrZjCJCe3J93rwHFKyTZdxYXJhfS5IPoQ== 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=M8I8QBkzWjjriwPhGxnMjP+149v6SRR8ynp3f1593/Q=; b=IkbX4H3OVHpHXzeaT3WO2iWDR5ckSvhS1yK0BYLQ3pOKmc6lJ8BU1SCkzNVaT36TeXVSNzIyACb9dvpJNq8lDYOCOs6/EAdg7aZ9ovacEjKQuHCGWuzlA4wtDlzrbrNbfa62caw8OkK2lTRNHJvffxxhZJAlDLyhJRXb7ILB41pIDPWrEK+kG/YFS0MOwRCATlC6ShDU7Q5NOgE3ftHmwNvEY7zjnrodvC6YEhvSPLrjVCBhBN6zgqevgP2fpxKIRlPCaljgKWmCboUoRgY2l3Jg60r4hi26ESaIsMV6e3OlZ2XMBl2PNssNeNq5qy6HG167YfFHe4LL9MMVEwnBbA== 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 DM5PR12MB1626.namprd12.prod.outlook.com (2603:10b6:4:d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Wed, 24 Feb 2021 13:20:15 +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.3868.033; Wed, 24 Feb 2021 13:20:15 +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] net/mlx5: fix wrong segmented packet in Rx Thread-Index: AQHXA5IYghNihb7APUCk7P5jniZ2oKpnVjDA Date: Wed, 24 Feb 2021 13:20:14 +0000 Message-ID: References: <1613384114-17855-1-git-send-email-17826875952@163.com> In-Reply-To: <1613384114-17855-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: 24067ea8-974a-46a8-f344-08d8d8c6ec30 x-ms-traffictypediagnostic: DM5PR12MB1626: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-header: ProcessedBy-CMR-outbound x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VDoHN+3gOlkyg17JErW/kWIA1bBf9gC0vucRgqWYmqm+FghfwNzZFgKp81Ijs4FC3icVAJfE8QkzgSsOWAF1eZFqwWRnkRfYQh4YPgqb9quEsRkKbMs4yXHm3RFFq1Tdxms/1urb/b88Za5PUTFYuFss0K85VFIFGYBIDlf83GtyltudmL27WPBscuUYyWuzJyFwyDxcA/UQrgJWv+r1rUQcmm+fZvBOSmzNpRXlRoZ2lkN5Nrm+cPmRSiA7uvw/Y0+Se7NGYVJljbrkDmNQo7H0dXDUJbw6v+DGhrd7ZOlgCLYCfYOaW7wzr/B/Aqi/C7+cTYdHRC9iyHjPzoQ/AUtMUvA0jenIUwuzgee2BEviOpg0iD3XqQ0CHo5ZATR4hRnppY6Q3g2eTbKQaMQeEa2RaiX1C9ptEQZ17Jb/GQ/hdNgqNydRFHXodV5TXB5FqPg/EB2Jz4jqYCEjNKuYXsAEgzxKtfpNI3GXAtNJvTAtk+oD0r49ye6AKOMfDMAe7HgaOrOWLkBO73vZ5E0ZIVIj36k0jx8yq6G6vl35ETtp5IrWJEcy4A3JfYQBxnPST+S1fH5eOVZS//D5RQ1V/g== 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)(39860400002)(396003)(366004)(376002)(346002)(136003)(83380400001)(186003)(4326008)(53546011)(86362001)(71200400001)(110136005)(478600001)(54906003)(316002)(76116006)(9686003)(26005)(8936002)(33656002)(55016002)(66446008)(8676002)(64756008)(52536014)(2906002)(6506007)(7696005)(66556008)(5660300002)(66476007)(66946007)(83323001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?c93DkMj/9DPoln3thW7wuh9r32mqlkVqfLLaA83D/Wag/6s1IMwIQhYzO6i0?= =?us-ascii?Q?FeFG7phqqbU8BDQ1fMPcH1UYZFXJh/gx56hg5jmSZ/SXmuPEg0h7yY8AcIRa?= =?us-ascii?Q?E5OdDmyUjCPDQo+HxKHhdSiGZC421QW1QQxj73iPVfXOxqwiK+3jl/QpHVAO?= =?us-ascii?Q?02PjsmqzwFxQ1t9JaJaqlyP4yRxxtn2TAcIsScGH0KoxqfhNWL0QOIvzXRUd?= =?us-ascii?Q?f8Dv916yPqfadQUzVErBdqwgcoYz+tcokCdZ9OZQ+W8eeuqXhUfMOCTiOsze?= =?us-ascii?Q?5iEzNKPEtU8P09Xlrtbj4CDCK/YmIysHTZw2PrDBFEBtYM3lhVXvbwUbwPen?= =?us-ascii?Q?QDUi/dGncRg1pCc4kqbHhSlzVb2mNZ2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uFAGD+hkaTpMGgVN2YTlyG0S1lu2nUFn2DBvtrec/RRd3ur7JAy5d3a?= =?us-ascii?Q?BxE=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: 24067ea8-974a-46a8-f344-08d8d8c6ec30 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Feb 2021 13:20:14.9670 (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: u3/CiF2QeCoGZW6aex+zSJTNQJPZcWLm9QEMRsoCNQgAScwG4x1JTNNhp1LeMIITT+O96HDNuaupEkVXoqLLOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1626 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1614172822; bh=M8I8QBkzWjjriwPhGxnMjP+149v6SRR8ynp3f1593/Q=; 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=ogAXYT67w1QgdezZ7wwLdSIDkt8OQPd32EJirj1tS0OiVXS/cIXQehW6kFGoX23RS MKQgr2TKcvt3xMi3Zi8TILZjQhPgqfMScj4ofDUGPtFAoVnKfBKFY0+fWa1iANazTX wt3IFvp09CHgad3RulnEDru2JYE9vG+Bla5BBXJZCkG4E74w/AuZYFRhZf4S0WZccH oLW9vR89+DFg2Ytco6lO0jm/4MAL8b6tiwcIN7ep1MaHvungxt77c+5apMlC8FELrS 2BZ4lZQEyD2fvjt4scvIrRgv+Wygppxd9o3vUHIujkB7mCXgov267rHuHdHE9cc7ev uONhOS7vuKL1g== Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix wrong segmented packet in Rx X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, Jiawei Thank you for the patch, but It seems I need some clarifications. As far I understand the issue: - we are in the midst of receiving the multi-segment packet - we have some mbufs allocated and packet chain is partially built - we fail on allocation replenishing mbuf for the segment - we free all the mbuf of the built chain - exit from the rx_burtst loop - rq_ci is expected to be kept pointing to the beginning of the current stride - it is supposed on next rx_burst() invocation we'll continue Rx queue handling from the stride where we failed - on loop exit we see the code: if (unlikely((i =3D=3D 0) && ((rq_ci >> sges_n) =3D=3D rxq->rq_ci))) return 0; /* Update the consumer index. */ rxq->rq_ci =3D rq_ci >> sges_n; hence, rq_ci is always shifted by sges_n, all increments happened during failed packet processing are just discarded, it seems no fix is need= ed. Did I miss something?=20 With best regards, Slava > -----Original Message----- > From: Jiawei Zhu <17826875952@163.com> > Sent: Monday, February 15, 2021 12:15 > To: dev@dpdk.org > Cc: zhujiawei12@huawei.com; Matan Azrad ; Shahaf > Shuler ; Slava Ovsiienko ; > Jiawei Zhu <17826875952@163.com>; stable@dpdk.org > Subject: [PATCH] net/mlx5: fix wrong segmented packet in Rx >=20 > Fixed issue could occur when Mbuf starvation happens in a middle of > reception of a segmented packet. > In such a situation, after release the segments of that packet, it does n= ot align > consumer index to the next stride. > This would cause receive a wrong segmented packet. >=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> > --- > drivers/net/mlx5/mlx5_rxtx.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c = index > 2e4b87c..e3ce9fd 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.c > +++ b/drivers/net/mlx5/mlx5_rxtx.c > @@ -1480,6 +1480,9 @@ enum mlx5_txcmp_code { > rte_mbuf_raw_free(pkt); > pkt =3D rep; > } > + rq_ci >>=3D sges_n; > + ++rq_ci; > + rq_ci <<=3D sges_n; > break; > } > if (!pkt) { > -- > 1.8.3.1 >=20