From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] veth: Optionally pad packets to minimum Ethernet length Date: Tue, 12 Dec 2017 10:34:23 -0800 Message-ID: <20171212103423.508ad7c9@xeon-e3> References: <1513095191-127313-1-git-send-email-eswierk@skyportsystems.com> <1513099966.26538.1.camel@redhat.com> <20171212181817.GB3531@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Dan Williams , Ed Swierk , netdev@vger.kernel.org, Benjamin Warren , Keith Holleman To: Marcelo Ricardo Leitner Return-path: Received: from mail-pg0-f46.google.com ([74.125.83.46]:39300 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbdLLSe0 (ORCPT ); Tue, 12 Dec 2017 13:34:26 -0500 Received: by mail-pg0-f46.google.com with SMTP id w7so13984991pgv.6 for ; Tue, 12 Dec 2017 10:34:26 -0800 (PST) In-Reply-To: <20171212181817.GB3531@localhost.localdomain> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 12 Dec 2017 16:18:17 -0200 Marcelo Ricardo Leitner wrote: > On Tue, Dec 12, 2017 at 11:32:46AM -0600, Dan Williams wrote: > > On Tue, 2017-12-12 at 08:13 -0800, Ed Swierk wrote: > > > Most physical Ethernet devices pad short packets to the minimum > > > length > > > of 64 bytes (including FCS) on transmit. It can be useful to simulate > > > this behavior when debugging a problem that results from it (such as > > > incorrect L4 checksum calculation). > > > > > > Padding is unnecessary for most applications so leave it off by > > > default. Enable padding only when the otherwise unused IFF_AUTOMEDIA > > > flag is set (e.g. by writing 0x5003 to flags in sysfs). > > > > This seems like a weird overload of AUTOMEDIA, which no other driver > > uses for this purpose. Seems like the only other user of AUTOMEDIA is > > 8390/etherh.c for some 10BaseT/10Base2 stuff. > > > > I'm not sure what the interface should be, but perhaps a sysfs > > attribute would be better than overloading IFF_AUTOMEDIA? > > What about using some tc action (i.e. skbmod) for this? > > Marcelo Why not add to netdevsim rather than cluttering up a normal driver with test support. We just pulled a bunch of test stuff out of dummy for the same reason.