From: Ori Kam <orika@mellanox.com>
To: Yongseok Koh <yskoh@mellanox.com>
Cc: Shahaf Shuler <shahafs@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel
Date: Mon, 5 Nov 2018 06:08:43 +0000 [thread overview]
Message-ID: <AM4PR05MB342591BFD23538D1574260DBDBCA0@AM4PR05MB3425.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20181105053732.GE15737@mtidpdk.mti.labs.mlnx>
> -----Original Message-----
> From: Yongseok Koh
> Sent: Monday, November 5, 2018 7:38 AM
> To: Ori Kam <orika@mellanox.com>
> Cc: Shahaf Shuler <shahafs@mellanox.com>; dev@dpdk.org
> Subject: Re: [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel
>
> On Sun, Nov 04, 2018 at 01:22:34AM -0700, Ori Kam wrote:
> >
> > > -----Original Message-----
> > > From: Yongseok Koh
> > > Sent: Friday, November 2, 2018 11:08 PM
> > > To: Shahaf Shuler <shahafs@mellanox.com>
> > > Cc: dev@dpdk.org; Yongseok Koh <yskoh@mellanox.com>; Ori Kam
> > > <orika@mellanox.com>
> > > Subject: [PATCH 2/3] net/mlx5: fix Direct Verbs flow tunnel
> > >
> > > 1) Fix layer parsing
> > > In translation of tunneled flows, dev_flow->layers must not be used to
> > > check tunneled layer as it contains all the layers parsed from
> > > flow_drv_prepare(). Checking tunneled layer is needed to distinguish
> > > between outer and inner item. This should be based on dynamic parsing.
> With
> > > dev_flow->layers on a tunneled flow, items will always be interpreted as
> > > inner as dev_flow->layer already has all the items. Dynamic parsing
> > > (item_flags) is added as there's no such code.
> > >
> > > 2) Refactoring code
> > > - flow_dv_create_item() and flow_dv_create_action() are merged into
> > > flow_dv_translate() for consistency with Verbs and *_validate().
> >
> > I don't like the idea of combining 2 distinct functions into one.
> > I think a function should be as short as possible and do only one thing,
> > if there is no good reason why two functions should be combined they should
> not
> > be combined.
> > If you want to align both the Direct Verbs and Verbs I think we can split the
> Verbs
> > code.
>
> Look at the other lengthy switch-case clauses in validate/prepare/translate in
> each driver. This DV translate is the only exception. I'd rather like to ask
> why. I didn't like the lengthy function from the beginning but you wanted to
> keep it. Of course, I considered to split the Verbs one but that's the reason
> why I chose to merge DV code. If we feel this lengthy func is really complex and
> gets error prone, then we can refactor all the code at once later. Or, I still
> prefer the graph approach. That would be simpler.
>
I agree with you that all functions should have been split( No excuse also kept the basic
structure as it was), specific in this one I had extra reason to make the split since
creation of items also need adding matcher so it was different.
In any case I agree that we should have consistency with other functions so ether we change
them all or just this one. I think do to time let's do what you suggested and change only this one
or just leave it as is.
Regarding the graph approach I think we should wait to see if the current approach is good
enough and in next releases maybe switch to the graph approach.
> Thanks,
> Yongseok
Thanks,
Ori
next prev parent reply other threads:[~2018-11-05 6:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 21:08 [dpdk-dev] [PATCH 1/3] net/mlx5: fix " Yongseok Koh
2018-11-02 21:08 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix Direct " Yongseok Koh
2018-11-04 8:22 ` Ori Kam
2018-11-05 5:37 ` Yongseok Koh
2018-11-05 6:08 ` Ori Kam [this message]
2018-11-05 6:43 ` Yongseok Koh
2018-11-02 21:08 ` [dpdk-dev] [PATCH 3/3] net/mlx5: remove flags setting from flow preparation Yongseok Koh
2018-11-04 8:29 ` Ori Kam
2018-11-05 5:39 ` Yongseok Koh
2018-11-04 8:17 ` [dpdk-dev] [PATCH 1/3] net/mlx5: fix Verbs flow tunnel Ori Kam
2018-11-05 7:20 ` [dpdk-dev] [PATCH v2 0/3] net/mlx5: fix tunnel flow Yongseok Koh
2018-11-05 7:20 ` [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix Verbs flow tunnel Yongseok Koh
2018-11-05 7:20 ` [dpdk-dev] [PATCH v2 2/3] net/mlx5: fix Direct " Yongseok Koh
2018-11-05 7:31 ` Ori Kam
2018-11-05 7:20 ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: remove flags setting from flow preparation Yongseok Koh
2018-11-05 7:32 ` Ori Kam
2018-11-05 8:09 ` [dpdk-dev] [PATCH v2 0/3] net/mlx5: fix tunnel flow Shahaf Shuler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM4PR05MB342591BFD23538D1574260DBDBCA0@AM4PR05MB3425.eurprd05.prod.outlook.com \
--to=orika@mellanox.com \
--cc=dev@dpdk.org \
--cc=shahafs@mellanox.com \
--cc=yskoh@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).