netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How do I know my driver support RSS?
@ 2012-03-03 21:25 Yuehai Xu
  2012-03-04  0:10 ` Ben Hutchings
  0 siblings, 1 reply; 4+ messages in thread
From: Yuehai Xu @ 2012-03-03 21:25 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, Eric Dumazet, yhxu, sbw

Hi,

The Linux version is 3.1.4,

ethtool -i eth0:
driver: bnx2
version: 2.1.11
firmware-version: 5.2.7 bc 5.2.2 NCSI 2.0.8
bus-info: 0000:01:00.0

cat /proc/interrupts | grep eth0:
  75:   21055507          0          0          0          0
0          0          0          0          0          0          0
      0          0          0          0          0          0
 0          0          0          0          0          0
PCI-MSI-edge      eth0-0
  76:      13525   16727512          0          0          0
0          0          0          0          0          0          0
      0          0          0          0          0          0
 0          0          0          0          0          0
PCI-MSI-edge      eth0-1
  77:      11057          0   15796802          0          0
0          0          0          0          0          0          0
      0          0          0          0          0          0
 0          0          0          0          0          0
PCI-MSI-edge      eth0-2
  78:     186481          0          0   31960030          0
0          0          0          0          0          0          0
      0          0          0          0          0          0
 0          0          0          0          0          0
PCI-MSI-edge      eth0-3
  79:     122343          0          0          0   32711648
0          0          0          0          0          0          0
      0          0          0          0          0          0
 0          0          0          0          0          0
PCI-MSI-edge      eth0-4
  80:     391642          0          0          0          0
164243994          0          0          0          0          0
   0          0          0          0          0          0          0
         0          0          0          0          0          0
PCI-MSI-edge      eth0-5
  81:     681084          0          0          0          0
0   41645128          0          0          0          0          0
      0          0          0          0          0          0
 0          0          0          0          0          0
PCI-MSI-edge      eth0-6
  82:      39207          0          0          0          0
0          0   30973807          0          0          0          0
      0          0          0          0          0          0
 0          0          0          0          0          0
PCI-MSI-edge      eth0-7

>From /proc/interrupts I know that my network card has 8 rx/tx queues.
However, after reading
http://code.google.com/p/kernel/wiki/NetScalingGuide#RSS:_Receive_Side_Scaling,
I still have no idea whether I have enabled RSS for my network card.

Since I read the following statements from a paper, "we use a separate
hardware receive and transmit queue for each core and configure the
IXGBE to inspect the port number in each incoming packet header, place
the packet on the queue dedicated to the associated memcached's core,
and deliver the receive interrupt to that core." and the background of
this configuration is that each memcached is pinned to a separate core
and has its own UDP port. It seems that IXGBE's driver can detect UDP
packets according to their port numbers and put these packets into
corresponding receive queues in the hardware, is this achieved by
configuring RSS in IXGBE? If it is, I am wondering whether bnx2
supports RSS and whether it can configure in the same way.

I appreciate any help for this.

Thanks,
Yuehai

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

* Re: How do I know my driver support RSS?
  2012-03-03 21:25 How do I know my driver support RSS? Yuehai Xu
@ 2012-03-04  0:10 ` Ben Hutchings
  2012-03-04  4:30   ` Yuehai Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2012-03-04  0:10 UTC (permalink / raw)
  To: Yuehai Xu; +Cc: netdev, linux-kernel, Eric Dumazet, yhxu, sbw

On Sat, 2012-03-03 at 16:25 -0500, Yuehai Xu wrote:
[...]
> Since I read the following statements from a paper, "we use a separate
> hardware receive and transmit queue for each core and configure the
> IXGBE to inspect the port number in each incoming packet header, place
> the packet on the queue dedicated to the associated memcached's core,
> and deliver the receive interrupt to that core." and the background of
> this configuration is that each memcached is pinned to a separate core
> and has its own UDP port. It seems that IXGBE's driver can detect UDP
> packets according to their port numbers and put these packets into
> corresponding receive queues in the hardware, is this achieved by
> configuring RSS in IXGBE? If it is, I am wondering whether bnx2
> supports RSS and whether it can configure in the same way.
> 
> I appreciate any help for this.

You're confusing RSS (flow hashing) with flow steering.  These are both
explained in Documentation/network/scaling.txt.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* Re: How do I know my driver support RSS?
  2012-03-04  0:10 ` Ben Hutchings
