[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e0dd21a0809080321p6b9e2bc7m73e2cdd57a8d58b8@mail.gmail.com>
Date: Mon, 8 Sep 2008 12:21:16 +0200
From: "Johann Baudy" <johaahn@...il.com>
To: "Evgeniy Polyakov" <johnpol@....mipt.ru>
Cc: netdev@...r.kernel.org
Subject: Re: Fwd: Packet mmap: TX RING and zero copy
Hi Evgeniy,
I've made a test with below patch (with and without UDP fragmentation):
without UDP fragmentation, packet size are almost always equal to
PAGE_SIZE due to my mtu limit (2*PACKET_SIZE > mtu).
with UDP fragmentation, kernel is sending multiple fragmented packets
of 61448Kbytes.
Unfortunately, in both case, bitrate is still 15-20 MB/s :(
According to wireshark, kernel sends 60KB over 9 packets, nothing
during ~5ms, 60KB and so on. strange ... kernel seems to spend its
time during push(). Is there a blocking call somewhere ?
Thanks in advance,
Johann
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -743,7 +743,28 @@ int udp_sendpage(struct sock *sk, struct page
*page, int offset,
size_t size, int flags)
{
struct udp_sock *up = udp_sk(sk);
+ struct inet_sock *inet = inet_sk(sk);
int ret;
+ int mtu = inet->cork.fragsize;
+ int fragheaderlen;
+ struct ip_options *opt = NULL;
+
+ if (inet->cork.flags & IPCORK_OPT)
+ opt = inet->cork.opt;
+
+ fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0);
+
+ // With UDP fragmentation
+ if (inet->cork.length + size >= 0xFFFF - fragheaderlen) {
+ // Without UDP fragmentation
+ // if( (inet->cork.length + size) > mtu) {
+ lock_sock(sk);
+ ret = udp_push_pending_frames(sk);
+ release_sock(sk);
+ if (ret) {
+ return 0;
+ }
+ }
--
Johann Baudy
johaahn@...il.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists