[PATCH net-next 00/10] bpf: xdp: Report bpf_prog ID in IFLA_XDP

STALE3415d SUPERSEDED

Revision v1 of 3 in this series.

19 messages, 5 authors, 2017-06-13 · open the first message on its own page

[PATCH net-next 00/10] bpf: xdp: Report bpf_prog ID in IFLA_XDP

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:28

This is the first usage of the new bpf_prog ID.  It is for
reporting the ID of a xdp_prog through netlink.

It rides on the existing IFLA_XDP.  This patch adds IFLA_XDP_PROG_ID
for the bpf_prog ID reporting.

It starts with changing the generic_xdp first.  After that,
the hardware driver is changed one by one.  The final patch
removes the prog_attached from 'struct netdev_xdp' because
prog_id > 0 implies the presence of xdp_prog.

I have tested with generic_xdp, mlx4 and mlx5.

Martin KaFai Lau (10):
  net: Add IFLA_XDP_PROG_ID
  bpf: mlx4: Report bpf_prog ID during XDP_QUERY_PROG
  bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG
  bpf: virtio_net: Report bpf_prog ID during XDP_QUERY_PROG
  bpf: bnxt: Report bpf_prog ID during XDP_QUERY_PROG
  bpf: thunderx: Report bpf_prog ID during XDP_QUERY_PROG
  bpf: ixgbe: Report bpf_prog ID during XDP_QUERY_PROG
  bpf: nfp: Report bpf_prog ID during XDP_QUERY_PROG
  bpf: qede: Report bpf_prog ID during XDP_QUERY_PROG
  net: Remove prog_attached from struct netdev_xdp

 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c      | 11 ++++++--
 drivers/net/ethernet/cavium/thunder/nicvf_main.c   | 11 ++++++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      | 11 ++++++--
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c     | 20 ++++++++++++--
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  | 14 ++++++++--
 .../net/ethernet/netronome/nfp/nfp_net_common.c    | 11 ++++++--
 drivers/net/ethernet/qlogic/qede/qede_filter.c     | 11 ++++++--
 drivers/net/virtio_net.c                           | 12 ++++----
 include/linux/netdevice.h                          |  4 +--
 include/uapi/linux/if_link.h                       |  1 +
 net/core/dev.c                                     | 15 +++++-----
 net/core/rtnetlink.c                               | 32 +++++++++++++++++-----
 12 files changed, 116 insertions(+), 37 deletions(-)

-- 
2.9.3

[PATCH net-next 02/10] bpf: mlx4: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:28

Add support to mlx4 to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Tariq Toukan <redacted>
Cc: Saeed Mahameed <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index c1de75fc399a..ba5233d6e19b 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2821,11 +2821,25 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
 	return err;
 }
 
-static bool mlx4_xdp_attached(struct net_device *dev)
+static u32 mlx4_xdp_query(struct net_device *dev)
 {
+	const struct bpf_prog *xdp_prog;
 	struct mlx4_en_priv *priv = netdev_priv(dev);
+	struct mlx4_en_dev *mdev = priv->mdev;
+	u32 prog_id = 0;
+
+	if (!priv->tx_ring_num[TX_XDP])
+		return prog_id;
+
+	mutex_lock(&mdev->state_lock);
+	xdp_prog = rcu_dereference_protected(
+		priv->rx_ring[0]->xdp_prog,
+		lockdep_is_held(&mdev->state_lock));
+	if (xdp_prog)
+		prog_id = xdp_prog->aux->id;
+	mutex_unlock(&mdev->state_lock);
 
-	return !!priv->tx_ring_num[TX_XDP];
+	return prog_id;
 }
 
 static int mlx4_xdp(struct net_device *dev, struct netdev_xdp *xdp)
@@ -2834,7 +2848,7 @@ static int mlx4_xdp(struct net_device *dev, struct netdev_xdp *xdp)
 	case XDP_SETUP_PROG:
 		return mlx4_xdp_set(dev, xdp->prog);
 	case XDP_QUERY_PROG:
-		xdp->prog_attached = mlx4_xdp_attached(dev);
+		xdp->prog_id = mlx4_xdp_query(dev);
 		return 0;
 	default:
 		return -EINVAL;
-- 
2.9.3

[PATCH net-next 05/10] bpf: bnxt: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:29

Add support to bnxt to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Michael Chan <michael.chan@broadcom.com>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
index 8ce793a0d030..5bf1c7ddb378 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
@@ -216,10 +216,17 @@ int bnxt_xdp(struct net_device *dev, struct netdev_xdp *xdp)
 	case XDP_SETUP_PROG:
 		rc = bnxt_xdp_set(bp, xdp->prog);
 		break;
