Re: [PATCH] rfs: Receive Flow Steering

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Changli Gao
Date: Thursday, April 1, 2010 - 10:04 pm

On Fri, Apr 2, 2010 at 11:59 AM, Tom Herbert <therbert@google.com> wrote:

for sending packets, how about letting sender compute the rxhash of
the packets from the other side if the rxhash of socket hasn't been
set yet. I is better for client applications.

For router and bridge, the current RPS can work well, but not for
server or client applications. So I propose a new socket option to get
the rps cpu of the packets received on a socket. It may be like this:

int cpu;
getsockopt(sock, SOL_SOCKET, SO_RPSCPU, &cpu, sizeof(cpu));

As Tom's patch did, rxhash is recorded in socket. When the call above
is made, rps_map is looked up to find the RPSCPU for that hash. Once
we get the cpu of the current connection, for a TCP server, it can
dispatch the new connection to the processes which run on that CPU.
the server code will be like this:

fd = accpet(fd, NULL, NULL);
getsockopt(fd, SOL_SOCKET, SO_RPSCPU, &cpu, sizeof(cpu));
asyncq_enqueue(work_queue[cpu], fd);

For a client program, the rxhash can be got after the first packet of
the connection is sent. So the client code will be:

fd = connect(fd, &addr, addr_len);
getsockopt(fd, SOL_SOCKET, SO_RPSCPU, &cpu, sizeof(cpu));
asyncq_enqueue(work_queue[cpu], fd);

I do think this idea is easier to understood. I'll cook a patch later
if it is welcomed.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] rfs: Receive Flow Steering, Tom Herbert, (Thu Apr 1, 8:59 pm)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Thu Apr 1, 10:04 pm)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 12:29 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 12:58 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 1:35 am)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Fri Apr 2, 3:58 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 5:01 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 5:37 am)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Fri Apr 2, 6:45 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 9:28 am)
Re: [PATCH] rfs: Receive Flow Steering, Rick Jones, (Fri Apr 2, 10:01 am)
Re: [PATCH] rfs: Receive Flow Steering, Rick Jones, (Fri Apr 2, 11:25 am)
Re: [PATCH] rfs: Receive Flow Steering, Eric Dumazet, (Fri Apr 2, 12:43 pm)
Re: [PATCH] rfs: Receive Flow Steering, Changli Gao, (Wed Apr 7, 6:37 pm)