mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: zero-copy networking & a performance drop
@ 2002-06-29 17:04 Nivedita Singhvi
  0 siblings, 0 replies; 11+ messages in thread
From: Nivedita Singhvi @ 2002-06-29 17:04 UTC (permalink / raw)
  To: hurwitz; +Cc: linux-kernel

> > On sending data, we have all the information trusted, because we
> > checked that already, as the user sets it. With sendfile, we have
> > even trusted and mapped data (because we just paged it in before).
> > 
> > If we take this into account, rx MUST be always slower, or tx
> > isn't really optimized yet.
> 
> Indeed, the above does make sense. But, what about when the receive side
> is trustable, too. This is obviously not the normal case; but with
> quadrics I think that it is. Since quadrics is a shared memory
> architecture, with all of the processing taken care of on the cards, we
> should be able to reliably trust the receive side as much as the send
> side. Unless I'm misunderstanding your use of trust?

Perhaps a little bit - the work the rx processing has to do
involves determining the validity of the packet as well as
demultiplexing at each protocol stage..You will always
have to at least test for a valid packet, parse options, find
the recipients, etc. If you're saying you have offloaded
the tcp/ip protocol stack on the cards, thats a whole different 
issue. 

 
> If I am right on this, how much of an overhaul would it be to implement, 
> for instance, a NETIF_RX_TRUSTED flag in the net_device struct to force a 
> receive side fast path? I don't expect this to bring the receive side even 
> with the transmit side, but right now we (and I have heard the same from 
> others) are running at ~70% of the transmit side on the receive side, 
> which seems to leave a good margin for improvement. 

I'm no maintainer, but I would at least say whoa! Not sure if we
have a problem, not sure where the problems are, and not sure
if there are problems in determining whether there is a problem :)..

fer'nstance:
	- if the rx code path is say 1000 lines and the tx
	  stack length is 700 lines of code, then I'd expect
	  the tx time to be 70% of rx time. A difference
	  in the stack length is not a problem by itself,
	  given that they have different functions to perform?

	- in reality, there is no such clean concept,
	  right? rx processing sends acks, interrupts happen,
	  and a whole bunch of profiling and lockmeter
	  data can end up pretty misleading.. Do you
	  have pure unidirectional data transfer? What 
	  applications are you running? How are you
	  measuring things, where are you measuring things,
	  and what are the skewing factors? 

	- and I'm not even a benchmarking or performance person,
	  wait till you get done talking to them :)	 	
	  
	 
> This seems like it could be useful not just for the special case of 
> quadrics (and other shared mamory architectures)- if, for instance, cards 
> begin to do more TCP processing in hardware (or we modify the firmware to 
> do this for us, ala AceNIC), it would be nice to bypass it in the kernel. 
> This is, of course, a quick idea that's just popped into my head, and 
> probably is inherently impossible or foolish :)

Thats a question of is the stack modified to take advantage
of what the hardware can do, and, as I said above, thats a rather bigger 
and different issue. 

> --Gus

thanks,
Nivedita


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: zero-copy networking & a performance drop
@ 2002-06-28  3:01 Hurwitz Justin W.
  0 siblings, 0 replies; 11+ messages in thread
From: Hurwitz Justin W. @ 2002-06-28  3:01 UTC (permalink / raw)
  To: linux-kernel


In a mail that wasn't CC'd to me Bernd said:
>
> In article <Pine.LNX.4.44.0206271146280.9500-100000@alvie-mail.lanl.gov> you wrote: 
>> Previous tests have show that we can transmit IP packets easily at around 
>> 1.4 Gbit, but we can only receive at about 0.9 Gbit. We suspect there is a 
>> memory copy somewhere either in the quadrics IP driver (covered by an NDA, 
>> sorry), or in the IP stack after netif_rx() is called. I've looked at the 
>> driver, and, upon a (good) cursory inspection, it looks good. 
>
> You have to sign a NDA for a hardware which bahaves slower than expected and 
> then u seek help in the open community? I would ask you to bother the 
> manufacturer, so they know about this problem and solve it. After all, if 
> you have to pay for it you should actually USE their service. 
>
> AFAIK only a few methods like sendfile support zero copy ip. 
>
> But on the other hand, if the card works by memory sharing perhaps TCP/IP is 
> simply the wrong api to speak to that device? 
>

Your mail begs a reply, to defend both my work, and the hardware that I'm
working on (and company behind it)- no offense is intended, and none was
taken. I feel that, in a community, such as this, where the immediate
response (which I do share) to letters like NDA is disgust, a bit of
defense where it is appropriate is an always on-topic reminder of their
occasional legitimacy.

There are three points in your mail to which I need reply- the NDA, the
performance of the hardware (esp. wrt TCP/IP), and my requesting the help
of the open source community.

I agree that NDAs are dangerous, often ill-conceived, and usually counter-
productive devices of intellectual monopoly (e.g., Broadcom's refusal to
share Tigon3 information). That said they can serve a legitimate purpose,
especially when you are not talking about commodity products. Quadrics
products are not commodity- I'd be surprised if anyone reading this has
quadrics hardware in any general use (commodity) machine. The material
covered under the NDA (of which the IP driver is a trivial part)
represents an important part of Quadrics' unique product line. They do
have legitimate reason to keep this code out of their competitors' hands;
we are not their competitors, and they have given us access to their code, 
provided that we do not share it with their competitors. 

You are very right in saying that TCP/IP is the wrong api for this 
hardware. We achieve significantly better performance with MPI. But we 
have applications that could significantly benefit from having TCP/IP 
available; being able to run TCP/IP on quadrics based clusters will open 
up new possibilities for us- hence this is of research interest for us. 