-	case XDP_QUERY_PROG:
-		xdp->prog_attached = !!bp->xdp_prog;
+	case XDP_QUERY_PROG: {
+		const struct bpf_prog *xdp_prog;
+
+		xdp_prog = READ_ONCE(bp->xdp_prog);
+		if (xdp_prog)
+			xdp->prog_id = xdp_prog->aux->id;
+		else
+			xdp->prog_id = 0;
 		rc = 0;
 		break;
+	}
 	default:
 		rc = -EINVAL;
 		break;
-- 
2.9.3

[PATCH net-next 06/10] bpf: thunderx: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:29

Add support to thunderx to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Sunil Goutham <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index d6477af88085..00f8247f2a9a 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -1761,9 +1761,16 @@ static int nicvf_xdp(struct net_device *netdev, struct netdev_xdp *xdp)
 	switch (xdp->command) {
 	case XDP_SETUP_PROG:
 		return nicvf_xdp_setup(nic, xdp->prog);
-	case XDP_QUERY_PROG:
-		xdp->prog_attached = !!nic->xdp_prog;
+	case XDP_QUERY_PROG: {
+		const struct bpf_prog *xdp_prog;
+
+		xdp_prog = READ_ONCE(nic->xdp_prog);
+		if (xdp_prog)
+			xdp->prog_id = xdp_prog->aux->id;
+		else
+			xdp->prog_id = 0;
 		return 0;
+	}
 	default:
 		return -EINVAL;
 	}
-- 
2.9.3

[PATCH net-next 04/10] bpf: virtio_net: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:29

Add support to virtio_net to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Jason Wang <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/virtio_net.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 1f8c15cb63b0..8e2d9e32dcda 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1955,16 +1955,18 @@ static int virtnet_xdp_set(struct net_device *dev, struct bpf_prog *prog,
 	return err;
 }
 
-static bool virtnet_xdp_query(struct net_device *dev)
+static u32 virtnet_xdp_query(struct net_device *dev)
 {
+	const struct bpf_prog *xdp_prog;
 	struct virtnet_info *vi = netdev_priv(dev);
 	int i;
 
 	for (i = 0; i < vi->max_queue_pairs; i++) {
-		if (vi->rq[i].xdp_prog)
-			return true;
+		xdp_prog = rtnl_dereference(vi->rq[i].xdp_prog);
+		if (xdp_prog)
+			return xdp_prog->aux->id;
 	}
-	return false;
+	return 0;
 }
 
 static int virtnet_xdp(struct net_device *dev, struct netdev_xdp *xdp)
@@ -1973,7 +1975,7 @@ static int virtnet_xdp(struct net_device *dev, struct netdev_xdp *xdp)
 	case XDP_SETUP_PROG:
 		return virtnet_xdp_set(dev, xdp->prog, xdp->extack);
 	case XDP_QUERY_PROG:
-		xdp->prog_attached = virtnet_xdp_query(dev);
+		xdp->prog_id = virtnet_xdp_query(dev);
 		return 0;
 	default:
 		return -EINVAL;
-- 
2.9.3

[PATCH net-next 01/10] net: Add IFLA_XDP_PROG_ID

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:29

Expose prog_id through IFLA_XDP_PROG_ID.  This patch
makes modification to generic_xdp.  The later patches will
modify other xdp-supported drivers.

prog_id is added to struct net_dev_xdp.  It is redundant
to prog_attached because prog_id > 0 implies prog_attached.
Hence, prog_attached will be removed after other xdp-supported
drivers can report prog_id during XDP_QUERY_PROG.

iproute2 patch will be followed. Here is how the 'ip link'
will look like:
ip link show eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdp(prog_id:1) qdisc fq_codel state UP mode DEFAULT group default qlen 1000

Signed-off-by: Martin KaFai Lau <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 include/linux/netdevice.h    |  3 ++-
 include/uapi/linux/if_link.h |  1 +
 net/core/dev.c               | 23 +++++++++++++++--------
 net/core/rtnetlink.c         | 27 +++++++++++++++++++++------
 4 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 524c7776ce96..dec4a2f25c2e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -826,6 +826,7 @@ struct netdev_xdp {
 		/* XDP_QUERY_PROG */
 		bool prog_attached;
 	};
+	u32 prog_id;
 };
 
 #ifdef CONFIG_XFRM_OFFLOAD
