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 23156A0555 for ; Mon, 5 Sep 2022 07:01:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0ABEE40697; Mon, 5 Sep 2022 07:01:02 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2055.outbound.protection.outlook.com [40.107.93.55]) by mails.dpdk.org (Postfix) with ESMTP id 2AA50400D4; Mon, 5 Sep 2022 07:01:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l0SjQbyQvvV8rDqG+1R+8OpJ91bcWjJ8sY/y+H/9o1VptytV7XhAYqhJxKBRUN8EnSZyglcUZ7C4jUdxuG3hxHkZol7B9foyf2dPu2NW9G0bFIxEzS0HL9VcNmCdyd6ovKZ12LrxI6V9yExPzehsE6AXgG8hpRTX6W+w/f0+ZkmxQLQ0Dr7mSP/ol5EJ9z4nAZD+aeXu2RfiGWYJwMVRMhv5mlpROw+rHA4I694xmkiQtPtbZpkIKIaLnPbL6amv155aFnnYmGdC4N/VlFCPxj+mmdVeKnAPtXkESwD0Pyju+jg1N07vW2eovdK37G5WVOwfaQYMw1e3zFvdiqjqqg== 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=LNxEjLZVtup2gu1l4ZcPmDW10uU3GK1IE7IVShIlW3I=; b=NCvMVDyvTan37tpYWRJrMhz07BUge2wTcY8EjKjfm1U3MfdaaaceV/qgR4v2tzy6Z2juTstAkiigaRVE8vXBoom61TBs7JxC2Whr3/wMoWlpElqZtEtLMhVIs44pX05mAUbX1xGLTD3Wwy2MCgTp/VeKPZLw0jo+2a3jfocHDdcmCpXDPXOjYj2yoGneg3lkAmanAwtwIB2qPhqoyJq9yIGcl8aUxeInFtfgulRXyuM7xJTEbTznwSrpCAE9JYIug8YKUFS/ylG8jHG5fyfpnqo7DnxwDpDeXCZG4Wqv6sxwoYuTtznzyaPSRbzxWH/HbK9nrhqFAnzm7In5EnJKuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LNxEjLZVtup2gu1l4ZcPmDW10uU3GK1IE7IVShIlW3I=; b=1aslfGnXWtrePBeu4RzTF3Gj+bcHUSeIvQngtfiQXb5IkII/02ptKXPFj2qP4qLFEPUAmKApGDOdlOTGUOSgXDkRjy9+UAVLkPN+BflImEaAvd6AciMdzH0ekXckp3tDEcpHIIzubQpFm0B/+5M1U0uGjlcersZnqD+l8yyc240= Received: from MW2PR12MB2538.namprd12.prod.outlook.com (2603:10b6:907:5::14) by DM4PR12MB6181.namprd12.prod.outlook.com (2603:10b6:8:a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 5 Sep 2022 05:00:58 +0000 Received: from MW2PR12MB2538.namprd12.prod.outlook.com ([fe80::c57e:5ef8:1335:e1f4]) by MW2PR12MB2538.namprd12.prod.outlook.com ([fe80::c57e:5ef8:1335:e1f4%6]) with mapi id 15.20.5588.018; Mon, 5 Sep 2022 05:00:57 +0000 From: "Namburu, Chandu-babu" To: "Modali, Bhagyada" , "Yigit, Ferruh" CC: "dev@dpdk.org" , "stable@dpdk.org" Subject: RE: [PATCH v3 1/4] net/axgbe: fix scattered Rx Thread-Topic: [PATCH v3 1/4] net/axgbe: fix scattered Rx Thread-Index: AQHYvqjB7pT6h+7P+06C7DDezP3jGq3QS4nA Date: Mon, 5 Sep 2022 05:00:57 +0000 Message-ID: References: <20220901124948.97063-1-bhagyada.modali@amd.com> <20220902084754.99884-1-bhagyada.modali@amd.com> In-Reply-To: <20220902084754.99884-1-bhagyada.modali@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Enabled=true; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SetDate=2022-09-05T05:00:35Z; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Method=Privileged; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Name=Public-AIP 2.0; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ActionId=4121a258-2fa2-4e50-b846-2a175a8426a7; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ContentBits=1 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_enabled: true msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_setdate: 2022-09-05T05:00:53Z msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_method: Privileged msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_name: Public-AIP 2.0 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_actionid: 7bdfed5c-4b6e-461a-a58d-61897dfe1490 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_contentbits: 0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 874cc89d-106d-44b0-a957-08da8efb9eb2 x-ms-traffictypediagnostic: DM4PR12MB6181:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BtRIwPF6wHQbCzGj1aKm1QKzoVfXVCjl41BMADIHJh+n96L2eDG9Id1mW1K1KlE3VvMggkJQpqwHwq+trvj1RpALC6sAHMK2uQo9Owhx023/B9WphvUASLt6GN45ZxueKjlspiRU5XEBKS9gMFq1o6vFgeDfCfjowjyy43GT+yaOHPJmvtPkTc1xbcwin9fTOAo2W8rMX7AnehpvbbV/B1LjKNbrVgMSVQZdj4m5RTugXcIcCdaptEETvTA79AyZXQHR0iBAg2PbyJLB+Az3B22BdcWIx3xH8MBfnAry0ymXmSQilX7mWOczUoV5dUIq2nw7ppx8LCdOy5pVMdpFdOIStR8E1xJVDEOKRABhOKha3WI1s8Kkmb69W4q04keKv86E9GAWZQ6zDLloWsBmesLDsGG9jY6HIbgD401Okf0WYPteIZCU1eOwVWLUDVL3Ky5meB0/ISpGxmVzE9Br8EQpIuSNdKXaU8oG6Tk1VxHel8dXI9/nOaNlvNPhGPrXfTPHeKB05xUob5maZ1keYd3fmmJamI9BzZQzCFhfGld28OUa61udElT42tNpGfi/7xdZl6urGFrJF2NZzEk+Ri/WJyDuqrzTKSGL870+fuySMHUc8rUc2iJEMdiptRZ0SmWblRlzNpzEhU/RrmkZbnI0Zs780Dn2YtCdQnizUeyZ9D7plRvz7ZBOmmy1E05eTpbP30a3Q+fAjbHyzKnf/pVatM3ONU2n2zU7/CG4cmoOp3N4b7QPKUMj8jZelPz8UlRKgoLzhMk1GzidUDaDh98mEUmnnqwSMMBNEt9xnQE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB2538.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(376002)(366004)(396003)(136003)(346002)(450100002)(122000001)(38070700005)(110136005)(186003)(38100700002)(316002)(54906003)(71200400001)(76116006)(8676002)(66446008)(64756008)(4326008)(6636002)(33656002)(66476007)(66556008)(8936002)(55016003)(2906002)(41300700001)(26005)(66946007)(52536014)(478600001)(9686003)(6506007)(86362001)(53546011)(7696005)(83380400001)(5660300002)(83323001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9zzQX/1Wlhk+8bHylVZ1DhjaOtDLuvTGob42e+NG3u0s88k02DSv24ZxNBht?= =?us-ascii?Q?22xVtpVT7vyEy59VDnEhk/B3Ogxit7Brvh176/Zj7yZjhUE1ZQJfwWQ8M0UZ?= =?us-ascii?Q?VVJNBRytWqCkZ2IWN4FkS31jxTB64aL9HHyeKVE1CHofwbw8dB1rsFzkmZ9y?= =?us-ascii?Q?Mak361JYHk52ws2KcHsjj4LuI6Rxsb2Sq7BoF9gzSs2yVXfjDBudWbpJ1H5L?= =?us-ascii?Q?KH+QRKQVRlAkCbZyh4+epVgszlfo+KqYNzgkNSq6KjMgTLcqRY4rS3+rGYFn?= =?us-ascii?Q?appC3b41uI2ZXwfArlYY7ZVlKpjZTxa59kQbz/dufnS3+6w54bXTGaMG1rg7?= =?us-ascii?Q?E4koBx6vVbM40TvLFGjBoq/tI51NSoj0zFzemapox3ywvXwjvYTl+gUfMNtg?= =?us-ascii?Q?FT2xkvbT/2wQZ4bmVi08b61vMKYv0uv3dnZvaonOVV7VNOFha8xKE4pXyv6P?= =?us-ascii?Q?NFiilzsRAC3//cey3jLpyMSZJ1tO/JV271acA8yLbBmng3hiwuzeTyriOGtL?= =?us-ascii?Q?Kb5Rn6IYlgYAq8aOBIJsBpCzU8aiNRtkEDTjKL0Yqb5/ucbfIcZ1I2FY2baR?= =?us-ascii?Q?EssrzdL1IwgirI0+2hv7Ki/S6sFj7tJr5K17gwPbPik/3cZ7mWOle7NomNTa?= =?us-ascii?Q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4pFjbEjZy0Ydag2SBCIGyXkI?= =?us-ascii?Q?GAi53USxnBBwFimlLwam+NiV2iXggrJ1bculD2Uf?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR12MB2538.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 874cc89d-106d-44b0-a957-08da8efb9eb2 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Sep 2022 05:00:57.6634 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /cijEnijVoUR5NCSV+Y6jDoGmRPieeZT5eRL5A2jv8mX80Rc1wOaxN/fZcZTljKid6tFGQ76kwsqyxi+MqQ6/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6181 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 [Public] Acked-by: Chandubabu Namburu -----Original Message----- From: Modali, Bhagyada =20 Sent: Friday, September 2, 2022 2:18 PM To: Namburu, Chandu-babu ; Yigit, Ferruh Cc: dev@dpdk.org; stable@dpdk.org; Modali, Bhagyada Subject: [PATCH v3 1/4] net/axgbe: fix scattered Rx Error check needs to be done only for last segment of Jumbo packet. Freed first_seg and reset eop to 0 in error case Fixes: 965b3127d425 ("net/axgbe: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Bhagyada Modali --- v2: * removed the extra paranthesis * initialised the variables * updated the commit logs --- drivers/net/axgbe/axgbe_rxtx.c | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.= c index f38bb64fab..89ed6fd74a 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -343,8 +343,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, uint64_t old_dirty =3D rxq->dirty; struct rte_mbuf *first_seg =3D NULL; struct rte_mbuf *mbuf, *tmbuf; - unsigned int err, etlt; - uint32_t error_status; + unsigned int err =3D 0, etlt; + uint32_t error_status =3D 0; uint16_t idx, pidx, data_len =3D 0, pkt_len =3D 0; uint64_t offloads; =20 @@ -381,19 +381,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, } =20 mbuf =3D rxq->sw_ring[idx]; - /* Check for any errors and free mbuf*/ - err =3D AXGMAC_GET_BITS_LE(desc->write.desc3, - RX_NORMAL_DESC3, ES); - error_status =3D 0; - if (unlikely(err)) { - error_status =3D desc->write.desc3 & AXGBE_ERR_STATUS; - if ((error_status !=3D AXGBE_L3_CSUM_ERR) - && (error_status !=3D AXGBE_L4_CSUM_ERR)) { - rxq->errors++; - rte_pktmbuf_free(mbuf); - goto err_set; - } - } rte_prefetch1(rte_pktmbuf_mtod(mbuf, void *)); =20 if (!AXGMAC_GET_BITS_LE(desc->write.desc3, @@ -406,6 +393,24 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, pkt_len =3D AXGMAC_GET_BITS_LE(desc->write.desc3, RX_NORMAL_DESC3, PL); data_len =3D pkt_len - rxq->crc_len; + /* Check for any errors and free mbuf*/ + err =3D AXGMAC_GET_BITS_LE(desc->write.desc3, + RX_NORMAL_DESC3, ES); + error_status =3D 0; + if (unlikely(err)) { + error_status =3D desc->write.desc3 & + AXGBE_ERR_STATUS; + if (error_status !=3D AXGBE_L3_CSUM_ERR && + error_status !=3D AXGBE_L4_CSUM_ERR) { + rxq->errors++; + rte_pktmbuf_free(mbuf); + rte_pktmbuf_free(first_seg); + first_seg =3D NULL; + eop =3D 0; + goto err_set; + } + } + } =20 if (first_seg !=3D NULL) { -- 2.25.1