Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1499464pxb; Sun, 19 Sep 2021 20:17:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3nFegI209bPHXlAJ/EmTToycMJxOMw5jvz5q0AkvORvM8zWfKKwLjvbkG/HJtI72YaFfE X-Received: by 2002:a05:6e02:1522:: with SMTP id i2mr8540967ilu.187.1632107866548; Sun, 19 Sep 2021 20:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632107866; cv=none; d=google.com; s=arc-20160816; b=EiuzwLOUvAuuZghhv9menHW8uUbFs6SMdZKDTsKmFScw4PX1Zakil5b0KkxBn4FS5P yYLqr1gH4OwTjMek3v0VmcJAsrPr0k5T+68qLc9tkIOi6zfG9od9n82JserTbvf7p57E AiayOE+ND/WLPlxAaqzTp2siohybR4Tq2z4Gy68thaZ/o0YtS2SHsc/eFD3W53TmgE38 zWwNpX29B6i9kNUXk2J1jOVStitbWnv2mqNSealzp9XeIPXmBR9MDmjybjihq7ICKnQd Vq7/0FUhfLJDPJEPIKHBmLLcF2NdC0e7rykvoaiBYSogq7RmTQ4GKo87zDDi8JpoAsTf hB7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VnTS+2gBOn9zmK09PKEGWQ2h0BtfZBmXwM4LvZZ5tNs=; b=rn5DLvROtThnL1oSeRNYCc36VKRuszWUm/M6nPH3FYCTKT7rqvus/3fW5aXYYOrmt0 UVlzsIyFbR8T87pZGrrmCKeBkMGYo6douxtLkM/GYLgv0JZlxmBSbFOOctaMAFgfbPxc No6W7MdBekiKH65Axp86NXsj/nruvoYJPwQNlI4Y2Lbfe1vYwFTEEXrGkgrlnr/JZ9qA ZM8oYnlw9gX2cGp4tSr18kCQj3Lrx+ykWMbsF4iAMCvKqdF70MliYRuQCMhMNBxc1uXW E8d+rwTBsWgu/9KiaeoiWd6B6+aGKSToC+vc1/BWw3QmmPBerZmgO5+CEElMofVGsx9t RCwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RADgCXTt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 67si6313273ioc.91.2021.09.19.20.17.35; Sun, 19 Sep 2021 20:17:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RADgCXTt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233583AbhISXfZ (ORCPT + 99 others); Sun, 19 Sep 2021 19:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbhISXfY (ORCPT ); Sun, 19 Sep 2021 19:35:24 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36922C061574; Sun, 19 Sep 2021 16:33:59 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id y8so14529366pfa.7; Sun, 19 Sep 2021 16:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VnTS+2gBOn9zmK09PKEGWQ2h0BtfZBmXwM4LvZZ5tNs=; b=RADgCXTtyIp8hlzuLC+OAJ8jXO3ltyQTzz373telbOm3ZBTd+49jtUVFU3lP0xC41O +4/ac7+uxP+aXf0cy3JZi1v9T/k7N08Zkv3s0QO630kGNGd7eknTfE1jQ0BaGLPnSLeU FcHBCUP7F77KGF4kzppssTVaxugVrnL1JoiIE7M1gVkD6TOw/kGi2JkDNGyanQIyNk06 5WoV0/c+Z0SUtzc5teJBIbya6pm7sSharvvTc3upMX1iLxfzHOTFRM7vxZU30XrQZ8OO +0PiJpEr2NfoFSwwzTACuZfyhdkT92cqrgraHJhcLoIxxTYKnnxzD6opiRSmeFsDC4Dt Pg8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VnTS+2gBOn9zmK09PKEGWQ2h0BtfZBmXwM4LvZZ5tNs=; b=Fra/9oF6EPtoF+2VkbKpGie8VCiXk8/KPsfLC1IIKrX4H1qOgp15CJjYp7UgyvbMU1 xHI78MF4saxh48MHMS5hxLDc8C3Rl9xs4U9KuhWqNM+bbYWpneKbZ7+rykMpw58QOZB1 DaHZMQeVEe/dz9udEAY1GR2LKFemdOQqg27+5mXYFbeHD3evjn++68lutqMYTTzxWtxC hrQGwlkodvKEjzzgy+ErJ3QghF393J8TT7nw8cSHP/Rdyhjix0c4LxH3RsVlWsOgXqru V8ncllr86DYhHEj8vKejChW+veIe9oo1TE4Kt+iyPdoY3sBig6MP/B+GkiMpyLJMdOg4 ooRA== X-Gm-Message-State: AOAM531/IhxJjjzICQ89V5E1qElkrnlpxeacZ86SM8XUal4FydBuhLzk LL0PBAjov0A4GtGxAWxK6RdsUcsKvDajNPIBTdxw1rGjSpk= X-Received: by 2002:a62:645:0:b0:3f2:23bd:5fc0 with SMTP id 66-20020a620645000000b003f223bd5fc0mr22289611pfg.35.1632094438782; Sun, 19 Sep 2021 16:33:58 -0700 (PDT) MIME-Version: 1.0 References: <20210919154337.9243-1-stachecki.tyler@gmail.com> In-Reply-To: <20210919154337.9243-1-stachecki.tyler@gmail.com> From: Cong Wang Date: Sun, 19 Sep 2021 16:33:47 -0700 Message-ID: Subject: Re: [PATCH] ovs: Only clear tstamp when changing namespaces To: "Tyler J. Stachecki" Cc: fankaixi.li@bytedance.com, xiexiaohui.xxh@bytedance.com, "Cong Wang ." , Pravin B Shelar , "David S. Miller" , Jakub Kicinski , Linux Kernel Network Developers , dev@openvswitch.org, LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 19, 2021 at 10:59 AM Tyler J. Stachecki 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? > > Signed-off-by: Tyler J. Stachecki > --- > 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.