mbox series

[net-next,v2,0/5] net: use ICW for sk_proto->{send,recv}msg

Message ID cover.1562162469.git.pabeni@redhat.com
Headers show
Series net: use ICW for sk_proto->{send,recv}msg | expand

Message

Paolo Abeni July 3, 2019, 2:06 p.m. UTC
This series extends ICW usage to one of the few remaining spots in fast-path
still hitting per packet retpoline overhead, namely the sk_proto->{send,recv}msg
calls.

The first 3 patches in this series refactor the existing code so that applying
the ICW macros is straight-forward: we demux inet_{recv,send}msg in ipv4 and
ipv6 variants so that each of them can easily select the appropriate TCP or UDP
direct call. While at it, a new helper is created to avoid excessive code
duplication, and the current ICWs for inet_{recv,send}msg are adjusted
accordingly.

The last 2 patches really introduce the new ICW use-case, respectively for the
ipv6 and the ipv4 code path.

This gives up to 5% performance improvement under UDP flood, and smaller but
measurable gains for TCP RR workloads.

v1 -> v2:
 - drop inet6_{recv,send}msg declaration from header file,
   prefer ICW macro instead
 - avoid unneeded reclaration for udp_sendmsg, as suggested by Willem

Paolo Abeni (5):
  inet: factor out inet_send_prepare()
  ipv6: provide and use ipv6 specific version for {recv,send}msg
  net: adjust socket level ICW to cope with ipv6 variant of
    {recv,send}msg
  ipv6: use indirect call wrappers for {tcp,udpv6}_{recv,send}msg()
  ipv4: use indirect call wrappers for {tcp,udp}_{recv,send}msg()

 include/net/inet_common.h |  1 +
 net/ipv4/af_inet.c        | 31 ++++++++++++++++++-----------
 net/ipv6/af_inet6.c       | 41 +++++++++++++++++++++++++++++++++++----
 net/socket.c              | 23 +++++++++++-----------
 4 files changed, 69 insertions(+), 27 deletions(-)

Comments

Willem de Bruijn July 3, 2019, 2:45 p.m. UTC | #1
On Wed, Jul 3, 2019 at 10:07 AM Paolo Abeni <pabeni@redhat.com> wrote:
>
> This series extends ICW usage to one of the few remaining spots in fast-path
> still hitting per packet retpoline overhead, namely the sk_proto->{send,recv}msg
> calls.
>
> The first 3 patches in this series refactor the existing code so that applying
> the ICW macros is straight-forward: we demux inet_{recv,send}msg in ipv4 and
> ipv6 variants so that each of them can easily select the appropriate TCP or UDP
> direct call. While at it, a new helper is created to avoid excessive code
> duplication, and the current ICWs for inet_{recv,send}msg are adjusted
> accordingly.
>
> The last 2 patches really introduce the new ICW use-case, respectively for the
> ipv6 and the ipv4 code path.
>
> This gives up to 5% performance improvement under UDP flood, and smaller but
> measurable gains for TCP RR workloads.
>
> v1 -> v2:
>  - drop inet6_{recv,send}msg declaration from header file,
>    prefer ICW macro instead
>  - avoid unneeded reclaration for udp_sendmsg, as suggested by Willem
>
> Paolo Abeni (5):
>   inet: factor out inet_send_prepare()
>   ipv6: provide and use ipv6 specific version for {recv,send}msg
>   net: adjust socket level ICW to cope with ipv6 variant of
>     {recv,send}msg
>   ipv6: use indirect call wrappers for {tcp,udpv6}_{recv,send}msg()
>   ipv4: use indirect call wrappers for {tcp,udp}_{recv,send}msg()

Acked-by: Willem de Bruijn <willemb@google.com>
David Miller July 3, 2019, 8:52 p.m. UTC | #2
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Wed, 3 Jul 2019 10:45:13 -0400

> On Wed, Jul 3, 2019 at 10:07 AM Paolo Abeni <pabeni@redhat.com> wrote:
>>
>> This series extends ICW usage to one of the few remaining spots in fast-path
>> still hitting per packet retpoline overhead, namely the sk_proto->{send,recv}msg
>> calls.
>>
>> The first 3 patches in this series refactor the existing code so that applying
>> the ICW macros is straight-forward: we demux inet_{recv,send}msg in ipv4 and
>> ipv6 variants so that each of them can easily select the appropriate TCP or UDP
>> direct call. While at it, a new helper is created to avoid excessive code
>> duplication, and the current ICWs for inet_{recv,send}msg are adjusted
>> accordingly.
>>
>> The last 2 patches really introduce the new ICW use-case, respectively for the
>> ipv6 and the ipv4 code path.
>>
>> This gives up to 5% performance improvement under UDP flood, and smaller but
>> measurable gains for TCP RR workloads.
>>
>> v1 -> v2:
>>  - drop inet6_{recv,send}msg declaration from header file,
>>    prefer ICW macro instead
>>  - avoid unneeded reclaration for udp_sendmsg, as suggested by Willem
>>
>> Paolo Abeni (5):
>>   inet: factor out inet_send_prepare()
>>   ipv6: provide and use ipv6 specific version for {recv,send}msg
>>   net: adjust socket level ICW to cope with ipv6 variant of
>>     {recv,send}msg
>>   ipv6: use indirect call wrappers for {tcp,udpv6}_{recv,send}msg()
>>   ipv4: use indirect call wrappers for {tcp,udp}_{recv,send}msg()
> 
> Acked-by: Willem de Bruijn <willemb@google.com>

Series applied, thanks.