summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlxsw/port.h
diff options
context:
space:
mode:
authorAmit Cohen <amcohen@nvidia.com>2024-06-13 17:07:55 +0300
committerJakub Kicinski <kuba@kernel.org>2024-06-15 05:30:34 +0300
commitd361536fc2dfd22e65a84f4f2a13b2b8f4f0739b (patch)
treea0e8e3a3674786adc34dd7456ee6d59330688192 /drivers/net/ethernet/mellanox/mlxsw/port.h
parentcae7fd47dfe15e54710e3e550340876382a6db19 (diff)
downloadlinux-d361536fc2dfd22e65a84f4f2a13b2b8f4f0739b.tar.xz
mlxsw: Adjust MTU value to hardware check
Ethernet frame consists of - Ethernet header, payload, FCS. The MTU value which is used by user is the size of the payload, which means that when user sets MTU to X, the total frame size will be larger due to the addition of the Ethernet header and FCS. Spectrum ASICs take into account Ethernet header and FCS as part of packet size for MTU check. Adjust MTU value when user sets MTU, to configure the MTU size which is required by hardware. The Tx header length which was used by the driver is not relevant for such calculation, take into account Ethernet header (with VLAN extension) and FCS. Signed-off-by: Amit Cohen <amcohen@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Link: https://lore.kernel.org/r/f3203c2477bb8ed18b1e79642fa3e3713e1e55bb.1718275854.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/port.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/port.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/port.h b/drivers/net/ethernet/mellanox/mlxsw/port.h
index aa309615eff3..0a73b1a4526e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/port.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/port.h
@@ -7,6 +7,7 @@
#include <linux/types.h>
#define MLXSW_PORT_MAX_MTU (10 * 1024)
+#define MLXSW_PORT_ETH_FRAME_HDR (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN)
#define MLXSW_PORT_DEFAULT_VID 1