* dev_add_pack and hardware checksumming
@ 2003-08-18 3:37 Petr Vandrovec
2003-08-18 5:38 ` David S. Miller
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vandrovec @ 2003-08-18 3:37 UTC (permalink / raw)
To: davem; +Cc: netdev
Hi Dave,
VMware uses dev_add_pack() for capturing ethernet traffic generated
by the host and forwarding it to the guest.
Unfortunately skb at the packet filter input is still in CHECKSUM_HW
state, while skb->csum is relative to the skb->h.raw and
dev_queue_xmit_nit overwrites skb->h.raw with skb->nh.raw. Due to this
I have to peek at packet body to detect protocol & its header length,
reinitialize skb->h.raw with this knowledge and then finally do
skb_checksum_help().
For me it would be best if dev_queue_xmit_nit could just leave
skb->h.raw alone, usable for skb_checksum_help(), but I assume that it
is not possible due to backward compatibility? Other choice is doing
checksumming in dev_queue_xmit_nit itself, before passing skb down to
the registered packet handlers.
BTW, it looks to me like that an uninitialized value is leaked in UDP's
checksum field to the packets tcpdump on the host can capture...
Thanks,
Petr Vandrovec
vandrove@vc.cvut.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: dev_add_pack and hardware checksumming
2003-08-18 3:37 dev_add_pack and hardware checksumming Petr Vandrovec
@ 2003-08-18 5:38 ` David S. Miller
2003-08-18 18:27 ` Petr Vandrovec
0 siblings, 1 reply; 3+ messages in thread
From: David S. Miller @ 2003-08-18 5:38 UTC (permalink / raw)
To: Petr Vandrovec; +Cc: netdev
On Mon, 18 Aug 2003 05:37:11 +0200
Petr Vandrovec <vandrove@vc.cvut.cz> wrote:
> For me it would be best if dev_queue_xmit_nit could just leave
> skb->h.raw alone,
The AF_PACKET layer depends upon skb->h.raw being set a certain
way. Have a look at the dev_add_pack() registered hooks that
net/packet/af_packet.c uses.
> Other choice is doing checksumming in dev_queue_xmit_nit itself,
> before passing skb down to the registered packet handlers.
This is not an option either. We're specifically not going to
undo checksum offloading just because tcpdump or some other
kind of tap is installed.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: dev_add_pack and hardware checksumming
2003-08-18 5:38 ` David S. Miller
@ 2003-08-18 18:27 ` Petr Vandrovec
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vandrovec @ 2003-08-18 18:27 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
On Sun, Aug 17, 2003 at 10:38:51PM -0700, David S. Miller wrote:
> On Mon, 18 Aug 2003 05:37:11 +0200
> Petr Vandrovec <vandrove@vc.cvut.cz> wrote:
>
> > For me it would be best if dev_queue_xmit_nit could just leave
> > skb->h.raw alone,
>
> The AF_PACKET layer depends upon skb->h.raw being set a certain
> way. Have a look at the dev_add_pack() registered hooks that
> net/packet/af_packet.c uses.
Well, I do not see skb->h.raw used in any way in AF_PACKET hooks...
Probably I missed some deeply nested generic function which accesses
it...
> > Other choice is doing checksumming in dev_queue_xmit_nit itself,
> > before passing skb down to the registered packet handlers.
>
> This is not an option either. We're specifically not going to
> undo checksum offloading just because tcpdump or some other
> kind of tap is installed.
And what's left, then? I can happilly offload checksum to some
other place down in the chain, but for doing that I must know
where I should put checksum, and currently this information is
unavailable to the packet hook.
Best regards,
Petr Vandrovec
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-08-18 18:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-18 3:37 dev_add_pack and hardware checksumming Petr Vandrovec
2003-08-18 5:38 ` David S. Miller
2003-08-18 18:27 ` Petr Vandrovec
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).