From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 09C802B94 for ; Wed, 7 Nov 2018 15:06:23 +0100 (CET) Received: by mail-wm1-f65.google.com with SMTP id a8-v6so15822032wmf.1 for ; Wed, 07 Nov 2018 06:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=PjPYSwteB9xup1rmD1+2lqa9nWGmqRmHQplzUcKC1WE=; b=ED9NVRq8PfxQs/gSZHQR187bFxY8azmC6LgA+M/X64QZazd15J60EmQwz07tRGkayY n2eLrjyzf3fMIcYNBZDrn1eLH0OvUnuAYueIzQFhliDQBq2BytM6M244a18glMRcuzT5 HiyhZIvk1PGaP/xk82mVMRy9WnctutB5/zk6mj4xCv3eCQA6uRF7nMnFWoHzt5KJ5MKc cPLI3ohr0rwkJu8IHls9GdKIx1rlWIfdqCCLfBv7GUmivl4HsaFCIDDpoe+JfWQOr+zo +H4+CwBjFawfv/tzBf/Xg1Eg49Pekk00+VUtAVYrtubUgrPjgGI5fxHbCCapbeco3j9S fPzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PjPYSwteB9xup1rmD1+2lqa9nWGmqRmHQplzUcKC1WE=; b=Vd72S1ws0K8ChACTVXBIyhAv3kKwm0y9QEq7hkqqvE46YF60pPQ4NXhLOSHB7H8G2m 0/KDd5wVpJRPrE5sFn3J+QlPQOv0R3qxxYJr1VgsF48fGiOiE/DyLm+fG9Nf9MLsp8r3 XWt8T6vRgeTHCq1GmIjnn6U9xQhnNr6VAE15i+/DK393BBg1XDb6XCiACKvYx1Oc5zuB iwenOZV4lWCVHTmH9C7pkC2odo2YlXPnWnEGR0Y6Q58E/n7B11cfagehT6CqekYROBXN PV4xsj28ABcdfYq6AYYZ/DmVnxoZhlqJN8i+MqYdJ87BMry8H8LqatINZXu3BJ1ejh5n JJbg== X-Gm-Message-State: AGRZ1gLPyT+LutvwD+kXLGhSdZkSPgKnZw6gEtwVJiXUdVigCi2041+E VQvNoOAjyNIJ4gkrSkPn6c30YA== X-Google-Smtp-Source: AJdET5fLzKtL23fMP59ja4p/xhuebfykSERzhfG/t8cVz4nb0hviZy33b3y3eENsw51OFzLvCHCgwg== X-Received: by 2002:a1c:8b94:: with SMTP id n142-v6mr339755wmd.38.1541599583641; Wed, 07 Nov 2018 06:06:23 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id e5-v6sm349203wru.88.2018.11.07.06.06.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 06:06:22 -0800 (PST) Date: Wed, 7 Nov 2018 15:06:04 +0100 From: Adrien Mazarguil To: Ophir Munk Cc: Ferruh Yigit , Andrew Rybchenko , "dev@dpdk.org" , Thomas Monjalon , Asaf Penso , Shahaf Shuler , Olga Shern Message-ID: <20181107140604.GL4638@6wind.com> References: <1541259953-4273-1-git-send-email-ophirmu@mellanox.com> <1541582611-1609-1-git-send-email-ophirmu@mellanox.com> <20181107093109.GG4638@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v2] ethdev: document RSS default key and types 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: Wed, 07 Nov 2018 14:06:24 -0000 On Wed, Nov 07, 2018 at 12:39:24PM +0000, Ophir Munk wrote: > > -----Original Message----- > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > Sent: Wednesday, November 07, 2018 11:31 AM > > To: Ophir Munk > > Cc: Ferruh Yigit ; Andrew Rybchenko > > ; dev@dpdk.org; Thomas Monjalon > > ; Asaf Penso ; Shahaf > > Shuler ; Olga Shern > > Subject: Re: [dpdk-dev] [PATCH v2] ethdev: document RSS default key and > > types > > > > On Wed, Nov 07, 2018 at 09:23:42AM +0000, Ophir Munk wrote: > > > struct rte_flow_action_rss include fields 'key' and 'types'. > > > Field 'key' is a pointer to bytes array (uint8_t *) which contains the > > > specific RSS hash key. > > > If an application is only interested in default RSS operation it > > > should not care about the specific hash key. The application can set > > > the hash key to NULL such that any PMD uses its default RSS key. > > > > > > Field 'types' is a uint64_t bits flag used to specify a specific RSS > > > hash type such as ETH_RSS_IP (see ETH_RSS_*). > > > If an application does not care about the specific RSS type it can set > > > this field to 0 such that any PMD uses its default type. > > > > > > Signed-off-by: Ophir Munk > > > --- > > > lib/librte_ethdev/rte_flow.h | 9 +++++++-- > > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > > > diff --git a/lib/librte_ethdev/rte_flow.h > > > b/lib/librte_ethdev/rte_flow.h index c0fe879..ca9e135 100644 > > > --- a/lib/librte_ethdev/rte_flow.h > > > +++ b/lib/librte_ethdev/rte_flow.h > > > @@ -1782,10 +1782,15 @@ struct rte_flow_action_rss { > > > * through. > > > */ > > > uint32_t level; > > > - uint64_t types; /**< Specific RSS hash types (see ETH_RSS_*). */ > > > + /** > > > + * Specific RSS hash types (see ETH_RSS_*), > > > + * or 0 for PMD specific default. > > > + */ > > > + uint64_t types; > > > uint32_t key_len; /**< Hash key length in bytes. */ > > > uint32_t queue_num; /**< Number of entries in @p queue. */ > > > - const uint8_t *key; /**< Hash key. */ > > > + /** Hash key, or NULL for PMD specific default key. */ > > > + const uint8_t *key; > > > > I'd suggest to document that on key_len instead. If key_len is nonzero, key > > cannot be NULL anyway. > > The decision if a key/len combination is valid is done in the PMD action validation API. > For example, in MLX5 key==NULL and key_len==40 is accepted. > The combination key==NULL and key_len==0 should always succeeds, however the "must" parameter for RSS default is key==NULL and not key_len==0. I understand this is how the mlx5 PMD implemented it, but my point is that it makes more sense API-wise to define key_len == 0 as the trigger for a default RSS hash key than key == NULL. My suggestion is to follow the same trend as memcpy(), mmap(), snprintf() and other well-known functions that take a size when dealing with NULL/undefined pointers. Only size matters! :) -- Adrien Mazarguil 6WIND