aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge_dbg.c
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-02-23 05:42:14 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-25 02:50:00 -0500
commitcc288f54bbace136c08742da84712add54e4acfa (patch)
tree6e4742f194bc787fa3cf9c2c416e95e02204a5ab /drivers/net/qlge/qlge_dbg.c
parentbb58b5b67c08b5fde08090917a040a07ac9d43de (diff)
qlge: Increase MAC addr hw sem granularity.
Instead of taking/giving the semaphore repeatedly when iterating over several adderesses, we have the caller hold it until all are done. This reduces PCI bus chatter and possible waits. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_dbg.c')
-rw-r--r--drivers/net/qlge/qlge_dbg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c
index 379b895ed6e6..40a70c36f5ae 100644
--- a/drivers/net/qlge/qlge_dbg.c
+++ b/drivers/net/qlge/qlge_dbg.c
@@ -83,6 +83,10 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev)
83{ 83{
84 int i; 84 int i;
85 u32 value[3]; 85 u32 value[3];
86
87 i = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
88 if (i)
89 return;
86 for (i = 0; i < 4; i++) { 90 for (i = 0; i < 4; i++) {
87 if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) { 91 if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) {
88 printk(KERN_ERR PFX 92 printk(KERN_ERR PFX
@@ -111,12 +115,16 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev)
111 qdev->ndev->name, i, value[1], value[0]); 115 qdev->ndev->name, i, value[1], value[0]);
112 } 116 }
113 } 117 }
118 ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK);
114} 119}
115 120
116void ql_dump_routing_entries(struct ql_adapter *qdev) 121void ql_dump_routing_entries(struct ql_adapter *qdev)
117{ 122{
118 int i; 123 int i;
119 u32 value; 124 u32 value;
125 i = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK);
126 if (i)
127 return;
120 for (i = 0; i < 16; i++) { 128 for (i = 0; i < 16; i++) {
121 value = 0; 129 value = 0;
122 if (ql_get_routing_reg(qdev, i, &value)) { 130 if (ql_get_routing_reg(qdev, i, &value)) {
@@ -131,6 +139,7 @@ void ql_dump_routing_entries(struct ql_adapter *qdev)
131 qdev->ndev->name, i, value); 139 qdev->ndev->name, i, value);
132 } 140 }
133 } 141 }
142 ql_sem_unlock(qdev, SEM_RT_IDX_MASK);
134} 143}
135 144
136void ql_dump_regs(struct ql_adapter *qdev) 145void ql_dump_regs(struct ql_adapter *qdev)