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 2693442413; Thu, 19 Jan 2023 02:51:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D938E410DD; Thu, 19 Jan 2023 02:51:12 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2080.outbound.protection.outlook.com [40.107.94.80]) by mails.dpdk.org (Postfix) with ESMTP id 657704068E for ; Thu, 19 Jan 2023 02:51:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZFdFX9crkub/78V63un8gjdbqlpi76KQd4+DuzJOT6TI2eBEFeOEOwgsMG3hnjqzm0q+mZzl88YZnZiCzlQowfN4ddK5tYSRR6+BUzig8I1PmUBhSq3mi4EBLOWyme3N+gL7Gke0hJtTiZuJuKX+g7G+qT3Qzc9TarARTJlMCmWwDYoO32fQz3Oh5B1Chy05CpIDneWRVNQ/+iYzwm3u0iA2tafBaJW/3J7sddjFa/q8A1HTiSn9xZjFZyiZXMRiv94IJEQ9fxgmTMPuFTHjWz+R+2apb8uiJXYBt7Q10K0py9pl1dyK+NG1lUjqMVVS07VAMx4qEDeEzohMgBufxg== 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=pBeAeI96vwIEpKo3XSNXSDyTJ9beIcNLWrDkWCcTrV8=; b=bceDUjfJNS+ghzVlwVHpqgtGu3oHAe1zf9IH8WbwmRKp9WgxS6vv3iGVDuBtU7xJiPTDsaxgE4306FJ5MZldZ8etttAEQ1guDDsrLPyPwOfLGCPcwPcKWbwM3V5wZYd8MWzWjbIn7Z4QNYDbs6cMKrfSap8PnDWcBRoeFyaPZ7laoWOb+sgjjCPHxOgLr1e28FsM/56FwHYC+4q6+Lbwg7FOVpoe/W24jjclEABxHcqMRBCpr1lmH60FTTYYVNtkd+NC2Afrtt0Ste2Fu2/xNtXqFdpPdpW4b94v/JBqVRorHmTtFcmqZKGtpCibWGgghWSv/wYGRPAXbl3bWPJaWw== 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=pBeAeI96vwIEpKo3XSNXSDyTJ9beIcNLWrDkWCcTrV8=; b=cfxaZRzA98mCnASjU0OueWNMk8p5pt/T1s0dGn+edh1ksRM9biKMSehSeExU1cN1BWwoAks4uFsy3DXOmvlmz7YHwSCt+VaWZ6yJ96HhlR+tW3HW2GfHizYxNpCLE6ynDkA1kqfA4BBr/iWEfzKkD33LS3OiFI9jDZQ43OYIv5o= Received: from DM6PR07CA0115.namprd07.prod.outlook.com (2603:10b6:5:330::6) by CY5PR12MB6407.namprd12.prod.outlook.com (2603:10b6:930:3c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Thu, 19 Jan 2023 01:51:09 +0000 Received: from DM6NAM11FT073.eop-nam11.prod.protection.outlook.com (2603:10b6:5:330:cafe::50) by DM6PR07CA0115.outlook.office365.com (2603:10b6:5:330::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Thu, 19 Jan 2023 01:51:09 +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 DM6NAM11FT073.mail.protection.outlook.com (10.13.173.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.24 via Frontend Transport; Thu, 19 Jan 2023 01:51:08 +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, 18 Jan 2023 19:51:06 -0600 From: Jesna K E To: CC: , , Jesna K E Subject: [PATCH v2] net/axgbe: move offloads to Rx/Tx queue setup Date: Thu, 19 Jan 2023 07:20:49 +0530 Message-ID: <20230119015049.114687-1-jesna.k.e@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: 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: DM6NAM11FT073:EE_|CY5PR12MB6407:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ef3d2a1-1680-4f65-36e8-08daf9bfa284 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aFPPxsLg2pdMDup7EYhI00Ks/8hG3CwjdrUVvJQ7/5+GvsNZ0xIbI4kGJT12h6tFQa0PbU4m6U7vJWZZGDjZeijhwfzsyP2NyVu67ls+f4AS9mpAJpbq2zX07VMFSrly6dKqoALxgEyF9rc920n9gKK8zGmLpuIF0pFiH23FVhHuKfyBn1jr+vQbbQJAToiwoHblqbb6G5pRQriX3aom4KqQXJawPXu/oJZpq/CbrTSKNiQEEEBHQxzhg4crZ/XsgcmBd2f+ivX8I2YM0J9i9yAEEQ1YUb64yHEjVRxoqsM3+7PfyVfuPMa6yIxpNpfBZs27oQzwt5j5ySt6Uyir2I5KJnD7vuqEn2x4Jsv/sIEhdS7eRz4bS/yzF1FYFWGM6UYUTgxCyF79b1eTRyG6LnaTVaGIcXqprDUKGoPpCk5za0vx4s0cJ3a9iZuyy+d0NZJPVpTqn3ALq/YCskSGN0YByaXMzY664zTVFhJuh5KAPjh5zr5Jx1s4+8pT60UQk90Y8hHBKJPULFoUMtLFR4GrZydGDV28eSIHKhQv2y+zbNPWyrysKI0y433t1gUTpVXSjZkeiKeB97H8MNq2Rixx8aqILfK02NJ/9w9A4Ng7BWsI0zDT+b2yjMOb6mQn0fn4K9bbbUWQSV/luyOxw1jQY+e62aeF3562YLwcjAl73EoyhyhEeKQBO27nntKYgauLAOg2bG02RaHxCoNYc7bnf+pc/Q69ABhyqANRklM= 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)(39860400002)(346002)(136003)(451199015)(40470700004)(46966006)(36840700001)(36756003)(8676002)(356005)(86362001)(70586007)(4326008)(6916009)(70206006)(5660300002)(8936002)(2906002)(83380400001)(81166007)(36860700001)(82740400003)(103116003)(316002)(478600001)(7696005)(54906003)(40460700003)(6666004)(47076005)(82310400005)(41300700001)(2616005)(186003)(1076003)(426003)(26005)(336012)(16526019)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 01:51:08.6208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ef3d2a1-1680-4f65-36e8-08daf9bfa284 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: DM6NAM11FT073.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6407 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 need to retrieve the offload parameter from the Device data directly that is shared between primary and secondary processes rather than accessing from Port private data (pdata) since this is not shared between primary and secondary process . Signed-off-by: Jesna K E --- drivers/net/axgbe/axgbe_rxtx.c | 12 +++++------- drivers/net/axgbe/axgbe_rxtx.h | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 9b283bd9d0..625a92109b 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 @@ -578,7 +575,7 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, return -ENOMEM; txq->pdata = pdata; offloads = tx_conf->offloads | - txq->pdata->eth_dev->data->dev_conf.txmode.offloads; + dev->data->dev_conf.txmode.offloads; txq->nb_desc = tx_desc; txq->free_thresh = tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh : AXGBE_TX_FREE_THRESH; @@ -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 1dceb76606..a218bf0f47 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