From: brouer@redhat.com (Jesper Dangaard Brouer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 net-next 08/10] net: mvneta: bm: add support for hardware buffer management
Date: Mon, 14 Mar 2016 10:57:14 +0100 [thread overview]
Message-ID: <20160314105714.1e97b4c1@redhat.com> (raw)
In-Reply-To: <1457944745-7634-9-git-send-email-gregory.clement@free-electrons.com>
On Mon, 14 Mar 2016 09:39:03 +0100 Gregory CLEMENT <gregory.clement@free-electrons.com> wrote:
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: brouer@redhat.com, "David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Lior Amsalem <alior@marvell.com>,
Nadav Haklai <nadavh@marvell.com>,
Marcin Wojtas <mw@semihalf.com>,
Simon Guinot <simon.guinot@sequanux.org>,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Willy Tarreau <w@1wt.eu>, Timor Kardashov <timork@marvell.com>,
Dmitri Epshtein <dima@marvell.com>,
Sebastian Careba <nitroshift@yahoo.com>
Subject: Re: [PATCH v6 net-next 08/10] net: mvneta: bm: add support for hardware buffer management
Date: Mon, 14 Mar 2016 10:57:14 +0100 [thread overview]
Message-ID: <20160314105714.1e97b4c1@redhat.com> (raw)
In-Reply-To: <1457944745-7634-9-git-send-email-gregory.clement@free-electrons.com>
On Mon, 14 Mar 2016 09:39:03 +0100 Gregory CLEMENT <gregory.clement@free-electrons.com> wrote:
> 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
next prev parent reply other threads:[~2016-03-14 9:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 8:38 [PATCH v6 net-next 00/10] API set for HW Buffer management Gregory CLEMENT
2016-03-14 8:38 ` Gregory CLEMENT
2016-03-14 8:38 ` [PATCH v6 net-next 01/10] misc: sram: add optional ioremap without write combining Gregory CLEMENT
2016-03-14 8:38 ` Gregory CLEMENT
2016-03-14 8:44 ` Gregory CLEMENT
2016-03-14 8:44 ` Gregory CLEMENT
2016-03-14 8:38 ` [PATCH v6 net-next 02/10] ARM: dts: armada-38x: add buffer manager nodes Gregory CLEMENT
2016-03-14 8:38 ` Gregory CLEMENT
2016-03-14 8:38 ` [PATCH v6 net-next 03/10] ARM: dts: armada-38x: enable buffer manager support on Armada 38x boards Gregory CLEMENT
2016-03-14 8:38 ` Gregory CLEMENT
2016-03-14 8:38 ` Gregory CLEMENT
2016-03-14 8:38 ` [PATCH v6 net-next 04/10] ARM: dts: armada-xp: add buffer manager nodes Gregory CLEMENT
2016-03-14 8:38 ` Gregory CLEMENT
2016-03-14 8:38 ` Gregory CLEMENT
2016-03-14 8:39 ` [PATCH v6 net-next 05/10] ARM: dts: armada-xp: enable buffer manager support on Armada XP boards Gregory CLEMENT
2016-03-14 8:39 ` Gregory CLEMENT
2016-03-14 8:39 ` [PATCH v6 net-next 06/10] ARM: dts: armada-xp-openblocks-ax3-4: Add BM support Gregory CLEMENT
2016-03-14 8:39 ` Gregory CLEMENT
2016-03-14 8:39 ` [PATCH v6 net-next 07/10] bus: mvebu-mbus: provide api for obtaining IO and DRAM window information Gregory CLEMENT
2016-03-14 8:39 ` Gregory CLEMENT
2016-03-14 8:39 ` [PATCH v6 net-next 08/10] net: mvneta: bm: add support for hardware buffer management Gregory CLEMENT
2016-03-14 8:39 ` Gregory CLEMENT
2016-03-14 9:57 ` Jesper Dangaard Brouer [this message]
2016-03-14 9:57 ` Jesper Dangaard Brouer
2016-03-14 8:39 ` [PATCH v6 net-next 09/10] net: add a hardware buffer management helper API Gregory CLEMENT
2016-03-14 8:39 ` Gregory CLEMENT
2016-03-14 10:33 ` Jesper Dangaard Brouer
2016-03-14 10:33 ` Jesper Dangaard Brouer
2016-03-14 8:39 ` [PATCH v6 net-next 10/10] net: mvneta: Use the new hwbm framework Gregory CLEMENT
2016-03-14 8:39 ` Gregory CLEMENT
2016-03-14 16:21 ` [PATCH v6 net-next 00/10] API set for HW Buffer management David Miller
2016-03-14 16:21 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160314105714.1e97b4c1@redhat.com \
--to=brouer@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.