netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/2] Unify IPv6 sendmsg codepaths.
@ 2014-05-02 19:11 Lorenzo Colitti
  2014-05-02 19:11 ` [PATCH v6 1/2] net: ipv6: Unduplicate UDP, raw, and L2TP sendmsg Lorenzo Colitti
  2014-05-02 19:11 ` [PATCH v6 2/2] net: ipv6: Use ip6_datagram_send_common in ping Lorenzo Colitti
  0 siblings, 2 replies; 5+ messages in thread
From: Lorenzo Colitti @ 2014-05-02 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, hannes, yoshifuji, david.laight, eric.dumazet,
	Lorenzo Colitti

Ok, here's another attempt at reducing code duplication between
the IPv6 UDP/raw/L2TP/ping sendmsg codepaths. I took Hannes's
suggestion and created an ip6_output_opts structure which groups
together parameters that go to ip6_append data (and which can
be written to directly by ip6_datagram_send_ctl).

Does this look better now?


Since there was a concern that the previous patch might impact
UDP sendmsg performance, I ran a couple of benchmarks on this
version and the results suggest that impact is in the noise.
x86_64 improved by 1-2%, but ARM got 1% worse. I suspect that
this what this means is that any optimization made to this code
is irrelevant compared to the overhead of context switches,
system call setup, copying from userspace, etc.

Specifically, I tested sending UDP on loobpack with:

  netperf -6 -H ::1 -t UDP_STREAM -- -m <size>

and counted the number of packets sent in 10 seconds, 5 times,
for UDP payload sizes of 1 byte (the minimum) and 1452. Results:

x86_64 workstation, 1-byte UDP payload: +1.1%

- Before:
  - Run #1: 2717005 2707060 2652702 2695698 2703355
  - Run #2: 2711797 2692290 2699832 2705740 2698174
- After:
  - Run #1: 2726430 2725619 2704406 2672582 2730418
  - Run #2: 2777486 2740683 2732652 2707956 2772541

x86_64 workstation, 1452-byte UDP payload: +1.8%

- Before: 2577335 2514953 2572881 2571107 2571355
- After:  2620455 2609399 2635285 2610107 2568943

Nexus 5 phone, 1-byte UDP payload (backport to kernel 3.4): -1.0%

- Before: 213955 216284 217529 217785 216854
- After:  221096 216049 216426 203414 213897


Lorenzo Colitti (2):
  net: ipv6: Unduplicate UDP, raw, and L2TP sendmsg
  net: ipv6: Use ip6_datagram_send_common in ping.

 include/net/ipv6.h       |  33 ++++++++++-
 include/net/transp_v6.h  |   7 ++-
 net/ipv6/datagram.c      | 145 +++++++++++++++++++++++++++++++++++++++++++++--
 net/ipv6/icmp.c          |  27 +++++----
 net/ipv6/ip6_flowlabel.c |   6 +-
 net/ipv6/ip6_output.c    |  11 ++--
 net/ipv6/ipv6_sockglue.c |   7 ++-
 net/ipv6/ping.c          |  90 ++++++++++-------------------
 net/ipv6/raw.c           | 101 ++-------------------------------
 net/ipv6/udp.c           | 122 ++++-----------------------------------
 net/l2tp/l2tp_ip6.c      | 108 +++--------------------------------
 11 files changed, 255 insertions(+), 402 deletions(-)

-- 
1.9.1.423.g4596e3a

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

end of thread, other threads:[~2014-05-05 17:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-02 19:11 [PATCH v6 0/2] Unify IPv6 sendmsg codepaths Lorenzo Colitti
2014-05-02 19:11 ` [PATCH v6 1/2] net: ipv6: Unduplicate UDP, raw, and L2TP sendmsg Lorenzo Colitti
2014-05-05 11:15   ` Hannes Frederic Sowa
2014-05-05 17:41     ` David Miller
2014-05-02 19:11 ` [PATCH v6 2/2] net: ipv6: Use ip6_datagram_send_common in ping Lorenzo Colitti

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).