Skip to contentSkip to conversation

skbedit cleanup

PATCH New Jamal Hadi Salim 1 participant 3 messages Dec 21, 2013

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

cover skbedit cleanup

These changes make skbedit behave similar to other actions when printing stats and participating in an action chain for a single flow

Jamal Hadi Salim (2):
[Iproute2: actions] skbedit to default to pipe [Iproute2: actions] skbedit print missing metadata

 tc/m_skbedit.c |    7 +++++++
 1 file changed, 7 insertions(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 skbedit to default to pipe

Allow skbedit to be used as is in an action chain by default without need to specify pipe

---
 tc/m_skbedit.c |    1 +
 1 file changed, 1 insertion(+)
tc/m_skbedit.c +1 -0
index cca05ed..6b582f3 100644
@@ -99,6 +99,7 @@ parse_skbedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 		argv++;
 	}
 
+	sel.action = TC_ACT_PIPE;
 	if (argc) {
 		if (matches(*argv, "reclassify") == 0) {
 			sel.action = TC_ACT_RECLASSIFY;
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/2 skbedit print missing metadata

In reply to Jamal Hadi Salim

skbedit should print the index and other generic metadata info

---
 tc/m_skbedit.c |    6 ++++++
 1 file changed, 6 insertions(+)
tc/m_skbedit.c +6 -0
index 6b582f3..4b4ee06 100644
@@ -165,6 +165,7 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 	__u32 *priority;
 	__u32 *mark;
 	__u16 *queue_mapping;
+	struct tc_skbedit *p = NULL;
 
 	if (arg == NULL)
 		return -1;
@@ -175,6 +176,7 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 		fprintf(f, "[NULL skbedit parameters]");
 		return -1;
 	}
+	p = RTA_DATA(tb[TCA_SKBEDIT_PARMS]);
 
 	fprintf(f, " skbedit");
 
@@ -191,6 +193,8 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 		fprintf(f, " mark %d", *mark);
 	}
 
+	fprintf(f, "\n\t index %d ref %d bind %d", p->index, p->refcnt, p->bindcnt);
+
 	if (show_stats) {
 		if (tb[TCA_SKBEDIT_TM]) {
 			struct tcf_t *tm = RTA_DATA(tb[TCA_SKBEDIT_TM]);
@@ -198,6 +202,8 @@ static int print_skbedit(struct action_util *au, FILE *f, struct rtattr *arg)
 		}
 	}
 
+	fprintf(f, "\n ");
+
 	return 0;
 }
 
Signature · 1 line
1.7.9.5