From: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
To: Somnath Kotur <somnath.kotur@emulex•com>, netdev@vger•kernel.org
Cc: davem@davemloft•net,
Vasundhara Volam <vasundhara.volam@emulex•com>,
Sathya Perla <sathya.perla@emulex•com>
Subject: Re: [PATCH net 5/5] be2net: isolate TX workarounds not applicable to Skyhawk-R
Date: Mon, 24 Feb 2014 22:15:46 +0300 [thread overview]
Message-ID: <530B9A62.9050405@cogentembedded.com> (raw)
In-Reply-To: <ad20d448-e798-4898-9823-898de98d54a2@CMEXHTCAS2.ad.emulex.com>
Hello.
On 02/24/2014 09:51 AM, Somnath Kotur wrote:
> From: Vasundhara Volam <vasundhara.volam@emulex•com>
> Some of TX workarounds in be_xmit_workarounds() routine
> are not applicable (and result in HW errors) to Skyhawk-R chip.
> Isolate BE3-R/Lancer specific workarounds to a separate routine.
>
> Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex•com>
> Signed-off-by: Sathya Perla <sathya.perla@emulex•com>
> Signed-off-by: Somnath Kotur <somnath.kotur@emulex•com>
> ---
> drivers/net/ethernet/emulex/benet/be_main.c | 42 ++++++++++++++++++--------
> 1 files changed, 29 insertions(+), 13 deletions(-)
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index f6a4481..6cf6e2a 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
[...]
> @@ -991,6 +981,32 @@ err:
> return NULL;
> }
>
> +static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
> + struct sk_buff *skb,
> + bool *skip_hw_vlan)
> +{
> + /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or
> + * less may cause a transmit stall on that port. So the work-around is
> + * to pad short packets (<= 32 bytes) to a 36-byte length.
> + */
> + if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
> + if (skb_padto(skb, 36))
> + goto err;
Why not just return NULL?
> + skb->len = 36;
> + }
> +
> + if (BEx_chip(adapter) || lancer_chip(adapter)) {
> + skb = be_lancer_xmit_workarounds(adapter, skb, skip_hw_vlan);
> + if (!skb)
> + goto err;
Likewise...
> + }
> +
> + return skb;
> +
> +err:
> + return NULL;
> +}
> +
WBR, Sergei
prev parent reply other threads:[~2014-02-24 18:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 6:51 [PATCH net 5/5] be2net: isolate TX workarounds not applicable to Skyhawk-R Somnath Kotur
2014-02-24 19:15 ` Sergei Shtylyov [this message]
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=530B9A62.9050405@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
--cc=sathya.perla@emulex$(echo .)com \
--cc=somnath.kotur@emulex$(echo .)com \
--cc=vasundhara.volam@emulex$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox