From: Dan Williams <dcbw@redhat.com>
To: Javier Cardona <javier@cozybit.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] libertas: Retry frame transmission when driver is busy.
Date: Mon, 05 Nov 2007 10:20:41 -0500 [thread overview]
Message-ID: <1194276041.18807.28.camel@localhost.localdomain> (raw)
In-Reply-To: <472d2e3e.18b38c0a.2c31.1a76@mx.google.com>
On Sat, 2007-11-03 at 19:28 -0700, Ashish Shukla wrote:
> The driver silently discards frames when some command is pending -- returns
> NETDEV_TX_OK to kernel. The following patch fixes this problem. This
> significantly improves file transfers while scanning (ticket #3341).
>
> Signed-off-by: Javier Cardona <javier@cozybit.com>
>
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index 83d534b..f72ebe2 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -509,22 +509,25 @@ static int libertas_close(struct net_device *dev)
>
> static int libertas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
> {
> - int ret = 0;
> + int ret = NETDEV_TX_OK;
> wlan_private *priv = dev->priv;
>
> lbs_deb_enter(LBS_DEB_NET);
>
> - if (priv->dnld_sent || priv->adapter->TxLockFlag) {
> - priv->stats.tx_dropped++;
> - goto done;
> - }
> -
> netif_stop_queue(priv->dev);
> if (priv->mesh_dev)
> netif_stop_queue(priv->mesh_dev);
>
> - if (libertas_process_tx(priv, skb) == 0)
> + if (priv->dnld_sent || priv->adapter->TxLockFlag) {
> + ret = NETDEV_TX_BUSY;
> + goto done;
> + }
> +
> + ret = libertas_process_tx(priv, skb);
> + if (ret == NETDEV_TX_OK)
> dev->trans_start = jiffies;
> + else if (ret == -1)
> + ret = NETDEV_TX_OK;
The one concern I have here (and I admit I don't know much about network
driver TX paths) is that SendSinglePacket() will return -1 on error
(like adapter got removed), which returns to libertas_process_tx() which
returns here and would then return NETDEV_TX_OK. Is that an OK thing to
do?
Dan
> done:
> lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> return ret;
> diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
> index bc9c2e1..1dc92ee 100644
> --- a/drivers/net/wireless/libertas/tx.c
> +++ b/drivers/net/wireless/libertas/tx.c
> @@ -218,6 +218,7 @@ int libertas_process_tx(wlan_private * priv, struct sk_buff *skb)
> if (priv->dnld_sent) {
> lbs_pr_alert( "TX error: dnld_sent = %d, not sending\n",
> priv->dnld_sent);
> + ret = NETDEV_TX_BUSY;
> goto done;
> }
>
prev parent reply other threads:[~2007-11-05 15:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-04 2:28 [PATCH] libertas: Retry frame transmission when driver is busy Ashish Shukla
2007-11-05 15:20 ` Dan Williams [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=1194276041.18807.28.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=javier@cozybit.com \
--cc=linux-wireless@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox