From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0076.outbound.protection.outlook.com [104.47.38.76]) by dpdk.org (Postfix) with ESMTP id 0082BFF4 for ; Mon, 8 May 2017 21:03:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GKicR9L8fCOsn6Jso10+WVPcFQNDJIaGNj1cH4e7C5c=; b=AcSM6DnEZQA00gpFH2GQA5bOmPoULesIR00kKvMtZqmCShy/DiQie5v0bIFmf4TuMeKG0f/hOy4nGsvtPslttVuhq/P+pTD8HTTCmeOTPN1iRL7l3G9TSWBSOmazw2q0tkD9682KWXNom1FWkJTYDrgb3Lt3vDwbbdmGjsZhagI= Received: from BLUPR0701MB1572.namprd07.prod.outlook.com (10.163.84.146) by BLUPR0701MB1570.namprd07.prod.outlook.com (10.163.84.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Mon, 8 May 2017 19:03:33 +0000 Received: from BLUPR0701MB1572.namprd07.prod.outlook.com ([10.163.84.146]) by BLUPR0701MB1572.namprd07.prod.outlook.com ([10.163.84.146]) with mapi id 15.01.1075.019; Mon, 8 May 2017 19:03:33 +0000 From: "Mody, Rasesh" To: Thomas Monjalon CC: "dev@dpdk.org" , Dept-Eng DPDK Dev , "Mody, Rasesh" Thread-Topic: [PATCH] net/qede: fix RSS table entries for 100G adapter Thread-Index: AQHSx4S66yzjkUBVI0WFj4lZKOjiiaHqshqg Date: Mon, 8 May 2017 19:03:33 +0000 Message-ID: References: <1494197592-12266-1-git-send-email-rasesh.mody@cavium.com> In-Reply-To: <1494197592-12266-1-git-send-email-rasesh.mody@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=cavium.com; x-originating-ip: [2601:646:8180:be50:f9eb:923:92f5:d1d8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BLUPR0701MB1570; 7:EgVM8imYjGuF1OHWK0OKVGAE17u0u33tgCEAnhkTIMwgp+K1RtFgRfvUUmT1+bVyGJxnjQ7Y6G26XNKpldW/hrpEeGdR+x3My3PIB/BjeOIVKAhy2dEj71njmAP0AYMPSkQ/h1BBMyx2JbCo+XPe2Vk9wN2Ew1O/6UBYd7BS6pNok5ZhxA7rtz19aj5j71flwA0P/0d+TD5UMUD+tTbhe5O99x6q3lc0aE4j59s+rO/Omep/05vF+d434t8RSl8G9UTpxspV7DJawg2lTimogKdPLUYDbYp6LOa6lCt3O51PIlYWxjq1N8/qx9Z2SoxAVWaEU8MLmmX27XiXOXA4/g== x-ms-office365-filtering-correlation-id: a8926803-1a68-4b44-3550-08d49644ec58 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1570; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(6072148); SRVR:BLUPR0701MB1570; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1570; x-forefront-prvs: 0301360BF5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39850400002)(39400400002)(39410400002)(39840400002)(377454003)(6506006)(4326008)(189998001)(7736002)(3280700002)(76176999)(54356999)(81166006)(9686003)(25786009)(55016002)(99286003)(5660300001)(305945005)(54906002)(7696004)(2900100001)(229853002)(3660700001)(122556002)(478600001)(2950100002)(2906002)(33656002)(77096006)(74316002)(8936002)(6916009)(50986999)(8676002)(53936002)(110136004)(6246003)(107886003)(38730400002)(575784001)(86362001)(6116002)(102836003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1570; H:BLUPR0701MB1572.namprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2017 19:03:33.0676 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1570 Subject: Re: [dpdk-dev] [PATCH] net/qede: fix RSS table entries for 100G adapter 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: , X-List-Received-Date: Mon, 08 May 2017 19:03:36 -0000 Hi Thomas, > From: Rasesh Mody [mailto:rasesh.mody@cavium.com] > Sent: Sunday, May 07, 2017 3:53 PM >=20 > With the change in base APIs the logic for 100G handling needs to be > adjusted to pass cid values instead for queue ids. The current API works > assuming its queue id. >=20 > Fixes: 69d7ba88f1a1 ("net/qede/base: use L2-handles for RSS configuration= ") This is a *CRITICAL MUST FIX* patch for 100Gb adapters supported by qed/qed= e on DPDK 17.05. There will be functional and performance issues/regression= without this fix on 100Gb adapters.=20 Without this change, RSS in 100Gb adapters do not function properly and lea= ds to performance issues. Rx Queue stop command on 100Gb adapter will resu= lts in FW exception, where the Rx queue stop request gets stuck in FW and l= eads to PMD/application error saying failed to stop RXQ 0. The issue was introduced by one of the 17.05 base driver patches (net/qede/= base: use L2-handles for RSS configuration), which has changed the logic to= use queue handles instead of queue ids. However, we missed to make the cor= responding changes in 17.05 QEDE for the 100Gb adapter. This patch addresse= s that by making changes in QEDE to work with queue handles and associate t= he queues to respective HW functions based on queue handles. Please include this fix in 17.05 release. Thanks! -Rasesh >=20 > Signed-off-by: Rasesh Mody > --- > drivers/net/qede/qede_eth_if.c | 27 ------------- > drivers/net/qede/qede_eth_if.h | 2 - > drivers/net/qede/qede_ethdev.c | 85 > ++++++++++++++++++++++++++++++++++------ > drivers/net/qede/qede_ethdev.h | 1 + > 4 files changed, 73 insertions(+), 42 deletions(-) >=20 > diff --git a/drivers/net/qede/qede_eth_if.c > b/drivers/net/qede/qede_eth_if.c index 86bb129..a3c0b13 100644 > --- a/drivers/net/qede/qede_eth_if.c > +++ b/drivers/net/qede/qede_eth_if.c > @@ -67,33 +67,6 @@ static int qed_stop_vport(struct ecore_dev *edev, > uint8_t vport_id) > return 0; > } >=20 > -bool qed_update_rss_parm_cmt(struct ecore_dev *edev, uint16_t *p_tbl) > -{ > - uint16_t max =3D 0, k; > - bool rss_mode =3D 0; /* disable */ > - int divisor; > - > - /* Find largest entry, since it's possible RSS needs to > - * be disabled [in case only 1 queue per-hwfn] > - */ > - for (k =3D 0; k < ECORE_RSS_IND_TABLE_SIZE; k++) > - max =3D (max > p_tbl[k]) ? max : p_tbl[k]; > - > - /* Either fix RSS values or disable RSS */ > - if (edev->num_hwfns < max + 1) { > - divisor =3D (max + edev->num_hwfns - 1) / edev->num_hwfns; > - DP_VERBOSE(edev, ECORE_MSG_SPQ, > - "CMT - fixing RSS values (modulo %02x)\n", > - divisor); > - for (k =3D 0; k < ECORE_RSS_IND_TABLE_SIZE; k++) > - p_tbl[k] =3D p_tbl[k] % divisor; > - > - rss_mode =3D 1; > - } > - > - return rss_mode; > -} > - > static int > qed_update_vport(struct ecore_dev *edev, struct > qed_update_vport_params *params) { diff --git > a/drivers/net/qede/qede_eth_if.h b/drivers/net/qede/qede_eth_if.h > index d845bac..097e025 100644 > --- a/drivers/net/qede/qede_eth_if.h > +++ b/drivers/net/qede/qede_eth_if.h > @@ -129,6 +129,4 @@ struct qed_eth_ops { int > qed_configure_filter_rx_mode(struct rte_eth_dev *eth_dev, > enum qed_filter_rx_mode_type type); >=20 > -bool qed_update_rss_parm_cmt(struct ecore_dev *edev, uint16_t *p_tbl); > - > #endif /* _QEDE_ETH_IF_H */ > diff --git a/drivers/net/qede/qede_ethdev.c > b/drivers/net/qede/qede_ethdev.c index 4ef5765..7501eb2 100644 > --- a/drivers/net/qede/qede_ethdev.c > +++ b/drivers/net/qede/qede_ethdev.c > @@ -1576,6 +1576,61 @@ static int qede_rss_hash_conf_get(struct > rte_eth_dev *eth_dev, > return 0; > } >=20 > +static bool qede_update_rss_parm_cmt(struct ecore_dev *edev, > + struct ecore_rss_params *rss) > +{ > + int i, fn; > + bool rss_mode =3D 1; /* enable */ > + struct ecore_queue_cid *cid; > + struct ecore_rss_params *t_rss; > + > + /* In regular scenario, we'd simply need to take input handlers. > + * But in CMT, we'd have to split the handlers according to the > + * engine they were configured on. We'd then have to understand > + * whether RSS is really required, since 2-queues on CMT doesn't > + * require RSS. > + */ > + > + /* CMT should be round-robin */ > + for (i =3D 0; i < ECORE_RSS_IND_TABLE_SIZE; i++) { > + cid =3D rss->rss_ind_table[i]; > + > + if (cid->p_owner =3D=3D ECORE_LEADING_HWFN(edev)) > + t_rss =3D &rss[0]; > + else > + t_rss =3D &rss[1]; > + > + t_rss->rss_ind_table[i / edev->num_hwfns] =3D cid; > + } > + > + t_rss =3D &rss[1]; > + t_rss->update_rss_ind_table =3D 1; > + t_rss->rss_table_size_log =3D 7; > + t_rss->update_rss_config =3D 1; > + > + /* Make sure RSS is actually required */ > + for_each_hwfn(edev, fn) { > + for (i =3D 1; i < ECORE_RSS_IND_TABLE_SIZE / edev- > >num_hwfns; > + i++) { > + if (rss[fn].rss_ind_table[i] !=3D > + rss[fn].rss_ind_table[0]) > + break; > + } > + > + if (i =3D=3D ECORE_RSS_IND_TABLE_SIZE / edev->num_hwfns) { > + DP_INFO(edev, > + "CMT - 1 queue per-hwfn; Disabling RSS\n"); > + rss_mode =3D 0; > + goto out; > + } > + } > + > +out: > + t_rss->rss_enable =3D rss_mode; > + > + return rss_mode; > +} > + > int qede_rss_reta_update(struct rte_eth_dev *eth_dev, > struct rte_eth_rss_reta_entry64 *reta_conf, > uint16_t reta_size) > @@ -1583,11 +1638,11 @@ int qede_rss_reta_update(struct rte_eth_dev > *eth_dev, > struct qede_dev *qdev =3D QEDE_INIT_QDEV(eth_dev); > struct ecore_dev *edev =3D QEDE_INIT_EDEV(qdev); > struct ecore_sp_vport_update_params vport_update_params; > - struct ecore_rss_params params; > + struct ecore_rss_params *params; > struct ecore_hwfn *p_hwfn; > uint16_t i, idx, shift; > uint8_t entry; > - int rc; > + int rc =3D 0; >=20 > if (reta_size > ETH_RSS_RETA_SIZE_128) { > DP_ERR(edev, "reta_size %d is not supported by > hardware\n", @@ -1596,7 +1651,8 @@ int qede_rss_reta_update(struct > rte_eth_dev *eth_dev, > } >=20 > memset(&vport_update_params, 0, sizeof(vport_update_params)); > - memset(¶ms, 0, sizeof(params)); > + params =3D rte_zmalloc("qede_rss", sizeof(*params) * edev- > >num_hwfns, > + RTE_CACHE_LINE_SIZE); >=20 > for (i =3D 0; i < reta_size; i++) { > idx =3D i / RTE_RETA_GROUP_SIZE; > @@ -1604,24 +1660,25 @@ int qede_rss_reta_update(struct rte_eth_dev > *eth_dev, > if (reta_conf[idx].mask & (1ULL << shift)) { > entry =3D reta_conf[idx].reta[shift]; > /* Pass rxq handles to ecore */ > - params.rss_ind_table[i] =3D > + params->rss_ind_table[i] =3D > qdev->fp_array[entry].rxq->handle; > /* Update the local copy for RETA query command */ > qdev->rss_ind_table[i] =3D entry; > } > } >=20 > + params->update_rss_ind_table =3D 1; > + params->rss_table_size_log =3D 7; > + params->update_rss_config =3D 1; > + > /* Fix up RETA for CMT mode device */ > if (edev->num_hwfns > 1) > - qdev->rss_enable =3D qed_update_rss_parm_cmt(edev, > - params.rss_ind_table[0]); > - params.update_rss_ind_table =3D 1; > - params.rss_table_size_log =3D 7; > - params.update_rss_config =3D 1; > + qdev->rss_enable =3D qede_update_rss_parm_cmt(edev, > + params); > vport_update_params.vport_id =3D 0; > /* Use the current value of rss_enable */ > - params.rss_enable =3D qdev->rss_enable; > - vport_update_params.rss_params =3D ¶ms; > + params->rss_enable =3D qdev->rss_enable; > + vport_update_params.rss_params =3D params; >=20 > for_each_hwfn(edev, i) { > p_hwfn =3D &edev->hwfns[i]; > @@ -1630,11 +1687,13 @@ int qede_rss_reta_update(struct rte_eth_dev > *eth_dev, > ECORE_SPQ_MODE_EBLOCK, > NULL); > if (rc) { > DP_ERR(edev, "vport-update for RSS failed\n"); > - return rc; > + goto out; > } > } >=20 > - return 0; > +out: > + rte_free(params); > + return rc; > } >=20 > static int qede_rss_reta_query(struct rte_eth_dev *eth_dev, diff --git > a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h > index 26b6332..e4323a0 100644 > --- a/drivers/net/qede/qede_ethdev.h > +++ b/drivers/net/qede/qede_ethdev.h > @@ -37,6 +37,7 @@ > #include "base/ecore_sp_commands.h" > #include "base/ecore_l2.h" > #include "base/ecore_dev_api.h" > +#include "base/ecore_l2.h" >=20 > #include "qede_logs.h" > #include "qede_if.h" > -- > 1.7.10.3