diff --git a/drivers/net/tap/tap_bpf_insns.h b/drivers/net/tap/tap_bpf_insns.h index c406f784bf..89873b6dc6 100644 --- a/drivers/net/tap/tap_bpf_insns.h +++ b/drivers/net/tap/tap_bpf_insns.h @@ -6,17 +6,20 @@ /* bpf_insn array matching cls_q section. See tap_bpf_program.c file */ struct bpf_insn cls_q_insns[] = { - {0x61, 1, 1, 52, 0x00000000}, - {0x18, 2, 0, 0, 0xdeadbeef}, + {0x61, 2, 1, 52, 0x00000000}, + {0x18, 3, 0, 0, 0xdeadbeef}, {0x00, 0, 0, 0, 0x00000000}, - {0x63, 10, 2, -4, 0x00000000}, - {0x61, 2, 10, -4, 0x00000000}, - {0x07, 2, 0, 0, 0x00000001}, - {0x67, 2, 0, 0, 0x00000020}, - {0x77, 2, 0, 0, 0x00000020}, - {0xb7, 0, 0, 0, 0xffffffff}, - {0x1d, 1, 2, 1, 0x00000000}, + {0x63, 10, 3, -4, 0x00000000}, {0xb7, 0, 0, 0, 0x00000000}, + {0x61, 3, 10, -4, 0x00000000}, + {0x07, 3, 0, 0, 0x7cafe800}, + {0x67, 3, 0, 0, 0x00000020}, + {0x77, 3, 0, 0, 0x00000020}, + {0x5d, 2, 3, 4, 0x00000000}, + {0xb7, 2, 0, 0, 0x00000000}, + {0x63, 1, 2, 52, 0x00000000}, + {0x18, 0, 0, 0, 0xffffffff}, + {0x00, 0, 0, 0, 0x00000000}, {0x95, 0, 0, 0, 0x00000000}, }; @@ -1685,7 +1688,7 @@ struct bpf_insn l3_l4_hash_insns[] = { {0x4f, 3, 2, 0, 0x00000000}, {0x67, 3, 0, 0, 0x00000010}, {0x4f, 3, 1, 0, 0x00000000}, - {0x07, 3, 0, 0, 0x00000001}, + {0x07, 3, 0, 0, 0x7cafe800}, {0x63, 5, 3, 52, 0x00000000}, {0xb7, 7, 0, 0, 0x00000001}, {0xbf, 0, 7, 0, 0x00000000}, diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/tap_bpf_program.c index 848c50b659..8abb3b76c2 100644 --- a/drivers/net/tap/tap_bpf_program.c +++ b/drivers/net/tap/tap_bpf_program.c @@ -28,10 +28,10 @@ ((b) & 0xff)) /* - * The queue number is offset by 1, to distinguish packets that have - * gone through this rule (skb->cb[1] != 0) from others. + * The queue number is offset by a unique QUEUE_OFFSET, to distinguish + * packets that have gone through this rule (skb->cb[1] != 0) from others. */ -#define QUEUE_OFFSET 1 +#define QUEUE_OFFSET 0x7cafe800 #define PIN_GLOBAL_NS 2 #define KEY_IDX 0 @@ -63,6 +63,9 @@ match_q(struct __sk_buff *skb) if (queue != match_queue) return TC_ACT_OK; + + /* queue match */ + skb->cb[1] = 0; return TC_ACT_UNSPEC; }