diff options
Diffstat (limited to 'drivers/s390/net/qeth_l3_main.c')
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 104 |
1 files changed, 48 insertions, 56 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 1496661507ea..18484b586a3e 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -1445,34 +1445,30 @@ static int qeth_l3_send_checksum_command(struct qeth_card *card) | |||
1445 | return 0; | 1445 | return 0; |
1446 | } | 1446 | } |
1447 | 1447 | ||
1448 | int qeth_l3_set_rx_csum(struct qeth_card *card, | 1448 | int qeth_l3_set_rx_csum(struct qeth_card *card, int on) |
1449 | enum qeth_checksum_types csum_type) | ||
1450 | { | 1449 | { |
1451 | int rc = 0; | 1450 | int rc = 0; |
1452 | 1451 | ||
1453 | if (card->options.checksum_type == HW_CHECKSUMMING) { | 1452 | if (on) { |
1454 | if ((csum_type != HW_CHECKSUMMING) && | 1453 | if (card->state != CARD_STATE_DOWN) { |
1455 | (card->state != CARD_STATE_DOWN)) { | 1454 | if (!qeth_is_supported(card, |
1456 | rc = qeth_l3_send_simple_setassparms(card, | 1455 | IPA_INBOUND_CHECKSUM)) |
1457 | IPA_INBOUND_CHECKSUM, IPA_CMD_ASS_STOP, 0); | 1456 | return -EPERM; |
1457 | rc = qeth_l3_send_checksum_command(card); | ||
1458 | if (rc) | 1458 | if (rc) |
1459 | return -EIO; | 1459 | return -EIO; |
1460 | } | 1460 | } |
1461 | card->dev->features |= NETIF_F_RXCSUM; | 1461 | card->dev->features |= NETIF_F_RXCSUM; |
1462 | } else { | 1462 | } else { |
1463 | if (csum_type == HW_CHECKSUMMING) { | 1463 | if (card->state != CARD_STATE_DOWN) { |
1464 | if (card->state != CARD_STATE_DOWN) { | 1464 | rc = qeth_l3_send_simple_setassparms(card, |
1465 | if (!qeth_is_supported(card, | 1465 | IPA_INBOUND_CHECKSUM, IPA_CMD_ASS_STOP, 0); |
1466 | IPA_INBOUND_CHECKSUM)) | 1466 | if (rc) |
1467 | return -EPERM; | 1467 | return -EIO; |
1468 | rc = qeth_l3_send_checksum_command(card); | ||
1469 | if (rc) | ||
1470 | return -EIO; | ||
1471 | } | ||
1472 | } | 1468 | } |
1473 | card->dev->features &= ~NETIF_F_RXCSUM; | 1469 | card->dev->features &= ~NETIF_F_RXCSUM; |
1474 | } | 1470 | } |
1475 | card->options.checksum_type = csum_type; | 1471 | |
1476 | return rc; | 1472 | return rc; |
1477 | } | 1473 | } |
1478 | 1474 | ||
@@ -1482,32 +1478,34 @@ static int qeth_l3_start_ipa_checksum(struct qeth_card *card) | |||
1482 | 1478 | ||
1483 | QETH_CARD_TEXT(card, 3, "strtcsum"); | 1479 | QETH_CARD_TEXT(card, 3, "strtcsum"); |
1484 | 1480 | ||
1485 | if (card->options.checksum_type == NO_CHECKSUMMING) { | 1481 | if (card->dev->features & NETIF_F_RXCSUM) { |
1486 | dev_info(&card->gdev->dev, | 1482 | /* hw may have changed during offline or recovery */ |
1487 | "Using no checksumming on %s.\n", | 1483 | if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) { |
1488 | QETH_CARD_IFNAME(card)); | 1484 | dev_info(&card->gdev->dev, |
1489 | return 0; | ||
1490 | } | ||
1491 | if (card->options.checksum_type == SW_CHECKSUMMING) { | ||
1492 | dev_info(&card->gdev->dev, | ||
1493 | "Using SW checksumming on %s.\n", | ||
1494 | QETH_CARD_IFNAME(card)); | ||
1495 | return 0; | ||
1496 | } | ||
1497 | if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) { | ||
1498 | dev_info(&card->gdev->dev, | ||
1499 | "Inbound HW Checksumming not " | 1485 | "Inbound HW Checksumming not " |
1500 | "supported on %s,\ncontinuing " | 1486 | "supported on %s,\ncontinuing " |
1501 | "using Inbound SW Checksumming\n", | 1487 | "using Inbound SW Checksumming\n", |
1502 | QETH_CARD_IFNAME(card)); | 1488 | QETH_CARD_IFNAME(card)); |
1503 | card->options.checksum_type = SW_CHECKSUMMING; | 1489 | goto update_feature; |
1504 | return 0; | 1490 | } |
1505 | } | 1491 | |
1506 | rc = qeth_l3_send_checksum_command(card); | 1492 | rc = qeth_l3_send_checksum_command(card); |
1507 | if (!rc) | 1493 | if (!rc) |
1508 | dev_info(&card->gdev->dev, | 1494 | dev_info(&card->gdev->dev, |
1509 | "HW Checksumming (inbound) enabled\n"); | 1495 | "HW Checksumming (inbound) enabled\n"); |
1496 | else | ||
1497 | goto update_feature; | ||
1498 | } else | ||
1499 | dev_info(&card->gdev->dev, | ||
1500 | "Using SW checksumming on %s.\n", | ||
1501 | QETH_CARD_IFNAME(card)); | ||
1502 | return 0; | ||
1510 | 1503 | ||
1504 | update_feature: | ||
1505 | rtnl_lock(); | ||
1506 | card->dev->features &= ~NETIF_F_RXCSUM; | ||
1507 | netdev_update_features(card->dev); | ||
1508 | rtnl_unlock(); | ||
1511 | return rc; | 1509 | return rc; |
1512 | } | 1510 | } |
1513 | 1511 | ||
@@ -2037,14 +2035,7 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card, | |||
2037 | is_vlan = 1; | 2035 | is_vlan = 1; |
2038 | } | 2036 | } |
2039 | 2037 | ||
2040 | switch (card->options.checksum_type) { | 2038 | if (card->dev->features & NETIF_F_RXCSUM) { |
2041 | case SW_CHECKSUMMING: | ||
2042 | skb->ip_summed = CHECKSUM_NONE; | ||
2043 | break; | ||
2044 | case NO_CHECKSUMMING: | ||
2045 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
2046 | break; | ||
2047 | case HW_CHECKSUMMING: | ||
2048 | if ((hdr->hdr.l3.ext_flags & | 2039 | if ((hdr->hdr.l3.ext_flags & |
2049 | (QETH_HDR_EXT_CSUM_HDR_REQ | | 2040 | (QETH_HDR_EXT_CSUM_HDR_REQ | |
2050 | QETH_HDR_EXT_CSUM_TRANSP_REQ)) == | 2041 | QETH_HDR_EXT_CSUM_TRANSP_REQ)) == |
@@ -2053,7 +2044,8 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card, | |||
2053 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 2044 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
2054 | else | 2045 | else |
2055 | skb->ip_summed = CHECKSUM_NONE; | 2046 | skb->ip_summed = CHECKSUM_NONE; |
2056 | } | 2047 | } else |
2048 | skb->ip_summed = CHECKSUM_NONE; | ||
2057 | 2049 | ||
2058 | return is_vlan; | 2050 | return is_vlan; |
2059 | } | 2051 | } |
@@ -3235,20 +3227,19 @@ static u32 qeth_l3_fix_features(struct net_device *dev, u32 features) | |||
3235 | 3227 | ||
3236 | static int qeth_l3_set_features(struct net_device *dev, u32 features) | 3228 | static int qeth_l3_set_features(struct net_device *dev, u32 features) |
3237 | { | 3229 | { |
3238 | enum qeth_checksum_types csum_type; | ||
3239 | struct qeth_card *card = dev->ml_priv; | 3230 | struct qeth_card *card = dev->ml_priv; |
3240 | u32 changed = dev->features ^ features; | 3231 | u32 changed = dev->features ^ features; |
3232 | int on; | ||
3241 | 3233 | ||
3242 | if (!(changed & NETIF_F_RXCSUM)) | 3234 | if (!(changed & NETIF_F_RXCSUM)) |
3243 | return 0; | 3235 | return 0; |
3244 | 3236 | ||
3245 | if (features & NETIF_F_RXCSUM) | 3237 | if (features & NETIF_F_RXCSUM) |
3246 | csum_type = HW_CHECKSUMMING; | 3238 | on = 1; |
3247 | else | 3239 | else |
3248 | csum_type = SW_CHECKSUMMING; | 3240 | on = 0; |
3249 | 3241 | ||
3250 | dev->features = features ^ NETIF_F_RXCSUM; | 3242 | return qeth_l3_set_rx_csum(card, on); |
3251 | return qeth_l3_set_rx_csum(card, csum_type); | ||
3252 | } | 3243 | } |
3253 | 3244 | ||
3254 | static const struct ethtool_ops qeth_l3_ethtool_ops = { | 3245 | static const struct ethtool_ops qeth_l3_ethtool_ops = { |
@@ -3342,6 +3333,12 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) | |||
3342 | if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) | 3333 | if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) |
3343 | card->dev->dev_id = card->info.unique_id & | 3334 | card->dev->dev_id = card->info.unique_id & |
3344 | 0xffff; | 3335 | 0xffff; |
3336 | if (!card->info.guestlan) { | ||
3337 | card->dev->hw_features = NETIF_F_SG | | ||
3338 | NETIF_F_RXCSUM | NETIF_F_IP_CSUM | | ||
3339 | NETIF_F_TSO; | ||
3340 | card->dev->features = NETIF_F_RXCSUM; | ||
3341 | } | ||
3345 | } | 3342 | } |
3346 | } else if (card->info.type == QETH_CARD_TYPE_IQD) { | 3343 | } else if (card->info.type == QETH_CARD_TYPE_IQD) { |
3347 | card->dev = alloc_netdev(0, "hsi%d", ether_setup); | 3344 | card->dev = alloc_netdev(0, "hsi%d", ether_setup); |
@@ -3357,8 +3354,6 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) | |||
3357 | card->dev->watchdog_timeo = QETH_TX_TIMEOUT; | 3354 | card->dev->watchdog_timeo = QETH_TX_TIMEOUT; |
3358 | card->dev->mtu = card->info.initial_mtu; | 3355 | card->dev->mtu = card->info.initial_mtu; |
3359 | SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops); | 3356 | SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops); |
3360 | card->dev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | | ||
3361 | NETIF_F_IP_CSUM | NETIF_F_TSO; | ||
3362 | card->dev->features |= NETIF_F_HW_VLAN_TX | | 3357 | card->dev->features |= NETIF_F_HW_VLAN_TX | |
3363 | NETIF_F_HW_VLAN_RX | | 3358 | NETIF_F_HW_VLAN_RX | |
3364 | NETIF_F_HW_VLAN_FILTER; | 3359 | NETIF_F_HW_VLAN_FILTER; |
@@ -3382,9 +3377,6 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev) | |||
3382 | card->discipline.output_handler = (qdio_handler_t *) | 3377 | card->discipline.output_handler = (qdio_handler_t *) |
3383 | qeth_qdio_output_handler; | 3378 | qeth_qdio_output_handler; |
3384 | card->discipline.recover = qeth_l3_recover; | 3379 | card->discipline.recover = qeth_l3_recover; |
3385 | if ((card->info.type == QETH_CARD_TYPE_OSD) || | ||
3386 | (card->info.type == QETH_CARD_TYPE_OSX)) | ||
3387 | card->options.checksum_type = HW_CHECKSUMMING; | ||
3388 | return 0; | 3380 | return 0; |
3389 | } | 3381 | } |
3390 | 3382 | ||