get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1048618/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1048618,
    "url": "http://patchwork.ozlabs.org/api/patches/1048618/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190227003523.28733-9-anirudh.venkataramanan@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20190227003523.28733-9-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2019-02-27T00:35:14",
    "name": "[S13,v2,08/17] ice: Add support for PF/VF promiscuous mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "882d77a2e6d396a51f135ec5a911074e9b36337d",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190227003523.28733-9-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 94355,
            "url": "http://patchwork.ozlabs.org/api/series/94355/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=94355",
            "date": "2019-02-27T00:35:10",
            "name": "Bug fixes and minor feature updates for ice",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/94355/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1048618/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1048618/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 448Gth0hMjz9s9T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Feb 2019 11:35:40 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id B72258562D;\n\tWed, 27 Feb 2019 00:35:38 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id nGgsu0koBUbY; Wed, 27 Feb 2019 00:35:35 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 354AB85784;\n\tWed, 27 Feb 2019 00:35:34 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5A98A1BF2A0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Feb 2019 00:35:30 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 576A58555A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Feb 2019 00:35:30 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id rd5Pnz-LAXcK for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Feb 2019 00:35:25 +0000 (UTC)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 1E372856F6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Feb 2019 00:35:25 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Feb 2019 16:35:25 -0800",
            "from shasta.jf.intel.com ([10.166.241.11])\n\tby fmsmga001.fm.intel.com with ESMTP; 26 Feb 2019 16:35:24 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,417,1544515200\"; d=\"scan'208\";a=\"150284168\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 26 Feb 2019 16:35:14 -0800",
        "Message-Id": "<20190227003523.28733-9-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.14.5",
        "In-Reply-To": "<20190227003523.28733-1-anirudh.venkataramanan@intel.com>",
        "References": "<20190227003523.28733-1-anirudh.venkataramanan@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH S13 v2 08/17] ice: Add support for PF/VF\n\tpromiscuous mode",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>\n\nImplement support for VF promiscuous mode, MAC/VLAN/MAC_VLAN and PF\nmulticast MAC/VLAN/MAC_VLAN promiscuous mode.\n\nSigned-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h             |  18 ++\n drivers/net/ethernet/intel/ice/ice_lib.c         |   9 +-\n drivers/net/ethernet/intel/ice/ice_lib.h         |   2 +-\n drivers/net/ethernet/intel/ice/ice_main.c        |  91 ++++++-\n drivers/net/ethernet/intel/ice/ice_switch.c      | 291 ++++++++++++++++++++++-\n drivers/net/ethernet/intel/ice/ice_switch.h      |  22 ++\n drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 125 ++++++++--\n 7 files changed, 527 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 2bb2898efb82..0843868d1bbd 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -125,6 +125,23 @@ extern const char ice_drv_ver[];\n #define ice_for_each_q_vector(vsi, i) \\\n \tfor ((i) = 0; (i) < (vsi)->num_q_vectors; (i)++)\n \n+#define ICE_UCAST_PROMISC_BITS (ICE_PROMISC_UCAST_TX | ICE_PROMISC_MCAST_TX | \\\n+\t\t\t\tICE_PROMISC_UCAST_RX | ICE_PROMISC_MCAST_RX)\n+\n+#define ICE_UCAST_VLAN_PROMISC_BITS (ICE_PROMISC_UCAST_TX | \\\n+\t\t\t\t     ICE_PROMISC_MCAST_TX | \\\n+\t\t\t\t     ICE_PROMISC_UCAST_RX | \\\n+\t\t\t\t     ICE_PROMISC_MCAST_RX | \\\n+\t\t\t\t     ICE_PROMISC_VLAN_TX  | \\\n+\t\t\t\t     ICE_PROMISC_VLAN_RX)\n+\n+#define ICE_MCAST_PROMISC_BITS (ICE_PROMISC_MCAST_TX | ICE_PROMISC_MCAST_RX)\n+\n+#define ICE_MCAST_VLAN_PROMISC_BITS (ICE_PROMISC_MCAST_TX | \\\n+\t\t\t\t     ICE_PROMISC_MCAST_RX | \\\n+\t\t\t\t     ICE_PROMISC_VLAN_TX  | \\\n+\t\t\t\t     ICE_PROMISC_VLAN_RX)\n+\n struct ice_tc_info {\n \tu16 qoffset;\n \tu16 qcount_tx;\n@@ -258,6 +275,7 @@ struct ice_vsi {\n \tu8 irqs_ready;\n \tu8 current_isup;\t\t /* Sync 'link up' logging */\n \tu8 stat_offsets_loaded;\n+\tu8 vlan_ena;\n \n \t/* queue information */\n \tu8 tx_mapping_mode;\t\t /* ICE_MAP_MODE_[CONTIG|SCATTER] */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex 87e57328a81b..7a692f80bda4 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -2119,10 +2119,11 @@ ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,\n  * ice_cfg_vlan_pruning - enable or disable VLAN pruning on the VSI\n  * @vsi: VSI to enable or disable VLAN pruning on\n  * @ena: set to true to enable VLAN pruning and false to disable it\n+ * @vlan_promisc: enable valid security flags if not in VLAN promiscuous mode\n  *\n  * returns 0 if VSI is updated, negative otherwise\n  */\n-int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena)\n+int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)\n {\n \tstruct ice_vsi_ctx *ctxt;\n \tstruct device *dev;\n@@ -2150,8 +2151,10 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena)\n \t\tctxt->info.sw_flags2 &= ~ICE_AQ_VSI_SW_FLAG_RX_VLAN_PRUNE_ENA;\n \t}\n \n-\tctxt->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_SECURITY_VALID |\n-\t\t\t\t\t\tICE_AQ_VSI_PROP_SW_VALID);\n+\tif (!vlan_promisc)\n+\t\tctxt->info.valid_sections =\n+\t\t\tcpu_to_le16(ICE_AQ_VSI_PROP_SECURITY_VALID |\n+\t\t\t\t    ICE_AQ_VSI_PROP_SW_VALID);\n \n \tstatus = ice_update_vsi(&vsi->back->hw, vsi->idx, ctxt, NULL);\n \tif (status) {\ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h\nindex 7988a53729a9..044617138122 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.h\n@@ -35,7 +35,7 @@ int\n ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,\n \t\t\t  u16 rel_vmvf_num);\n \n-int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena);\n+int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc);\n \n void ice_vsi_delete(struct ice_vsi *vsi);\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 34712e38121e..879c1f176a17 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -167,6 +167,39 @@ static bool ice_vsi_fltr_changed(struct ice_vsi *vsi)\n \t       test_bit(ICE_VSI_FLAG_VLAN_FLTR_CHANGED, vsi->flags);\n }\n \n+/**\n+ * ice_cfg_promisc - Enable or disable promiscuous mode for a given PF\n+ * @vsi: the VSI being configured\n+ * @promisc_m: mask of promiscuous config bits\n+ * @set_promisc: enable or disable promisc flag request\n+ *\n+ */\n+static int ice_cfg_promisc(struct ice_vsi *vsi, u8 promisc_m, bool set_promisc)\n+{\n+\tstruct ice_hw *hw = &vsi->back->hw;\n+\tenum ice_status status = 0;\n+\n+\tif (vsi->type != ICE_VSI_PF)\n+\t\treturn 0;\n+\n+\tif (vsi->vlan_ena) {\n+\t\tstatus = ice_set_vlan_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t  set_promisc);\n+\t} else {\n+\t\tif (set_promisc)\n+\t\t\tstatus = ice_set_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t     0);\n+\t\telse\n+\t\t\tstatus = ice_clear_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t       0);\n+\t}\n+\n+\tif (status)\n+\t\treturn -EIO;\n+\n+\treturn 0;\n+}\n+\n /**\n  * ice_vsi_sync_fltr - Update the VSI filter list to the HW\n  * @vsi: ptr to the VSI\n@@ -182,6 +215,7 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)\n \tstruct ice_hw *hw = &pf->hw;\n \tenum ice_status status = 0;\n \tu32 changed_flags = 0;\n+\tu8 promisc_m;\n \tint err = 0;\n \n \tif (!vsi->netdev)\n@@ -245,8 +279,35 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)\n \t\t}\n \t}\n \t/* check for changes in promiscuous modes */\n-\tif (changed_flags & IFF_ALLMULTI)\n-\t\tnetdev_warn(netdev, \"Unsupported configuration\\n\");\n+\tif (changed_flags & IFF_ALLMULTI) {\n+\t\tif (vsi->current_netdev_flags & IFF_ALLMULTI) {\n+\t\t\tif (vsi->vlan_ena)\n+\t\t\t\tpromisc_m = ICE_MCAST_VLAN_PROMISC_BITS;\n+\t\t\telse\n+\t\t\t\tpromisc_m = ICE_MCAST_PROMISC_BITS;\n+\n+\t\t\terr = ice_cfg_promisc(vsi, promisc_m, true);\n+\t\t\tif (err) {\n+\t\t\t\tnetdev_err(netdev, \"Error setting Multicast promiscuous mode on VSI %i\\n\",\n+\t\t\t\t\t   vsi->vsi_num);\n+\t\t\t\tvsi->current_netdev_flags &= ~IFF_ALLMULTI;\n+\t\t\t\tgoto out_promisc;\n+\t\t\t}\n+\t\t} else if (!(vsi->current_netdev_flags & IFF_ALLMULTI)) {\n+\t\t\tif (vsi->vlan_ena)\n+\t\t\t\tpromisc_m = ICE_MCAST_VLAN_PROMISC_BITS;\n+\t\t\telse\n+\t\t\t\tpromisc_m = ICE_MCAST_PROMISC_BITS;\n+\n+\t\t\terr = ice_cfg_promisc(vsi, promisc_m, false);\n+\t\t\tif (err) {\n+\t\t\t\tnetdev_err(netdev, \"Error clearing Multicast promiscuous mode on VSI %i\\n\",\n+\t\t\t\t\t   vsi->vsi_num);\n+\t\t\t\tvsi->current_netdev_flags |= IFF_ALLMULTI;\n+\t\t\t\tgoto out_promisc;\n+\t\t\t}\n+\t\t}\n+\t}\n \n \tif (((changed_flags & IFF_PROMISC) || promisc_forced_on) ||\n \t    test_bit(ICE_VSI_FLAG_PROMISC_CHANGED, vsi->flags)) {\n@@ -1665,6 +1726,7 @@ ice_vlan_rx_add_vid(struct net_device *netdev, __always_unused __be16 proto,\n {\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_vsi *vsi = np->vsi;\n+\tint ret;\n \n \tif (vid >= VLAN_N_VID) {\n \t\tnetdev_err(netdev, \"VLAN id requested %d is out of range %d\\n\",\n@@ -1677,8 +1739,7 @@ ice_vlan_rx_add_vid(struct net_device *netdev, __always_unused __be16 proto,\n \n \t/* Enable VLAN pruning when VLAN 0 is added */\n \tif (unlikely(!vid)) {\n-\t\tint ret = ice_cfg_vlan_pruning(vsi, true);\n-\n+\t\tret = ice_cfg_vlan_pruning(vsi, true, false);\n \t\tif (ret)\n \t\t\treturn ret;\n \t}\n@@ -1687,7 +1748,13 @@ ice_vlan_rx_add_vid(struct net_device *netdev, __always_unused __be16 proto,\n \t * needed to continue allowing all untagged packets since VLAN prune\n \t * list is applied to all packets by the switch\n \t */\n-\treturn ice_vsi_add_vlan(vsi, vid);\n+\tret = ice_vsi_add_vlan(vsi, vid);\n+\tif (!ret) {\n+\t\tvsi->vlan_ena = true;\n+\t\tset_bit(ICE_VSI_FLAG_VLAN_FLTR_CHANGED, vsi->flags);\n+\t}\n+\n+\treturn ret;\n }\n \n /**\n@@ -1704,7 +1771,7 @@ ice_vlan_rx_kill_vid(struct net_device *netdev, __always_unused __be16 proto,\n {\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_vsi *vsi = np->vsi;\n-\tint status;\n+\tint ret;\n \n \tif (vsi->info.pvid)\n \t\treturn -EINVAL;\n@@ -1712,15 +1779,17 @@ ice_vlan_rx_kill_vid(struct net_device *netdev, __always_unused __be16 proto,\n \t/* Make sure ice_vsi_kill_vlan is successful before updating VLAN\n \t * information\n \t */\n-\tstatus = ice_vsi_kill_vlan(vsi, vid);\n-\tif (status)\n-\t\treturn status;\n+\tret = ice_vsi_kill_vlan(vsi, vid);\n+\tif (ret)\n+\t\treturn ret;\n \n \t/* Disable VLAN pruning when VLAN 0 is removed */\n \tif (unlikely(!vid))\n-\t\tstatus = ice_cfg_vlan_pruning(vsi, false);\n+\t\tret = ice_cfg_vlan_pruning(vsi, false, false);\n \n-\treturn status;\n+\tvsi->vlan_ena = false;\n+\tset_bit(ICE_VSI_FLAG_VLAN_FLTR_CHANGED, vsi->flags);\n+\treturn ret;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c\nindex cf5bada75a7e..f84f3bf0132a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.c\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.c\n@@ -2189,6 +2189,291 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle,\n \treturn status;\n }\n \n+/**\n+ * ice_determine_promisc_mask\n+ * @fi: filter info to parse\n+ *\n+ * Helper function to determine which ICE_PROMISC_ mask corresponds\n+ * to given filter into.\n+ */\n+static u8 ice_determine_promisc_mask(struct ice_fltr_info *fi)\n+{\n+\tu16 vid = fi->l_data.mac_vlan.vlan_id;\n+\tu8 *macaddr = fi->l_data.mac.mac_addr;\n+\tbool is_tx_fltr = false;\n+\tu8 promisc_mask = 0;\n+\n+\tif (fi->flag == ICE_FLTR_TX)\n+\t\tis_tx_fltr = true;\n+\n+\tif (is_broadcast_ether_addr(macaddr))\n+\t\tpromisc_mask |= is_tx_fltr ?\n+\t\t\tICE_PROMISC_BCAST_TX : ICE_PROMISC_BCAST_RX;\n+\telse if (is_multicast_ether_addr(macaddr))\n+\t\tpromisc_mask |= is_tx_fltr ?\n+\t\t\tICE_PROMISC_MCAST_TX : ICE_PROMISC_MCAST_RX;\n+\telse if (is_unicast_ether_addr(macaddr))\n+\t\tpromisc_mask |= is_tx_fltr ?\n+\t\t\tICE_PROMISC_UCAST_TX : ICE_PROMISC_UCAST_RX;\n+\tif (vid)\n+\t\tpromisc_mask |= is_tx_fltr ?\n+\t\t\tICE_PROMISC_VLAN_TX : ICE_PROMISC_VLAN_RX;\n+\n+\treturn promisc_mask;\n+}\n+\n+/**\n+ * ice_remove_promisc - Remove promisc based filter rules\n+ * @hw: pointer to the hardware structure\n+ * @recp_id: recipe id for which the rule needs to removed\n+ * @v_list: list of promisc entries\n+ */\n+static enum ice_status\n+ice_remove_promisc(struct ice_hw *hw, u8 recp_id,\n+\t\t   struct list_head *v_list)\n+{\n+\tstruct ice_fltr_list_entry *v_list_itr, *tmp;\n+\n+\tlist_for_each_entry_safe(v_list_itr, tmp, v_list, list_entry) {\n+\t\tv_list_itr->status =\n+\t\t\tice_remove_rule_internal(hw, recp_id, v_list_itr);\n+\t\tif (v_list_itr->status)\n+\t\t\treturn v_list_itr->status;\n+\t}\n+\treturn 0;\n+}\n+\n+/**\n+ * ice_clear_vsi_promisc - clear specified promiscuous mode(s) for given VSI\n+ * @hw: pointer to the hardware structure\n+ * @vsi_handle: VSI handle to clear mode\n+ * @promisc_mask: mask of promiscuous config bits to clear\n+ * @vid: VLAN ID to clear VLAN promiscuous\n+ */\n+enum ice_status\n+ice_clear_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,\n+\t\t      u16 vid)\n+{\n+\tstruct ice_switch_info *sw = hw->switch_info;\n+\tstruct ice_fltr_list_entry *fm_entry, *tmp;\n+\tstruct list_head remove_list_head;\n+\tstruct ice_fltr_mgmt_list_entry *itr;\n+\tstruct list_head *rule_head;\n+\tstruct mutex *rule_lock;\t/* Lock to protect filter rule list */\n+\tenum ice_status status = 0;\n+\tu8 recipe_id;\n+\n+\tif (!ice_is_vsi_valid(hw, vsi_handle))\n+\t\treturn ICE_ERR_PARAM;\n+\n+\tif (vid)\n+\t\trecipe_id = ICE_SW_LKUP_PROMISC_VLAN;\n+\telse\n+\t\trecipe_id = ICE_SW_LKUP_PROMISC;\n+\n+\trule_head = &sw->recp_list[recipe_id].filt_rules;\n+\trule_lock = &sw->recp_list[recipe_id].filt_rule_lock;\n+\n+\tINIT_LIST_HEAD(&remove_list_head);\n+\n+\tmutex_lock(rule_lock);\n+\tlist_for_each_entry(itr, rule_head, list_entry) {\n+\t\tu8 fltr_promisc_mask = 0;\n+\n+\t\tif (!ice_vsi_uses_fltr(itr, vsi_handle))\n+\t\t\tcontinue;\n+\n+\t\tfltr_promisc_mask |=\n+\t\t\tice_determine_promisc_mask(&itr->fltr_info);\n+\n+\t\t/* Skip if filter is not completely specified by given mask */\n+\t\tif (fltr_promisc_mask & ~promisc_mask)\n+\t\t\tcontinue;\n+\n+\t\tstatus = ice_add_entry_to_vsi_fltr_list(hw, vsi_handle,\n+\t\t\t\t\t\t\t&remove_list_head,\n+\t\t\t\t\t\t\t&itr->fltr_info);\n+\t\tif (status) {\n+\t\t\tmutex_unlock(rule_lock);\n+\t\t\tgoto free_fltr_list;\n+\t\t}\n+\t}\n+\tmutex_unlock(rule_lock);\n+\n+\tstatus = ice_remove_promisc(hw, recipe_id, &remove_list_head);\n+\n+free_fltr_list:\n+\tlist_for_each_entry_safe(fm_entry, tmp, &remove_list_head, list_entry) {\n+\t\tlist_del(&fm_entry->list_entry);\n+\t\tdevm_kfree(ice_hw_to_dev(hw), fm_entry);\n+\t}\n+\n+\treturn status;\n+}\n+\n+/**\n+ * ice_set_vsi_promisc - set given VSI to given promiscuous mode(s)\n+ * @hw: pointer to the hardware structure\n+ * @vsi_handle: VSI handle to configure\n+ * @promisc_mask: mask of promiscuous config bits\n+ * @vid: VLAN ID to set VLAN promiscuous\n+ */\n+enum ice_status\n+ice_set_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask, u16 vid)\n+{\n+\tenum { UCAST_FLTR = 1, MCAST_FLTR, BCAST_FLTR };\n+\tstruct ice_fltr_list_entry f_list_entry;\n+\tstruct ice_fltr_info new_fltr;\n+\tenum ice_status status = 0;\n+\tbool is_tx_fltr;\n+\tu16 hw_vsi_id;\n+\tint pkt_type;\n+\tu8 recipe_id;\n+\n+\tif (!ice_is_vsi_valid(hw, vsi_handle))\n+\t\treturn ICE_ERR_PARAM;\n+\thw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle);\n+\n+\tmemset(&new_fltr, 0, sizeof(new_fltr));\n+\n+\tif (promisc_mask & (ICE_PROMISC_VLAN_RX | ICE_PROMISC_VLAN_TX)) {\n+\t\tnew_fltr.lkup_type = ICE_SW_LKUP_PROMISC_VLAN;\n+\t\tnew_fltr.l_data.mac_vlan.vlan_id = vid;\n+\t\trecipe_id = ICE_SW_LKUP_PROMISC_VLAN;\n+\t} else {\n+\t\tnew_fltr.lkup_type = ICE_SW_LKUP_PROMISC;\n+\t\trecipe_id = ICE_SW_LKUP_PROMISC;\n+\t}\n+\n+\t/* Separate filters must be set for each direction/packet type\n+\t * combination, so we will loop over the mask value, store the\n+\t * individual type, and clear it out in the input mask as it\n+\t * is found.\n+\t */\n+\twhile (promisc_mask) {\n+\t\tu8 *mac_addr;\n+\n+\t\tpkt_type = 0;\n+\t\tis_tx_fltr = false;\n+\n+\t\tif (promisc_mask & ICE_PROMISC_UCAST_RX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_UCAST_RX;\n+\t\t\tpkt_type = UCAST_FLTR;\n+\t\t} else if (promisc_mask & ICE_PROMISC_UCAST_TX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_UCAST_TX;\n+\t\t\tpkt_type = UCAST_FLTR;\n+\t\t\tis_tx_fltr = true;\n+\t\t} else if (promisc_mask & ICE_PROMISC_MCAST_RX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_MCAST_RX;\n+\t\t\tpkt_type = MCAST_FLTR;\n+\t\t} else if (promisc_mask & ICE_PROMISC_MCAST_TX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_MCAST_TX;\n+\t\t\tpkt_type = MCAST_FLTR;\n+\t\t\tis_tx_fltr = true;\n+\t\t} else if (promisc_mask & ICE_PROMISC_BCAST_RX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_BCAST_RX;\n+\t\t\tpkt_type = BCAST_FLTR;\n+\t\t} else if (promisc_mask & ICE_PROMISC_BCAST_TX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_BCAST_TX;\n+\t\t\tpkt_type = BCAST_FLTR;\n+\t\t\tis_tx_fltr = true;\n+\t\t}\n+\n+\t\t/* Check for VLAN promiscuous flag */\n+\t\tif (promisc_mask & ICE_PROMISC_VLAN_RX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_VLAN_RX;\n+\t\t} else if (promisc_mask & ICE_PROMISC_VLAN_TX) {\n+\t\t\tpromisc_mask &= ~ICE_PROMISC_VLAN_TX;\n+\t\t\tis_tx_fltr = true;\n+\t\t}\n+\n+\t\t/* Set filter DA based on packet type */\n+\t\tmac_addr = new_fltr.l_data.mac.mac_addr;\n+\t\tif (pkt_type == BCAST_FLTR) {\n+\t\t\teth_broadcast_addr(mac_addr);\n+\t\t} else if (pkt_type == MCAST_FLTR ||\n+\t\t\t   pkt_type == UCAST_FLTR) {\n+\t\t\t/* Use the dummy ether header DA */\n+\t\t\tether_addr_copy(mac_addr, dummy_eth_header);\n+\t\t\tif (pkt_type == MCAST_FLTR)\n+\t\t\t\tmac_addr[0] |= 0x1;\t/* Set multicast bit */\n+\t\t}\n+\n+\t\t/* Need to reset this to zero for all iterations */\n+\t\tnew_fltr.flag = 0;\n+\t\tif (is_tx_fltr) {\n+\t\t\tnew_fltr.flag |= ICE_FLTR_TX;\n+\t\t\tnew_fltr.src = hw_vsi_id;\n+\t\t} else {\n+\t\t\tnew_fltr.flag |= ICE_FLTR_RX;\n+\t\t\tnew_fltr.src = hw->port_info->lport;\n+\t\t}\n+\n+\t\tnew_fltr.fltr_act = ICE_FWD_TO_VSI;\n+\t\tnew_fltr.vsi_handle = vsi_handle;\n+\t\tnew_fltr.fwd_id.hw_vsi_id = hw_vsi_id;\n+\t\tf_list_entry.fltr_info = new_fltr;\n+\n+\t\tstatus = ice_add_rule_internal(hw, recipe_id, &f_list_entry);\n+\t\tif (status)\n+\t\t\tgoto set_promisc_exit;\n+\t}\n+\n+set_promisc_exit:\n+\treturn status;\n+}\n+\n+/**\n+ * ice_set_vlan_vsi_promisc\n+ * @hw: pointer to the hardware structure\n+ * @vsi_handle: VSI handle to configure\n+ * @promisc_mask: mask of promiscuous config bits\n+ * @rm_vlan_promisc: Clear VLANs VSI promisc mode\n+ *\n+ * Configure VSI with all associated VLANs to given promiscuous mode(s)\n+ */\n+enum ice_status\n+ice_set_vlan_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,\n+\t\t\t bool rm_vlan_promisc)\n+{\n+\tstruct ice_switch_info *sw = hw->switch_info;\n+\tstruct ice_fltr_list_entry *list_itr, *tmp;\n+\tstruct list_head vsi_list_head;\n+\tstruct list_head *vlan_head;\n+\tstruct mutex *vlan_lock; /* Lock to protect filter rule list */\n+\tenum ice_status status;\n+\tu16 vlan_id;\n+\n+\tINIT_LIST_HEAD(&vsi_list_head);\n+\tvlan_lock = &sw->recp_list[ICE_SW_LKUP_VLAN].filt_rule_lock;\n+\tvlan_head = &sw->recp_list[ICE_SW_LKUP_VLAN].filt_rules;\n+\tmutex_lock(vlan_lock);\n+\tstatus = ice_add_to_vsi_fltr_list(hw, vsi_handle, vlan_head,\n+\t\t\t\t\t  &vsi_list_head);\n+\tmutex_unlock(vlan_lock);\n+\tif (status)\n+\t\tgoto free_fltr_list;\n+\n+\tlist_for_each_entry(list_itr, &vsi_list_head, list_entry) {\n+\t\tvlan_id = list_itr->fltr_info.l_data.vlan.vlan_id;\n+\t\tif (rm_vlan_promisc)\n+\t\t\tstatus = ice_clear_vsi_promisc(hw, vsi_handle,\n+\t\t\t\t\t\t       promisc_mask, vlan_id);\n+\t\telse\n+\t\t\tstatus = ice_set_vsi_promisc(hw, vsi_handle,\n+\t\t\t\t\t\t     promisc_mask, vlan_id);\n+\t\tif (status)\n+\t\t\tbreak;\n+\t}\n+\n+free_fltr_list:\n+\tlist_for_each_entry_safe(list_itr, tmp, &vsi_list_head, list_entry) {\n+\t\tlist_del(&list_itr->list_entry);\n+\t\tdevm_kfree(ice_hw_to_dev(hw), list_itr);\n+\t}\n+\treturn status;\n+}\n+\n /**\n  * ice_remove_vsi_lkup_fltr - Remove lookup type filters for a VSI\n  * @hw: pointer to the hardware structure\n@@ -2224,12 +2509,14 @@ ice_remove_vsi_lkup_fltr(struct ice_hw *hw, u16 vsi_handle,\n \tcase ICE_SW_LKUP_VLAN:\n \t\tice_remove_vlan(hw, &remove_list_head);\n \t\tbreak;\n+\tcase ICE_SW_LKUP_PROMISC:\n+\tcase ICE_SW_LKUP_PROMISC_VLAN:\n+\t\tice_remove_promisc(hw, lkup, &remove_list_head);\n+\t\tbreak;\n \tcase ICE_SW_LKUP_MAC_VLAN:\n \tcase ICE_SW_LKUP_ETHERTYPE:\n \tcase ICE_SW_LKUP_ETHERTYPE_MAC:\n-\tcase ICE_SW_LKUP_PROMISC:\n \tcase ICE_SW_LKUP_DFLT:\n-\tcase ICE_SW_LKUP_PROMISC_VLAN:\n \tcase ICE_SW_LKUP_LAST:\n \tdefault:\n \t\tice_debug(hw, ICE_DBG_SW, \"Unsupported lookup type %d\\n\", lkup);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.h b/drivers/net/ethernet/intel/ice/ice_switch.h\nindex 2d3a2dfcb0de..e4ce0720b871 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.h\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.h\n@@ -178,6 +178,17 @@ struct ice_fltr_mgmt_list_entry {\n \tu8 counter_index;\n };\n \n+enum ice_promisc_flags {\n+\tICE_PROMISC_UCAST_RX = 0x1,\n+\tICE_PROMISC_UCAST_TX = 0x2,\n+\tICE_PROMISC_MCAST_RX = 0x4,\n+\tICE_PROMISC_MCAST_TX = 0x8,\n+\tICE_PROMISC_BCAST_RX = 0x10,\n+\tICE_PROMISC_BCAST_TX = 0x20,\n+\tICE_PROMISC_VLAN_RX = 0x40,\n+\tICE_PROMISC_VLAN_TX = 0x80,\n+};\n+\n /* VSI related commands */\n enum ice_status\n ice_add_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,\n@@ -202,8 +213,19 @@ void ice_remove_vsi_fltr(struct ice_hw *hw, u16 vsi_handle);\n enum ice_status\n ice_add_vlan(struct ice_hw *hw, struct list_head *m_list);\n enum ice_status ice_remove_vlan(struct ice_hw *hw, struct list_head *v_list);\n+\n+/* Promisc/defport setup for VSIs */\n enum ice_status\n ice_cfg_dflt_vsi(struct ice_hw *hw, u16 vsi_handle, bool set, u8 direction);\n+enum ice_status\n+ice_set_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,\n+\t\t    u16 vid);\n+enum ice_status\n+ice_clear_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,\n+\t\t      u16 vid);\n+enum ice_status\n+ice_set_vlan_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,\n+\t\t\t bool rm_vlan_promisc);\n \n enum ice_status ice_init_def_sw_recp(struct ice_hw *hw);\n u16 ice_get_hw_vsi_num(struct ice_hw *hw, u16 vsi_handle);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 62201977b074..f0de80d182d0 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -771,6 +771,47 @@ static void ice_cleanup_and_realloc_vf(struct ice_vf *vf)\n \twr32(hw, VFGEN_RSTAT(vf->vf_id), VIRTCHNL_VFR_VFACTIVE);\n }\n \n+/**\n+ * ice_vf_set_vsi_promisc - set given VF VSI to given promiscuous mode(s)\n+ * @vf: pointer to the VF info\n+ * @vsi: the VSI being configured\n+ * @promisc_m: mask of promiscuous config bits\n+ * @rm_promisc: promisc flag request from the VF to remove or add filter\n+ *\n+ * This function configures VF VSI promiscuous mode, based on the VF requests,\n+ * for Unicast, Multicast and VLAN\n+ */\n+static enum ice_status\n+ice_vf_set_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m,\n+\t\t       bool rm_promisc)\n+{\n+\tstruct ice_pf *pf = vf->pf;\n+\tenum ice_status status = 0;\n+\tstruct ice_hw *hw;\n+\n+\thw = &pf->hw;\n+\tif (vf->num_vlan) {\n+\t\tstatus = ice_set_vlan_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t  rm_promisc);\n+\t} else if (vf->port_vlan_id) {\n+\t\tif (rm_promisc)\n+\t\t\tstatus = ice_clear_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t       vf->port_vlan_id);\n+\t\telse\n+\t\t\tstatus = ice_set_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t     vf->port_vlan_id);\n+\t} else {\n+\t\tif (rm_promisc)\n+\t\t\tstatus = ice_clear_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t       0);\n+\t\telse\n+\t\t\tstatus = ice_set_vsi_promisc(hw, vsi->idx, promisc_m,\n+\t\t\t\t\t\t     0);\n+\t}\n+\n+\treturn status;\n+}\n+\n /**\n  * ice_reset_all_vfs - reset all allocated VFs in one go\n  * @pf: pointer to the PF structure\n@@ -892,9 +933,10 @@ bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr)\n static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n {\n \tstruct ice_pf *pf = vf->pf;\n-\tstruct ice_hw *hw = &pf->hw;\n \tstruct ice_vsi *vsi;\n+\tstruct ice_hw *hw;\n \tbool rsd = false;\n+\tu8 promisc_m;\n \tu32 reg;\n \tint i;\n \n@@ -920,6 +962,7 @@ static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \t\t\t\tvf->vf_id, NULL);\n \t}\n \n+\thw = &pf->hw;\n \t/* poll VPGEN_VFRSTAT reg to make sure\n \t * that reset is complete\n \t */\n@@ -945,6 +988,21 @@ static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \n \tusleep_range(10000, 20000);\n \n+\t/* disable promiscuous modes in case they were enabled\n+\t * ignore any error if disabling process failed\n+\t */\n+\tif (test_bit(ICE_VF_STATE_UC_PROMISC, vf->vf_states) ||\n+\t    test_bit(ICE_VF_STATE_MC_PROMISC, vf->vf_states)) {\n+\t\tif (vf->port_vlan_id ||  vf->num_vlan)\n+\t\t\tpromisc_m = ICE_UCAST_VLAN_PROMISC_BITS;\n+\t\telse\n+\t\t\tpromisc_m = ICE_UCAST_PROMISC_BITS;\n+\n+\t\tvsi = pf->vsi[vf->lan_vsi_idx];\n+\t\tif (ice_vf_set_vsi_promisc(vf, vsi, promisc_m, true))\n+\t\t\tdev_err(&pf->pdev->dev, \"disabling promiscuous mode failed\\n\");\n+\t}\n+\n \t/* free VF resources to begin resetting the VSI state */\n \tice_free_vf_res(vf);\n \n@@ -2192,7 +2250,11 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \t    (struct virtchnl_vlan_filter_list *)msg;\n \tenum ice_status aq_ret = 0;\n \tstruct ice_pf *pf = vf->pf;\n+\tbool vlan_promisc = false;\n \tstruct ice_vsi *vsi;\n+\tstruct ice_hw *hw;\n+\tint status = 0;\n+\tu8 promisc_m;\n \tint i;\n \n \tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n@@ -2209,7 +2271,9 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \t    vf->num_vlan >= ICE_MAX_VLAN_PER_VF) {\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \"VF is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\\n\");\n-\t\taq_ret = ICE_ERR_PARAM;\n+\t\t/* There is no need to let VF know about being not trusted,\n+\t\t * so we can just return success message here\n+\t\t */\n \t\tgoto error_param;\n \t}\n \n@@ -2222,6 +2286,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \t\t}\n \t}\n \n+\thw = &pf->hw;\n \tvsi = ice_find_vsi_from_id(vf->pf, vfl->vsi_id);\n \tif (!vsi) {\n \t\taq_ret = ICE_ERR_PARAM;\n@@ -2241,19 +2306,41 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \t\tgoto error_param;\n \t}\n \n+\tif (test_bit(ICE_VF_STATE_UC_PROMISC, vf->vf_states) ||\n+\t    test_bit(ICE_VF_STATE_MC_PROMISC, vf->vf_states))\n+\t\tvlan_promisc = true;\n+\n \tif (add_v) {\n \t\tfor (i = 0; i < vfl->num_elements; i++) {\n \t\t\tu16 vid = vfl->vlan_id[i];\n \n-\t\t\tif (!ice_vsi_add_vlan(vsi, vid)) {\n-\t\t\t\tvf->num_vlan++;\n+\t\t\tif (ice_vsi_add_vlan(vsi, vid)) {\n+\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t\tgoto error_param;\n+\t\t\t}\n \n-\t\t\t\t/* Enable VLAN pruning when VLAN 0 is added */\n-\t\t\t\tif (unlikely(!vid))\n-\t\t\t\t\tif (ice_cfg_vlan_pruning(vsi, true))\n-\t\t\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\tvf->num_vlan++;\n+\t\t\t/* Enable VLAN pruning when VLAN is added */\n+\t\t\tif (!vlan_promisc) {\n+\t\t\t\tstatus = ice_cfg_vlan_pruning(vsi, true, false);\n+\t\t\t\tif (status) {\n+\t\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\t\t\"Enable VLAN pruning on VLAN ID: %d failed error-%d\\n\",\n+\t\t\t\t\t\tvid, status);\n+\t\t\t\t\tgoto error_param;\n+\t\t\t\t}\n \t\t\t} else {\n-\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t\t/* Enable Ucast/Mcast VLAN promiscuous mode */\n+\t\t\t\tpromisc_m = ICE_PROMISC_VLAN_TX |\n+\t\t\t\t\t    ICE_PROMISC_VLAN_RX;\n+\n+\t\t\t\tstatus = ice_set_vsi_promisc(hw, vsi->idx,\n+\t\t\t\t\t\t\t     promisc_m, vid);\n+\t\t\t\tif (status)\n+\t\t\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\t\t\"Enable Unicast/multicast promiscuous mode on VLAN ID:%d failed error-%d\\n\",\n+\t\t\t\t\t\tvid, status);\n \t\t\t}\n \t\t}\n \t} else {\n@@ -2263,12 +2350,22 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \t\t\t/* Make sure ice_vsi_kill_vlan is successful before\n \t\t\t * updating VLAN information\n \t\t\t */\n-\t\t\tif (!ice_vsi_kill_vlan(vsi, vid)) {\n-\t\t\t\tvf->num_vlan--;\n+\t\t\tif (ice_vsi_kill_vlan(vsi, vid)) {\n+\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t\tgoto error_param;\n+\t\t\t}\n+\n+\t\t\tvf->num_vlan--;\n+\t\t\t/* Disable VLAN pruning when removing VLAN */\n+\t\t\tice_cfg_vlan_pruning(vsi, false, false);\n+\n+\t\t\t/* Disable Unicast/Multicast VLAN promiscuous mode */\n+\t\t\tif (vlan_promisc) {\n+\t\t\t\tpromisc_m = ICE_PROMISC_VLAN_TX |\n+\t\t\t\t\t    ICE_PROMISC_VLAN_RX;\n \n-\t\t\t\t/* Disable VLAN pruning when removing VLAN 0 */\n-\t\t\t\tif (unlikely(!vid))\n-\t\t\t\t\tice_cfg_vlan_pruning(vsi, false);\n+\t\t\t\tice_clear_vsi_promisc(hw, vsi->idx,\n+\t\t\t\t\t\t      promisc_m, vid);\n \t\t\t}\n \t\t}\n \t}\n",
    "prefixes": [
        "S13",
        "v2",
        "08/17"
    ]
}