Skip to content

Commit 57fb677

Browse files
image-dragonkuba-moo
authored andcommitted
net: ovs: fix ovs_drop_reasons error
There is something wrong with ovs_drop_reasons. ovs_drop_reasons[0] is "OVS_DROP_LAST_ACTION", but OVS_DROP_LAST_ACTION == __OVS_DROP_REASON + 1, which means that ovs_drop_reasons[1] should be "OVS_DROP_LAST_ACTION". And as Adrian tested, without the patch, adding flow to drop packets results in: drop at: do_execute_actions+0x197/0xb20 [openvsw (0xffffffffc0db6f97) origin: software input port ifindex: 8 timestamp: Tue Aug 20 10:19:17 2024 859853461 nsec protocol: 0x800 length: 98 original length: 98 drop reason: OVS_DROP_ACTION_ERROR With the patch, the same results in: drop at: do_execute_actions+0x197/0xb20 [openvsw (0xffffffffc0db6f97) origin: software input port ifindex: 8 timestamp: Tue Aug 20 10:16:13 2024 475856608 nsec protocol: 0x800 length: 98 original length: 98 drop reason: OVS_DROP_LAST_ACTION Fix this by initializing ovs_drop_reasons with index. Fixes: 9d802da ("net: openvswitch: add last-action drop reason") Signed-off-by: Menglong Dong <[email protected]> Tested-by: Adrian Moreno <[email protected]> Reviewed-by: Adrian Moreno <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3ddbf7b commit 57fb677

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/openvswitch/datapath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2706,7 +2706,7 @@ static struct pernet_operations ovs_net_ops = {
27062706
};
27072707

27082708
static const char * const ovs_drop_reasons[] = {
2709-
#define S(x) (#x),
2709+
#define S(x) [(x) & ~SKB_DROP_REASON_SUBSYS_MASK] = (#x),
27102710
OVS_DROP_REASONS(S)
27112711
#undef S
27122712
};

0 commit comments

Comments
 (0)