[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <81D78EA7F834FA4C83B64260D494C859010828D6@AVMB1.qlogic.org>
Date: Sun, 19 Apr 2015 15:48:49 +0000
From: Ariel Elior <Ariel.Elior@...gic.com>
To: Gabriel Krisman Bertazi <krisman@...ux.vnet.ibm.com>
CC: netdev <netdev@...r.kernel.org>,
"cascardo@...ux.vnet.ibm.com" <cascardo@...ux.vnet.ibm.com>
Subject: RE: [PATCH] bnx2x: Alloc 4k fragment for each rx ring buffer element
Hi Gabriel,
Thanks for pointing out this shortcoming.
However, I don't think that the solution you suggested would work as is.
@@ -628,21 +644,30 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp,
bnx2x_fp_qstats(bp, fp)->rx_skb_alloc_failed++;
return err;
}
+ if (old_rx_pg.offset + old_rx_pg.len >= PAGE_SIZE) {
+ /* Unmap the page as we finished passing it to
+ * the stack
+ */
+ old_rx_pg.mapping = old_rx_pg.mapping -
+ old_rx_pg.offset;
+ dma_unmap_page(&bp->pdev->dev,
+ dma_unmap_addr(&old_rx_pg, mapping),
+ PAGE_SIZE, DMA_FROM_DEVICE);
+ }
This code assumes that pages are consumed by the device in order. This is not true.
The pages are consumed according to packet arrival order, which can be from different aggregations.
We'll come up with a compatible solution.
Thanks,
Ariel
--
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