From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50074.outbound.protection.outlook.com [40.107.5.74]) by dpdk.org (Postfix) with ESMTP id 8EDB0239 for ; Mon, 29 Oct 2018 17:38:01 +0100 (CET) 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=A8A3KH+HCBAngKAYGqZV/LP13z0JMwCsO19Bn/lNRVs=; b=QslwDKW4ycUvI2okuigrFhniWCwGwOLTGy8gwtuD7BoenunzbLkhJV7h5k4D/XSBu5Y6RvdltYLOHJj1rUWBvUO0SmUZkwIr1vQdF29CwW0NoKdN2Q+pCdZnA9Xpp+8eS6TgcKaFdafGkZA/pU5vB3EdDZKVgFzIejXqhvM2RE8= Received: from VI1PR0502MB3743.eurprd05.prod.outlook.com (52.134.8.154) by VI1PR0502MB2990.eurprd05.prod.outlook.com (10.175.21.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.18; Mon, 29 Oct 2018 16:37:59 +0000 Received: from VI1PR0502MB3743.eurprd05.prod.outlook.com ([fe80::fd5f:be55:2063:d2de]) by VI1PR0502MB3743.eurprd05.prod.outlook.com ([fe80::fd5f:be55:2063:d2de%3]) with mapi id 15.20.1273.027; Mon, 29 Oct 2018 16:37:59 +0000 From: Ophir Munk To: Shahaf Shuler , Yongseok Koh CC: "dev@dpdk.org" , Asaf Penso , Thomas Monjalon , Olga Shern Thread-Topic: [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS Thread-Index: AQHUWz/ESBH47HIm1UmG4BuA5+cC8KUN3w0AgAXHJuCAIuuXEA== Date: Mon, 29 Oct 2018 16:37:59 +0000 Message-ID: References: <1538588246-21436-1-git-send-email-ophirmu@mellanox.com> In-Reply-To: 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=ophirmu@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0502MB2990; 6:Tu/l1T3nJSLBJIqBRwfDiTyZdASWhC4pnGx9RkMAbzHXFVFTvkoFOMRvonYe4TkrWJdYOOWz44IYsaCJpzS8lLAwmDJByhexyE/UFTnsqDXB4Cdr7fwLbL+Y4WxVpFO95RHdcxe0SJhX6ZC/SfH1QbtWIpaKS7Y800pcYR/H9CujiKJoLJZL2nLOrWQm71qHDFigI+Lbtm+3bAZHot1vzcs8oLqNXRcuhqa9x2X55mE/Ws/gvqyjLS6YarKOGvnGCiuSeQhsrk2CROOLLed9o6SH69pUoQs0cPPVMuJ89VKYMPatRXAb8UpYYT/b3Rj19oKdj09cKBHkxNglmj5up5wVTAK3C1a4ZnvhnKQgvLGmh5Mr6wL3Nr0XiJ1SydxNxMQgFD3JOupaPLrzXf84rNF/Unlul3Pj43wXX3ya4QnOV4wV5as0UkG9aMMcGkiLfLPQT1J6RdverLQDakyuDQ==; 5:4E48CU3kIVzcYo3Z32qYz+Tv6xibWWHsreH7ssS+p1NULIihwVlC6zf274wdGGlwBd3KXQ/5BlxMRShknQcKMIboftkcU1/8VQAZ0aeOq3Hh6urNJTI/cRFbl5/EuUHmr98rmcnQTn2V2BhEnos2PVBszBJE0f32BET22cwi6gM=; 7:t/PX09UqkMDBa952fspDV85uJzjiXEsAHWlHv7htJ58Hso9h4nqDu+bRp1HZbu+wKptqmmbk2xch15Qc1IYuxSwkBpvBnjHUXZxlJFn8amCftj8AwcmDkHD2fmGB7ZVp1B5aulDnaWcI7n53LxWa3A== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 6c54371b-a1b1-4d63-9fbb-08d63dbce362 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR0502MB2990; x-ms-traffictypediagnostic: VI1PR0502MB2990: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397); 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)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:VI1PR0502MB2990; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0502MB2990; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(366004)(346002)(396003)(376002)(199004)(189003)(13464003)(6116002)(110136005)(14454004)(26005)(97736004)(5250100002)(25786009)(86362001)(478600001)(7696005)(66066001)(99286004)(186003)(71190400001)(71200400001)(76176011)(54906003)(105586002)(107886003)(3846002)(316002)(102836004)(6506007)(106356001)(14444005)(53546011)(7736002)(256004)(6436002)(68736007)(305945005)(6636002)(2900100001)(229853002)(9686003)(55016002)(33656002)(6246003)(53936002)(8676002)(81166006)(74316002)(81156014)(8936002)(2906002)(486006)(5660300001)(11346002)(476003)(446003)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0502MB2990; H:VI1PR0502MB3743.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: DmjrYCsqG780YNSJls5OEJg3Bf7NUIORIveJUJfdVxTV7NEo3ap0gmXKEywIjSSkuB2ZUI0RfP6UtL++iTxXNxdjK4KetV795mPvrjGP7KKLaHcRdYVX5Tp4oXE1g70r/G8A+ZvQm9OwYKlcfGbl85UpVaS+xKaQDxtmp3Ftp4X2H7ngZwNANQGFCkzsKYL7PumZ6RqdK7PI6C2YgifpGpGzWMgi3gr5VHoz81XwdvGgAR4bz7P6LEOXTkPG9G36ePY7L7vTHf1DuLj82bjmwxSIRJ7YFB6WhG7BG49kj2G9RzxoBMI4f6NoIwhQ9dsgEy3nK6dnBv6ke+QLYCzJfxQ+K470fwFWKeZT4veuDG4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c54371b-a1b1-4d63-9fbb-08d63dbce362 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 16:37:59.6320 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB2990 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS 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, 29 Oct 2018 16:38:01 -0000 > -----Original Message----- > From: Shahaf Shuler > Sent: Sunday, October 07, 2018 2:21 PM > To: Yongseok Koh ; Ophir Munk > > Cc: dev@dpdk.org; Asaf Penso ; Thomas Monjalon > ; Olga Shern > Subject: RE: [PATCH] net/mlx5: set RSS key len 0 to indicate default RSS >=20 > > > On Oct 3, 2018, at 10:37 AM, Ophir Munk > > wrote: > > > > > > Applications which add an RSS flow must supply an RSS key table and > > > an RSS key length. If an application needs to add the default RSS > > > flow it should not care about the exact RSS default key table and its > length. > > > By setting key length to 0 - the PMD will know that it should use > > > the default RSS key table and length. >=20 > Can you refer where in the rte_flow API this is documented? I couldn't f= ind it > under struct rte_flow_action_rss definition. > I agree it is better for the PMD to behave this way, but this should be > explained in the API, so for this patch to be accepted we need also doc > update in rte_flow.h. >=20 Will update documentation in v2 > In my opinion, it is better for the key to be NULL to request from the PM= D to > use the default key, similar to struct rte_eth_rss_conf. >=20 I suggest considering both (NULL key or key_len 0) as a criteria for using = default RSS key. In addition if type=3D=3D0 it will be considered a default type and mlx5 wi= ll use ETH_RSS_IP Will update in v2 > > > diff --git a/drivers/net/mlx5/mlx5_flow.c > > > b/drivers/net/mlx5/mlx5_flow.c index 3f548a9..18eacf5 100644 > > > --- a/drivers/net/mlx5/mlx5_flow.c > > > +++ b/drivers/net/mlx5/mlx5_flow.c > > > @@ -2062,7 +2062,8 @@ struct mlx5_flow_tunnel_info { > > > > > > @@ -2106,7 +2107,7 @@ struct mlx5_flow_tunnel_info { > > > memcpy((*flow->queue), rss->queue, > > > rss->queue_num * sizeof(uint16_t)); > > > flow->rss.queue_num =3D rss->queue_num; > > > - memcpy(flow->key, rss->key, MLX5_RSS_HASH_KEY_LEN); > > > + memcpy(flow->key, rss->key, rss->key_len); >=20 > In Mellanox devices 40B of a key is a must. If you intended to copy 0 byt= es, it > is better to do it in other ways. rss->key_len can be 0 or 40. Please consider this memcpy() a generic code w= hich fits both cases. >=20