@@ -3302,7 +3303,7 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
 typedef int (*xdp_op_t)(struct net_device *dev, struct netdev_xdp *xdp);
 int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
 		      int fd, u32 flags);
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op);
+bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op, u32 *prog_id);
 
 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 8ed679fe603f..dd88375a6580 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -907,6 +907,7 @@ enum {
 	IFLA_XDP_FD,
 	IFLA_XDP_ATTACHED,
 	IFLA_XDP_FLAGS,
+	IFLA_XDP_PROG_ID,
 	__IFLA_XDP_MAX,
 };
 
diff --git a/net/core/dev.c b/net/core/dev.c
index 8f72f4a9c6ac..aa7c6eba5af6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4341,13 +4341,12 @@ static struct static_key generic_xdp_needed __read_mostly;
 
 static int generic_xdp_install(struct net_device *dev, struct netdev_xdp *xdp)
 {
+	struct bpf_prog *old = rtnl_dereference(dev->xdp_prog);
 	struct bpf_prog *new = xdp->prog;
 	int ret = 0;
 
 	switch (xdp->command) {
-	case XDP_SETUP_PROG: {
-		struct bpf_prog *old = rtnl_dereference(dev->xdp_prog);
-
+	case XDP_SETUP_PROG:
 		rcu_assign_pointer(dev->xdp_prog, new);
 		if (old)
 			bpf_prog_put(old);
@@ -4359,10 +4358,12 @@ static int generic_xdp_install(struct net_device *dev, struct netdev_xdp *xdp)
 			dev_disable_lro(dev);
 		}
 		break;
-	}
 
 	case XDP_QUERY_PROG:
-		xdp->prog_attached = !!rcu_access_pointer(dev->xdp_prog);
+		if (old)
+			xdp->prog_id = old->aux->id;
+		else
+			xdp->prog_id = 0;
 		break;
 
 	default:
@@ -6930,7 +6931,8 @@ int dev_change_proto_down(struct net_device *dev, bool proto_down)
 }
 EXPORT_SYMBOL(dev_change_proto_down);
 
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op)
+bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op,
+			u32 *prog_id)
 {
 	struct netdev_xdp xdp;
 
@@ -6939,6 +6941,11 @@ bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op)
 
 	/* Query must always succeed. */
 	WARN_ON(xdp_op(dev, &xdp) < 0);
+	if (xdp.prog_id)
+		xdp.prog_attached = true;
+	if (prog_id)
+		*prog_id = xdp.prog_id;
+
 	return xdp.prog_attached;
 }
 
@@ -6984,10 +6991,10 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
 		xdp_chk = generic_xdp_install;
 
 	if (fd >= 0) {
-		if (xdp_chk && __dev_xdp_attached(dev, xdp_chk))
+		if (xdp_chk && __dev_xdp_attached(dev, xdp_chk, NULL))
 			return -EEXIST;
 		if ((flags & XDP_FLAGS_UPDATE_IF_NOEXIST) &&
-		    __dev_xdp_attached(dev, xdp_op))
+		    __dev_xdp_attached(dev, xdp_op, NULL))
 			return -EBUSY;
 
 		prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 7084f1db2446..f25a53b1fb92 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -39,6 +39,7 @@
 #include <linux/if_vlan.h>
 #include <linux/pci.h>
 #include <linux/etherdevice.h>
+#include <linux/bpf.h>
 
 #include <linux/uaccess.h>
 
@@ -899,7 +900,8 @@ static size_t rtnl_port_size(const struct net_device *dev,
 static size_t rtnl_xdp_size(void)
 {
 	size_t xdp_size = nla_total_size(0) +	/* nest IFLA_XDP */
-			  nla_total_size(1);	/* XDP_ATTACHED */
+			  nla_total_size(1) +	/* XDP_ATTACHED */
+			  nla_total_size(4);	/* XDP_PROG_ID */
 
 	return xdp_size;
 }
@@ -1247,15 +1249,20 @@ static int rtnl_fill_link_ifmap(struct sk_buff *skb, struct net_device *dev)
 	return 0;
 }
 
