Re: [net 2/2] net: fix a bug of dropping FCoE frames when disabling tx ip checksum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Wed, 14 Mar 2012 18:54:32 +0000
"Zou, Yi" <yi.zou@xxxxxxxxx> wrote:

> > 
> > On Wed, 14 Mar 2012 00:01:58 -0700
> > Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx> wrote:
> > 
> > > From: Yi Zou <yi.zou@xxxxxxxxx>
> > >
> > > Fix a bug when using 'ethtool -K ethx tx off' to turn off tx ip
> > checksum,
> > > FCoE CRC offload should not be impacte. The skb_checksum_help() is
> > needed
> > > only if it's not FCoE traffic for ip checksum, regardless of ethtool
> > toggling
> > > the tx ip checksum on or off.
> > >
> > > Signed-off-by: Yi Zou <yi.zou@xxxxxxxxx>
> > > Tested-by: Ross Brattain <ross.b.brattain@xxxxxxxxx>
> > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx>
> > > ---
> > >  net/core/dev.c |    3 +++
> > >  1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/net/core/dev.c b/net/core/dev.c
> > > index 6ca32f6..9e378009 100644
> > > --- a/net/core/dev.c
> > > +++ b/net/core/dev.c
> > > @@ -1913,6 +1913,9 @@ int skb_checksum_help(struct sk_buff *skb)
> > >  	__wsum csum;
> > >  	int ret = 0, offset;
> > >
> > > +	if (skb->protocol == htons(ETH_P_FCOE))
> > > +		goto out;
> > > +
> > >  	if (skb->ip_summed == CHECKSUM_COMPLETE)
> > >  		goto out_set_summed;
> > >
> > 
> > Shouldn't this be done in the offending driver rather than the core?
> Well, yes and no, the driver is already using NETIF_F_FCOE_CRC to indicate
> the FCoE CRC offload capability, and can_checksum_protocol() indicates that.
> The fcoe protocol stack then uses CHECKSUM_PARTIAL and NETIF_F_FCOE_CRC to
> pass through netdev w/o doing skb_checksum(), which is not captured here
> in dev_hard_start_xmit() as it looks at NETIF_F_ALL_CSUM only before calling
> skb_checksum_help().

But your change would break any code (if there is any) generating this
kind of packet and going through firewall, etc. For example a bridge or
router for FCOE packets.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux