From: Ben Greear <greearb@candelatech.com>
To: netdev <netdev@vger.kernel.org>
Subject: bug fix for out-of-tree igb driver
Date: Wed, 04 May 2011 11:06:19 -0700 [thread overview]
Message-ID: <4DC1959B.4010609@candelatech.com> (raw)
Just in case someone is using the out-of-tree igb driver, I
think I found a bug.
The tx_queue_mapping method should have r_idx >= adapter->num_tx_queues
as shown below. The driver had: r_idx > adapter->num_tx_queues originally.
Its possible my code is buggy for sending queue_mapping of 1
when num_tx_queues is 1, but either way, the driver
shouldn't crash.
Upstream igb driver in mainline kernels does not have this problem.
static inline struct igb_ring *igb_tx_queue_mapping(struct igb_adapter *adapter,
struct sk_buff *skb)
{
unsigned int r_idx = skb->queue_mapping & (IGB_MAX_TX_QUEUES - 1);
if (r_idx >= adapter->num_tx_queues)
r_idx = r_idx % adapter->num_tx_queues;
return adapter->tx_ring[r_idx];
}
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next reply other threads:[~2011-05-04 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 18:06 Ben Greear [this message]
2011-05-04 18:12 ` bug fix for out-of-tree igb driver Jeff Kirsher
2011-05-04 18:36 ` Wyborny, Carolyn
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=4DC1959B.4010609@candelatech.com \
--to=greearb@candelatech.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.