get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 894808,
    "url": "http://patchwork.ozlabs.org/api/patches/894808/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180403211645.7880.13012.stgit@ahduyck-green-test.jf.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": "<20180403211645.7880.13012.stgit@ahduyck-green-test.jf.intel.com>",
    "list_archive_url": null,
    "date": "2018-04-03T21:16:45",
    "name": "[iwl,next-queue,10/10] ixgbe: Avoid performing unnecessary resets for macvlan offload",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "abefec9ae0b66faa0ec02046e894629c6be9fcdf",
    "submitter": {
        "id": 251,
        "url": "http://patchwork.ozlabs.org/api/people/251/?format=api",
        "name": "Duyck, Alexander H",
        "email": "alexander.h.duyck@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/20180403211645.7880.13012.stgit@ahduyck-green-test.jf.intel.com/mbox/",
    "series": [
        {
            "id": 37262,
            "url": "http://patchwork.ozlabs.org/api/series/37262/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=37262",
            "date": "2018-04-03T21:15:53",
            "name": "Clean-up macvlan offloading",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/37262/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/894808/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/894808/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.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 40G2Bl1C2jz9s0y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  4 Apr 2018 07:23:27 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BC5B18A44A;\n\tTue,  3 Apr 2018 21:23:25 +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 e7231EC2fT7d; Tue,  3 Apr 2018 21:23:24 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 02D628A3B9;\n\tTue,  3 Apr 2018 21:23:24 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6BF241C039A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Apr 2018 21:23:22 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 661C02E78D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Apr 2018 21:23:22 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 3hh0w9DbTC7p for <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Apr 2018 21:23:21 +0000 (UTC)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 719302C899\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 Apr 2018 21:23:21 +0000 (UTC)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Apr 2018 14:23:21 -0700",
            "from ahduyck-green-test.jf.intel.com ([10.166.244.179])\n\tby orsmga006.jf.intel.com with ESMTP; 03 Apr 2018 14:23:21 -0700"
        ],
        "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.48,402,1517904000\"; d=\"scan'208\";a=\"31279558\"",
        "From": "Alexander Duyck <alexander.h.duyck@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Tue, 03 Apr 2018 17:16:45 -0400",
        "Message-ID": "<20180403211645.7880.13012.stgit@ahduyck-green-test.jf.intel.com>",
        "In-Reply-To": "<20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com>",
        "References": "<20180403211519.7880.70243.stgit@ahduyck-green-test.jf.intel.com>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [iwl next-queue PATCH 10/10] ixgbe: Avoid\n\tperforming unnecessary resets for macvlan offload",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "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>",
        "Cc": "netdev@vger.kernel.org",
        "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": "The original implementation for macvlan offload has us performing a full\nport reset every time we added a new macvlan. This shouldn't be necessary\nand can be avoided with a few behavior changes.\n\nThis patches updates the logic for the queues so that we have essentially 3\npossible configurations for macvlan offload. They consist of 15 macvlans\nwith 4 queues per macvlan, 31 macvlans with 2 queues per macvlan, and 63\nmacvlans with 1 queue per macvlan. As macvlans are added you will encounter\nup to 3 total resets if you add all the way up to 63, and after that the\ndevice will stay in the mode supporting up to 63 macvlans until the L2FW\nflag is cleared.\n\nSigned-off-by: Alexander Duyck <alexander.h.duyck@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |  192 +++++++++++++++++-------\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |    5 -\n 2 files changed, 135 insertions(+), 62 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 56772d6..01c95bf 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -5336,15 +5336,11 @@ static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,\n \tstruct net_device *vdev = accel->netdev;\n \tint i, baseq, err;\n \n-\tif (!test_bit(accel->pool, adapter->fwd_bitmask))\n-\t\treturn 0;\n-\n \tbaseq = accel->pool * adapter->num_rx_queues_per_pool;\n \tnetdev_dbg(vdev, \"pool %i:%i queues %i:%i\\n\",\n \t\t   accel->pool, adapter->num_rx_pools,\n \t\t   baseq, baseq + adapter->num_rx_queues_per_pool);\n \n-\taccel->netdev = vdev;\n \taccel->rx_base_queue = baseq;\n \taccel->tx_base_queue = baseq;\n \n@@ -5364,9 +5360,17 @@ static int ixgbe_fwd_ring_up(struct ixgbe_adapter *adapter,\n \tif (err >= 0)\n \t\treturn 0;\n \n+\t/* if we cannot add the MAC rule then disable the offload */\n+\tmacvlan_release_l2fw_offload(vdev);\n+\n \tfor (i = 0; i < adapter->num_rx_queues_per_pool; i++)\n \t\tadapter->rx_ring[baseq + i]->netdev = NULL;\n \n+\tnetdev_err(vdev, \"L2FW offload disabled due to L2 filter error\\n\");\n+\n+\tclear_bit(accel->pool, adapter->fwd_bitmask);\n+\tkfree(accel);\n+\n \treturn err;\n }\n \n@@ -8783,6 +8787,49 @@ static void ixgbe_set_prio_tc_map(struct ixgbe_adapter *adapter)\n }\n \n #endif /* CONFIG_IXGBE_DCB */\n+static int ixgbe_reassign_macvlan_pool(struct net_device *vdev, void *data)\n+{\n+\tstruct ixgbe_adapter *adapter = data;\n+\tstruct ixgbe_fwd_adapter *accel;\n+\tint pool;\n+\n+\t/* we only care about macvlans... */\n+\tif (!netif_is_macvlan(vdev))\n+\t\treturn 0;\n+\n+\t/* that have hardware offload enabled... */\n+\taccel = macvlan_accel_priv(vdev);\n+\tif (!accel)\n+\t\treturn 0;\n+\n+\t/* If we can relocate to a different bit do so */\n+\tpool = find_first_zero_bit(adapter->fwd_bitmask, adapter->num_rx_pools);\n+\tif (pool < adapter->num_rx_pools) {\n+\t\tset_bit(pool, adapter->fwd_bitmask);\n+\t\taccel->pool = pool;\n+\t\treturn 0;\n+\t}\n+\n+\t/* if we cannot find a free pool then disable the offload */\n+\tnetdev_err(vdev, \"L2FW offload disabled due to lack of queue resources\\n\");\n+\tmacvlan_release_l2fw_offload(vdev);\n+\tkfree(accel);\n+\n+\treturn 0;\n+}\n+\n+static void ixgbe_defrag_macvlan_pools(struct net_device *dev)\n+{\n+\tstruct ixgbe_adapter *adapter = netdev_priv(dev);\n+\n+\t/* flush any stale bits out of the fwd bitmask */\n+\tbitmap_clear(adapter->fwd_bitmask, 1, 63);\n+\n+\t/* walk through upper devices reassigning pools */\n+\tnetdev_walk_all_upper_dev_rcu(dev, ixgbe_reassign_macvlan_pool,\n+\t\t\t\t      adapter);\n+}\n+\n /**\n  * ixgbe_setup_tc - configure net_device for multiple traffic classes\n  *\n@@ -8850,6 +8897,8 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)\n #endif /* CONFIG_IXGBE_DCB */\n \tixgbe_init_interrupt_scheme(adapter);\n \n+\tixgbe_defrag_macvlan_pools(dev);\n+\n \tif (netif_running(dev))\n \t\treturn ixgbe_open(dev);\n \n@@ -9399,6 +9448,22 @@ static netdev_features_t ixgbe_fix_features(struct net_device *netdev,\n \treturn features;\n }\n \n+static void ixgbe_reset_l2fw_offload(struct ixgbe_adapter *adapter)\n+{\n+\tint rss = min_t(int, ixgbe_max_rss_indices(adapter),\n+\t\t\tnum_online_cpus());\n+\n+\t/* go back to full RSS if we're not running SR-IOV */\n+\tif (!adapter->ring_feature[RING_F_VMDQ].offset)\n+\t\tadapter->flags &= ~(IXGBE_FLAG_VMDQ_ENABLED |\n+\t\t\t\t    IXGBE_FLAG_SRIOV_ENABLED);\n+\n+\tadapter->ring_feature[RING_F_RSS].limit = rss;\n+\tadapter->ring_feature[RING_F_VMDQ].limit = 1;\n+\n+\tixgbe_setup_tc(adapter->netdev, adapter->hw_tcs);\n+}\n+\n static int ixgbe_set_features(struct net_device *netdev,\n \t\t\t      netdev_features_t features)\n {\n@@ -9479,7 +9544,9 @@ static int ixgbe_set_features(struct net_device *netdev,\n \t\t}\n \t}\n \n-\tif (need_reset)\n+\tif ((changed & NETIF_F_HW_L2FW_DOFFLOAD) && adapter->num_rx_pools > 1)\n+\t\tixgbe_reset_l2fw_offload(adapter);\n+\telse if (need_reset)\n \t\tixgbe_do_reset(netdev);\n \telse if (changed & (NETIF_F_HW_VLAN_CTAG_RX |\n \t\t\t    NETIF_F_HW_VLAN_CTAG_FILTER))\n@@ -9742,11 +9809,9 @@ static int ixgbe_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,\n \n static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)\n {\n-\tstruct ixgbe_fwd_adapter *fwd_adapter = NULL;\n \tstruct ixgbe_adapter *adapter = netdev_priv(pdev);\n-\tint used_pools = adapter->num_vfs + adapter->num_rx_pools;\n+\tstruct ixgbe_fwd_adapter *accel;\n \tint tcs = adapter->hw_tcs ? : 1;\n-\tunsigned int limit;\n \tint pool, err;\n \n \t/* The hardware supported by ixgbe only filters on the destination MAC\n@@ -9756,47 +9821,73 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)\n \tif (!macvlan_supports_dest_filter(vdev))\n \t\treturn ERR_PTR(-EMEDIUMTYPE);\n \n-\t/* Hardware has a limited number of available pools. Each VF, and the\n-\t * PF require a pool. Check to ensure we don't attempt to use more\n-\t * then the available number of pools.\n-\t */\n-\tif (used_pools >= IXGBE_MAX_VF_FUNCTIONS)\n-\t\treturn ERR_PTR(-EINVAL);\n+\tpool = find_first_zero_bit(adapter->fwd_bitmask, adapter->num_rx_pools);\n+\tif (pool == adapter->num_rx_pools) {\n+\t\tu16 used_pools = adapter->num_vfs + adapter->num_rx_pools;\n+\t\tu16 reserved_pools;\n+\n+\t\tif (((adapter->flags & IXGBE_FLAG_DCB_ENABLED) &&\n+\t\t     adapter->num_rx_pools >= (MAX_TX_QUEUES / tcs)) ||\n+\t\t    adapter->num_rx_pools > IXGBE_MAX_MACVLANS)\n+\t\t\treturn ERR_PTR(-EBUSY);\n+\n+\t\t/* Hardware has a limited number of available pools. Each VF,\n+\t\t * and the PF require a pool. Check to ensure we don't\n+\t\t * attempt to use more then the available number of pools.\n+\t\t */\n+\t\tif (used_pools >= IXGBE_MAX_VF_FUNCTIONS)\n+\t\t\treturn ERR_PTR(-EBUSY);\n \n-\tif (((adapter->flags & IXGBE_FLAG_DCB_ENABLED) &&\n-\t      adapter->num_rx_pools >= (MAX_TX_QUEUES / tcs)) ||\n-\t    (adapter->num_rx_pools > IXGBE_MAX_MACVLANS))\n-\t\treturn ERR_PTR(-EBUSY);\n+\t\t/* Enable VMDq flag so device will be set in VM mode */\n+\t\tadapter->flags |= IXGBE_FLAG_VMDQ_ENABLED |\n+\t\t\t\t  IXGBE_FLAG_SRIOV_ENABLED;\n \n-\tfwd_adapter = kzalloc(sizeof(*fwd_adapter), GFP_KERNEL);\n-\tif (!fwd_adapter)\n-\t\treturn ERR_PTR(-ENOMEM);\n+\t\t/* Try to reserve as many queues per pool as possible,\n+\t\t * we start with the configurations that support 4 queues\n+\t\t * per pools, followed by 2, and then by just 1 per pool.\n+\t\t */\n+\t\tif (used_pools < 32 && adapter->num_rx_pools < 16)\n+\t\t\treserved_pools = min_t(u16,\n+\t\t\t\t\t       32 - used_pools,\n+\t\t\t\t\t       16 - adapter->num_rx_pools);\n+\t\telse if (adapter->num_rx_pools < 32)\n+\t\t\treserved_pools = min_t(u16,\n+\t\t\t\t\t       64 - used_pools,\n+\t\t\t\t\t       32 - adapter->num_rx_pools);\n+\t\telse\n+\t\t\treserved_pools = 64 - used_pools;\n \n-\tpool = find_first_zero_bit(adapter->fwd_bitmask, adapter->num_rx_pools);\n-\tset_bit(pool, adapter->fwd_bitmask);\n-\tlimit = find_last_bit(adapter->fwd_bitmask, adapter->num_rx_pools + 1);\n \n-\t/* Enable VMDq flag so device will be set in VM mode */\n-\tadapter->flags |= IXGBE_FLAG_VMDQ_ENABLED | IXGBE_FLAG_SRIOV_ENABLED;\n-\tadapter->ring_feature[RING_F_VMDQ].limit = limit + 1;\n+\t\tif (!reserved_pools)\n+\t\t\treturn ERR_PTR(-EBUSY);\n \n-\tfwd_adapter->pool = pool;\n+\t\tadapter->ring_feature[RING_F_VMDQ].limit += reserved_pools;\n \n-\t/* Force reinit of ring allocation with VMDQ enabled */\n-\terr = ixgbe_setup_tc(pdev, adapter->hw_tcs);\n+\t\t/* Force reinit of ring allocation with VMDQ enabled */\n+\t\terr = ixgbe_setup_tc(pdev, adapter->hw_tcs);\n+\t\tif (err)\n+\t\t\treturn ERR_PTR(err);\n \n-\tif (!err && netif_running(pdev))\n-\t\terr = ixgbe_fwd_ring_up(adapter, fwd_adapter);\n+\t\tif (pool >= adapter->num_rx_pools)\n+\t\t\treturn ERR_PTR(-ENOMEM);\n+\t}\n \n-\tif (!err)\n-\t\treturn fwd_adapter;\n+\taccel = kzalloc(sizeof(*accel), GFP_KERNEL);\n+\tif (!accel)\n+\t\treturn ERR_PTR(-ENOMEM);\n+\n+\tset_bit(pool, adapter->fwd_bitmask);\n+\taccel->pool = pool;\n+\taccel->netdev = vdev;\n \n-\t/* unwind counter and free adapter struct */\n-\tnetdev_info(pdev,\n-\t\t    \"%s: dfwd hardware acceleration failed\\n\", vdev->name);\n-\tclear_bit(pool, adapter->fwd_bitmask);\n-\tkfree(fwd_adapter);\n-\treturn ERR_PTR(err);\n+\tif (!netif_running(pdev))\n+\t\treturn accel;\n+\n+\terr = ixgbe_fwd_ring_up(adapter, accel);\n+\tif (err)\n+\t\treturn ERR_PTR(err);\n+\n+\treturn accel;\n }\n \n static void ixgbe_fwd_del(struct net_device *pdev, void *priv)\n@@ -9804,7 +9895,7 @@ static void ixgbe_fwd_del(struct net_device *pdev, void *priv)\n \tstruct ixgbe_fwd_adapter *accel = priv;\n \tstruct ixgbe_adapter *adapter = netdev_priv(pdev);\n \tunsigned int rxbase = accel->rx_base_queue;\n-\tunsigned int limit, i;\n+\tunsigned int i;\n \n \t/* delete unicast filter associated with offloaded interface */\n \tixgbe_del_mac_filter(adapter, accel->netdev->dev_addr,\n@@ -9828,25 +9919,6 @@ static void ixgbe_fwd_del(struct net_device *pdev, void *priv)\n \t}\n \n \tclear_bit(accel->pool, adapter->fwd_bitmask);\n-\tlimit = find_last_bit(adapter->fwd_bitmask, adapter->num_rx_pools);\n-\tadapter->ring_feature[RING_F_VMDQ].limit = limit + 1;\n-\n-\t/* go back to full RSS if we're done with our VMQs */\n-\tif (adapter->ring_feature[RING_F_VMDQ].limit == 1) {\n-\t\tint rss = min_t(int, ixgbe_max_rss_indices(adapter),\n-\t\t\t\tnum_online_cpus());\n-\n-\t\tadapter->flags &= ~IXGBE_FLAG_VMDQ_ENABLED;\n-\t\tadapter->flags &= ~IXGBE_FLAG_SRIOV_ENABLED;\n-\t\tadapter->ring_feature[RING_F_RSS].limit = rss;\n-\t}\n-\n-\tixgbe_setup_tc(pdev, adapter->hw_tcs);\n-\tnetdev_dbg(pdev, \"pool %i:%i queues %i:%i\\n\",\n-\t\t   accel->pool, adapter->num_rx_pools,\n-\t\t   accel->rx_base_queue,\n-\t\t   accel->rx_base_queue +\n-\t\t   adapter->num_rx_queues_per_pool);\n \tkfree(accel);\n }\n \ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex 008aa07..bfc4171 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -266,7 +266,7 @@ int ixgbe_disable_sriov(struct ixgbe_adapter *adapter)\n #endif\n \n \t/* Disable VMDq flag so device will be set in VM mode */\n-\tif (adapter->ring_feature[RING_F_VMDQ].limit == 1) {\n+\tif (bitmap_weight(adapter->fwd_bitmask, adapter->num_rx_pools) == 1) {\n \t\tadapter->flags &= ~IXGBE_FLAG_VMDQ_ENABLED;\n \t\tadapter->flags &= ~IXGBE_FLAG_SRIOV_ENABLED;\n \t\trss = min_t(int, ixgbe_max_rss_indices(adapter),\n@@ -312,7 +312,8 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)\n \t * other values out of range.\n \t */\n \tnum_tc = adapter->hw_tcs;\n-\tnum_rx_pools = adapter->num_rx_pools;\n+\tnum_rx_pools = bitmap_weight(adapter->fwd_bitmask,\n+\t\t\t\t     adapter->num_rx_pools);\n \tlimit = (num_tc > 4) ? IXGBE_MAX_VFS_8TC :\n \t\t(num_tc > 1) ? IXGBE_MAX_VFS_4TC : IXGBE_MAX_VFS_1TC;\n \n",
    "prefixes": [
        "iwl",
        "next-queue",
        "10/10"
    ]
}