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 5032DA054A; Wed, 7 Sep 2022 19:34:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D048E4281B; Wed, 7 Sep 2022 19:34:00 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 67178427EC; Wed, 7 Sep 2022 19:33:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VX3f8ukQuflgRbrlhlK8MNV3SgV1lY4n6rfgDY+XpNHBOPoRwb9z06Cs6xmvAp95fTAGyC4qNiro65FyAEE0zXyvAjiWlgWphNXdLiHgXBtOeuVhel9UMPsHIzKF0j2gLpVayofd01qLQa6psfmr3PC41cPxjq45cRLVm9P2Gafa+s5pady4KFRETa2wE8RLb3mCS504XKQLzCinutNoPoERltoIz1U+TYIvnYr+1djQTR+evUAKOsUMSAu5HOhyXFQ7awpej/QlC9VVzJGydGruaMLVtKOfXv1NB9Yn3qJFo5fw40vf7tjn3vXbNKM8jk6rJ2WSWS4OTqnNVNYeFQ== 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=7moRDmcPCgvev1Dz6nSR8K1Jt7pDBb1hgmVgXV0hkVg=; b=SmclTZ7Su0+9hvqgRpLsH1Hlljl3TLLfetsLi8afCAPVgQ2a3E40h0xjdXaDEhqjRr8tYpVkJPJZ0Nxb5aFoIF4Tq/vyr05SUuy5DrwItbVuuXrORO7J6qNeygk1e86iY2LXTtKNjAcjSNaB5J5pZaETOWhjnYa6DnkzUG6Xj4C7lF9A/WehRKPLaTqIqibYnYo/jFwYVjs0sJkU8LyZh/0gUCssnWpEixXeTmvYtmh5KG1PmtrALuHqQIAXDximxcvWCcQFl4+6zTDnd0MG32bYYoGwgMZ1T2yl1CGidFRG7ZOo2zqJafOKb5nNpV76mHwv0FNt2VHLuyaKFMan7Q== 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=7moRDmcPCgvev1Dz6nSR8K1Jt7pDBb1hgmVgXV0hkVg=; b=J/5qX8CCWY6EoZyHcrCXOc/X8x9tSCEL98C72YxFQc2X1KKzvESog4A2UQK+ngIab/KQk3lJnMUAPw4gPdOO7ZvVuH1NmulTVHpI8YsJ77DG2YL38HAgBHjh8mtIZgZN05PjRz6z9yLazcccr2Uy7tvWYe2V4yMEh5w9qED8yxI= Received: from BN7PR06CA0051.namprd06.prod.outlook.com (2603:10b6:408:34::28) by SJ1PR12MB6292.namprd12.prod.outlook.com (2603:10b6:a03:455::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.12; Wed, 7 Sep 2022 17:33:57 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:34:cafe::c) by BN7PR06CA0051.outlook.office365.com (2603:10b6:408:34::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Wed, 7 Sep 2022 17:33:56 +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 BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5612.13 via Frontend Transport; Wed, 7 Sep 2022 17:33:56 +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 12:33:53 -0500 From: Bhagyada Modali To: , CC: , , Bhagyada Modali Subject: [PATCH 3/3] net/axgbe: save segment data in scattered Rx Date: Wed, 7 Sep 2022 13:33:26 -0400 Message-ID: <20220907173326.124914-3-bhagyada.modali@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220907173326.124914-1-bhagyada.modali@amd.com> References: <20220907173326.124914-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT059:EE_|SJ1PR12MB6292:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e097963-667e-44f8-50ec-08da90f72467 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NQKeIZtVSWvExCIp0gEaI1h7jeTuxltKp6nekuDkfEuMbhabK0ojgVfhL2gPMdV9Nu+u5l5Ys+aZpR64CNYrlP8W7FSiDYuVJkibJODbf3HsiJOnNWaijwKbDwecdBl7/P0gWj4b9TfA6kfpeaqr73q5nGbiARKxyqufGQeEE7vPx0PGT8hjazuryvvAadLuDxtmmrObV7kvOcPE5XLMoR8OoEonXB55haiOGyJ2KzkL/NTspMTpenwItQCvlGtx+P6RKzcky9LE+U/03RQo27+JnoPW7VkzXnb0PkhMmCifJB3Zx7ZRvpECnHZCC3eyVvJLIAbbACjxKtfWnmzWawXrttDFuBH2i9iscMh116yX4wbNuoUZ8e39TPHEnN/leGFfY0zk2KmgxMcVDwJYyICEuol3r1paG2jHb3lexTBIlKOkF6CZeOdjZnqDqvgB8jLR4QMY7EfFtygFeP/Szkia6Rac5Qctz4JRTT1JprckmQjS0l28oTE3jc5D0NHZlrsDq80f9ZkyWDbLA24K/hX/vZQ613UycD7Fw5fN/bP2W1H3As0AdDKTDyIUtJok6jO+Lzrp4KKk6BD5xVKSYbe749fRiOVeqovk9Iypi5ljRituT9jRF0ToW0VRG3gAP+gOtXsIOB9PO1X7+crb/bSQ4Q6Dm3E3xtc3HpaKlN/tFuvXUsXoOa7GmyhTI+zqUeWh34iY7EMx4jZCDnOKMGfNGp+OVhXhmvW+0awAiHViKwc5NFu1azH4X0H75XwN51l82PwDpC3O4Bbyn8D5Y1JbCW7nvInqrcN6hqM40Ky5qa8pzpfUXWP4/+GCUlGp/v9ycb1at0/XwOdU8w5kyQ== 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)(136003)(376002)(396003)(39860400002)(346002)(40470700004)(46966006)(36840700001)(450100002)(54906003)(6636002)(316002)(110136005)(8676002)(5660300002)(36860700001)(44832011)(2906002)(4326008)(8936002)(70206006)(70586007)(36756003)(16526019)(478600001)(40480700001)(41300700001)(336012)(426003)(2616005)(186003)(82310400005)(1076003)(86362001)(81166007)(356005)(40460700003)(82740400003)(7696005)(6666004)(47076005)(26005)(83323001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2022 17:33:56.7481 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e097963-667e-44f8-50ec-08da90f72467 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: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6292 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 Save the segments of the packet, when the next descriptor 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