-static u8 rtnl_xdp_attached_mode(struct net_device *dev)
+static u8 rtnl_xdp_attached_mode(struct net_device *dev, u32 *prog_id)
 {
 	const struct net_device_ops *ops = dev->netdev_ops;
+	const struct bpf_prog *generic_xdp_prog;
 
 	ASSERT_RTNL();
 
-	if (rcu_access_pointer(dev->xdp_prog))
+	*prog_id = 0;
+	generic_xdp_prog = rtnl_dereference(dev->xdp_prog);
+	if (generic_xdp_prog) {
+		*prog_id = generic_xdp_prog->aux->id;
 		return XDP_ATTACHED_SKB;
-	if (ops->ndo_xdp && __dev_xdp_attached(dev, ops->ndo_xdp))
+	}
+	if (ops->ndo_xdp && __dev_xdp_attached(dev, ops->ndo_xdp, prog_id))
 		return XDP_ATTACHED_DRV;
 
 	return XDP_ATTACHED_NONE;
@@ -1264,6 +1271,7 @@ static u8 rtnl_xdp_attached_mode(struct net_device *dev)
 static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)
 {
 	struct nlattr *xdp;
+	u32 prog_id;
 	int err;
 
 	xdp = nla_nest_start(skb, IFLA_XDP);
@@ -1271,10 +1279,16 @@ static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)
 		return -EMSGSIZE;
 
 	err = nla_put_u8(skb, IFLA_XDP_ATTACHED,
-			 rtnl_xdp_attached_mode(dev));
+			 rtnl_xdp_attached_mode(dev, &prog_id));
 	if (err)
 		goto err_cancel;
 
+	if (prog_id) {
+		err = nla_put_u32(skb, IFLA_XDP_PROG_ID, prog_id);
+		if (err)
+			goto err_cancel;
+	}
+
 	nla_nest_end(skb, xdp);
 	return 0;
 
@@ -1552,6 +1566,7 @@ static const struct nla_policy ifla_xdp_policy[IFLA_XDP_MAX + 1] = {
 	[IFLA_XDP_FD]		= { .type = NLA_S32 },
 	[IFLA_XDP_ATTACHED]	= { .type = NLA_U8 },
 	[IFLA_XDP_FLAGS]	= { .type = NLA_U32 },
+	[IFLA_XDP_PROG_ID]	= { .type = NLA_U32 },
 };
 
 static const struct rtnl_link_ops *linkinfo_to_kind_ops(const struct nlattr *nla)
@@ -2224,7 +2239,7 @@ static int do_setlink(const struct sk_buff *skb,
 		if (err < 0)
 			goto errout;
 
-		if (xdp[IFLA_XDP_ATTACHED]) {
+		if (xdp[IFLA_XDP_ATTACHED] || xdp[IFLA_XDP_PROG_ID]) {
 			err = -EINVAL;
 			goto errout;
 		}
-- 
2.9.3

[PATCH net-next 08/10] bpf: nfp: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:30

Add support to nfp to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Jakub Kicinski <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 49d1756d6a8e..e4d175853dc7 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -3254,9 +3254,16 @@ static int nfp_net_xdp(struct net_device *netdev, struct netdev_xdp *xdp)
 	switch (xdp->command) {
 	case XDP_SETUP_PROG:
 		return nfp_net_xdp_setup(nn, xdp);
-	case XDP_QUERY_PROG:
-		xdp->prog_attached = !!nn->dp.xdp_prog;
+	case XDP_QUERY_PROG: {
+		const struct bpf_prog *xdp_prog;
+
+		xdp_prog = READ_ONCE(nn->dp.xdp_prog);
+		if (xdp_prog)
+			xdp->prog_id = xdp_prog->aux->id;
+		else
+			xdp->prog_id = 0;
 		return 0;
+	}
 	default:
 		return -EINVAL;
 	}
-- 
2.9.3

[PATCH net-next 09/10] bpf: qede: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:30

Add support to qede to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Mintz, Yuval <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/ethernet/qlogic/qede/qede_filter.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_filter.c b/drivers/net/ethernet/qlogic/qede/qede_filter.c
index 13955a3bd3b3..26b652ae5ec1 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_filter.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_filter.c
@@ -1035,9 +1035,16 @@ int qede_xdp(struct net_device *dev, struct netdev_xdp *xdp)
 	switch (xdp->command) {
 	case XDP_SETUP_PROG:
 		return qede_xdp_set(edev, xdp->prog);
-	case XDP_QUERY_PROG:
-		xdp->prog_attached = !!edev->xdp_prog;
+	case XDP_QUERY_PROG: {
+		const struct bpf_prog *xdp_prog;
+
+		xdp_prog = READ_ONCE(edev->xdp_prog);
+		if (xdp_prog)
+			xdp->prog_id = xdp_prog->aux->id;
+		else
+			xdp->prog_id = 0;
 		return 0;
+	}
 	default:
 		return -EINVAL;
 	}
-- 
2.9.3

[PATCH net-next 10/10] net: Remove prog_attached from struct netdev_xdp

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:30

prog_attached can be implied by prog_id (!!prog_id) and
all drivers supporting xdp has been stopped setting prog_attached.

Signed-off-by: Martin KaFai Lau <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 include/linux/netdevice.h |  5 ++---
 net/core/dev.c            | 14 ++++----------
 net/core/rtnetlink.c      |  7 +++++--
 3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index dec4a2f25c2e..a4ac0821b903 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -824,9 +824,8 @@ struct netdev_xdp {
 			struct netlink_ext_ack *extack;
 		};
 		/* XDP_QUERY_PROG */
-		bool prog_attached;
+		u32 prog_id;
 	};
-	u32 prog_id;
 };
 
 #ifdef CONFIG_XFRM_OFFLOAD
