[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D45EA2B@AcuExch.aculab.com>
Date: Fri, 17 Jan 2014 09:28:13 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Willy Tarreau' <w@....eu>, David Miller <davem@...emloft.net>
CC: "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
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.
David
--
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