aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRalph Campbell <ralph.campbell@qlogic.com>2008-01-07 00:02:34 -0500
committerRoland Dreier <rolandd@cisco.com>2008-01-25 17:15:39 -0500
commit60948a415859cb859e24f0dfe739069d66577466 (patch)
tree392b6e21c7041998600a78821dc1ba1fba9c6572 /drivers/infiniband
parenta18e26ae442001de62f6b84a923e8613347dc35f (diff)
IB/ipath: Port config has on-chip effects for 7220
The number of configured ports for the 7220 changes the number of eager TIDs available per port, for all but port 0 (kernel port) which remains constant, so add a field to give port0 count separate from the portdata structure. Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_iba6110.c9
-rw-r--r--drivers/infiniband/hw/ipath/ipath_iba6120.c9
-rw-r--r--drivers/infiniband/hw/ipath/ipath_init_chip.c5
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h3
5 files changed, 24 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 0b877ed76712..7b2f59af9c91 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -882,7 +882,7 @@ static int ipath_create_user_egr(struct ipath_portdata *pd)
882 882
883 egrcnt = dd->ipath_rcvegrcnt; 883 egrcnt = dd->ipath_rcvegrcnt;
884 /* TID number offset for this port */ 884 /* TID number offset for this port */
885 egroff = pd->port_port * egrcnt; 885 egroff = (pd->port_port - 1) * egrcnt + dd->ipath_p0_rcvegrcnt;
886 egrsize = dd->ipath_rcvegrbufsize; 886 egrsize = dd->ipath_rcvegrbufsize;
887 ipath_cdbg(VERBOSE, "Allocating %d egr buffers, at egrtid " 887 ipath_cdbg(VERBOSE, "Allocating %d egr buffers, at egrtid "
888 "offset %x, egrsize %u\n", egrcnt, egroff, egrsize); 888 "offset %x, egrsize %u\n", egrcnt, egroff, egrsize);
diff --git a/drivers/infiniband/hw/ipath/ipath_iba6110.c b/drivers/infiniband/hw/ipath/ipath_iba6110.c
index 5ecf65b8f85a..0c900c51e538 100644
--- a/drivers/infiniband/hw/ipath/ipath_iba6110.c
+++ b/drivers/infiniband/hw/ipath/ipath_iba6110.c
@@ -1669,6 +1669,14 @@ static void ipath_ht_free_irq(struct ipath_devdata *dd)
1669 dd->ipath_intconfig = 0; 1669 dd->ipath_intconfig = 0;
1670} 1670}
1671 1671
1672static void ipath_ht_config_ports(struct ipath_devdata *dd, ushort cfgports)
1673{
1674 dd->ipath_portcnt =
1675 ipath_read_kreg32(dd, dd->ipath_kregs->kr_portcnt);
1676 dd->ipath_p0_rcvegrcnt =
1677 ipath_read_kreg32(dd, dd->ipath_kregs->kr_rcvegrcnt);
1678}
1679
1672static void ipath_ht_read_counters(struct ipath_devdata *dd, 1680static void ipath_ht_read_counters(struct ipath_devdata *dd,
1673 struct infinipath_counters *cntrs) 1681 struct infinipath_counters *cntrs)
1674{ 1682{
@@ -1798,6 +1806,7 @@ void ipath_init_iba6110_funcs(struct ipath_devdata *dd)
1798 dd->ipath_f_setextled = ipath_setup_ht_setextled; 1806 dd->ipath_f_setextled = ipath_setup_ht_setextled;
1799 dd->ipath_f_get_base_info = ipath_ht_get_base_info; 1807 dd->ipath_f_get_base_info = ipath_ht_get_base_info;
1800 dd->ipath_f_free_irq = ipath_ht_free_irq; 1808 dd->ipath_f_free_irq = ipath_ht_free_irq;
1809 dd->ipath_f_config_ports = ipath_ht_config_ports;
1801 dd->ipath_f_read_counters = ipath_ht_read_counters; 1810 dd->ipath_f_read_counters = ipath_ht_read_counters;
1802 1811
1803 /* 1812 /*
diff --git a/drivers/infiniband/hw/ipath/ipath_iba6120.c b/drivers/infiniband/hw/ipath/ipath_iba6120.c
index 23de8da0f16b..066a8ea4b4df 100644
--- a/drivers/infiniband/hw/ipath/ipath_iba6120.c
+++ b/drivers/infiniband/hw/ipath/ipath_iba6120.c
@@ -1423,6 +1423,14 @@ static void ipath_pe_free_irq(struct ipath_devdata *dd)
1423 dd->ipath_irq = 0; 1423 dd->ipath_irq = 0;
1424} 1424}
1425 1425
1426static void ipath_pe_config_ports(struct ipath_devdata *dd, ushort cfgports)
1427{
1428 dd->ipath_portcnt =
1429 ipath_read_kreg32(dd, dd->ipath_kregs->kr_portcnt);
1430 dd->ipath_p0_rcvegrcnt =
1431 ipath_read_kreg32(dd, dd->ipath_kregs->kr_rcvegrcnt);
1432}
1433
1426static void ipath_pe_read_counters(struct ipath_devdata *dd, 1434static void ipath_pe_read_counters(struct ipath_devdata *dd,
1427 struct infinipath_counters *cntrs) 1435 struct infinipath_counters *cntrs)
1428{ 1436{
@@ -1581,6 +1589,7 @@ void ipath_init_iba6120_funcs(struct ipath_devdata *dd)
1581 1589
1582 /* initialize chip-specific variables */ 1590 /* initialize chip-specific variables */
1583 dd->ipath_f_tidtemplate = ipath_pe_tidtemplate; 1591 dd->ipath_f_tidtemplate = ipath_pe_tidtemplate;
1592 dd->ipath_f_config_ports = ipath_pe_config_ports;
1584 dd->ipath_f_read_counters = ipath_pe_read_counters; 1593 dd->ipath_f_read_counters = ipath_pe_read_counters;
1585 1594
1586 /* 1595 /*
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c
index 98b51465b58d..3174c315999b 100644
--- a/drivers/infiniband/hw/ipath/ipath_init_chip.c
+++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c
@@ -91,7 +91,7 @@ static int create_port0_egr(struct ipath_devdata *dd)
91 struct ipath_skbinfo *skbinfo; 91 struct ipath_skbinfo *skbinfo;
92 int ret; 92 int ret;
93 93
94 egrcnt = dd->ipath_rcvegrcnt; 94 egrcnt = dd->ipath_p0_rcvegrcnt;
95 95
96 skbinfo = vmalloc(sizeof(*dd->ipath_port0_skbinfo) * egrcnt); 96 skbinfo = vmalloc(sizeof(*dd->ipath_port0_skbinfo) * egrcnt);
97 if (skbinfo == NULL) { 97 if (skbinfo == NULL) {
@@ -244,8 +244,7 @@ static int init_chip_first(struct ipath_devdata *dd,
244 * cfgports. We do still check and report a difference, if 244 * cfgports. We do still check and report a difference, if
245 * not same (should be impossible). 245 * not same (should be impossible).
246 */ 246 */
247 dd->ipath_portcnt = 247 dd->ipath_f_config_ports(dd, ipath_cfgports);
248 ipath_read_kreg32(dd, dd->ipath_kregs->kr_portcnt);
249 if (!ipath_cfgports) 248 if (!ipath_cfgports)
250 dd->ipath_cfgports = dd->ipath_portcnt; 249 dd->ipath_cfgports = dd->ipath_portcnt;
251 else if (ipath_cfgports <= dd->ipath_portcnt) { 250 else if (ipath_cfgports <= dd->ipath_portcnt) {
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 08272bef2475..b9cca8403239 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -253,6 +253,7 @@ struct ipath_devdata {
253 int (*ipath_f_get_base_info)(struct ipath_portdata *, void *); 253 int (*ipath_f_get_base_info)(struct ipath_portdata *, void *);
254 /* free irq */ 254 /* free irq */
255 void (*ipath_f_free_irq)(struct ipath_devdata *); 255 void (*ipath_f_free_irq)(struct ipath_devdata *);
256 void (*ipath_f_config_ports)(struct ipath_devdata *, ushort);
256 void (*ipath_f_read_counters)(struct ipath_devdata *, 257 void (*ipath_f_read_counters)(struct ipath_devdata *,
257 struct infinipath_counters *); 258 struct infinipath_counters *);
258 struct ipath_ibdev *verbs_dev; 259 struct ipath_ibdev *verbs_dev;
@@ -326,6 +327,8 @@ struct ipath_devdata {
326 u32 ipath_cfgports; 327 u32 ipath_cfgports;
327 /* count of port 0 hdrqfull errors */ 328 /* count of port 0 hdrqfull errors */
328 u32 ipath_p0_hdrqfull; 329 u32 ipath_p0_hdrqfull;
330 /* port 0 number of receive eager buffers */
331 u32 ipath_p0_rcvegrcnt;
329 332
330 /* 333 /*
331 * index of last piobuffer we used. Speeds up searching, by 334 * index of last piobuffer we used. Speeds up searching, by