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 417B7A0545; Wed, 21 Dec 2022 03:52:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EAE08410D3; Wed, 21 Dec 2022 03:52:27 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2072.outbound.protection.outlook.com [40.107.101.72]) by mails.dpdk.org (Postfix) with ESMTP id E7105410D3 for ; Wed, 21 Dec 2022 03:52:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H5IQHot1ffN2UNqEkd7OPZ6i6CYoQZczkkciTrnAlDv2/WTmVi+MrkNBhdVhLBn7ZnozhfKVHT8d2IXh6dKegWMkQo//TOU7jRN6PCuFq2Ny5LF15iq/DJclirUV6hD0fLJohQ4/TiRglekucRHXqX7dRyW4a0p5EIL/imIZlpLqYOWjkAC+nxzDjFKP5UjyjuPdnFAEIqZVdoXh6VIdNbKHTnMhgl29X4F5ZNZkkaslTKNINTMD/F84j0cusu3Uqh8un0d3WFoqRUPyubf8kD/vsmmaKJ6lBQ67RGX4bUydACm5Fs4ZtkD1CVLIqUqpD8Ou7yW3JW3ssvx7ai+RJw== 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=Fdym3ZqnmWE2GM5SMl3DmPm4Nt3qqZQ+NAKeSxpTLrLA1zrRJIeF0AXuol5du/9ackvZ5sWxGWyDN1dBnPpR+rDWS2Ja2uhdsuAN15vrWtGcM0ZDPm8ZNLCrwyNAQGm9Wz2CGFMqrKqncQ9C1VZksyQPmEN1ctTLSQGuh9Jws26Sij8dJHOEFdSImTzRKbFJFGxV2QplkApO+jfM9efqlqHFMn9Pi9sMC2mLm9eMtJi8YWqoh0VkqI8KoRR28mjZlN0vptth+UiQaY2vUS75py8kp1Oj1E/l/10k4NuXOOMVF2yxHn2Ly9GJG8LNukGncjbpnQRRB1Rlx8KYMiprZg== 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=l6SxMYZHunIUqs+DzOJmA80yq6LN0jQbYBTImxcX/lpMZV/g0xzjDi9Hwv7cPxEiPU4Zj7cPUffWLke6GWMdn5lsMVXzkm5KR5qPAHaACYD7IqWMgckOED4bb6tiyWSU3ouedCaZg+todjL4j0Fl0/RV1oigSfobpAmgFwjbjuU= Received: from DM5PR07CA0100.namprd07.prod.outlook.com (2603:10b6:4:ae::29) by CY8PR12MB7413.namprd12.prod.outlook.com (2603:10b6:930:5f::5) 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:52:24 +0000 Received: from DM6NAM11FT081.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::c6) by DM5PR07CA0100.outlook.office365.com (2603:10b6:4:ae::29) 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:52:23 +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 DM6NAM11FT081.mail.protection.outlook.com (10.13.172.136) 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:52:23 +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:52:21 -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:22:02 +0530 Message-ID: <20221221025202.31733-2-jesna.k.e@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221221025202.31733-1-jesna.k.e@amd.com> References: <20221221025202.31733-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: DM6NAM11FT081:EE_|CY8PR12MB7413:EE_ X-MS-Office365-Filtering-Correlation-Id: bfa6b7e1-9d6b-4301-dfa8-08dae2fe631c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7riR9928/7BM7c35hwkZFdCGTvZazuShHFXK7rXzMo49mRM5I9lxy7oqFF0yQVcBDtsHvxuhkHBOzafkEN5GaFetLjv5OFHkEDSPtx/V9VX3P65s+jh8VqyRPDBeC12YsNltCwcvUNMNKWIh2InyNRUUZaihi4Pykyc4J81Ae3YBsdlI6FucXMb8Yz2J+crKK6nDKbjtnDiU8muisXWQv2QSgpfLoAL1Rp5LHnI49qw/DK+9fWB122gzOHcHZASEIW/ntvSiDoglsURrvauYWZACZ/lArXKcrfcY7gHWXgasZKD2yM9XtRq30R20nHaqIyP9mS40NuLbJWJQtQDYl6A7c4m/gQc5UhpmsBiaSU4jZWRN76W/rzSOr9hYhEGWEAAh8koFeLE9vVoUPy2OzVMi9n0I27IaFg3o0u7T+kWCu6QT963pG/mggR6V1k/C2Sg5EYTPmX+K746q4VZvkSAI3aKQaoSSxiChej7kPZptuZ0EtcGOMVea6h24x2PJ9C+exW5+qGF4PM6M+AK0PW3Sh/lFFXzSJxAFUDVkZ5cXw2I1xSZ6kPt4r/QsXLSsceVl5hBgm/xWPd7QLCS/jN4js/mmMAyT0RFxdM1ijIm5G0I/XlrQjyU/pXtm7s1AqlwPfjdta+Na8BMH9F5U2Xo0bAfPRF61wEqKRrNw7udTyxXEuEV1lo1C7+yb8+ypH03h+PPf4Sh+DQQ2EpqrE7TzfNz9loFo3pBVoOj5uoQ= 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)(39860400002)(396003)(376002)(136003)(451199015)(36840700001)(40470700004)(46966006)(6666004)(26005)(4326008)(186003)(36756003)(103116003)(5660300002)(70206006)(426003)(70586007)(8676002)(82310400005)(86362001)(7696005)(41300700001)(83380400001)(316002)(16526019)(36860700001)(54906003)(40460700003)(6916009)(478600001)(356005)(1076003)(82740400003)(2906002)(47076005)(40480700001)(81166007)(2616005)(8936002)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 02:52:23.7972 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfa6b7e1-9d6b-4301-dfa8-08dae2fe631c 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: DM6NAM11FT081.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7413 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