[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140117094804.GB23276@1wt.eu>
Date: Fri, 17 Jan 2014 10:48:04 +0100
From: Willy Tarreau <w@....eu>
To: David Laight <David.Laight@...LAB.COM>
Cc: David Miller <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"thomas.petazzoni@...e-electrons.com"
<thomas.petazzoni@...e-electrons.com>,
"gregory.clement@...e-electrons.com"
<gregory.clement@...e-electrons.com>
Subject: Re: [PATCH 11/13] net: mvneta: implement rx_copybreak
On Fri, Jan 17, 2014 at 09:28:13AM +0000, David Laight wrote:
> From: Willy Tarreau
> ..
> > Ah that's an interesting trick! We don't have an IOMMU on this platform
> > so the call is cheap. However, it relies on an I/O barrier to wait for
> > a cache snoop completion. From what I read, it's not needed when going
> > to the device. But when going to the CPU for the Rx case, we're calling
> > it for every packet which is counter productive because I'd like to do
> > it only once when entering the rx loop and avoid any other call during
> > the loop. I measured that I could save 300 ns per packet by doing this
> > (thus slightly modifying the DMA API to add a new dma_io_barrier function).
> >
> > I think it could be interesting (at least for this platform, I don't know
> > if other platforms work with cache coherent DMA which only require to
> > verify end of snooping), to have two distinct set of DMA calls, something
> > like this :
> >
> > rx_loop(napi, budget)
> > {
> > dma_wait_for_snoop_completion(dev);
> > ...
> > for_each_rx_packet(pkt) {
> > dma_sync_single_range_for_cpu_unless_completed(dev, pkt->addr);
> > /* use packet */
> > }
> > }
>
> You'd need to scan the rx ring for completed entries before the waiting
> for the snoop to complete - and then only process those entries.
> (Or read a block of rx ring entries...)
>
> Otherwise you might try to process a rx that finished after you
> waited for the snoop to complete.
That's already the case, the number of descs to use is computed first
thing when entering the function. That's why it's already safe.
Willy
--
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