From patchwork Thu Oct 19 16:37:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 155649 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp514061vqb; Thu, 19 Oct 2023 09:38:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUe4BXYvtHCb00i9CcVpYI4VrsDubbxCsom8FAC4QIdxAazYSABnbokeTLHSwq3ZhvAqSh X-Received: by 2002:a05:6359:1a47:b0:166:eb70:12a3 with SMTP id ru7-20020a0563591a4700b00166eb7012a3mr2238977rwb.25.1697733514051; Thu, 19 Oct 2023 09:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697733514; cv=none; d=google.com; s=arc-20160816; b=axwmxINQ219K0tStbLsvyLTl/Hd70FNBt2Of+hIMjBNd2k517QzFNVTKrfRIoqkua7 C3ZsMGgn1aVQoJ4M9I4PD+UcmCsN5aZaQ4FNF9zY1ekkT9ekHDkeksJCPZja+M6HXcWr 5/s+d9LkRhBhBKQYtOBBDCc5SQP9+fgrm1ko9CsDTjXvBvKtB7lQaMy/09j3GeXEFuOW cCFZwBqIvzbGi962TVmR4iYeHzlxuICGHOak8gwWJKBIogi3QbMf57TkHtJ0/U6L6xW3 VUIBzFbBT4DasMdpTQfRFqS62p7Ru1dTVOX1iY3ZF6n1p8zoSTJOLryaHDR9LaQdAh4k cFcQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=aCk5y5U6S6pBpWhKJtSh1SurFp9oD5gnKu4jbHvlKmo=; fh=xjNl7ZRH0zcr0dYKCj/Vj54mTY+YYUiHUJbx4XV8nBo=; b=ibSEdHEW91+L7mfJ1YN3PVUnaoQqTeiUeX1fY3kUyJJgDGDfSzeVJGR4HnFlc2veRO Qe8Wu29sqx3iaj3+QqmZCV7aD/jwyygI1aZsinOqxkQtNiNBYKWo7J7plNfrVEi0r4op LgW6Sx0fMA7WFhqLluI5e8nfCcihZoH3V2p5vwwoD+Ad5h4ecBCbhD8zxT2Fk422MqAZ dvOEc96SfV1Mg4elE33UmM/adGnNUyGeIQYEzI3FwstGNnqvTv5IgOLgiybmf92Cd6Y4 7j2Dd6Z3HSWkxdEtCjaRcFOVlaJawAeyI7vTb9qrrVayiubWUIvZHG8WJRChfHYbO4qs vYzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X6fTaqQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id az1-20020a056a02004100b00577461296a9si5231421pgb.338.2023.10.19.09.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 09:38:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X6fTaqQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1879983393BC; Thu, 19 Oct 2023 09:38:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbjJSQiT (ORCPT + 26 others); Thu, 19 Oct 2023 12:38:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233020AbjJSQiS (ORCPT ); Thu, 19 Oct 2023 12:38:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4E3711F for ; Thu, 19 Oct 2023 09:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697733449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aCk5y5U6S6pBpWhKJtSh1SurFp9oD5gnKu4jbHvlKmo=; b=X6fTaqQqICf7mhj4EQS+pNAH1onDIkUXPFcgHa0ZbnoU1e9I67MUrgYdLZTTNDCtg93COO w+TVYzjuOGOcN6V/RkCCnNlO3xhL11OnuJhAsaW19ySl9yiU2lNmBaXhESlpDk46bFCeZZ b7cGNuKC3wG1bHtiQo5sXTSZi6yjj1Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-444-TxVd3RA4PPiZ1DhsYil0lA-1; Thu, 19 Oct 2023 12:37:24 -0400 X-MC-Unique: TxVd3RA4PPiZ1DhsYil0lA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E3B828E6D01; Thu, 19 Oct 2023 16:37:23 +0000 (UTC) Received: from p1.luc.com (unknown [10.45.226.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0379925C8; Thu, 19 Oct 2023 16:37:21 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Mateusz Palczewski , Simon Horman , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Przemyslaw Patynowski , Sylwester Dziedziuch , intel-wired-lan@lists.osuosl.org (moderated list:INTEL ETHERNET DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net v2] i40e: Fix I40E_FLAG_VF_VLAN_PRUNING value Date: Thu, 19 Oct 2023 18:37:20 +0200 Message-ID: <20231019163721.1333370-1-ivecera@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 09:38:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780092448522625379 X-GMAIL-MSGID: 1780202617198559999 Commit c87c938f62d8f1 ("i40e: Add VF VLAN pruning") added new PF flag I40E_FLAG_VF_VLAN_PRUNING but its value collides with existing I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED flag. Move the affected flag at the end of the flags and fix its value. Reproducer: [root@cnb-03 ~]# ethtool --set-priv-flags enp2s0f0np0 link-down-on-close on [root@cnb-03 ~]# ethtool --set-priv-flags enp2s0f0np0 vf-vlan-pruning on [root@cnb-03 ~]# ethtool --set-priv-flags enp2s0f0np0 link-down-on-close off [ 6323.142585] i40e 0000:02:00.0: Setting link-down-on-close not supported on this port (because total-port-shutdown is enabled) netlink error: Operation not supported [root@cnb-03 ~]# ethtool --set-priv-flags enp2s0f0np0 vf-vlan-pruning off [root@cnb-03 ~]# ethtool --set-priv-flags enp2s0f0np0 link-down-on-close off The link-down-on-close flag cannot be modified after setting vf-vlan-pruning because vf-vlan-pruning shares the same bit with total-port-shutdown flag that prevents any modification of link-down-on-close flag. Fixes: c87c938f62d8 ("i40e: Add VF VLAN pruning") Cc: Mateusz Palczewski Cc: Simon Horman Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) --- drivers/net/ethernet/intel/i40e/i40e.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 6e310a53946782..55bb0b5310d5b4 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h @@ -580,7 +580,6 @@ struct i40e_pf { #define I40E_FLAG_DISABLE_FW_LLDP BIT(24) #define I40E_FLAG_RS_FEC BIT(25) #define I40E_FLAG_BASE_R_FEC BIT(26) -#define I40E_FLAG_VF_VLAN_PRUNING BIT(27) /* TOTAL_PORT_SHUTDOWN * Allows to physically disable the link on the NIC's port. * If enabled, (after link down request from the OS) @@ -603,6 +602,7 @@ struct i40e_pf { * in abilities field of i40e_aq_set_phy_config structure */ #define I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED BIT(27) +#define I40E_FLAG_VF_VLAN_PRUNING BIT(28) struct i40e_client_instance *cinst; bool stat_offsets_loaded;