From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CB36C433EF for ; Mon, 20 Sep 2021 05:44:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 404EC60FC2 for ; Mon, 20 Sep 2021 05:44:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232892AbhITFqL (ORCPT ); Mon, 20 Sep 2021 01:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231250AbhITFqI (ORCPT ); Mon, 20 Sep 2021 01:46:08 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FDDFC061574; Sun, 19 Sep 2021 22:44:42 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id i25so63235697lfg.6; Sun, 19 Sep 2021 22:44:42 -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=ivxRxXk1jmWb3aes+tkdDqCm6jQIS0oNdYc8DLVRVcM=; b=Ln4zRqSiUZgW1oFGYKnets0iGhY6tKiZCYZgPoVDqxqGBRWH8OyKfD1FzZn7KAYs9I TCbKaus5OaJki58tBSNsgxCdxxfKBk5n7rDE2XIgVCHUDdxOvUZ+Hqi9OElyv+iKllw/ 6LZzROtjVru2uepL3IoJaa8trD9zZ5wEaiLg8U5rOdCA9l9wcJqkA7YT5stqeYMV0Fby RxEq3L8PkOv/lEMe7jjxT0bCt6KiwSj6zAorpbG+OFu8SHPqPp4LNAP+eRjup/nys5XE cCnIfpvrsF2dpsBKR/qitqn0l+MqjYL7taezFCpj4ETkDzkuu+h0FxHLYOErVq8ak+nv feMA== 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=ivxRxXk1jmWb3aes+tkdDqCm6jQIS0oNdYc8DLVRVcM=; b=53D0C6BLKcSz4YrxgwqFzZrQyftF9jakHsF1zHDmU4+T5fOx67+vbEvFpWqDz44EfS p0rZodcwKiIJgoSrOIjZDGty+oxaJmIloWD+hXAESvhr+XLIGwe3+zEjH4oa/8/VcF5H FwuoYPwUFH4H0AN2DNKC6+O9EhGdb/Ha2zD6xhbHtnAtMGBaCgb0fyV7Iun2mSSDv266 7/4lX3jfLlyIbn3wjs/D1gAgkgdgpniWQomeTEeUQcdrohJyMuRB/72R0/JaSo6eppZV YB0x9KvaCOLa3Kl1kYWbjPSbqFYNkL7mqV9875MMlkf//GSh0lpAT94SmTCL0G2RdsOo UvLQ== X-Gm-Message-State: AOAM530lIeSijGHYylKdUEYvKJ6otzHt2l6GxXt4bXGqhbave7pf4AJf 3QPTq/ICWxcrMxYFg/VMYr8qDvG9rF26wFueG/NFOFkBQE6H6A== X-Google-Smtp-Source: ABdhPJz2W8YCHXSZNkjWCeQaWDCVVA/VycRTXKRCEWIfLTCeSf50ohoCLe8V9nJajvQzDF2jRA9JTr4GV1QJq0imWEg= X-Received: by 2002:a2e:580e:: with SMTP id m14mr18457247ljb.82.1632116680413; Sun, 19 Sep 2021 22:44:40 -0700 (PDT) MIME-Version: 1.0 References: <20210919154337.9243-1-stachecki.tyler@gmail.com> In-Reply-To: From: Tyler Stachecki Date: Mon, 20 Sep 2021 01:44:29 -0400 Message-ID: Subject: Re: [PATCH] ovs: Only clear tstamp when changing namespaces To: Cong Wang 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 7:33 PM Cong Wang wrote: > > 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. Sorry if this is a no-op -- I'm admittedly not familiar with this part of the tree. I had added this check based on this discussion on the OVS mailing list: https://mail.openvswitch.org/pipermail/ovs-discuss/2021-February/050966.html The motivation to add it was based on the fact that skb_scrub_packet is doing it conditionally as well, but you seem to indicate that skb_scrub_packet itself is already being done somewhere? Cheers, Tyler