[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 11 Nov 2015 13:08:23 +0800
From: Jason Wang <jasowang@...hat.com>
To: Daniel Borkmann <daniel@...earbox.net>, davem@...emloft.net
Cc: edumazet@...gle.com, willemb@...gle.com, tklauser@...tanz.ch,
netdev@...r.kernel.org
Subject: Re: [PATCH net v2 2/3] packet: always probe for transport header
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@...earbox.net>
> Cc: Jason Wang <jasowang@...hat.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@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists