[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0904211640280.31780@qirst.com>
Date: Tue, 21 Apr 2009 16:42:28 -0400 (EDT)
From: Christoph Lameter <cl@...ux.com>
To: Johann Baudy <johann.baudy@...-log.net>
cc: netdev@...r.kernel.org
Subject: Re: [PATCH] TX_RING and packet mmap
On Tue, 21 Apr 2009, Johann Baudy wrote:
> > Also can you ensure that send() continues to send if I concurrently set
> > the status to TP_STATUS_SEND_REQUEST from another thread? How it is
> > serialized anyways? Status is an atomic value? Or do you rely on status
> > only being modified while send() is running?
>
> TP_STATUS_KERNEL => TP_STATUS_SEND_REQUEST: only performed by user.
> TP_STATUS_SEND_REQUEST => TP_STATUS_SENDING only performed by kernel
> TP_STATUS_SENDING => TP_STATUS_KERNEL only performed by kernel.
>
> Only one thread is allowed to change status values from user space.
Duh. So I cannot concurrently operate with multiple threads on the
structure.
The kernel synchronizes with itself via the socket?
> This way, you can take advantage of smp. One thread is filling the
> buffer changing status from TP_STATUS_KERNEL to
> TP_STATUS_SEND_REQUEST , another is calling send() in loop
> (MSG_DONTBLOCK option can be used).
Ah ok.
--
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