From: David Miller <davem@davemloft.net>
To: gregory.clement@free-electrons.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
thomas.petazzoni@free-electrons.com, f.fainelli@gmail.com,
jason@lakedaemon.net, andrew@lunn.ch,
sebastian.hesselbarth@gmail.com,
linux-arm-kernel@lists.infradead.org, alior@marvell.com,
nadavh@marvell.com, mw@semihalf.com, simon.guinot@sequanux.org,
linux@arm.linux.org.uk, w@1wt.eu, timork@marvell.com,
nitroshift@yahoo.com
Subject: Re: [PATCH v2 net-next 6/8] net: mvneta: bm: add support for hardware buffer management
Date: Wed, 17 Feb 2016 23:43:21 -0500 (EST) [thread overview]
Message-ID: <20160217.234321.1202099534402079240.davem@davemloft.net> (raw)
In-Reply-To: <1455636823-14470-7-git-send-email-gregory.clement@free-electrons.com>
From: Gregory CLEMENT <gregory.clement@free-electrons.com>
Date: Tue, 16 Feb 2016 16:33:41 +0100
> pp->dev = dev;
> SET_NETDEV_DEV(dev, &pdev->dev);
>
> + dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
> + dev->hw_features |= dev->features;
> + dev->vlan_features |= dev->features;
> + dev->priv_flags |= IFF_UNICAST_FLT;
> + dev->gso_max_segs = MVNETA_MAX_TSO_SEGS;
> +
> + err = register_netdev(dev);
> + if (err < 0) {
> + dev_err(&pdev->dev, "failed to register\n");
> + goto err_free_stats;
> + }
> +
> + pp->id = dev->ifindex;
> +
> + /* Obtain access to BM resources if enabled and already initialized */
> + bm_node = of_parse_phandle(dn, "buffer-manager", 0);
> + if (bm_node && bm_node->data) {
This set of changes has a lot of problems.
First, the exact moment you call register_netdev() your device must be
fully initialized because ->open() can be invoked immediately. This
means you must take care of all of this buffer manager stuff before
calling register_netdev().
It must precisely be the last thing you invoke in your probe function
for this reason.
Also you are now adding conditionalized code to every fastpath in your
driver, that is rediculous and is going to hurt performance.
Add seperate code paths for the HWBM vs SWBM, and register a unique
set of netdev_ops as appropriate.
next prev parent reply other threads:[~2016-02-18 4:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 15:33 [PATCH v2 net-next 0/8] API set for HW Buffer management Gregory CLEMENT
2016-02-16 15:33 ` [PATCH v2 1/8] ARM: dts: armada-38x: add buffer manager nodes Gregory CLEMENT
2016-02-16 15:33 ` [PATCH v2 2/8] ARM: dts: armada-38x: enable buffer manager support on Armada 38x boards Gregory CLEMENT
2016-02-16 15:33 ` [PATCH v2 3/8] ARM: dts: armada-xp: add buffer manager nodes Gregory CLEMENT
2016-02-16 15:33 ` [PATCH v2 4/8] ARM: dts: armada-xp: enable buffer manager support on Armada XP boards Gregory CLEMENT
2016-02-16 15:33 ` [PATCH v2 net-next 5/8] bus: mvebu-mbus: provide api for obtaining IO and DRAM window information Gregory CLEMENT
2016-02-16 15:33 ` [PATCH v2 net-next 6/8] net: mvneta: bm: add support for hardware buffer management Gregory CLEMENT
2016-02-18 4:43 ` David Miller [this message]
2016-02-18 11:41 ` Marcin Wojtas
2016-02-16 15:33 ` [PATCH v2 net-next 7/8] net: add a hardware buffer management helper API Gregory CLEMENT
2016-02-16 15:33 ` [PATCH v2 net-next 8/8] net: mvneta: Use the new hwbm framework Gregory CLEMENT
2016-02-17 22:59 ` [PATCH v2 net-next 0/8] API set for HW Buffer management Willy Tarreau
2016-02-18 17:32 ` Gregory CLEMENT
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=20160217.234321.1202099534402079240.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alior@marvell.com \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=nitroshift@yahoo.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=simon.guinot@sequanux.org \
--cc=thomas.petazzoni@free-electrons.com \
--cc=timork@marvell.com \
--cc=w@1wt.eu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).