public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: packet re-ordering on SMP machines.
  2002-08-25  7:18 packet re-ordering on SMP machines Ben Greear
@ 2002-08-25  7:07 ` David S. Miller
  2002-08-25 14:41 ` Alan Cox
  1 sibling, 0 replies; 8+ messages in thread
From: David S. Miller @ 2002-08-25  7:07 UTC (permalink / raw)
  To: greearb; +Cc: linux-kernel


Use IRQ affinity settings if you want strict packet receive ordering.

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

* packet re-ordering on SMP machines.
@ 2002-08-25  7:18 Ben Greear
  2002-08-25  7:07 ` David S. Miller
  2002-08-25 14:41 ` Alan Cox
  0 siblings, 2 replies; 8+ messages in thread
From: Ben Greear @ 2002-08-25  7:18 UTC (permalink / raw)
  To: linux-kernel

It appears from my initial tests on 2.4.20-pre4, that packets sent on
one port, and received on another port on the same machine (via a cross-over
cable), can be re-ordered.  I see about 2000 reordered packets per 5,000,000 packets
sent (sending about 70,000 packets-per-second on a dual-port e1000 NIC.)

By re-ordered, I mean that a method called from process_backlog in dev.c
is being handed packets in a different order than they are being poked into
the driver with hard_start_xmit on the other interface.  If each CPU can be running the
process_backlog, then I can see how this could be happening.


1)  Is this expected behaviour?

2)  Is there any standard (ie configurable) way to enforce strict ordering on an
     SMP system?

3)  If answer to 2 is no, would you all be interested in a patch that
     did allow strict ordering (if indeed I can figure out how to write one)?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



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

* Re:  packet re-ordering on SMP machines.
@ 2002-08-25  8:01 Manfred Spraul
  0 siblings, 0 replies; 8+ messages in thread
From: Manfred Spraul @ 2002-08-25  8:01 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-kernel

 > 2)  Is there any standard (ie configurable) way to enforce strict
 > ordering on an SMP system?

2 cpus, 2 network cards? What happens if you bind the interrupts to cpus?

echo 1 > /proc/irq/<irq_of_card_1>/smp_affinity
echo 2 > /proc/irq/<irq_of_card_2>/smp_affinity

--
	Manfred


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

* Re: packet re-ordering on SMP machines.
  2002-08-25  7:18 packet re-ordering on SMP machines Ben Greear
  2002-08-25  7:07 ` David S. Miller
@ 2002-08-25 14:41 ` Alan Cox
  2002-08-25 17:00   ` Ben Greear
  2002-08-25 22:49   ` David S. Miller
  1 sibling, 2 replies; 8+ messages in thread
From: Alan Cox @ 2002-08-25 14:41 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-kernel

On Sun, 2002-08-25 at 08:18, Ben Greear wrote:
> By re-ordered, I mean that a method called from process_backlog in dev.c
> is being handed packets in a different order than they are being poked into
> the driver with hard_start_xmit on the other interface.  If each CPU can be running the
> process_backlog, then I can see how this could be happening.
> 
> 
> 1)  Is this expected behaviour?
Yes

> 2)  Is there any standard (ie configurable) way to enforce strict ordering on an
>      SMP system?
No

> 3)  If answer to 2 is no, would you all be interested in a patch that
>      did allow strict ordering (if indeed I can figure out how to write one)?

You should never need it. Ethernet, hubs, switches, routers, internet
backbones etc will all cause packet re-ordering. You should also expect
the percentage of re-ordered frames on the net to rise and rise. 



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

* Re: packet re-ordering on SMP machines.
@ 2002-08-25 15:56 jamal
  0 siblings, 0 replies; 8+ messages in thread
From: jamal @ 2002-08-25 15:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev




NAPI fixes packet reordering problems.
Could people please post network related questions to netdev please?
I think it even says so in the FAQ Richard Gooch maintains.
Believe it or not, quiet a few people are not subscribed to lk

cheers,
jamal


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

* Re: packet re-ordering on SMP machines.
  2002-08-25 14:41 ` Alan Cox
@ 2002-08-25 17:00   ` Ben Greear
  2002-08-25 20:44     ` Alan Cox
  2002-08-25 22:49   ` David S. Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Ben Greear @ 2002-08-25 17:00 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Alan Cox wrote:
> On Sun, 2002-08-25 at 08:18, Ben Greear wrote:
> 
>>By re-ordered, I mean that a method called from process_backlog in dev.c
>>is being handed packets in a different order than they are being poked into
>>the driver with hard_start_xmit on the other interface.  If each CPU can be running the
>>process_backlog, then I can see how this could be happening.
>>
>>
>>1)  Is this expected behaviour?
> 
> Yes
> 
> 
>>2)  Is there any standard (ie configurable) way to enforce strict ordering on an
>>     SMP system?
> 
> No
> 
> 
>>3)  If answer to 2 is no, would you all be interested in a patch that
>>     did allow strict ordering (if indeed I can figure out how to write one)?
> 
> 
> You should never need it. Ethernet, hubs, switches, routers, internet
> backbones etc will all cause packet re-ordering. You should also expect
> the percentage of re-ordered frames on the net to rise and rise. 

I would like to detect the number of pkts that such backbone hardware does
re-order, so if my end machine is also re-ordering, I cannot get valid
numbers.

Thanks,
Ben

> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


-- 
Ben Greear <greearb@candelatech.com>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear



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

* Re: packet re-ordering on SMP machines.
  2002-08-25 17:00   ` Ben Greear
@ 2002-08-25 20:44     ` Alan Cox
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Cox @ 2002-08-25 20:44 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-kernel

On Sun, 2002-08-25 at 18:00, Ben Greear wrote:
> I would like to detect the number of pkts that such backbone hardware does
> re-order, so if my end machine is also re-ordering, I cannot get valid
> numbers.

Good point 


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

* Re: packet re-ordering on SMP machines.
  2002-08-25 14:41 ` Alan Cox
  2002-08-25 17:00   ` Ben Greear
@ 2002-08-25 22:49   ` David S. Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David S. Miller @ 2002-08-25 22:49 UTC (permalink / raw)
  To: alan; +Cc: greearb, linux-kernel

   From: Alan Cox <alan@lxorguk.ukuu.org.uk>
   Date: 25 Aug 2002 15:41:13 +0100

   > 3)  If answer to 2 is no, would you all be interested in a patch that
   >      did allow strict ordering (if indeed I can figure out how to write one)?
   
   You should never need it. Ethernet, hubs, switches, routers, internet
   backbones etc will all cause packet re-ordering. You should also expect
   the percentage of re-ordered frames on the net to rise and rise. 
   
But to be honest, NAPI was meant to dramatically reduce the "SMP
specific" causes of packet reordering.  When a driver does use NAPI,
the reordering due to SMP goes way down.

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

end of thread, other threads:[~2002-08-25 22:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-25  7:18 packet re-ordering on SMP machines Ben Greear
2002-08-25  7:07 ` David S. Miller
2002-08-25 14:41 ` Alan Cox
2002-08-25 17:00   ` Ben Greear
2002-08-25 20:44     ` Alan Cox
2002-08-25 22:49   ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2002-08-25  8:01 Manfred Spraul
2002-08-25 15:56 jamal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox