bug fix for out-of-tree igb driver
Subsystems (2)
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
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 18 lines · Ben Greear
Just in case someone is using the out-of-tree igb driver, I think I found a bug.
The
tx_queue_mappingmethod should haver_idx>=adapter->num_tx_queuesas shown below. The driver had:r_idx>adapter->num_tx_queuesoriginally.Its possible my code is buggy for sending
queue_mappingof 1 whennum_tx_queuesis 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(structigb_adapter*adapter,
structsk_buff*skb) {
unsigned intr_idx=skb->queue_mapping& (IGB_MAX_TX_QUEUES- 1);
Quoted 9 lines
if (
r_idx>=adapter->num_tx_queues)r_idx=r_idx%adapter->num_tx_queues;return adapter->tx_ring[r_idx];
}Thanks,
Ben
Thanks Ben, I have copied Carolyn so that she is aware of it.
Signature · 2 lines
Cheers, Jeff
Quoted 38 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ben Greear
Sent: Wednesday, May 04, 2011 11:06 AM
To: netdev
Subject: bug fix for out-of-tree igb driverJust in case someone is using the out-of-tree igb driver, I think I found a bug.
The
tx_queue_mappingmethod should haver_idx>=adapter->num_tx_queuesas shown below. The driver had:r_idx>adapter->num_tx_queuesoriginally.Its possible my code is buggy for sending
queue_mappingof 1 whennum_tx_queuesis 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(structigb_adapter*adapter,
structsk_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
Quoted 8 lines
--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks Ben,
I'll be fixing that ASAP and updating the driver version there.
Carolyn
Carolyn Wyborny
Linux Development
LAN Access Division
Intel Corporation