@@ -3303,7 +3302,7 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
 typedef int (*xdp_op_t)(struct net_device *dev, struct netdev_xdp *xdp);
 int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
 		      int fd, u32 flags);
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op, u32 *prog_id);
+u32 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op);
 
 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
diff --git a/net/core/dev.c b/net/core/dev.c
index aa7c6eba5af6..a484f946267c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6931,8 +6931,7 @@ int dev_change_proto_down(struct net_device *dev, bool proto_down)
 }
 EXPORT_SYMBOL(dev_change_proto_down);
 
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op,
-			u32 *prog_id)
+u32 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op)
 {
 	struct netdev_xdp xdp;
 
@@ -6941,12 +6940,7 @@ bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op,
 
 	/* Query must always succeed. */
 	WARN_ON(xdp_op(dev, &xdp) < 0);
-	if (xdp.prog_id)
-		xdp.prog_attached = true;
-	if (prog_id)
-		*prog_id = xdp.prog_id;
-
-	return xdp.prog_attached;
+	return xdp.prog_id;
 }
 
 static int dev_xdp_install(struct net_device *dev, xdp_op_t xdp_op,
@@ -6991,10 +6985,10 @@ int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
 		xdp_chk = generic_xdp_install;
 
 	if (fd >= 0) {
-		if (xdp_chk && __dev_xdp_attached(dev, xdp_chk, NULL))
+		if (xdp_chk && __dev_xdp_attached(dev, xdp_chk))
 			return -EEXIST;
 		if ((flags & XDP_FLAGS_UPDATE_IF_NOEXIST) &&
-		    __dev_xdp_attached(dev, xdp_op, NULL))
+		    __dev_xdp_attached(dev, xdp_op))
 			return -EBUSY;
 
 		prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index f25a53b1fb92..feba0ec757c4 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1262,8 +1262,11 @@ static u8 rtnl_xdp_attached_mode(struct net_device *dev, u32 *prog_id)
 		*prog_id = generic_xdp_prog->aux->id;
 		return XDP_ATTACHED_SKB;
 	}
-	if (ops->ndo_xdp && __dev_xdp_attached(dev, ops->ndo_xdp, prog_id))
-		return XDP_ATTACHED_DRV;
+	if (ops->ndo_xdp) {
+		*prog_id = __dev_xdp_attached(dev, ops->ndo_xdp);
+		if (*prog_id)
+			return XDP_ATTACHED_DRV;
+	}
 
 	return XDP_ATTACHED_NONE;
 }
-- 
2.9.3

[PATCH net-next 07/10] bpf: ixgbe: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:30

Add support to ixgbe to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Alexander Duyck <redacted>
Cc: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 812319ab77db..62fb564d62a2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9799,9 +9799,16 @@ static int ixgbe_xdp(struct net_device *dev, struct netdev_xdp *xdp)
 	switch (xdp->command) {
 	case XDP_SETUP_PROG:
 		return ixgbe_xdp_setup(dev, xdp->prog);
-	case XDP_QUERY_PROG:
-		xdp->prog_attached = !!(adapter->xdp_prog);
+	case XDP_QUERY_PROG: {
+		const struct bpf_prog *xdp_prog;
+
+		xdp_prog = READ_ONCE(adapter->xdp_prog);
+		if (xdp_prog)
+			xdp->prog_id = xdp_prog->aux->id;
+		else
+			xdp->prog_id = 0;
 		return 0;
+	}
 	default:
 		return -EINVAL;
 	}
-- 
2.9.3

[PATCH net-next 03/10] bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 01:00:30

Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Tariq Toukan <redacted>
Cc: Saeed Mahameed <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 5afec0f4a658..c3ed2e122e12 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3599,11 +3599,19 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog)
 	return err;
 }
 
