From patchwork Thu Dec 16 12:31:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Palczewski X-Patchwork-Id: 1569128 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=mW2aqRfo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JFBM637vDz9s1l for ; Thu, 16 Dec 2021 23:32:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DCC4A82F3D; Thu, 16 Dec 2021 12:31:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9EUdMrSluyni; Thu, 16 Dec 2021 12:31:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id E777B82F92; Thu, 16 Dec 2021 12:31:58 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id AB0B51BF2B8 for ; Thu, 16 Dec 2021 12:31:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 98801410D0 for ; Thu, 16 Dec 2021 12:31:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=intel.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R0P6GR3ZfjHZ for ; Thu, 16 Dec 2021 12:31:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by smtp4.osuosl.org (Postfix) with ESMTPS id D0911410C0 for ; Thu, 16 Dec 2021 12:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639657915; x=1671193915; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XeHwvrkTJ5AzWaWofcE4/O6vCOFyUi3R5tT7g3ofJrU=; b=mW2aqRfofgsOcGsh2KXakWIfKRtMHGSpHXIPLrUHRB30u5m1UMzk+wOG fGDvi1D+TtBCsDUjCYaH+SKufR313ZCYt1mGw08p3kYtWbNxQIrWXTYMR hsAgfmOjj2sIctAFM7IbafDmnV45CKgxlDXL4iEfuqZC/7upeoX59tTIc 9cemVSgRZsdzaVOv7G5VY8+R3sfnJWlct7xw3JbQLw3ZrxNNjUGyCneDP 7TOA4xneTJDnGk/BcZMKEUrCn3bm5GZsv9n7xYdR+rK2jy8ddNw7N/o6B eLF4xUtfk7EQKivd8DBSfy2tzYcbwe4Tv0IgZI8MeDeD5XDckjkLfS2Pn w==; X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="220155491" X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="220155491" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2021 04:31:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,211,1635231600"; d="scan'208";a="611439087" Received: from amlin-018-068.igk.intel.com (HELO localhost.igk.intel.com) ([10.102.18.68]) by fmsmga002.fm.intel.com with ESMTP; 16 Dec 2021 04:31:53 -0800 From: Mateusz Palczewski To: intel-wired-lan@lists.osuosl.org Date: Thu, 16 Dec 2021 13:31:13 +0100 Message-Id: <20211216123113.2142-1-mateusz.palczewski@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Intel-wired-lan] [PATCH net-next v3] i40e: Disable hw-tc-offload feature on driver load. X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mateusz Palczewski , Przemyslaw Patynowski , Norbert Zulinski Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" After loading driver hw-tc-offload is enabled by default. Change the behaviour of driver to disable hw-tc-offload by default as this is the expected state. Additionaly since this impacts ntuple feature state change the way of checking NETIF_F_HW_TC flag. Signed-off-by: Norbert Zulinski Signed-off-by: Przemyslaw Patynowski Signed-off-by: Mateusz Palczewski Tested-by: Dave Switzer --- v3: Removed internal tags and fixed commit message v2: Squashed two commits into one --- drivers/net/ethernet/intel/i40e/i40e_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 3fd3f10..fec4d51 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -12724,7 +12724,8 @@ static int i40e_set_features(struct net_device *netdev, else i40e_vlan_stripping_disable(vsi); - if (!(features & NETIF_F_HW_TC) && pf->num_cloud_filters) { + if (!(features & NETIF_F_HW_TC) && + (netdev->features & NETIF_F_HW_TC) && pf->num_cloud_filters) { dev_err(&pf->pdev->dev, "Offloaded tc filters active, can't turn hw_tc_offload off"); return -EINVAL; @@ -13476,6 +13477,8 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) netdev->features |= hw_features | NETIF_F_HW_VLAN_CTAG_FILTER; netdev->hw_enc_features |= NETIF_F_TSO_MANGLEID; + netdev->features &= ~NETIF_F_HW_TC; + if (vsi->type == I40E_VSI_MAIN) { SET_NETDEV_DEV(netdev, &pf->pdev->dev); ether_addr_copy(mac_addr, hw->mac.perm_addr);