aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2015-03-24 18:19:24 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-24 21:21:41 -0400
commit835c3d9b7a28f5ecfc2dea2300946e27811f16a5 (patch)
treec145404b376dec9a53bfecbc8507e00f7f22ec49
parentb1275eb32e1c543f0664ebbb9d9ec3baa9bbfcba (diff)
tools: bpf_asm: cleanup vlan extension related token
We now have K_VLANT, K_VLANP and K_VLANTPID. Clean them up into more descriptive token, namely K_VLAN_TCI, K_VLAN_AVAIL and K_VLAN_TPID. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--tools/net/bpf_exp.l8
-rw-r--r--tools/net/bpf_exp.y20
2 files changed, 14 insertions, 14 deletions
diff --git a/tools/net/bpf_exp.l b/tools/net/bpf_exp.l
index c83af3fb77de..7cc72a336645 100644
--- a/tools/net/bpf_exp.l
+++ b/tools/net/bpf_exp.l
@@ -90,10 +90,10 @@ extern void yyerror(const char *str);
90"#"?("hatype") { return K_HATYPE; } 90"#"?("hatype") { return K_HATYPE; }
91"#"?("rxhash") { return K_RXHASH; } 91"#"?("rxhash") { return K_RXHASH; }
92"#"?("cpu") { return K_CPU; } 92"#"?("cpu") { return K_CPU; }
93"#"?("vlan_tci") { return K_VLANT; } 93"#"?("vlan_tci") { return K_VLAN_TCI; }
94"#"?("vlan_pr") { return K_VLANP; } 94"#"?("vlan_pr") { return K_VLAN_AVAIL; }
95"#"?("vlan_avail") { return K_VLANP; } 95"#"?("vlan_avail") { return K_VLAN_AVAIL; }
96"#"?("vlan_tpid") { return K_VLANTPID; } 96"#"?("vlan_tpid") { return K_VLAN_TPID; }
97"#"?("rand") { return K_RAND; } 97"#"?("rand") { return K_RAND; }
98 98
99":" { return ':'; } 99":" { return ':'; }
diff --git a/tools/net/bpf_exp.y b/tools/net/bpf_exp.y
index f8332749b44c..e24eea1b0db5 100644
--- a/tools/net/bpf_exp.y
+++ b/tools/net/bpf_exp.y
@@ -56,7 +56,7 @@ static void bpf_set_jmp_label(char *label, enum jmp_type type);
56%token OP_LDXI 56%token OP_LDXI
57 57
58%token K_PKT_LEN K_PROTO K_TYPE K_NLATTR K_NLATTR_NEST K_MARK K_QUEUE K_HATYPE 58%token K_PKT_LEN K_PROTO K_TYPE K_NLATTR K_NLATTR_NEST K_MARK K_QUEUE K_HATYPE
59%token K_RXHASH K_CPU K_IFIDX K_VLANT K_VLANP K_VLANTPID K_POFF K_RAND 59%token K_RXHASH K_CPU K_IFIDX K_VLAN_TCI K_VLAN_AVAIL K_VLAN_TPID K_POFF K_RAND
60 60
61%token ':' ',' '[' ']' '(' ')' 'x' 'a' '+' 'M' '*' '&' '#' '%' 61%token ':' ',' '[' ']' '(' ')' 'x' 'a' '+' 'M' '*' '&' '#' '%'
62 62
@@ -155,10 +155,10 @@ ldb
155 | OP_LDB K_CPU { 155 | OP_LDB K_CPU {
156 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0, 156 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0,
157 SKF_AD_OFF + SKF_AD_CPU); } 157 SKF_AD_OFF + SKF_AD_CPU); }
158 | OP_LDB K_VLANT { 158 | OP_LDB K_VLAN_TCI {
159 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0, 159 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0,
160 SKF_AD_OFF + SKF_AD_VLAN_TAG); } 160 SKF_AD_OFF + SKF_AD_VLAN_TAG); }
161 | OP_LDB K_VLANP { 161 | OP_LDB K_VLAN_AVAIL {
162 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0, 162 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0,
163 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT); } 163 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT); }
164 | OP_LDB K_POFF { 164 | OP_LDB K_POFF {
@@ -167,7 +167,7 @@ ldb
167 | OP_LDB K_RAND { 167 | OP_LDB K_RAND {
168 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0, 168 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0,
169 SKF_AD_OFF + SKF_AD_RANDOM); } 169 SKF_AD_OFF + SKF_AD_RANDOM); }
170 | OP_LDB K_VLANTPID { 170 | OP_LDB K_VLAN_TPID {
171 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0, 171 bpf_set_curr_instr(BPF_LD | BPF_B | BPF_ABS, 0, 0,
172 SKF_AD_OFF + SKF_AD_VLAN_TPID); } 172 SKF_AD_OFF + SKF_AD_VLAN_TPID); }
173 ; 173 ;
@@ -209,10 +209,10 @@ ldh
209 | OP_LDH K_CPU { 209 | OP_LDH K_CPU {
210 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0, 210 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0,
211 SKF_AD_OFF + SKF_AD_CPU); } 211 SKF_AD_OFF + SKF_AD_CPU); }
212 | OP_LDH K_VLANT { 212 | OP_LDH K_VLAN_TCI {
213 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0, 213 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0,
214 SKF_AD_OFF + SKF_AD_VLAN_TAG); } 214 SKF_AD_OFF + SKF_AD_VLAN_TAG); }
215 | OP_LDH K_VLANP { 215 | OP_LDH K_VLAN_AVAIL {
216 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0, 216 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0,
217 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT); } 217 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT); }
218 | OP_LDH K_POFF { 218 | OP_LDH K_POFF {
@@ -221,7 +221,7 @@ ldh
221 | OP_LDH K_RAND { 221 | OP_LDH K_RAND {
222 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0, 222 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0,
223 SKF_AD_OFF + SKF_AD_RANDOM); } 223 SKF_AD_OFF + SKF_AD_RANDOM); }
224 | OP_LDH K_VLANTPID { 224 | OP_LDH K_VLAN_TPID {
225 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0, 225 bpf_set_curr_instr(BPF_LD | BPF_H | BPF_ABS, 0, 0,
226 SKF_AD_OFF + SKF_AD_VLAN_TPID); } 226 SKF_AD_OFF + SKF_AD_VLAN_TPID); }
227 ; 227 ;
@@ -268,10 +268,10 @@ ld
268 | OP_LD K_CPU { 268 | OP_LD K_CPU {
269 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0, 269 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0,
270 SKF_AD_OFF + SKF_AD_CPU); } 270 SKF_AD_OFF + SKF_AD_CPU); }
271 | OP_LD K_VLANT { 271 | OP_LD K_VLAN_TCI {
272 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0, 272 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0,
273 SKF_AD_OFF + SKF_AD_VLAN_TAG); } 273 SKF_AD_OFF + SKF_AD_VLAN_TAG); }
274 | OP_LD K_VLANP { 274 | OP_LD K_VLAN_AVAIL {
275 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0, 275 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0,
276 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT); } 276 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT); }
277 | OP_LD K_POFF { 277 | OP_LD K_POFF {
@@ -280,7 +280,7 @@ ld
280 | OP_LD K_RAND { 280 | OP_LD K_RAND {
281 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0, 281 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0,
282 SKF_AD_OFF + SKF_AD_RANDOM); } 282 SKF_AD_OFF + SKF_AD_RANDOM); }
283 | OP_LD K_VLANTPID { 283 | OP_LD K_VLAN_TPID {
284 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0, 284 bpf_set_curr_instr(BPF_LD | BPF_W | BPF_ABS, 0, 0,
285 SKF_AD_OFF + SKF_AD_VLAN_TPID); } 285 SKF_AD_OFF + SKF_AD_VLAN_TPID); }
286 | OP_LD 'M' '[' number ']' { 286 | OP_LD 'M' '[' number ']' {