Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lingyu Liu <lingyu.liu@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: kevin.tian@intel.com, yi.l.liu@intel.com, phani.r.burra@intel.com
Subject: [Intel-wired-lan] [PATCH iwl-next V1 12/15] ice: mask VF advanced capabilities if live migration is activated
Date: Tue, 20 Jun 2023 09:59:58 +0000	[thread overview]
Message-ID: <20230620100001.5331-13-lingyu.liu@intel.com> (raw)
In-Reply-To: <20230620100001.5331-1-lingyu.liu@intel.com>

Mask the advanced VF capability flags that are
not supported when VF migration is activated.

Signed-off-by: Lingyu Liu <lingyu.liu@intel.com>
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
---
 .../net/ethernet/intel/ice/ice_migration.c    | 27 +++++++++++++++++++
 .../intel/ice/ice_migration_private.h         |  6 +++++
 drivers/net/ethernet/intel/ice/ice_virtchnl.c |  2 ++
 3 files changed, 35 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_migration.c b/drivers/net/ethernet/intel/ice/ice_migration.c
index c588738828ab..0bc897ab0dc2 100644
--- a/drivers/net/ethernet/intel/ice/ice_migration.c
+++ b/drivers/net/ethernet/intel/ice/ice_migration.c
@@ -748,3 +748,30 @@ void ice_migration_fix_msg_vsi(struct ice_vf *vf, u32 v_opcode, u8 *msg)
 		break;
 	}
 }
+
+#define VIRTCHNL_VF_MIGRATION_SUPPORT_FEATURE \
+				(VIRTCHNL_VF_OFFLOAD_L2 | \
+				 VIRTCHNL_VF_OFFLOAD_RSS_PF | \
+				 VIRTCHNL_VF_OFFLOAD_RSS_AQ | \
+				 VIRTCHNL_VF_OFFLOAD_RSS_REG | \
+				 VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 | \
+				 VIRTCHNL_VF_OFFLOAD_ENCAP | \
+				 VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM | \
+				 VIRTCHNL_VF_OFFLOAD_RX_POLLING | \
+				 VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | \
+				 VIRTCHNL_VF_CAP_ADV_LINK_SPEED | \
+				 VIRTCHNL_VF_OFFLOAD_VLAN | \
+				 VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC | \
+				 VIRTCHNL_VF_OFFLOAD_USO)
+
+/**
+ * ice_migration_supported_caps - get migration supported VF capablities
+ *
+ * When migration is activated, some VF capabilities are not supported.
+ * So unmask those capability flags for VF resources.
+ */
+u32 ice_migration_supported_caps(void)
+{
+
+	return VIRTCHNL_VF_MIGRATION_SUPPORT_FEATURE;
+}
diff --git a/drivers/net/ethernet/intel/ice/ice_migration_private.h b/drivers/net/ethernet/intel/ice/ice_migration_private.h
index 728acfaefbdf..47ad45c2b737 100644
--- a/drivers/net/ethernet/intel/ice/ice_migration_private.h
+++ b/drivers/net/ethernet/intel/ice/ice_migration_private.h
@@ -14,12 +14,18 @@
 void ice_migration_save_vf_msg(struct ice_vf *vf,
 			       struct ice_rq_event_info *event);
 void ice_migration_fix_msg_vsi(struct ice_vf *vf, u32 v_opcode, u8 *msg);
+u32 ice_migration_supported_caps(void);
 #else
 static inline void
 ice_migration_save_vf_msg(struct ice_vf *vf,
 			  struct ice_rq_event_info *event) { }
 static inline void
 ice_migration_fix_msg_vsi(struct ice_vf *vf, u32 v_opcode, u8 *msg) { }
+static inline u32
+ice_migration_supported_caps(void)
+{
+	return 0xFFFFFFFF;
+}
 #endif /* CONFIG_ICE_VFIO_PCI */
 
 #endif /* _ICE_MIGRATION_PRIVATE_H_ */
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
index 5fc252e14fdf..655d68fc688b 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c
@@ -468,6 +468,8 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)
 				  VIRTCHNL_VF_OFFLOAD_RSS_REG |
 				  VIRTCHNL_VF_OFFLOAD_VLAN;
 
+	if (vf->migration_active)
+		vf->driver_caps &= ice_migration_supported_caps();
 	vfres->vf_cap_flags = VIRTCHNL_VF_OFFLOAD_L2;
 	vsi = ice_get_vf_vsi(vf);
 	if (!vsi) {
-- 
2.25.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  parent reply	other threads:[~2023-06-20 10:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20  9:59 [Intel-wired-lan] [PATCH iwl-next V1 00/15] Add E800 live migration driver Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 01/15] ice: Fix missing legacy 32byte RXDID in the supported bitmap Lingyu Liu
2023-06-20 11:05   ` Przemek Kitszel
2023-06-21  9:16     ` Liu, Lingyu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 02/15] ice: add function to get rxq context Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 03/15] ice: check VF migration status before sending messages to VF Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 04/15] ice: add migration init field and helper functions Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 05/15] ice: save VF messages as device state Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 06/15] ice: save and restore " Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 07/15] ice: do not notify VF link state during migration Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 08/15] ice: change VSI id in virtual channel message after migration Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 09/15] ice: save and restore RX queue head Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 10/15] ice: save and restore TX " Lingyu Liu
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 11/15] ice: stop device before saving device states Lingyu Liu
2023-06-20  9:59 ` Lingyu Liu [this message]
2023-06-20  9:59 ` [Intel-wired-lan] [PATCH iwl-next V1 13/15] vfio/ice: implement vfio_pci driver for E800 devices Lingyu Liu
2023-06-20 10:00 ` [Intel-wired-lan] [PATCH iwl-next V1 14/15] vfio: Expose vfio_device_has_container() Lingyu Liu
2023-06-20 10:00 ` [Intel-wired-lan] [PATCH iwl-next V1 15/15] vfio/ice: support iommufd vfio compat mode Lingyu Liu
2023-06-20 11:08 ` [Intel-wired-lan] [PATCH iwl-next V1 00/15] Add E800 live migration driver Paul Menzel
2023-06-27  9:06   ` Liu, Lingyu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230620100001.5331-13-lingyu.liu@intel.com \
    --to=lingyu.liu@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kevin.tian@intel.com \
    --cc=phani.r.burra@intel.com \
    --cc=yi.l.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox