From: David Miller <davem@davemloft.net>
To: jakub.kicinski@netronome.com
Cc: netdev@vger.kernel.org, kubakici@wp.pl, oss-drivers@netronome.com
Subject: Re: [PATCH net-next 05/13] nfp: introduce very minimal nfp_app
Date: Sun, 21 May 2017 13:23:28 -0400 (EDT) [thread overview]
Message-ID: <20170521.132328.352349689480345479.davem@davemloft.net> (raw)
In-Reply-To: <20170519220155.27857-6-jakub.kicinski@netronome.com>
From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Fri, 19 May 2017 15:01:47 -0700
> Introduce a concept of an application. For now it's just grouping
> pointers and serving as a layer of indirection. It will help us
> weaken the dependency on nfp_net in ethtool code. Later series
> will flesh out support for different apps in the driver.
>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Simon Horman <simon.horman@netronome.com>
...
> +struct nfp_cpp *nfp_app_cpp(struct nfp_app *app)
> +{
> + return app->cpp;
> +}
> +
> +struct nfp_pf *nfp_app_pf(struct nfp_app *app)
> +{
> + return app->pf;
> +}
Don't create real function calls just to dereference pointers
like this.
Instead, if you absolutely _must_ do stuff like this, put it into
inline functions in a header file so that there is no overhead.
But honestly I would just make the core dereference the struct members
directly in the code and do away with these helpers.
Thanks.
next prev parent reply other threads:[~2017-05-21 17:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 22:01 [PATCH net-next 00/13] nfp: introduce nfp_port and nfp_app Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 01/13] nfp: add nfp_cppcore_pcie_unit() helper Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 02/13] nfp: make nfp_net alloc/init/cleanup/free not depend on netdevs Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 03/13] nfp: rename netdev/port to vNIC Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 04/13] nfp: add nfp_net_pf_free_vnic() function Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 05/13] nfp: introduce very minimal nfp_app Jakub Kicinski
2017-05-21 17:23 ` David Miller [this message]
2017-05-19 22:01 ` [PATCH net-next 06/13] nfp: disallow mixing vNICs with and without NSP port entry Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 07/13] nfp: introduce nfp_port Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 08/13] nfp: update port state in place Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 09/13] nfp: move refresh tracking into the port structure Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 10/13] nfp: provide linking on port structures Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 11/13] nfp: mark port state as stale after reconfig Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 12/13] nfp: mark port state as stale if update failed Jakub Kicinski
2017-05-19 22:01 ` [PATCH net-next 13/13] nfp: refresh port state before reporting autonegotiation Jakub Kicinski
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=20170521.132328.352349689480345479.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=kubakici@wp.pl \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/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