All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Daniel Borkmann <daniel@iogearbox.net>, davem@davemloft.net
Cc: edumazet@google.com, willemb@google.com, tklauser@distanz.ch,
	netdev@vger.kernel.org
Subject: Re: [PATCH net v2 2/3] packet: always probe for transport header
Date: Wed, 11 Nov 2015 13:08:23 +0800	[thread overview]
Message-ID: <5642CD47.4020101@redhat.com> (raw)
In-Reply-To: <4adce55fc6c4aa8f05306af650659a1326537a1a.1447191361.git.daniel@iogearbox.net>



On 11/11/2015 06:03 AM, Daniel Borkmann wrote:
> We concluded that the skb_probe_transport_header() should better be
> called unconditionally. Avoiding the call into the flow dissector has
> also not really much to do with the direct xmit mode.
>
> While it seems that only virtio_net code makes use of GSO from non
> RX/TX ring packet socket paths, we should probe for a transport header
> nevertheless before they hit devices.
>
> Reference: http://thread.gmane.org/gmane.linux.network/386173/
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Jason Wang <jasowang@redhat.com>
> ---
>  net/packet/af_packet.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index 80c36c0..bdecf17 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -2447,8 +2447,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
>  		len = ((to_write > len_max) ? len_max : to_write);
>  	}
>  
> -	if (!packet_use_direct_xmit(po))
> -		skb_probe_transport_header(skb, 0);
> +	skb_probe_transport_header(skb, 0);
>  
>  	return tp_len;
>  }
> @@ -2808,8 +2807,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
>  		len += vnet_hdr_len;
>  	}
>  
> -	if (!packet_use_direct_xmit(po))
> -		skb_probe_transport_header(skb, reserve);
> +	skb_probe_transport_header(skb, reserve);
> +
>  	if (unlikely(extra_len == 4))
>  		skb->no_fcs = 1;
>  

Acked-by: Jason Wang <jasowang@redhat.com>

  reply	other threads:[~2015-11-11  5:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 22:03 [PATCH net v2 0/3] packet fixes Daniel Borkmann
2015-11-10 22:03 ` [PATCH net v2 1/3] packet: do skb_probe_transport_header when we actually have data Daniel Borkmann
2015-11-11  5:07   ` Jason Wang
2015-11-10 22:03 ` [PATCH net v2 2/3] packet: always probe for transport header Daniel Borkmann
2015-11-11  5:08   ` Jason Wang [this message]
2015-11-10 22:03 ` [PATCH net v2 3/3] packet: fix tpacket_snd max frame and vlan handling Daniel Borkmann
2015-11-10 22:52   ` Willem de Bruijn
2015-11-10 23:12     ` Daniel Borkmann
2015-11-10 23:24       ` Willem de Bruijn
2015-11-10 23:51         ` Daniel Borkmann
2015-11-11 14:56           ` Willem de Bruijn
2015-11-11 22:39             ` Daniel Borkmann

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=5642CD47.4020101@redhat.com \
    --to=jasowang@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tklauser@distanz.ch \
    --cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.