From: "Ricardo Tubío" <rtpardavila@gmail.com>
To: netdev@vger.kernel.org
Subject: Re: Single socket with TX_RING and RX_RING
Date: Wed, 15 May 2013 14:58:06 +0000 (UTC) [thread overview]
Message-ID: <loom.20130515T165501-421@post.gmane.org> (raw)
In-Reply-To: 5193A128.8030204@redhat.com
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.
next prev parent reply other threads:[~2013-05-15 14:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 12:53 Single socket with TX_RING and RX_RING Ricardo Tubío
2013-05-15 13:20 ` Daniel Borkmann
2013-05-15 13:32 ` Ricardo Tubío
2013-05-15 14:47 ` Daniel Borkmann
2013-05-15 14:52 ` Daniel Borkmann
2013-05-15 14:58 ` Ricardo Tubío [this message]
2013-05-15 15:04 ` Daniel Borkmann
2013-05-20 20:50 ` Paul Chavent
2013-05-15 22:44 ` Phil Sutter
2013-05-16 9:18 ` Ricardo Tubío
2013-05-16 10:45 ` Phil Sutter
2013-05-16 11:01 ` Ricardo Tubío
2013-05-16 11:14 ` Daniel Borkmann
2013-05-16 11:52 ` Phil Sutter
2013-05-20 20:54 ` Paul Chavent
2013-05-22 19:36 ` Ricardo Tubío
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20130515T165501-421@post.gmane.org \
--to=rtpardavila@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.