From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30089.outbound.protection.outlook.com [40.107.3.89]) by dpdk.org (Postfix) with ESMTP id D3A69EE2B for ; Mon, 21 May 2018 12:59:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KLVWj6/gJ+Yju8dbks5Q/l/FBvbVzW5GNstxiyqkP6o=; b=lgRUQMj/cq7sK0MiZMHGK/EPPRfiX2pHGsD8cecrvJ20J7CAZQsSfeampyXSNW5TXYXf3ySgeH0ruH/Iti1r0lnHUpL1P1MiH/EdU9VAzf7e4XOTGzM/yxLgHRPd7c8/fmS3Tc7al0l3o5jyYVqeJu2TUcevr65hCtVhZ5fzEqU= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB5050.eurprd05.prod.outlook.com (20.176.236.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.755.16; Mon, 21 May 2018 10:59:36 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::e57e:5e77:595f:d4f7]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::e57e:5e77:595f:d4f7%13]) with mapi id 15.20.0776.015; Mon, 21 May 2018 10:59:36 +0000 From: Shahaf Shuler To: Adrien Mazarguil , Ophir Munk CC: "dev@dpdk.org" Thread-Topic: [PATCH 2/2] net/mlx4: refactor RSS conversion functions Thread-Index: AQHT7GSULwYC3iP/9UqiKoNnLm+yTaQ0NUKAgAEM2QCABMdPUA== Date: Mon, 21 May 2018 10:59:36 +0000 Message-ID: References: <20180515154853.6361-1-adrien.mazarguil@6wind.com> <20180515154853.6361-2-adrien.mazarguil@6wind.com> <20180518094900.GM6497@6wind.com> In-Reply-To: <20180518094900.GM6497@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5050; 7:fWK9PyTkqVEmbPdDfy499ZVQqli+tD2o0sSa0PXDpwWj/6z85Hk3vQ/ALKh2/AWzqQzTh2JVq51uGWkiRwqStXC/XVvv6x/by/70gkdvl5q4DbUJMjkLrydVMqJrXLAMtyiuT0jITaqPy3t1mwWE8wX1YNP9M35BeMIpCGd0tzT0/19MB0IZRfiSFN3ZQvlpS6LWy9ZlUEbgOSEerfL6tD3DGp4PS6w5MkIy9ieK+LDJfe54yuKdqgWpG373r70O x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5050; x-ms-traffictypediagnostic: DB7PR05MB5050: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB5050; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5050; x-forefront-prvs: 06793E740F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(39860400002)(39380400002)(189003)(53474002)(199004)(5250100002)(93886005)(5660300001)(105586002)(229853002)(106356001)(3846002)(6116002)(68736007)(74316002)(186003)(7696005)(55016002)(6436002)(99286004)(102836004)(26005)(9686003)(2906002)(97736004)(6246003)(6506007)(53936002)(110136005)(76176011)(33656002)(14454004)(11346002)(3280700002)(7736002)(305945005)(316002)(4326008)(8936002)(3660700001)(8676002)(6636002)(86362001)(81166006)(81156014)(66066001)(478600001)(446003)(2900100001)(486006)(476003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5050; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 9iFoldRIjWeMlgIFqN/xG5RrM7nzYuAE8W2Wfn2ZYb4NQKmwIJ9Q3Ydy/VUQb4PIlF399WHJAaWkwn23+R3e/kZleoexNJrXxQ6GUHl8JWrFDneGJINTG5oXppCIfZ1ishk7vq1iXOAY8Shp8GeWR7a0hQwL5knGY8Fbmmm43Zh6I28HURPWsx6nWyOH1vsQ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: a605237e-2b1c-4973-d2f1-08d5bf09f107 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: a605237e-2b1c-4973-d2f1-08d5bf09f107 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2018 10:59:36.0975 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5050 Subject: Re: [dpdk-dev] [PATCH 2/2] net/mlx4: refactor RSS conversion functions 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, 21 May 2018 10:59:38 -0000 Hi Adrien, Please help me walkthrough this logic. Something doesn't end up correctly.= =20 Friday, May 18, 2018 12:49 PM, Adrien Mazarguil: > Cc: Shahaf Shuler ; dev@dpdk.org > Subject: Re: [PATCH 2/2] net/mlx4: refactor RSS conversion functions > > > Signed-off-by: Adrien Mazarguil > > > Cc: Ophir Munk > > > * > > > * @return > > > - * A valid Verbs RSS hash fields mask for mlx4 on success, (uint64= _t)-1 > > > - * otherwise and rte_errno is set. > > > + * Converted RSS hash fields on success, (uint64_t)-1 otherwise an= d > > > + * rte_errno is set. > > > */ > > > uint64_t > > > -mlx4_conv_rss_types(struct priv *priv, uint64_t types) > > > +mlx4_conv_rss_types(struct priv *priv, uint64_t types, int > > > +verbs_to_dpdk) > > > { Let's assume: Types =3D IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4 And verbs_to_dpdk=3D1 > > > - enum { IPV4, IPV6, TCP, UDP, }; > > > - static const uint64_t in[] =3D { > > > + enum { > > > + INNER, IPV4, IPV6, TCP, UDP, > > > + IPV4_TCP, IPV4_UDP, IPV6_TCP, IPV6_UDP, > > > + }; > > > + static const uint64_t dpdk[] =3D { > > > + [INNER] =3D 0, > > > [IPV4] =3D (ETH_RSS_IPV4 | > > > ETH_RSS_FRAG_IPV4 | > > > - ETH_RSS_NONFRAG_IPV4_TCP | > > > - ETH_RSS_NONFRAG_IPV4_UDP | > > > ETH_RSS_NONFRAG_IPV4_OTHER), > > > [IPV6] =3D (ETH_RSS_IPV6 | > > > ETH_RSS_FRAG_IPV6 | > > > - ETH_RSS_NONFRAG_IPV6_TCP | > > > - ETH_RSS_NONFRAG_IPV6_UDP | > > > ETH_RSS_NONFRAG_IPV6_OTHER | > > > - ETH_RSS_IPV6_EX | > > > - ETH_RSS_IPV6_TCP_EX | > > > - ETH_RSS_IPV6_UDP_EX), > > > - [TCP] =3D (ETH_RSS_NONFRAG_IPV4_TCP | > > > - ETH_RSS_NONFRAG_IPV6_TCP | > > > - ETH_RSS_IPV6_TCP_EX), > > > - [UDP] =3D (ETH_RSS_NONFRAG_IPV4_UDP | > > > - ETH_RSS_NONFRAG_IPV6_UDP | > > > - ETH_RSS_IPV6_UDP_EX), > > > + ETH_RSS_IPV6_EX), > > > + [TCP] =3D 0, > > > + [UDP] =3D 0, > > > + [IPV4_TCP] =3D ETH_RSS_NONFRAG_IPV4_TCP, > > > + [IPV4_UDP] =3D ETH_RSS_NONFRAG_IPV4_UDP, > > > + [IPV6_TCP] =3D (ETH_RSS_NONFRAG_IPV6_TCP | > > > + ETH_RSS_IPV6_TCP_EX), > > > + [IPV6_UDP] =3D (ETH_RSS_NONFRAG_IPV6_UDP | > > > + ETH_RSS_IPV6_UDP_EX), > > > }; > > > - static const uint64_t out[RTE_DIM(in)] =3D { > > > + const uint64_t verbs[RTE_DIM(dpdk)] =3D { > > > + [INNER] =3D IBV_RX_HASH_INNER, > > > [IPV4] =3D IBV_RX_HASH_SRC_IPV4 | > IBV_RX_HASH_DST_IPV4, > > > [IPV6] =3D IBV_RX_HASH_SRC_IPV6 | > IBV_RX_HASH_DST_IPV6, > > > [TCP] =3D IBV_RX_HASH_SRC_PORT_TCP | > IBV_RX_HASH_DST_PORT_TCP, > > > [UDP] =3D IBV_RX_HASH_SRC_PORT_UDP | > IBV_RX_HASH_DST_PORT_UDP, > > > + [IPV4_TCP] =3D verbs[IPV4] | verbs[TCP], > > > + [IPV4_UDP] =3D verbs[IPV4] | verbs[UDP], > > > + [IPV6_TCP] =3D verbs[IPV6] | verbs[TCP], > > > + [IPV6_UDP] =3D verbs[IPV6] | verbs[UDP], > > > }; > > > + const uint64_t *in =3D verbs_to_dpdk ? verbs : dpdk; > > > + const uint64_t *out =3D verbs_to_dpdk ? dpdk : verbs; > > > uint64_t seen =3D 0; > > > uint64_t conv =3D 0; > > > unsigned int i; > > > > > > - if (!types) Types !=3D 0 , we skip.=20 > > > - return priv->hw_rss_sup; > > > - for (i =3D 0; i !=3D RTE_DIM(in); ++i) > > > + if (!types) { > > > + if (!verbs_to_dpdk) > > > + return priv->hw_rss_sup; > > > + types =3D priv->hw_rss_sup; > > > + } > > > + for (i =3D 0; i !=3D RTE_DIM(dpdk); ++i) > > > if (types & in[i]) { > > > seen |=3D types & in[i]; > > > conv |=3D out[i]; > > > } After this loop: seen =3D (IBV_RX_HASH_SRC_PORT_IPV4 | IBV_RX_HASH_DST_IPV4) conv =3D dpdk[IPV4] | dpdk[IPV4_TCP] | dpdk[IPV4_UDP] > > > - if ((conv & priv->hw_rss_sup) =3D=3D conv && !(types & ~seen)) > > > + if ((verbs_to_dpdk || (conv & priv->hw_rss_sup) =3D=3D conv) && > > > + !(types & ~seen)) All types were seen && verbs_to_dpdk hence returning that PMD support RSS b= ased on IPV4 | TCPV4 | UDPV4 While according to the reported capabilities form kernel only IPV4 is suppo= rted.=20 > > > return conv; > > > rte_errno =3D ENOTSUP; > > > return (uint64_t)-1; > > > } > > > > >