]> Git Repo - linux.git/commit
net: ovs: fix ovs_drop_reasons error
authorMenglong Dong <[email protected]>
Wed, 21 Aug 2024 12:32:52 +0000 (20:32 +0800)
committerJakub Kicinski <[email protected]>
Thu, 22 Aug 2024 20:09:15 +0000 (13:09 -0700)
commit57fb67783c4011581882f32e656d738da1f82042
tree89745fee2c78bddd8ad78d833f0ded033399f836
parent3ddbf7b6966d8a679bd2a6f8104734face6de4a1
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: 9d802da40b7c ("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]>
net/openvswitch/datapath.c
This page took 0.052715 seconds and 4 git commands to generate.