All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julian Wiedmann <jwi@linux.vnet.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.vnet.ibm.com>,
	Ursula Braun <ubraun@linux.vnet.ibm.com>,
	Julian Wiedmann <jwi@linux.vnet.ibm.com>
Subject: [PATCH net-next 06/13] s390/qeth: clean up initial MTU determination
Date: Wed, 18 Oct 2017 17:40:18 +0200	[thread overview]
Message-ID: <20171018154025.73630-7-jwi@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>

1. Drop the support for Token Ring,
2. use the ETH_DATA_LEN macro for the default L2 MTU,
3. handle OSM via the default case (as OSM is L2-only), and
4. document why the L3 MTU is reduced.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_core_main.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 735b03cae727..acf16fa75c63 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -2219,18 +2219,12 @@ static int qeth_get_initial_mtu_for_card(struct qeth_card *card)
 	case QETH_CARD_TYPE_IQD:
 		return card->info.max_mtu;
 	case QETH_CARD_TYPE_OSD:
-		switch (card->info.link_type) {
-		case QETH_LINK_TYPE_HSTR:
-		case QETH_LINK_TYPE_LANE_TR:
-			return 2000;
-		default:
-			return card->options.layer2 ? 1500 : 1492;
-		}
-	case QETH_CARD_TYPE_OSM:
 	case QETH_CARD_TYPE_OSX:
-		return card->options.layer2 ? 1500 : 1492;
+		if (!card->options.layer2)
+			return ETH_DATA_LEN - 8; /* L3: allow for LLC + SNAP */
+		/* fall through */
 	default:
-		return 1500;
+		return ETH_DATA_LEN;
 	}
 }
 
-- 
2.13.5

WARNING: multiple messages have this Message-ID (diff)
From: Julian Wiedmann <jwi@linux.vnet.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.vnet.ibm.com>,
	Ursula Braun <ubraun@linux.vnet.ibm.com>,
	Julian Wiedmann <jwi@linux.vnet.ibm.com>
Subject: [PATCH net-next 06/13] s390/qeth: clean up initial MTU determination
Date: Wed, 18 Oct 2017 17:40:18 +0200	[thread overview]
Message-ID: <20171018154025.73630-7-jwi@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171018154025.73630-1-jwi@linux.vnet.ibm.com>

1. Drop the support for Token Ring,
2. use the ETH_DATA_LEN macro for the default L2 MTU,
3. handle OSM via the default case (as OSM is L2-only), and
4. document why the L3 MTU is reduced.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_core_main.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 735b03cae727..acf16fa75c63 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -2219,18 +2219,12 @@ static int qeth_get_initial_mtu_for_card(struct qeth_card *card)
 	case QETH_CARD_TYPE_IQD:
 		return card->info.max_mtu;
 	case QETH_CARD_TYPE_OSD:
-		switch (card->info.link_type) {
-		case QETH_LINK_TYPE_HSTR:
-		case QETH_LINK_TYPE_LANE_TR:
-			return 2000;
-		default:
-			return card->options.layer2 ? 1500 : 1492;
-		}
-	case QETH_CARD_TYPE_OSM:
 	case QETH_CARD_TYPE_OSX:
-		return card->options.layer2 ? 1500 : 1492;
+		if (!card->options.layer2)
+			return ETH_DATA_LEN - 8; /* L3: allow for LLC + SNAP */
+		/* fall through */
 	default:
-		return 1500;
+		return ETH_DATA_LEN;
 	}
 }
 
-- 
2.13.5

  parent reply	other threads:[~2017-10-18 15:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 15:40 [PATCH net-next 00/13] s390/net: updates 2017-10-18 Julian Wiedmann
2017-10-18 15:40 ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 01/13] s390/qeth: rely on kernel for feature recovery Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 02/13] s390/drivers: use setup_timer Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 03/13] s390/qeth: remove duplicated device matching Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 04/13] s390/qeth: use kstrtobool() in qeth_bridgeport_hostnotification_store() Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 05/13] s390/qeth: fix early exit from error path Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` Julian Wiedmann [this message]
2017-10-18 15:40   ` [PATCH net-next 06/13] s390/qeth: clean up initial MTU determination Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 07/13] s390/qeth: don't verify device when setting MAC address Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 08/13] s390/qeth: no VLAN support on OSM Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 09/13] s390/qeth: clean up page frag creation Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 10/13] s390/qeth: consolidate skb allocation Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 11/13] s390/qeth: try harder to get packets from RX buffer Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 15:40 ` [PATCH net-next 12/13] s390/qeth: support GRO flush timer Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-18 16:08   ` Eric Dumazet
2017-10-18 15:40 ` [PATCH net-next 13/13] s390/qeth: don't dump control cmd twice Julian Wiedmann
2017-10-18 15:40   ` Julian Wiedmann
2017-10-20 12:12 ` [PATCH net-next 00/13] s390/net: updates 2017-10-18 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=20171018154025.73630-7-jwi@linux.vnet.ibm.com \
    --to=jwi@linux.vnet.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.vnet.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=ubraun@linux.vnet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.