netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 master] {f,m}_bpf: dump tag over insns
@ 2017-02-23 12:07 Daniel Borkmann
  2017-02-23 17:02 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2017-02-23 12:07 UTC (permalink / raw)
  To: stephen; +Cc: alexei.starovoitov, netdev, Daniel Borkmann

We already export TCA_BPF_TAG resp. TCA_ACT_BPF_TAG from kernel commit
f1f7714ea51c ("bpf: rework prog_digest into prog_tag"), thus also dump
it when filter/actions are shown.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
 tc/f_bpf.c | 9 +++++++++
 tc/m_bpf.c | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index c4764d8..df8a259 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -216,6 +216,15 @@ static int bpf_print_opt(struct filter_util *qu, FILE *f,
 		bpf_print_ops(f, tb[TCA_BPF_OPS],
 			      rta_getattr_u16(tb[TCA_BPF_OPS_LEN]));
 
+	if (tb[TCA_BPF_TAG]) {
+		SPRINT_BUF(b);
+
+		fprintf(f, "tag %s ",
+			hexstring_n2a(RTA_DATA(tb[TCA_BPF_TAG]),
+				      RTA_PAYLOAD(tb[TCA_BPF_TAG]),
+				      b, sizeof(b)));
+	}
+
 	if (tb[TCA_BPF_POLICE]) {
 		fprintf(f, "\n");
 		tc_print_police(f, tb[TCA_BPF_POLICE]);
diff --git a/tc/m_bpf.c b/tc/m_bpf.c
index f043ae4..1ddc334 100644
--- a/tc/m_bpf.c
+++ b/tc/m_bpf.c
@@ -177,6 +177,15 @@ static int bpf_print_opt(struct action_util *au, FILE *f, struct rtattr *arg)
 		fprintf(f, " ");
 	}
 
+	if (tb[TCA_ACT_BPF_TAG]) {
+		SPRINT_BUF(b);
+
+		fprintf(f, "tag %s ",
+			hexstring_n2a(RTA_DATA(tb[TCA_ACT_BPF_TAG]),
+				      RTA_PAYLOAD(tb[TCA_ACT_BPF_TAG]),
+				      b, sizeof(b)));
+	}
+
 	fprintf(f, "default-action %s\n", action_n2a(parm->action));
 	fprintf(f, "\tindex %u ref %d bind %d", parm->index, parm->refcnt,
 		parm->bindcnt);
-- 
1.9.3

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

* Re: [PATCH iproute2 master] {f,m}_bpf: dump tag over insns
  2017-02-23 12:07 [PATCH iproute2 master] {f,m}_bpf: dump tag over insns Daniel Borkmann
@ 2017-02-23 17:02 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2017-02-23 17:02 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: alexei.starovoitov, netdev

On Thu, 23 Feb 2017 13:07:14 +0100
Daniel Borkmann <daniel@iogearbox.net> wrote:

> We already export TCA_BPF_TAG resp. TCA_ACT_BPF_TAG from kernel commit
> f1f7714ea51c ("bpf: rework prog_digest into prog_tag"), thus also dump
> it when filter/actions are shown.
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied

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

end of thread, other threads:[~2017-02-23 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23 12:07 [PATCH iproute2 master] {f,m}_bpf: dump tag over insns Daniel Borkmann
2017-02-23 17:02 ` Stephen Hemminger

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