From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC] Ethernet drivers to add padding on egress Date: Mon, 19 Nov 2018 08:10:27 -0800 Message-ID: <20181119081010.44e7bbd9@xeon-e3> References: <98CBD80474FA8B44BF855DF32C47DC35B424A6@smartserver.smartshare.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: , "Ferruh Yigit" , "Declan Doherty" , "Chas Williams" , "John W. Linville" , "Marcin Wojtas" , "Michal Krawczyk" , "Guy Tzalik" , "Evgeny Schemeilin" , "Ravi Kumar" , "Igor Russkikh" , "Pavel Belous" , "Shepard Siegel" , "Ed Czeck" , "John Miller" , "Ajit Khaparde" , "Somnath Kotur" , "Jerin Jacob" , "Maciej Czekaj" , "Shijith Thotton" , "Srisivasubramanian Srinivasan" Return-path: Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 52D022B8B for ; Mon, 19 Nov 2018 17:10:40 +0100 (CET) Received: by mail-pl1-f194.google.com with SMTP id s5-v6so14787554plq.11 for ; Mon, 19 Nov 2018 08:10:40 -0800 (PST) In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35B424A6@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 Thu, 15 Nov 2018 17:56:48 +0100 Morten Br=C3=B8rup wrote: > Hi networking driver maintainers, >=20 > I suggest that the TX functions of Ethernet interface drivers accept pack= ets with less than 60 byte payload, and transmit them on the medium as vali= d Ethernet frames, i.e. by padding the packets up to the minimum Ethernet p= acket size of 64 bytes incl. Ethernet FCS, instead of discarding them. >=20 > This feature makes it easier for application developers who are using DPD= K as the lower layer in an IP stack, where lots of packets have less than 6= 0 bytes Ethernet payload, e.g. TCP SYN and TCP ACK packets. >=20 > This feature also makes it easier for application developers who are usin= g DPDK library functions that split, merge or otherwise transform packets i= nto packets of other sizes, e.g. Generic Segmentation Offload, IP Fragmenta= tion and various tunnel encapsulation/decapsulation functions. >=20 > Currently (without this feature), it is required by the application to ch= eck if packets originating from the IP stack or having passed through a spl= it/merge/transform function are about to egress on an Ethernet interface, a= nd in that case, if some of the packets are less than 60 bytes (excl. Ether= net FCS), add padding before passing them on to the driver's TX function. >=20 > E.g. when using Generic Segmentation Offload, a packet carrying 1461 byte= TCP payload (excl. 54 bytes Ethernet+IP+TCP headers) will be split into tw= o packets of respectively 1514 byte (incl. 54 bytes Ethernet+IP+TCP headers= ) and 55 bytes (incl. 54 bytes Ethernet+IP+TCP headers), and the latter mus= t be padded before it is transmitted on an Ethernet interface. >=20 >=20 > In my opinion, it should be a requirement that the Ethernet interface dri= vers ensure correct padding when egressing the packet on the medium. Altern= atively, it can be an optional feature, which could be exposed as an TX Cap= abilities flag of the driver. >=20 > What do you think? >=20 >=20 > I do not suggest any changes regarding ingress - runts (undersize Etherne= t packets) received from the medium are invalid, and should be discarded an= d counted as errors. >=20 Devices drivers should work like Linux and BSD! They must pad packets to meet any restrictions by the underlying technology. Please don't add another capability flag or other way for applications to s= ee this. DPDK already has way to many hardware capability flags. It should just happen.