aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2018-10-12 11:27:12 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-12 14:27:00 -0400
commit1f83b817d0f14ac06ab593b47fdd6f51238cd73e (patch)
tree2b3c246b87dafb9755027554de47034bad1d23b4
parent139ce90a45700234fdd78bec1ffe780085989f52 (diff)
s390/qeth: make TSO controls protocol-agnostic
In preparation for IPv6 TSO, turn the protocol version into a parameter for the TSO control code. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/s390/net/qeth_core_main.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 1771d0073c0c..92e539d1fbd3 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6396,27 +6396,27 @@ static int qeth_set_ipa_csum(struct qeth_card *card, bool on, int cstype,
6396 return rc ? -EIO : 0; 6396 return rc ? -EIO : 0;
6397} 6397}
6398 6398
6399static int qeth_set_ipa_tso(struct qeth_card *card, int on) 6399static int qeth_set_tso_off(struct qeth_card *card,
6400 enum qeth_prot_versions prot)
6400{ 6401{
6401 int rc; 6402 return qeth_send_simple_setassparms_prot(card, IPA_OUTBOUND_TSO,
6403 IPA_CMD_ASS_STOP, 0, prot);
6404}
6402 6405
6403 QETH_CARD_TEXT(card, 3, "sttso"); 6406static int qeth_set_tso_on(struct qeth_card *card,
6407 enum qeth_prot_versions prot)
6408{
6409 return qeth_send_simple_setassparms_prot(card, IPA_OUTBOUND_TSO,
6410 IPA_CMD_ASS_START, 0, prot);
6411}
6404 6412
6405 if (on) { 6413static int qeth_set_ipa_tso(struct qeth_card *card, bool on,
6406 rc = qeth_send_simple_setassparms(card, IPA_OUTBOUND_TSO, 6414 enum qeth_prot_versions prot)
6407 IPA_CMD_ASS_START, 0); 6415{
6408 if (rc) { 6416 int rc = on ? qeth_set_tso_on(card, prot) :
6409 dev_warn(&card->gdev->dev, 6417 qeth_set_tso_off(card, prot);
6410 "Starting outbound TCP segmentation offload for %s failed\n", 6418
6411 QETH_CARD_IFNAME(card)); 6419 return rc ? -EIO : 0;
6412 return -EIO;
6413 }
6414 dev_info(&card->gdev->dev, "Outbound TSO enabled\n");
6415 } else {
6416 rc = qeth_send_simple_setassparms(card, IPA_OUTBOUND_TSO,
6417 IPA_CMD_ASS_STOP, 0);
6418 }
6419 return rc;
6420} 6420}
6421 6421
6422static int qeth_set_ipa_rx_csum(struct qeth_card *card, bool on) 6422static int qeth_set_ipa_rx_csum(struct qeth_card *card, bool on)
@@ -6493,8 +6493,9 @@ int qeth_set_features(struct net_device *dev, netdev_features_t features)
6493 if (rc) 6493 if (rc)
6494 changed ^= NETIF_F_RXCSUM; 6494 changed ^= NETIF_F_RXCSUM;
6495 } 6495 }
6496 if ((changed & NETIF_F_TSO)) { 6496 if (changed & NETIF_F_TSO) {
6497 rc = qeth_set_ipa_tso(card, features & NETIF_F_TSO ? 1 : 0); 6497 rc = qeth_set_ipa_tso(card, features & NETIF_F_TSO,
6498 QETH_PROT_IPV4);
6498 if (rc) 6499 if (rc)
6499 changed ^= NETIF_F_TSO; 6500 changed ^= NETIF_F_TSO;
6500 } 6501 }