Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1172600pxb; Thu, 24 Mar 2022 14:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfCO6/ewE4l8lPLnvi5w/9fWtMQ2PilQJjHpmhJhlThL5HS6w5Px6aGwl2o7JJjhdXZp0t X-Received: by 2002:a17:90a:ca06:b0:1c6:6af7:db3 with SMTP id x6-20020a17090aca0600b001c66af70db3mr8420944pjt.217.1648156764739; Thu, 24 Mar 2022 14:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648156764; cv=none; d=google.com; s=arc-20160816; b=pfr/FOGk7st66MZjFsOAjOhsyJ8naKLYM5x4VQEVFRBkfTTzARqgFravTx+AnGwZgJ 425QbR33rRVW0pbe98ZKMzWRylGD1FCZTSMi0WTOCBVq9PRM3Yp8pMWZvlVb8JQJ3gad uXNIhlTya4FrSukEGUQDU+e17ib7kZn0TH44/7cLv/aQCEazrW2FPSt12K784wn5eD9B pVsyQMJakEWIk0onykv93tzpwulDcbkw/lHLNVu+fkTAE6VUoFxDCYpsN/BIj1Y1+f1G KhsVf0PrehztxSXXpx6g0pvK38wU2tO3NKpvKSC/c1Krn7nA87EiKPyHj2cayzfrlx5f Ir7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=F2jjyqRJ+tc1SvsfwSlVju0JFvKE4GocdT5bVLmCj3k=; b=QkeMEulitVQ/LswqJMxhLi7FyFr2NfdfXxaxN1nUjCmSEDbna/FdozFbgowX+4dPth vxJAYbK1jKdeWpn0r7M+KMRiXj5KvxjnY8atxUsi++NaBHD2STSRwzLb4hMHIHTiAmvx nrBvgBy0YDrOld/fxjfnGlXLMcc3LM7oovxvivjXoTiY4481VUTc8fBqZSok4gk/ZOYx qWbRfw0M07Jt0pGbw6XSoQl4u4ISlW1QjhezBFXE4Fg5yaGXb2bebaSe7XEhtAxvhB2D 1EU+d/3RcmWosg+Pepnn05GSuZg0dU+IaL0yyMeSWpbxyIiBaeascA/YeuBuQzzbpxUU vsWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DeBCEZ+b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a170902e5c300b00153b2d1651csi450229plf.292.2022.03.24.14.19.10; Thu, 24 Mar 2022 14:19:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DeBCEZ+b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245593AbiCWSVg (ORCPT + 99 others); Wed, 23 Mar 2022 14:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244643AbiCWSVf (ORCPT ); Wed, 23 Mar 2022 14:21:35 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4629890A2; Wed, 23 Mar 2022 11:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648059604; x=1679595604; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zKC6DF3oHwhlqlVr0NFUdSwE6lappAD/Mes4aBhNhNo=; b=DeBCEZ+bPWlzQHtsgbSCyaF29zTSscfyETvfDvwToKhEdWydRQ31YC6C kzQswjH7Ftdb5GgDRlqfMCFm5Y11siVBx+j8lYDgQC6oNd9OhSAFmnrI1 tP+vPMhGBeS3sA23gmJSJnSnzhKFHNdGBAsDqr/HCVXnr6Ge8zUX2DRhr J6mQEC4+TNQPAKNIIDFvgwJoL9/RiweG4iz2qk1p25Vtol3oZvo4EySo6 xE1hOmkkMypY+KDA4XzWguca9E90pPQrLk07c8T3Hhj7uOFqATu/ivDIL njHJKqGuXD5ks8N1qHXWmXyQYHyG7ykVWcDPDOtzZ9t16UVqdmSOlVC8t w==; X-IronPort-AV: E=McAfee;i="6200,9189,10295"; a="344629237" X-IronPort-AV: E=Sophos;i="5.90,204,1643702400"; d="scan'208";a="344629237" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 11:20:01 -0700 X-IronPort-AV: E=Sophos;i="5.90,204,1643702400"; d="scan'208";a="561031165" Received: from mszycik-mobl.ger.corp.intel.com (HELO [10.249.137.148]) ([10.249.137.148]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 11:19:57 -0700 Message-ID: <287f2247-2c58-497d-f7b1-ae1e24a88da8@linux.intel.com> Date: Wed, 23 Mar 2022 19:19:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH net] ice: Clear default forwarding VSI during VSI release Content-Language: en-US To: Ivan Vecera Cc: netdev@vger.kernel.org, poros@redhat.com, mschmidt@redhat.com, Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Brett Creeley , Jeff Kirsher , "moderated list:INTEL ETHERNET DRIVERS\"" , open list References: <20220322142554.3253428-1-ivecera@redhat.com> <45b155ff-8e26-fa96-f89e-6a561de01abb@linux.intel.com> <20220323185426.33c66892@ceranb> From: Marcin Szycik In-Reply-To: <20220323185426.33c66892@ceranb> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 23-Mar-22 18:54, Ivan Vecera wrote: > On Wed, 23 Mar 2022 18:39:11 +0100 > Marcin Szycik wrote: > >> On 22-Mar-22 15:25, Ivan Vecera wrote: >>> VSI is set as default forwarding one when promisc mode is set for >>> PF interface, when PF is switched to switchdev mode or when VF >>> driver asks to enable allmulticast or promisc mode for the VF >>> interface (when vf-true-promisc-support priv flag is off). >>> The third case is buggy because in that case VSI associated with >>> VF remains as default one after VF removal. >>> >>> Reproducer: >>> 1. Create VF >>> echo 1 > sys/class/net/ens7f0/device/sriov_numvfs >>> 2. Enable allmulticast or promisc mode on VF >>> ip link set ens7f0v0 allmulticast on >>> ip link set ens7f0v0 promisc on >>> 3. Delete VF >>> echo 0 > sys/class/net/ens7f0/device/sriov_numvfs >>> 4. Try to enable promisc mode on PF >>> ip link set ens7f0 promisc on >>> >>> Although it looks that promisc mode on PF is enabled the opposite >>> is true because ice_vsi_sync_fltr() responsible for IFF_PROMISC >>> handling first checks if any other VSI is set as default forwarding >>> one and if so the function does not do anything. At this point >>> it is not possible to enable promisc mode on PF without re-probe >>> device. >>> >>> To resolve the issue this patch clear default forwarding VSI >>> during ice_vsi_release() when the VSI to be released is the default >>> one. >>> >>> Fixes: 01b5e89aab49 ("ice: Add VF promiscuous support") >>> Signed-off-by: Ivan Vecera >>> --- >>> drivers/net/ethernet/intel/ice/ice_lib.c | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c >>> index 53256aca27c7..20d755822d43 100644 >>> --- a/drivers/net/ethernet/intel/ice/ice_lib.c >>> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c >>> @@ -3147,6 +3147,8 @@ int ice_vsi_release(struct ice_vsi *vsi) >>> } >>> } >>> >>> + if (ice_is_vsi_dflt_vsi(pf->first_sw, vsi)) >>> + ice_clear_dflt_vsi(pf->first_sw); >> >> It would probably be good to check `ice_clear_dflt_vsi` return code. > > Check and report potential warning when error occurs? because we are in ice_vsi_release() so > any rollback does not make sense. Right. ice_clear_dflt_vsi already reports errors so it should be good as is. LGTM, thanks! > > Ivan >