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 C1ABFA0C5E; Thu, 4 Nov 2021 19:26:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B112C42771; Thu, 4 Nov 2021 19:26:52 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 69DB54276E for ; Thu, 4 Nov 2021 19:26:50 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10158"; a="295213345" X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="295213345" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2021 11:26:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="578953919" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by FMSMGA003.fm.intel.com with ESMTP; 04 Nov 2021 11:26:48 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 4 Nov 2021 11:26:48 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 4 Nov 2021 11:26:48 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 4 Nov 2021 11:26:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EbBT4hZUlhQ7FFxDKxUGHfXv1uv3bETCHH+x5pTC+w3BMUlN6jPq5vSKcP9lnwmtsq0bkSJU+PFUiAQbzpvMZ2IPMRF3QzBqWGaqKtk1RGk5wlQTPbBzYULEgZzoo7hE36gzJgs84FNN+KI7R1/v13AnakE1A71YbyhXgPRx5f46i2ZoA03a+i5uHlVxErHAo0p/bAC0QVG5j6YhLRENGFIsBufGRYVCEx31vMqzLJ+RZ9cwOdYMrQBOUhdVRtjC66zsxxxClugcQzI3prhiMREMdJyRSqz7xQsjuL2BKGN/OgFi6Islv6bUjIKbvfIZLxWS3tzZkQ2QRRpGco3mVg== 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=LNyB0C9WR+zU2Cllb+B/RzVItKkLpjyFC5VLBPQQRBs=; b=VKUqEuel4U/bzY3sm5DG9Ijg/CnLJYiMcOT+nPwdVFTSrlU0VTUNqeeLkzWfsGFjM1lpG9+WQh4VEwCebleUU2Gd5n97EbJUGSgKlPesHEDjaHt5+47d0+nVUAiRobFHcKbEoWooPO+kuQbs1J7CWnttrF1fC62OolV6a90q7crHeztrV3aaiWZT85DZKTY8OfWFEPZQTUfxbsDnOXJKnBTaEtOvdp/MtuALlar+ZEnE4qymfWJi9ACdfDdB8CuPLDRvU4mYPouD4qEzaKt+iRDuTVDVJwbgPVP2RcpaVJRkojJEVhevMG6IJ2AphmSJOBS+enNRgz7e0MD5FmNF1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LNyB0C9WR+zU2Cllb+B/RzVItKkLpjyFC5VLBPQQRBs=; b=cwppSuw/P02OQsvbWa/UrehM9+6sd84wqsejH24OVNDETa6/gUIPCO4eOyVaFC1q6n1kyK2AbF9AA1Ow1xPP31dNE/4dEBUK/ieZO19uYSIomdffWnZH+MuiVbuqY83kzq+X32IAtyKqpVIxqjOHe8MoVsQFP+of84h80dTZr6Q= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Thu, 4 Nov 2021 18:26:46 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd7d:29be:3342:632c%7]) with mapi id 15.20.4669.011; Thu, 4 Nov 2021 18:26:46 +0000 Message-ID: <55d0d2e0-80ba-09fe-6bd2-08dac3160c06@intel.com> Date: Thu, 4 Nov 2021 18:26:39 +0000 Content-Language: en-US To: Apeksha Gupta , , CC: , , References: <20211021044700.12370-2-apeksha.gupta@nxp.com> <20211103192045.22240-1-apeksha.gupta@nxp.com> <20211103192045.22240-4-apeksha.gupta@nxp.com> From: Ferruh Yigit X-User: ferruhy In-Reply-To: <20211103192045.22240-4-apeksha.gupta@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0275.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:195::10) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by LO4P123CA0275.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:195::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Thu, 4 Nov 2021 18:26:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2381444b-2520-4e9c-9398-08d99fc0a8cb X-MS-TrafficTypeDiagnostic: PH0PR11MB5093: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1JzoEv8jMM6+H3HlujDH/8Jfuzrd08f2mRuS9DYs8xapedkb1njNhGosizTguHMwvFCkLeOtsJLmJo8Ur/vfj9D6+so1SNowKOOE3tJSfOA36rJNuuaEhUoz2CLUG0EDEwdqDZqtXZ47D8sDTNWN3SDWh0jqXdn49bGtbKBsVi4MyRaQ0UrsSG8h2xVwjwFKyqWJWlTREOVnE56D6sKHkYwBZqiJQBjqeuYJWHoDuDZmUdLiEN8beFpGyG+UrXTcU+y9PGrwUhnbv9C07sMOzBeHNqfkY1ZPyPQoDFAFPOASHFTDsPdEIk47R9Witj6dyyuP9Cv2Hok82f4NFjkwjlnBsgdrjfltzoSqn2hLU+iuJObzrFobCHbno/z68hqlCBDrrQ/kM8ON/lrEsXh1fHH3TgSrHjk2OvXaNi5JPC02OE/W/cFd1NJoI47SwUhsF1pFYdwK7VCF+osmKgNXDEh7I/X7iV44ijvvXup0fY145pH0qN9rWxaJ01vXZQrlPNdFqYuBYqWxwIrYWUcBfCJzDQAaYBVLsJgLTKhBVMuBad3JEfmDVXWvU89GACf264egRlZ2Vi8rVCzQxnd6pukMZ7CTHwzrpZeONEc+GL6q0YRXdLMuC+a1NIve+oOlQX6sEYuyv+jGoejJVx+Obvwj/fu7tF+LQrRtKtUzwlNIJIVs98mEb8e1EDRipX0m4akJlf+8vTAtCtT6IXrD8g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(5660300002)(186003)(26005)(82960400001)(956004)(2616005)(4326008)(53546011)(16576012)(2906002)(316002)(6486002)(31686004)(508600001)(31696002)(86362001)(6666004)(38100700002)(83380400001)(8676002)(36756003)(66556008)(44832011)(8936002)(66476007)(66946007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cHBaUlZCQkJ5Rkg3cVlkZVZlUGN4bjBGQ1BkZjNQYWc3ay8xbnlVYWRNQTE2?= =?utf-8?B?eTNFZFA5TWIwQU9jYXl5QWo5b0o1bkowNVZkazJxOVp2K1llNkgwR3EvRDdx?= =?utf-8?B?d2FacHBqblRuclpGdHRXWlJOUHBsWWJZUWVrakpFMVBneWRCV3JrWjFHbklQ?= =?utf-8?B?MFRkVGs5UjBWMDdZL0htQkMrSlFha0hqR3lzUXg2WFZpK0FCVTVvQVlyT0Zh?= =?utf-8?B?dDh2MUYyYVpPSGxmSkhDZXN5bjlFQm5jMHQ3Mzh1aUMyaytuTi9VaEZ6MHAx?= =?utf-8?B?NzRsY2JVYllxbnhWd01jTjlRSkFjekcrUlQ4dVprc3E4ZXlqbXVZbkkvTUZM?= =?utf-8?B?WHFYVDVmZFp0L2UwSWYwSTJvdlNsWDc0dkVlZXplOFh6U0Y2MmMrZHNmOVJG?= =?utf-8?B?ZkdBNmdPRy9xTkR5QkVXcnRJQmc0TkU5V2RrdUVNdGs1V2xnbFhIMlppdmJw?= =?utf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PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2021 18:26:46.6386 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tu+aBY06BOkPsWliIMGpH1Xy1Y2f7eYZMsa7LMp1uz1QBzPo+/RhpmgDJQRJF8gPertsLzXCXg5R10YxpbtXWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5093 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 3/5] net/enetfec: support queue configuration 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 Sender: "dev" On 11/3/2021 7:20 PM, Apeksha Gupta wrote: > This patch adds Rx/Tx queue configuration setup operations. > On packet reception the respective BD Ring status bit is set > which is then used for packet processing. > > Signed-off-by: Sachin Saxena > Signed-off-by: Apeksha Gupta > --- > drivers/net/enetfec/enet_ethdev.c | 230 +++++++++++++++++++++++++++++- > drivers/net/enetfec/enet_ethdev.h | 73 ++++++++++ > 2 files changed, 302 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c > index 410c395039..aa96093eb8 100644 > --- a/drivers/net/enetfec/enet_ethdev.c > +++ b/drivers/net/enetfec/enet_ethdev.c > @@ -45,6 +45,19 @@ > > static uint32_t enetfec_e_cntl; > > +/* Supported Rx offloads */ > +static uint64_t dev_rx_offloads_sup = > + DEV_RX_OFFLOAD_IPV4_CKSUM | > + DEV_RX_OFFLOAD_UDP_CKSUM | > + DEV_RX_OFFLOAD_TCP_CKSUM | > + DEV_RX_OFFLOAD_VLAN_STRIP | > + DEV_RX_OFFLOAD_CHECKSUM; > + > +static uint64_t dev_tx_offloads_sup = > + DEV_TX_OFFLOAD_IPV4_CKSUM | > + DEV_TX_OFFLOAD_UDP_CKSUM | > + DEV_TX_OFFLOAD_TCP_CKSUM; > + The comment in the previous version seems ignored, copying down: The macro names are updated in ethdev, can you please update them? like: DEV_RX_OFFLOAD_IPV4_CKSUM -> RTE_ETH_RX_OFFLOAD_IPV4_CKSUM > /* > * This function is called to start or restart the ENETFEC during a link > * change, transmit timeout, or to reconfigure the ENETFEC. The network > @@ -204,10 +217,225 @@ enetfec_eth_stop(struct rte_eth_dev *dev) > return 0; > } > > +static int > +enetfec_eth_info(__rte_unused struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info) > +{ > + dev_info->max_rx_queues = ENETFEC_MAX_Q; > + dev_info->max_tx_queues = ENETFEC_MAX_Q; > + dev_info->rx_offload_capa = dev_rx_offloads_sup; > + dev_info->tx_offload_capa = dev_tx_offloads_sup; > + return 0; > +} > + > +static const unsigned short offset_des_active_rxq[] = { > + ENETFEC_RDAR_0, ENETFEC_RDAR_1, ENETFEC_RDAR_2 > +}; > + > +static const unsigned short offset_des_active_txq[] = { > + ENETFEC_TDAR_0, ENETFEC_TDAR_1, ENETFEC_TDAR_2 > +}; > + > +static int > +enetfec_tx_queue_setup(struct rte_eth_dev *dev, > + uint16_t queue_idx, > + uint16_t nb_desc, > + unsigned int socket_id __rte_unused, > + const struct rte_eth_txconf *tx_conf) > +{ > + struct enetfec_private *fep = dev->data->dev_private; > + unsigned int i; > + struct bufdesc *bdp, *bd_base; > + struct enetfec_priv_tx_q *txq; > + unsigned int size; > + unsigned int dsize = fep->bufdesc_ex ? sizeof(struct bufdesc_ex) : > + sizeof(struct bufdesc); > + unsigned int dsize_log2 = fls64(dsize); > + > + /* Tx deferred start is not supported */ > + if (tx_conf->tx_deferred_start) { > + ENETFEC_PMD_ERR("%p:Tx deferred start not supported", > + (void *)dev); > + return -EINVAL; > + } > + > + /* allocate transmit queue */ > + txq = rte_zmalloc(NULL, sizeof(*txq), RTE_CACHE_LINE_SIZE); > + if (txq == NULL) { > + ENETFEC_PMD_ERR("transmit queue allocation failed"); > + return -ENOMEM; > + } > + > + if (nb_desc > MAX_TX_BD_RING_SIZE) { > + nb_desc = MAX_TX_BD_RING_SIZE; > + ENETFEC_PMD_WARN("modified the nb_desc to MAX_TX_BD_RING_SIZE\n"); Redundant '\n', as macro already adds one. Can you please search and fix all usages? > + } > + txq->bd.ring_size = nb_desc; > + fep->total_tx_ring_size += txq->bd.ring_size; > + fep->tx_queues[queue_idx] = txq; > + > + rte_write32(rte_cpu_to_le_32(fep->bd_addr_p_t[queue_idx]), > + (uint8_t *)fep->hw_baseaddr_v + ENETFEC_TD_START(queue_idx)); > + > + /* Set transmit descriptor base. */ > + txq = fep->tx_queues[queue_idx]; > + txq->fep = fep; > + size = dsize * txq->bd.ring_size; > + bd_base = (struct bufdesc *)fep->dma_baseaddr_t[queue_idx]; > + txq->bd.queue_id = queue_idx; > + txq->bd.base = bd_base; > + txq->bd.cur = bd_base; > + txq->bd.d_size = dsize; > + txq->bd.d_size_log2 = dsize_log2; > + txq->bd.active_reg_desc = (uint8_t *)fep->hw_baseaddr_v + > + offset_des_active_txq[queue_idx]; > + bd_base = (struct bufdesc *)(((uintptr_t)bd_base) + size); > + txq->bd.last = (struct bufdesc *)(((uintptr_t)bd_base) - dsize); > + bdp = txq->bd.base; > + bdp = txq->bd.cur; > + > + for (i = 0; i < txq->bd.ring_size; i++) { > + /* Initialize the BD for every fragment in the page. */ > + rte_write16(rte_cpu_to_le_16(0), &bdp->bd_sc); > + if (txq->tx_mbuf[i] != NULL) { > + rte_pktmbuf_free(txq->tx_mbuf[i]); > + txq->tx_mbuf[i] = NULL; > + } > + rte_write32(0, &bdp->bd_bufaddr); > + bdp = enet_get_nextdesc(bdp, &txq->bd); > + } > + > + /* Set the last buffer to wrap */ > + bdp = enet_get_prevdesc(bdp, &txq->bd); > + rte_write16((rte_cpu_to_le_16(TX_BD_WRAP) | > + rte_read16(&bdp->bd_sc)), &bdp->bd_sc); > + txq->dirty_tx = bdp; > + dev->data->tx_queues[queue_idx] = fep->tx_queues[queue_idx]; > + return 0; > +} > + > +static int > +enetfec_rx_queue_setup(struct rte_eth_dev *dev, > + uint16_t queue_idx, > + uint16_t nb_rx_desc, > + unsigned int socket_id __rte_unused, > + const struct rte_eth_rxconf *rx_conf, > + struct rte_mempool *mb_pool) > +{ > + struct enetfec_private *fep = dev->data->dev_private; > + unsigned int i; > + struct bufdesc *bd_base; > + struct bufdesc *bdp; > + struct enetfec_priv_rx_q *rxq; > + unsigned int size; > + unsigned int dsize = fep->bufdesc_ex ? sizeof(struct bufdesc_ex) : > + sizeof(struct bufdesc); > + unsigned int dsize_log2 = fls64(dsize); > + > + /* Rx deferred start is not supported */ > + if (rx_conf->rx_deferred_start) { > + ENETFEC_PMD_ERR("%p:Rx deferred start not supported", > + (void *)dev); > + return -EINVAL; > + } > + > + /* allocate receive queue */ > + rxq = rte_zmalloc(NULL, sizeof(*rxq), RTE_CACHE_LINE_SIZE); > + if (rxq == NULL) { > + ENETFEC_PMD_ERR("receive queue allocation failed"); > + return -ENOMEM; > + } > + > + if (nb_rx_desc > MAX_RX_BD_RING_SIZE) { > + nb_rx_desc = MAX_RX_BD_RING_SIZE; > + ENETFEC_PMD_WARN("modified the nb_desc to MAX_RX_BD_RING_SIZE\n"); > + } > + > + rxq->bd.ring_size = nb_rx_desc; > + fep->total_rx_ring_size += rxq->bd.ring_size; > + fep->rx_queues[queue_idx] = rxq; > + > + rte_write32(rte_cpu_to_le_32(fep->bd_addr_p_r[queue_idx]), > + (uint8_t *)fep->hw_baseaddr_v + ENETFEC_RD_START(queue_idx)); > + rte_write32(rte_cpu_to_le_32(PKT_MAX_BUF_SIZE), > + (uint8_t *)fep->hw_baseaddr_v + ENETFEC_MRB_SIZE(queue_idx)); > + > + /* Set receive descriptor base. */ > + rxq = fep->rx_queues[queue_idx]; > + rxq->pool = mb_pool; > + size = dsize * rxq->bd.ring_size; > + bd_base = (struct bufdesc *)fep->dma_baseaddr_r[queue_idx]; > + rxq->bd.queue_id = queue_idx; > + rxq->bd.base = bd_base; > + rxq->bd.cur = bd_base; > + rxq->bd.d_size = dsize; > + rxq->bd.d_size_log2 = dsize_log2; > + rxq->bd.active_reg_desc = (uint8_t *)fep->hw_baseaddr_v + > + offset_des_active_rxq[queue_idx]; > + bd_base = (struct bufdesc *)(((uintptr_t)bd_base) + size); > + rxq->bd.last = (struct bufdesc *)(((uintptr_t)bd_base) - dsize); > + > + rxq->fep = fep; > + bdp = rxq->bd.base; > + rxq->bd.cur = bdp; > + > + for (i = 0; i < nb_rx_desc; i++) { > + /* Initialize Rx buffers from pktmbuf pool */ > + struct rte_mbuf *mbuf = rte_pktmbuf_alloc(mb_pool); > + if (mbuf == NULL) { > + ENETFEC_PMD_ERR("mbuf failed\n"); > + goto err_alloc; Wrong indentation.