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 97F46A0548; Thu, 8 Sep 2022 05:32:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8BD8D410FB; Thu, 8 Sep 2022 05:32:31 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2063.outbound.protection.outlook.com [40.107.93.63]) by mails.dpdk.org (Postfix) with ESMTP id 8653640697; Thu, 8 Sep 2022 05:32:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XWlVSqbhBtGXIHMJZNyWz7ONVe+ZCKWIaNNvLGSd9CwXZt/w/RuIQJOiq9K7u34yF8YxTGzDpYklGcJSik+yqnweQUGvbwTgTspuVokH+wiYgjsyNJmxQUQIR2rITYKs8hWfEgca2whwDEAF+yTwaaPR4+YnQSQAyJ3w2d0IGi9L/rIUx4MqLw+3zBeCGxVZ3N9Ho5XR7h497bQdHAuGwVUGoMousQ9ncUlkPkZ93kmdHEEcwHUBVPb+W14J1BT40Zf4SagudRjft9bOfr8VCtTZKq1eWQ0tHDvbtJL3tab1/Wg83/4+uVLA1Zyi4SFbCtBTwVgmXWUZvL9t1J/Bwg== 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=r/QJestHiXj/tMnaDWnavaAmJ6OSRmjnpIw/vusd6i0=; b=VkmQ3p7W8Gbx7DgV5QwgNDEl/ScNPzueid0eWmq5gK0gSMny3JO+cYUs90W1mv32bSXfzzzEbJaJyiWaCttLkInfiuxELuELbLjwMbiIghF1CCzOryv91oo3Z5EtWoxwaox2fxSmK5fkmJhFdyhbfsDnutmDprWlAVqreD0vjePHrgjdyhvQ98yOU57yozOSWGVna7b9L393wbe/bktagAnzjjEvNxLppjDpm39e+P3C5t6EcPgvpPST/fLsTLciMr0wPgy1Ld6EXiLYf/SIVpm88dhm5PXFUNB09xPCHgRcB9oi23806mkyILGSReKv2l9MJ3jZ16P3wULBbbsrfA== 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=r/QJestHiXj/tMnaDWnavaAmJ6OSRmjnpIw/vusd6i0=; b=H1hGKScmlTn5Hlpi/z/4bFJDqHF0pH7lOnVW39qz8oOKDiUb6IiUpzmoAlyAElWfPzxBYkGFEPIi12uxQCNyzXv5bMeaTh38LcMk8ZYC3uZUgVZ0w+9H8IpDe8YT8wOoDKrdrDICsijG7qIwWI/tLQRLdTsFqnmH93lJpBOvS34= Received: from MW4PR03CA0293.namprd03.prod.outlook.com (2603:10b6:303:b5::28) by MW4PR12MB7143.namprd12.prod.outlook.com (2603:10b6:303:222::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Thu, 8 Sep 2022 03:32:25 +0000 Received: from CO1NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b5:cafe::f8) by MW4PR03CA0293.outlook.office365.com (2603:10b6:303:b5::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12 via Frontend Transport; Thu, 8 Sep 2022 03:32:25 +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 CO1NAM11FT010.mail.protection.outlook.com (10.13.175.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Thu, 8 Sep 2022 03:32:24 +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; Wed, 7 Sep 2022 22:32:11 -0500 From: Bhagyada Modali To: , CC: , , Bhagyada Modali Subject: [PATCH v2 3/3] net/axgbe: save segment data in scattered Rx Date: Wed, 7 Sep 2022 23:31:09 -0400 Message-ID: <20220908033109.126547-3-bhagyada.modali@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908033109.126547-1-bhagyada.modali@amd.com> References: <20220907173326.124914-1-bhagyada.modali@amd.com> <20220908033109.126547-1-bhagyada.modali@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT010:EE_|MW4PR12MB7143:EE_ X-MS-Office365-Filtering-Correlation-Id: 2344678e-ee98-4aad-3e35-08da914abf6c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SZG2ZoSD5o5eE4Mcijnlsw/RLugsOLN4AYrwjAM5ToeUsNoXyr+mUyVSg0KxB0rWsKIplSfGA3MrKZQh29iJB4J5rSF2FmaTWya0LzZBDzRgg1dPwF2VWuXLncWly54eDXRxYxp2bx92xoqqhEtVYOmKtju6JQGAg9Ot2vIp72kX99ARC+J5qO6J72Hx8ALolEJpWqAHvrhaUBzW4RdjONdHUXCWBnI8wlGIba5PTTDBlW6+WQ7z84/lat9J6bWBUAgAG8Jv83QHZrq6skUbFXYbqWS+tvqPAp4IxiWEIn3BFhhvrjt2L/seiZWwkX0ePtzHEs7sjyaDbhMQLGntBqd0sAmX1b49G3PbE8DGX9LThcouRdKLARTZVEeFFTRDVRnHaoMCmzTuvETO0znVtfdXxMUO/0Z3q26GnZ422t6wK8Bq+cJYC/yqRbZOy6QJSn+knLW38c02gQ2NxFHr24O0WtxEfCuSRI9voSa/2j92+ipD/tA1WEcg7vAGUsEBPFFClKjgYSseO0mBJlY/dWPcw+OQ0KE3qsBMdnh7Y6YEANaYM+P7J6wPt8FESHsqod+sbeAtjFjdnBHj+0PqjBL/yeYS81KNOzrls+tt2f9aZ1cy7xQW/bcD3CH8p4flxokGpQtraIETXOmGwmbOyJdDDl6maI/eCoWJY6ETQvkXZ9/3G1abexvYRlx8stIe8HMTdXQKTQYLKl8NasWvQCMRFnqkDFJ09BLDmcNxv0AqQHLo9ZScV0Z9VpakL/WFJF8MEj5zljZBXWhAfuV5ZqPp24Tv5NlsYss9b0GUPgxqiutVpEew0A+1ef2WTDTuJ1MRmtOxUW4ATfFoWBK2kg== 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)(396003)(136003)(376002)(346002)(46966006)(40470700004)(36840700001)(54906003)(336012)(47076005)(426003)(44832011)(1076003)(26005)(186003)(40460700003)(82310400005)(7696005)(40480700001)(2616005)(5660300002)(316002)(2906002)(41300700001)(478600001)(8936002)(450100002)(110136005)(82740400003)(70586007)(6636002)(4326008)(86362001)(16526019)(36860700001)(70206006)(356005)(8676002)(81166007)(36756003)(83323001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2022 03:32:24.9621 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2344678e-ee98-4aad-3e35-08da914abf6c 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: CO1NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7143 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 Saving the current segments of the packet, when the next segment data is not ready. Fixes: 965b3127d425 ("net/axgbe: support scattered Rx") Cc: stable@dpdk.org Signed-off-by: Bhagyada Modali --- drivers/net/axgbe/axgbe_rxtx.c | 11 +++++++++++ drivers/net/axgbe/axgbe_rxtx.h | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index c1f51ed6d6..65bda2a0d3 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -416,11 +416,17 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, mbuf->data_len = data_len; mbuf->pkt_len = data_len; + if (rxq->saved_mbuf) { + first_seg = rxq->saved_mbuf; + rxq->saved_mbuf = NULL; + } + if (first_seg != NULL) { if (rte_pktmbuf_chain(first_seg, mbuf) != 0) { rte_pktmbuf_free(first_seg); first_seg = NULL; rte_pktmbuf_free(mbuf); + rxq->saved_mbuf = NULL; rxq->errors++; eop = 0; break; @@ -502,6 +508,11 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, first_seg = NULL; } + /* Check if we need to save state before leaving */ + if (first_seg != NULL && eop == 0) + rxq->saved_mbuf = first_seg; + + /* Save receive context.*/ rxq->pkts += nb_rx; diff --git a/drivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.h index 2a330339cd..2da3095547 100644 --- a/drivers/net/axgbe/axgbe_rxtx.h +++ b/drivers/net/axgbe/axgbe_rxtx.h @@ -65,6 +65,12 @@ struct axgbe_rx_queue { uint16_t crc_len; /* address of s/w rx buffers */ struct rte_mbuf **sw_ring; + + /* For segemented packets - save the current state + * of packet, if next descriptor is not ready yet + */ + struct rte_mbuf *saved_mbuf; + /* Port private data */ struct axgbe_port *pdata; /* Number of Rx descriptors in queue */ -- 2.25.1