[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-KiMWMwvD-s=z4brqUrNbRe4-fRZAKupEc2FvVn0MQxuQ@mail.gmail.com>
Date: Thu, 12 Oct 2017 13:25:54 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Anton Ivanov <anton.ivanov@...bridgegreys.com>
Cc: Network Development <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>
Subject: Re: BUG:af_packet fails to TX TSO frames
On Thu, Oct 12, 2017 at 12:30 PM, Willem de Bruijn
<willemdebruijn.kernel@...il.com> wrote:
> On Thu, Oct 12, 2017 at 11:44 AM, Anton Ivanov
> <anton.ivanov@...bridgegreys.com> wrote:
>> Found it.
>>
>> Two bugs canceling each other.
>> The bind sequence in: psock_txring_vnet.c is wrong.
>>
>> It does the following addr.sll_protocol = htons(ETH_P_IP);
>> before calling bind.
>>
>> If you set addr.sll_protocol to ETH_P_ALL where it should have been in the
>> first place the test program blows up with -ENOBUFS
>
> There is no such requirement that the socket should bind to ETH_P_ALL.
>
>> I think what is happening is that this value is taken into account when
>> looking at "what should I use to segment it with" in skb_mac_gso_segment
>> which is invoked at the end of the verification chain which starts in
>> packet_direct_xmit in af_packet.c
>
> packet_snd sets skb->protocol based on the protocol that the packet
> socket is bound to. Binding to ETH_P_IP is the right choice here.
To avoid having to open multiple sockets for different protocols,
sockaddr_ll can also be passed in the msg_name argument on
each call.
Powered by blists - more mailing lists