netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <therbert@google.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH v2] rfs: Receive Flow Steering
Date: Tue, 6 Apr 2010 07:25:56 -0700	[thread overview]
Message-ID: <v2n65634d661004060725paf401b5bg1ee692caef565d33@mail.gmail.com> (raw)
In-Reply-To: <1270559096.2081.35.camel@edumazet-laptop>

>
> Running on a preprod machine here, seems fine.
>
> Some questions :
>
> 1) The need to add "rps_flow_entries=xxx" at boot time is problematic.
>   Maybe we can allow it being dynamic (and use vmalloc() instead of
> alloc_large_system_hash())
>
Okay, could be a sysctl with vmalloc.

> 2) inet_rps_save_rxhash(sk, skb->rxhash);
>
>        It should have a check to make sure some part of the stack doesnt feed
> many different rxhash for a given socket (Make sure we dont pollute flow
> table with pseudo random values)
>
If packets for a connection are always received on the same device, is
it reasonable to assume the rxhash is constant for that connection?

I suppose it's possible that packets for a same sockets are being
constantly received on two different devices that are giving different
rxhashes.  This would already be bad in that OOO is probably happening
anyway.  I don't know if thrashing the sock_flow_table is going to
aggravate this scenario much.

Are there any other degenerative cases you're worried about?

> 3) UDP connected sockets dont benefit of RFS currently
>   (Not sure many apps use connected UDP sockets, I do have some of them
> in house)
>
Makes sense to support that.

> I am trying following code for IPV4 only :
>
> diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
> index 7af756d..5c2d37a 100644
> --- a/net/ipv4/udp.c
> +++ b/net/ipv4/udp.c
> @@ -1216,6 +1216,7 @@ int udp_disconnect(struct sock *sk, int flags)
>        sk->sk_state = TCP_CLOSE;
>        inet->inet_daddr = 0;
>        inet->inet_dport = 0;
> +       inet_rps_save_rxhash(sk, 0);
>        sk->sk_bound_dev_if = 0;
>        if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK))
>                inet_reset_saddr(sk);
> @@ -1257,8 +1258,12 @@ EXPORT_SYMBOL(udp_lib_unhash);
>
>  static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
>  {
> -       int rc = sock_queue_rcv_skb(sk, skb);
> +       int rc;
> +
> +       if (inet_sk(sk)->inet_daddr)
> +               inet_rps_save_rxhash(sk, skb->rxhash);
>
> +       rc = sock_queue_rcv_skb(sk, skb);
>        if (rc < 0) {
>                int is_udplite = IS_UDPLITE(sk);
>
>
>
>

  parent reply	other threads:[~2010-04-06 14:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06  5:56 [PATCH v2] rfs: Receive Flow Steering Tom Herbert
2010-04-06 13:04 ` Eric Dumazet
2010-04-06 13:42   ` Changli Gao
2010-04-06 14:25   ` Tom Herbert [this message]
2010-04-06 15:10     ` Eric Dumazet
2010-04-08  4:40 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v2n65634d661004060725paf401b5bg1ee692caef565d33@mail.gmail.com \
    --to=therbert@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).