All of lore.kernel.org
 help / color / mirror / Atom feed
* SUN Neptune byte order bug in TCAM filter/ethtool
@ 2009-05-06 16:16 Robert Olsson
  2009-06-10  8:26 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Olsson @ 2009-05-06 16:16 UTC (permalink / raw)
  To: netdev; +Cc: David, Miller <davem, Matheos.Worku, Jens.Laas, robert


David Miller writes:

 > >  FYI byte order seems reversed on Intel meaning you have to reverse
 > >  byte order for address and ports when adding TCAM entries via
 > >  ethtool.
 > 
 > Please report this formally with a reproduction script/commands/etc.
 > with netdev CC:'d as this is a very serious bug and exactly what I
 > tried to avoid have happen when I was so anal about the endian
 > oriented typing of the ethtool structures. :-//////////


First a disclaimer this our production system 2.6.29-rc2 but I haven't 
seen any patches since.


# This rule makes the TCAM drop pkts with IP-src 10.10.10.1 
# Note the reversed byte-order. Machine is Opteron little Endian.

ethtool -N  eth0  rx-class-rule-add ip4 udp sip 1.10.10.10 drop  

# The rule listed

ethtool  -n eth0  rx-class-rule-all 
Total 1 rules

      IPv4 Rule:   ID[84] Target[Discard]
      IP src addr[1.10.10.10] mask[255.255.255.255]
      IP dst addr[0.0.0.0] mask[0.0.0.0]
      L4 proto[UDP]
      L4 src port[0] mask[0x0]
      L4 dst port[0] mask[0x0]
      IP TOS[0x0] mask[0x0]

# The rule deleted

ethtool  -N eth0  rx-class-rule-del 84 


Cheers
					--ro


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SUN Neptune byte order bug in TCAM filter/ethtool
  2009-05-06 16:16 SUN Neptune byte order bug in TCAM filter/ethtool Robert Olsson
@ 2009-06-10  8:26 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-06-10  8:26 UTC (permalink / raw)
  To: robert; +Cc: netdev, davem, Matheos.Worku, Jens.Laas

From: Robert Olsson <robert@robur.slu.se>
Date: Wed, 6 May 2009 18:16:07 +0200

> # This rule makes the TCAM drop pkts with IP-src 10.10.10.1 
> # Note the reversed byte-order. Machine is Opteron little Endian.
> 
> ethtool -N  eth0  rx-class-rule-add ip4 udp sip 1.10.10.10 drop  
> 
> # The rule listed
> 
> ethtool  -n eth0  rx-class-rule-all 
> Total 1 rules
> 
>       IPv4 Rule:   ID[84] Target[Discard]
>       IP src addr[1.10.10.10] mask[255.255.255.255]
>       IP dst addr[0.0.0.0] mask[0.0.0.0]
>       L4 proto[UDP]
>       L4 src port[0] mask[0x0]
>       L4 dst port[0] mask[0x0]
>       IP TOS[0x0] mask[0x0]

I suspect that ethtool is probably to blame, the kernel seems
sane and treats the IP addresses, ports, etc. as big-endian.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-10 16:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-06 16:16 SUN Neptune byte order bug in TCAM filter/ethtool Robert Olsson
2009-06-10  8:26 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.