netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sridhar Samudrala <sri@us.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>,
	Rusty Russell <rusty@rustcorp.com.au>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next-2.6] packet: Add GSO/checksum offload support to af_packet sockets
Date: Fri, 29 Jan 2010 14:30:49 -0800	[thread overview]
Message-ID: <4B636199.7080708@us.ibm.com> (raw)
In-Reply-To: <20100129213619.GA6404@gondor.apana.org.au>

On 1/29/2010 1:36 PM, Herbert Xu wrote:
> On Fri, Jan 29, 2010 at 01:25:08PM -0800, Sridhar Samudrala wrote:
>    
>> This check is to dis-allow processing of packets with virtio_net_hdr
>> destined for non-ethernet devices.
>> Is it OK if i add a check in packet_bind() to not allow binding to
>> a non-ethernet device when PACKET_VNET_HDR option is set?
>>
>> I need to figure out a way to set the skb protocol correctly based
>> on the packet. Any clues?
>>      
> IMHO the skb protocol should be set by whatever is invoking the
> sendmsg call.  After all they would know what the L2 header is
> and should be able to deduce the protocol correctly.
>    
In this use-case, the component that is calling sendmsg() can be either 
the vhost-net in host kernel
or qemu. They get the buffer including the L2 header from the guest. 
They too need to parse the L2
header to find the protocol.
The packet itself originates from the guest virtio-net driver. but when 
it converts the skb to a virtio-ring
buffer, some of the information in the skb(including protocol and vlan 
info etc) is lost. I guess if we could
re-design, virtio_net_hdr would include this info too. But i think it is 
too late to make any such changes.
So either the callers of sendmsg() or packet_snd() need to parse the L2 
header to get the protocol and
vlan info etc. sendmsg() caller could fill in the protocol, but not the 
vlan info.

Thanks
Sridhar


  reply	other threads:[~2010-01-29 22:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 20:30 [PATCH net-next-2.6] packet: Add GSO/checksum offload support to af_packet sockets Sridhar Samudrala
2010-01-27  1:52 ` Rusty Russell
2010-01-27 11:42 ` Michael S. Tsirkin
2010-01-27 17:42   ` Sridhar Samudrala
2010-01-27 18:02     ` Michael S. Tsirkin
2010-01-29  8:53 ` Herbert Xu
2010-01-29 21:25   ` Sridhar Samudrala
2010-01-29 21:36     ` Herbert Xu
2010-01-29 22:30       ` Sridhar Samudrala [this message]
2010-01-29 23:22         ` Herbert Xu

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=4B636199.7080708@us.ibm.com \
    --to=sri@us.ibm.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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).