Message ID | 20210106130622.2110387-4-danieller@mellanox.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Support setting lanes via ethtool | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 2 maintainers not CCed: gaurav1086@gmail.com linux@rempel-privat.de |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 1 this patch: 1 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | WARNING: line length of 81 exceeds 80 columns |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 1 this patch: 1 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c index 505a9b395fce..f22761dcdb2e 100644 --- a/net/ethtool/linkmodes.c +++ b/net/ethtool/linkmodes.c @@ -166,11 +166,15 @@ static int linkmodes_prepare_data(const struct ethnl_req_info *req_base, goto out; } + if (!(dev->ethtool_ops->capabilities & ETHTOOL_CAP_LINK_LANES_SUPPORTED)) + data->ksettings.lanes = ETHTOOL_LANES_UNKNOWN; + if (data->ksettings.link_mode) { for (i = 0; i < __ETHTOOL_LINK_MODE_MASK_NBITS; i++) { if (data->ksettings.link_mode == i) { link_info = &link_mode_params[i]; data->lsettings->speed = link_info->speed; + data->ksettings.lanes = link_info->lanes; data->lsettings->duplex = link_info->duplex; } } @@ -196,6 +200,7 @@ static int linkmodes_reply_size(const struct ethnl_req_info *req_base, len = nla_total_size(sizeof(u8)) /* LINKMODES_AUTONEG */ + nla_total_size(sizeof(u32)) /* LINKMODES_SPEED */ + + nla_total_size(sizeof(u32)) /* LINKMODES_LANES */ + nla_total_size(sizeof(u8)) /* LINKMODES_DUPLEX */ + 0; ret = ethnl_bitset_size(ksettings->link_modes.advertising, @@ -253,6 +258,7 @@ static int linkmodes_fill_reply(struct sk_buff *skb, } if (nla_put_u32(skb, ETHTOOL_A_LINKMODES_SPEED, lsettings->speed) || + nla_put_u32(skb, ETHTOOL_A_LINKMODES_LANES, ksettings->lanes) || nla_put_u8(skb, ETHTOOL_A_LINKMODES_DUPLEX, lsettings->duplex)) return -EMSGSIZE;