Skip to content

Commit

Permalink
Remove priority field from ternary table's action
Browse files Browse the repository at this point in the history
In P4TC, the kernel doesn't expand the returned bpf action with a priority
field because, at least as of now, there is no need for such field.
So when this priority field is emitted by the compiler, it causes a
mismatch between what the kernel returns and what the eBPF program is
expecting

Signed-off-by: Victor Nogueira <[email protected]>
  • Loading branch information
vbnogueira committed Aug 21, 2024
1 parent c7a2726 commit 3fbce4e
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 13 deletions.
6 changes: 0 additions & 6 deletions backends/tc/ebpfCodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,12 +896,6 @@ void EBPFTablePNA::emitValueStructStructure(EBPF::CodeBuilder *builder) {
builder->append("is_default_hit_act:1;");
builder->newline();

if (isTernaryTable()) {
builder->emitIndent();
builder->append("__u32 priority;");
builder->newline();
}

builder->emitIndent();
builder->append("union ");
builder->blockStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct __attribute__((__packed__)) MainControlImpl_set_ct_options_value {
u32 hit:1,
is_default_miss_act:1,
is_default_hit_act:1;
__u32 priority;
union {
struct {
} _NoAction;
Expand Down
1 change: 0 additions & 1 deletion testdata/p4tc_samples_outputs/matchtype_control_blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ struct __attribute__((__packed__)) MainControlImpl_ipv4_tbl_2_value {
u32 hit:1,
is_default_miss_act:1,
is_default_hit_act:1;
__u32 priority;
union {
struct {
} _NoAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ struct __attribute__((__packed__)) MainControlImpl_ipv4_tbl_2_value {
u32 hit:1,
is_default_miss_act:1,
is_default_hit_act:1;
__u32 priority;
union {
struct {
} _NoAction;
Expand Down Expand Up @@ -76,7 +75,6 @@ struct __attribute__((__packed__)) MainControlImpl_ipv4_tbl_3_value {
u32 hit:1,
is_default_miss_act:1,
is_default_hit_act:1;
__u32 priority;
union {
struct {
} _NoAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ struct __attribute__((__packed__)) MainControlImpl_set_ct_options_value {
u32 hit:1,
is_default_miss_act:1,
is_default_hit_act:1;
__u32 priority;
union {
struct {
} _NoAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ struct __attribute__((__packed__)) MainControlImpl_set_ct_options_value {
u32 hit:1,
is_default_miss_act:1,
is_default_hit_act:1;
__u32 priority;
union {
struct {
} _NoAction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct __attribute__((__packed__)) ingress_nh_table_value {
u32 hit:1,
is_default_miss_act:1,
is_default_hit_act:1;
__u32 priority;
union {
struct {
} _NoAction;
Expand Down

0 comments on commit 3fbce4e

Please sign in to comment.