From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Dan Williams <dcbw@redhat.com>
Cc: Ed Swierk <eswierk@skyportsystems.com>,
netdev@vger.kernel.org, Benjamin Warren <ben@skyportsystems.com>,
Keith Holleman <holleman@skyportsystems.com>
Subject: Re: [PATCH] veth: Optionally pad packets to minimum Ethernet length
Date: Tue, 12 Dec 2017 16:18:17 -0200 [thread overview]
Message-ID: <20171212181817.GB3531@localhost.localdomain> (raw)
In-Reply-To: <1513099966.26538.1.camel@redhat.com>
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
>
> Dan
>
> > Signed-off-by: Ed Swierk <eswierk@skyportsystems.com>
> > ---
> > drivers/net/veth.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> > index f5438d0978ca..292029bf4bb2 100644
> > --- a/drivers/net/veth.c
> > +++ b/drivers/net/veth.c
> > @@ -111,6 +111,12 @@ static netdev_tx_t veth_xmit(struct sk_buff
> > *skb, struct net_device *dev)
> > goto drop;
> > }
> >
> > + if (unlikely(dev->flags & IFF_AUTOMEDIA)) {
> > + /* if eth_skb_pad returns an error the skb was freed
> > */
> > + if (eth_skb_pad(skb))
> > + goto drop;
> > + }
> > +
> > if (likely(dev_forward_skb(rcv, skb) == NET_RX_SUCCESS)) {
> > struct pcpu_vstats *stats = this_cpu_ptr(dev-
> > >vstats);
> >
>
next prev parent reply other threads:[~2017-12-12 18:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 16:13 [PATCH] veth: Optionally pad packets to minimum Ethernet length Ed Swierk
2017-12-12 17:32 ` Dan Williams
2017-12-12 18:18 ` Marcelo Ricardo Leitner [this message]
2017-12-12 18:34 ` Stephen Hemminger
2017-12-12 19:00 ` Ed Swierk
2017-12-12 22:01 ` Stephen Hemminger
2017-12-12 21:11 ` Cong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171212181817.GB3531@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=ben@skyportsystems.com \
--cc=dcbw@redhat.com \
--cc=eswierk@skyportsystems.com \
--cc=holleman@skyportsystems.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.