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 BC308A0519; Mon, 22 Jun 2020 16:36:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2AFA01D70D; Mon, 22 Jun 2020 16:36:41 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 3C05C1D14F for ; Mon, 22 Jun 2020 16:36:39 +0200 (CEST) IronPort-SDR: 7J3ScoavKBWX6/0WJmBalVDPhlblbKF6JYFCnHlUu4VtjQaukGF+hkX/OEg9xh8exe1roUZWhS /hATTShsF9vw== X-IronPort-AV: E=McAfee;i="6000,8403,9659"; a="208971781" X-IronPort-AV: E=Sophos;i="5.75,267,1589266800"; d="scan'208";a="208971781" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2020 07:36:37 -0700 IronPort-SDR: 8en7yGupj78wBWofceYxKlLmHSa+go1riZtZ4u0u0nKc8JKyTtxQXJR19l1yFHmAIQLMAuSbdF fAiEIR99XETA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,267,1589266800"; d="scan'208";a="292866544" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 22 Jun 2020 07:36:37 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 07:36:37 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jun 2020 07:36:37 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.89]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.174]) with mapi id 14.03.0439.000; Mon, 22 Jun 2020 22:36:33 +0800 From: "Zhang, Qi Z" To: "Jiang, JunyuX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Su, Simei" Thread-Topic: [PATCH v2] net/ice: support based RSS configure Thread-Index: AQHWSFielHBUGUv6XEmFgZHgqJ2YCajkqkVA Date: Mon, 22 Jun 2020 14:36:33 +0000 Message-ID: <039ED4275CED7440929022BC67E7061154842F8A@SHSMSX103.ccr.corp.intel.com> References: <20200610063355.35172-1-junyux.jiang@intel.com> <20200622053312.46719-1-junyux.jiang@intel.com> In-Reply-To: <20200622053312.46719-1-junyux.jiang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/ice: support based RSS configure 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: Jiang, JunyuX > Sent: Monday, June 22, 2020 1:33 PM > To: dev@dpdk.org > Cc: Yang, Qiming ; Zhang, Qi Z > ; Su, Simei ; Jiang, JunyuX > > Subject: [PATCH v2] net/ice: support based RSS configure The title is misleading, how about "initialize and update RSS based on user= request" >=20 > Enable/disable RSS for corresponding flow base on the user's requirement Initialize and update RSS configure based on user request (rte_eth_rss_conf= ) from dev_configure and .rss_hash_update ops. All previous default configure has been removed. . >=20 > Signed-off-by: Junyu Jiang >=20 > --- > v1->v2: > remove gtpu and pppoe/pppod configuration from rss init > --- > drivers/net/ice/ice_ethdev.c | 162 +++++++++++++++++++++-------------- > 1 file changed, 96 insertions(+), 66 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c = index > 5a89a1955..cbe59a40e 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -2441,6 +2441,87 @@ ice_dev_uninit(struct rte_eth_dev *dev) > return 0; > } >=20 > +static void > +ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf) { > + struct ice_hw *hw =3D ICE_PF_TO_HW(pf); > + struct ice_vsi *vsi =3D pf->main_vsi; > + int ret; > + > + /** > + * configure RSS for IPv4 with input set IPv4 src/dst > + * configure RSS for IPv6 with input set IPv6 src/dst The comment looks redundant, please merge into one line. /* Configure RSS for IP with src/dst address as input set */ > + */ > + if (rss_hf & ETH_RSS_IP) { This is not correct, it is possible user only want IPv4 but not IPv6. For ice, I think we can do like below If (rss_hf & ETH_RSS_IPV4) { Ice_add_rss_cfg (... ICE_FLOW_HASH_IPV4 ...) } If (rss_hf & ETH_RSS_IPV6) { Ice_add_rss_cfg (... ICE_FLOW_HASH_IPv6 ...) } We can just ignore ETH_RSS_FRAG_IPV4 and ETH_RSS_NONFRAG_IPV4_OTHER and sam= e for UDP/TCP and SCTP. > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4, > + ICE_FLOW_SEG_HDR_IPV4, 0); You need ICE_FLOW_SEG_HDR_IPV_OTHER, see patch=20 http://patchwork.dpdk.org/patch/71584/ > + if (ret) > + PMD_DRV_LOG(ERR, "%s IPV4 rss flow fail %d", > + __func__, ret); > + > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6, > + ICE_FLOW_SEG_HDR_IPV6, 0); > + if (ret) > + PMD_DRV_LOG(ERR, "%s IPV6 rss flow fail %d", > + __func__, ret); > + } > + /** > + *configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst > + *configure RSS for udp4 with input set IP src/dst, UDP src/dst > + */ > + if (rss_hf & ETH_RSS_UDP) { > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV6, > + ICE_FLOW_SEG_HDR_UDP | > + ICE_FLOW_SEG_HDR_IPV6, 0); > + if (ret) > + PMD_DRV_LOG(ERR, "%s UDP_IPV6 rss flow fail %d", > + __func__, ret); > + > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV4, > + ICE_FLOW_SEG_HDR_UDP | > + ICE_FLOW_SEG_HDR_IPV4, 0); > + if (ret) > + PMD_DRV_LOG(ERR, "%s UDP_IPV4 rss flow fail %d", > + __func__, ret); > + } > + /** > + * configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst > + * configure RSS for tcp4 with input set IP src/dst, TCP src/dst > + */ > + if (rss_hf & ETH_RSS_TCP) { > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV6, > + ICE_FLOW_SEG_HDR_TCP | > + ICE_FLOW_SEG_HDR_IPV6, 0); > + if (ret) > + PMD_DRV_LOG(ERR, "%s TCP_IPV6 rss flow fail %d", > + __func__, ret); > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV4, > + ICE_FLOW_SEG_HDR_TCP | > + ICE_FLOW_SEG_HDR_IPV4, 0); > + if (ret) > + PMD_DRV_LOG(ERR, "%s TCP_IPV4 rss flow fail %d", > + __func__, ret); > + } > + /** > + * configure RSS for sctp6 with input set IPv6 src/dst > + * configure RSS for sctp4 with input set IP src/dst > + */ > + if (rss_hf & ETH_RSS_SCTP) { > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6, > + ICE_FLOW_SEG_HDR_SCTP | > + ICE_FLOW_SEG_HDR_IPV6, 0); > + if (ret) > + PMD_DRV_LOG(ERR, "%s SCTP_IPV6 rss flow fail %d", > + __func__, ret); > + ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4, > + ICE_FLOW_SEG_HDR_SCTP | > + ICE_FLOW_SEG_HDR_IPV4, 0); > + if (ret) > + PMD_DRV_LOG(ERR, "%s SCTP_IPV4 rss flow fail %d", > + __func__, ret); > + } > +} > + > static int ice_init_rss(struct ice_pf *pf) { > struct ice_hw *hw =3D ICE_PF_TO_HW(pf); > @@ -2501,72 +2582,9 @@ static int ice_init_rss(struct ice_pf *pf) > (1 << VSIQF_HASH_CTL_HASH_SCHEME_S); > ICE_WRITE_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id), reg); >=20 > - /* configure RSS for IPv4 with input set IPv4 src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4, > - ICE_FLOW_SEG_HDR_IPV4, 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s IPV4 rss flow fail %d", __func__, ret); > - > - /* configure RSS for IPv6 with input set IPv6 src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6, > - ICE_FLOW_SEG_HDR_IPV6, 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s IPV6 rss flow fail %d", __func__, ret); > - > - /* configure RSS for tcp6 with input set IPv6 src/dst, TCP src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV6, > - ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_IPV6, > 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s TCP_IPV6 rss flow fail %d", __func__, ret); > - > - /* configure RSS for udp6 with input set IPv6 src/dst, UDP src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV6, > - ICE_FLOW_SEG_HDR_UDP | ICE_FLOW_SEG_HDR_IPV6, > 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s UDP_IPV6 rss flow fail %d", __func__, ret); > - > - /* configure RSS for sctp6 with input set IPv6 src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6, > - ICE_FLOW_SEG_HDR_SCTP | ICE_FLOW_SEG_HDR_IPV6, > 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s SCTP_IPV6 rss flow fail %d", > - __func__, ret); > - > - /* configure RSS for tcp4 with input set IP src/dst, TCP src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV4, > - ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_IPV4, > 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s TCP_IPV4 rss flow fail %d", __func__, ret); > - > - /* configure RSS for udp4 with input set IP src/dst, UDP src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV4, > - ICE_FLOW_SEG_HDR_UDP | ICE_FLOW_SEG_HDR_IPV4, > 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s UDP_IPV4 rss flow fail %d", __func__, ret); > - > - /* configure RSS for sctp4 with input set IP src/dst */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4, > - ICE_FLOW_SEG_HDR_SCTP | ICE_FLOW_SEG_HDR_IPV4, > 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s SCTP_IPV4 rss flow fail %d", > - __func__, ret); > - > - /* configure RSS for gtpu with input set TEID */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_GTP_U_IPV4_TEID, > - ICE_FLOW_SEG_HDR_GTPU_IP, 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s GTPU_TEID rss flow fail %d", > - __func__, ret); >=20 > - /** > - * configure RSS for pppoe/pppod with input set > - * Source MAC and Session ID > - */ > - ret =3D ice_add_rss_cfg(hw, vsi->idx, > ICE_FLOW_HASH_PPPOE_SESS_ID_ETH, > - ICE_FLOW_SEG_HDR_PPPOE, 0); > - if (ret) > - PMD_DRV_LOG(ERR, "%s PPPoE/PPPoD_SessionID rss flow fail %d", > - __func__, ret); > + /* RSS hash configuration */ > + ice_rss_hash_set(pf, rss_conf->rss_hf); >=20 > return 0; > } > @@ -3680,6 +3698,7 @@ ice_rss_hash_update(struct rte_eth_dev *dev, { > enum ice_status status =3D ICE_SUCCESS; > struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > struct ice_vsi *vsi =3D pf->main_vsi; >=20 > /* set hash key */ > @@ -3687,7 +3706,18 @@ ice_rss_hash_update(struct rte_eth_dev *dev, > if (status) > return status; >=20 > - /* TODO: hash enable config, ice_add_rss_cfg */ > + if (rss_conf->rss_hf =3D=3D 0) > + return -EINVAL; > + > + status =3D ice_rem_vsi_rss_cfg(hw, vsi->idx); > + if (status !=3D ICE_SUCCESS) { > + PMD_DRV_LOG(ERR, "Failed to remove rss cfg!"); > + return status; > + } No need to remove exist configure,=20 we just need to make sure all the configure from rss_hf has been applied. > + > + /* RSS hash configuration */ > + ice_rss_hash_set(pf, rss_conf->rss_hf); > + > return 0; > } >=20 > -- > 2.17.1