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 8E8E8A034C; Wed, 21 Dec 2022 17:27:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34FA640A7F; Wed, 21 Dec 2022 17:27:32 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2084.outbound.protection.outlook.com [40.107.96.84]) by mails.dpdk.org (Postfix) with ESMTP id 0406640A7A for ; Wed, 21 Dec 2022 17:27:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IlHTZjAKYC6qqG4rF7uBLKj2Tad6zr6eySIQ0Z0fLL53/33U1MVQKhXSpF6PTHcigOlsBNASzUximKUZmYHLCxXEQ9uHIYn7NGDgGX+wm7XtyVjdhK5vYzeRm+o/dnCz0WmT4k4+/O5GrI2UZzqhZWDH39ENXko1mH0wpt56GIFJ6ClU2bYlSPmErxyBIMLBAEtRONhsp3rvy6F8XieZJuDyvmwFBOynCyYrNuCLLdxlUSc8R/tbqEURq0dA24Zeduxw/e65+2LBA5tDXwG4SKmSZRXr9k2pa8FDOmLcBztXK8dUgB8fjtV8CTRoMeNSg4+H8zZJiHhOgocJyakGZg== 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=1ioP+pplUhRFw/69qWuZbpGPw87hj3UCk+/zH0yfFOM=; b=JL3Uxqhx7FYKzZWw/mW+EHZSgfY5co3ePQbaMWDk03niv6bMnDTfK+c9jBgbBeuPCsXwHKh+aSKL13kra1CLEnnvWwDTKPzVW/R0EMblsaVhW6oq7WP2hYxP3FqKZCLPI0IjdLC/rAugXB3aR4IG8SEgEs/XcUYeNT3vEy5jrS3KmGzK7D7PI5EmFVf4gYdBLjp0JzxTy35uKib525vReU0yKv8SwS9QwMwu+F5e9G1nLKWWigbQxFXaoGbBuZHPt79rZhuG4TmvVzFeIHdYY1OXgSGt7S0S3t6wrv/9QawDi6o1ROpHJYVV2ZfoYWU0vAwEvYUpHVi/xhDAoWXN2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=1ioP+pplUhRFw/69qWuZbpGPw87hj3UCk+/zH0yfFOM=; b=Cf2zwRxdplJBYJGf3/S5K8wpgTJYlVzxwMfggtxdztrFOii91w9EsZxFQKh8xHgPAq9PUc7uwVZywXVhf+UvMMnbg6JD3yvcsLa2YMkGrAMw6N1NYZqkfFDrvkoxIZgLbpHRxfmO1cGAqdEuXeCVa+Z5t8i0UenlSHj5QI8MPNU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SA0PR12MB4511.namprd12.prod.outlook.com (2603:10b6:806:95::9) 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 16:27:29 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.5924.016; Wed, 21 Dec 2022 16:27:29 +0000 Message-ID: Date: Wed, 21 Dec 2022 16:27:23 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US To: Jesna K E , dev@dpdk.org Cc: Selwin.Sebastian@amd.com References: <20221221025202.31733-1-jesna.k.e@amd.com> <20221221025202.31733-2-jesna.k.e@amd.com> From: Ferruh Yigit Subject: Re: [PATCH v1 2/2] net/axgbe: move offloads to Rx/Tx queue setup In-Reply-To: <20221221025202.31733-2-jesna.k.e@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0038.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::6) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SA0PR12MB4511:EE_ X-MS-Office365-Filtering-Correlation-Id: a756cd26-a4cd-4f22-7c89-08dae37040af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UKvBKoJwWPiBWasz3yLPE9IXTup6wvM/H/v22sUMuShWrNc/tvsVbCbEG1J0w4T9BPBVo3+3GxZnQMVw7ovBfR5qqnQv76o3e7QNw0O6t1kkWe2bpir8fS04rqiaQhYLORgIFncb9GBHChLT6Oa1n5AMvE2qNROYpQ9WdEsY0Rw4pkDhX2bEnyFLu/Es5rqhppD0JltiYKFYPRrV96LF6BZUvSfPGuGXDkAXZH2SWK5ASRaL6r+su5yL5Wos2+1MmM+71SHZxP99fWhXVmIKirQAngwT2PIS6LkBkwhEbmXe6BF+tpiJFRjMnFQMPWTjjz6ealqzmvveoFdHIm/1DEfgKZKnpV8LxixNMLe5uh4egv98rcKTnIKcbVcgfJnRBUynIar2hO696JXIJZrVai/wQ69ZUFy5qGWB7pzORNdfJuF40kb105VMZtnxCXEEDwH1+yoNwFa/UMXgp1yeMVpKJISJHuYzg8ji1WuRxxoQl2kJjHhD2vfDDh1tZH55ctKngjYj52XkeTrsTnpRmovoh9yJOrW27HaUYNx5ksfkInu7jMmAtpuU6K+zH0fS6WRzTcsfHR6+LWa5M4vHPTf6AVxWM7HZ1EgJuJ6V4HaitEj8K6duDQGmw79s/KKzHYT94bP5ZorS/YtZEldCYpQInvF1qCqu0+9op0vVlhmnR/h2zdMdk5/uqqUQHyupVKohhNfzwCNoHyGHCOK3omk6zDLyL/oyFRIgI+SUtIk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(136003)(366004)(346002)(376002)(396003)(39860400002)(451199015)(2906002)(44832011)(478600001)(38100700002)(6486002)(31686004)(316002)(8936002)(5660300002)(36756003)(31696002)(66946007)(66556008)(66476007)(86362001)(4326008)(8676002)(83380400001)(26005)(53546011)(6666004)(41300700001)(6506007)(2616005)(6512007)(186003)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Qm9RYndhdW9GMmF1T2NtdDF3N0hScVdCejFQYWRSb3g4ZU1JZEY2VVlucllD?= =?utf-8?B?RFNWaWhpT0pWWm1wN28xUk4zNWkyMUJGdzBTSXlId2lXQ0xpVXcrdlROK2xr?= =?utf-8?B?eVNITW1Mb2F4R090Q3FrYkpYSVVrYkZVaVYzeU5SOU1RK2U0ZkNLaE9sYUZT?= =?utf-8?B?NCtxSmpQV01UcGxJL1ZCYVkzSGc4Vi9TNlRhQTJBem9hd2NEcjd0UEFJbE5U?= =?utf-8?B?SDRjU2IyVXdNSzRKenlNaXJHdXRJTy9RNzBwM1F2M05EMFRZbVRYQ056Wk54?= =?utf-8?B?eXI1T0pWcVFIdlRBb1luU2VhYWx4ZmdjdTJXRnpMNHU4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XDJaTDoEqurBd?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a756cd26-a4cd-4f22-7c89-08dae37040af X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2022 16:27:28.9774 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iN5xIZxAMN7NhnOwIgPpt6ksIaBSJ+1T4b5zX/KIq1Pd5Xoa8wV24cmHYYBnYAak X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4511 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 On 12/21/2022 2:52 AM, Jesna K E wrote: > 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() > I don't see any issue to store offload values in queue_setup functions, and it can be more performant to access if from queue struct, but I am not clear why it cause segfault when it is in data path, when burst functions start to run device should be configured alredy, finding root case helps us to figure out if anything is missing, hence: Can you please give more details on why/how seg fault happens? > 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 */