[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <530B9A62.9050405@cogentembedded.com>
Date: Mon, 24 Feb 2014 22:15:46 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Somnath Kotur <somnath.kotur@...lex.com>, netdev@...r.kernel.org
CC: davem@...emloft.net,
Vasundhara Volam <vasundhara.volam@...lex.com>,
Sathya Perla <sathya.perla@...lex.com>
Subject: Re: [PATCH net 5/5] be2net: isolate TX workarounds not applicable
to Skyhawk-R
Hello.
On 02/24/2014 09:51 AM, Somnath Kotur wrote:
> From: Vasundhara Volam <vasundhara.volam@...lex.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@...lex.com>
> Signed-off-by: Sathya Perla <sathya.perla@...lex.com>
> Signed-off-by: Somnath Kotur <somnath.kotur@...lex.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists