aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cpmac.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-17 04:56:23 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-17 22:21:07 -0400
commitfd2ea0a79faad824258af5dcec1927aa24d81c16 (patch)
tree644fd4ce92227cc319c7a54c63ea07a96b8c6b8d /drivers/net/cpmac.c
parent24344d2600108b9b79a60c0e4c43b3c499856d14 (diff)
net: Use queue aware tests throughout.
This effectively "flips the switch" by making the core networking and multiqueue-aware drivers use the new TX multiqueue structures. Non-multiqueue drivers need no changes. The interfaces they use such as netif_stop_queue() degenerate into an operation on TX queue zero. So everything "just works" for them. Code that really wants to do "X" to all TX queues now invokes a routine that does so, such as netif_tx_wake_all_queues(), netif_tx_stop_all_queues(), etc. pktgen and netpoll required a little bit more surgery than the others. In particular the pktgen changes, whilst functional, could be largely improved. The initial check in pktgen_xmit() will sometimes check the wrong queue, which is mostly harmless. The thing to do is probably to invoke fill_packet() earlier. The bulk of the netpoll changes is to make the code operate solely on the TX queue indicated by by the SKB queue mapping. Setting of the SKB queue mapping is entirely confined inside of net/core/dev.c:dev_pick_tx(). If we end up needing any kind of special semantics (drops, for example) it will be implemented here. Finally, we now have a "real_num_tx_queues" which is where the driver indicates how many TX queues are actually active. With IGB changes from Jeff Kirsher. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cpmac.c')
-rw-r--r--drivers/net/cpmac.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index 7c7b54e4828e..fbd4280c102c 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -544,7 +544,7 @@ fatal_error:
544 544
545 spin_unlock(&priv->rx_lock); 545 spin_unlock(&priv->rx_lock);
546 netif_rx_complete(priv->dev, napi); 546 netif_rx_complete(priv->dev, napi);
547 netif_stop_queue(priv->dev); 547 netif_tx_stop_all_queues(priv->dev);
548 napi_disable(&priv->napi); 548 napi_disable(&priv->napi);
549 549
550 atomic_inc(&priv->reset_pending); 550 atomic_inc(&priv->reset_pending);
@@ -750,9 +750,7 @@ static void cpmac_hw_error(struct work_struct *work)
750 barrier(); 750 barrier();
751 atomic_dec(&priv->reset_pending); 751 atomic_dec(&priv->reset_pending);
752 752
753 for (i = 0; i < CPMAC_QUEUES; i++) 753 netif_tx_wake_all_queues(priv->dev);
754 netif_wake_subqueue(priv->dev, i);
755 netif_wake_queue(priv->dev);
756 cpmac_write(priv->regs, CPMAC_MAC_INT_ENABLE, 3); 754 cpmac_write(priv->regs, CPMAC_MAC_INT_ENABLE, 3);
757} 755}
758 756
@@ -781,7 +779,7 @@ static void cpmac_check_status(struct net_device *dev)
781 dev->name, tx_code, tx_channel, macstatus); 779 dev->name, tx_code, tx_channel, macstatus);
782 } 780 }
783 781
784 netif_stop_queue(dev); 782 netif_tx_stop_all_queues(dev);
785 cpmac_hw_stop(dev); 783 cpmac_hw_stop(dev);
786 if (schedule_work(&priv->reset_work)) 784 if (schedule_work(&priv->reset_work))
787 atomic_inc(&priv->reset_pending); 785 atomic_inc(&priv->reset_pending);
@@ -842,9 +840,7 @@ static void cpmac_tx_timeout(struct net_device *dev)
842 barrier(); 840 barrier();
843 atomic_dec(&priv->reset_pending); 841 atomic_dec(&priv->reset_pending);
844 842
845 netif_wake_queue(priv->dev); 843 netif_tx_wake_all_queues(priv->dev);
846 for (i = 0; i < CPMAC_QUEUES; i++)
847 netif_wake_subqueue(dev, i);
848} 844}
849 845
850static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 846static int cpmac_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -935,7 +931,7 @@ static void cpmac_adjust_link(struct net_device *dev)
935 931
936 spin_lock(&priv->lock); 932 spin_lock(&priv->lock);
937 if (priv->phy->link) { 933 if (priv->phy->link) {
938 netif_start_queue(dev); 934 netif_tx_start_all_queues(dev);
939 if (priv->phy->duplex != priv->oldduplex) { 935 if (priv->phy->duplex != priv->oldduplex) {
940 new_state = 1; 936 new_state = 1;
941 priv->oldduplex = priv->phy->duplex; 937 priv->oldduplex = priv->phy->duplex;
@@ -949,10 +945,10 @@ static void cpmac_adjust_link(struct net_device *dev)
949 if (!priv->oldlink) { 945 if (!priv->oldlink) {
950 new_state = 1; 946 new_state = 1;
951 priv->oldlink = 1; 947 priv->oldlink = 1;
952 netif_schedule(dev); 948 netif_tx_schedule_all(dev);
953 } 949 }
954 } else if (priv->oldlink) { 950 } else if (priv->oldlink) {
955 netif_stop_queue(dev); 951 netif_tx_stop_all_queues(dev);
956 new_state = 1; 952 new_state = 1;
957 priv->oldlink = 0; 953 priv->oldlink = 0;
958 priv->oldspeed = 0; 954 priv->oldspeed = 0;
@@ -1072,7 +1068,7 @@ static int cpmac_stop(struct net_device *dev)
1072 struct cpmac_priv *priv = netdev_priv(dev); 1068 struct cpmac_priv *priv = netdev_priv(dev);
1073 struct resource *mem; 1069 struct resource *mem;
1074 1070
1075 netif_stop_queue(dev); 1071 netif_tx_stop_all_queues(dev);
1076 1072
1077 cancel_work_sync(&priv->reset_work); 1073 cancel_work_sync(&priv->reset_work);
1078 napi_disable(&priv->napi); 1074 napi_disable(&priv->napi);