netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <tom@herbertland.com>
To: Alexander Duyck <aduyck@mirantis.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Alexander Duyck <alexander.duyck@gmail.com>
Subject: Re: [net-next PATCH 5/5] eth: Pull header from first fragment via eth_get_headlen
Date: Wed, 24 Feb 2016 10:15:50 -0800	[thread overview]
Message-ID: <CALx6S36JytbBsh1czsMsP__aC4ims2C8F8AzRsoHQ2hwcAHCCw@mail.gmail.com> (raw)
In-Reply-To: <20160224173004.12339.17023.stgit@localhost.localdomain>

On Wed, Feb 24, 2016 at 9:30 AM, Alexander Duyck <aduyck@mirantis.com> wrote:
> We want to try and pull the L4 header in if it is available in the first
> fragment.  As such add the flag to indicate we want to pull the headers on
> the first fragment in.
>
> Signed-off-by: Alexander Duyck <aduyck@mirantis.com>

Acked-by: Tom Herbert <tom@herbertland.com>

> ---
>  net/ethernet/eth.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
> index 103871784e50..66dff5e3d772 100644
> --- a/net/ethernet/eth.c
> +++ b/net/ethernet/eth.c
> @@ -125,6 +125,7 @@ EXPORT_SYMBOL(eth_header);
>   */
>  u32 eth_get_headlen(void *data, unsigned int len)
>  {
> +       const unsigned int flags = FLOW_DISSECTOR_F_PARSE_1ST_FRAG;
>         const struct ethhdr *eth = (const struct ethhdr *)data;
>         struct flow_keys keys;
>
> @@ -134,7 +135,7 @@ u32 eth_get_headlen(void *data, unsigned int len)
>
>         /* parse any remaining L2/L3 headers, check for L4 */
>         if (!skb_flow_dissect_flow_keys_buf(&keys, data, eth->h_proto,
> -                                           sizeof(*eth), len, 0))
> +                                           sizeof(*eth), len, flags))
>                 return max_t(u32, keys.control.thoff, sizeof(*eth));
>
>         /* parse for any L4 headers */
>

      reply	other threads:[~2016-02-24 18:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 17:29 [net-next PATCH 0/5] Flow dissector fixes and improvements Alexander Duyck
2016-02-24 17:29 ` [net-next PATCH 1/5] flow_dissector: Check for IP fragmentation even if not using IPv4 address Alexander Duyck
2016-02-24 18:14   ` Tom Herbert
2016-02-24 17:29 ` [net-next PATCH 2/5] flow_dissector: Fix fragment handling for header length computation Alexander Duyck
2016-02-24 18:14   ` Tom Herbert
2016-02-24 17:29 ` [net-next PATCH 3/5] flow_dissector: Correctly handle parsing FCoE Alexander Duyck
2016-02-24 18:14   ` Tom Herbert
2016-02-24 17:29 ` [net-next PATCH 4/5] flow_dissector: Use same pointer for IPv4 and IPv6 addresses Alexander Duyck
2016-02-24 18:15   ` Tom Herbert
2016-02-24 17:30 ` [net-next PATCH 5/5] eth: Pull header from first fragment via eth_get_headlen Alexander Duyck
2016-02-24 18:15   ` Tom Herbert [this message]

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=CALx6S36JytbBsh1czsMsP__aC4ims2C8F8AzRsoHQ2hwcAHCCw@mail.gmail.com \
    --to=tom@herbertland.com \
    --cc=aduyck@mirantis.com \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).