From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
Yongseok Koh <yskoh@mellanox.com>
Subject: [dpdk-dev] [PATCH v3 06/10] net/mlx5: remove useless empty lines
Date: Mon, 5 Mar 2018 13:21:02 +0100 [thread overview]
Message-ID: <a863558993e89441dd5aa722d9e08122354e40ca.1520252354.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1520252354.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1520252354.git.nelio.laranjeiro@6wind.com>
Some empty lines have been added in the middle of the code without any
reason. This commit removes them.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
drivers/net/mlx5/mlx5.c | 22 ----------------------
drivers/net/mlx5/mlx5_ethdev.c | 7 -------
drivers/net/mlx5/mlx5_mr.c | 1 -
| 2 --
drivers/net/mlx5/mlx5_rxq.c | 1 -
drivers/net/mlx5/mlx5_vlan.c | 6 ------
6 files changed, 39 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index cdf99b5ad..91149ccee 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -597,7 +597,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
return -ENOMEM;
}
DEBUG("using driver device index %d", idx);
-
/* Save PCI address. */
mlx5_dev[idx].pci_addr = pci_dev->addr;
list = mlx5_glue->get_device_list(&i);
@@ -644,7 +643,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
return -err;
}
ibv_dev = list[i];
-
DEBUG("device opened");
/*
* Multi-packet send is supported by ConnectX-4 Lx PF as well
@@ -685,7 +683,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
if (mlx5_glue->query_device_ex(attr_ctx, NULL, &device_attr))
goto error;
INFO("%u port(s) detected", device_attr.orig_attr.phys_port_cnt);
-
for (i = 0; i < device_attr.orig_attr.phys_port_cnt; i++) {
char name[RTE_ETH_NAME_MAX_LEN];
int len;
@@ -716,9 +713,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
pci_dev->addr.devid, pci_dev->addr.function);
if (device_attr.orig_attr.phys_port_cnt > 1)
snprintf(name + len, sizeof(name), " port %u", i);
-
mlx5_dev[idx].ports |= test;
-
if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
eth_dev = rte_eth_dev_attach_secondary(name);
if (eth_dev == NULL) {
@@ -755,15 +750,12 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
priv_select_tx_function(priv, eth_dev);
continue;
}
-
DEBUG("using port %u (%08" PRIx32 ")", port, test);
-
ctx = mlx5_glue->open_device(ibv_dev);
if (ctx == NULL) {
err = ENODEV;
goto port_error;
}
-
mlx5_glue->query_device_ex(ctx, NULL, &device_attr);
/* Check port status. */
err = mlx5_glue->query_port(ctx, port, &port_attr);
@@ -771,19 +763,16 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
ERROR("port query failed: %s", strerror(err));
goto port_error;
}
-
if (port_attr.link_layer != IBV_LINK_LAYER_ETHERNET) {
ERROR("port %d is not configured in Ethernet mode",
port);
err = EINVAL;
goto port_error;
}
-
if (port_attr.state != IBV_PORT_ACTIVE)
DEBUG("port %d is not active: \"%s\" (%d)",
port, mlx5_glue->port_state_str(port_attr.state),
port_attr.state);
-
/* Allocate protection domain. */
pd = mlx5_glue->alloc_pd(ctx);
if (pd == NULL) {
@@ -791,9 +780,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
err = ENOMEM;
goto port_error;
}
-
mlx5_dev[idx].ports |= test;
-
/* from rte_ethdev.c */
priv = rte_zmalloc("ethdev private structure",
sizeof(*priv),
@@ -803,7 +790,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
err = ENOMEM;
goto port_error;
}
-
priv->ctx = ctx;
strncpy(priv->ibdev_path, priv->ctx->device->ibdev_path,
sizeof(priv->ibdev_path));
@@ -821,7 +807,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
ERROR("ibv_query_device_ex() failed");
goto port_error;
}
-
config.hw_csum = !!(device_attr_ex.device_cap_flags_ex &
IBV_DEVICE_RAW_IP_CSUM);
DEBUG("checksum offloading is %ssupported",
@@ -857,7 +842,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
#endif
DEBUG("hardware RX end alignment padding is %ssupported",
(config.hw_padding ? "" : "not "));
-
config.tso = ((device_attr_ex.tso_caps.max_tso > 0) &&
(device_attr_ex.tso_caps.supported_qpts &
(1 << IBV_QPT_RAW_PACKET)));
@@ -906,7 +890,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
/* Get actual MTU if possible. */
priv_get_mtu(priv, &priv->mtu);
DEBUG("port %u MTU is %u", priv->port, priv->mtu);
-
eth_dev = rte_eth_dev_allocate(name);
if (eth_dev == NULL) {
ERROR("can not allocate rte ethdev");
@@ -929,7 +912,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
claim_zero(mlx5_mac_addr_add(eth_dev, &mac, 0, 0));
TAILQ_INIT(&priv->flows);
TAILQ_INIT(&priv->ctrl_flows);
-
/* Hint libmlx5 to use PMD allocator for data plane resources */
struct mlx5dv_ctx_allocators alctr = {
.alloc = &mlx5_alloc_verbs_buf,
@@ -946,7 +928,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
/* Store device configuration on private structure. */
priv->config = config;
continue;
-
port_error:
if (priv)
rte_free(priv);
@@ -956,20 +937,17 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
claim_zero(mlx5_glue->close_device(ctx));
break;
}
-
/*
* XXX if something went wrong in the loop above, there is a resource
* leak (ctx, pd, priv, dpdk ethdev) but we can do nothing about it as
* long as the dpdk does not provide a way to deallocate a ethdev and a
* way to enumerate the registered ethdevs to free the previous ones.
*/
-
/* no port found, complain */
if (!mlx5_dev[idx].ports) {
err = ENODEV;
goto error;
}
-
error:
if (attr_ctx)
claim_zero(mlx5_glue->close_device(attr_ctx));
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 9bbf1eb7d..5c43755d0 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -403,7 +403,6 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
char ifname[IF_NAMESIZE];
info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
-
priv_lock(priv);
/* FIXME: we should ask the device for these values. */
info->min_rx_bufsize = 32;
@@ -492,7 +491,6 @@ mlx5_link_update_unlocked_gset(struct rte_eth_dev *dev)
int link_speed = 0;
/* priv_lock() is not taken to allow concurrent calls. */
-
if (priv_ifreq(priv, SIOCGIFFLAGS, &ifr)) {
WARN("ioctl(SIOCGIFFLAGS) failed: %s", strerror(errno));
return -1;
@@ -838,7 +836,6 @@ mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
strerror(ret));
goto out;
}
-
fc_conf->autoneg = ethpause.autoneg;
if (ethpause.rx_pause && ethpause.tx_pause)
fc_conf->mode = RTE_FC_FULL;
@@ -849,7 +846,6 @@ mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
else
fc_conf->mode = RTE_FC_NONE;
ret = 0;
-
out:
priv_unlock(priv);
assert(ret >= 0);
@@ -890,7 +886,6 @@ mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
ethpause.tx_pause = 1;
else
ethpause.tx_pause = 0;
-
priv_lock(priv);
if (priv_ifreq(priv, SIOCETHTOOL, &ifr)) {
ret = errno;
@@ -900,7 +895,6 @@ mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
goto out;
}
ret = 0;
-
out:
priv_unlock(priv);
assert(ret >= 0);
@@ -1155,7 +1149,6 @@ priv_dev_interrupt_handler_install(struct priv *priv, struct rte_eth_dev *dev)
rte_intr_callback_register(&priv->intr_handle,
mlx5_dev_interrupt_handler, dev);
}
-
rc = priv_socket_init(priv);
if (!rc && priv->primary_socket) {
priv->intr_handle_socket.fd = priv->primary_socket;
diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
index 8748ddcf5..6624d0ffa 100644
--- a/drivers/net/mlx5/mlx5_mr.c
+++ b/drivers/net/mlx5/mlx5_mr.c
@@ -76,7 +76,6 @@ mlx5_check_mempool(struct rte_mempool *mp, uintptr_t *start,
rte_mempool_mem_iter(mp, mlx5_check_mempool_cb, &data);
*start = (uintptr_t)data.start;
*end = (uintptr_t)data.end;
-
return data.ret;
}
--git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index d06b0bee1..8f5c8beff 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -123,7 +123,6 @@ priv_rss_reta_index_resize(struct priv *priv, unsigned int reta_size)
return ENOMEM;
priv->reta_idx = mem;
priv->reta_idx_n = reta_size;
-
if (old_size < reta_size)
memset(&(*priv->reta_idx)[old_size], 0,
(reta_size - old_size) *
@@ -191,7 +190,6 @@ priv_dev_rss_reta_update(struct priv *priv,
ret = priv_rss_reta_index_resize(priv, reta_size);
if (ret)
return ret;
-
for (idx = 0, i = 0; (i != reta_size); ++i) {
idx = i / RTE_RETA_GROUP_SIZE;
pos = i % RTE_RETA_GROUP_SIZE;
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 6924202cc..320a12be9 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1067,7 +1067,6 @@ mlx5_priv_rxq_get(struct priv *priv, uint16_t idx)
rxq_ctrl = container_of((*priv->rxqs)[idx],
struct mlx5_rxq_ctrl,
rxq);
-
mlx5_priv_rxq_ibv_get(priv, idx);
rte_atomic32_inc(&rxq_ctrl->refcnt);
DEBUG("%p: Rx queue %p: refcnt %d", (void *)priv,
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index 75c345626..85ed546cb 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -120,14 +120,12 @@ priv_vlan_strip_queue_set(struct priv *priv, uint16_t idx, int on)
.flags_mask = IBV_WQ_FLAGS_CVLAN_STRIPPING,
.flags = vlan_offloads,
};
-
err = mlx5_glue->modify_wq(rxq_ctrl->ibv->wq, &mod);
if (err) {
ERROR("%p: failed to modified stripping mode: %s",
(void *)priv, strerror(err));
return;
}
-
/* Update related bits in RX queue. */
rxq->vlan_strip = !!on;
}
@@ -152,13 +150,11 @@ mlx5_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)
ERROR("VLAN stripping is not supported");
return;
}
-
/* Validate queue number */
if (queue >= priv->rxqs_n) {
ERROR("VLAN stripping, invalid queue number %d", queue);
return;
}
-
priv_lock(priv);
priv_vlan_strip_queue_set(priv, queue, on);
priv_unlock(priv);
@@ -186,13 +182,11 @@ mlx5_vlan_offload_set(struct rte_eth_dev *dev, int mask)
ERROR("VLAN stripping is not supported");
return 0;
}
-
/* Run on every RX queue and set/reset VLAN stripping. */
priv_lock(priv);
for (i = 0; (i != priv->rxqs_n); i++)
priv_vlan_strip_queue_set(priv, i, hw_vlan_strip);
priv_unlock(priv);
}
-
return 0;
}
--
2.11.0
next prev parent reply other threads:[~2018-03-05 12:21 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 9:29 [dpdk-dev] [PATCH 1/3] net/mlx5: add missing function documentation Nelio Laranjeiro
2018-02-15 9:29 ` [dpdk-dev] [PATCH 2/3] net/mlx5: convert return errno to negative ones Nelio Laranjeiro
2018-02-16 14:26 ` Adrien Mazarguil
2018-02-15 9:29 ` [dpdk-dev] [PATCH 3/3] net/mlx5: fix traffic restart function to return errors Nelio Laranjeiro
2018-02-16 14:26 ` Adrien Mazarguil
2018-02-16 14:26 ` [dpdk-dev] [PATCH 1/3] net/mlx5: add missing function documentation Adrien Mazarguil
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 00/10] net/mlx5: clean driver Nelio Laranjeiro
2018-03-05 12:20 ` [dpdk-dev] [PATCH v3 " Nelio Laranjeiro
2018-03-18 6:33 ` Shahaf Shuler
2018-03-21 17:34 ` Ferruh Yigit
2018-03-05 12:20 ` [dpdk-dev] [PATCH v3 01/10] net/mlx5: fix sriov flag Nelio Laranjeiro
2018-03-05 12:20 ` [dpdk-dev] [PATCH v3 02/10] net/mlx5: name parameters in function prototypes Nelio Laranjeiro
2018-03-05 12:20 ` [dpdk-dev] [PATCH v3 03/10] net/mlx5: mark parameters with unused attribute Nelio Laranjeiro
2018-03-05 12:21 ` [dpdk-dev] [PATCH v3 04/10] net/mlx5: normalize function prototypes Nelio Laranjeiro
2018-03-05 12:21 ` [dpdk-dev] [PATCH v3 05/10] net/mlx5: add missing function documentation Nelio Laranjeiro
2018-03-05 12:21 ` Nelio Laranjeiro [this message]
2018-03-05 12:21 ` [dpdk-dev] [PATCH v3 07/10] net/mlx5: remove control path locks Nelio Laranjeiro
2018-03-05 12:21 ` [dpdk-dev] [PATCH v3 08/10] net/mlx5: prefix all function with mlx5 Nelio Laranjeiro
2018-03-05 12:21 ` [dpdk-dev] [PATCH v3 09/10] net/mlx5: change non failing function return values Nelio Laranjeiro
2018-03-05 12:21 ` [dpdk-dev] [PATCH v3 10/10] net/mlx5: standardize on negative errno values Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 01/10] net/mlx5: fix sriov flag Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 02/10] net/mlx5: name parameters in function prototypes Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 03/10] net/mlx5: mark parameters with unused attribute Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 04/10] net/mlx5: normalize function prototypes Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 05/10] net/mlx5: add missing function documentation Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 06/10] net/mlx5: remove useless empty lines Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 07/10] net/mlx5: remove control path locks Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 08/10] net/mlx5: prefix all function with mlx5 Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 09/10] net/mlx5: change non failing function return values Nelio Laranjeiro
2018-02-28 15:12 ` [dpdk-dev] [PATCH v2 10/10] net/mlx5: standardize on negative errno values Nelio Laranjeiro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a863558993e89441dd5aa722d9e08122354e40ca.1520252354.git.nelio.laranjeiro@6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=yskoh@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).