@@ -2134,6 +2134,7 @@ static int __mlxsw_core_port_init(struct mlxsw_core *mlxsw_core, u8 local_port,
int err;
attrs.split = split;
+ attrs.lanes = lanes;
attrs.flavour = flavour;
attrs.phys.port_number = port_number;
attrs.phys.split_subport_number = split_port_subnumber;
@@ -66,6 +66,7 @@ struct devlink_port_pci_vf_attrs {
struct devlink_port_attrs {
u8 split:1;
+ u32 lanes;
enum devlink_port_flavour flavour;
struct netdev_phys_item_id switch_id;
union {
@@ -451,6 +451,8 @@ enum devlink_attr {
DEVLINK_ATTR_TRAP_POLICER_RATE, /* u64 */
DEVLINK_ATTR_TRAP_POLICER_BURST, /* u64 */
+ DEVLINK_ATTR_PORT_LANES, /* u32 */
+
/* add new attributes above here, update the policy in devlink.c */
__DEVLINK_ATTR_MAX,
@@ -526,6 +526,10 @@ static int devlink_nl_port_attrs_put(struct sk_buff *msg,
if (!devlink_port->attrs_set)
return 0;
+ if (attrs->lanes) {
+ if (nla_put_u32(msg, DEVLINK_ATTR_PORT_LANES, attrs->lanes))
+ return -EMSGSIZE;
+ }
if (nla_put_u16(msg, DEVLINK_ATTR_PORT_FLAVOUR, attrs->flavour))
return -EMSGSIZE;
switch (devlink_port->attrs.flavour) {
@@ -7405,6 +7409,9 @@ static int __devlink_port_attrs_set(struct devlink_port *devlink_port,
* user, for example the front panel
* port number
* @split: indicates if this is split port
+ * @lanes: maximum number of lanes the port supports.
+ * 0 value is not passed to netlink and valid
+ * number is a power of 2.
* @split_subport_number: if the port is split, this
* is the number of subport.
* @switch_id: if the port is part of switch, this is