From: Simon Horman <simon.horman@netronome.com>
To: Tom Herbert <tom@quantonium.net>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
alex.popov@linux.com, hannes@stressinduktion.org
Subject: Re: [PATCH net-next 1/2] flow_dissector: Cleanup control flow
Date: Fri, 1 Sep 2017 14:26:49 +0200 [thread overview]
Message-ID: <20170901122647.GB4938@vergenet.net> (raw)
In-Reply-To: <20170831222239.21509-2-tom@quantonium.net>
Hi Tom,
On Thu, Aug 31, 2017 at 03:22:38PM -0700, Tom Herbert wrote:
> __skb_flow_dissect is riddled with gotos that make discerning the flow,
> debugging, and extending the capability difficult. This patch
> reorganizes things so that we only perform goto's after the two main
> switch statements (no gotos within the cases now). It also eliminates
> several goto labels so that there are only two labels that can be target
> for goto.
I agree that the flow of __skb_flow_dissect() is difficult to follow
but its not obvious that this significant change in terms of loc
takes us to a better place.
Maybe it makes follow-up work easier. If so perhaps it should be motivated
along those lines.
In any case I won't stand in the way of this change but I did want to throw
my 2c worth in.
>
> Reported-by: Alexander Popov <alex.popov@linux.com>
> Signed-off-by: Tom Herbert <tom@quantonium.net>
> ---
> include/net/flow_dissector.h | 9 ++
> net/core/flow_dissector.c | 225 ++++++++++++++++++++++++++++---------------
> 2 files changed, 156 insertions(+), 78 deletions(-)
>
> diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h
> index e2663e900b0a..c358c3ff6acc 100644
> --- a/include/net/flow_dissector.h
> +++ b/include/net/flow_dissector.h
> @@ -19,6 +19,15 @@ struct flow_dissector_key_control {
> #define FLOW_DIS_FIRST_FRAG BIT(1)
> #define FLOW_DIS_ENCAPSULATION BIT(2)
>
> +enum flow_dissect_ret {
> + FLOW_DISSECT_RET_OUT_GOOD,
> + FLOW_DISSECT_RET_OUT_BAD,
> + FLOW_DISSECT_RET_PROTO_AGAIN,
> + FLOW_DISSECT_RET_IPPROTO_AGAIN,
> + FLOW_DISSECT_RET_IPPROTO_AGAIN_EH,
> + FLOW_DISSECT_RET_CONTINUE,
> +};
Minor nit:
My reading is that this patch does not seem to differentiate between the
handling of FLOW_DISSECT_RET_IPPROTO_AGAIN and
FLOW_DISSECT_RET_IPPROTO_AGAIN_EH. Perhaps it would be better to add
FLOW_DISSECT_RET_IPPROTO_AGAIN_EH in the following patch where it is used.
> +
> /**
> * struct flow_dissector_key_basic:
> * @thoff: Transport header offset
...
next prev parent reply other threads:[~2017-09-01 12:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 22:22 [PATCH net-next 0/2] flow_dissector: Flow dissector fixes Tom Herbert
2017-08-31 22:22 ` [PATCH net-next 1/2] flow_dissector: Cleanup control flow Tom Herbert
2017-09-01 12:26 ` Simon Horman [this message]
2017-09-01 12:35 ` Hannes Frederic Sowa
2017-09-01 16:12 ` Tom Herbert
2017-08-31 22:22 ` [PATCH net-next 2/2] flow_dissector: Add limits for encapsulation and EH Tom Herbert
2017-09-01 12:22 ` Simon Horman
2017-09-01 13:32 ` Hannes Frederic Sowa
2017-09-01 15:38 ` Tom Herbert
2017-09-01 16:35 ` Hannes Frederic Sowa
2017-09-01 16:49 ` Tom Herbert
2017-09-01 17:05 ` Hannes Frederic Sowa
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=20170901122647.GB4938@vergenet.net \
--to=simon.horman@netronome.com \
--cc=alex.popov@linux.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=tom@quantonium.net \
/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