Thread (4 messages) flat view 4 messages, 2 authors, 2021-09-20

Re: [PATCH] ovs: Only clear tstamp when changing namespaces

From: Cong Wang <hidden>
Date: 2021-09-19 23:34:03
Also in: lkml

On Sun, Sep 19, 2021 at 10:59 AM Tyler J. Stachecki
[off-list ref] wrote:
As of "ovs: clear skb->tstamp in forwarding path", the
tstamp is now being cleared unconditionally to fix fq qdisc
operation with ovs vports.

While this is mostly correct and fixes forwarding for that
use case, a slight adjustment is necessary to ensure that
the tstamp is cleared *only when the forwarding is across
namespaces*.
Hmm? I am sure timestamp has already been cleared when
crossing netns:

void skb_scrub_packet(struct sk_buff *skb, bool xnet)
{
...
        if (!xnet)
                return;

        ipvs_reset(skb);
        skb->mark = 0;
        skb->tstamp = 0;
}

So, what are you trying to fix?
quoted hunk ↗ jump to hunk
Signed-off-by: Tyler J. Stachecki <redacted>
---
 net/openvswitch/vport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
index cf2ce5812489..c2d32a5c3697 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
@@ -507,7 +507,8 @@ void ovs_vport_send(struct vport *vport, struct sk_buff *skb, u8 mac_proto)
        }

        skb->dev = vport->dev;
-       skb->tstamp = 0;
+       if (dev_net(skb->dev))
Doesn't dev_net() always return a non-NULL pointer?

If you really want to check whether it is cross-netns, you should
use net_eq() to compare src netns with dst netns, something like:
if (!net_eq(dev_net(vport->dev), dev_net(skb->dev))).

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help