]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Attempt to add busy_poll support for mmap RX
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 12 Jan 2014 23:17:52 +0000 (00:17 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 12 Jan 2014 23:17:52 +0000 (00:17 +0100)
This is not supported by PF_PACKET sockets so there is no change in
performance.

ugw/ugw.c

index 9458e7d22a3e83d42dfdcb3d32d68a05e9e2a889..482f4e1c143443c6ccfdce2b5f6b443808aa6046 100644 (file)
--- a/ugw/ugw.c
+++ b/ugw/ugw.c
@@ -137,6 +137,11 @@ void init_packet_rx(struct in_ctx *ctx)
 
        s = CHECK(socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)));
 
+       if (busy_poll_us) {
+               CHECK(setsockopt(s, SOL_SOCKET, SO_BUSY_POLL,
+                                &busy_poll_us, sizeof(busy_poll_us)));
+       }
+
        int val = TPACKET_V2;
        CHECK(setsockopt(s, SOL_PACKET, PACKET_VERSION, &val, sizeof(val)));
        socklen_t len = sizeof(ctx->hdrlen);