Tom Herbert | 1 Feb 2011 01:21
Picon
Favicon

(unknown)

From b6943d0caff7db23aaed20ec7abb7848281e502a Mon Sep 17 00:00:00 2001
From: Tom Herbert <therbert <at> google.com>
Date: Mon, 31 Jan 2011 16:12:02 -0800
Subject: [PATCH] net: Check rps_flow_table when RPS map length is 1

In get_rps_cpu, add check that the rps_flow_table for the device is
NULL when trying to take fast path when RPS map length is one.
Without this, RFS is effectively disabled if map length is one which
is not correct.

Signed-off-by: Tom Herbert <therbert <at> google.com>
---
 net/core/dev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index ddd5df2..283ed85 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
 <at>  <at>  -2666,7 +2666,8  <at>  <at>  static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,

 	map = rcu_dereference(rxqueue->rps_map);
 	if (map) {
-		if (map->len == 1) {
+		if (map->len == 1 &&
+		    !rcu_dereference_raw(rxqueue->rps_flow_table)) {
 			tcpu = map->cpus[0];
 			if (cpu_online(tcpu))
 				cpu = tcpu;
--

-- 
(Continue reading)

David Miller | 1 Feb 2011 01:24
Favicon

Re: rps_flow_table bug fix

From: Tom Herbert <therbert <at> google.com>
Date: Mon, 31 Jan 2011 16:21:43 -0800 (PST)

Tom, please set your email subject correctly.

> Subject: [PATCH] net: Check rps_flow_table when RPS map length is 1
> 
> In get_rps_cpu, add check that the rps_flow_table for the device is
> NULL when trying to take fast path when RPS map length is one.
> Without this, RFS is effectively disabled if map length is one which
> is not correct.
> 
> Signed-off-by: Tom Herbert <therbert <at> google.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Steve Dobbelstein | 1 Feb 2011 01:24
Picon
Favicon

Re: Network performance with small packets

"Michael S. Tsirkin" <mst <at> redhat.com> wrote on 01/28/2011 06:16:16 AM:

> OK, so thinking about it more, maybe the issue is this:
> tx becomes full. We process one request and interrupt the guest,
> then it adds one request and the queue is full again.
>
> Maybe the following will help it stabilize?
> By itself it does nothing, but if you set
> all the parameters to a huge value we will
> only interrupt when we see an empty ring.
> Which might be too much: pls try other values
> in the middle: e.g. make bufs half the ring,
> or bytes some small value, or packets some
> small value etc.
>
> Warning: completely untested.
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index aac05bc..6769cdc 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
>  <at>  <at>  -32,6 +32,13  <at>  <at> 
>   * Using this limit prevents one virtqueue from starving others. */
>  #define VHOST_NET_WEIGHT 0x80000
>
> +int tx_bytes_coalesce = 0;
> +module_param(tx_bytes_coalesce, int, 0644);
> +int tx_bufs_coalesce = 0;
> +module_param(tx_bufs_coalesce, int, 0644);
> +int tx_packets_coalesce = 0;
(Continue reading)

David Miller | 1 Feb 2011 01:25
Favicon

[PATCH 1/2] ipv4: Remember FIB alias list head and table in lookup results.


This will be used later to implement fib_select_default() in a
completely generic manner, instead of the current situation where the
default route is re-looked up in the TRIE/HASH table and then the
available aliases are analyzed.

Signed-off-by: David S. Miller <davem <at> davemloft.net>
---
 include/net/ip_fib.h     |    3 +++
 net/ipv4/fib_hash.c      |    2 +-
 net/ipv4/fib_lookup.h    |    2 +-
 net/ipv4/fib_semantics.c |    7 +++++--
 net/ipv4/fib_trie.c      |    8 ++++----
 5 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 2c0508a..f5199b0 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
 <at>  <at>  -96,12 +96,15  <at>  <at>  struct fib_info {
 struct fib_rule;
 #endif

+struct fib_table;
 struct fib_result {
 	unsigned char	prefixlen;
 	unsigned char	nh_sel;
 	unsigned char	type;
 	unsigned char	scope;
 	struct fib_info *fi;
(Continue reading)

David Miller | 1 Feb 2011 01:25
Favicon

[PATCH 0/2] Consolidate ipv4 default route selection


We've had two copies of this code for ages, and it has always driven
me crazy when I've seen these things.

With some minor changes, we can have one generic copy which is also
much more efficient than what we have right now.

Part of what makes this so easy to do right now is all of the RCU work
Eric has done in the FIB layers.  Since all of the datastructures are
RCU protected, and fib_select_default() already runs in an RCU read
side protected area, there is no special locking needed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

David Miller | 1 Feb 2011 01:25
Favicon

[PATCH 2/2] ipv4: Consolidate all default route selection implementations.


Both fib_trie and fib_hash have a local implementation of
fib_table_select_default().  This is completely unnecessary
code duplication.

Since we now remember the fib_table and the head of the fib
alias list of the default route, we can implement one single
generic version of this routine.

Looking at the fib_hash implementation you may get the impression
that it's possible for there to be multiple top-level routes in
the table for the default route.  The truth is, it isn't, the
insert code will only allow one entry to exist in the zero
prefix hash table, because all keys evaluate to zero and all
keys in a hash table must be unique.

Signed-off-by: David S. Miller <davem <at> davemloft.net>
---
 include/net/ip_fib.h     |    6 +---
 net/ipv4/fib_frontend.c  |   15 ---------
 net/ipv4/fib_hash.c      |   72 --------------------------------------------
 net/ipv4/fib_semantics.c |   56 ++++++++++++++++++++++++++++++++++
 net/ipv4/fib_trie.c      |   74 ----------------------------------------------
 net/ipv4/route.c         |    2 +-
 6 files changed, 58 insertions(+), 167 deletions(-)

diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index f5199b0..819d61c 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
(Continue reading)

Sridhar Samudrala | 1 Feb 2011 02:30
Picon
Favicon

Re: Network performance with small packets

On Mon, 2011-01-31 at 18:24 -0600, Steve Dobbelstein wrote:
> "Michael S. Tsirkin" <mst <at> redhat.com> wrote on 01/28/2011 06:16:16 AM:
> 
> > OK, so thinking about it more, maybe the issue is this:
> > tx becomes full. We process one request and interrupt the guest,
> > then it adds one request and the queue is full again.
> >
> > Maybe the following will help it stabilize?
> > By itself it does nothing, but if you set
> > all the parameters to a huge value we will
> > only interrupt when we see an empty ring.
> > Which might be too much: pls try other values
> > in the middle: e.g. make bufs half the ring,
> > or bytes some small value, or packets some
> > small value etc.
> >
> > Warning: completely untested.
> >
> > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> > index aac05bc..6769cdc 100644
> > --- a/drivers/vhost/net.c
> > +++ b/drivers/vhost/net.c
> >  <at>  <at>  -32,6 +32,13  <at>  <at> 
> >   * Using this limit prevents one virtqueue from starving others. */
> >  #define VHOST_NET_WEIGHT 0x80000
> >
> > +int tx_bytes_coalesce = 0;
> > +module_param(tx_bytes_coalesce, int, 0644);
> > +int tx_bufs_coalesce = 0;
> > +module_param(tx_bufs_coalesce, int, 0644);
(Continue reading)

Michael Chan | 1 Feb 2011 01:39
Favicon

[PATCH net-next-2.6] bnx2x, cnic: Consolidate iSCSI/FCoE shared mem logic in bnx2x

From: Vladislav Zolotarov <vladz <at> broadcom.com>

Move all shared mem code to bnx2x to avoid code duplication.  bnx2x now
performs:

- Read the FCoE and iSCSI max connection information.
- Read the iSCSI and FCoE MACs from NPAR configuration in shmem.
- Block the CNIC for the current function if there is neither FCoE nor
  iSCSI valid configuration by returning NULL from bnx2x_cnic_probe().

Signed-off-by: Vladislav Zolotarov <vladz <at> broadcom.com>
Signed-off-by: Eilon Greenstein <eilong <at> broadcom.com>
Signed-off-by: Michael Chan <mchan <at> broadcom.com>
---
 drivers/net/bnx2.h             |    2 +
 drivers/net/bnx2x/bnx2x.h      |    5 +-
 drivers/net/bnx2x/bnx2x_hsi.h  |   25 +++++---
 drivers/net/bnx2x/bnx2x_main.c |  112 ++++++++++++++++++++++++++++----
 drivers/net/cnic.c             |  143 +++++-----------------------------------
 drivers/net/cnic_if.h          |    8 ++-
 6 files changed, 146 insertions(+), 149 deletions(-)

diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 0132ea9..7a5e88f 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
 <at>  <at>  -6207,6 +6207,8  <at>  <at>  struct l2_fhdr {

 #define BNX2_CP_SCRATCH					0x001a0000

(Continue reading)

Bill Sommerfeld | 1 Feb 2011 03:04
Picon
Favicon

Re: [PATCH] Make INET_LHTABLE_SIZE a compile-time tunable

On Mon, Jan 31, 2011 at 14:05, David Miller <davem <at> davemloft.net> wrote:
> From: Bill Sommerfeld <wsommerfeld <at> google.com>
>> I haven't seen any responses to this patch submission.  Can someone
>> take a look?  Thanks.
> It should be dynamically sized.  Compile time configuration knobs
> generally stick.

I'll work on that.  Consider this patch withdrawn until then.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane