Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp562212pxj; Thu, 13 May 2021 11:16:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEiC8ScOmx8rtxyW7ZXrevAVLif5zd7tDL0zjXgK6cMYE/oqdaOSrr5PFjvFYssmIii/ws X-Received: by 2002:a17:907:7749:: with SMTP id kx9mr45569329ejc.90.1620929796230; Thu, 13 May 2021 11:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620929796; cv=none; d=google.com; s=arc-20160816; b=JEV3RNg8foI7JGW/LLnfzR4ofwNtXaCXPwAEJ6n/CKRtlVdNQFOhPIFeNmdHBYvrRW s4FmuVNFLtZw99mJQer5DCsvN0KHgtqbzSkqrgaUuaifUWP8ZSf7yDTEPw19zdPh1Qy0 nKCK4if+hTieZDftVmnQZw9xN97cqzNmODpSsrJnDMGvxiXF/18CL2mb5nrkd5aCHQwz e/ymj8IkmL32vl+XuJIvmLoZLi40tHjfleDS8YbkgguSbbrN6waSCLcnn9b66ytCLRRi jV1eaSTqRD/ogC2t2yMdpPSWu+BWU38w//KKqNdTig0Eiz5lLBFZpUpbQV7YWgeQmVBR KUUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=uMIRc1/u4GSpNlpPGyiPOa6w5UPrnf2w4iumFhDsDyA=; b=oOgl4NgjFIR1Sxif3/4wx8xBpbTZGnGI0Z4/mUeVD7sf4SoiSKlfpAUSNXSj2QIF/Y yYbsyuwYccNxuzFQDQTiekFk2QIJ3tSVWjB8u1tIYT9e4W0p4UpApKBeVXtAWJUemNtZ dceXC3K2pmTj2Rz6O9AUsQca8OQDgL9leQhb86MkbYJpMwRWxFMMBji2D/GeZONB9MgC VkeF3xqQiPkgYo0Rmm710VUQvo67uu6LpT3dHaEG5IdkdCTz+0d8e1i9flpHe/U/xn3w ftpChHdCZ8YJYrgH3vbKNzh0hW+RhLr1Ts1aFu8PgofIOGXDyBSWA9SRDl80ZNpfYrBv cy4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si3812772ejb.750.2021.05.13.11.16.11; Thu, 13 May 2021 11:16:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233424AbhEMLox (ORCPT + 99 others); Thu, 13 May 2021 07:44:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231414AbhEMLow (ORCPT ); Thu, 13 May 2021 07:44:52 -0400 Received: from plekste.mt.lv (bute.mt.lv [IPv6:2a02:610:7501:2000::195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B55CC061760; Thu, 13 May 2021 04:43:42 -0700 (PDT) Received: from [2a02:610:7501:feff:1ccf:41ff:fe50:18b9] (helo=localhost.localdomain) by plekste.mt.lv with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lh9kb-0007HF-Da; Thu, 13 May 2021 14:43:33 +0300 From: Gatis Peisenieks 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 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 Message-Id: <20210513114326.699663-4-gatis@mikrotik.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210513114326.699663-1-gatis@mikrotik.com> References: <20210513114326.699663-1-gatis@mikrotik.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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