-static bool mlx5e_xdp_attached(struct net_device *dev)
+static u32 mlx5e_xdp_query(struct net_device *dev)
 {
+	const struct bpf_prog *xdp_prog;
 	struct mlx5e_priv *priv = netdev_priv(dev);
+	u32 prog_id = 0;
 
-	return !!priv->channels.params.xdp_prog;
+	mutex_lock(&priv->state_lock);
+	xdp_prog = READ_ONCE(priv->channels.params.xdp_prog);
+	if (xdp_prog)
+		prog_id = xdp_prog->aux->id;
+	mutex_unlock(&priv->state_lock);
+
+	return prog_id;
 }
 
 static int mlx5e_xdp(struct net_device *dev, struct netdev_xdp *xdp)
@@ -3612,7 +3620,7 @@ static int mlx5e_xdp(struct net_device *dev, struct netdev_xdp *xdp)
 	case XDP_SETUP_PROG:
 		return mlx5e_xdp_set(dev, xdp->prog);
 	case XDP_QUERY_PROG:
-		xdp->prog_attached = mlx5e_xdp_attached(dev);
+		xdp->prog_id = mlx5e_xdp_query(dev);
 		return 0;
 	default:
 		return -EINVAL;
-- 
2.9.3

Re: [PATCH net-next 00/10] bpf: xdp: Report bpf_prog ID in IFLA_XDP

From: Jakub Kicinski <hidden>
Date: 2017-06-13 01:26:11

On Mon, 12 Jun 2017 18:00:15 -0700, Martin KaFai Lau wrote:
This is the first usage of the new bpf_prog ID.  It is for
reporting the ID of a xdp_prog through netlink.

It rides on the existing IFLA_XDP.  This patch adds IFLA_XDP_PROG_ID
for the bpf_prog ID reporting.

It starts with changing the generic_xdp first.  After that,
the hardware driver is changed one by one.  The final patch
removes the prog_attached from 'struct netdev_xdp' because
prog_id > 0 implies the presence of xdp_prog.
Daniel made the XDP_ATTACHED an enum to be able to extend it with other
modes.  I would appreciate if you didn't remove the member since I have
this waiting in my tree:

From: Jakub Kicinski <redacted>
Date: Mon, 5 Jun 2017 22:52:01 -0700
Subject: [PATCH net-next] xdp: add reporting of offload mode

Extend the XDP_ATTACHED_* values to include offloaded mode.
Let drivers report whether program is installed in the driver
or the HW by changing the prog_attached field from bool to
u8 (type of the netlink attribute).

Signed-off-by: Jakub Kicinski <redacted>
---
 include/linux/netdevice.h    | 7 ++++---
 include/uapi/linux/if_link.h | 1 +
 net/core/dev.c               | 2 +-
 net/core/rtnetlink.c         | 6 +++---
 4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 524c7776ce96..76165dfd2a1e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -808,7 +808,8 @@ enum xdp_netdev_command {
 	 */
 	XDP_SETUP_PROG,
 	/* Check if a bpf program is set on the device.  The callee should
-	 * return true if a program is currently attached and running.
+	 * set @prog_attached to one of XDP_ATTACHED_* values, note that "true"
+	 * is equivalent to XDP_ATTACHED_DRV.
 	 */
 	XDP_QUERY_PROG,
 };
@@ -824,7 +825,7 @@ struct netdev_xdp {
 			struct netlink_ext_ack *extack;
 		};
 		/* XDP_QUERY_PROG */
-		bool prog_attached;
+		u8 prog_attached;
 	};
 };
 
@@ -3302,7 +3303,7 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
 typedef int (*xdp_op_t)(struct net_device *dev, struct netdev_xdp *xdp);
 int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
 		      int fd, u32 flags);
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op);
+u8 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op);
 
 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 8ed679fe603f..4dd59b7463a9 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -900,6 +900,7 @@ enum {
 	XDP_ATTACHED_NONE = 0,
 	XDP_ATTACHED_DRV,
 	XDP_ATTACHED_SKB,
+	XDP_ATTACHED_HW,
 };
 
 enum {
diff --git a/net/core/dev.c b/net/core/dev.c
index 8f72f4a9c6ac..8f29b6ba99ac 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6930,7 +6930,7 @@ int dev_change_proto_down(struct net_device *dev, bool proto_down)
 }
 EXPORT_SYMBOL(dev_change_proto_down);
 
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op)
+u8 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op)
 {
 	struct netdev_xdp xdp;
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 7084f1db2446..5b16e479ea68 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1255,10 +1255,10 @@ static u8 rtnl_xdp_attached_mode(struct net_device *dev)
 
 	if (rcu_access_pointer(dev->xdp_prog))
 		return XDP_ATTACHED_SKB;
-	if (ops->ndo_xdp && __dev_xdp_attached(dev, ops->ndo_xdp))
-		return XDP_ATTACHED_DRV;
+	if (!ops->ndo_xdp)
+		return XDP_ATTACHED_NONE;
 
-	return XDP_ATTACHED_NONE;
+	return __dev_xdp_attached(dev, ops->ndo_xdp);
 }
 
 static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)
