From: Xin Long <lucien.xin@gmail.com> Date: 2021-11-12 16:33:20
This issue was found when using OVS HWOL on OVN-k8s. These packets
dropped on rx path were seen with output dst, which should've been
dropped from the skbs when redirecting them.
The 1st patch is to the fix and the 2nd is a selftest to reproduce
and verify it.
Davide Caratti (1):
selftests: add a test case for mirred egress to ingress
Xin Long (1):
net: sched: act_mirred: drop dst for the direction from egress to
ingress
net/sched/act_mirred.c | 11 +++--
tools/testing/selftests/net/forwarding/config | 1 +
.../selftests/net/forwarding/tc_actions.sh | 47 ++++++++++++++++++-
3 files changed, 55 insertions(+), 4 deletions(-)
--
2.27.0
From: Xin Long <lucien.xin@gmail.com> Date: 2021-11-12 16:33:21
Without dropping dst, the packets sent from local mirred/redirected
to ingress will may still use the old dst. ip_rcv() will drop it as
the old dst is for output and its .input is dst_discard.
This patch is to fix by also dropping dst for those packets that are
mirred or redirected from egress to ingress in act_mirred.
Note that we don't drop it for the direction change from ingress to
egress, as on which there might be a user case attaching a metadata
dst by act_tunnel_key that would be used later.
Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/sched/act_mirred.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
@@ -271,10 +274,12 @@ static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a,gotoout;}+want_ingress=tcf_mirred_act_wants_ingress(m_eaction);+/* All mirred/redirected skbs should clear previous ct info */nf_reset_ct(skb2);--want_ingress=tcf_mirred_act_wants_ingress(m_eaction);+if(want_ingress&&!at_ingress)/* drop dst for egress -> ingress */+skb_dst_drop(skb2);expects_nh=want_ingress||!m_mac_header_xmit;at_nh=skb->data==skb_network_header(skb);
From: Xin Long <lucien.xin@gmail.com> Date: 2021-11-12 16:33:26
From: Davide Caratti <redacted>
add a selftest that verifies the correct behavior of TC act_mirred egress
to ingress: in particular, it checks if the dst_entry is removed from skb
before redirect egress -> ingress. The correct behavior is: an ICMP 'echo
request' generated by ping will be received and generate a reply the same
way as the one generated by mausezahn.
Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Davide Caratti <redacted>
---
tools/testing/selftests/net/forwarding/config | 1 +
.../selftests/net/forwarding/tc_actions.sh | 47 ++++++++++++++++++-
2 files changed, 47 insertions(+), 1 deletion(-)
From: Xin Long <lucien.xin@gmail.com> Date: 2021-11-12 16:35:14
+Cc Davide.
On Fri, Nov 12, 2021 at 11:33 AM Xin Long [off-list ref] wrote:
This issue was found when using OVS HWOL on OVN-k8s. These packets
dropped on rx path were seen with output dst, which should've been
dropped from the skbs when redirecting them.
The 1st patch is to the fix and the 2nd is a selftest to reproduce
and verify it.
Davide Caratti (1):
selftests: add a test case for mirred egress to ingress
Xin Long (1):
net: sched: act_mirred: drop dst for the direction from egress to
ingress
net/sched/act_mirred.c | 11 +++--
tools/testing/selftests/net/forwarding/config | 1 +
.../selftests/net/forwarding/tc_actions.sh | 47 ++++++++++++++++++-
3 files changed, 55 insertions(+), 4 deletions(-)
--
2.27.0
From: Cong Wang <hidden> Date: 2021-11-15 05:05:40
On Fri, Nov 12, 2021 at 8:33 AM Xin Long [off-list ref] wrote:
This issue was found when using OVS HWOL on OVN-k8s. These packets
dropped on rx path were seen with output dst, which should've been
dropped from the skbs when redirecting them.
The 1st patch is to the fix and the 2nd is a selftest to reproduce
and verify it.
On Fri, Nov 12, 2021 at 11:33:10AM -0500, Xin Long wrote:
This issue was found when using OVS HWOL on OVN-k8s. These packets
dropped on rx path were seen with output dst, which should've been
dropped from the skbs when redirecting them.
The 1st patch is to the fix and the 2nd is a selftest to reproduce
and verify it.
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-11-17 03:42:20
On Fri, 12 Nov 2021 11:33:10 -0500 Xin Long wrote:
This issue was found when using OVS HWOL on OVN-k8s. These packets
dropped on rx path were seen with output dst, which should've been
dropped from the skbs when redirecting them.
The 1st patch is to the fix and the 2nd is a selftest to reproduce
and verify it.