Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp971085pxb; Fri, 22 Apr 2022 15:38:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx001MspnHA5Uqw3kyvUaU3IZdZF+uZ92NARuAWSa4jiLMbr2qJarOc910doPTRYzrZDiCH X-Received: by 2002:a63:5163:0:b0:3a9:4e90:6d3d with SMTP id r35-20020a635163000000b003a94e906d3dmr5773292pgl.48.1650667127930; Fri, 22 Apr 2022 15:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650667127; cv=none; d=google.com; s=arc-20160816; b=Vi96Bn6w3ynqbUSdwPZTox2+WNhtco1Ul/4HeKaqxMlpbnNhbp4QDisZ/apJV+cAtF W1j1AEM2/m+nKqD0SwlVAe1F0XGYARVWorg25O6uzV61HNvSnHwcQPv13jAzxiOnQwSG HJZBpE5tPUkuS5GSuUSJEnZcHQ/JV2c6nigN9ZTylOKSXutplVTJ9+gdESGkcJTn/Db9 o1UkwgcmqOFr8bvWKcm/RK9nbCfkYpcWgcqeI5mPDJf8BphlOHm62BmhbHnGNBBMUSJl eCJj9T6m6JNUqnKVpsr6P51NamdW1D1q1SAGslki1vvdGyz0wNwmr8o1XJBALWnRTA81 HCGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Avzb9cPznIodZfUy9syBNKrwQrszHEnglyfet/YgVsc=; b=HHfh9CLOZgq3072EtixrhMRRIfTPF7ufcUiAHJIzaMg3CwAALoLZbf+HcxEtiZukcK avGRB9RabaAcnW5ZUVJc+XqZXtvC9N73mNFaofkxSDhhYticIG5i8PYfDMcAzSgoJBjm hDO1n+Y6402k+jOYEugFH4v1mAEGZ+dtV7rS1hiN0k0iDCBsXCKDPJxQl/N8EhDRblsc B0UWofSQMDRg843Mrp2PHGi4cTn6HMVgFjP6D6OKBiPCrcYNwhFu/hTt4Ppkl4fy4ssk 5eFlN9NCwYdhYm6PWdwnX150A1ePJ2zFgW0lxQvP1zfCSQd81Wzu6xOf/xYk2QjF/Us1 36yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JAKqUSyQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l65-20020a633e44000000b00397ff5a487asi9874275pga.189.2022.04.22.15.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:38:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JAKqUSyQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1B5371DB6A3; Fri, 22 Apr 2022 13:26:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391823AbiDUWsT (ORCPT + 99 others); Thu, 21 Apr 2022 18:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383069AbiDUWsS (ORCPT ); Thu, 21 Apr 2022 18:48:18 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E77C4552A; Thu, 21 Apr 2022 15:45:27 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id hf18so4392245qtb.0; Thu, 21 Apr 2022 15:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Avzb9cPznIodZfUy9syBNKrwQrszHEnglyfet/YgVsc=; b=JAKqUSyQ//H2HGk1D1Uz4/fNWeCFHlMXaS4F2SznucIZZY9cksMSToyNDoypUzpxNH GNOrp1wkR6lpzZutDFVGWRMPcY0HsXYsR0lttjn8OARMFErUNog6JC/kR0En/taRgXS3 DVMExq8xhuTgb58ELb3NBLEdUM9evw85yOv8gdPzT3NjLAmzCRdHBTmn2EbEAX+Cvcfc 5hPRcmAUMio8/PNeTRBA+vgCnbmFzf98SqZj/TKWMLhKAhaj+aM0e9fa8e5PXWcI2JGw vUPuQ3QBpSb00023UwbV+es3e7Lu6RY/VoccMxSqfwAmDaYlC1ykLJAmz1OmtsMrVT4h iIgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Avzb9cPznIodZfUy9syBNKrwQrszHEnglyfet/YgVsc=; b=jXyG48y5HlqkmfxNtJvUzVm4umNDbKlMvvsaPic2qmxz4aos367eBo9K1Uw1/MEKft GOkd4MGKJ6U3ltktyrAO5NLIl2GsvjXhjA2bY6QFZZGkwjaFlOqFiR7swQFKAWSjMWTG g82mUeX2scf0p68kfO4Fal97k8p0lwQPtWmyAI64e97Nd6dCFmGzPc5dYr92CEWPDZhp 3llZlHDnBFSpEwbort7pkJ8wbkBLYMXixPei6USWK7OyiSnXEtsps+BnsWJ+mbCGFlHk BczY9vNWl6ZmNSbKTCi9APK7eiURjQ9D8OBWPLwoQPjcRygciD2vylIHGGk6zem5Dpf1 RXZQ== X-Gm-Message-State: AOAM531BCOls2iiWripbmEq+fMkElLvUXDJyEWhUWfgTOyj2nvh/a6xi tTekIdWP4NC4D5ZwYVw+0g== X-Received: by 2002:ac8:5855:0:b0:2f3:3eb4:51ee with SMTP id h21-20020ac85855000000b002f33eb451eemr1252301qth.644.1650581126629; Thu, 21 Apr 2022 15:45:26 -0700 (PDT) Received: from bytedance.attlocal.net (ec2-13-57-97-131.us-west-1.compute.amazonaws.com. [13.57.97.131]) by smtp.gmail.com with ESMTPSA id x13-20020a05620a258d00b0069c7468e123sm129831qko.122.2022.04.21.15.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 15:45:26 -0700 (PDT) From: Peilin Ye To: "David S. Miller" , Jakub Kicinski , Hideaki YOSHIFUJI , David Ahern , Paolo Abeni Cc: Peilin Ye , Cong Wang , Eric Dumazet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Peilin Ye Subject: [PATCH net-next 2/2] ip6_gre: Make IP6GRE and IP6GRETAP devices always NETIF_F_LLTX Date: Thu, 21 Apr 2022 15:45:02 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye Recently we made o_seqno atomic_t. Stop special-casing TUNNEL_SEQ, and always mark IP6GRE[TAP] devices as NETIF_F_LLTX, since we no longer need the TX lock (&txq->_xmit_lock). Signed-off-by: Peilin Ye --- net/ipv6/ip6_gre.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 5136959b3dc5..4e37f7c29900 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -382,11 +382,6 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net, goto failed_free; ip6gre_tnl_link_config(nt, 1); - - /* Can use a lockless transmit, unless we generate output sequences */ - if (!(nt->parms.o_flags & TUNNEL_SEQ)) - dev->features |= NETIF_F_LLTX; - ip6gre_tunnel_link(ign, nt); return nt; @@ -1445,26 +1440,23 @@ static void ip6gre_tunnel_setup(struct net_device *dev) static void ip6gre_tnl_init_features(struct net_device *dev) { struct ip6_tnl *nt = netdev_priv(dev); + __be16 flags; - dev->features |= GRE6_FEATURES; + dev->features |= GRE6_FEATURES | NETIF_F_LLTX; dev->hw_features |= GRE6_FEATURES; - if (!(nt->parms.o_flags & TUNNEL_SEQ)) { - /* TCP offload with GRE SEQ is not supported, nor - * can we support 2 levels of outer headers requiring - * an update. - */ - if (!(nt->parms.o_flags & TUNNEL_CSUM) || - nt->encap.type == TUNNEL_ENCAP_NONE) { - dev->features |= NETIF_F_GSO_SOFTWARE; - dev->hw_features |= NETIF_F_GSO_SOFTWARE; - } + flags = nt->parms.o_flags; - /* Can use a lockless transmit, unless we generate - * output sequences - */ - dev->features |= NETIF_F_LLTX; - } + /* TCP offload with GRE SEQ is not supported, nor can we support 2 + * levels of outer headers requiring an update. + */ + if (flags & TUNNEL_SEQ) + return; + if (flags & TUNNEL_CSUM && nt->encap.type != TUNNEL_ENCAP_NONE) + return; + + dev->features |= NETIF_F_GSO_SOFTWARE; + dev->hw_features |= NETIF_F_GSO_SOFTWARE; } static int ip6gre_tunnel_init_common(struct net_device *dev) -- 2.20.1