From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20074.outbound.protection.outlook.com [40.107.2.74]) by dpdk.org (Postfix) with ESMTP id 4C2BFA49 for ; Wed, 19 Sep 2018 14:27:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Wa4dfDFZu4CqKCqZOdjnI9Ej7CYOCpOGBS0/PYJm5go=; b=K2EjM8gb4YIVzXfv0eTDb3JwWhh+fcHXqgwa7XAC83rg0LtlqqP4kCvoi7FzAdAtGPCIhL6JamTxSguNyuQ1JttolsAdnAENDVrLghDKQYNSo6E8SJcJ/j8De3nHCV+1lGF2VKE1A544djxB5PGXVvJBhG6t1llNndJHTrEeVBk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from [10.232.14.39] (14.142.187.166) by AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Wed, 19 Sep 2018 12:27:05 +0000 To: Gagandeep Singh Cc: dev@dpdk.org, ferruh.yigit@intel.com, pankaj.chauhan@nxp.com References: <20180906055449.21731-1-g.singh@nxp.com> <20180913094201.17098-1-g.singh@nxp.com> <20180913094201.17098-4-g.singh@nxp.com> From: Shreyansh Jain Message-ID: <261840a3-5636-485c-7294-b9d67ee159e9@nxp.com> Date: Wed, 19 Sep 2018 17:56:47 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180913094201.17098-4-g.singh@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR01CA0094.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::34) To AM6PR04MB4679.eurprd04.prod.outlook.com (2603:10a6:20b:1c::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33ad0a69-824f-4489-504b-08d61e2b3664 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4679; X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 3:9zoCt5l2cEMqsH7idbmr7/ypthHdAOrc0PyvS5JIOCCGwYXO0dNvOyy+9D5OU8WD9pOwk/V9TWeNUHPuLVcQAzBQesU3k9HSMFXQDxpq2hcSwCZbP5VVFugXEagPpEIoAQr7lNtTKvlFSPRB9zbwLnqJco80Vy3RXe+o70kBn/MpJcXyt75VweB89NeHGnxxq2yNryGW8wVxNv0OGAECijyVpBokVHuJcd6u2VDpdhjokQI3+Wu9hh+PRWVatXth; 25:sKb2w8iQ84xFvHcscNzPZvielB/WxyZaxXPFlJP+W3W/Et9xY6bf/JNFKdhPzTVehHXWU3UGhuukTBiYOoDD5Lkn5zHvoqpZfGRR/kKxrSPNNfLNUkyftHBtxZCNsH4BVcgOdt0xenRRrfEJIm5O7Tvl1qymx+hZygt2V/VfM7vFQ5r2C7VWZ0wyzukiUB1hbS+LpsoGqIah9w2S6gtO+XE/h59m9ESkt/LuzqZZEKXPtyAquGVR49EX/OIfcnUFkz7NsSyFtWKPDoBlYTGHsbBKopTzHzTLZpVFoMOZgY6xW6Rvpp8dqYkAY4Gfw1bxOPTrLeIpYRr2+wjnxWrXDQ==; 31:xT2rMZZjJitm0SucnoHI6b8eJJ15EV2cUxabWOmwrBwHoHlXNNnkaCIbkUikoeS7G3g1owK/1UFKqIZUtYVVIXTmWGQ9+z9uC5obyHiZueCpmHJtgWj/fQptRaD2EZCJAaNOFipul6UfvA+imhmk9j4qQrRtZHOXZR5wqxkKeSgws7+8BtCY9MDTF4hjDBKHaENgY04NgnaWsHieAf5Cuj1JXaWgm4oRl2dIL5+GfLU= X-MS-TrafficTypeDiagnostic: AM6PR04MB4679: X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4679; 20:NwSm+/ER5LznzJySkhzVuPkMGqRAovVHXqWawSS7Hh4Z9VBIIuNjoZTZIcLCs+zINTbAFJR44lplmPP2OWr9yg/6hXTbBIvFUvKrmhH2mdvT0xIF31BIfGyLiiV9QvZrdSdVjDHn5GUoOVEHrg2u7zbK8KoY/PdDbA7RtBqGCePH8UO+h5pTFwenJwIpoUO82Ay4n1nnw1QyLTfjb0CWyyevgL73rjM0QdHNT7B6GgNSk+Z+Urdu5sgKyuogd6ge98lkhXVJ/SQyjF24ge6vP+pL/ohY0VoFrliZdaAevEG87v9qpZV/QIqyH1qEl+EY7TfWiPZ0n4VtsZTo1kuA5aWmrr8urNkdiopdHuc1elsKlQNqSrqlNyKUNdhISnT4fB90nAd0BBqUXnenSuBF+IJ9od7B55yKfA3RZudllUi+8Br9AOgOFi39QFY/9IGlrrPsLScRJ+lUOkYKNNzzFT+i6SYFPko5jmWF6oWQmjCQ7PGrbX7z/PAwXXQvkzQG; 4:gzy4ExrnqWGo0brSvW+1p0iTD+QepG24UTcRW017NcGrsTnMA+wNLDoZKUXScfFsDt0W5f1YX4jK36pF7j5lnLCbTq5axaPPIuDcFNx7p8n9nAqpl+0LOasRxRxH2k8aEsNcmh8o2FgogETQ/qQqv1emeue/XMRpavesOMyi82miEwcgB0w+BaDJtgWy3rjDFZJZZ1V2Cg4sbj+9fwF0idTvvW4Yp8+1eYsrTQDdhYl/C9KYQjGl3t+cIT1Lkyj2GWp+ya6Bxzf9EEZVyW9Q8pDXUykc7VSZt0Y/i5HqNQqYRzjdawaswVO5Qp94VZ6H X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:AM6PR04MB4679; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4679; X-Forefront-PRVS: 0800C0C167 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(396003)(136003)(366004)(39860400002)(376002)(346002)(189003)(199004)(22813001)(76176011)(305945005)(8676002)(2486003)(478600001)(386003)(5009440100003)(86362001)(230700001)(575784001)(31686004)(11346002)(6862004)(16576012)(3846002)(6246003)(6116002)(37006003)(316002)(52116002)(476003)(446003)(2616005)(16526019)(486006)(52146003)(58126008)(50466002)(956004)(44832011)(31696002)(23676004)(26005)(64126003)(7736002)(65826007)(8936002)(5660300001)(6636002)(68736007)(67846002)(25786009)(97736004)(6666003)(81156014)(105586002)(4326008)(36756003)(106356001)(77096007)(2906002)(14444005)(81166006)(6486002)(47776003)(66066001)(65956001)(229853002)(65806001)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4679; H:[10.232.14.39]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTZQUjA0TUI0Njc5OzIzOk9DUmNIc0p5VGVFeWlkdDBGSWRxcXcyb0Np?= =?utf-8?B?SjVsL202MFgxWGRLYkF3T3JpOGZRc0JpRjNoRUV6MndoSFl2UWIrNW84QXZL?= =?utf-8?B?K2YyTkUrZDViaGlHRmNwSTF6R0dBaGE3ZkJ1UXh3TXNBbVNXZU40dUFTQmtP?= =?utf-8?B?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fUm6NEugRuXUqvJCBCV3vGS2Dw==; 5:OSgnyWq4X7E8yUWjYwYbtEanAd2468M0fg6QsjO0pRMiRMsSJ1BokingDlPaXED/im5DTsrMO4KL1DtM3RapA2fOb5grk/YJf8Pou8V3hA4Gxe/7EsdFZbG5L6/3QGG7poKH08+WFlNMIhi++wHY9b5s3phPEVLP3qy/I0h4pXs=; 7:HQ+QiEpzPDtEQeGV+I/gCUv5jqXAniuLYpqmSQlpK7QkDR9lHn5ryFXPP1Q/JWSgZJsuIevPRnwPRm3faykDdZhmQsU0S1fZr0sBLDGEBDBkFjSilKICq7yCl00XEDY6RawwCd9ooY54HpREQVZdGqeZfZzg+6WgxjRtu2EEhm63wXF0HfDROdG5oT5cwuvZzI5B9rWR4KXy1WVtVx0idW8GrS5vaI/z8E3/wdi36I6k2mbD4U6vRcloTNX+ztY9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2018 12:27:05.5278 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33ad0a69-824f-4489-504b-08d61e2b3664 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4679 Subject: Re: [dpdk-dev] [PATCH v2 3/3] net/enetc: enable Rx and Tx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 12:27:08 -0000 On Thursday 13 September 2018 03:12 PM, Gagandeep Singh wrote: > Add RX and TX queue setup, datapath functions > and enable the packet parsing > > Signed-off-by: Gagandeep Singh > --- > MAINTAINERS | 1 + > drivers/net/enetc/Makefile | 3 +- > drivers/net/enetc/enetc_ethdev.c | 6 +- > drivers/net/enetc/enetc_rxtx.c | 447 +++++++++++++++++++++++++++++++ > drivers/net/enetc/meson.build | 3 +- > 5 files changed, 456 insertions(+), 4 deletions(-) > create mode 100644 drivers/net/enetc/enetc_rxtx.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index fc70ac049..b67f2afa4 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -645,6 +645,7 @@ F: doc/guides/nics/features/dpaa2.ini > > NXP enetc > M: Gagandeep Singh > +M: Pankaj Chauhan > F: drivers/net/enetc/ > F: doc/guides/nics/enetc.rst > F: doc/guides/nics/features/enetc.ini > diff --git a/drivers/net/enetc/Makefile b/drivers/net/enetc/Makefile > index 3f4ba97da..1f886831a 100644 > --- a/drivers/net/enetc/Makefile > +++ b/drivers/net/enetc/Makefile > @@ -16,8 +16,9 @@ LIBABIVER := 1 > # all source are stored in SRCS-y > # > SRCS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += enetc_ethdev.c > +SRCS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += enetc_rxtx.c > > -LDLIBS += -lrte_eal > +LDLIBS += -lrte_eal -lrte_mempool > LDLIBS += -lrte_ethdev > LDLIBS += -lrte_bus_pci > > diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c > index 06438835d..67106593f 100644 > --- a/drivers/net/enetc/enetc_ethdev.c > +++ b/drivers/net/enetc/enetc_ethdev.c > @@ -37,6 +37,8 @@ static const struct eth_dev_ops enetc_ops = { > .dev_close = enetc_dev_close, > .link_update = enetc_link_update, > .dev_infos_get = enetc_dev_infos_get, > + .rx_queue_setup = enetc_rx_queue_setup, > + .tx_queue_setup = enetc_tx_queue_setup, > }; > > /** > @@ -61,8 +63,8 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) > > PMD_INIT_FUNC_TRACE(); > eth_dev->dev_ops = &enetc_ops; > - eth_dev->rx_pkt_burst = NULL; > - eth_dev->tx_pkt_burst = NULL; > + eth_dev->rx_pkt_burst = &enetc_recv_pkts; > + eth_dev->tx_pkt_burst = &enetc_xmit_pkts; > > rte_eth_copy_pci_info(eth_dev, pci_dev); > > diff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.c > new file mode 100644 > index 000000000..b01f64b0c > --- /dev/null > +++ b/drivers/net/enetc/enetc_rxtx.c > @@ -0,0 +1,447 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2018 NXP > + */ > + > +#include > +#include > +#include > + > +#include "rte_ethdev.h" > +#include "rte_malloc.h" > +#include "rte_memzone.h" > + > +#include "base/enetc_hw.h" > +#include "enetc.h" > +#include "enetc_logs.h" > + > +#define ENETC_RXBD_BUNDLE 8 /* Number of BDs to update at once */ > + > +static inline int enetc_bd_unused(struct enetc_bdr *bdr) Ideally, the function definition should be like: (, , ); This helps in searching for the tags against function names. Declarations are on a single line. This is valid across other patches as well in this series. > +{ > + if (bdr->next_to_clean > bdr->next_to_use) > + return bdr->next_to_clean - bdr->next_to_use - 1; > + > + return bdr->bd_count + bdr->next_to_clean - bdr->next_to_use - 1; > +} > + > +static bool enetc_clean_tx_ring(struct enetc_bdr *tx_ring) > +{ > + int tx_frm_cnt = 0; > + struct enetc_swbd *tx_swbd; > + int i; > + > + i = tx_ring->next_to_clean; > + tx_swbd = &tx_ring->q_swbd[i]; > + while ((int)(enetc_rd_reg(tx_ring->tcisr) & ENETC_TBCISR_IDX_MASK) != i) { > + rte_pktmbuf_free(tx_swbd->buffer_addr); > + tx_swbd->buffer_addr = NULL; > + tx_swbd++; > + i++; > + if (unlikely(i == tx_ring->bd_count)) { > + i = 0; > + tx_swbd = &tx_ring->q_swbd[0]; > + } > + > + tx_frm_cnt++; > + } > + tx_ring->next_to_clean = i; > + return tx_frm_cnt++; > +} > + > +uint16_t enetc_xmit_pkts(void *tx_queue, > + struct rte_mbuf **tx_pkts, > + uint16_t nb_pkts) Formatting of second line arguments is wrong. Also, maintain uniformity of the declaration syntax. Either all on single line with their returns or all with returns on one line and names on another. > +{ > + struct enetc_swbd *tx_swbd; > + int i, start; > + struct enetc_tx_bd *txbd; > + struct enetc_bdr *tx_ring = (struct enetc_bdr *)tx_queue; > + > + i = tx_ring->next_to_use; > + start = 0; > + while (nb_pkts--) { > + enetc_clean_tx_ring(tx_ring); > + > + tx_ring->q_swbd[i].buffer_addr = tx_pkts[start]; > + > + txbd = ENETC_TXBD(*tx_ring, i); > + tx_swbd = &tx_ring->q_swbd[i]; > + txbd->frm_len = tx_pkts[start]->pkt_len; > + txbd->buf_len = txbd->frm_len; > + txbd->flags = rte_cpu_to_le_16(ENETC_TXBD_FLAGS_F); > + txbd->addr = > + (uint64_t)rte_cpu_to_le_64(tx_swbd->buffer_addr->buf_addr + > + tx_swbd->buffer_addr->data_off); > + i++; > + start++; > + if (unlikely(i == tx_ring->bd_count)) > + i = 0; > + } > + tx_ring->next_to_use = i; > + enetc_wr_reg(tx_ring->tcir, i); > + return start; > +} > + > +static int enetc_refill_rx_ring(struct enetc_bdr *rx_ring, const int buff_cnt) > +{ > + struct enetc_swbd *rx_swbd; > + union enetc_rx_bd *rxbd; > + int i, j; > + > + i = rx_ring->next_to_use; > + rx_swbd = &rx_ring->q_swbd[i]; > + rxbd = ENETC_RXBD(*rx_ring, i); > + > + for (j = 0; j < buff_cnt; j++) { > + rx_swbd->buffer_addr = > + rte_cpu_to_le_64(rte_mbuf_raw_alloc(rx_ring->mb_pool)); > + rxbd->w.addr = (uint64_t)rx_swbd->buffer_addr->buf_addr + > + rx_swbd->buffer_addr->data_off; > + /* clear 'R" as well */ > + rxbd->r.lstatus = 0; > + rx_swbd++; > + rxbd++; > + i++; > + > + if (unlikely(i == rx_ring->bd_count)) { > + i = 0; > + rxbd = ENETC_RXBD(*rx_ring, 0); > + rx_swbd = &rx_ring->q_swbd[i]; > + } > + } > + if (likely(j)) { > + rx_ring->next_to_alloc = i; > + rx_ring->next_to_use = i; > + enetc_wr_reg(rx_ring->rcir, i); > + } It is nice to have a new line after a logical block (like the for and if above). It helps in reading. But, no formal rule exists to enforce this. > + return j; > +} > + > + > +static inline void __attribute__((hot)) > +enetc_dev_rx_parse(struct rte_mbuf *m, uint16_t parse_results) > +{ > + ENETC_PMD_DP_DEBUG("parse summary = 0x%x ", parse_results); > + > + m->packet_type = RTE_PTYPE_UNKNOWN; > + switch (parse_results) { > + case ENETC_PKT_TYPE_ETHER: > + m->packet_type = RTE_PTYPE_L2_ETHER; > + break; > + case ENETC_PKT_TYPE_IPV4: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4; > + break; > + case ENETC_PKT_TYPE_IPV6: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6; > + break; > + case ENETC_PKT_TYPE_IPV4_TCP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP; > + break; > + case ENETC_PKT_TYPE_IPV6_TCP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP; > + break; > + case ENETC_PKT_TYPE_IPV4_UDP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP; > + break; > + case ENETC_PKT_TYPE_IPV6_UDP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP; > + break; > + case ENETC_PKT_TYPE_IPV4_SCTP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_SCTP; > + break; > + case ENETC_PKT_TYPE_IPV6_SCTP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_SCTP; > + break; > + case ENETC_PKT_TYPE_IPV4_ICMP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_ICMP; > + break; > + case ENETC_PKT_TYPE_IPV6_ICMP: > + m->packet_type = RTE_PTYPE_L2_ETHER | > + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_ICMP; If you order your packet_type values, they would be easier to read: m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_ICMP; Again, just like above, no strict formatting rule exists. You can choose to ignore. > + break; > + /* More switch cases can be added */ > + default: > + m->packet_type = RTE_PTYPE_UNKNOWN; > + } > +} > + > +static int > +enetc_clean_rx_ring(struct enetc_bdr *rx_ring, struct rte_mbuf **rx_pkts, > + int work_limit) I think the above line would exceed 79 char - even if not, formatting is incorrect. > +{ > + int rx_frm_cnt = 0; > + int cleaned_cnt, i; > + struct enetc_swbd *rx_swbd; > + > + cleaned_cnt = enetc_bd_unused(rx_ring); > + > + /* next descriptor to process */ > + i = rx_ring->next_to_clean; > + rx_swbd = &rx_ring->q_swbd[i]; > + > + while (likely(rx_frm_cnt < work_limit)) { > + union enetc_rx_bd *rxbd; > + uint32_t bd_status; > + > + if (cleaned_cnt >= ENETC_RXBD_BUNDLE) { > + int count = enetc_refill_rx_ring(rx_ring, cleaned_cnt); > + > + cleaned_cnt -= count; > + } > + rxbd = ENETC_RXBD(*rx_ring, i); > + bd_status = rte_le_to_cpu_32(rxbd->r.lstatus); > + if (!bd_status) > + break; > + > + rx_swbd->buffer_addr->pkt_len = rxbd->r.buf_len; > + rx_swbd->buffer_addr->data_len = rxbd->r.buf_len; > + rx_swbd->buffer_addr->hash.rss = rxbd->r.rss_hash; > + rx_swbd->buffer_addr->ol_flags = 0; > + enetc_dev_rx_parse(rx_swbd->buffer_addr, rxbd->r.parse_summary); > + > + rx_pkts[rx_frm_cnt] = rx_swbd->buffer_addr; > + > + cleaned_cnt++; > + rx_swbd++; > + i++; > + if (unlikely(i == rx_ring->bd_count)) { > + i = 0; > + rx_swbd = &rx_ring->q_swbd[i]; > + } > + rx_ring->next_to_clean = i; > + rx_frm_cnt++; > + } > + > + return rx_frm_cnt; > +} > + [...] > +static void enetc_setup_tx_bdrs(struct rte_eth_dev *dev) > +{ > + int i; > + struct enetc_eth_adapter *priv = > + ENETC_DEV_PRIVATE(dev->data->dev_private); > + > + for (i = 0; i < priv->num_tx_rings; i++) { > + enetc_setup_txbdr(&priv->hw.hw, priv->tx_ring[i]); > + dev->data->tx_queues[i] = priv->tx_ring[i]; > + } > +} > + > +int enetc_tx_queue_setup(struct rte_eth_dev *dev, > + uint16_t queue_idx, > + uint16_t nb_desc, > + unsigned int socket_id, > + const struct rte_eth_txconf *tx_conf) Can you please fix the format of the arguments on new line. > +{ > + struct enetc_eth_adapter *adapter = > + ENETC_DEV_PRIVATE(dev->data->dev_private); > + int err = 0; > + > + err = enetc_alloc_tx_resources(adapter); > + if (err) > + goto err_alloc_tx; > + > + enetc_setup_tx_bdrs(dev); > + > +err_alloc_tx: > + return err; > +} > + > +static int enetc_alloc_rxbdr(struct enetc_bdr *rxr) > +{ > + int size; > + > + size = rxr->bd_count * sizeof(struct enetc_swbd); > + rxr->q_swbd = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE); > + if (rxr->q_swbd == NULL) > + return -ENOMEM; > + > + size = rxr->bd_count * sizeof(union enetc_rx_bd); > + rxr->bd_base = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE); > + New line is not required here - rxr->bd_base allocation is being checked, so essentially a single logical block. > + if (rxr->bd_base == NULL) { > + rte_free(rxr->q_swbd); > + rxr->q_swbd = NULL; > + return -ENOMEM; > + } > + > + rxr->next_to_clean = 0; > + rxr->next_to_use = 0; > + rxr->next_to_alloc = 0; > + > + return 0; > +} > + [...]