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 01E25A0032; Thu, 1 Sep 2022 10:08:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F18F427F9; Thu, 1 Sep 2022 10:08:43 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2082.outbound.protection.outlook.com [40.107.220.82]) by mails.dpdk.org (Postfix) with ESMTP id B152140395 for ; Thu, 1 Sep 2022 07:34:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W6d/TU1qMKCA0Rn31pUmeX5Tcu1+8HIwxPxQwOyV42yy9Ar6zXeczstLBtrrMVYdVjz00NXHA1K53/eJ+PbmrYOWqSrnEOzXcRgDbrTX2kSrD/qlPq6mur9rGS8SuQU+ndDt0I7oyttGuwWGt3w1OI13sDXKarPT4LHZuFvxbKNo72LkY++WoeFO+EvUHTHmfhCru8F6Zxm8UpiZjkF1IRkxvWWaE+zCrKpScVkNkNk/nplBnQYml+zrcDW8coV8wI3FOcBtjn56xfB/djcO6MmbfG0Hi1pkzELxWc/a8MfEWPHF7AGyXbTJMQSDWGYAH+Q5fJEkGpAkm1SlRkwSiA== 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=1aSeAtxM5qq6Rcw7eiMooF/7yLFWHv0u1ZbU6TLH+A0=; b=iRxENrB9gU+byJFCmfFJ2i6V3O9U/NdmCXB7/OGJgsXcLgCOWG4DcLy6RcQDvTzf4yIOpu1c32TRaTfZ54Z7JRvSDDw4fu7TFb1xJ0gsbWp4dswR8Siaqpu3hN5YDpAJyr9YD/IvBongt+DbbU9uUAYCjOlmM0e0aW0E5vWRHEvz34fhX5fJIMh3ESRh9gHZHxihQ7IcKPkiTH7jL7fPzwRLOFpXBVXR1OvW0qQ/H32t5B+IgoF0oAv8wkkKodP/llePDOij7eqbNKXGqg/JYGKco1UMe2NDuObg2g3PzwqaUTR6xMAcYFddAZnjxn2UbXq/mIvVDX3w3sYG64slFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=1aSeAtxM5qq6Rcw7eiMooF/7yLFWHv0u1ZbU6TLH+A0=; b=2kniTUJS/ynHLM1gVKmh2ei0sZUKdnDggh/8hyc06/ejDwlS/JxbCDmnNalSxnJGZY/isZZz2xaKEJx3CFUhJfm2g/zvvAtw3gRAVO0cSqYJ4KF4t91ofzI8qIg1GrDutLQY+R8rN8uuYWBk7qA7V1Kvbdog2bMBYty5lwSUnmI= Received: from DM5PR07CA0099.namprd07.prod.outlook.com (2603:10b6:4:ae::28) by BN9PR12MB5116.namprd12.prod.outlook.com (2603:10b6:408:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.11; Thu, 1 Sep 2022 05:34:14 +0000 Received: from DM6NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::bd) by DM5PR07CA0099.outlook.office365.com (2603:10b6:4:ae::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.13 via Frontend Transport; Thu, 1 Sep 2022 05:34:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT030.mail.protection.outlook.com (10.13.172.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5588.10 via Frontend Transport; Thu, 1 Sep 2022 05:34:13 +0000 Received: from cae-Selwin.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 1 Sep 2022 00:34:08 -0500 From: Bhagyada Modali To: , CC: , Bhagyada Modali Subject: [PATCH 1/4] net/axgbe: fix scattered Rx function Date: Thu, 1 Sep 2022 01:33:08 -0400 Message-ID: <20220901053311.92964-1-bhagyada.modali@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4eaaeed-c7fa-44d4-50e2-08da8bdb9aad X-MS-TrafficTypeDiagnostic: BN9PR12MB5116:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n1ZVSZOEtUZPZ6ga9xwGaY/Gh8sLgRXsjbX6rAGxbiOjTUXsPi+pWNo8W1oAzVLc/ayuUtpy07zh4LfwwJNlSR2kZKH/IUJ7nLumqvusegNG1JcJPhp4WoQ+wnlUgQTJ+2BTyo2kqlF0QBXcHG2ZNX0BigsWwRNQvoz9b8nhT5csx4XS8DxFpj4k83/vWCa3Uk4bGshgKEnms/q+D/gMBWMZF+K379Exm0A+x+0cJOizcrZnJ1hP/2p0q344qEXgkPHaXaYmE7lK2jN7A7wRsY0/vqQOrB1YaRZL1amCTFinVF6JyVRaMQ36p2YV82VJA9t2Vh/or6e0nK90RBVmAXc5AbcGhnMbx6v7/HACP5d9fV/uzdRmpfdl8xlVwg8nbcSbMN2g2nfSfYH0jKYQcPx3/AcDFKrlE5ROYIrJLDF4L75BI8snph3nXB5dtjmEoucd8EWcu8VLV1Tyh1xx06DqDQJBs6Qsiyp0iBhzyiogjtoXLgfK3hRQjVpgeNASYhoYXWr7D9y5kDDCt2nXZsQ/5pvxrrdwa9EOy9v3jWEKgF5k/oKEINLPcAdaPKh9s2LdzjuMFsHwQNI2xTy553vD2bjAeRv95QLYyPFb4jrwL1W2tzLacoT0CYfVTkWY5rdgRyHenOZez7Qs9MiPJ3YoYtsqzpWRR5kcLW0dQuJ4XdKg2ARLmy8u3AHRlwhiWm5btMSRR0lHQ/OatNOYvG0bIzTeW8DUyDIdHAQ7SvHcRDfmf1qES/nyy/gQ4QwQrFC/QfZg6gHyC5QdHhOMd7UUm6qphA1n5A3fcr4ofQIiCVkYDuDS7GlWkEWpNMHR X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(136003)(376002)(346002)(396003)(40470700004)(46966006)(36840700001)(2616005)(86362001)(186003)(40460700003)(426003)(47076005)(81166007)(336012)(1076003)(44832011)(41300700001)(5660300002)(8936002)(16526019)(7696005)(356005)(2906002)(26005)(36860700001)(40480700001)(82740400003)(83380400001)(82310400005)(54906003)(36756003)(70206006)(478600001)(70586007)(6636002)(8676002)(4326008)(110136005)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 05:34:13.4401 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4eaaeed-c7fa-44d4-50e2-08da8bdb9aad X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5116 X-Mailman-Approved-At: Thu, 01 Sep 2022 10:08:40 +0200 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 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") Signed-off-by: Bhagyada Modali --- drivers/net/axgbe/axgbe_rxtx.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index f38bb64fab..6909d3a852 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -381,19 +381,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, } mbuf = rxq->sw_ring[idx]; - /* Check for any errors and free mbuf*/ - err = AXGMAC_GET_BITS_LE(desc->write.desc3, - RX_NORMAL_DESC3, ES); - error_status = 0; - if (unlikely(err)) { - error_status = desc->write.desc3 & AXGBE_ERR_STATUS; - if ((error_status != AXGBE_L3_CSUM_ERR) - && (error_status != AXGBE_L4_CSUM_ERR)) { - rxq->errors++; - rte_pktmbuf_free(mbuf); - goto err_set; - } - } rte_prefetch1(rte_pktmbuf_mtod(mbuf, void *)); if (!AXGMAC_GET_BITS_LE(desc->write.desc3, @@ -406,6 +393,25 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, pkt_len = AXGMAC_GET_BITS_LE(desc->write.desc3, RX_NORMAL_DESC3, PL); data_len = pkt_len - rxq->crc_len; + /* Check for any errors and free mbuf*/ + err = AXGMAC_GET_BITS_LE(desc->write.desc3, + RX_NORMAL_DESC3, ES); + error_status = 0; + if (unlikely(err)) { + error_status = desc->write.desc3 & + AXGBE_ERR_STATUS; + if ((error_status != AXGBE_L3_CSUM_ERR) && + (error_status != + AXGBE_L4_CSUM_ERR)) { + rxq->errors++; + rte_pktmbuf_free(mbuf); + rte_pktmbuf_free(first_seg); + first_seg = NULL; + eop = 0; + goto err_set; + } + } + } if (first_seg != NULL) { -- 2.25.1