aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/nes/nes.c58
-rw-r--r--drivers/infiniband/hw/nes/nes.h2
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c3
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.h2
4 files changed, 63 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index 30c93db5a74e..a2b04d62b1a4 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -91,6 +91,10 @@ unsigned int nes_debug_level = 0;
91module_param_named(debug_level, nes_debug_level, uint, 0644); 91module_param_named(debug_level, nes_debug_level, uint, 0644);
92MODULE_PARM_DESC(debug_level, "Enable debug output level"); 92MODULE_PARM_DESC(debug_level, "Enable debug output level");
93 93
94unsigned int wqm_quanta = 0x10000;
95module_param(wqm_quanta, int, 0644);
96MODULE_PARM_DESC(wqm_quanta, "WQM quanta");
97
94LIST_HEAD(nes_adapter_list); 98LIST_HEAD(nes_adapter_list);
95static LIST_HEAD(nes_dev_list); 99static LIST_HEAD(nes_dev_list);
96 100
@@ -557,6 +561,7 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
557 goto bail5; 561 goto bail5;
558 } 562 }
559 nesdev->nesadapter->et_rx_coalesce_usecs_irq = interrupt_mod_interval; 563 nesdev->nesadapter->et_rx_coalesce_usecs_irq = interrupt_mod_interval;
564 nesdev->nesadapter->wqm_quanta = wqm_quanta;
560 565
561 /* nesdev->base_doorbell_index = 566 /* nesdev->base_doorbell_index =
562 nesdev->nesadapter->pd_config_base[PCI_FUNC(nesdev->pcidev->devfn)]; */ 567 nesdev->nesadapter->pd_config_base[PCI_FUNC(nesdev->pcidev->devfn)]; */
@@ -1069,6 +1074,55 @@ static ssize_t nes_store_idx_data(struct device_driver *ddp,
1069 return strnlen(buf, count); 1074 return strnlen(buf, count);
1070} 1075}
1071 1076
1077
1078/**
1079 * nes_show_wqm_quanta
1080 */
1081static ssize_t nes_show_wqm_quanta(struct device_driver *ddp, char *buf)
1082{
1083 u32 wqm_quanta_value = 0xdead;
1084 u32 i = 0;
1085 struct nes_device *nesdev;
1086
1087 list_for_each_entry(nesdev, &nes_dev_list, list) {
1088 if (i == ee_flsh_adapter) {
1089 wqm_quanta_value = nesdev->nesadapter->wqm_quanta;
1090 break;
1091 }
1092 i++;
1093 }
1094
1095 return snprintf(buf, PAGE_SIZE, "0x%X\n", wqm_quanta);
1096}
1097
1098
1099/**
1100 * nes_store_wqm_quanta
1101 */
1102static ssize_t nes_store_wqm_quanta(struct device_driver *ddp,
1103 const char *buf, size_t count)
1104{
1105 unsigned long wqm_quanta_value;
1106 u32 wqm_config1;
1107 u32 i = 0;
1108 struct nes_device *nesdev;
1109
1110 strict_strtoul(buf, 0, &wqm_quanta_value);
1111 list_for_each_entry(nesdev, &nes_dev_list, list) {
1112 if (i == ee_flsh_adapter) {
1113 nesdev->nesadapter->wqm_quanta = wqm_quanta_value;
1114 wqm_config1 = nes_read_indexed(nesdev,
1115 NES_IDX_WQM_CONFIG1);
1116 nes_write_indexed(nesdev, NES_IDX_WQM_CONFIG1,
1117 ((wqm_quanta_value << 1) |
1118 (wqm_config1 & 0x00000001)));
1119 break;
1120 }
1121 i++;
1122 }
1123 return strnlen(buf, count);
1124}
1125
1072static DRIVER_ATTR(adapter, S_IRUSR | S_IWUSR, 1126static DRIVER_ATTR(adapter, S_IRUSR | S_IWUSR,
1073 nes_show_adapter, nes_store_adapter); 1127 nes_show_adapter, nes_store_adapter);
1074static DRIVER_ATTR(eeprom_cmd, S_IRUSR | S_IWUSR, 1128static DRIVER_ATTR(eeprom_cmd, S_IRUSR | S_IWUSR,
@@ -1087,6 +1141,8 @@ static DRIVER_ATTR(idx_addr, S_IRUSR | S_IWUSR,
1087 nes_show_idx_addr, nes_store_idx_addr); 1141 nes_show_idx_addr, nes_store_idx_addr);
1088static DRIVER_ATTR(idx_data, S_IRUSR | S_IWUSR, 1142static DRIVER_ATTR(idx_data, S_IRUSR | S_IWUSR,
1089 nes_show_idx_data, nes_store_idx_data); 1143 nes_show_idx_data, nes_store_idx_data);
1144static DRIVER_ATTR(wqm_quanta, S_IRUSR | S_IWUSR,
1145 nes_show_wqm_quanta, nes_store_wqm_quanta);
1090 1146
1091static int nes_create_driver_sysfs(struct pci_driver *drv) 1147static int nes_create_driver_sysfs(struct pci_driver *drv)
1092{ 1148{
@@ -1100,6 +1156,7 @@ static int nes_create_driver_sysfs(struct pci_driver *drv)
1100 error |= driver_create_file(&drv->driver, &driver_attr_nonidx_data); 1156 error |= driver_create_file(&drv->driver, &driver_attr_nonidx_data);
1101 error |= driver_create_file(&drv->driver, &driver_attr_idx_addr); 1157 error |= driver_create_file(&drv->driver, &driver_attr_idx_addr);
1102 error |= driver_create_file(&drv->driver, &driver_attr_idx_data); 1158 error |= driver_create_file(&drv->driver, &driver_attr_idx_data);
1159 error |= driver_create_file(&drv->driver, &driver_attr_wqm_quanta);
1103 return error; 1160 return error;
1104} 1161}
1105 1162
@@ -1114,6 +1171,7 @@ static void nes_remove_driver_sysfs(struct pci_driver *drv)
1114 driver_remove_file(&drv->driver, &driver_attr_nonidx_data); 1171 driver_remove_file(&drv->driver, &driver_attr_nonidx_data);
1115 driver_remove_file(&drv->driver, &driver_attr_idx_addr); 1172 driver_remove_file(&drv->driver, &driver_attr_idx_addr);
1116 driver_remove_file(&drv->driver, &driver_attr_idx_data); 1173 driver_remove_file(&drv->driver, &driver_attr_idx_data);
1174 driver_remove_file(&drv->driver, &driver_attr_wqm_quanta);
1117} 1175}
1118 1176
1119/** 1177/**
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
index 8eb7ae96974d..1595dc7bba9d 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -169,7 +169,7 @@ extern int disable_mpa_crc;
169extern unsigned int send_first; 169extern unsigned int send_first;
170extern unsigned int nes_drv_opt; 170extern unsigned int nes_drv_opt;
171extern unsigned int nes_debug_level; 171extern unsigned int nes_debug_level;
172 172extern unsigned int wqm_quanta;
173extern struct list_head nes_adapter_list; 173extern struct list_head nes_adapter_list;
174 174
175extern atomic_t cm_connects; 175extern atomic_t cm_connects;
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index bdd98e66f432..0e259a8b307f 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -861,7 +861,8 @@ static void nes_init_csr_ne020(struct nes_device *nesdev, u8 hw_rev, u8 port_cou
861 861
862 nes_write_indexed(nesdev, 0x00005000, 0x00018000); 862 nes_write_indexed(nesdev, 0x00005000, 0x00018000);
863 /* nes_write_indexed(nesdev, 0x00005000, 0x00010000); */ 863 /* nes_write_indexed(nesdev, 0x00005000, 0x00010000); */
864 nes_write_indexed(nesdev, 0x00005004, 0x00020001); 864 nes_write_indexed(nesdev, NES_IDX_WQM_CONFIG1, (wqm_quanta << 1) |
865 0x00000001);
865 nes_write_indexed(nesdev, 0x00005008, 0x1F1F1F1F); 866 nes_write_indexed(nesdev, 0x00005008, 0x1F1F1F1F);
866 nes_write_indexed(nesdev, 0x00005010, 0x1F1F1F1F); 867 nes_write_indexed(nesdev, 0x00005010, 0x1F1F1F1F);
867 nes_write_indexed(nesdev, 0x00005018, 0x1F1F1F1F); 868 nes_write_indexed(nesdev, 0x00005018, 0x1F1F1F1F);
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index fc0f063ce248..82d06766ad52 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -156,6 +156,7 @@ enum indexed_regs {
156 NES_IDX_ENDNODE0_NSTAT_TX_OCTETS_HI = 0x7004, 156 NES_IDX_ENDNODE0_NSTAT_TX_OCTETS_HI = 0x7004,
157 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_LO = 0x7008, 157 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_LO = 0x7008,
158 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_HI = 0x700c, 158 NES_IDX_ENDNODE0_NSTAT_TX_FRAMES_HI = 0x700c,
159 NES_IDX_WQM_CONFIG1 = 0x5004,
159 NES_IDX_CM_CONFIG = 0x5100, 160 NES_IDX_CM_CONFIG = 0x5100,
160 NES_IDX_NIC_LOGPORT_TO_PHYPORT = 0x6000, 161 NES_IDX_NIC_LOGPORT_TO_PHYPORT = 0x6000,
161 NES_IDX_NIC_PHYPORT_TO_USW = 0x6008, 162 NES_IDX_NIC_PHYPORT_TO_USW = 0x6008,
@@ -1079,6 +1080,7 @@ struct nes_adapter {
1079 u32 et_rx_max_coalesced_frames_high; 1080 u32 et_rx_max_coalesced_frames_high;
1080 u32 et_rate_sample_interval; 1081 u32 et_rate_sample_interval;
1081 u32 timer_int_limit; 1082 u32 timer_int_limit;
1083 u32 wqm_quanta;
1082 1084
1083 /* Adapter base MAC address */ 1085 /* Adapter base MAC address */
1084 u32 mac_addr_low; 1086 u32 mac_addr_low;