ixgb: Don't check for vlan group on transmit.
Subsystems (2)
PATCH 1/2 ixgb: Don't check for vlan group on transmit.
On transmit, the ixgb driver will only use vlan acceleration if a vlan group is configured. This can lead to tags getting dropped when bridging because the networking core assumes that a driver that claims vlan acceleration support can do it at all times. This change should have been part of commit eab6d18d "vlan: Don't check for vlan group before vlan_tx_tag_present." but was missed.
--- drivers/net/ixgb/ixgb_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ixgb/ixgb_main.c +1 -1
@@ -1498,7 +1498,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) DESC_NEEDED)))return NETDEV_TX_BUSY ; -if (adapter->vlgrp &&vlan_tx_tag_present (skb)) { +if (vlan_tx_tag_present (skb)) { tx_flags |=IXGB_TX_FLAGS_VLAN ; vlan_id =vlan_tx_tag_get (skb); }
Signature · 1 line
1.7.1
PATCH 2/2 igb: Don't depend on vlan group for receive size.
The igb driver currently sets its maximum receive size based on whether a vlan group is configured. However, this causes it to completely drop MTU sized vlan packets when there is no vlan group, preventing them from showing up in tcpdump, etc.
--- drivers/net/igb/igb_main.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/net/igb/igb_main.c +1 -4
@@ -2830,13 +2830,10 @@ static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,**/ static void igb_rlpml_set (struct igb_adapter *adapter) { -u32 max_frame_size = adapter->max_frame_size; +u32 max_frame_size = adapter->max_frame_size +VLAN_TAG_SIZE ;struct e1000_hw *hw = &adapter->hw;u16 pf_id = adapter->vfs_allocated_count; -if (adapter->vlgrp) - max_frame_size +=VLAN_TAG_SIZE ; -/* if vfs are enabled we set RLPML to the largest possible request * size and set the VMOLR RLPML to the size we need */ if (pf_id) {
Signature · 1 line
1.7.1
Quoted 8 lines · Jesse Gross
On transmit, the ixgb driver will only use vlan acceleration if a vlan group is configured. This can lead to tags getting dropped when bridging because the networking core assumes that a driver that claims vlan acceleration support can do it at all times. This change should have been part of commit
eab6d18d"vlan: Don't check for vlan group beforevlan_tx_tag_present." but was missed.
Quoted 7 lines
Signed-off-by Jesse Gross <[email protected]>CC Jeff Kirsher <[email protected]>CC Jesse Brandeburg <[email protected]>CC PJ Waskiewicz <[email protected]>--- drivers/net/ixgb/ixgb_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Thanks Jesse, I have added this to my queue.
Re: [PATCH 2/2] igb: Don't depend on vlan group for receive size.
In reply to Jesse GrossQuoted 5 lines · Jesse Gross
The igb driver currently sets its maximum receive size based on whether a vlan group is configured. However, this causes it to completely drop MTU sized vlan packets when there is no vlan group, preventing them from showing up in tcpdump, etc.
Quoted 7 lines
Signed-off-by Jesse Gross <[email protected]>CC Jeff Kirsher <[email protected]>CC Jesse Brandeburg <[email protected]>CC PJ Waskiewicz <[email protected]>--- drivers/net/igb/igb_main.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
Thanks, I have added this patch to my queue.
Quoted 20 lines · Jesse Gross
On transmit, the ixgb driver will only use vlan acceleration if a vlan group is configured. This can lead to tags getting dropped when bridging because the networking core assumes that a driver that claims vlan acceleration support can do it at all times. This change should have been part of commit
eab6d18d"vlan: Don't check for vlan group beforevlan_tx_tag_present." but was missed.Signed-off-by Jesse Gross <[email protected]>CC Jeff Kirsher <[email protected]>CC Jesse Brandeburg <[email protected]>CC PJ Waskiewicz <[email protected]>--- drivers/net/ixgb/ixgb_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/ixgb/ixgb_main.c +0
-0
drivers/net/ixgb/ixgb_main.c ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · line 1504
Quoted 8 lines
drivers/net/ixgb/ixgb_main.c +1
-1@@ -1498,7 +1498,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) DESC_NEEDED)))return NETDEV_TX_BUSY ; -if (adapter->vlgrp &&vlan_tx_tag_present (skb)) { +if (vlan_tx_tag_present (skb)) { tx_flags |=IXGB_TX_FLAGS_VLAN ; vlan_id =vlan_tx_tag_get (skb); }
After further review, NAK because this will cause a bug. With this patch it would be possible to overrun the buffers, so the correct fix is to increase max_frame_size by VLAN_TAG_SIZE in ixgb/igb_change_mtu.
Alex has said that he will generate the patches for the alternate fix.
Quoted 24 lines · Jeff Kirsher
Quoted 23 lines · Jesse Gross
On transmit, the ixgb driver will only use vlan acceleration if a vlan group is configured. This can lead to tags getting dropped when bridging because the networking core assumes that a driver that claims vlan acceleration support can do it at all times. This change should have been part of commit
eab6d18d"vlan: Don't check for vlan group beforevlan_tx_tag_present." but was missed.Signed-off-by Jesse Gross <[email protected]>CC Jeff Kirsher <[email protected]>CC Jesse Brandeburg <[email protected]>CC PJ Waskiewicz <[email protected]>---
drivers/net/ixgb/ixgb_main.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/ixgb/ixgb_main.c +0
-0@@ -1498,7 +1498,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) DESC_NEEDED))) return NETDEV_TX_BUSY;
Quoted 9 lines
drivers/net/ixgb/ixgb_main.c ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · line 1504
Quoted 5 lines
drivers/net/ixgb/ixgb_main.c +1
-1- if (adapter->vlgrp && vlan_tx_tag_present(skb)) { + if (vlan_tx_tag_present(skb)) { tx_flags |= IXGB_TX_FLAGS_VLAN; vlan_id = vlan_tx_tag_get(skb); }After further review, NAK because this will cause a bug. With this patch it would be possible to overrun the buffers, so the correct fix is to increase
max_frame_sizebyVLAN_TAG_SIZEin ixgb/igb_change_mtu.
Hmm, I didn't see any other place where it made changes to the handling of packets on transmit if a vlan group is configured. Maybe the buffer is extended when a group is registered and stripping is enabled?
In any case, you might want to check the other Intel drivers for similar problems. I did a pass and made a mass conversion of this type a little while ago. Those changes have already been merged, I just missed this one by accident.
Quoted 41 lines · Jesse Gross
Quoted 24 lines · Jeff Kirsher
Quoted 23 lines · Jesse Gross
On transmit, the ixgb driver will only use vlan acceleration if a vlan group is configured. This can lead to tags getting dropped when bridging because the networking core assumes that a driver that claims vlan acceleration support can do it at all times. This change should have been part of commit
eab6d18d"vlan: Don't check for vlan group beforevlan_tx_tag_present." but was missed.Signed-off-by Jesse Gross <[email protected]>CC Jeff Kirsher <[email protected]>CC Jesse Brandeburg <[email protected]>CC PJ Waskiewicz <[email protected]>--- drivers/net/ixgb/ixgb_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/ixgb/ixgb_main.c +0
-0@@ -1498,7 +1498,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) DESC_NEEDED)))return NETDEV_TX_BUSY ;Quoted 9 lines
drivers/net/ixgb/ixgb_main.c ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · line 1504
Quoted 5 lines
drivers/net/ixgb/ixgb_main.c +1
-1-if (adapter->vlgrp &&vlan_tx_tag_present (skb)) { +if (vlan_tx_tag_present (skb)) { tx_flags |=IXGB_TX_FLAGS_VLAN ; vlan_id =vlan_tx_tag_get (skb); }After further review, NAK because this will cause a bug. With this patch it would be possible to overrun the buffers, so the correct fix is to increase
max_frame_sizebyVLAN_TAG_SIZEin ixgb/igb_change_mtu.Hmm, I didn't see any other place where it made changes to the handling of packets on transmit if a vlan group is configured. Maybe the buffer is extended when a group is registered and stripping is enabled?
Quoted 4 lines
In any case, you might want to check the other Intel drivers for similar problems. I did a pass and made a mass conversion of this type a little while ago. Those changes have already been merged, I just missed this one by accident.
I will get with Alex and review the other Intel drivers, thanks Jesse.
Quoted 60 lines
-----Original Message-----
From: Kirsher, Jeffrey T
Sent: Friday, November 05, 2010 1:07 PM
To: Jesse Gross
Cc: David Miller; [email protected]; Brandeburg, Jesse; Duyck, Alexander H
Subject: Re: [PATCH 1/2] ixgb: Don't check for vlan group on transmit.Quoted 7 lines · Jesse Gross
Quoted 5 lines · Jeff Kirsher
Quoted 4 lines · Jesse Gross
On transmit, the ixgb driver will only use vlan acceleration if a vlan group is configured. This can lead to tags getting dropped when bridging because the networking core assumes that a driver that claims vlan acceleration support can do it at all times.
This
Quoted 1 line
Quoted 1 line
Quoted 1 line
change should have been part of commit
eab6d18d"vlan: Don'tcheck for
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
vlan group before
vlan_tx_tag_present." but was missed.Signed-off-by Jesse Gross <[email protected]>CC Jeff Kirsher <[email protected]>CC Jesse Brandeburg <[email protected]>CC PJ Waskiewicz <[email protected]>--- drivers/net/ixgb/ixgb_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/net/ixgb/ixgb_main.cQuoted 4 lines
Quoted 4 lines
drivers/net/ixgb/ixgb_main.c ixgb_xmit_frame(struct sk_buff *skb, struct
Quoted 4 lines
index caa8192..d18194e 100644
drivers/net/ixgb/ixgb_main.c +0
-0@@ -1498,7 +1498,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct
net_device*netdev)Quoted 10 lines
Quoted 10 lines
drivers/net/ixgb/ixgb_main.c ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · line 1504
Quoted 8 lines
drivers/net/ixgb/ixgb_main.c +1
-1DESC_NEEDED)))return NETDEV_TX_BUSY ; -if (adapter->vlgrp &&vlan_tx_tag_present (skb)) { +if (vlan_tx_tag_present (skb)) { tx_flags |=IXGB_TX_FLAGS_VLAN ; vlan_id =vlan_tx_tag_get (skb); }After further review, NAK because this will cause a bug. With
this
Quoted 1 line
Quoted 1 line
patch it would be possible to overrun the buffers, so the correct
fix is
Quoted 1 line
Quoted 1 line
to increase
max_frame_sizebyVLAN_TAG_SIZEinixgb/igb_change_mtu.
Quoted 3 lines
Hmm, I didn't see any other place where it made changes to the handling of packets on transmit if a vlan group is configured.
Maybe
Quoted 3 lines
the buffer is extended when a group is registered and stripping is enabled?
Quoted 6 lines
Quoted 4 lines
In any case, you might want to check the other Intel drivers for similar problems. I did a pass and made a mass conversion of this type a little while ago. Those changes have already been merged, I just missed this one by accident.
I will get with Alex and review the other Intel drivers, thanks Jesse.
Just to make things clear. The ixgb patch is fine. There isn't anything wrong with it.
The patch with the bug is the other patch, "2/2 igb: Don't depend on VLAN group for receive size". The problem is it was updating the RLPML register, but not updating the buffer sizes as such there were a few cases where we could receive a buffer larger the SKB head room. The bug itself probably won't come up very often since there are only a couple of very specific MTU sizes where it will be an issue.
The quick fix for your patch is to move the addition of VLAN_TAG_SIZE to the max_frame in igb_change_mtu instead of in the set_rlpml call. Otherwise I will see about submitting an updated patch in the next few days.
Thanks,
Alex
Quoted 65 lines · Alexander H
Quoted 65 lines
-----Original Message-----
From: Kirsher, Jeffrey T
Sent: Friday, November 05, 2010 1:07 PM
To: Jesse Gross
Cc: David Miller; [email protected]; Brandeburg, Jesse; Duyck, Alexander H
Subject: Re: [PATCH 1/2] ixgb: Don't check for vlan group on transmit.Quoted 7 lines · Jesse Gross
Quoted 5 lines · Jeff Kirsher
Quoted 4 lines · Jesse Gross
On transmit, the ixgb driver will only use vlan acceleration if a vlan group is configured. This can lead to tags getting dropped when bridging because the networking core assumes that a driver that claims vlan acceleration support can do it at all times.
This
Quoted 1 line
Quoted 1 line
Quoted 1 line
change should have been part of commit
eab6d18d"vlan: Don'tcheck for
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
vlan group before
vlan_tx_tag_present." but was missed.Signed-off-by Jesse Gross <[email protected]>CC Jeff Kirsher <[email protected]>CC Jesse Brandeburg <[email protected]>CC PJ Waskiewicz <[email protected]>---
drivers/net/ixgb/ixgb_main.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/drivers/net/ixgb/ixgb_main.cQuoted 4 lines
Quoted 4 lines
drivers/net/ixgb/ixgb_main.c ixgb_xmit_frame(struct sk_buff *skb, struct
Quoted 4 lines
index caa8192..d18194e 100644
drivers/net/ixgb/ixgb_main.c +0
-0@@ -1498,7 +1498,7 @@ ixgb_xmit_frame(struct sk_buff *skb, struct
net_device*netdev)Quoted 10 lines
Quoted 10 lines
drivers/net/ixgb/ixgb_main.c ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · line 1504
Quoted 8 lines
drivers/net/ixgb/ixgb_main.c +1
-1DESC_NEEDED))) return NETDEV_TX_BUSY; - if (adapter->vlgrp && vlan_tx_tag_present(skb)) { + if (vlan_tx_tag_present(skb)) { tx_flags |= IXGB_TX_FLAGS_VLAN; vlan_id = vlan_tx_tag_get(skb); }After further review, NAK because this will cause a bug. With
this
Quoted 1 line
Quoted 1 line
patch it would be possible to overrun the buffers, so the correct
fix is
Quoted 1 line
Quoted 1 line
to increase
max_frame_sizebyVLAN_TAG_SIZEinixgb/igb_change_mtu.
Quoted 3 lines
Hmm, I didn't see any other place where it made changes to the handling of packets on transmit if a vlan group is configured.
Maybe
Quoted 7 lines
the buffer is extended when a group is registered and stripping is enabled?
In any case, you might want to check the other Intel drivers for similar problems. I did a pass and made a mass conversion of this type a little while ago. Those changes have already been merged, I just missed this one by accident.
Quoted 6 lines
Quoted 1 line
I will get with Alex and review the other Intel drivers, thanks Jesse.
Just to make things clear. The ixgb patch is fine. There isn't anything wrong with it.
The patch with the bug is the other patch, "2/2 igb: Don't depend on VLAN group for receive size". The problem is it was updating the RLPML register, but not updating the buffer sizes as such there were a few cases where we could receive a buffer larger the SKB head room. The bug itself probably won't come up very often since there are only a couple of very specific MTU sizes where it will be an issue.
OK, that makes more sense. It seems that the other drivers already account for this, so they should be fine.
Quoted 1 line
The quick fix for your patch is to move the addition of
VLAN_TAG_SIZEto themax_frameinigb_change_mtuinstead of in theset_rlpmlcall. Otherwise I will see about submitting an updated patch in the next few days.
I happy to let you take care of it - obviously you know the driver/hardware much better than I.
Quoted 5 lines · Jesse Gross
On Fri, Nov 5, 2010 at 3:30 PM, Duyck, Alexander H
Quoted 1 line
The quick fix for your patch is to move the addition of
VLAN_TAG_SIZEto themax_frameinigb_change_mtuinstead of in theset_rlpmlcall. Otherwise I will see about submitting an updated patch in the next few days.I happy to let you take care of it - obviously you know the driver/hardware much better than I.
Alex, did you get a chance to take a look at this? I was hoping to get the fix for this (and also the patch mentioned originally in this message for ixgb) into 2.6.37. I can also respin it along the lines that you suggested if that would help.
Quoted 7 lines · Jesse Gross
Quoted 6 lines · Jesse Gross
On Fri, Nov 5, 2010 at 3:30 PM, Duyck, Alexander H
Quoted 4 lines
The quick fix for your patch is to move the addition of
VLAN_TAG_SIZEto themax_frameinigb_change_mtuinstead of in theset_rlpmlcall. Otherwise I will see about submitting an updated patch in the next few days.
Quoted 7 lines
Quoted 2 lines
I happy to let you take care of it - obviously you know the driver/hardware much better than I.
Alex, did you get a chance to take a look at this? I was hoping to get the fix for this (and also the patch mentioned originally in this message for ixgb) into 2.6.37. I can also respin it along the lines that you suggested if that would help.
Jesse, I am still looking at the ixgb patch. I think the patch is incomplete.
Simply removing the adapter->vlgrp check is not enough. According to
the specs CTRL0_VME needs to be set in order for the vlan tag insertion/stripping to be enabled. We have a modified patch currently in test and will post it to netdev as soon as we confirm that it works
as expected.
Thanks,
Emil
Quoted 15 lines
-----Original Message-----
From: Jesse Gross [mailto:[email protected]]
Sent: Tuesday, November 30, 2010 2:34 PM
To: Duyck, Alexander H
Cc: Kirsher, Jeffrey T; David Miller; [email protected]; Brandeburg, Jesse
Subject: Re: [PATCH 1/2] ixgb: Don't check for vlan group on transmit.Quoted 2 lines · Jesse Gross
On Fri, Nov 5, 2010 at 3:30 PM, Duyck, Alexander H
Quoted 1 line
The quick fix for your patch is to move the addition of
VLAN_TAG_SIZEto themax_frameinigb_change_mtuinstead of in theset_rlpmlcall. Otherwise I will see about submitting an updated patch in the next few days.Quoted 1 line
Quoted 7 lines
Quoted 2 lines
I happy to let you take care of it - obviously you know the driver/hardware much better than I.
Alex, did you get a chance to take a look at this? I was hoping to get the fix for this (and also the patch mentioned originally in this message for ixgb) into 2.6.37. I can also respin it along the lines that you suggested if that would help.
I did, and we are currently testing the patch I have generated. Once it passes testing Jeff will submit it to netdev.
Thanks,
Alex