s390/qeth: improve selection of ethtool link modes
The link mode is a combination of port speed and port mode. But we
currently only consider the speed, and then typically select the
corresponding TP-based link mode. For 1G and 10G Fibre links this means
we display the wrong link modes.
Move the SPEED_* switch statements inside the PORT_* cases, and only
consider valid combinations where we can select the corresponding
link mode. Add the relevant link modes (1000baseX, 10000baseSR and
1000baseLR) that were introduced back with
commit 5711a98221 ("net: ethtool: add support for 1000BaseX and missing 10G link modes").
To differentiate between 10000baseSR and 10000baseLR, use the detailed
media_type information that QUERY OAT provides.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
e92d42e760
commit
235db52783
@@ -5018,13 +5018,19 @@ static int qeth_init_link_info_oat_cb(struct qeth_card *card,
|
||||
switch (phys_if->media_type) {
|
||||
case QETH_QOAT_PHYS_MEDIA_COPPER:
|
||||
link_info->port = PORT_TP;
|
||||
link_info->link_mode = QETH_LINK_MODE_UNKNOWN;
|
||||
break;
|
||||
case QETH_QOAT_PHYS_MEDIA_FIBRE_SHORT:
|
||||
link_info->port = PORT_FIBRE;
|
||||
link_info->link_mode = QETH_LINK_MODE_FIBRE_SHORT;
|
||||
break;
|
||||
case QETH_QOAT_PHYS_MEDIA_FIBRE_LONG:
|
||||
link_info->port = PORT_FIBRE;
|
||||
link_info->link_mode = QETH_LINK_MODE_FIBRE_LONG;
|
||||
break;
|
||||
default:
|
||||
link_info->port = PORT_OTHER;
|
||||
link_info->link_mode = QETH_LINK_MODE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5038,6 +5044,7 @@ static void qeth_init_link_info(struct qeth_card *card)
|
||||
if (IS_IQD(card) || IS_VM_NIC(card)) {
|
||||
card->info.link_info.speed = SPEED_10000;
|
||||
card->info.link_info.port = PORT_FIBRE;
|
||||
card->info.link_info.link_mode = QETH_LINK_MODE_FIBRE_SHORT;
|
||||
} else {
|
||||
switch (card->info.link_type) {
|
||||
case QETH_LINK_TYPE_FAST_ETH:
|
||||
@@ -5064,6 +5071,8 @@ static void qeth_init_link_info(struct qeth_card *card)
|
||||
card->info.link_info.speed = SPEED_UNKNOWN;
|
||||
card->info.link_info.port = PORT_OTHER;
|
||||
}
|
||||
|
||||
card->info.link_info.link_mode = QETH_LINK_MODE_UNKNOWN;
|
||||
}
|
||||
|
||||
/* Get more accurate data via QUERY OAT: */
|
||||
@@ -5089,6 +5098,8 @@ static void qeth_init_link_info(struct qeth_card *card)
|
||||
card->info.link_info.duplex = link_info.duplex;
|
||||
if (link_info.port != PORT_OTHER)
|
||||
card->info.link_info.port = link_info.port;
|
||||
if (link_info.link_mode != QETH_LINK_MODE_UNKNOWN)
|
||||
card->info.link_info.link_mode = link_info.link_mode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user