devlink: Replace devlink_port_attrs_set parameters with a struct
Currently, devlink_port_attrs_set accepts a long list of parameters, that most of them are devlink port's attributes. Use the devlink_port_attrs struct to replace the relevant parameters. Signed-off-by: Danielle Ratson <danieller@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
46737a1949
commit
71ad8d55f8
@@ -353,6 +353,7 @@ const struct devlink_ops nfp_devlink_ops = {
|
||||
|
||||
int nfp_devlink_port_register(struct nfp_app *app, struct nfp_port *port)
|
||||
{
|
||||
struct devlink_port_attrs attrs = {};
|
||||
struct nfp_eth_table_port eth_port;
|
||||
struct devlink *devlink;
|
||||
const u8 *serial;
|
||||
@@ -365,10 +366,14 @@ int nfp_devlink_port_register(struct nfp_app *app, struct nfp_port *port)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
attrs.split = eth_port.is_split;
|
||||
attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
|
||||
attrs.phys.port_number = eth_port.label_port;
|
||||
attrs.phys.split_subport_number = eth_port.label_subport;
|
||||
serial_len = nfp_cpp_serial(port->app->cpp, &serial);
|
||||
devlink_port_attrs_set(&port->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
|
||||
eth_port.label_port, eth_port.is_split,
|
||||
eth_port.label_subport, serial, serial_len);
|
||||
memcpy(attrs.switch_id.id, serial, serial_len);
|
||||
attrs.switch_id.id_len = serial_len;
|
||||
devlink_port_attrs_set(&port->dl_port, &attrs);
|
||||
|
||||
devlink = priv_to_devlink(app->pf);
|
||||
|
||||
|
Reference in New Issue
Block a user