From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC] ethdev: add min/max MTU to device info Date: Wed, 6 Feb 2019 08:11:07 -0800 Message-ID: <20190206081107.41c57bad@hermes.lan> References: <20180905164157.844-1-stephen@networkplumber.org> <98CBD80474FA8B44BF855DF32C47DC35B4265B@smartserver.smartshare.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Return-path: Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id BE91D1B3EB for ; Wed, 6 Feb 2019 17:11:23 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id b85so3283743pfc.3 for ; Wed, 06 Feb 2019 08:11:23 -0800 (PST) In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35B4265B@smartserver.smartshare.dk> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 6 Feb 2019 14:05:34 +0100 Morten Br=C3=B8rup wrote: > Good work, Stephen. >=20 > It should also be documented how PMDs should interpret this MTU. >=20 > Obviously, a VLAN tagged Ethernet frame grows from 1518 to 1522 bytes inc= l. header and CRC, and should be allowed with an Ethernet MTU of 1500 bytes= . There's even a #define ETHER_MAX_VLAN_FRAME_LEN for this, but that's as f= ar as it goes... >=20 > But how about frames with even larger headers, e.g. 4 MPLS labels makes a= frame 16 bytes longer, i.e. it grows from 1518 to 1534 bytes... is such a = frame acceptable with an MTU of 1500 bytes? No. According to standard practice in Linux and FreeBSD, only the first VLA= N tag is free. After that any other headers count against MTU. >=20 > According to Wikipedia (https://en.wikipedia.org/wiki/Maximum_transmissio= n_unit), MTU describes the maximum payload size, and is not tied to the max= imum frame size. However, the Linux kernel (at least the older versions I h= ave been working with) incorrectly ties the MTU directly to the maximum fra= me size, so the MTU has to increased to support larger headers (e.g. QinQ o= r an MPLS stack). Do none, all or some DPDK PMDs suffer from the same error? >=20 Maximum Transmission Unit and Maximum Receive Unit (MRU) are separate. On m= ost hardware they are the same but there is variation. Some hardware can receive larger sizes than MTU and som= e have max receive length register.