From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCA1FEB64D7 for ; Tue, 20 Jun 2023 10:01:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8FE6C418E9; Tue, 20 Jun 2023 10:01:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8FE6C418E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1687255307; bh=O7IMbo2Z7io2wGwNIhDJ/zkH0h2XFBv6ybspZ6KVXnA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=K9e9VHcMEG0ZFFeaUw704yd+Hdy/+2ND+yms8k35dAs6R6u7p3c7OQB5RNlqCcTD5 11j39oep4ROs/sepDJu4/0Hw4MtURUJunGNjKcGxOzmgEra9kcCoSILhLA0qNbnT6Q ZHsL6brr8mFf0n8u9xGrMNA2T0ni4oyvUz1hjCsDcOtNb9UXmOzSFnyTSKYZKzWn5A tJdS+Ey6o43wbDqcRM93iNt7epvDML4CvDcWjnOOYE3YcEOHUgeIcX34GL7dYaCk1X 27QNHZekelun5n4eSFnGAC2yC2o1XqrExGZ/NEBHOsd+OQbwjEz/rVRIPj+nJ+VngW e8mOK4MyWAZDg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yPbAZTuel7Nt; Tue, 20 Jun 2023 10:01:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 6DD8C418F3; Tue, 20 Jun 2023 10:01:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6DD8C418F3 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 0871F1BF39E for ; Tue, 20 Jun 2023 10:01:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D5FC460E4F for ; Tue, 20 Jun 2023 10:01:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D5FC460E4F X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nyCKp3t1oxjg for ; Tue, 20 Jun 2023 10:01:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 666EE60D59 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by smtp3.osuosl.org (Postfix) with ESMTPS id 666EE60D59 for ; Tue, 20 Jun 2023 10:01:17 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6600,9927,10746"; a="358688511" X-IronPort-AV: E=Sophos;i="6.00,256,1681196400"; d="scan'208";a="358688511" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2023 03:01:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10746"; a="664227481" X-IronPort-AV: E=Sophos;i="6.00,256,1681196400"; d="scan'208";a="664227481" Received: from dpdk-liulingy-2.sh.intel.com ([10.67.119.34]) by orsmga003.jf.intel.com with ESMTP; 20 Jun 2023 03:01:14 -0700 From: Lingyu Liu To: intel-wired-lan@lists.osuosl.org Date: Tue, 20 Jun 2023 09:59:58 +0000 Message-Id: <20230620100001.5331-13-lingyu.liu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230620100001.5331-1-lingyu.liu@intel.com> References: <20230620100001.5331-1-lingyu.liu@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687255277; x=1718791277; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6hq03XgwKBBLTJOEj+S+jKGtfVLR4/LVgHcDKbcVWtM=; b=ChMbkGs6Oa7QQD2oXwqME+WR59jnTiD/ZWuTNlDRJpmSkRrMGq4gAz9x EMTvcXTqtvqlrE+9tqhQaFLXY6Xyak5DDRuOAV9gq0jc/O7vJiKqnIbVc DH/6cI5QSa6ArBscleCWY5ecmQ5xp4gn3NPFHyEoyamt0tYHPqehQAjf9 kjiUBy8wKjDSscnozA5biWNO5G7o7gYBYNeUvbfVondp+9aht0dBLiXUt O+0rCzeFaX/apz7Z35CsNhpv785XiJLikyeCS52JWNy0T8wu4wsf97hLU FMoAdziNpJT8kWsbUKdKWsGhtD1OQsnmhuO1VS7SIVNPuHaRqITvoTX9M Q==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ChMbkGs6 Subject: [Intel-wired-lan] [PATCH iwl-next V1 12/15] ice: mask VF advanced capabilities if live migration is activated X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kevin.tian@intel.com, yi.l.liu@intel.com, phani.r.burra@intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Mask the advanced VF capability flags that are not supported when VF migration is activated. Signed-off-by: Lingyu Liu Signed-off-by: Yahui Cao --- .../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