From: Jiri Pirko <jiri@resnulli.us>
To: "Wilczynski, Michal" <michal.wilczynski@intel.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
davem@davemloft.net, edumazet@google.com, leon@kernel.org,
saeedm@nvidia.com, moshe@nvidia.com, jesse.brandeburg@intel.com,
anthony.l.nguyen@intel.com, tariqt@nvidia.com, idosch@nvidia.com,
petrm@nvidia.com, simon.horman@corigine.com,
ecree.xilinx@gmail.com, habetsm.xilinx@gmail.com,
jacob.e.keller@intel.com
Subject: Re: [patch net-next v2 02/15] ice: register devlink port for PF with ops
Date: Fri, 26 May 2023 13:35:16 +0200 [thread overview]
Message-ID: <ZHCZdD/m29yr5hfc@nanopsycho> (raw)
In-Reply-To: <4b8dcf1e-72df-48dc-b249-81d07323a632@intel.com>
Fri, May 26, 2023 at 12:52:21PM CEST, michal.wilczynski@intel.com wrote:
>
>
>On 5/26/2023 12:28 PM, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@nvidia.com>
>>
>> Use newly introduce devlink port registration function variant and
>> register devlink port passing ops.
>>
>> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
>> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
>> ---
>> drivers/net/ethernet/intel/ice/ice_devlink.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
>> index bc44cc220818..6661d12772a3 100644
>> --- a/drivers/net/ethernet/intel/ice/ice_devlink.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
>> @@ -1512,6 +1512,9 @@ ice_devlink_set_port_split_options(struct ice_pf *pf,
>> ice_active_port_option = active_idx;
>> }
>>
>> +static const struct devlink_port_ops ice_devlink_port_ops = {
>> +};
>
>I can see that you're doing this everywhere, but aren't those braces redundant ?
>This struct would be initialized to zero anyway.
Well, yeah, but 3 patches later, they are not going to be empty anymore.
>
>> +
>> /**
>> * ice_devlink_create_pf_port - Create a devlink port for this PF
>> * @pf: the PF to create a devlink port for
>> @@ -1551,7 +1554,8 @@ int ice_devlink_create_pf_port(struct ice_pf *pf)
>> devlink_port_attrs_set(devlink_port, &attrs);
>> devlink = priv_to_devlink(pf);
>>
>> - err = devlink_port_register(devlink, devlink_port, vsi->idx);
>> + err = devlink_port_register_with_ops(devlink, devlink_port, vsi->idx,
>> + &ice_devlink_port_ops);
>> if (err) {
>> dev_err(dev, "Failed to create devlink port for PF %d, error %d\n",
>> pf->hw.pf_id, err);
>
>Looks good to me,
>
>Reviewed-by: Michal Wilczynski <michal.wilczynski@intel.com>
>
>
next prev parent reply other threads:[~2023-05-26 11:35 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 10:28 [patch net-next v2 00/15] devlink: move port ops into separate structure Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 01/15] devlink: introduce port ops placeholder Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 02/15] ice: register devlink port for PF with ops Jiri Pirko
2023-05-26 10:52 ` Wilczynski, Michal
2023-05-26 11:35 ` Jiri Pirko [this message]
2023-05-26 10:28 ` [patch net-next v2 03/15] mlxsw_core: register devlink port " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 04/15] nfp: devlink: " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 05/15] devlink: move port_split/unsplit() ops into devlink_port_ops Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 06/15] mlx4: register devlink port with ops Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 07/15] devlink: move port_type_set() op into devlink_port_ops Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 08/15] sfc: register devlink port with ops Jiri Pirko
2023-05-30 8:02 ` Martin Habets
2023-05-26 10:28 ` [patch net-next v2 09/15] mlx5: register devlink ports " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 10/15] devlink: move port_fn_hw_addr_get/set() to devlink_port_ops Jiri Pirko
2023-05-30 8:03 ` Martin Habets
2023-05-26 10:28 ` [patch net-next v2 11/15] devlink: move port_fn_roce_get/set() " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 12/15] devlink: move port_fn_migratable_get/set() " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 13/15] devlink: move port_fn_state_get/set() " Jiri Pirko
2023-05-26 10:28 ` [patch net-next v2 14/15] devlink: move port_del() " Jiri Pirko
2023-05-27 4:10 ` Jakub Kicinski
2023-05-27 7:42 ` Jiri Pirko
2023-05-29 6:33 ` Jakub Kicinski
2023-05-29 8:31 ` Jiri Pirko
2023-05-30 1:41 ` Jakub Kicinski
2023-05-30 6:33 ` Jiri Pirko
2023-05-30 6:58 ` Jiri Pirko
2023-05-30 17:34 ` Jakub Kicinski
2023-05-31 6:33 ` Jiri Pirko
2023-06-01 22:16 ` Jacob Keller
2023-05-26 10:28 ` [patch net-next v2 15/15] devlink: save devlink_port_ops into a variable in devlink_port_function_validate() Jiri Pirko
2023-05-30 18:00 ` [patch net-next v2 00/15] devlink: move port ops into separate structure patchwork-bot+netdevbpf
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=ZHCZdD/m29yr5hfc@nanopsycho \
--to=jiri@resnulli.us \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=habetsm.xilinx@gmail.com \
--cc=idosch@nvidia.com \
--cc=jacob.e.keller@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=michal.wilczynski@intel.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=simon.horman@corigine.com \
--cc=tariqt@nvidia.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