@ 2012-03-04  4:30   ` Yuehai Xu
  2012-03-04 22:23     ` Ben Hutchings
  0 siblings, 1 reply; 4+ messages in thread
From: Yuehai Xu @ 2012-03-04  4:30 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, linux-kernel, Eric Dumazet, yhxu, sbw

On Sat, Mar 3, 2012 at 7:10 PM, Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Sat, 2012-03-03 at 16:25 -0500, Yuehai Xu wrote:
> [...]
>> Since I read the following statements from a paper, "we use a separate
>> hardware receive and transmit queue for each core and configure the
>> IXGBE to inspect the port number in each incoming packet header, place
>> the packet on the queue dedicated to the associated memcached's core,
>> and deliver the receive interrupt to that core." and the background of
>> this configuration is that each memcached is pinned to a separate core
>> and has its own UDP port. It seems that IXGBE's driver can detect UDP
>> packets according to their port numbers and put these packets into
>> corresponding receive queues in the hardware, is this achieved by
>> configuring RSS in IXGBE? If it is, I am wondering whether bnx2
>> supports RSS and whether it can configure in the same way.
>>
>> I appreciate any help for this.
>
> You're confusing RSS (flow hashing) with flow steering.  These are both
> explained in Documentation/network/scaling.txt.
>
> Ben.
>
I appreciate your replying!! What confuses me is that for each UDP
socket with exclusive port number, it has RX queue in transport layer,
and network card might also have multiple RX queues. These two queues
are definitely different. So, is it possible to configure network card
to put packets to queues(RX queues in network card) according to hash?
I read the codes of RPS/RFS, it seems that packets are put into queues
in transport layer of sockets instead of queues in network card. Am I
correct?

I appreciate any replies.

Yuehai

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

* Re: How do I know my driver support RSS?
  2012-03-04  4:30   ` Yuehai Xu
@ 2012-03-04 22:23     ` Ben Hutchings
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2012-03-04 22:23 UTC (permalink / raw)
  To: Yuehai Xu; +Cc: netdev, linux-kernel, Eric Dumazet, yhxu, sbw

On Sat, 2012-03-03 at 23:30 -0500, Yuehai Xu wrote:
> On Sat, Mar 3, 2012 at 7:10 PM, Ben Hutchings <bhutchings@solarflare.com> wrote:
> > On Sat, 2012-03-03 at 16:25 -0500, Yuehai Xu wrote:
> > [...]
> >> Since I read the following statements from a paper, "we use a separate
> >> hardware receive and transmit queue for each core and configure the
> >> IXGBE to inspect the port number in each incoming packet header, place
> >> the packet on the queue dedicated to the associated memcached's core,
> >> and deliver the receive interrupt to that core." and the background of
> >> this configuration is that each memcached is pinned to a separate core
> >> and has its own UDP port. It seems that IXGBE's driver can detect UDP
> >> packets according to their port numbers and put these packets into
> >> corresponding receive queues in the hardware, is this achieved by
> >> configuring RSS in IXGBE? If it is, I am wondering whether bnx2
> >> supports RSS and whether it can configure in the same way.
> >>
> >> I appreciate any help for this.
> >
> > You're confusing RSS (flow hashing) with flow steering.  These are both
> > explained in Documentation/network/scaling.txt.
> >
> > Ben.
> >
> I appreciate your replying!! What confuses me is that for each UDP
> socket with exclusive port number, it has RX queue in transport layer,
> and network card might also have multiple RX queues. These two queues
> are definitely different. So, is it possible to configure network card
> to put packets to queues(RX queues in network card) according to hash?

Yes.

> I read the codes of RPS/RFS, it seems that packets are put into queues
> in transport layer of sockets instead of queues in network card. Am I
> correct?
>
> I appreciate any replies.

No, that's not right.  There are also per-CPU queues of packets to be
processed.  So a packet can go from the port into a hardware RX queue,
then to a per-CPU queue for protocol processing on that CPU, then to a
per-socket queue.  By default, the protocol processing for a packet will
be done on the same CPU that took it off the hardware queue, but RPS and
RFS can transfer packets to other per-CPU queues.  It is possible to
improve on this with the hardware flow steering mechanisms discussed in
that document.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

end of thread, other threads:[~2012-03-04 22:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-03 21:25 How do I know my driver support RSS? Yuehai Xu
2012-03-04  0:10 ` Ben Hutchings
2012-03-04  4:30   ` Yuehai Xu
2012-03-04 22:23     ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).