-- 
2.11.0

Re: [PATCH net-next 08/10] bpf: nfp: Report bpf_prog ID during XDP_QUERY_PROG

From: Jakub Kicinski <hidden>
Date: 2017-06-13 01:28:46

On Mon, 12 Jun 2017 18:00:23 -0700, Martin KaFai Lau wrote:
quoted hunk
+	case XDP_QUERY_PROG: {
+		const struct bpf_prog *xdp_prog;
+
+		xdp_prog = READ_ONCE(nn->dp.xdp_prog);
+		if (xdp_prog)
+			xdp->prog_id = xdp_prog->aux->id;
+		else
+			xdp->prog_id = 0;
 		return 0;
+	}
 	default:
 		return -EINVAL;
 	}
Why READ_ONCE?  I thought .ndo_xdp is always called under RTNL.

Re: [PATCH net-next 08/10] bpf: nfp: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 04:56:38

On Mon, Jun 12, 2017 at 06:28:42PM -0700, Jakub Kicinski wrote:
On Mon, 12 Jun 2017 18:00:23 -0700, Martin KaFai Lau wrote:
quoted
+	case XDP_QUERY_PROG: {
+		const struct bpf_prog *xdp_prog;
+
+		xdp_prog = READ_ONCE(nn->dp.xdp_prog);
+		if (xdp_prog)
+			xdp->prog_id = xdp_prog->aux->id;
+		else
+			xdp->prog_id = 0;
 		return 0;
+	}
 	default:
 		return -EINVAL;
 	}
Why READ_ONCE?  I thought .ndo_xdp is always called under RTNL.
will remove in the next spin.

Re: [PATCH net-next 00/10] bpf: xdp: Report bpf_prog ID in IFLA_XDP

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 05:35:52

On Mon, Jun 12, 2017 at 06:26:02PM -0700, Jakub Kicinski wrote:
On Mon, 12 Jun 2017 18:00:15 -0700, Martin KaFai Lau wrote:
quoted
This is the first usage of the new bpf_prog ID.  It is for
reporting the ID of a xdp_prog through netlink.

It rides on the existing IFLA_XDP.  This patch adds IFLA_XDP_PROG_ID
for the bpf_prog ID reporting.

It starts with changing the generic_xdp first.  After that,
the hardware driver is changed one by one.  The final patch
removes the prog_attached from 'struct netdev_xdp' because
prog_id > 0 implies the presence of xdp_prog.
Daniel made the XDP_ATTACHED an enum to be able to extend it with other
modes.  I would appreciate if you didn't remove the member since I have
this waiting in my tree:
I see. I will keep prog_attached then.
From: Jakub Kicinski <redacted>
Date: Mon, 5 Jun 2017 22:52:01 -0700
Subject: [PATCH net-next] xdp: add reporting of offload mode

Extend the XDP_ATTACHED_* values to include offloaded mode.
Let drivers report whether program is installed in the driver
or the HW by changing the prog_attached field from bool to
u8 (type of the netlink attribute).

Signed-off-by: Jakub Kicinski <redacted>
---
 include/linux/netdevice.h    | 7 ++++---
j
quoted hunk
 include/uapi/linux/if_link.h | 1 +
 net/core/dev.c               | 2 +-
 net/core/rtnetlink.c         | 6 +++---
 4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 524c7776ce96..76165dfd2a1e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -808,7 +808,8 @@ enum xdp_netdev_command {
 	 */
 	XDP_SETUP_PROG,
 	/* Check if a bpf program is set on the device.  The callee should
-	 * return true if a program is currently attached and running.
+	 * set @prog_attached to one of XDP_ATTACHED_* values, note that "true"
+	 * is equivalent to XDP_ATTACHED_DRV.
 	 */
 	XDP_QUERY_PROG,
 };
@@ -824,7 +825,7 @@ struct netdev_xdp {
 			struct netlink_ext_ack *extack;
 		};
 		/* XDP_QUERY_PROG */
-		bool prog_attached;
+		u8 prog_attached;
 	};
 };
