Thread (14 messages) flat view 14 messages, 3 authors, 2016-03-14

[PATCH v6 net-next 08/10] net: mvneta: bm: add support for hardware buffer management

From: Jesper Dangaard Brouer <hidden>
Date: 2016-03-14 09:57:34
Also in: lkml, netdev

On Mon, 14 Mar 2016 09:39:03 +0100 Gregory CLEMENT [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index b0ae69f84493..2847c0c291de 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
[...]
-static void *mvneta_frag_alloc(const struct mvneta_port *pp)
+void *mvneta_frag_alloc(unsigned int frag_size)
 {
-	if (likely(pp->frag_size <= PAGE_SIZE))
-		return netdev_alloc_frag(pp->frag_size);
+	if (likely(frag_size <= PAGE_SIZE))
+		return netdev_alloc_frag(frag_size);
(I know you are modifying existing code here.)

Be aware that there is a significant performance advantage of using
napi_alloc_frag() over netdev_alloc_frag().  You obviously can only use
the NAPI call, if you indeed are running in NAPI/BH context.
 	else
-		return kmalloc(pp->frag_size, GFP_ATOMIC);
+		return kmalloc(frag_size, GFP_ATOMIC);
 }
+EXPORT_SYMBOL_GPL(mvneta_frag_alloc);
  


-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help