All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2 net-next] bpf: Add support for IFLA_XDP_PROG_ID
@ 2017-06-21 21:29 Martin KaFai Lau
  2017-06-21 21:35 ` Daniel Borkmann
  2017-06-27 23:14 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Martin KaFai Lau @ 2017-06-21 21:29 UTC (permalink / raw)
  To: stephen; +Cc: Daniel Borkmann, Alexei Starovoitov, davem, netdev

This patch adds support to the newly added IFLA_XDP_PROG_ID.

./ip link show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdpgeneric/id:2 qdisc [...]

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
---
 include/linux/if_link.h |  1 +
 ip/iplink_xdp.c         | 12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index a536a24b1c28..75e6824094e3 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -905,6 +905,7 @@ enum {
 	IFLA_XDP_FD,
 	IFLA_XDP_ATTACHED,
 	IFLA_XDP_FLAGS,
+	IFLA_XDP_PROG_ID,
 	__IFLA_XDP_MAX,
 };
 
diff --git a/ip/iplink_xdp.c b/ip/iplink_xdp.c
index 98503fab7d3c..4857f50c80de 100644
--- a/ip/iplink_xdp.c
+++ b/ip/iplink_xdp.c
@@ -90,9 +90,15 @@ void xdp_dump(FILE *fp, struct rtattr *xdp)
 	if (mode == XDP_ATTACHED_NONE)
 		return;
 	else if (mode == XDP_ATTACHED_DRV)
-		fprintf(fp, "xdp ");
+		fprintf(fp, "xdp");
 	else if (mode == XDP_ATTACHED_SKB)
-		fprintf(fp, "xdpgeneric ");
+		fprintf(fp, "xdpgeneric");
 	else
-		fprintf(fp, "xdp[%u] ", mode);
+		fprintf(fp, "xdp[%u]", mode);
+
+	if (tb[IFLA_XDP_PROG_ID])
+		fprintf(fp, "/id:%u",
+			rta_getattr_u32(tb[IFLA_XDP_PROG_ID]));
+
+	fprintf(fp, " ");
 }
-- 
2.9.3

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

* Re: [PATCH iproute2 net-next] bpf: Add support for IFLA_XDP_PROG_ID
  2017-06-21 21:29 [PATCH iproute2 net-next] bpf: Add support for IFLA_XDP_PROG_ID Martin KaFai Lau
@ 2017-06-21 21:35 ` Daniel Borkmann
  2017-06-27 23:14 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2017-06-21 21:35 UTC (permalink / raw)
  To: Martin KaFai Lau, stephen; +Cc: Alexei Starovoitov, davem, netdev

On 06/21/2017 11:29 PM, Martin KaFai Lau wrote:
> This patch adds support to the newly added IFLA_XDP_PROG_ID.
>
> ./ip link show dev eth0
> 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdpgeneric/id:2 qdisc [...]
>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

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

* Re: [PATCH iproute2 net-next] bpf: Add support for IFLA_XDP_PROG_ID
  2017-06-21 21:29 [PATCH iproute2 net-next] bpf: Add support for IFLA_XDP_PROG_ID Martin KaFai Lau
  2017-06-21 21:35 ` Daniel Borkmann
@ 2017-06-27 23:14 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2017-06-27 23:14 UTC (permalink / raw)
  To: Martin KaFai Lau; +Cc: Daniel Borkmann, Alexei Starovoitov, davem, netdev

On Wed, 21 Jun 2017 14:29:42 -0700
Martin KaFai Lau <kafai@fb.com> wrote:

> This patch adds support to the newly added IFLA_XDP_PROG_ID.
> 
> ./ip link show dev eth0
> 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdpgeneric/id:2 qdisc [...]
> 
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>

Applied to net-next

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

end of thread, other threads:[~2017-06-27 23:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-21 21:29 [PATCH iproute2 net-next] bpf: Add support for IFLA_XDP_PROG_ID Martin KaFai Lau
2017-06-21 21:35 ` Daniel Borkmann
2017-06-27 23:14 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.