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 5C2B1A00C2; Wed, 4 Jan 2023 08:43:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1BE142B8E; Wed, 4 Jan 2023 08:43:08 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2066.outbound.protection.outlook.com [40.107.93.66]) by mails.dpdk.org (Postfix) with ESMTP id 7F878410EA for ; Wed, 4 Jan 2023 08:43:07 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VaDWzACDqGPBOSOT9jIRCHXu6FjXcRHcmnRdId82zCBR4QwIx2nIu+wWhJ/QXTavtQCzPfo2c0ckmgPhPjuyZP+jnok30/9ckP5lkImgmPK7DULsZzV3wKdil6ZGX730eiBDH7NyK42qPQjtKFR2mO74WlehZ9EtivVsSdziJBqy2jXP9ORUcMLaYdQ2v5NyDEuvM3Xw/2HJzs0wLQJBd2aoJWnSI3ZjF87U4/mFJiYEtXQijBCF/zaxkfUszLkqr/4EySRdIhNr73uBZN9DW9rJhazbwsy/vBmMGVWBKcJJXtVZ6RK36FfoZOrWmhNB5qSSA7DRbuVb4PExv8dhhg== 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=8lq5e1mwZrQu8+dnDAao62beoX9J5L5smFURO/iFLmo=; b=J6mnJNBHPRXNUBb6rYLd8lHDgbysxzdHChNjVMZvaSKgGyDI2+E+nFIZXd8ocQcGQsfamUOT8G8oKCT4paqdpM8OgZKnebhWDxib7h2385bouAiBmrmF29WmKi+wtabRV0HDtPeNddIlybtqq5KCoUkUXZLIvcWfXMet1hUEoxY4Lflvo+lRwYqHMlOziFD1YTuHm1hvb/QTKQvowq39YTvdvk2k83Skpk8yMY9ALFH5a5wubUoWGZpT8/1Nl4hvQztzP+NZJQTa5da9UsfZMDHQOCZEpDa27emmkllSRuVGFV7dwFTeJ1k9rj23mkVeC+71OCs72XS8NR84rosJqQ== 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=8lq5e1mwZrQu8+dnDAao62beoX9J5L5smFURO/iFLmo=; b=cCLn7KqyX8KDeBc/jNT3bU0/A+1y6prYe2KwjlTev4sU7h4FhDedeWYvFerYHj5poNEeGtDUTp0CMuauaC5kINyvA/ovMVXmMn9Y51GM1/feT60dR6HV164/SHWopj5SGLs/B3JGr5uBBxgNcLj3wZmhpGek466GoJWa6pZwIK4= Received: from DM6PR04CA0017.namprd04.prod.outlook.com (2603:10b6:5:334::22) by CH2PR12MB4264.namprd12.prod.outlook.com (2603:10b6:610:a4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Wed, 4 Jan 2023 07:43:04 +0000 Received: from DM6NAM11FT069.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::40) by DM6PR04CA0017.outlook.office365.com (2603:10b6:5:334::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5966.19 via Frontend Transport; Wed, 4 Jan 2023 07:43:04 +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 DM6NAM11FT069.mail.protection.outlook.com (10.13.173.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5966.17 via Frontend Transport; Wed, 4 Jan 2023 07:43:04 +0000 Received: from cae-Bilby-RV1.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.34; Wed, 4 Jan 2023 01:43:02 -0600 From: Jesna K E To: CC: , , Jesna K E Subject: [PATCH v1 2/2] net/axgbe: move offloads to Rx/Tx queue setup Date: Wed, 4 Jan 2023 13:12:41 +0530 Message-ID: <20230104074241.33445-2-jesna.k.e@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104074241.33445-1-jesna.k.e@amd.com> References: <20230104074241.33445-1-jesna.k.e@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: DM6NAM11FT069:EE_|CH2PR12MB4264:EE_ X-MS-Office365-Filtering-Correlation-Id: 27857689-7f2f-4e98-abdd-08daee27507c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tbQNDRQOPqS/wLVBa2kHxpPE66QXtl6pj6705YyGCHAINv46UgSUZKM+14lfZiusSD5c4ldDT28QTtcPnqW6uua7KXMDve3aXJE/3I5HOYfsJr+USZoKjFSJ9hIdn/545f7QeBXODLBSfc6mEShnWaZuFlfRCJZJtV0kaNjTsVjHWwlIA2ZItZHx1LOis0vZ+tFULQL3LAAFbD4Lv3OZiFf3+Jlke0Rm9kY7qX1kNsq8zcoa2knKx17Fq9ZuJ9sfoJvcU/YG6E5pWJJN77xcGfJ1ijw0hifw7CvFgwrorCn7gaBnE6MX10xbeaezoHHGsrCAcxygI2cNn6jG12YRoXqpDvklU09H0r5yKPfdmWo9UoXdDU9tYE3IMplsF43+Xz2vFNiUN0mfwgfUC9UC/ocpQNgC+1GlyFjJT6b7+whVm/EKKpfFUPhywmTOYlaLULjYE2f4Ae7XDySio0QCGpwL+DGNN3DcvkoEmBGh8ZDixNh4nJJSJDWAlyAplzBooBBUXS8Ev62zTtKCAgDuV9w/BwS2RkQeXWGq/1Ae017zB5yOMCYCtHeIEW04enHbdrhqaLkulel6NXZbsTM0H4nRK77UGUXg5NZXDRu4yDm4gFzXImghdzYV+AcS+jKcnm/1P9gQWrw/4JmoPNeGhyVXEgWhEBjOPIm2bgvzhzFkEvqI2mgWroyzPyuMPpbyJGmglo7KUVzydi+1oy5liuTJXwh4mCyTgpS2EobiOWg= 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:(13230022)(4636009)(376002)(396003)(136003)(39860400002)(346002)(451199015)(40470700004)(46966006)(36840700001)(81166007)(103116003)(36756003)(40460700003)(2906002)(8936002)(356005)(82740400003)(47076005)(5660300002)(36860700001)(426003)(83380400001)(86362001)(70586007)(70206006)(54906003)(7696005)(6916009)(41300700001)(82310400005)(316002)(40480700001)(186003)(478600001)(336012)(16526019)(4326008)(6666004)(26005)(1076003)(2616005)(8676002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 07:43:04.6892 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27857689-7f2f-4e98-abdd-08daee27507c 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: DM6NAM11FT069.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4264 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 For Multiprocess dpdk applications retrieving the offload parameter for receive packet directly from struct eth_dev giving segmentation fault since rxmode.offloads from eth_dev was null duirng recv_pkts. So retrieved offload from rx/tx_queue_setup() Signed-off-by: Jesna K E --- drivers/net/axgbe/axgbe_rxtx.c | 10 ++++------ drivers/net/axgbe/axgbe_rxtx.h | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 9b283bd9d0..5dc4fe7369 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -86,6 +86,7 @@ int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, if (rxq->free_thresh > rxq->nb_desc) rxq->free_thresh = rxq->nb_desc >> 3; + rxq->offloads = rx_conf->offloads | dev->data->dev_conf.rxmode.offloads; /* Allocate RX ring hardware descriptors */ size = rxq->nb_desc * sizeof(union axgbe_rx_desc); dma = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, size, 128, @@ -211,7 +212,6 @@ axgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, unsigned int err, etlt; uint32_t error_status; uint16_t idx, pidx, pkt_len; - uint64_t offloads; idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur); while (nb_rx < nb_pkts) { @@ -278,14 +278,13 @@ axgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, mbuf->hash.rss = rte_le_to_cpu_32(desc->write.desc1); etlt = AXGMAC_GET_BITS_LE(desc->write.desc3, RX_NORMAL_DESC3, ETLT); - offloads = rxq->pdata->eth_dev->data->dev_conf.rxmode.offloads; if (!err || !etlt) { if (etlt == RX_CVLAN_TAG_PRESENT) { mbuf->ol_flags |= RTE_MBUF_F_RX_VLAN; mbuf->vlan_tci = AXGMAC_GET_BITS_LE(desc->write.desc0, RX_NORMAL_DESC0, OVT); - if (offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) + if (rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) mbuf->ol_flags |= RTE_MBUF_F_RX_VLAN_STRIPPED; else mbuf->ol_flags &= ~RTE_MBUF_F_RX_VLAN_STRIPPED; @@ -345,7 +344,6 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, unsigned int err = 0, etlt; uint32_t error_status = 0; uint16_t idx, pidx, data_len = 0, pkt_len = 0; - uint64_t offloads; bool eop = 0; idx = AXGBE_GET_DESC_IDX(rxq, rxq->cur); @@ -441,14 +439,13 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, rte_le_to_cpu_32(desc->write.desc1); etlt = AXGMAC_GET_BITS_LE(desc->write.desc3, RX_NORMAL_DESC3, ETLT); - offloads = rxq->pdata->eth_dev->data->dev_conf.rxmode.offloads; if (!err || !etlt) { if (etlt == RX_CVLAN_TAG_PRESENT) { first_seg->ol_flags |= RTE_MBUF_F_RX_VLAN; first_seg->vlan_tci = AXGMAC_GET_BITS_LE(desc->write.desc0, RX_NORMAL_DESC0, OVT); - if (offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) + if (rxq->offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) first_seg->ol_flags |= RTE_MBUF_F_RX_VLAN_STRIPPED; else @@ -606,6 +603,7 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, txq->desc = tz->addr; txq->queue_id = queue_idx; txq->port_id = dev->data->port_id; + txq->offloads = offloads; txq->dma_regs = (void *)((uint8_t *)pdata->xgmac_regs + DMA_CH_BASE + (DMA_CH_INC * txq->queue_id)); txq->dma_tail_reg = (volatile uint32_t *)((uint8_t *)txq->dma_regs + diff --git a/drivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.h index a904939de3..3e38d321f2 100644 --- a/drivers/net/axgbe/axgbe_rxtx.h +++ b/drivers/net/axgbe/axgbe_rxtx.h @@ -100,7 +100,7 @@ struct axgbe_rx_queue { uint64_t rx_mbuf_alloc_failed; /* Number of mbufs allocated from pool*/ uint64_t mbuf_alloc; - + uint64_t offloads; /**< Rx offloads with RTE_ETH_RX_OFFLOAD_**/ } __rte_cache_aligned; /*Tx descriptor format */ @@ -149,7 +149,7 @@ struct axgbe_tx_queue { uint64_t pkts; uint64_t bytes; uint64_t errors; - + uint64_t offloads; /**< Tx offload flags of RTE_ETH_TX_OFFLOAD_* */ } __rte_cache_aligned; /*Queue related APIs */ -- 2.25.1