Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200877
b: refs/heads/master
c: f0796d5
h: refs/heads/master
i:
  200875: f98684b
v: v3
  • Loading branch information
John Fastabend authored and David S. Miller committed Jul 3, 2010
1 parent 483750a commit f2a9062
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ef6acff83222f4496ceef7d1f0ee9e50a5bb403
refs/heads/master: f0796d5c73e59786d09a1e617689d1d415f2db44
2 changes: 1 addition & 1 deletion trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4001,7 +4001,7 @@ static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)

done:
/* Notify the stack of the (possibly) reduced Tx Queue count. */
adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
}

static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter,
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,9 @@ static inline int netif_is_multiqueue(const struct net_device *dev)
return (dev->num_tx_queues > 1);
}

extern void netif_set_real_num_tx_queues(struct net_device *dev,
unsigned int txq);

/* Use this variant when it is known for sure that it
* is executing from hardware interrupt context or with hardware interrupts
* disabled.
Expand Down
12 changes: 8 additions & 4 deletions trunk/include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,12 @@ extern void qdisc_calculate_pkt_len(struct sk_buff *skb,
extern void tcf_destroy(struct tcf_proto *tp);
extern void tcf_destroy_chain(struct tcf_proto **fl);

/* Reset all TX qdiscs of a device. */
static inline void qdisc_reset_all_tx(struct net_device *dev)
/* Reset all TX qdiscs greater then index of a device. */
static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
{
unsigned int i;
struct Qdisc *qdisc;

for (i = 0; i < dev->num_tx_queues; i++) {
for (; i < dev->num_tx_queues; i++) {
qdisc = netdev_get_tx_queue(dev, i)->qdisc;
if (qdisc) {
spin_lock_bh(qdisc_lock(qdisc));
Expand All @@ -329,6 +328,11 @@ static inline void qdisc_reset_all_tx(struct net_device *dev)
}
}

static inline void qdisc_reset_all_tx(struct net_device *dev)
{
qdisc_reset_all_tx_gt(dev, 0);
}

/* Are all TX queues of the device empty? */
static inline bool qdisc_all_tx_empty(const struct net_device *dev)
{
Expand Down
18 changes: 18 additions & 0 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,24 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
rcu_read_unlock();
}

/*
* Routine to help set real_num_tx_queues. To avoid skbs mapped to queues
* greater then real_num_tx_queues stale skbs on the qdisc must be flushed.
*/
void netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
{
unsigned int real_num = dev->real_num_tx_queues;

if (unlikely(txq > dev->num_tx_queues))
;
else if (txq > real_num)
dev->real_num_tx_queues = txq;
else if (txq < real_num) {
dev->real_num_tx_queues = txq;
qdisc_reset_all_tx_gt(dev, txq);
}
}
EXPORT_SYMBOL(netif_set_real_num_tx_queues);

static inline void __netif_reschedule(struct Qdisc *q)
{
Expand Down

0 comments on commit f2a9062

Please sign in to comment.