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 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 748DDC43334 for ; Tue, 28 Jun 2022 12:34:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DFBB560EE0; Tue, 28 Jun 2022 12:34:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org DFBB560EE0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1656419650; bh=PCOOlgbyDGz8QyYH7dWVJCTWqsonC/MFJCmnxYMs47E=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=sqxDH6/lnkb46ibTlWpL42G9CBzgAmFEHSI74A2f4Q368F6wNfpZgHVDo1JpUY8Pz 34+m8wnqouKnNSx3Do9WORiWejsH5a0SMollxwU1yG5Y+i4lsjZtW4rbvs6zdKg0u6 1k2bJKdE3DBQh0AQ4Vu0ECUxlRBHb+FknM+BatCMmlo6KFJ2KvSsKcLnZUIEjVt7QX KXM+WeFM+YeNReQ4xxGnk1k9RPOSkhMdKsQP/tPVwd+RsEKbqFCvuxAqUp1wM6lKEe /fUH2HLJ8p4mOGsqyKBvvDFJKxprHOthBUYag6ZuVFe/qi2xBQZVGScL7N6U4PHcyH sP6w2GXVtcD7g== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0eeeDTLMjHdf; Tue, 28 Jun 2022 12:34:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id D6CD360F04; Tue, 28 Jun 2022 12:34:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D6CD360F04 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 027821BF3B8 for ; Tue, 28 Jun 2022 12:34:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CFD5A82DE6 for ; Tue, 28 Jun 2022 12:34:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CFD5A82DE6 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 vPpFPu-f_-XH for ; Tue, 28 Jun 2022 12:34:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4F1D982C99 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4F1D982C99 for ; Tue, 28 Jun 2022 12:34:04 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="345723960" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="345723960" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 05:34:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="565058386" Received: from amlin-018-068.igk.intel.com (HELO localhost.igk.intel.com) ([10.102.18.68]) by orsmga006.jf.intel.com with ESMTP; 28 Jun 2022 05:34:02 -0700 From: "Palczewski, Mateusz" To: intel-wired-lan@lists.osuosl.org Date: Tue, 28 Jun 2022 14:33:50 +0200 Message-Id: <20220628123350.677880-1-mateusz.palczewski@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656419644; x=1687955644; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dw77FSPyz+klouPHwlp8v+TJXRVD5xG7x1ylWVAONI8=; b=AXhmrp8KMe0qEKDUYv39Gz+OJrKU7KGxE6vB8t1q6yDtE2Mhx6MIVrvC H6+AqbbkIIr/r5OGiZ52OHMOC5xEkQwMyHrFwCqLQmppW3z/1kuTqdyuL 9lC0kSLzOwA6ydTp3TOvtzp20ZGef2h8PIWmi22wYaN+hL25wbjoCCi6m 5cyPDEIUsi+BmWBf+LBCpoXc5Jj802RvPDg9ZCr2BM3kcdKZBNWmCn8+Y Uy6o+n995X9Jfk+hti9ZLu+CTwZO0yNgm/qKFOrtZ+5fe0TWK2cNhK9Q3 Ci+4g/TpluRrmXWD6hpDVtQ9XLTYz/dW1ykUsg1SJHq7PPiZxvpVMHvfj g==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AXhmrp8K Subject: [Intel-wired-lan] [PATCH net v2] ice: Fix max VLANs available for VF 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: Przemyslaw Patynowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Legacy VLAN implementation allows for untrusted VF to have 8 VLAN filters, not counting VLAN 0 filters. Current VLAN_V2 implementation lowers available filters for VF, by counting in VLAN 0 filter for both TPIDs. Fix this by counting only non zero VLAN filters. Without this patch, untrusted VF would not be able to access 8 VLAN filters. Fixes: cc71de8fa133 ("ice: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Mateusz Palczewski --- v2: Changed fixes tag --- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index 4547bc1f7cee..24188ec594d5 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -2948,7 +2948,8 @@ ice_vc_validate_add_vlan_filter_list(struct ice_vsi *vsi, struct virtchnl_vlan_filtering_caps *vfc, struct virtchnl_vlan_filter_list_v2 *vfl) { - u16 num_requested_filters = vsi->num_vlan + vfl->num_elements; + u16 num_requested_filters = ice_vsi_num_non_zero_vlans(vsi) + + vfl->num_elements; if (num_requested_filters > vfc->max_filters) return false; -- 2.27.0 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan