kernel-hacking-2024-linux-s.../net/openvswitch
Menglong Dong 57fb67783c 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: 9d802da40b ("net: openvswitch: add last-action drop reason")
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Tested-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Adrian Moreno <amorenoz@redhat.com>
Link: https://patch.msgid.link/20240821123252.186305-1-dongml2@chinatelecom.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-08-22 13:09:15 -07:00
..
actions.c net: openvswitch: store sampling probability in cb. 2024-07-05 17:45:47 -07:00
conntrack.c openvswitch: prepare for stolen verdict coming from conntrack and nat engine 2024-07-05 11:05:05 +01:00
conntrack.h
datapath.c net: ovs: fix ovs_drop_reasons error 2024-08-22 13:09:15 -07:00
datapath.h net: openvswitch: store sampling probability in cb. 2024-07-05 17:45:47 -07:00
dp_notify.c
drop.h
flow.c
flow.h
flow_netlink.c net: openvswitch: add psample action 2024-07-05 17:45:47 -07:00
flow_netlink.h
flow_table.c
flow_table.h
Kconfig net: openvswitch: add psample action 2024-07-05 17:45:47 -07:00
Makefile
meter.c
meter.h
openvswitch_trace.c
openvswitch_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
vport-geneve.c
vport-gre.c
vport-internal_dev.c openvswitch: Remove generic .ndo_get_stats64 2024-06-04 16:06:37 +02:00
vport-internal_dev.h
vport-netdev.c
vport-netdev.h
vport-vxlan.c
vport.c net: openvswitch: store sampling probability in cb. 2024-07-05 17:45:47 -07:00
vport.h