From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 1AE092BAF for ; Wed, 30 Aug 2017 16:39:15 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id 187so2848093wmn.1 for ; Wed, 30 Aug 2017 07:39:15 -0700 (PDT) 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=lYGodVHw+uQsc6plmTMzn6qlwXtUEbuopq5zKLIaE1g=; b=fpT+TA9jiJXr8rWILiOXSDENEjxHyfR/QBW1BotNMO4YHS2XcS9JGZqmIKP8famUuf XdbdHiGXsxBcnadXjjCkq9bmkXt2mUrUg9KMaRR2qjJCRt84BwaRRhgAM8iNWpBW99DC qbO3z7H5Urguen6iFgSyAzczLRJiGnBkbmM6aTztUtuA+5p0tElL67sybCTUunvIEE78 +j/UH1vPhUxcbfDsOZQ2ziuV2bWTq3uYp6Nc+C9DNcBR6c0Qu8BijsFsLQPkrpyaW65H 4d0ksNti98XcHgPddYCppRZZUGxT0J4vq/o/WrbMf3ZML9OjMZicLKIqYTLqHk3texX/ 6d+g== 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=lYGodVHw+uQsc6plmTMzn6qlwXtUEbuopq5zKLIaE1g=; b=nj+T6ct03Hap7yUuU/A6rZ2MeJUzqmCBPa9YQ/mEKWa5Pu8z2laEK2Xohqbq8oNn7b d1dboNw1PpwWEaDmeQMHvWwEZmGjpPM4vVfEABw9HvbldVjqA8qFy1ByQbKQOwsFPuft QnQcOyODs2ebiobcF0jR9JKwLNM1PO4r+Y7IQj26TZ7R3xHHd4DXy5MhRauZJBgR6Dxu +k1vwwqBgdXMPJl5bCO6K+sT4GSVoqb+PI3AHgGWaUm5kpQiPY2bwKLXO8oCwq/BVfZR rdrNDxEB52eW+2djuIh4mK5OaNZu6AL38+iXrgF3u/Nqasq6lFvbceSLfDDLuthpMp4E UzOQ== X-Gm-Message-State: AHYfb5iwcCviTC1clSyLTUY29lJI4fagQwp2nIuYf+tdRvSQMH1/0hZC gGdgemSi/B79xFGG X-Received: by 10.28.215.79 with SMTP id o76mr1410493wmg.85.1504103955600; Wed, 30 Aug 2017 07:39:15 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 80sm3506781wmi.19.2017.08.30.07.39.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Aug 2017 07:39:13 -0700 (PDT) Date: Wed, 30 Aug 2017 16:39:03 +0200 From: Adrien Mazarguil To: "Iremonger, Bernard" Cc: "dev@dpdk.org" , "Yigit, Ferruh" , "Ananyev, Konstantin" , "Dumitrescu, Cristian" Message-ID: <20170830143903.GK4301@6wind.com> References: <1503496275-27492-1-git-send-email-bernard.iremonger@intel.com> <1503677438-27591-4-git-send-email-bernard.iremonger@intel.com> <20170830123912.GJ4301@6wind.com> <8CEF83825BEC744B83065625E567D7C24E042C4F@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8CEF83825BEC744B83065625E567D7C24E042C4F@IRSMSX108.ger.corp.intel.com> Subject: Re: [dpdk-dev] [PATCH v2 3/6] librte_ether: initialise IPv4 protocol mask for rte_flow 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, 30 Aug 2017 14:39:16 -0000 On Wed, Aug 30, 2017 at 01:28:04PM +0000, Iremonger, Bernard wrote: > Hi Adrien, > > > -----Original Message----- > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > Sent: Wednesday, August 30, 2017 1:39 PM > > To: Iremonger, Bernard > > Cc: dev@dpdk.org; Yigit, Ferruh ; Ananyev, > > Konstantin ; Dumitrescu, Cristian > > > > Subject: Re: [PATCH v2 3/6] librte_ether: initialise IPv4 protocol mask for > > rte_flow > > > > Hi Bernard, > > > > On Fri, Aug 25, 2017 at 05:10:35PM +0100, Bernard Iremonger wrote: > > > Initialise the next_proto_id mask in the default mask for > > > rte_flow_item_type_ipv4. > > > > > > Signed-off-by: Bernard Iremonger > > > --- > > > lib/librte_ether/rte_flow.h | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h > > > index bba6169..59c42fa 100644 > > > --- a/lib/librte_ether/rte_flow.h > > > +++ b/lib/librte_ether/rte_flow.h > > > @@ -489,6 +489,7 @@ struct rte_flow_item_ipv4 { #ifndef __cplusplus > > > static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = { > > > .hdr = { > > > + .next_proto_id = 0xff, > > > > Please don't change the default mask to cover this field as it means > > all rte_flow-based applications that do not provide a specific mask > > (.mask == NULL) have to always set this field to some valid value. > > This is not a convenient default behavior. > > > > > .src_addr = RTE_BE32(0xffffffff), > > > .dst_addr = RTE_BE32(0xffffffff), > > > }, > > > -- > > > 1.9.1 > > > > > > > I'll have to NACK this change. The example application should define its own > > mask if next_proto_id must be always set. > > Surely for IPv4 the next_proto_id will always be set to TCP(6) , UDP(17) or SCTP (132). > If the mask is 0 for next_proto_id then it is not possible to match on the protocol. Applications normally match the next protocol implicitly by providing it as the subsequent item (e.g. in testpmd by writing "eth / ip / tcp" instead of "eth / ip next_proto_id spec 6"). This change forces users to write "eth / ip next_proto_id spec 6 / tcp" or face an error due to an uninitialized next_proto_id (which might be garbage due to uninitialized memory, not just 0). > I can define an ipv4_mask in the application if you insist. Yes please, a better suggestion would be to rely on the subsequent item type and not on the value of this field. These default masks must only cover basic fields like source/destination addresses and ports for most protocols. -- Adrien Mazarguil 6WIND