From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 5794B1B44F for ; Mon, 9 Jul 2018 16:53:42 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id s11-v6so11313653wra.13 for ; Mon, 09 Jul 2018 07:53:42 -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:content-transfer-encoding:in-reply-to:openpgp :user-agent; bh=G3NW3rDes0U+GlhePMnM2QG6kTwtwSUHS8KTPeBWx9w=; b=RSvKm6+ZTw5eYrgwaYIhDQyJpnb6XxnrmLsYk7W3De4eHpl2kVMS1QL1tva/wwpyuS GVSp9o/45fYyV6B4zGbXwdxoWzS1KgIDifpI0amsm/86UX1eE+lHEM89hiu9kAyIVErk LJISu7gIG7BsUmle7mNrfMqG2eppBJcBps/wmHXPRbXxQjGH3NYuAgPo7Xvl4qwOSQlB BpNjryCrbWgfp3d+NdvI+nb5XyEiCKdodIlHSnRlpvQyMv+5MlEaLayoaeukZheqnX5Y KBGC3CGTYyoS67c75mE4/iR71PvUnTtsS0SbGtxAfsudLuK/MsRZd1l0427PQ+DL9Wjf W97A== 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:content-transfer-encoding :in-reply-to:openpgp:user-agent; bh=G3NW3rDes0U+GlhePMnM2QG6kTwtwSUHS8KTPeBWx9w=; b=cr2ctc8YU6qoypLYFoEHaDHm3plze5Nl/HUKPHqmE48O/pzXv+vp+R79hkyPb74TtP 5WKAKTFc/yyHNZO7wP3Zrrgqlu4xWwE7/fllSE08VuthhcypaIKpk6gkQPWz4VsbSmS8 YsTj1vhVIcDPDGhIxjY3qGK3L7fJ+FsexT3pNSU4bgxdzuJ2XFqDxQSzenNqtLUvSXLG Q2v18C25UFOSMQ7Avc7blX1F/wX3PL9VwZ/HU8berHk6856jGLgM0Y55HtEvYyFee29n K9K8oMEHZ9EUMuk1/QoI3SbmZ8A+8Kb9zgR3Fjittr+uG7Do/31OQ5ZTEYneZztF+PdD kS2w== X-Gm-Message-State: AOUpUlESFHninoMHClzd/F3wU7hOssa2J4mlv/YJtNgGelmwIqPLBBE8 SdaAwSuhPdxo6TPU+OOr7S9uXjtaag== X-Google-Smtp-Source: AAOMgpesjHb26wnQhK+7chvisNMGhP71mIl1rINxQfDMS1wP8uPmWgeGhYYpSOuGFEUdNN/i3aUjqQ== X-Received: by 2002:adf:e287:: with SMTP id v7-v6mr9537150wri.139.1531148022085; Mon, 09 Jul 2018 07:53:42 -0700 (PDT) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id h5-v6sm1784110wrr.19.2018.07.09.07.53.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 07:53:41 -0700 (PDT) Date: Mon, 9 Jul 2018 16:53:26 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Yongseok Koh Cc: dev@dpdk.org, Adrien Mazarguil Message-ID: <20180709145326.2aosydfbwnwvxuuz@laranjeiro-vm.dev.6wind.com> References: <5e9bb490cd3cccb660e11ea0c7ca256e0fd73cc7.1530111623.git.nelio.laranjeiro@6wind.com> <20180706232325.GB53779@yongseok-MBP.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180706232325.GB53779@yongseok-MBP.local> OpenPGP: id=A0075DA8F66A5949 preference=signencrypt User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2 17/20] net/mlx5: add flow VXLAN-GPE item 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, 09 Jul 2018 14:53:42 -0000 On Fri, Jul 06, 2018 at 04:23:26PM -0700, Yongseok Koh wrote: > On Wed, Jun 27, 2018 at 05:07:49PM +0200, Nelio Laranjeiro wrote: > > Signed-off-by: Nelio Laranjeiro > > --- > > drivers/net/mlx5/mlx5_flow.c | 123 ++++++++++++++++++++++++++++++++++- > > 1 file changed, 120 insertions(+), 3 deletions(-) > > >[...] > > +/** > > + * Validate VXLAN-GPE layer and possibly create the Verbs specification. > > + * > > + * @param dev > > + * Pointer to Ethernet device. > > + * @param item[in] > > + * Item specification. > > + * @param flow[in, out] > > + * Pointer to flow structure. > > + * @param flow_size[in] > > + * Size in bytes of the available space for to store the flow information. > > + * @param error > > + * Pointer to error structure. > > + * > > + * @return > > + * size in bytes necessary for the conversion, a negative errno value > > + * otherwise and rte_errno is set. > > + */ > > +static int > > +mlx5_flow_item_vxlan_gpe(struct rte_eth_dev *dev, > > + const struct rte_flow_item *item, > > + struct rte_flow *flow, const size_t flow_size, > > + struct rte_flow_error *error) > > It is almost same as mlx5_flow_item_vxlan() except for checking > priv->config.l3_vxlan_en. One more difference I noticed is that it doesn't check > flow->exapnd on validation. Why is that? If that's a mistake, isn't it better to > make the common code shareable? >[...] The GPE version needs: - l3_vxlan_en - set its own tunnel bit (as in this case the following layer may directly be an L3) Indeed there are some common code (as for the TCP/UDP) but sharing it will be more difficult to read and fix in case of bugs. In addition if this RFC [1] is fully dropped it will be easier to remove the dedicated code when the ITEM in the API will also be removed, it may not be from Mellanox PMD team but from anyone proposing the drop. The chances he breaks anything if the code is shared among several items is high. It is better to have a single function per item/action according to the API directly. Thanks, [1] https://datatracker.ietf.org/doc/draft-quinn-vxlan-gpe/ -- Nélio Laranjeiro 6WIND