netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-s390@vger.kernel.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Stefan Raspl <raspl@linux.ibm.com>,
	Ursula Braun <ubraun@linux.ibm.com>,
	Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 03/10] s390/qeth: enable only required csum offload features
Date: Tue, 12 Feb 2019 18:33:18 +0100	[thread overview]
Message-ID: <20190212173325.36555-4-jwi@linux.ibm.com> (raw)
In-Reply-To: <20190212173325.36555-1-jwi@linux.ibm.com>

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: Julian Wiedmann <jwi@linux.ibm.com>
---
 drivers/s390/net/qeth_core_main.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 5f450df886c6..31720044656a 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6329,8 +6329,11 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype,
 	struct qeth_checksum_cmd chksum_cb;
 	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;
+
 	rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_START, 0,
 				       &chksum_cb, prot);
 	if (!rc) {
@@ -6351,8 +6354,12 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype,
 			 prot, QETH_CARD_IFNAME(card));
 		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,
-				       chksum_cb.supported, &chksum_cb,
+				       required_features, &chksum_cb,
 				       prot);
 	if (!rc) {
 		if ((required_features & chksum_cb.enabled) !=
-- 
2.16.4


  parent reply	other threads:[~2019-02-12 17:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12 17:33 [PATCH net-next 00/10] s390/qeth: updates 2019-02-12 Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 01/10] s390/qeth: reduce data length for ARP cache query Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 02/10] s390/qeth: consolidate filling of low-level cmd length fields Julian Wiedmann
2019-02-12 17:33 ` Julian Wiedmann [this message]
2019-02-12 17:33 ` [PATCH net-next 04/10] s390/qeth: align csum offload with TSO control logic Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 05/10] s390/qeth: limit trace to valid data of command request Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 06/10] s390/qeth: simplify reply object handling Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 07/10] s390/qeth: cancel cmd on early error Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 08/10] s390/qeth: allow cmd callbacks to return errnos Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 09/10] s390/qeth: convert bridgeport callbacks Julian Wiedmann
2019-02-12 17:33 ` [PATCH net-next 10/10] s390/qeth: convert remaining legacy cmd callbacks Julian Wiedmann
2019-02-12 18:14 ` [PATCH net-next 00/10] s390/qeth: updates 2019-02-12 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190212173325.36555-4-jwi@linux.ibm.com \
    --to=jwi@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=raspl@linux.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=ubraun@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).