Commit 7e83747d authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: enable only required csum offload features

Current code attempts to enable all advertised HW csum offload features.
Future-proof this by enabling only those features that we actually use.

Also, the IPv4 header csum feature is only needed for TX on L3 devices.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c2153277
...@@ -6329,8 +6329,11 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype, ...@@ -6329,8 +6329,11 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype,
struct qeth_checksum_cmd chksum_cb; struct qeth_checksum_cmd chksum_cb;
int rc; int rc;
if (prot == QETH_PROT_IPV4) /* some L3 HW requires combined L3+L4 csum offload: */
if (IS_LAYER3(card) && prot == QETH_PROT_IPV4 &&
cstype == IPA_OUTBOUND_CHECKSUM)
required_features |= QETH_IPA_CHECKSUM_IP_HDR; required_features |= QETH_IPA_CHECKSUM_IP_HDR;
rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_START, 0, rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_START, 0,
&chksum_cb, prot); &chksum_cb, prot);
if (!rc) { if (!rc) {
...@@ -6351,8 +6354,12 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype, ...@@ -6351,8 +6354,12 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype,
prot, QETH_CARD_IFNAME(card)); prot, QETH_CARD_IFNAME(card));
return rc; return rc;
} }
if (chksum_cb.supported & QETH_IPA_CHECKSUM_LP2LP)
required_features |= QETH_IPA_CHECKSUM_LP2LP;
rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_ENABLE, rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_ENABLE,
chksum_cb.supported, &chksum_cb, required_features, &chksum_cb,
prot); prot);
if (!rc) { if (!rc) {
if ((required_features & chksum_cb.enabled) != if ((required_features & chksum_cb.enabled) !=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment