[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <loom.20130515T165501-421@post.gmane.org>
Date: Wed, 15 May 2013 14:58:06 +0000 (UTC)
From: Ricardo TubĂo <rtpardavila@...il.com>
To: netdev@...r.kernel.org
Subject: Re: Single socket with TX_RING and RX_RING
Daniel Borkmann <dborkman <at> redhat.com> writes:
>
> No, just as a side note, I think here you rather wanted to say ...
>
> setsockopt(socket, SOL_PACKET, PACKET_RX_RING, ...);
> setsockopt(socket, SOL_PACKET, PACKET_TX_RING, ...);
>
> ... and then only once:
>
> ring = mmap(NULL, ..., socket, 0);
>
> > I haven't tried it out yet, and currently also do not really have time
to. But
> > looking at the mmap code, it seems that the size of the mmap area is
accumulated
> > for rx and tx ring. However, the header status bits are not really
interoperable
> > with each other. So looks you will need to have two sockets ...
>
I have already tried that and, if I use the same socket_fd twice with
setsockopt(), I get the EBUSY errno from Kernel. Tomorrow, I will try the
first solution with both sockets (it seems the easiest way); afterwards, I
will try to use the TX_RING socket for TX and for RX at a time.
I will come back with the results.
--
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