@@ -3302,7 +3303,7 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
 typedef int (*xdp_op_t)(struct net_device *dev, struct netdev_xdp *xdp);
 int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
 		      int fd, u32 flags);
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op);
+u8 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op);

 int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 8ed679fe603f..4dd59b7463a9 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -900,6 +900,7 @@ enum {
 	XDP_ATTACHED_NONE = 0,
 	XDP_ATTACHED_DRV,
 	XDP_ATTACHED_SKB,
+	XDP_ATTACHED_HW,
 };

 enum {
diff --git a/net/core/dev.c b/net/core/dev.c
index 8f72f4a9c6ac..8f29b6ba99ac 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6930,7 +6930,7 @@ int dev_change_proto_down(struct net_device *dev, bool proto_down)
 }
 EXPORT_SYMBOL(dev_change_proto_down);

-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op)
+u8 __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op)
 {
 	struct netdev_xdp xdp;
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 7084f1db2446..5b16e479ea68 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1255,10 +1255,10 @@ static u8 rtnl_xdp_attached_mode(struct net_device *dev)

 	if (rcu_access_pointer(dev->xdp_prog))
 		return XDP_ATTACHED_SKB;
-	if (ops->ndo_xdp && __dev_xdp_attached(dev, ops->ndo_xdp))
-		return XDP_ATTACHED_DRV;
+	if (!ops->ndo_xdp)
+		return XDP_ATTACHED_NONE;

-	return XDP_ATTACHED_NONE;
+	return __dev_xdp_attached(dev, ops->ndo_xdp);
 }

 static int rtnl_xdp_fill(struct sk_buff *skb, struct net_device *dev)
--
2.11.0

Re: [PATCH net-next 00/10] bpf: xdp: Report bpf_prog ID in IFLA_XDP

From: Jakub Kicinski <hidden>
Date: 2017-06-13 06:07:31

On Mon, 12 Jun 2017 22:35:34 -0700, Martin KaFai Lau wrote:
On Mon, Jun 12, 2017 at 06:26:02PM -0700, Jakub Kicinski wrote:
quoted
On Mon, 12 Jun 2017 18:00:15 -0700, Martin KaFai Lau wrote:  
quoted
This is the first usage of the new bpf_prog ID.  It is for
reporting the ID of a xdp_prog through netlink.

It rides on the existing IFLA_XDP.  This patch adds IFLA_XDP_PROG_ID
for the bpf_prog ID reporting.

It starts with changing the generic_xdp first.  After that,
the hardware driver is changed one by one.  The final patch
removes the prog_attached from 'struct netdev_xdp' because
prog_id > 0 implies the presence of xdp_prog.  
Daniel made the XDP_ATTACHED an enum to be able to extend it with other
modes.  I would appreciate if you didn't remove the member since I have
this waiting in my tree:  
I see. I will keep prog_attached then.
Thanks!

Re: [PATCH net-next 03/10] bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG

From: Saeed Mahameed <hidden>
Date: 2017-06-13 16:04:48

On Tue, Jun 13, 2017 at 4:00 AM, Martin KaFai Lau [off-list ref] wrote:
Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Tariq Toukan <redacted>
Cc: Saeed Mahameed <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Saeed Mahameed <redacted>

Thanks you Martin.

Re: [PATCH net-next 03/10] bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG

From: Martin KaFai Lau <hidden>
Date: 2017-06-13 18:50:10

On Tue, Jun 13, 2017 at 07:04:26PM +0300, Saeed Mahameed wrote:
On Tue, Jun 13, 2017 at 4:00 AM, Martin KaFai Lau [off-list ref] wrote:
quoted
Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Tariq Toukan <redacted>
Cc: Saeed Mahameed <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Saeed Mahameed <redacted>
Thanks for reviewing, Saeed.

I will respin v2 with READ_ONCE removed since
it is already under rtnl lock per Jakub Kicinski's
suggestion in nfp.  The situation should be similar
in mlx5e.

Re: [PATCH net-next 03/10] bpf: mlx5e: Report bpf_prog ID during XDP_QUERY_PROG

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2017-06-13 19:05:00

On 06/13/2017 08:49 PM, Martin KaFai Lau wrote:
On Tue, Jun 13, 2017 at 07:04:26PM +0300, Saeed Mahameed wrote:
quoted
On Tue, Jun 13, 2017 at 4:00 AM, Martin KaFai Lau [off-list ref] wrote:
quoted
Add support to mlx5e to report bpf_prog ID during XDP_QUERY_PROG.

Signed-off-by: Martin KaFai Lau <redacted>
Cc: Tariq Toukan <redacted>
Cc: Saeed Mahameed <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Saeed Mahameed <redacted>
Thanks for reviewing, Saeed.

I will respin v2 with READ_ONCE removed since
it is already under rtnl lock per Jakub Kicinski's
suggestion in nfp.  The situation should be similar
in mlx5e.
Sounds good, yeah, only needed in data path wrt program
updates.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help