Another consequence of your point is that Quadrics does not have a direct
interest in developing TCP/IP for their hardware; it is not part of their
design for the hardware, and they cannot be expected to provide a top
notch driver to do what we want, just because we want it- their hardware
does what it is supposed to do; we're trying to get it to do the
unexpected. Initial research shows that we should be able to get twice the
performance out of TCP/IP on this hardware than we currently do. Quadrics
has helped us get this far, despite the fact that they did not design
their hardware for this purpose- that's much more than I expect from most
companies.

Which brings me to my work. I am not trying to get the open source
community's help to make a propreitary driver work. As I said before,
Quadrics' driver does look to be of good quality- I do not believe that
the problem necessarily lies there. I am trying to determine why there is
so large a disparity between send and receive performance when using this
driver in the linux kernel. As indicated in a previous reply to my
question, this asymmetry might be inherent to the kernel. If it is, my job
is become to try to eliminate or reduce this asymmetry. That work, if
sucessful, will be returned to the kernel. As you certainly know, TCP only
performs as well as the slowest side of the connection- reducing asymmetry
could offer significant performance gains.

Hope this clarifies my intent, repudiates any indication that the Quadrics
hardware is underperforming, and justifies the NDA :) It's a lot to do.  
I _am_ an open source developer (I learned how to program while hacking
SCSI drivers in the kernel's pre-1.0 days); and I do believe that
Quadrics' NDA is legitimate, and that they are not the bad-guys. 

Cheers,
--Gus

PS- You are right about sendfile() and zero-copy IP. 


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: zero-copy networking & a performance drop
@ 2002-06-27 19:53 Nivedita Singhvi
  2002-06-27 21:50 ` Hurwitz Justin W.
  0 siblings, 1 reply; 11+ messages in thread
From: Nivedita Singhvi @ 2002-06-27 19:53 UTC (permalink / raw)
  To: hurwitz; +Cc: linux-kernel

> Now, here is my direct question: has a zero-copy TCP stack 
> been introduced after 2.4.3 (which we're running)? I believe 
> the answer is yes, but I've not been able to find direct confirmation. 
> If the answer is yes, does anything special need to be done 
> (in terms of allocating/working with skbs, or passing the packets 
> up to higher levels) in order to use the zero-copy implementation.

Yes, 2.4.4.  You should upgrade to that if possible, or rather,
a much more recent version..

That said, rx has been slower than sends in most of our testing
too. 


thanks,
Nivedita



^ permalink raw reply	[flat|nested] 11+ messages in thread
* zero-copy networking & a performance drop
@ 2002-06-27 18:16 Hurwitz Justin W.
  2002-06-27 21:08 ` Bernd Eckenfels
  0 siblings, 1 reply; 11+ messages in thread
From: Hurwitz Justin W. @ 2002-06-27 18:16 UTC (permalink / raw)
  To: linux-kernel


Please Cc me in replies. I'm an archive lurker.

Howdy-

I've been working to isolate (and fix ;) a receive-side performance 
bottleneck in the IP implementation used over the Quadrics Interconnect. 
For those "not in the know," quadrics is a high speed (3.2 gbit) low 
latency propreitary interconnect, used primarily in supercomputing 
applications. It provides a shared memory architecture, and most of the 
communication is handled by the NICs.

Previous tests have show that we can transmit IP packets easily at around
1.4 Gbit, but we can only receive at about 0.9 Gbit. We suspect there is a 
memory copy somewhere either in the quadrics IP driver (covered by an NDA, 
sorry), or in the IP stack after netif_rx() is called. I've looked at the 
driver, and, upon a (good) cursory inspection, it looks good.

Now, here is my direct question: has a zero-copy TCP stack been introduced
after 2.4.3 (which we're running)? I believe the answer is yes, but I've
not been able to find direct confirmation. If the answer is yes, does
anything special need to be done (in terms of allocating/working with
skbs, or passing the packets up to higher levels) in order to use the
zero-copy implementation.

>From what I've read/determined, fixing this performance drop might be as
simple as upgrading the kernel and recomiling our IP module. It is
unfortunately the case that I can't play around with our test cluster-
it's become a production cluster, so even upgrading kernel versions will
be a hard sell. I need to be certain that what I want to do is the Right
Thing(tm) before I propose it.

For the curious (and possibly advice-offering): neither fragmentation nor
checksums should be an issue with this hardware. The IP data is sent via
the hardware's link level protocol, which performs fragmentation and error
checking/correcting transparent to the OS (which, btw, is sometimes a real
pain).

Cheers,
--Gus


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

end of thread, other threads:[~2002-06-29 17:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.44.0206271545220.17078-100000@alvie-mail.lanl.gov.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.33.0206271513320.13651-100000@w-nivedita2.des.beaverton.ibm.com.suse.lists.linux.kernel>
2002-06-28  2:59   ` zero-copy networking & a performance drop Andi Kleen
2002-06-28 15:04     ` Nivedita Singhvi
2002-06-29 17:04 Nivedita Singhvi
  -- strict thread matches above, loose matches on Subject: below --
2002-06-28  3:01 Hurwitz Justin W.
2002-06-27 19:53 Nivedita Singhvi
2002-06-27 21:50 ` Hurwitz Justin W.
2002-06-27 22:33   ` Nivedita Singhvi
2002-06-28  9:33     ` Ingo Oeser
2002-06-28 16:43       ` Hurwitz Justin W.
2002-06-27 18:16 Hurwitz Justin W.
2002-06-27 21:08 ` Bernd Eckenfels

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

all inboxes | Powered by JetHome®