linux-stable/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 net/sched: act_api: fix miss set post_ct for ovs after do conntrack in act_ct 2021-03-16 15:22:18 -07:00
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 net: openvswitch: use netif_ovs_is_port() instead of opencode 2019-07-08 15:53:25 -07:00
drop.h net: openvswitch: add misc error drop reasons 2023-08-14 08:01:06 +01:00
flow.c net: openvswitch: fix overwriting ct original tuple for ICMPv6 2024-05-10 19:24:07 -07:00
flow.h net: openvswitch: reduce cpu_used_mask memory 2023-02-06 22:36:29 -08:00
flow_netlink.c net: openvswitch: add psample action 2024-07-05 17:45:47 -07:00
flow_netlink.h
flow_table.c net: openvswitch: Use struct_size() 2023-10-17 13:56:03 +02:00
flow_table.h net: openvswitch: Annotate struct mask_array with __counted_by 2023-10-17 13:56:03 +02:00
Kconfig net: openvswitch: add psample action 2024-07-05 17:45:47 -07:00
Makefile openvswitch: add trace points 2021-06-22 10:47:32 -07:00
meter.c genetlink: remove userhdr from struct genl_info 2023-08-15 14:54:44 -07:00
meter.h net: openvswitch: remove unnecessary linux/genetlink.h include 2024-04-01 21:44:34 -07:00
openvswitch_trace.c openvswitch: add trace points 2021-06-22 10:47:32 -07:00
openvswitch_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
vport-geneve.c rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link 2022-10-31 18:10:21 -07:00
vport-gre.c rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link 2022-10-31 18:10:21 -07:00
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 net: openvswitch: Release reference to netdev 2024-04-24 17:07:17 -07:00
vport-netdev.h
vport-vxlan.c rtnetlink: Honour NLM_F_ECHO flag in rtnl_delete_link 2022-10-31 18:10:21 -07:00
vport.c net: openvswitch: store sampling probability in cb. 2024-07-05 17:45:47 -07:00
vport.h net: openvswitch: Add support to count upcall packets 2022-12-09 10:43:46 +00:00