DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix route Netlink message overflow
@ 2018-07-24  6:50 Nelio Laranjeiro
  2018-07-24 13:50 ` Shahaf Shuler
  0 siblings, 1 reply; 2+ messages in thread
From: Nelio Laranjeiro @ 2018-07-24  6:50 UTC (permalink / raw)
  To: dev, Yongseok Koh, Shahaf Shuler; +Cc: stable, Zijie Pan

Route Netlink message socket is wrongly initialised by registering to
the route link group.  This causes the socket to receive all link
message related to routes whereas the PMD do not expect to receive such
information.  In some situation it ends by filling the socket at a point
that any new message cannot be exchanged.
As the PMD is not expected to process such broadcast messages, the
parameter in the nl_group in the function is also remove.

Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org

Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5.c    | 8 ++++----
 drivers/net/mlx5/mlx5.h    | 2 +-
 drivers/net/mlx5/mlx5_nl.c | 5 +----
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index c62a52fd5..612392a20 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -946,8 +946,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		rte_spinlock_init(&priv->uar_lock[i]);
 #endif
 	/* Some internal functions rely on Netlink sockets, open them now. */
-	priv->nl_socket_rdma = mlx5_nl_init(0, NETLINK_RDMA);
-	priv->nl_socket_route =	mlx5_nl_init(RTMGRP_LINK, NETLINK_ROUTE);
+	priv->nl_socket_rdma = mlx5_nl_init(NETLINK_RDMA);
+	priv->nl_socket_route =	mlx5_nl_init(NETLINK_ROUTE);
 	priv->nl_sn = 0;
 	priv->representor = !!switch_info->representor;
 	priv->domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID;
@@ -1286,8 +1286,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	ibv_match[n] = NULL;
 
 	struct mlx5_dev_spawn_data list[n];
-	int nl_route = n ? mlx5_nl_init(0, NETLINK_ROUTE) : -1;
-	int nl_rdma = n ? mlx5_nl_init(0, NETLINK_RDMA) : -1;
+	int nl_route = n ? mlx5_nl_init(NETLINK_ROUTE) : -1;
+	int nl_rdma = n ? mlx5_nl_init(NETLINK_RDMA) : -1;
 	unsigned int i;
 	unsigned int u;
 
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 896158aed..65a45a34a 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -372,7 +372,7 @@ int mlx5_socket_connect(struct rte_eth_dev *priv);
 
 /* mlx5_nl.c */
 
-int mlx5_nl_init(uint32_t nlgroups, int protocol);
+int mlx5_nl_init(int protocol);
 int mlx5_nl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac,
 			 uint32_t index);
 int mlx5_nl_mac_addr_remove(struct rte_eth_dev *dev, struct ether_addr *mac,
diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c
index 008cd2c31..0cc26f9f1 100644
--- a/drivers/net/mlx5/mlx5_nl.c
+++ b/drivers/net/mlx5/mlx5_nl.c
@@ -89,8 +89,6 @@ struct mlx5_nl_ifindex_data {
 /**
  * Opens a Netlink socket.
  *
- * @param nl_groups
- *   Netlink group value (e.g. RTMGRP_LINK).
  * @param protocol
  *   Netlink protocol (e.g. NETLINK_ROUTE, NETLINK_RDMA).
  *
@@ -99,14 +97,13 @@ struct mlx5_nl_ifindex_data {
  *   rte_errno is set.
  */
 int
-mlx5_nl_init(uint32_t nl_groups, int protocol)
+mlx5_nl_init(int protocol)
 {
 	int fd;
 	int sndbuf_size = MLX5_SEND_BUF_SIZE;
 	int rcvbuf_size = MLX5_RECV_BUF_SIZE;
 	struct sockaddr_nl local = {
 		.nl_family = AF_NETLINK,
-		.nl_groups = nl_groups,
 	};
 	int ret;
 
-- 
2.18.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix route Netlink message overflow
  2018-07-24  6:50 [dpdk-dev] [PATCH] net/mlx5: fix route Netlink message overflow Nelio Laranjeiro
@ 2018-07-24 13:50 ` Shahaf Shuler
  0 siblings, 0 replies; 2+ messages in thread
From: Shahaf Shuler @ 2018-07-24 13:50 UTC (permalink / raw)
  To: Nélio Laranjeiro, dev, Yongseok Koh; +Cc: stable, Zijie Pan

Tuesday, July 24, 2018 9:50 AM, Nelio Laranjeiro:
> Subject: [PATCH] net/mlx5: fix route Netlink message overflow
> 
> Route Netlink message socket is wrongly initialised by registering to the
> route link group.  This causes the socket to receive all link message related to
> routes whereas the PMD do not expect to receive such information.  In some
> situation it ends by filling the socket at a point that any new message cannot
> be exchanged.
> As the PMD is not expected to process such broadcast messages, the
> parameter in the nl_group in the function is also remove.
> 
> Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to next-net-mlx, thanks. 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-24 13:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24  6:50 [dpdk-dev] [PATCH] net/mlx5: fix route Netlink message overflow Nelio Laranjeiro
2018-07-24 13:50 ` Shahaf Shuler

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).