linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gatis Peisenieks <gatis@mikrotik.com>
To: chris.snook@gmail.com, davem@davemloft.net, kuba@kernel.org,
	hkallweit1@gmail.com, jesse.brandeburg@intel.com,
	dchickles@marvell.com, tully@mikrotik.com,
	eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Gatis Peisenieks <gatis@mikrotik.com>
Subject: [PATCH net-next v2 3/5] atl1c: adjust max mtu according to Mikrotik 10/25G NIC ability
Date: Thu, 13 May 2021 14:43:24 +0300	[thread overview]
Message-ID: <20210513114326.699663-4-gatis@mikrotik.com> (raw)
In-Reply-To: <20210513114326.699663-1-gatis@mikrotik.com>

The new Mikrotik 10/25G NIC supports jumbo frames. Jumbo frames are
supported for TSO as well.

This enables the support for mtu up to 9500 bytes.

Signed-off-by: Gatis Peisenieks <gatis@mikrotik.com>
---
 drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 08a0f49e03ce..dbafd8118a86 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -478,6 +478,9 @@ static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter,
 static netdev_features_t atl1c_fix_features(struct net_device *netdev,
 	netdev_features_t features)
 {
+	struct atl1c_adapter *adapter = netdev_priv(netdev);
+	struct atl1c_hw *hw = &adapter->hw;
+
 	/*
 	 * Since there is no support for separate rx/tx vlan accel
 	 * enable/disable make sure tx flag is always in same state as rx.
@@ -487,8 +490,10 @@ static netdev_features_t atl1c_fix_features(struct net_device *netdev,
 	else
 		features &= ~NETIF_F_HW_VLAN_CTAG_TX;
 
-	if (netdev->mtu > MAX_TSO_FRAME_SIZE)
-		features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
+	if (hw->nic_type != athr_mt) {
+		if (netdev->mtu > MAX_TSO_FRAME_SIZE)
+			features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
+	}
 
 	return features;
 }
@@ -515,9 +520,12 @@ static void atl1c_set_max_mtu(struct net_device *netdev)
 	case athr_l1d:
 	case athr_l1d_2:
 		netdev->max_mtu = MAX_JUMBO_FRAME_SIZE -
-				  (ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN);
+			(ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN);
+		break;
+	case athr_mt:
+		netdev->max_mtu = 9500;
 		break;
-	/* The 10/100 devices don't support jumbo packets, max_mtu 1500 */
+		/* The 10/100 devices don't support jumbo packets, max_mtu 1500 */
 	default:
 		netdev->max_mtu = ETH_DATA_LEN;
 		break;
-- 
2.31.1


  parent reply	other threads:[~2021-05-13 11:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13 11:43 [PATCH net-next v2 0/5] atl1c: support for Mikrotik 10/25G NIC features Gatis Peisenieks
2021-05-13 11:43 ` [PATCH net-next v2 1/5] atl1c: show correct link speed on Mikrotik 10/25G NIC Gatis Peisenieks
2021-05-13 11:43 ` [PATCH net-next v2 2/5] atl1c: improve performance by avoiding unnecessary pcie writes on xmit Gatis Peisenieks
2021-05-13 11:43 ` Gatis Peisenieks [this message]
2021-05-13 11:43 ` [PATCH net-next v2 4/5] atl1c: enable rx csum offload on Mikrotik 10/25G NIC Gatis Peisenieks
2021-05-13 11:43 ` [PATCH net-next v2 5/5] atl1c: improve link detection reliability " Gatis Peisenieks
2021-05-13 22:50 ` [PATCH net-next v2 0/5] atl1c: support for Mikrotik 10/25G NIC features patchwork-bot+netdevbpf

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=20210513114326.699663-4-gatis@mikrotik.com \
    --to=gatis@mikrotik.com \
    --cc=chris.snook@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dchickles@marvell.com \
    --cc=eric.dumazet@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tully@mikrotik.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).