igb: allow tx of pre-formatted vlan tagged packets
Subsystems (2)
PATCH 1/1 igb: allow tx of pre-formatted vlan tagged packets
When the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
--- drivers/net/igb/igb_main.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
drivers/net/igb/igb_main.c +11 -1
@@ -2778,7 +2778,17 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, tu_cmd |= (E1000_TXD_CMD_DEXT |E1000_ADVTXD_DTYP_CTXT );if (skb->ip_summed ==CHECKSUM_PARTIAL ) { -switch (skb->protocol) { +__be16 protocol; + +if (skb->protocol ==__constant_htons (ETH_P_8021Q )) { +const struct vlan_ethhdr *vhdr = + (const struct vlan_ethhdr *) skb->data; + + protocol = vhdr->h_vlan_encapsulated_proto; + }else + protocol = skb->protocol; + +switch (protocol) {case __constant_htons (ETH_P_IP ): tu_cmd |=E1000_ADVTXD_TUCMD_IPV4 ;if (ip_hdr (skb)->protocol ==IPPROTO_TCP )
Signature · 1 line
1.5.6.3
Quoted 13 lines · On Thu, 12 Mar 2009 13:27:24 -0700 Arthur Jones <[email protected]> wrote:
When the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Quoted 8 lines
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
Signed-off-by Arthur Jones <[email protected]>--- drivers/net/igb/igb_main.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
That code in current igb driver (net-next-2.6) tree no longer has the whole switch you are changing.
drivers/net/igb/igb_main.c static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, · line 2783
Quoted 12 lines
drivers/net/igb/igb_main.c +3
-1@@ -2778,7 +2778,17 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, tu_cmd |= (E1000_TXD_CMD_DEXT |E1000_ADVTXD_DTYP_CTXT );if (skb->ip_summed ==CHECKSUM_PARTIAL ) { -switch (skb->protocol) { +__be16 protocol; + +if (skb->protocol ==__constant_htons (ETH_P_8021Q )) {
Don't use __constant_htons() here, macro is smart enough to know when value is const.
Quoted 11 lines
drivers/net/igb/igb_main.c +8
-0+const struct vlan_ethhdr *vhdr = + (const struct vlan_ethhdr *) skb->data; + + protocol = vhdr->h_vlan_encapsulated_proto; + }else + protocol = skb->protocol; + +switch (protocol) {case __constant_htons (ETH_P_IP ): tu_cmd |=E1000_ADVTXD_TUCMD_IPV4 ;if (ip_hdr (skb)->protocol ==IPPROTO_TCP )
Hi Stephen, ...
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Thu, 12 Mar 2009 13:27:24 -0700 Arthur Jones <[email protected]> wrote:
When the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Arthur Jones <[email protected]>--- drivers/net/igb/igb_main.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)That code in current igb driver (net-next-2.6) tree no longer has the whole switch you are changing.
Ok, thanks, I'll test that one...
Arthur
Quoted 28 lines · On Thu, 12 Mar 2009 14:00:57 -0700 Arthur Jones <[email protected]> wrote:
Hi Stephen, ...
Quoted 25 lines · Stephen Hemminger
Quoted 21 lines · On Thu, 12 Mar 2009 13:27:24 -0700 Arthur Jones <[email protected]> wrote:
When the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
Signed-off-by Arthur Jones <[email protected]>--- drivers/net/igb/igb_main.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
Quoted 6 lines
Quoted 2 lines
That code in current igb driver (net-next-2.6) tree no longer has the whole switch you are changing.
Ok, thanks, I'll test that one...
Arthur
Actually, it is there just a little furthur down than I was looking
PATCH 1/1 igb: allow tx of pre-formatted vlan tagged packets
In reply to Arthur JonesWhen the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
Macro fixups from Stephen Hemminger <[email protected]>
--- drivers/net/igb/igb_main.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
drivers/net/igb/igb_main.c +11 -1
@@ -3017,7 +3017,17 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, tu_cmd |= (E1000_TXD_CMD_DEXT |E1000_ADVTXD_DTYP_CTXT );if (skb->ip_summed ==CHECKSUM_PARTIAL ) { -switch (skb->protocol) { +__be16 protocol; + +if (skb->protocol ==cpu_to_be16 (ETH_P_8021Q )) { +const struct vlan_ethhdr *vhdr = + (const struct vlan_ethhdr *) skb->data; + + protocol = vhdr->h_vlan_encapsulated_proto; + }else + protocol = skb->protocol; + +switch (protocol) {case cpu_to_be16 (ETH_P_IP ): tu_cmd |=E1000_ADVTXD_TUCMD_IPV4 ;if (ip_hdr (skb)->protocol ==IPPROTO_TCP )
Signature · 8 lines
1.5.6.3 ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
I have added a few comments inline.
Quoted 29 lines · Arthur Jones
When the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
Macro fixups from Stephen Hemminger <[email protected]>
Signed-off-by Arthur Jones <[email protected]>--- drivers/net/igb/igb_main.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)drivers/net/igb/igb_main.c +0
-0
drivers/net/igb/igb_main.c static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, · line 3024
Quoted 9 lines
drivers/net/igb/igb_main.c +5
-1@@ -3017,7 +3017,17 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, tu_cmd |= (E1000_TXD_CMD_DEXT |E1000_ADVTXD_DTYP_CTXT );if (skb->ip_summed ==CHECKSUM_PARTIAL ) { -switch (skb->protocol) { +__be16 protocol; + +if (skb->protocol ==cpu_to_be16 (ETH_P_8021Q )) { +const struct vlan_ethhdr *vhdr = + (const struct vlan_ethhdr *) skb->data;
This should probably reference skb_mac_header(skb) instead of data in the event that data is an offset instead of a pointer.
drivers/net/igb/igb_main.c static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, · line 3029
Quoted 5 lines
drivers/net/igb/igb_main.c +5
-0+ + protocol = vhdr->h_vlan_encapsulated_proto; + }else + protocol = skb->protocol; +
This else should have braces since the matching if was using braces.
drivers/net/igb/igb_main.c static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, · line 3033
Quoted 4 lines
drivers/net/igb/igb_main.c +1
-0+switch (protocol) {case cpu_to_be16 (ETH_P_IP ): tu_cmd |=E1000_ADVTXD_TUCMD_IPV4 ;if (ip_hdr (skb)->protocol ==IPPROTO_TCP )
Thanks,
Alex
Hi Alexander, ...
Quoted 1 line · Alexander Duyck
I have added a few comments inline.
Thanks, I'll fix these up and re-submit...
Arthur
Quoted 6 lines · Arthur Jones
Hi Alexander, ...
Quoted 1 line · Alexander Duyck
I have added a few comments inline.
Thanks, I'll fix these up and re-submit...
I'm out of the office today, though, so testing
will have to wait until Monday -- I'll resend
after the patch is tested...
Arthur
PATCH 1/1 igb: allow tx of pre-formatted vlan tagged packets
In reply to Arthur JonesWhen the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
Fixups from Stephen Hemminger <[email protected]> and Alexander Duyck <[email protected]>.
--- drivers/net/igb/igb_main.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
drivers/net/igb/igb_main.c +12 -1
@@ -3030,7 +3030,18 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, tu_cmd |= (E1000_TXD_CMD_DEXT |E1000_ADVTXD_DTYP_CTXT );if (skb->ip_summed ==CHECKSUM_PARTIAL ) { -switch (skb->protocol) { +__be16 protocol; + +if (skb->protocol ==cpu_to_be16 (ETH_P_8021Q )) { +const struct vlan_ethhdr *vhdr = +vlan_eth_hdr (skb); + + protocol = vhdr->h_vlan_encapsulated_proto; + }else { + protocol = skb->protocol; + } + +switch (protocol) {case cpu_to_be16 (ETH_P_IP ): tu_cmd |=E1000_ADVTXD_TUCMD_IPV4 ;if (ip_hdr (skb)->protocol ==IPPROTO_TCP )
Signature · 8 lines
1.5.6.3 ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
David Miller
maintainerFrom: Arthur Jones <[email protected]>
Date: Tue, 17 Mar 2009 10:39:24 -0700
Quoted 13 lines
When the 82575 is fed 802.1q packets, it chokes with an error of the form:
igb 0000:08:00.1: partial checksum but proto=81
As the logic there was not smart enough to look into the vlan header to pick out the encapsulated protocol.
There are times when we'd like to send these packets out without having to configure a vlan on the interface. Here we check for the vlan tag and allow the packet to go out with the correct hardware checksum.
Quoted 8 lines
Thanks to Kand Ly <[email protected]> for discovering the issue and the coming up with a solution. This patch is based upon his work.
Fixups from Stephen Hemminger <[email protected]> and Alexander Duyck <[email protected]>.
Signed-off-by Arthur Jones <[email protected]>
Jeff, are you queueing this one up?