From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF07AA057B; Thu, 2 Apr 2020 09:33:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A7D12BCE; Thu, 2 Apr 2020 09:33:02 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0BD1A2B8B for ; Thu, 2 Apr 2020 09:32:59 +0200 (CEST) IronPort-SDR: 9dAvwh6hd39nE/JqOcdZR0zh2SKXiqYuyCA9epVu3aiOUK/JkzdZQC7WAsoOjNSlC319zAxQI8 1hqk8KBN5Iag== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 00:32:46 -0700 IronPort-SDR: vViGrh/Gc1LOSY5PgB9LAQ/hpB/lOaRZUl8x8ueiB1kMEA7dc6goKXHIBw3N7hE1p8OSPtK8eo guMfrD/fY0mg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,334,1580803200"; d="scan'208";a="267934572" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 02 Apr 2020 00:32:46 -0700 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Apr 2020 00:32:45 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 2 Apr 2020 15:32:43 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Thu, 2 Apr 2020 15:32:43 +0800 From: "Wang, Haiyue" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Peng, Yuan" , "Lu, Nannan" , "Fu, Qi" , "Xing, Beilei" Thread-Topic: [PATCH v2 13/13] net/ice: redirect switch rule to new VSI Thread-Index: AQHWCL10sF4msBBQRUuew5gwW6yZ7ahlcDFA Date: Thu, 2 Apr 2020 07:32:43 +0000 Message-ID: References: <20200313020806.21654-1-wei.zhao1@intel.com> <20200402064620.47668-1-wei.zhao1@intel.com> <20200402064620.47668-14-wei.zhao1@intel.com> In-Reply-To: <20200402064620.47668-14-wei.zhao1@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 13/13] net/ice: redirect switch rule to new VSI X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Zhao1, Wei > Sent: Thursday, April 2, 2020 14:46 > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Peng, Yuan ;= Lu, Nannan > ; Fu, Qi ; Wang, Haiyue ; Xing, Beilei > > Subject: [PATCH v2 13/13] net/ice: redirect switch rule to new VSI >=20 > After VF reset, VF's VSI number may be changed, > the switch rule which forwards packet to the old > VSI number should be redirected to the new VSI > number. >=20 > Signed-off-by: Beilei Xing > --- > drivers/net/ice/ice_dcf_parent.c | 22 +++++++++++++++++++--- > 1 file changed, 19 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_p= arent.c > index 37f0e2be2..e05b6b3e5 100644 > --- a/drivers/net/ice/ice_dcf_parent.c > +++ b/drivers/net/ice/ice_dcf_parent.c > @@ -19,6 +19,8 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vsi_= handle, > uint16_t vsi_map) > { > struct ice_vsi_ctx *vsi_ctx; > + bool first_update =3D false; > + uint16_t new_vsi_num; >=20 > if (unlikely(vsi_handle >=3D ICE_MAX_VSI)) { > PMD_DRV_LOG(ERR, "Invalid vsi handle %u", vsi_handle); > @@ -35,11 +37,25 @@ ice_dcf_update_vsi_ctx(struct ice_hw *hw, uint16_t vs= i_handle, > vsi_handle); > return; > } > + hw->vsi_ctx[vsi_handle] =3D vsi_ctx; > + first_update =3D true; > } >=20 > - vsi_ctx->vsi_num =3D (vsi_map & VIRTCHNL_DCF_VF_VSI_ID_M) >> > - VIRTCHNL_DCF_VF_VSI_ID_S; > - hw->vsi_ctx[vsi_handle] =3D vsi_ctx; > + new_vsi_num =3D (vsi_map & VIRTCHNL_DCF_VF_VSI_ID_M) >> > + VIRTCHNL_DCF_VF_VSI_ID_S; > + > + /* Redirect rules if vsi mapping table changes. */ > + if (!first_update && vsi_ctx->vsi_num !=3D new_vsi_num) { > + struct ice_flow_redirect rd; > + > + memset(&rd, 0, sizeof(struct ice_flow_redirect)); > + rd.type =3D ICE_FLOW_REDIRECT_VSI; > + rd.vsi_handle =3D vsi_handle; > + rd.new_vsi_num =3D new_vsi_num; > + ice_flow_redirect((struct ice_adapter *)hw->back, &rd); > + } else { > + vsi_ctx->vsi_num =3D new_vsi_num; > + } >=20 > PMD_DRV_LOG(DEBUG, "VF%u is assigned with vsi number %u", > vsi_handle, vsi_ctx->vsi_num); > -- > 2.19.1 Acked-by: Haiyue Wang