Skip to contentSkip to conversation

RDMA/mlx5: Enable sniffer when device is in switchdev mode

PATCH Applied Leon Romanovsky 2 participants 2 messages Aug 3, 2020 – Aug 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/mlx5: Enable sniffer when device is in switchdev mode

From: Maor Gottlieb <[email protected]>

In order to allow sniffer when the RDMA device is in switchdev mode, we don't need to set the source port when creating the sniffer rule.

---
Sorry for being late and sending this in merge window, this patch is small enough to be taken anyway. It was in my queue for a weeks already, simply missed it.

Thanks

---
 drivers/infiniband/hw/mlx5/fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/fs.c +2 -1
index 1a7e6226f11a..fbbb1adac273 100644
@@ -954,7 +954,7 @@ static struct mlx5_ib_flow_handler *_create_flow_rule(struct mlx5_ib_dev *dev,
 	if (!flow_is_multicast_only(flow_attr))
 		set_underlay_qp(dev, spec, underlay_qpn);
 
-	if (dev->is_rep) {
+	if (dev->is_rep && flow_attr->type != IB_FLOW_ATTR_SNIFFER) {
 		struct mlx5_eswitch_rep *rep;
 
 		rep = dev->port[flow_attr->port - 1].rep;
@@ -1116,6 +1116,7 @@ static struct mlx5_ib_flow_handler *create_sniffer_rule(struct mlx5_ib_dev *dev,
 	int err;
 	static const struct ib_flow_attr flow_attr  = {
 		.num_of_specs = 0,
+		.type = IB_FLOW_ATTR_SNIFFER,
 		.size = sizeof(flow_attr)
 	};
 

--
2.26.2

maintainer Applied
#1 lore raw
Quoted 11 lines · Leon Romanovsky

From: Maor Gottlieb <[email protected]>

In order to allow sniffer when the RDMA device is in switchdev mode, we don't need to set the source port when creating the sniffer rule.

---
 drivers/infiniband/hw/mlx5/fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to for-next, thanks

Jason