Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229673/?format=api
{ "id": 2229673, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229673/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260428143716.9653-3-marcin.szycik@linux.intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260428143716.9653-3-marcin.szycik@linux.intel.com>", "date": "2026-04-28T14:37:15", "name": "[iwl-next,2/3] virtchnl, iavf, ice, i40e: store VIRTCHNL_VF_* flags in bitmaps", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c14cc7f43beaea8de6e8d8c46f8d961adf79c184", "submitter": { "id": 82782, "url": "http://patchwork.ozlabs.org/api/1.1/people/82782/?format=api", "name": "Marcin Szycik", "email": "marcin.szycik@linux.intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260428143716.9653-3-marcin.szycik@linux.intel.com/mbox/", "series": [ { "id": 501879, "url": "http://patchwork.ozlabs.org/api/1.1/series/501879/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=501879", "date": "2026-04-28T14:37:14", "name": "virtchnl: add extended VF capability flags", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501879/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229673/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229673/checks/", "tags": {}, "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@legolas.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=IGMyon29;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4l1t2xkyz1xrS\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 01:37:54 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id C051B80D44;\n\tTue, 28 Apr 2026 15:37:52 +0000 (UTC)", "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id E8NsBR6NyeXO; Tue, 28 Apr 2026 15:37:50 +0000 (UTC)", "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id B94518236B;\n\tTue, 28 Apr 2026 15:37:50 +0000 (UTC)", "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n by lists1.osuosl.org (Postfix) with ESMTP id BC2841B8\n for <intel-wired-lan@lists.osuosl.org>; Tue, 28 Apr 2026 15:37:47 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 6B9C580D44\n for <intel-wired-lan@lists.osuosl.org>; Tue, 28 Apr 2026 15:37:47 +0000 (UTC)", "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 83q5zdAa-TJ2 for <intel-wired-lan@lists.osuosl.org>;\n Tue, 28 Apr 2026 15:37:45 +0000 (UTC)", "from mgamail.intel.com (mgamail.intel.com [192.198.163.15])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 8B4BA821CE\n for <intel-wired-lan@lists.osuosl.org>; Tue, 28 Apr 2026 15:37:45 +0000 (UTC)", "from fmviesa003.fm.intel.com ([10.60.135.143])\n by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Apr 2026 08:37:45 -0700", "from irvmail002.ir.intel.com ([10.43.11.120])\n by fmviesa003.fm.intel.com with ESMTP; 28 Apr 2026 08:37:42 -0700", "from gond.igk.intel.com (gond.igk.intel.com [10.123.220.52])\n by irvmail002.ir.intel.com (Postfix) with ESMTP id 9AE67312C2;\n Tue, 28 Apr 2026 16:37:40 +0100 (IST)" ], "X-Virus-Scanned": [ "amavis at osuosl.org", "amavis at osuosl.org" ], "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ", "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 smtp1.osuosl.org B94518236B", "OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8B4BA821CE" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1777390670;\n\tbh=h6xmkC20ZZsQfbCXkpbC0mMyClnK0/2HcBfHcMzmLA4=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=IGMyon29c5Y26gm00ZeUiTND5yYR5llj7n/yqSL+HXFFbgL32oPq5/RTeo3idddqe\n\t JYcaeYSA8ubXO9iRRrX61MoTEYXfS58NUBpaH9718KTeO7qXEC8mXOukxvyLyWdIFT\n\t U/saYmgyGMv1rzuBhLsjMwcB4sp9WWUhHpBEeGMGAw156mfUl6tLf77YXhCVcHfImm\n\t zCTmeCTPhE7/33gqmPARRVu71SaZdPYczGn+hwvj8SPW8FG+4r4bhCdd9isw2vHpRD\n\t 9qyKl2DqYAFRYD8S8fdO4PtjbdNlIsHfXFKP6aYdGC2bbhiCovYqiAyCScDBRdh3vx\n\t odNmDCD1nJ3NQ==", "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.15;\n helo=mgamail.intel.com; envelope-from=marcin.szycik@linux.intel.com;\n receiver=<UNKNOWN>", "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp1.osuosl.org 8B4BA821CE", "X-CSE-ConnectionGUID": [ "Wx/n2WTaRp2o3qGTpteWww==", "m1sAz/B7QwO4aCHjx5KBUg==" ], "X-CSE-MsgGUID": [ "jxoLPDQpTKKiRlM1WeYFQw==", "yVfI1yzESuq7rR6ioXnqzw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11770\"; a=\"78415124\"", "E=Sophos;i=\"6.23,204,1770624000\"; d=\"scan'208\";a=\"78415124\"" ], "X-ExtLoop1": "1", "From": "Marcin Szycik <marcin.szycik@linux.intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Cc": "netdev@vger.kernel.org, paul.greenwalt@intel.com,\n jacob.e.keller@intel.com,\n Marcin Szycik <marcin.szycik@linux.intel.com>,\n Przemek Kitszel <przemyslaw.kitszel@intel.com>,\n Aleksandr Loktionov <aleksandr.loktionov@intel.com>", "Date": "Tue, 28 Apr 2026 16:37:15 +0200", "Message-ID": "<20260428143716.9653-3-marcin.szycik@linux.intel.com>", "X-Mailer": "git-send-email 2.49.0", "In-Reply-To": "<20260428143716.9653-1-marcin.szycik@linux.intel.com>", "References": "<20260428143716.9653-1-marcin.szycik@linux.intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1777390665; x=1808926665;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=VQu2tqSbSW7X25R4xLZsKJJ9VF0GLiJsVVZC1KV7H0g=;\n b=LvgQDHvxdGFweOrDbABjs8+Aaj0oZAdMPYawJSQEf1KrN5YEolBnzUry\n /9oUyZcK8vhOnG4mKnAy0LDbhOsGfIGnoKWF8wbwfvOkM10t/kM8wT4g0\n X6mKd3SMT93CPLeRI5L6qBSPu4PmnOZxfdLO+bMzlzKAURQHVDCgFoNu4\n QFRZJhjblRGlBj/ZCIf01JAPZU9KBOsWnP/+VkBFL8l+wJIOsn/gca3R3\n NFLA92kTDYI7jr2ifTQNvS07yHwHoztGCSh2buGDwfp9WoLf37eN5+//o\n R/ZLAW9oaER/tzUGldqHm9jMEuR7R+3nPAReFU+tdYwi2U0viyca5BxsO\n A==;", "X-Mailman-Original-Authentication-Results": [ "smtp1.osuosl.org;\n dmarc=none (p=none dis=none)\n header.from=linux.intel.com", "smtp1.osuosl.org;\n dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.a=rsa-sha256 header.s=Intel header.b=LvgQDHvx" ], "Subject": "[Intel-wired-lan] [PATCH iwl-next 2/3] virtchnl, iavf, ice,\n i40e: store VIRTCHNL_VF_* flags in bitmaps", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <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 <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "As part of preparation to add extended (32nd and more) capability flags,\nchange all flags from bitmasks to bit numbers and store them in bitmaps\ninstead of u32. Change all bitops to test_bit()/set_bit()/etc.\n\nFunctionally nothing is changed, except that iavf now stores capability\nflags in struct iavf_adapter::vf_cap_flags instead of\niavf_adapter::vf_res::vf_cap_flags to allow it to grow in the future.\n\nSigned-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>\nReviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>\nReviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\nReviewed-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 4 +-\n drivers/net/ethernet/intel/iavf/iavf.h | 51 ++++----\n .../net/ethernet/intel/iavf/iavf_prototype.h | 3 +-\n drivers/net/ethernet/intel/ice/ice_vf_lib.h | 5 +-\n include/linux/intel/virtchnl.h | 62 +++++-----\n .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 76 ++++++------\n drivers/net/ethernet/intel/iavf/iavf_common.c | 7 +-\n .../net/ethernet/intel/iavf/iavf_ethtool.c | 2 +-\n drivers/net/ethernet/intel/iavf/iavf_main.c | 36 +++---\n .../net/ethernet/intel/iavf/iavf_virtchnl.c | 51 ++++----\n drivers/net/ethernet/intel/ice/ice_vf_lib.c | 4 +-\n .../net/ethernet/intel/ice/virt/allowlist.c | 5 +-\n drivers/net/ethernet/intel/ice/virt/fdir.c | 2 +-\n drivers/net/ethernet/intel/ice/virt/queues.c | 13 ++-\n drivers/net/ethernet/intel/ice/virt/rss.c | 4 +-\n .../net/ethernet/intel/ice/virt/virtchnl.c | 109 +++++++++---------\n 16 files changed, 227 insertions(+), 207 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\nindex a03ecddfb956..b2b50c1fccf1 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n@@ -80,7 +80,9 @@ struct i40e_vf {\n \t/* all VF vsis connect to the same parent */\n \tenum i40e_switch_element_types parent_type;\n \tstruct virtchnl_version_info vf_ver;\n-\tu32 driver_caps; /* reported by VF driver */\n+\n+\t/* reported by VF driver */\n+\tDECLARE_BITMAP(driver_caps, VIRTCHNL_VF_CAPS_MAX);\n \n \t/* VF Port Extender (PE) stag if used */\n \tu16 stag;\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h\nindex 1a1a66b3311e..64576cba3a01 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf.h\n+++ b/drivers/net/ethernet/intel/iavf/iavf.h\n@@ -395,7 +395,7 @@ struct iavf_adapter {\n \tbool link_up;\n \tenum virtchnl_link_speed link_speed;\n \t/* This is only populated if the VIRTCHNL_VF_CAP_ADV_LINK_SPEED is set\n-\t * in vf_res->vf_cap_flags. Use ADV_LINK_SUPPORT macro to determine if\n+\t * in vf_cap_flags. Use ADV_LINK_SUPPORT macro to determine if\n \t * this field is valid. This field should be used going forward and the\n \t * enum virtchnl_link_speed above should be considered the legacy way of\n \t * storing/communicating link speeds.\n@@ -404,39 +404,32 @@ struct iavf_adapter {\n \n \tenum virtchnl_ops current_op;\n /* RSS by the PF should be preferred over RSS via other methods. */\n-#define RSS_PF(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t VIRTCHNL_VF_OFFLOAD_RSS_PF)\n-#define RSS_AQ(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t VIRTCHNL_VF_OFFLOAD_RSS_AQ)\n-#define RSS_REG(_a) (!((_a)->vf_res->vf_cap_flags & \\\n-\t\t (VIRTCHNL_VF_OFFLOAD_RSS_AQ | \\\n-\t\t\tVIRTCHNL_VF_OFFLOAD_RSS_PF)))\n-#define VLAN_ALLOWED(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t VIRTCHNL_VF_OFFLOAD_VLAN)\n-#define VLAN_V2_ALLOWED(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t VIRTCHNL_VF_OFFLOAD_VLAN_V2)\n-#define CRC_OFFLOAD_ALLOWED(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t\t VIRTCHNL_VF_OFFLOAD_CRC)\n-#define TC_U32_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t VIRTCHNL_VF_OFFLOAD_TC_U32)\n+#define RSS_PF(_a) test_bit(VIRTCHNL_VF_OFFLOAD_RSS_PF, (_a)->vf_cap_flags)\n+#define RSS_AQ(_a) test_bit(VIRTCHNL_VF_OFFLOAD_RSS_AQ, (_a)->vf_cap_flags)\n+#define RSS_REG(_a) (!(RSS_PF(_a) || RSS_AQ(_a)))\n+#define VLAN_ALLOWED(_a) test_bit(VIRTCHNL_VF_OFFLOAD_VLAN, (_a)->vf_cap_flags)\n+#define VLAN_V2_ALLOWED(_a)\t\t\t\t\t\t\\\n+\ttest_bit(VIRTCHNL_VF_OFFLOAD_VLAN_V2, (_a)->vf_cap_flags)\n+#define CRC_OFFLOAD_ALLOWED(_a)\t\t\t\t\t\t\\\n+\ttest_bit(VIRTCHNL_VF_OFFLOAD_CRC, (_a)->vf_cap_flags)\n+#define TC_U32_SUPPORT(_a)\t\t\t\t\t\t\\\n+\ttest_bit(VIRTCHNL_VF_OFFLOAD_TC_U32, (_a)->vf_cap_flags)\n #define VLAN_V2_FILTERING_ALLOWED(_a) \\\n \t(VLAN_V2_ALLOWED((_a)) && \\\n \t ((_a)->vlan_v2_caps.filtering.filtering_support.outer || \\\n \t (_a)->vlan_v2_caps.filtering.filtering_support.inner))\n #define VLAN_FILTERING_ALLOWED(_a) \\\n \t(VLAN_ALLOWED((_a)) || VLAN_V2_FILTERING_ALLOWED((_a)))\n-#define ADV_LINK_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t VIRTCHNL_VF_CAP_ADV_LINK_SPEED)\n-#define FDIR_FLTR_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t VIRTCHNL_VF_OFFLOAD_FDIR_PF)\n-#define ADV_RSS_SUPPORT(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF)\n-#define QOS_ALLOWED(_a) ((_a)->vf_res->vf_cap_flags & \\\n-\t\t\t VIRTCHNL_VF_OFFLOAD_QOS)\n+#define ADV_LINK_SUPPORT(_a)\t\t\t\t\t\t\\\n+\ttest_bit(VIRTCHNL_VF_CAP_ADV_LINK_SPEED, (_a)->vf_cap_flags)\n+#define FDIR_FLTR_SUPPORT(_a)\t\t\t\t\t\t\\\n+\ttest_bit(VIRTCHNL_VF_OFFLOAD_FDIR_PF, (_a)->vf_cap_flags)\n+#define ADV_RSS_SUPPORT(_a)\t\t\t\t\t\t\\\n+\ttest_bit(VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF, (_a)->vf_cap_flags)\n+#define QOS_ALLOWED(_a) test_bit(VIRTCHNL_VF_OFFLOAD_QOS, (_a)->vf_cap_flags)\n #define IAVF_RXDID_ALLOWED(a)\t\t\t\t\t\t\\\n-\t((a)->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)\n-#define IAVF_PTP_ALLOWED(a)\t\t\t\t\t\t\\\n-\t((a)->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_PTP)\n+\ttest_bit(VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC, (a)->vf_cap_flags)\n+#define IAVF_PTP_ALLOWED(a) test_bit(VIRTCHNL_VF_CAP_PTP, (a)->vf_cap_flags)\n \tstruct virtchnl_vf_resource *vf_res; /* incl. all VSIs */\n \tstruct virtchnl_vsi_resource *vsi_res; /* our LAN VSI */\n \tstruct virtchnl_version_info pf_version;\n@@ -445,6 +438,10 @@ struct iavf_adapter {\n \tstruct virtchnl_vlan_caps vlan_v2_caps;\n \tu64 supp_rxdids;\n \tstruct iavf_ptp ptp;\n+\n+\t/* Mirrors vf_res->vf_cap_flags */\n+\tDECLARE_BITMAP(vf_cap_flags, VIRTCHNL_VF_CAPS_MAX);\n+\n \tu16 msg_enable;\n \tstruct iavf_eth_stats current_stats;\n \tstruct virtchnl_qos_cap_list *qos_caps;\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_prototype.h b/drivers/net/ethernet/intel/iavf/iavf_prototype.h\nindex a3348b063723..985111b152d5 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_prototype.h\n+++ b/drivers/net/ethernet/intel/iavf/iavf_prototype.h\n@@ -42,7 +42,8 @@ enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,\n \t\t\t\t struct iavf_aqc_get_set_rss_key_data *key);\n \n void iavf_vf_parse_hw_config(struct iavf_hw *hw,\n-\t\t\t struct virtchnl_vf_resource *msg);\n+\t\t\t struct virtchnl_vf_resource *msg,\n+\t\t\t const unsigned long *vf_cap_flags);\n enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,\n \t\t\t\t\tenum virtchnl_ops v_opcode,\n \t\t\t\t\tenum iavf_status v_retval,\ndiff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h\nindex c520e22e3d0a..d44c060d3c91 100644\n--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h\n@@ -157,7 +157,10 @@ struct ice_vf {\n \tu64 rss_hashcfg;\t\t/* RSS hash configuration */\n \tstruct ice_sw *vf_sw_id;\t/* switch ID the VF VSIs connect to */\n \tstruct virtchnl_version_info vf_ver;\n-\tu32 driver_caps;\t\t/* reported by VF driver */\n+\n+\t/* reported by VF driver */\n+\tDECLARE_BITMAP(driver_caps, VIRTCHNL_VF_CAPS_MAX);\n+\n \tu8 dev_lan_addr[ETH_ALEN];\n \tu8 hw_lan_addr[ETH_ALEN];\n \tstruct ice_time_mac legacy_last_added_umac;\ndiff --git a/include/linux/intel/virtchnl.h b/include/linux/intel/virtchnl.h\nindex bb4737de37fe..577b0549b437 100644\n--- a/include/linux/intel/virtchnl.h\n+++ b/include/linux/intel/virtchnl.h\n@@ -244,35 +244,39 @@ struct virtchnl_vsi_resource {\n \n VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);\n \n-/* VF capability flags\n- * VIRTCHNL_VF_OFFLOAD_L2 flag is inclusive of base mode L2 offloads including\n- * TX/RX Checksum offloading and TSO for non-tunnelled packets.\n- */\n-#define VIRTCHNL_VF_OFFLOAD_L2\t\t\tBIT(0)\n-#define VIRTCHNL_VF_OFFLOAD_RDMA\t\tBIT(1)\n-#define VIRTCHNL_VF_OFFLOAD_RSS_AQ\t\tBIT(3)\n-#define VIRTCHNL_VF_OFFLOAD_RSS_REG\t\tBIT(4)\n-#define VIRTCHNL_VF_OFFLOAD_WB_ON_ITR\t\tBIT(5)\n-#define VIRTCHNL_VF_OFFLOAD_REQ_QUEUES\t\tBIT(6)\n-/* used to negotiate communicating link speeds in Mbps */\n-#define VIRTCHNL_VF_CAP_ADV_LINK_SPEED\t\tBIT(7)\n-#define VIRTCHNL_VF_OFFLOAD_CRC\t\tBIT(10)\n-#define VIRTCHNL_VF_OFFLOAD_TC_U32\t\tBIT(11)\n-#define VIRTCHNL_VF_OFFLOAD_VLAN_V2\t\tBIT(15)\n-#define VIRTCHNL_VF_OFFLOAD_VLAN\t\tBIT(16)\n-#define VIRTCHNL_VF_OFFLOAD_RX_POLLING\t\tBIT(17)\n-#define VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2\tBIT(18)\n-#define VIRTCHNL_VF_OFFLOAD_RSS_PF\t\tBIT(19)\n-#define VIRTCHNL_VF_OFFLOAD_ENCAP\t\tBIT(20)\n-#define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM\t\tBIT(21)\n-#define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM\tBIT(22)\n-#define VIRTCHNL_VF_OFFLOAD_ADQ\t\t\tBIT(23)\n-#define VIRTCHNL_VF_OFFLOAD_USO\t\t\tBIT(25)\n-#define VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC\tBIT(26)\n-#define VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF\t\tBIT(27)\n-#define VIRTCHNL_VF_OFFLOAD_FDIR_PF\t\tBIT(28)\n-#define VIRTCHNL_VF_OFFLOAD_QOS\t\t\tBIT(29)\n-#define VIRTCHNL_VF_CAP_PTP\t\t\tBIT(31)\n+/* VF capability flags */\n+enum virtchnl_vf_caps_bitnr {\n+\t/* Inclusive of base mode L2 offloads including TX/RX Checksum\n+\t * offloading and TSO for non-tunnelled packets.\n+\t */\n+\tVIRTCHNL_VF_OFFLOAD_L2 = 0,\n+\tVIRTCHNL_VF_OFFLOAD_RDMA = 1,\n+\tVIRTCHNL_VF_OFFLOAD_RSS_AQ = 3,\n+\tVIRTCHNL_VF_OFFLOAD_RSS_REG = 4,\n+\tVIRTCHNL_VF_OFFLOAD_WB_ON_ITR = 5,\n+\tVIRTCHNL_VF_OFFLOAD_REQ_QUEUES = 6,\n+\t/* Used to negotiate communicating link speeds in Mbps */\n+\tVIRTCHNL_VF_CAP_ADV_LINK_SPEED = 7,\n+\tVIRTCHNL_VF_OFFLOAD_CRC = 10,\n+\tVIRTCHNL_VF_OFFLOAD_TC_U32 = 11,\n+\tVIRTCHNL_VF_OFFLOAD_VLAN_V2 = 15,\n+\tVIRTCHNL_VF_OFFLOAD_VLAN = 16,\n+\tVIRTCHNL_VF_OFFLOAD_RX_POLLING = 17,\n+\tVIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 = 18,\n+\tVIRTCHNL_VF_OFFLOAD_RSS_PF = 19,\n+\tVIRTCHNL_VF_OFFLOAD_ENCAP = 20,\n+\tVIRTCHNL_VF_OFFLOAD_ENCAP_CSUM = 21,\n+\tVIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM = 22,\n+\tVIRTCHNL_VF_OFFLOAD_ADQ = 23,\n+\tVIRTCHNL_VF_OFFLOAD_USO = 25,\n+\tVIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC = 26,\n+\tVIRTCHNL_VF_OFFLOAD_ADV_RSS_PF = 27,\n+\tVIRTCHNL_VF_OFFLOAD_FDIR_PF = 28,\n+\tVIRTCHNL_VF_OFFLOAD_QOS = 29,\n+\tVIRTCHNL_VF_CAP_PTP = 31,\n+\n+\tVIRTCHNL_VF_CAPS_MAX /* must be last */\n+};\n \n struct virtchnl_vf_resource {\n \tu16 num_vsis;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex a26c3d47ec15..519f18dacd4a 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -90,7 +90,7 @@ static void i40e_set_vf_link_state(struct i40e_vf *vf,\n \tif (vf->link_forced)\n \t\tlink_status = vf->link_up;\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) {\n+\tif (test_bit(VIRTCHNL_VF_CAP_ADV_LINK_SPEED, vf->driver_caps)) {\n \t\tpfe->event_data.link_event_adv.link_speed = link_status ?\n \t\t\ti40e_vc_link_speed2mbps(ls->link_speed) : 0;\n \t\tpfe->event_data.link_event_adv.link_status = link_status;\n@@ -455,8 +455,8 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_id,\n \t/* if the vf is running in polling mode and using interrupt zero,\n \t * need to disable auto-mask on enabling zero interrupt for VFs.\n \t */\n-\tif ((vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_POLLING) &&\n-\t (vector_id == 0)) {\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RX_POLLING, vf->driver_caps) &&\n+\t vector_id == 0) {\n \t\treg = rd32(hw, I40E_GLINT_CTL);\n \t\tif (!(reg & I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK)) {\n \t\t\treg |= I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK;\n@@ -2146,51 +2146,56 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)\n \t\tlen = 0;\n \t\tgoto err;\n \t}\n-\tif (VF_IS_V11(&vf->vf_ver))\n-\t\tvf->driver_caps = *(u32 *)msg;\n-\telse\n-\t\tvf->driver_caps = VIRTCHNL_VF_OFFLOAD_L2 |\n-\t\t\t\t VIRTCHNL_VF_OFFLOAD_RSS_REG |\n-\t\t\t\t VIRTCHNL_VF_OFFLOAD_VLAN;\n \n-\tvfres->vf_cap_flags = VIRTCHNL_VF_OFFLOAD_L2;\n-\tvfres->vf_cap_flags |= VIRTCHNL_VF_CAP_ADV_LINK_SPEED;\n+\tbitmap_zero(vf->driver_caps, VIRTCHNL_VF_CAPS_MAX);\n+\tif (VF_IS_V11(&vf->vf_ver)) {\n+\t\tbitmap_from_arr32(vf->driver_caps, (u32 *)msg,\n+\t\t\t\t BITS_PER_TYPE(u32));\n+\t} else {\n+\t\t__set_bit(VIRTCHNL_VF_OFFLOAD_L2, vf->driver_caps);\n+\t\t__set_bit(VIRTCHNL_VF_OFFLOAD_RSS_REG, vf->driver_caps);\n+\t\t__set_bit(VIRTCHNL_VF_OFFLOAD_VLAN, vf->driver_caps);\n+\t}\n+\n+\tvfres->vf_cap_flags = BIT(VIRTCHNL_VF_OFFLOAD_L2);\n+\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_CAP_ADV_LINK_SPEED);\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n \tif (!vsi->info.pvid)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_VLAN;\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_VLAN);\n \n \tif (i40e_vf_client_capable(pf, vf->vf_id) &&\n-\t (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RDMA)) {\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RDMA;\n+\t test_bit(VIRTCHNL_VF_OFFLOAD_RDMA, vf->driver_caps)) {\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RDMA);\n \t\tset_bit(I40E_VF_STATE_RDMAENA, &vf->vf_states);\n \t} else {\n \t\tclear_bit(I40E_VF_STATE_RDMAENA, &vf->vf_states);\n \t}\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PF) {\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_PF;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RSS_PF, vf->driver_caps)) {\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RSS_PF);\n \t} else {\n \t\tif (test_bit(I40E_HW_CAP_RSS_AQ, pf->hw.caps) &&\n-\t\t (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_AQ))\n-\t\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_AQ;\n+\t\t test_bit(VIRTCHNL_VF_OFFLOAD_RSS_AQ, vf->driver_caps))\n+\t\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RSS_AQ);\n \t\telse\n-\t\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_REG;\n+\t\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RSS_REG);\n \t}\n \n \tif (test_bit(I40E_HW_CAP_MULTI_TCP_UDP_RSS_PCTYPE, pf->hw.caps)) {\n-\t\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2)\n+\t\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2,\n+\t\t\t vf->driver_caps))\n \t\t\tvfres->vf_cap_flags |=\n-\t\t\t\tVIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2;\n+\t\t\t\tBIT(VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2);\n \t}\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ENCAP;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ENCAP, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_ENCAP);\n \n \tif (test_bit(I40E_HW_CAP_OUTER_UDP_CSUM, pf->hw.caps) &&\n-\t (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM))\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM;\n+\t test_bit(VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_POLLING) {\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RX_POLLING, vf->driver_caps)) {\n \t\tif (test_bit(I40E_FLAG_MFP_ENA, pf->flags)) {\n \t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\"VF %d requested polling mode: this feature is supported only when the device is running in single function per port (SFP) mode\\n\",\n@@ -2198,20 +2203,20 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)\n \t\t\taq_ret = -EINVAL;\n \t\t\tgoto err;\n \t\t}\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RX_POLLING;\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RX_POLLING);\n \t}\n \n \tif (test_bit(I40E_HW_CAP_WB_ON_ITR, pf->hw.caps)) {\n-\t\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)\n+\t\tif (test_bit(VIRTCHNL_VF_OFFLOAD_WB_ON_ITR, vf->driver_caps))\n \t\t\tvfres->vf_cap_flags |=\n-\t\t\t\t\tVIRTCHNL_VF_OFFLOAD_WB_ON_ITR;\n+\t\t\t\t\tBIT(VIRTCHNL_VF_OFFLOAD_WB_ON_ITR);\n \t}\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_REQ_QUEUES;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_REQ_QUEUES, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_REQ_QUEUES);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ADQ)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ADQ;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_ADQ);\n \n \tvfres->num_vsis = num_vsis;\n \tvfres->num_queue_pairs = vf->num_queue_pairs;\n@@ -2227,7 +2232,8 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)\n \t\t/* VFs only use TC 0 */\n \t\tvfres->vsi_res[0].qset_handle\n \t\t\t\t\t = le16_to_cpu(vsi->info.qs_handle[0]);\n-\t\tif (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO) && !vf->pf_set_mac) {\n+\t\tif (!test_bit(VIRTCHNL_VF_OFFLOAD_USO, vf->driver_caps) &&\n+\t\t !vf->pf_set_mac) {\n \t\t\tspin_lock_bh(&vsi->mac_filter_hash_lock);\n \t\t\ti40e_del_mac_filter(vsi, vf->default_lan_addr.addr);\n \t\t\teth_zero_addr(vf->default_lan_addr.addr);\n@@ -4059,7 +4065,7 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg)\n \t\tgoto err;\n \t}\n \n-\tif (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ADQ)) {\n+\tif (!test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, vf->driver_caps)) {\n \t\tdev_err(&pf->pdev->dev,\n \t\t\t\"VF %d attempting to enable ADq, but hasn't properly negotiated that capability\\n\",\n \t\t\tvf->vf_id);\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_common.c b/drivers/net/ethernet/intel/iavf/iavf_common.c\nindex 9bc8bdc339c7..97e8b4ac8125 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_common.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_common.c\n@@ -421,12 +421,14 @@ enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,\n * iavf_vf_parse_hw_config\n * @hw: pointer to the hardware structure\n * @msg: pointer to the virtual channel VF resource structure\n+ * @vf_cap_flags: VF capability flags\n *\n * Given a VF resource message from the PF, populate the hw struct\n * with appropriate information.\n **/\n void iavf_vf_parse_hw_config(struct iavf_hw *hw,\n-\t\t\t struct virtchnl_vf_resource *msg)\n+\t\t\t struct virtchnl_vf_resource *msg,\n+\t\t\t const unsigned long *vf_cap_flags)\n {\n \tstruct virtchnl_vsi_resource *vsi_res;\n \tint i;\n@@ -437,8 +439,7 @@ void iavf_vf_parse_hw_config(struct iavf_hw *hw,\n \thw->dev_caps.num_rx_qp = msg->num_queue_pairs;\n \thw->dev_caps.num_tx_qp = msg->num_queue_pairs;\n \thw->dev_caps.num_msix_vectors_vf = msg->max_vectors;\n-\thw->dev_caps.dcb = msg->vf_cap_flags &\n-\t\t\t VIRTCHNL_VF_OFFLOAD_L2;\n+\thw->dev_caps.dcb = test_bit(VIRTCHNL_VF_OFFLOAD_L2, vf_cap_flags);\n \thw->dev_caps.fcoe = 0;\n \tfor (i = 0; i < msg->num_vsis; i++) {\n \t\tif (vsi_res->vsi_type == VIRTCHNL_VSI_SRIOV) {\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\nindex dc2503e3c5ba..b14d5c2309cc 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c\n@@ -1726,7 +1726,7 @@ static int iavf_set_channels(struct net_device *netdev,\n \tstruct iavf_adapter *adapter = netdev_priv(netdev);\n \tu32 num_req = ch->combined_count;\n \n-\tif ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, adapter->vf_cap_flags) &&\n \t adapter->num_tc) {\n \t\tdev_info(&adapter->pdev->dev, \"Cannot set channels since ADq is enabled.\\n\");\n \t\treturn -EINVAL;\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c\nindex 30ae1a296115..ce2b61e56f9d 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_main.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c\n@@ -1533,7 +1533,7 @@ static int iavf_alloc_queues(struct iavf_adapter *adapter)\n \t */\n \tif (adapter->num_req_queues)\n \t\tnum_active_queues = adapter->num_req_queues;\n-\telse if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&\n+\telse if (test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, adapter->vf_cap_flags) &&\n \t\t adapter->num_tc)\n \t\tnum_active_queues = adapter->ch_config.total_qps;\n \telse\n@@ -1736,8 +1736,8 @@ static int iavf_init_rss(struct iavf_adapter *adapter)\n \n \tif (!RSS_PF(adapter)) {\n \t\t/* Enable PCTYPES for RSS, TCP/UDP with IPv4/IPv6 */\n-\t\tif (adapter->vf_res->vf_cap_flags &\n-\t\t VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2)\n+\t\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2,\n+\t\t\t adapter->vf_cap_flags))\n \t\t\tadapter->rss_hashcfg =\n \t\t\t\tIAVF_DEFAULT_RSS_HASHCFG_EXPANDED;\n \t\telse\n@@ -1861,7 +1861,7 @@ static int iavf_init_interrupt_scheme(struct iavf_adapter *adapter)\n \t * resources have been allocated in the reset path.\n \t * Now we can truly claim that ADq is enabled.\n \t */\n-\tif ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, adapter->vf_cap_flags) &&\n \t adapter->num_tc)\n \t\tdev_info(&adapter->pdev->dev, \"ADq Enabled, %u TCs created\",\n \t\t\t adapter->num_tc);\n@@ -2436,7 +2436,7 @@ int iavf_parse_vf_resource_msg(struct iavf_adapter *adapter)\n \tadapter->vsi.base_vector = 1;\n \tvsi->netdev = adapter->netdev;\n \tvsi->qs_handle = adapter->vsi_res->qset_handle;\n-\tif (adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF) {\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RSS_PF, adapter->vf_cap_flags)) {\n \t\tadapter->rss_key_size = adapter->vf_res->rss_key_size;\n \t\tadapter->rss_lut_size = adapter->vf_res->rss_lut_size;\n \t} else {\n@@ -2783,8 +2783,7 @@ static void iavf_init_config_adapter(struct iavf_adapter *adapter)\n \tif (err)\n \t\tgoto err_sw_init;\n \tiavf_map_rings_to_vectors(adapter);\n-\tif (adapter->vf_res->vf_cap_flags &\n-\t\tVIRTCHNL_VF_OFFLOAD_WB_ON_ITR)\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_WB_ON_ITR, adapter->vf_cap_flags))\n \t\tadapter->flags |= IAVF_FLAG_WB_ON_ITR_CAPABLE;\n \n \terr = iavf_request_misc_irq(adapter);\n@@ -3080,7 +3079,6 @@ static void iavf_reconfig_qs_bw(struct iavf_adapter *adapter)\n */\n void iavf_reset_step(struct iavf_adapter *adapter)\n {\n-\tstruct virtchnl_vf_resource *vfres = adapter->vf_res;\n \tstruct net_device *netdev = adapter->netdev;\n \tstruct iavf_hw *hw = &adapter->hw;\n \tstruct iavf_mac_filter *f, *ftmp;\n@@ -3234,7 +3232,7 @@ void iavf_reset_step(struct iavf_adapter *adapter)\n \n \t/* check if TCs are running and re-add all cloud filters */\n \tspin_lock_bh(&adapter->cloud_filter_list_lock);\n-\tif ((vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, adapter->vf_cap_flags) &&\n \t adapter->num_tc) {\n \t\tlist_for_each_entry(cf, &adapter->cloud_filter_list, list) {\n \t\t\tcf->add = true;\n@@ -3675,7 +3673,6 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)\n {\n \tstruct tc_mqprio_qopt_offload *mqprio_qopt = type_data;\n \tstruct iavf_adapter *adapter = netdev_priv(netdev);\n-\tstruct virtchnl_vf_resource *vfres = adapter->vf_res;\n \tu8 num_tc = 0, total_qps = 0;\n \tint ret = 0, netdev_tc = 0;\n \tu64 max_tx_rate;\n@@ -3704,7 +3701,7 @@ static int __iavf_setup_tc(struct net_device *netdev, void *type_data)\n \n \t/* add queue channel */\n \tif (mode == TC_MQPRIO_MODE_CHANNEL) {\n-\t\tif (!(vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ)) {\n+\t\tif (!test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, adapter->vf_cap_flags)) {\n \t\t\tdev_err(&adapter->pdev->dev, \"ADq not supported\\n\");\n \t\t\treturn -EOPNOTSUPP;\n \t\t}\n@@ -4744,7 +4741,7 @@ iavf_get_netdev_vlan_hw_features(struct iavf_adapter *adapter)\n {\n \tnetdev_features_t hw_features = 0;\n \n-\tif (!adapter->vf_res || !adapter->vf_res->vf_cap_flags)\n+\tif (bitmap_empty(adapter->vf_cap_flags, VIRTCHNL_VF_CAPS_MAX))\n \t\treturn hw_features;\n \n \t/* Enable VLAN features if supported */\n@@ -4809,7 +4806,7 @@ iavf_get_netdev_vlan_features(struct iavf_adapter *adapter)\n {\n \tnetdev_features_t features = 0;\n \n-\tif (!adapter->vf_res || !adapter->vf_res->vf_cap_flags)\n+\tif (bitmap_empty(adapter->vf_cap_flags, VIRTCHNL_VF_CAPS_MAX))\n \t\treturn features;\n \n \tif (VLAN_ALLOWED(adapter)) {\n@@ -5186,7 +5183,6 @@ static int iavf_check_reset_complete(struct iavf_hw *hw)\n **/\n int iavf_process_config(struct iavf_adapter *adapter)\n {\n-\tstruct virtchnl_vf_resource *vfres = adapter->vf_res;\n \tnetdev_features_t hw_vlan_features, vlan_features;\n \tstruct net_device *netdev = adapter->netdev;\n \tnetdev_features_t hw_enc_features;\n@@ -5208,7 +5204,7 @@ int iavf_process_config(struct iavf_adapter *adapter)\n \t/* advertise to stack only if offloads for encapsulated packets is\n \t * supported\n \t */\n-\tif (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ENCAP) {\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ENCAP, adapter->vf_cap_flags)) {\n \t\thw_enc_features |= NETIF_F_GSO_UDP_TUNNEL\t|\n \t\t\t\t NETIF_F_GSO_GRE\t\t|\n \t\t\t\t NETIF_F_GSO_GRE_CSUM\t\t|\n@@ -5218,8 +5214,8 @@ int iavf_process_config(struct iavf_adapter *adapter)\n \t\t\t\t NETIF_F_GSO_PARTIAL\t\t|\n \t\t\t\t 0;\n \n-\t\tif (!(vfres->vf_cap_flags &\n-\t\t VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM))\n+\t\tif (!test_bit(VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM,\n+\t\t\t adapter->vf_cap_flags))\n \t\t\tnetdev->gso_partial_features |=\n \t\t\t\tNETIF_F_GSO_UDP_TUNNEL_CSUM;\n \n@@ -5239,11 +5235,11 @@ int iavf_process_config(struct iavf_adapter *adapter)\n \thw_vlan_features = iavf_get_netdev_vlan_hw_features(adapter);\n \n \t/* Enable HW TC offload if ADQ or tc U32 is supported */\n-\tif (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ ||\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ADQ, adapter->vf_cap_flags) ||\n \t TC_U32_SUPPORT(adapter))\n \t\thw_features |= NETIF_F_HW_TC;\n \n-\tif (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_USO)\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_USO, adapter->vf_cap_flags))\n \t\thw_features |= NETIF_F_GSO_UDP_L4;\n \n \tnetdev->hw_features |= hw_features | hw_vlan_features;\n@@ -5251,7 +5247,7 @@ int iavf_process_config(struct iavf_adapter *adapter)\n \n \tnetdev->features |= hw_features | vlan_features;\n \n-\tif (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_VLAN, adapter->vf_cap_flags))\n \t\tnetdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;\n \n \tif (FDIR_FLTR_SUPPORT(adapter)) {\ndiff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\nindex 04dc447bb8b0..38be4caf77f0 100644\n--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\n+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c\n@@ -152,27 +152,27 @@ int iavf_send_vf_config_msg(struct iavf_adapter *adapter)\n {\n \tu32 caps;\n \n-\tcaps = VIRTCHNL_VF_OFFLOAD_L2 |\n-\t VIRTCHNL_VF_OFFLOAD_RSS_PF |\n-\t VIRTCHNL_VF_OFFLOAD_RSS_AQ |\n-\t VIRTCHNL_VF_OFFLOAD_RSS_REG |\n-\t VIRTCHNL_VF_OFFLOAD_VLAN |\n-\t VIRTCHNL_VF_OFFLOAD_WB_ON_ITR |\n-\t VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 |\n-\t VIRTCHNL_VF_OFFLOAD_ENCAP |\n-\t VIRTCHNL_VF_OFFLOAD_TC_U32 |\n-\t VIRTCHNL_VF_OFFLOAD_VLAN_V2 |\n-\t VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC |\n-\t VIRTCHNL_VF_OFFLOAD_CRC |\n-\t VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM |\n-\t VIRTCHNL_VF_OFFLOAD_REQ_QUEUES |\n-\t VIRTCHNL_VF_CAP_PTP |\n-\t VIRTCHNL_VF_OFFLOAD_ADQ |\n-\t VIRTCHNL_VF_OFFLOAD_USO |\n-\t VIRTCHNL_VF_OFFLOAD_FDIR_PF |\n-\t VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF |\n-\t VIRTCHNL_VF_CAP_ADV_LINK_SPEED |\n-\t VIRTCHNL_VF_OFFLOAD_QOS;\n+\tcaps = BIT(VIRTCHNL_VF_OFFLOAD_L2) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_RSS_PF) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_RSS_AQ) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_RSS_REG) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_VLAN) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_ENCAP) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_TC_U32) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_VLAN_V2) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_CRC) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_REQ_QUEUES) |\n+\t BIT(VIRTCHNL_VF_CAP_PTP) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_ADQ) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_USO) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_FDIR_PF) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF) |\n+\t BIT(VIRTCHNL_VF_CAP_ADV_LINK_SPEED) |\n+\t BIT(VIRTCHNL_VF_OFFLOAD_QOS);\n \n \tadapter->current_op = VIRTCHNL_OP_GET_VF_RESOURCES;\n \tadapter->aq_required &= ~IAVF_FLAG_AQ_GET_CONFIG;\n@@ -296,12 +296,16 @@ int iavf_get_vf_config(struct iavf_adapter *adapter)\n \terr = iavf_poll_virtchnl_msg(hw, &event, VIRTCHNL_OP_GET_VF_RESOURCES);\n \tmemcpy(adapter->vf_res, event.msg_buf, min(event.msg_len, len));\n \n+\t/* mirror to the extended bitmap */\n+\tbitmap_from_arr32(adapter->vf_cap_flags, &adapter->vf_res->vf_cap_flags,\n+\t\t\t BITS_PER_TYPE(u32));\n+\n \t/* some PFs send more queues than we should have so validate that\n \t * we aren't getting too many queues\n \t */\n \tif (!err)\n \t\tiavf_validate_num_queues(adapter);\n-\tiavf_vf_parse_hw_config(hw, adapter->vf_res);\n+\tiavf_vf_parse_hw_config(hw, adapter->vf_res, adapter->vf_cap_flags);\n \n \tkfree(event.msg_buf);\n \n@@ -2579,7 +2583,8 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,\n \n \t\tmemcpy(adapter->vf_res, msg, min(msglen, len));\n \t\tiavf_validate_num_queues(adapter);\n-\t\tiavf_vf_parse_hw_config(&adapter->hw, adapter->vf_res);\n+\t\tiavf_vf_parse_hw_config(&adapter->hw, adapter->vf_res,\n+\t\t\t\t\tadapter->vf_cap_flags);\n \t\tif (is_zero_ether_addr(adapter->hw.mac.addr)) {\n \t\t\t/* restore current mac address */\n \t\t\tether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c\nindex 64a4a9eac9db..6570480c13fa 100644\n--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c\n@@ -792,7 +792,7 @@ void ice_reset_all_vfs(struct ice_pf *pf)\n \t\tmutex_lock(&vf->cfg_lock);\n \n \t\tice_eswitch_detach_vf(pf, vf);\n-\t\tvf->driver_caps = 0;\n+\t\tbitmap_zero(vf->driver_caps, VIRTCHNL_VF_CAPS_MAX);\n \t\tice_vc_set_default_allowlist(vf);\n \n \t\tice_vf_fdir_exit(vf);\n@@ -935,7 +935,7 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)\n \tif (!rsd)\n \t\tdev_warn(dev, \"VF reset check timeout on VF %d\\n\", vf->vf_id);\n \n-\tvf->driver_caps = 0;\n+\tbitmap_zero(vf->driver_caps, VIRTCHNL_VF_CAPS_MAX);\n \tice_vc_set_default_allowlist(vf);\n \n \t/* disable promiscuous modes in case they were enabled\ndiff --git a/drivers/net/ethernet/intel/ice/virt/allowlist.c b/drivers/net/ethernet/intel/ice/virt/allowlist.c\nindex a07efec19c45..eb3d3b4e65a9 100644\n--- a/drivers/net/ethernet/intel/ice/virt/allowlist.c\n+++ b/drivers/net/ethernet/intel/ice/virt/allowlist.c\n@@ -102,7 +102,7 @@ struct allowlist_opcode_info {\n \n #define BIT_INDEX(caps) (HWEIGHT((caps) - 1))\n #define ALLOW_ITEM(caps, list) \\\n-\t[BIT_INDEX(caps)] = { \\\n+\t[caps] = { \\\n \t\t.opcodes = list, \\\n \t\t.size = ARRAY_SIZE(list) \\\n \t}\n@@ -190,10 +190,9 @@ void ice_vc_set_working_allowlist(struct ice_vf *vf)\n */\n void ice_vc_set_caps_allowlist(struct ice_vf *vf)\n {\n-\tunsigned long caps = vf->driver_caps;\n \tunsigned int i;\n \n-\tfor_each_set_bit(i, &caps, ARRAY_SIZE(allowlist_opcodes))\n+\tfor_each_set_bit(i, vf->driver_caps, ARRAY_SIZE(allowlist_opcodes))\n \t\tice_vc_allowlist_opcodes(vf, allowlist_opcodes[i].opcodes,\n \t\t\t\t\t allowlist_opcodes[i].size);\n }\ndiff --git a/drivers/net/ethernet/intel/ice/virt/fdir.c b/drivers/net/ethernet/intel/ice/virt/fdir.c\nindex 4f1f3442e52c..74967edf27ad 100644\n--- a/drivers/net/ethernet/intel/ice/virt/fdir.c\n+++ b/drivers/net/ethernet/intel/ice/virt/fdir.c\n@@ -105,7 +105,7 @@ ice_vc_fdir_param_check(struct ice_vf *vf, u16 vsi_id)\n \tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))\n \t\treturn -EINVAL;\n \n-\tif (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_FDIR_PF))\n+\tif (!test_bit(VIRTCHNL_VF_OFFLOAD_FDIR_PF, vf->driver_caps))\n \t\treturn -EINVAL;\n \n \tif (!ice_vc_isvalid_vsi_id(vf, vsi_id))\ndiff --git a/drivers/net/ethernet/intel/ice/virt/queues.c b/drivers/net/ethernet/intel/ice/virt/queues.c\nindex 31be2f76181c..4e2caeb5d642 100644\n--- a/drivers/net/ethernet/intel/ice/virt/queues.c\n+++ b/drivers/net/ethernet/intel/ice/virt/queues.c\n@@ -781,7 +781,7 @@ int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)\n \t\tif (!qci->qpair[i].rxq.crc_disable)\n \t\t\tcontinue;\n \n-\t\tif (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC) ||\n+\t\tif (!test_bit(VIRTCHNL_VF_OFFLOAD_CRC, vf->driver_caps) ||\n \t\t vf->vlan_strip_ena)\n \t\t\tgoto error_param;\n \t}\n@@ -868,8 +868,8 @@ int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)\n \t\t\t * format. Legacy 16byte descriptor is not supported.\n \t\t\t * If this RXDID is selected, return error.\n \t\t\t */\n-\t\t\tif (vf->driver_caps &\n-\t\t\t VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {\n+\t\t\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC,\n+\t\t\t\t vf->driver_caps)) {\n \t\t\t\trxdid = qpi->rxq.rxdid;\n \t\t\t\tif (!(BIT(rxdid) & pf->supported_rxdids))\n \t\t\t\t\tgoto error_param;\n@@ -877,9 +877,10 @@ int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)\n \t\t\t\trxdid = ICE_RXDID_LEGACY_1;\n \t\t\t}\n \n-\t\t\tena_ts = ((vf->driver_caps &\n-\t\t\t\t VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) &&\n-\t\t\t\t (vf->driver_caps & VIRTCHNL_VF_CAP_PTP) &&\n+\t\t\tena_ts = (test_bit(VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC,\n+\t\t\t\t\t vf->driver_caps) &&\n+\t\t\t\t test_bit(VIRTCHNL_VF_CAP_PTP,\n+\t\t\t\t\t vf->driver_caps) &&\n \t\t\t\t (qpi->rxq.flags & VIRTCHNL_PTP_RX_TSTAMP));\n \n \t\t\tice_write_qrxflxp_cntxt(&vsi->back->hw,\ndiff --git a/drivers/net/ethernet/intel/ice/virt/rss.c b/drivers/net/ethernet/intel/ice/virt/rss.c\nindex 960012ca91b5..b4f6dcce76f6 100644\n--- a/drivers/net/ethernet/intel/ice/virt/rss.c\n+++ b/drivers/net/ethernet/intel/ice/virt/rss.c\n@@ -680,9 +680,9 @@ static bool ice_vc_parse_rss_cfg(struct ice_hw *hw,\n * Return true if VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF capability is set,\n * else return false\n */\n-static bool ice_vf_adv_rss_offload_ena(u32 caps)\n+static bool ice_vf_adv_rss_offload_ena(const unsigned long *caps)\n {\n-\treturn !!(caps & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF);\n+\treturn test_bit(VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF, caps);\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/ice/virt/virtchnl.c b/drivers/net/ethernet/intel/ice/virt/virtchnl.c\nindex 06d2f9be93ae..f15e8c82d52d 100644\n--- a/drivers/net/ethernet/intel/ice/virt/virtchnl.c\n+++ b/drivers/net/ethernet/intel/ice/virt/virtchnl.c\n@@ -58,7 +58,7 @@ static void\n ice_set_pfe_link(struct ice_vf *vf, struct virtchnl_pf_event *pfe,\n \t\t int ice_link_speed, bool link_up)\n {\n-\tif (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED) {\n+\tif (test_bit(VIRTCHNL_VF_CAP_ADV_LINK_SPEED, vf->driver_caps)) {\n \t\tpfe->event_data.link_event_adv.link_status = link_up;\n \t\t/* Speed in Mbps */\n \t\tpfe->event_data.link_event_adv.link_speed =\n@@ -188,26 +188,26 @@ static int ice_vc_get_ver_msg(struct ice_vf *vf, u8 *msg)\n }\n \n /**\n- * ice_vc_get_vlan_caps\n+ * ice_vc_get_vlan_caps - get VF capability flags based on driver caps\n * @hw: pointer to the hw\n * @vf: pointer to the VF info\n * @vsi: pointer to the VSI\n * @driver_caps: current driver caps\n *\n- * Return 0 if there is no VLAN caps supported, or VLAN caps value\n+ * Return: 0 if there is no VLAN caps supported, or VLAN caps value\n */\n static u32\n ice_vc_get_vlan_caps(struct ice_hw *hw, struct ice_vf *vf, struct ice_vsi *vsi,\n-\t\t u32 driver_caps)\n+\t\t const unsigned long *driver_caps)\n {\n \tif (ice_is_eswitch_mode_switchdev(vf->pf))\n \t\t/* In switchdev setting VLAN from VF isn't supported */\n \t\treturn 0;\n \n-\tif (driver_caps & VIRTCHNL_VF_OFFLOAD_VLAN_V2) {\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_VLAN_V2, driver_caps)) {\n \t\t/* VLAN offloads based on current device configuration */\n-\t\treturn VIRTCHNL_VF_OFFLOAD_VLAN_V2;\n-\t} else if (driver_caps & VIRTCHNL_VF_OFFLOAD_VLAN) {\n+\t\treturn BIT(VIRTCHNL_VF_OFFLOAD_VLAN_V2);\n+\t} else if (test_bit(VIRTCHNL_VF_OFFLOAD_VLAN, driver_caps)) {\n \t\t/* allow VF to negotiate VIRTCHNL_VF_OFFLOAD explicitly for\n \t\t * these two conditions, which amounts to guest VLAN filtering\n \t\t * and offloads being based on the inner VLAN or the\n@@ -215,7 +215,7 @@ ice_vc_get_vlan_caps(struct ice_hw *hw, struct ice_vf *vf, struct ice_vsi *vsi,\n \t\t * negotiate VIRTCHNL_VF_OFFLOAD in any other cases\n \t\t */\n \t\tif (ice_is_dvm_ena(hw) && ice_vf_is_port_vlan_ena(vf)) {\n-\t\t\treturn VIRTCHNL_VF_OFFLOAD_VLAN;\n+\t\t\treturn BIT(VIRTCHNL_VF_OFFLOAD_VLAN);\n \t\t} else if (!ice_is_dvm_ena(hw) &&\n \t\t\t !ice_vf_is_port_vlan_ena(vf)) {\n \t\t\t/* configure backward compatible support for VFs that\n@@ -223,7 +223,7 @@ ice_vc_get_vlan_caps(struct ice_hw *hw, struct ice_vf *vf, struct ice_vsi *vsi,\n \t\t\t * configured in SVM, and no port VLAN is configured\n \t\t\t */\n \t\t\tice_vf_vsi_cfg_svm_legacy_vlan_mode(vsi);\n-\t\t\treturn VIRTCHNL_VF_OFFLOAD_VLAN;\n+\t\t\treturn BIT(VIRTCHNL_VF_OFFLOAD_VLAN);\n \t\t} else if (ice_is_dvm_ena(hw)) {\n \t\t\t/* configure software offloaded VLAN support when DVM\n \t\t\t * is enabled, but no port VLAN is enabled\n@@ -264,13 +264,17 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\n \t\tlen = 0;\n \t\tgoto err;\n \t}\n-\tif (VF_IS_V11(&vf->vf_ver))\n-\t\tvf->driver_caps = *(u32 *)msg;\n-\telse\n-\t\tvf->driver_caps = VIRTCHNL_VF_OFFLOAD_L2 |\n-\t\t\t\t VIRTCHNL_VF_OFFLOAD_VLAN;\n \n-\tvfres->vf_cap_flags = VIRTCHNL_VF_OFFLOAD_L2;\n+\tbitmap_zero(vf->driver_caps, VIRTCHNL_VF_CAPS_MAX);\n+\tif (VF_IS_V11(&vf->vf_ver)) {\n+\t\tbitmap_from_arr32(vf->driver_caps, (u32 *)msg,\n+\t\t\t\t BITS_PER_TYPE(u32));\n+\t} else {\n+\t\t__set_bit(VIRTCHNL_VF_OFFLOAD_L2, vf->driver_caps);\n+\t\t__set_bit(VIRTCHNL_VF_OFFLOAD_VLAN, vf->driver_caps);\n+\t}\n+\n+\tvfres->vf_cap_flags = BIT(VIRTCHNL_VF_OFFLOAD_L2);\n \tvsi = ice_get_vf_vsi(vf);\n \tif (!vsi) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n@@ -280,54 +284,54 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\n \tvfres->vf_cap_flags |= ice_vc_get_vlan_caps(hw, vf, vsi,\n \t\t\t\t\t\t vf->driver_caps);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PF)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_PF;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RSS_PF, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RSS_PF);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_FDIR_PF)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_FDIR_PF;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_FDIR_PF, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_FDIR_PF);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_TC_U32 &&\n-\t vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_FDIR_PF)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_TC_U32;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_TC_U32, vf->driver_caps) &&\n+\t (vfres->vf_cap_flags & BIT(VIRTCHNL_VF_OFFLOAD_FDIR_PF)))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_TC_U32);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ENCAP;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ENCAP, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_ENCAP);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_POLLING)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RX_POLLING;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_RX_POLLING, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_RX_POLLING);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_WB_ON_ITR;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_WB_ON_ITR, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_WB_ON_ITR);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_REQ_QUEUES;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_REQ_QUEUES, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_REQ_QUEUES);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_CRC;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_CRC, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_CRC);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_CAP_ADV_LINK_SPEED;\n+\tif (test_bit(VIRTCHNL_VF_CAP_ADV_LINK_SPEED, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_CAP_ADV_LINK_SPEED);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_USO)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_USO;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_USO, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_USO);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_QOS)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_QOS;\n+\tif (test_bit(VIRTCHNL_VF_OFFLOAD_QOS, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_OFFLOAD_QOS);\n \n-\tif (vf->driver_caps & VIRTCHNL_VF_CAP_PTP)\n-\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_CAP_PTP;\n+\tif (test_bit(VIRTCHNL_VF_CAP_PTP, vf->driver_caps))\n+\t\tvfres->vf_cap_flags |= BIT(VIRTCHNL_VF_CAP_PTP);\n \n \tvfres->num_vsis = 1;\n \t/* Tx and Rx queue are equal for VF */\n@@ -344,7 +348,8 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\n \t\t\tvf->hw_lan_addr);\n \n \t/* match guest capabilities */\n-\tvf->driver_caps = vfres->vf_cap_flags;\n+\tbitmap_from_arr32(vf->driver_caps, &vfres->vf_cap_flags,\n+\t\t\t BITS_PER_TYPE(u32));\n \n \tice_vc_set_caps_allowlist(vf);\n \tice_vc_set_working_allowlist(vf);\n@@ -1027,9 +1032,9 @@ static int ice_vc_del_mac_addr_msg(struct ice_vf *vf, u8 *msg)\n *\n * Return true if VIRTCHNL_VF_OFFLOAD_VLAN capability is set, else return false\n */\n-static bool ice_vf_vlan_offload_ena(u32 caps)\n+static bool ice_vf_vlan_offload_ena(const unsigned long *caps)\n {\n-\treturn !!(caps & VIRTCHNL_VF_OFFLOAD_VLAN);\n+\treturn test_bit(VIRTCHNL_VF_OFFLOAD_VLAN, caps);\n }\n \n /**\n@@ -1431,7 +1436,7 @@ static int ice_vc_query_rxdid(struct ice_vf *vf)\n \t\tgoto err;\n \t}\n \n-\tif (!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)) {\n+\tif (!test_bit(VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC, vf->driver_caps)) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n \t\tgoto err;\n \t}\n", "prefixes": [ "iwl-next", "2/3" ] }