From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7364EA0096 for ; Wed, 8 May 2019 18:03:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 696874C77; Wed, 8 May 2019 18:03:05 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 0543F4C77 for ; Wed, 8 May 2019 18:03:04 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D37D3087959; Wed, 8 May 2019 16:03:03 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-210.ams2.redhat.com [10.36.117.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 673FE60C82; Wed, 8 May 2019 16:03:02 +0000 (UTC) From: Kevin Traynor To: Stephen Hemminger Cc: Ferruh Yigit , dpdk stable Date: Wed, 8 May 2019 17:02:15 +0100 Message-Id: <20190508160233.2648-18-ktraynor@redhat.com> In-Reply-To: <20190508160233.2648-1-ktraynor@redhat.com> References: <20190508160233.2648-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 08 May 2019 16:03:03 +0000 (UTC) Subject: [dpdk-stable] patch 'net/ring: fix coding style' has been queued to LTS release 18.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/14/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/997a9f97348da498caf69278ef15c3396b8f3ea5 Thanks. Kevin Traynor --- >From 997a9f97348da498caf69278ef15c3396b8f3ea5 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 23 Apr 2019 09:53:32 -0700 Subject: [PATCH] net/ring: fix coding style [ upstream commit 869bf6d222bb05502bd5b508eb1cfed4e7d2623b ] Whitespace fixes to bring inline with current DPDK style. Fixes: e1e4017751f1 ("ring: add new driver") Fixes: a74a99bbb8ed ("ring: free rings when detaching device") Fixes: 61934c0956d4 ("ring: convert to use of PMD_REGISTER_DRIVER and fix linking") Signed-off-by: Stephen Hemminger Reviewed-by: Ferruh Yigit --- drivers/net/ring/rte_eth_ring.c | 58 ++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index aeb48f5ec..f301ba9f4 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -46,6 +46,6 @@ struct ring_queue { struct pmd_internals { - unsigned max_rx_queues; - unsigned max_tx_queues; + unsigned int max_rx_queues; + unsigned int max_tx_queues; struct ring_queue rx_ring_queues[RTE_PMD_RING_MAX_RX_RINGS]; @@ -56,10 +56,9 @@ struct pmd_internals { }; - static struct rte_eth_link pmd_link = { - .link_speed = ETH_SPEED_NUM_10G, - .link_duplex = ETH_LINK_FULL_DUPLEX, - .link_status = ETH_LINK_DOWN, - .link_autoneg = ETH_LINK_FIXED, + .link_speed = ETH_SPEED_NUM_10G, + .link_duplex = ETH_LINK_FULL_DUPLEX, + .link_status = ETH_LINK_DOWN, + .link_autoneg = ETH_LINK_FIXED, }; @@ -139,4 +138,5 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, { struct pmd_internals *internals = dev->data->dev_private; + dev->data->rx_queues[rx_queue_id] = &internals->rx_ring_queues[rx_queue_id]; return 0; @@ -150,4 +150,5 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, { struct pmd_internals *internals = dev->data->dev_private; + dev->data->tx_queues[tx_queue_id] = &internals->tx_ring_queues[tx_queue_id]; return 0; @@ -157,7 +158,8 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, static void eth_dev_info(struct rte_eth_dev *dev, - struct rte_eth_dev_info *dev_info) + struct rte_eth_dev_info *dev_info) { struct pmd_internals *internals = dev->data->dev_private; + dev_info->max_mac_addrs = 1; dev_info->max_rx_pktlen = (uint32_t)-1; @@ -170,5 +172,5 @@ static int eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { - unsigned i; + unsigned int i; unsigned long rx_total = 0, tx_total = 0, tx_err_total = 0; const struct pmd_internals *internal = dev->data->dev_private; @@ -198,6 +200,7 @@ static void eth_stats_reset(struct rte_eth_dev *dev) { - unsigned i; + unsigned int i; struct pmd_internals *internal = dev->data->dev_private; + for (i = 0; i < dev->data->nb_rx_queues; i++) internal->rx_ring_queues[i].rx_pkts.cnt = 0; @@ -251,6 +254,8 @@ static struct rte_vdev_driver pmd_ring_drv; static int do_eth_dev_ring_create(const char *name, - struct rte_ring * const rx_queues[], const unsigned nb_rx_queues, - struct rte_ring *const tx_queues[], const unsigned nb_tx_queues, + struct rte_ring * const rx_queues[], + const unsigned int nb_rx_queues, + struct rte_ring *const tx_queues[], + const unsigned int nb_tx_queues, const unsigned int numa_node, enum dev_action action, struct rte_eth_dev **eth_dev_p) @@ -261,5 +266,5 @@ do_eth_dev_ring_create(const char *name, void **rx_queues_local = NULL; void **tx_queues_local = NULL; - unsigned i; + unsigned int i; PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %u", @@ -345,8 +350,8 @@ error: int rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], - const unsigned nb_rx_queues, + const unsigned int nb_rx_queues, struct rte_ring *const tx_queues[], - const unsigned nb_tx_queues, - const unsigned numa_node) + const unsigned int nb_tx_queues, + const unsigned int numa_node) { struct ring_internal_args args = { @@ -399,5 +404,5 @@ rte_eth_from_ring(struct rte_ring *r) static int -eth_dev_ring_create(const char *name, const unsigned numa_node, +eth_dev_ring_create(const char *name, const unsigned int numa_node, enum dev_action action, struct rte_eth_dev **eth_dev) { @@ -406,7 +411,7 @@ eth_dev_ring_create(const char *name, const unsigned numa_node, */ struct rte_ring *rxtx[RTE_PMD_RING_MAX_RX_RINGS]; - unsigned i; + unsigned int i; char rng_name[RTE_RING_NAMESIZE]; - unsigned num_rings = RTE_MIN(RTE_PMD_RING_MAX_RX_RINGS, + unsigned int num_rings = RTE_MIN(RTE_PMD_RING_MAX_RX_RINGS, RTE_PMD_RING_MAX_TX_RINGS); @@ -430,15 +435,16 @@ eth_dev_ring_create(const char *name, const unsigned numa_node, struct node_action_pair { char name[PATH_MAX]; - unsigned node; + unsigned int node; enum dev_action action; }; struct node_action_list { - unsigned total; - unsigned count; + unsigned int total; + unsigned int count; struct node_action_pair *list; }; -static int parse_kvlist (const char *key __rte_unused, const char *value, void *data) +static int parse_kvlist(const char *key __rte_unused, + const char *value, void *data) { struct node_action_list *info = data; @@ -553,6 +559,6 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) if (!kvlist) { - PMD_LOG(INFO, "Ignoring unsupported parameters when creating" - " rings-backed ethernet device"); + PMD_LOG(INFO, + "Ignoring unsupported parameters when creatingrings-backed ethernet device"); ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE, ð_dev); @@ -598,5 +604,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) info->total = ret; - info->list = (struct node_action_pair*)(info + 1); + info->list = (struct node_action_pair *)(info + 1); ret = rte_kvargs_process(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-05-08 16:33:58.393611691 +0100 +++ 0018-net-ring-fix-coding-style.patch 2019-05-08 16:33:57.393578764 +0100 @@ -1 +1 @@ -From 869bf6d222bb05502bd5b508eb1cfed4e7d2623b Mon Sep 17 00:00:00 2001 +From 997a9f97348da498caf69278ef15c3396b8f3ea5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 869bf6d222bb05502bd5b508eb1cfed4e7d2623b ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 115a882b5..91e5f5f8f 100644 +index aeb48f5ec..f301ba9f4 100644 @@ -153 +154 @@ -@@ -554,6 +560,6 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -553,6 +559,6 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) @@ -162 +163 @@ -@@ -599,5 +605,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -598,5 +604,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)