From: Scott Wood <scottwood@freescale.com>
To: John Rigby <jrigby@freescale.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] MPC5121 FEC support
Date: Tue, 17 Jun 2008 13:01:53 -0500 [thread overview]
Message-ID: <4857FC11.8080903@freescale.com> (raw)
In-Reply-To: <1213724880-14965-1-git-send-email-jrigby@freescale.com>
This patch should go through Jeff Garzik and be CCed to
netdev@vger.kernel.org.
John Rigby wrote:
> drivers/net/fs_enet/fs_enet-main.c
> Add a routine for conditionally copying TX skb's that
> are not aligned. Only do this if fep->fpi->align_tx_packets
> is set.
> In fs_enet_probe set fpi->align_tx_packets to 1 if
> the device node has the property fsl,align-tx-packets.
How about setting the property to the size that it needs to be aligned to?
> +/*
> + * The 5121 FEC doc says transmit buffers must have 4 byte alignment,
> + * however testing has shown that 2 byte alignment works fine except
> + * for buffers that end in 0x1e.
> + *
> + * Testing with iperf shows about 30% cpu load when copying all packets
> + * vs 19% when only copying 0x1e packets.
> + */
> +static struct sk_buff *align_tx_skb(struct net_device *dev, struct sk_buff *skb)
> +{
> + struct sk_buff *skbn;
> + int align = ((unsigned long)skb->data) & (0x1e);
> +
> + if (align != 0x1e)
> + return skb;
Are we guaranteed that skb->data is always 2-byte aligned, even with
obscure protocols?
> + if (!skbn) {
> + printk(KERN_WARNING DRV_MODULE_NAME
> + ": %s Memory squeeze, dropping tx packet.\n",
> + dev->name);
Does this need to be rate-limited?
> - if (!IS_FEC(match)) {
> + if (IS_FEC(match)) {
> + if (of_get_property(ofdev->node, "fsl,align-tx-packets", NULL))
> + fpi->align_tx_packets = 1;
Might as well check for the property regardless of which ethernet type
it is, in case a similar bug crops up elsewhere.
-Scott
next prev parent reply other threads:[~2008-06-17 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-17 17:48 [PATCH] MPC5121 FEC support John Rigby
2008-06-17 18:01 ` Scott Wood [this message]
2008-06-18 0:35 ` Stephen Rothwell
2008-06-18 0:55 ` John Rigby
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=4857FC11.8080903@freescale.com \
--to=scottwood@freescale.com \
--cc=jrigby@freescale.com \
--cc=linuxppc-dev@ozlabs.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.