]> git.baikalelectronics.ru Git - kernel.git/commit
net: Fix test for VLAN TX checksum offload capability
authorBen Hutchings <bhutchings@solarflare.com>
Tue, 17 Jun 2008 00:02:28 +0000 (17:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Jun 2008 00:02:28 +0000 (17:02 -0700)
commit0fbaed9472a3cc43fccfe71a33613f3aaa2bb9ce
treea93885a05230ee514dcc5c58a1b4af3cc09b9d28
parent127fd4c0baba852bc965b1f7a14a97c0d2c27a75
net: Fix test for VLAN TX checksum offload capability

Selected device feature bits can be propagated to VLAN devices, so we
can make use of TX checksum offload and TSO on VLAN-tagged packets.
However, if the physical device does not do VLAN tag insertion or
generic checksum offload then the test for TX checksum offload in
dev_queue_xmit() will see a protocol of htons(ETH_P_8021Q) and yield
false.

This splits the checksum offload test into two functions:

- can_checksum_protocol() tests a given protocol against a feature bitmask

- dev_can_checksum() first tests the skb protocol against the device
  features; if that fails and the protocol is htons(ETH_P_8021Q) then
  it tests the encapsulated protocol against the effective device
  features for VLANs

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c