[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1335544386.2618.50.camel@bwh-desktop.uk.solarflarecom.com>
Date: Fri, 27 Apr 2012 17:33:06 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>,
Tom Herbert <therbert@...gle.com>,
Neal Cardwell <ncardwell@...gle.com>,
Matt Carlson <mcarlson@...adcom.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
Michael Chan <mchan@...adcom.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Maciej Żenczykowski <maze@...gle.com>
Subject: Re: [PATCH 2/4 net-next] tg3: provide frags as skb head
On Fri, 2012-04-27 at 12:34 +0200, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> This patch converts tg3 driver, one of our reference drivers, to use new
> build_skb() api in frag mode.
>
> Instead of using kmalloc() to allocate the memory block that will be
> used by build_skb() as skb->head, we use a page fragment.
>
> This is a followup of patch "net: allow skb->head to be a page fragment"
>
> This allows GRO, TCP coalescing, and splice() to be more efficient.
>
> Incidentally, this also removes SLUB slow path contention in kfree()
[...]
> @@ -5617,17 +5626,48 @@ static void tg3_tx(struct tg3_napi *tnapi)
> }
> }
>
> +static void *tg3_frag_alloc(struct tg3_rx_prodring_set *tpr)
> +{
> + void *data;
> +
> + if (tpr->rx_page_size < TG3_FRAGSIZE) {
> + struct page *page = alloc_page(GFP_ATOMIC);
> +
> + if (!page)
> + return NULL;
> + atomic_add((PAGE_SIZE / TG3_FRAGSIZE) - 1, &page->_count);
> + tpr->rx_page_addr = page_address(page);
[...]
page_address() may return NULL if CONFIG_HIGHMEM is enabled. And that's
going to be a general problem with this scheme on 32-bit machines.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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