netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, mlxsw@mellanox.com,
	idosch@mellanox.com, f.fainelli@gmail.com, andrew@lunn.ch,
	vivien.didelot@gmail.com
Subject: Re: [patch net-next v2 11/15] nfp: move devlink port type set after netdev registration
Date: Sat, 23 Mar 2019 23:47:50 +0100	[thread overview]
Message-ID: <20190323224750.GC2327@nanopsycho> (raw)
In-Reply-To: <20190323133102.60fceb6e@cakuba.netronome.com>

Sat, Mar 23, 2019 at 09:31:02PM CET, jakub.kicinski@netronome.com wrote:
>On Fri, 22 Mar 2019 17:56:32 +0100, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>> 
>> Similar to other driver, move the port type set after netdev registration
>> is done. Along with that, clear the type before unregistration.
>> 
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
>> index e9eca99cf493..cb59a18ec6a6 100644
>> --- a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
>> +++ b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
>> @@ -362,7 +362,6 @@ int nfp_devlink_port_register(struct nfp_app *app, struct nfp_port *port)
>>  	if (ret)
>>  		return ret;
>>  
>> -	devlink_port_type_eth_set(&port->dl_port, port->netdev);
>>  	devlink_port_attrs_set(&port->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
>>  			       eth_port.label_port, eth_port.is_split,
>>  			       eth_port.label_subport);
>> @@ -377,6 +376,16 @@ void nfp_devlink_port_unregister(struct nfp_port *port)
>>  	devlink_port_unregister(&port->dl_port);
>>  }
>>  
>> +void nfp_devlink_port_type_eth_set(struct nfp_port *port)
>> +{
>> +	devlink_port_type_eth_set(&port->dl_port, port->netdev);
>> +}
>> +
>> +void nfp_devlink_port_type_clear(struct nfp_port *port)
>> +{
>> +	devlink_port_type_clear(&port->dl_port);
>> +}
>> +
>>  struct devlink *nfp_devlink_get_devlink(struct net_device *netdev)
>>  {
>>  	struct nfp_app *app;
>> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
>> index 08f5fdbd8e41..e29744f2af02 100644
>> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
>> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
>> @@ -169,6 +169,8 @@ nfp_net_pf_init_vnic(struct nfp_pf *pf, struct nfp_net *nn, unsigned int id)
>>  		if (err)
>>  			goto err_devlink_port_clean;
>>  	}
>> +	if (nn->port)
>> +		nfp_devlink_port_type_eth_set(nn->port);
>>  
>>  	return 0;
>>  
>> @@ -218,6 +220,8 @@ nfp_net_pf_alloc_vnics(struct nfp_pf *pf, void __iomem *ctrl_bar,
>>  
>>  static void nfp_net_pf_clean_vnic(struct nfp_pf *pf, struct nfp_net *nn)
>>  {
>> +	if (nn->port)
>> +		nfp_devlink_port_type_clear(nn->port);
>>  	if (nfp_net_is_data_vnic(nn))
>>  		nfp_app_vnic_clean(pf->app, nn);
>
>Sorry for not noticing right away, I thought you just split my patch in
>two, but it seems you reordered the app_vnic_init/clean calls with the

I did the patch from scratch.


>type setting.  I'd rather those calls happened on fully initialized
>netdev (and port), could you perhaps just take this patch into the

I don't get it, you are commenting cleanup part. On init, the type set
happens on fully initialized devlink_port and netdev.


>series:
>
>https://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux.git/commit/?h=devlink-pci-ports&id=1debfdef5aef369412e72f370d11120d309a6a74
>
>>  	if (nn->port)

  reply	other threads:[~2019-03-23 22:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 16:56 [patch net-next v2 00/15] devlink: small spring cleanup Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 01/15] net: devlink: add couple of missing mutex_destroy() calls Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 02/15] bnxt: add missing net/devlink.h include Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 03/15] dsa: " Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 04/15] bnxt: set devlink port attrs properly Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 05/15] bnxt: call devlink_port_type_eth_set() before port register Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 06/15] net: devlink: don't take devlink_mutex for devlink_compat_* Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 07/15] net: devlink: don't pass return value of __devlink_port_type_set() Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 08/15] mlxsw: Move devlink_port_attrs_set() call before register Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 09/15] dsa: move " Jiri Pirko
2019-03-22 20:47   ` Andrew Lunn
2019-03-22 16:56 ` [patch net-next v2 10/15] net: devlink: disallow port_attrs_set() to be called " Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 11/15] nfp: move devlink port type set after netdev registration Jiri Pirko
2019-03-23 20:31   ` Jakub Kicinski
2019-03-23 22:47     ` Jiri Pirko [this message]
2019-03-24  3:04       ` Jakub Kicinski
2019-03-24  8:01         ` Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 12/15] bnxt: set devlink port type after registration Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 13/15] net: devlink: warn on setting type on unregistered port Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 14/15] net: devlink: add port type spinlock Jiri Pirko
2019-03-22 16:56 ` [patch net-next v2 15/15] net: devlink: select NET_DEVLINK from drivers Jiri Pirko

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=20190323224750.GC2327@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).