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 82F0FA0545; Wed, 21 Dec 2022 03:36:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 760B64113F; Wed, 21 Dec 2022 03:36:28 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2076.outbound.protection.outlook.com [40.107.94.76]) by mails.dpdk.org (Postfix) with ESMTP id EB64140684 for ; Wed, 21 Dec 2022 03:36:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PzV1ZB6Iy00cykNMj99a/cAaTxhVmNSRu9ws0xGvj58C2I9PJjIsmnJ9IyECeoDHtsegOFq1KqYlFJT8zJ4Fh2xbXiR5R7VMRATux5iXlVVZRLas1BRVDO0nIpOQAGU4TbzZPaFihmc/aBSZQzMwIMCxeSlrhTYBZqMOfx+qkBCsId70UrpN7cJrxElK3bWIpbwWayqaAiS0iIF52rFHimJPdC8ujp938PGd5rN5TxUqmxyCF5WVcSkVNOnanr8uBBddJAVtjoIo6J0NUtf5Sjw+abgBOnY5AAKG2N33a/xA9eA8t0RejXpiL/HXs55KjH0vE/9BN0tjS6SuYjtjFg== 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=OaAz0yMctBiM/lxjyt5m/7mVRTycVLyLUpUIEcjjdpI=; b=WNlqniOojA/y0Z5zW20OBamkzo/AHuU5+LWawDcoXnoh/Sui0/thL3MgBxMLYS1waKA5eVDkhByXRDGlcPewmgianfKon8UOdbqDfsLCyWwW9aRginFKzVPklMSnJC1MgWvB6+b46tAtWDcxBhQKYmf944PJy7iwaseRtTI9FQ/b9amk5YLbTAbv+y/Ap7SXgkSdSmmgM8Ox5DG5gEYfJo36EP3Xy8jAkwLfmLNKrllRqPladcVriFZIwykad0VlnR32RbpIZSPcKKEFht+Cs40mlbEEVgruxHwhG3VqMr4Di8fJPzUggKjeU9eLV76OjX5GBMePI9V2aitJaKgJTw== 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=OaAz0yMctBiM/lxjyt5m/7mVRTycVLyLUpUIEcjjdpI=; b=ONcRnLGHmaXPDzDEG5a3twIHB9yx/mj3H4sKPRAXvzMiiGKJmXcKzp7CG1rZPxgg9amOGrYUwQU8+duFBnZbqdJA874VLoXhbV45HXRZLlo6bVTpysBNJyaTFl1e8Q5NGA5HkvFQzFw2o/K20hf6kqN+/hjF+FOdMXs+P/3Dh70= Received: from BN9PR03CA0580.namprd03.prod.outlook.com (2603:10b6:408:10d::15) by CH2PR12MB4133.namprd12.prod.outlook.com (2603:10b6:610:7a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Wed, 21 Dec 2022 02:36:24 +0000 Received: from BL02EPF0000EE3F.namprd05.prod.outlook.com (2603:10b6:408:10d:cafe::c7) by BN9PR03CA0580.outlook.office365.com (2603:10b6:408:10d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.21 via Frontend Transport; Wed, 21 Dec 2022 02:36:24 +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 BL02EPF0000EE3F.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5944.10 via Frontend Transport; Wed, 21 Dec 2022 02:36:24 +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; Tue, 20 Dec 2022 20:36:22 -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, 21 Dec 2022 08:05:35 +0530 Message-ID: <20221221023535.30547-2-jesna.k.e@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221221023535.30547-1-jesna.k.e@amd.com> References: <20221221023535.30547-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: BL02EPF0000EE3F:EE_|CH2PR12MB4133:EE_ X-MS-Office365-Filtering-Correlation-Id: c00a52de-dc51-4bf1-a7ac-08dae2fc2739 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l6Z1kY1ElLWIXeAW5AEvGYJ7nqz/gq2UG5OdCjdkmAJI0+A5jl6DXUuLWUIqNYgf+YDSRW1oyNCr/OrEjSjeLlAXEOWMqZBD8zSEnRp89hJIlhiABeO0JYhYG3NLlwaAUENw1BFlZubWEDBkhxc+xAtOoxcUbtBfsmEUHLU8VFvZXT9zMybqrw/Yw79ev3j4iSSmEwOv1Dw63FxZpUYHYHHGrUPmTiBgUJ8UREGNhQt5ffAx+srWNRrSH4c7Syc2VZtV0yLZGC48mBxVuAg7lcjQNVBT6HhRX0yy3oa2GGny4IicEKmMjLQCWcGSU2mI8X5WCLSd1BnAzbJFvNUret3RW5nQI4TrtZY4D7axsav3dFeepgDzixtI+aZs9hZUs4dSKusiUoFUsgUnRj6ClRcT7CJ2JHteDP+YC1chHRQ35D9gwzXwWBVeTxvvkj++fhJhTS5VijXGKPPR5LBcldSOkJ+lLNr7W4ahyolanGhnhTwcYbkl5D49eUNciHsamap6VFGqpkHrTaYRrIKxMvMFwpP1w6TYFh+lYmzhBc8jKF+OgP/s/5+NvIG6IcyfmkRT1ZpyVMhNUFTjxSprAFeiDHpR1qCxk+R+4UryfdUUqPrVNsZs4H96WTDsUhsDlZ0saf+jD7rO2EGkITvrXGF02YyvJLEVLu1Qp/LXcMB2kd/X3DtJG5WuntpSMEZwYd65AxIowkp3KGSjjYJyzMqQo3MuuV5ACHMJWAR7FOE= 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)(346002)(136003)(376002)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(478600001)(7696005)(36756003)(16526019)(186003)(2906002)(40480700001)(336012)(26005)(40460700003)(81166007)(82310400005)(8676002)(1076003)(4326008)(70206006)(47076005)(70586007)(5660300002)(426003)(356005)(41300700001)(6916009)(83380400001)(316002)(8936002)(103116003)(54906003)(36860700001)(86362001)(2616005)(82740400003)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 02:36:24.3603 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c00a52de-dc51-4bf1-a7ac-08dae2fc2739 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: BL02EPF0000EE3F.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4133 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 d5660f5c4b..56e7c7aadd 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