aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge
diff options
context:
space:
mode:
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>2010-03-28 18:11:41 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-29 19:57:22 -0400
commitb59c94571a6593c71a78bbcebb42982099154938 (patch)
tree32e6cfca72e2b24ebb2f399f68637bca54e6163a /drivers/net/vxge
parent4c5f3b210f53e315e460d539655a8d14595c5d1a (diff)
vxge: Fixed MSIX interrupt configuration.
- Fixed MSIX interrupt configuration to support non contiguous vpaths in functions. Four msi-x vectors are reserved per vpath internal to the chip. In all, there are 68 msi-x vectors for the 17 vpaths in the chip. In the multi function configurations, non-contiguous vpaths are configured to represent a function. For instance vpaths 0 and 8 can be configured to represent function zero. - If pci_enable_msix fails for the requested vectors, try with a lesser number vectors by reducing the vpath count. Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge')
-rw-r--r--drivers/net/vxge/vxge-main.c163
-rw-r--r--drivers/net/vxge/vxge-main.h1
-rw-r--r--drivers/net/vxge/vxge-traffic.c35
-rw-r--r--drivers/net/vxge/vxge-traffic.h2
4 files changed, 81 insertions, 120 deletions
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index cada8fc51d4f..e5f2d3ee0df3 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -1363,28 +1363,26 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p)
1363void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id) 1363void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id)
1364{ 1364{
1365 struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; 1365 struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
1366 int msix_id, alarm_msix_id; 1366 int msix_id = 0;
1367 int tim_msix_id[4] = {[0 ...3] = 0}; 1367 int tim_msix_id[4] = {0, 1, 0, 0};
1368 int alarm_msix_id = VXGE_ALARM_MSIX_ID;
1368 1369
1369 vxge_hw_vpath_intr_enable(vpath->handle); 1370 vxge_hw_vpath_intr_enable(vpath->handle);
1370 1371
1371 if (vdev->config.intr_type == INTA) 1372 if (vdev->config.intr_type == INTA)
1372 vxge_hw_vpath_inta_unmask_tx_rx(vpath->handle); 1373 vxge_hw_vpath_inta_unmask_tx_rx(vpath->handle);
1373 else { 1374 else {
1374 msix_id = vp_id * VXGE_HW_VPATH_MSIX_ACTIVE;
1375 alarm_msix_id =
1376 VXGE_HW_VPATH_MSIX_ACTIVE * vdev->no_of_vpath - 2;
1377
1378 tim_msix_id[0] = msix_id;
1379 tim_msix_id[1] = msix_id + 1;
1380 vxge_hw_vpath_msix_set(vpath->handle, tim_msix_id, 1375 vxge_hw_vpath_msix_set(vpath->handle, tim_msix_id,
1381 alarm_msix_id); 1376 alarm_msix_id);
1382 1377
1378 msix_id = vpath->device_id * VXGE_HW_VPATH_MSIX_ACTIVE;
1383 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id); 1379 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id);
1384 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id + 1); 1380 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id + 1);
1385 1381
1386 /* enable the alarm vector */ 1382 /* enable the alarm vector */
1387 vxge_hw_vpath_msix_unmask(vpath->handle, alarm_msix_id); 1383 msix_id = (vpath->handle->vpath->hldev->first_vp_id *
1384 VXGE_HW_VPATH_MSIX_ACTIVE) + alarm_msix_id;
1385 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id);
1388 } 1386 }
1389} 1387}
1390 1388
@@ -1405,12 +1403,13 @@ void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
1405 if (vdev->config.intr_type == INTA) 1403 if (vdev->config.intr_type == INTA)
1406 vxge_hw_vpath_inta_mask_tx_rx(vpath->handle); 1404 vxge_hw_vpath_inta_mask_tx_rx(vpath->handle);
1407 else { 1405 else {
1408 msix_id = vp_id * VXGE_HW_VPATH_MSIX_ACTIVE; 1406 msix_id = vpath->device_id * VXGE_HW_VPATH_MSIX_ACTIVE;
1409 vxge_hw_vpath_msix_mask(vpath->handle, msix_id); 1407 vxge_hw_vpath_msix_mask(vpath->handle, msix_id);
1410 vxge_hw_vpath_msix_mask(vpath->handle, msix_id + 1); 1408 vxge_hw_vpath_msix_mask(vpath->handle, msix_id + 1);
1411 1409
1412 /* disable the alarm vector */ 1410 /* disable the alarm vector */
1413 msix_id = VXGE_HW_VPATH_MSIX_ACTIVE * vdev->no_of_vpath - 2; 1411 msix_id = (vpath->handle->vpath->hldev->first_vp_id *
1412 VXGE_HW_VPATH_MSIX_ACTIVE) + VXGE_ALARM_MSIX_ID;
1414 vxge_hw_vpath_msix_mask(vpath->handle, msix_id); 1413 vxge_hw_vpath_msix_mask(vpath->handle, msix_id);
1415 } 1414 }
1416} 1415}
@@ -2223,19 +2222,18 @@ vxge_alarm_msix_handle(int irq, void *dev_id)
2223 enum vxge_hw_status status; 2222 enum vxge_hw_status status;
2224 struct vxge_vpath *vpath = (struct vxge_vpath *)dev_id; 2223 struct vxge_vpath *vpath = (struct vxge_vpath *)dev_id;
2225 struct vxgedev *vdev = vpath->vdev; 2224 struct vxgedev *vdev = vpath->vdev;
2226 int alarm_msix_id = 2225 int msix_id = (vpath->handle->vpath->vp_id *
2227 VXGE_HW_VPATH_MSIX_ACTIVE * vdev->no_of_vpath - 2; 2226 VXGE_HW_VPATH_MSIX_ACTIVE) + VXGE_ALARM_MSIX_ID;
2228 2227
2229 for (i = 0; i < vdev->no_of_vpath; i++) { 2228 for (i = 0; i < vdev->no_of_vpath; i++) {
2230 vxge_hw_vpath_msix_mask(vdev->vpaths[i].handle, 2229 vxge_hw_vpath_msix_mask(vdev->vpaths[i].handle, msix_id);
2231 alarm_msix_id);
2232 2230
2233 status = vxge_hw_vpath_alarm_process(vdev->vpaths[i].handle, 2231 status = vxge_hw_vpath_alarm_process(vdev->vpaths[i].handle,
2234 vdev->exec_mode); 2232 vdev->exec_mode);
2235 if (status == VXGE_HW_OK) { 2233 if (status == VXGE_HW_OK) {
2236 2234
2237 vxge_hw_vpath_msix_unmask(vdev->vpaths[i].handle, 2235 vxge_hw_vpath_msix_unmask(vdev->vpaths[i].handle,
2238 alarm_msix_id); 2236 msix_id);
2239 continue; 2237 continue;
2240 } 2238 }
2241 vxge_debug_intr(VXGE_ERR, 2239 vxge_debug_intr(VXGE_ERR,
@@ -2248,18 +2246,17 @@ vxge_alarm_msix_handle(int irq, void *dev_id)
2248static int vxge_alloc_msix(struct vxgedev *vdev) 2246static int vxge_alloc_msix(struct vxgedev *vdev)
2249{ 2247{
2250 int j, i, ret = 0; 2248 int j, i, ret = 0;
2251 int intr_cnt = 0; 2249 int msix_intr_vect = 0, temp;
2252 int alarm_msix_id = 0, msix_intr_vect = 0;
2253 vdev->intr_cnt = 0; 2250 vdev->intr_cnt = 0;
2254 2251
2252start:
2255 /* Tx/Rx MSIX Vectors count */ 2253 /* Tx/Rx MSIX Vectors count */
2256 vdev->intr_cnt = vdev->no_of_vpath * 2; 2254 vdev->intr_cnt = vdev->no_of_vpath * 2;
2257 2255
2258 /* Alarm MSIX Vectors count */ 2256 /* Alarm MSIX Vectors count */
2259 vdev->intr_cnt++; 2257 vdev->intr_cnt++;
2260 2258
2261 intr_cnt = (vdev->max_vpath_supported * 2) + 1; 2259 vdev->entries = kzalloc(vdev->intr_cnt * sizeof(struct msix_entry),
2262 vdev->entries = kzalloc(intr_cnt * sizeof(struct msix_entry),
2263 GFP_KERNEL); 2260 GFP_KERNEL);
2264 if (!vdev->entries) { 2261 if (!vdev->entries) {
2265 vxge_debug_init(VXGE_ERR, 2262 vxge_debug_init(VXGE_ERR,
@@ -2268,8 +2265,9 @@ static int vxge_alloc_msix(struct vxgedev *vdev)
2268 return -ENOMEM; 2265 return -ENOMEM;
2269 } 2266 }
2270 2267
2271 vdev->vxge_entries = kzalloc(intr_cnt * sizeof(struct vxge_msix_entry), 2268 vdev->vxge_entries =
2272 GFP_KERNEL); 2269 kzalloc(vdev->intr_cnt * sizeof(struct vxge_msix_entry),
2270 GFP_KERNEL);
2273 if (!vdev->vxge_entries) { 2271 if (!vdev->vxge_entries) {
2274 vxge_debug_init(VXGE_ERR, "%s: memory allocation failed", 2272 vxge_debug_init(VXGE_ERR, "%s: memory allocation failed",
2275 VXGE_DRIVER_NAME); 2273 VXGE_DRIVER_NAME);
@@ -2277,9 +2275,7 @@ static int vxge_alloc_msix(struct vxgedev *vdev)
2277 return -ENOMEM; 2275 return -ENOMEM;
2278 } 2276 }
2279 2277
2280 /* Last vector in the list is used for alarm */ 2278 for (i = 0, j = 0; i < vdev->no_of_vpath; i++) {
2281 alarm_msix_id = VXGE_HW_VPATH_MSIX_ACTIVE * vdev->no_of_vpath - 2;
2282 for (i = 0, j = 0; i < vdev->max_vpath_supported; i++) {
2283 2279
2284 msix_intr_vect = i * VXGE_HW_VPATH_MSIX_ACTIVE; 2280 msix_intr_vect = i * VXGE_HW_VPATH_MSIX_ACTIVE;
2285 2281
@@ -2297,47 +2293,31 @@ static int vxge_alloc_msix(struct vxgedev *vdev)
2297 } 2293 }
2298 2294
2299 /* Initialize the alarm vector */ 2295 /* Initialize the alarm vector */
2300 vdev->entries[j].entry = alarm_msix_id; 2296 vdev->entries[j].entry = VXGE_ALARM_MSIX_ID;
2301 vdev->vxge_entries[j].entry = alarm_msix_id; 2297 vdev->vxge_entries[j].entry = VXGE_ALARM_MSIX_ID;
2302 vdev->vxge_entries[j].in_use = 0; 2298 vdev->vxge_entries[j].in_use = 0;
2303 2299
2304 ret = pci_enable_msix(vdev->pdev, vdev->entries, intr_cnt); 2300 ret = pci_enable_msix(vdev->pdev, vdev->entries, vdev->intr_cnt);
2305 /* if driver request exceeeds available irq's, request with a small
2306 * number.
2307 */
2308 if (ret > 0) {
2309 vxge_debug_init(VXGE_ERR,
2310 "%s: MSI-X enable failed for %d vectors, available: %d",
2311 VXGE_DRIVER_NAME, intr_cnt, ret);
2312 vdev->max_vpath_supported = vdev->no_of_vpath;
2313 intr_cnt = (vdev->max_vpath_supported * 2) + 1;
2314
2315 /* Reset the alarm vector setting */
2316 vdev->entries[j].entry = 0;
2317 vdev->vxge_entries[j].entry = 0;
2318
2319 /* Initialize the alarm vector with new setting */
2320 vdev->entries[intr_cnt - 1].entry = alarm_msix_id;
2321 vdev->vxge_entries[intr_cnt - 1].entry = alarm_msix_id;
2322 vdev->vxge_entries[intr_cnt - 1].in_use = 0;
2323
2324 ret = pci_enable_msix(vdev->pdev, vdev->entries, intr_cnt);
2325 if (!ret)
2326 vxge_debug_init(VXGE_ERR,
2327 "%s: MSI-X enabled for %d vectors",
2328 VXGE_DRIVER_NAME, intr_cnt);
2329 }
2330 2301
2331 if (ret) { 2302 if (ret > 0) {
2332 vxge_debug_init(VXGE_ERR, 2303 vxge_debug_init(VXGE_ERR,
2333 "%s: MSI-X enable failed for %d vectors, ret: %d", 2304 "%s: MSI-X enable failed for %d vectors, ret: %d",
2334 VXGE_DRIVER_NAME, intr_cnt, ret); 2305 VXGE_DRIVER_NAME, vdev->intr_cnt, ret);
2335 kfree(vdev->entries); 2306 kfree(vdev->entries);
2336 kfree(vdev->vxge_entries); 2307 kfree(vdev->vxge_entries);
2337 vdev->entries = NULL; 2308 vdev->entries = NULL;
2338 vdev->vxge_entries = NULL; 2309 vdev->vxge_entries = NULL;
2310
2311 if ((max_config_vpath != VXGE_USE_DEFAULT) || (ret < 3))
2312 return -ENODEV;
2313 /* Try with less no of vector by reducing no of vpaths count */
2314 temp = (ret - 1)/2;
2315 vxge_close_vpaths(vdev, temp);
2316 vdev->no_of_vpath = temp;
2317 goto start;
2318 } else if (ret < 0)
2339 return -ENODEV; 2319 return -ENODEV;
2340 } 2320
2341 return 0; 2321 return 0;
2342} 2322}
2343 2323
@@ -2345,43 +2325,26 @@ static int vxge_enable_msix(struct vxgedev *vdev)
2345{ 2325{
2346 2326
2347 int i, ret = 0; 2327 int i, ret = 0;
2348 enum vxge_hw_status status;
2349 /* 0 - Tx, 1 - Rx */ 2328 /* 0 - Tx, 1 - Rx */
2350 int tim_msix_id[4]; 2329 int tim_msix_id[4] = {0, 1, 0, 0};
2351 int alarm_msix_id = 0, msix_intr_vect = 0; 2330
2352 vdev->intr_cnt = 0; 2331 vdev->intr_cnt = 0;
2353 2332
2354 /* allocate msix vectors */ 2333 /* allocate msix vectors */
2355 ret = vxge_alloc_msix(vdev); 2334 ret = vxge_alloc_msix(vdev);
2356 if (!ret) { 2335 if (!ret) {
2357 /* Last vector in the list is used for alarm */
2358 alarm_msix_id =
2359 VXGE_HW_VPATH_MSIX_ACTIVE * vdev->no_of_vpath - 2;
2360 for (i = 0; i < vdev->no_of_vpath; i++) { 2336 for (i = 0; i < vdev->no_of_vpath; i++) {
2361 2337
2362 /* If fifo or ring are not enabled 2338 /* If fifo or ring are not enabled
2363 the MSIX vector for that should be set to 0 2339 the MSIX vector for that should be set to 0
2364 Hence initializeing this array to all 0s. 2340 Hence initializeing this array to all 0s.
2365 */ 2341 */
2366 memset(tim_msix_id, 0, sizeof(tim_msix_id)); 2342 vdev->vpaths[i].ring.rx_vector_no =
2367 msix_intr_vect = i * VXGE_HW_VPATH_MSIX_ACTIVE; 2343 (vdev->vpaths[i].device_id *
2368 tim_msix_id[0] = msix_intr_vect; 2344 VXGE_HW_VPATH_MSIX_ACTIVE) + 1;
2369
2370 tim_msix_id[1] = msix_intr_vect + 1;
2371 vdev->vpaths[i].ring.rx_vector_no = tim_msix_id[1];
2372 2345
2373 status = vxge_hw_vpath_msix_set( 2346 vxge_hw_vpath_msix_set(vdev->vpaths[i].handle,
2374 vdev->vpaths[i].handle, 2347 tim_msix_id, VXGE_ALARM_MSIX_ID);
2375 tim_msix_id, alarm_msix_id);
2376 if (status != VXGE_HW_OK) {
2377 vxge_debug_init(VXGE_ERR,
2378 "vxge_hw_vpath_msix_set "
2379 "failed with status : %x", status);
2380 kfree(vdev->entries);
2381 kfree(vdev->vxge_entries);
2382 pci_disable_msix(vdev->pdev);
2383 return -ENODEV;
2384 }
2385 } 2348 }
2386 } 2349 }
2387 2350
@@ -2392,7 +2355,7 @@ static void vxge_rem_msix_isr(struct vxgedev *vdev)
2392{ 2355{
2393 int intr_cnt; 2356 int intr_cnt;
2394 2357
2395 for (intr_cnt = 0; intr_cnt < (vdev->max_vpath_supported * 2 + 1); 2358 for (intr_cnt = 0; intr_cnt < (vdev->no_of_vpath * 2 + 1);
2396 intr_cnt++) { 2359 intr_cnt++) {
2397 if (vdev->vxge_entries[intr_cnt].in_use) { 2360 if (vdev->vxge_entries[intr_cnt].in_use) {
2398 synchronize_irq(vdev->entries[intr_cnt].vector); 2361 synchronize_irq(vdev->entries[intr_cnt].vector);
@@ -2457,9 +2420,10 @@ static int vxge_add_isr(struct vxgedev *vdev)
2457 switch (msix_idx) { 2420 switch (msix_idx) {
2458 case 0: 2421 case 0:
2459 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, 2422 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN,
2460 "%s:vxge fn: %d vpath: %d Tx MSI-X: %d", 2423 "%s:vxge:MSI-X %d - Tx - fn:%d vpath:%d",
2461 vdev->ndev->name, pci_fun, vp_idx, 2424 vdev->ndev->name,
2462 vdev->entries[intr_cnt].entry); 2425 vdev->entries[intr_cnt].entry,
2426 pci_fun, vp_idx);
2463 ret = request_irq( 2427 ret = request_irq(
2464 vdev->entries[intr_cnt].vector, 2428 vdev->entries[intr_cnt].vector,
2465 vxge_tx_msix_handle, 0, 2429 vxge_tx_msix_handle, 0,
@@ -2471,9 +2435,10 @@ static int vxge_add_isr(struct vxgedev *vdev)
2471 break; 2435 break;
2472 case 1: 2436 case 1:
2473 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, 2437 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN,
2474 "%s:vxge fn: %d vpath: %d Rx MSI-X: %d", 2438 "%s:vxge:MSI-X %d - Rx - fn:%d vpath:%d",
2475 vdev->ndev->name, pci_fun, vp_idx, 2439 vdev->ndev->name,
2476 vdev->entries[intr_cnt].entry); 2440 vdev->entries[intr_cnt].entry,
2441 pci_fun, vp_idx);
2477 ret = request_irq( 2442 ret = request_irq(
2478 vdev->entries[intr_cnt].vector, 2443 vdev->entries[intr_cnt].vector,
2479 vxge_rx_msix_napi_handle, 2444 vxge_rx_msix_napi_handle,
@@ -2501,9 +2466,11 @@ static int vxge_add_isr(struct vxgedev *vdev)
2501 if (irq_req) { 2466 if (irq_req) {
2502 /* We requested for this msix interrupt */ 2467 /* We requested for this msix interrupt */
2503 vdev->vxge_entries[intr_cnt].in_use = 1; 2468 vdev->vxge_entries[intr_cnt].in_use = 1;
2469 msix_idx += vdev->vpaths[vp_idx].device_id *
2470 VXGE_HW_VPATH_MSIX_ACTIVE;
2504 vxge_hw_vpath_msix_unmask( 2471 vxge_hw_vpath_msix_unmask(
2505 vdev->vpaths[vp_idx].handle, 2472 vdev->vpaths[vp_idx].handle,
2506 intr_idx); 2473 msix_idx);
2507 intr_cnt++; 2474 intr_cnt++;
2508 } 2475 }
2509 2476
@@ -2513,16 +2480,17 @@ static int vxge_add_isr(struct vxgedev *vdev)
2513 vp_idx++; 2480 vp_idx++;
2514 } 2481 }
2515 2482
2516 intr_cnt = vdev->max_vpath_supported * 2; 2483 intr_cnt = vdev->no_of_vpath * 2;
2517 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, 2484 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN,
2518 "%s:vxge Alarm fn: %d MSI-X: %d", 2485 "%s:vxge:MSI-X %d - Alarm - fn:%d",
2519 vdev->ndev->name, pci_fun, 2486 vdev->ndev->name,
2520 vdev->entries[intr_cnt].entry); 2487 vdev->entries[intr_cnt].entry,
2488 pci_fun);
2521 /* For Alarm interrupts */ 2489 /* For Alarm interrupts */
2522 ret = request_irq(vdev->entries[intr_cnt].vector, 2490 ret = request_irq(vdev->entries[intr_cnt].vector,
2523 vxge_alarm_msix_handle, 0, 2491 vxge_alarm_msix_handle, 0,
2524 vdev->desc[intr_cnt], 2492 vdev->desc[intr_cnt],
2525 &vdev->vpaths[vp_idx]); 2493 &vdev->vpaths[0]);
2526 if (ret) { 2494 if (ret) {
2527 vxge_debug_init(VXGE_ERR, 2495 vxge_debug_init(VXGE_ERR,
2528 "%s: MSIX - %d Registration failed", 2496 "%s: MSIX - %d Registration failed",
@@ -2535,16 +2503,19 @@ static int vxge_add_isr(struct vxgedev *vdev)
2535 goto INTA_MODE; 2503 goto INTA_MODE;
2536 } 2504 }
2537 2505
2506 msix_idx = (vdev->vpaths[0].handle->vpath->vp_id *
2507 VXGE_HW_VPATH_MSIX_ACTIVE) + VXGE_ALARM_MSIX_ID;
2538 vxge_hw_vpath_msix_unmask(vdev->vpaths[vp_idx].handle, 2508 vxge_hw_vpath_msix_unmask(vdev->vpaths[vp_idx].handle,
2539 intr_idx - 2); 2509 msix_idx);
2540 vdev->vxge_entries[intr_cnt].in_use = 1; 2510 vdev->vxge_entries[intr_cnt].in_use = 1;
2541 vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[vp_idx]; 2511 vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0];
2542 } 2512 }
2543INTA_MODE: 2513INTA_MODE:
2544#endif 2514#endif
2545 snprintf(vdev->desc[0], VXGE_INTR_STRLEN, "%s:vxge", vdev->ndev->name);
2546 2515
2547 if (vdev->config.intr_type == INTA) { 2516 if (vdev->config.intr_type == INTA) {
2517 snprintf(vdev->desc[0], VXGE_INTR_STRLEN,
2518 "%s:vxge:INTA", vdev->ndev->name);
2548 vxge_hw_device_set_intr_type(vdev->devh, 2519 vxge_hw_device_set_intr_type(vdev->devh,
2549 VXGE_HW_INTR_MODE_IRQLINE); 2520 VXGE_HW_INTR_MODE_IRQLINE);
2550 vxge_hw_vpath_tti_ci_set(vdev->devh, 2521 vxge_hw_vpath_tti_ci_set(vdev->devh,
diff --git a/drivers/net/vxge/vxge-main.h b/drivers/net/vxge/vxge-main.h
index 7c83ba4be9d7..0441d5aa3042 100644
--- a/drivers/net/vxge/vxge-main.h
+++ b/drivers/net/vxge/vxge-main.h
@@ -31,6 +31,7 @@
31#define PCI_DEVICE_ID_TITAN_UNI 0x5833 31#define PCI_DEVICE_ID_TITAN_UNI 0x5833
32#define VXGE_USE_DEFAULT 0xffffffff 32#define VXGE_USE_DEFAULT 0xffffffff
33#define VXGE_HW_VPATH_MSIX_ACTIVE 4 33#define VXGE_HW_VPATH_MSIX_ACTIVE 4
34#define VXGE_ALARM_MSIX_ID 2
34#define VXGE_HW_RXSYNC_FREQ_CNT 4 35#define VXGE_HW_RXSYNC_FREQ_CNT 4
35#define VXGE_LL_WATCH_DOG_TIMEOUT (15 * HZ) 36#define VXGE_LL_WATCH_DOG_TIMEOUT (15 * HZ)
36#define VXGE_LL_RX_COPY_THRESHOLD 256 37#define VXGE_LL_RX_COPY_THRESHOLD 256
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index c8b3997e9eeb..f83e6aee3f6a 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -231,8 +231,7 @@ void vxge_hw_channel_msix_mask(struct __vxge_hw_channel *channel, int msix_id)
231{ 231{
232 232
233 __vxge_hw_pio_mem_write32_upper( 233 __vxge_hw_pio_mem_write32_upper(
234 (u32)vxge_bVALn(vxge_mBIT(channel->first_vp_id+(msix_id/4)), 234 (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
235 0, 32),
236 &channel->common_reg->set_msix_mask_vect[msix_id%4]); 235 &channel->common_reg->set_msix_mask_vect[msix_id%4]);
237 236
238 return; 237 return;
@@ -252,8 +251,7 @@ vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channel, int msix_id)
252{ 251{
253 252
254 __vxge_hw_pio_mem_write32_upper( 253 __vxge_hw_pio_mem_write32_upper(
255 (u32)vxge_bVALn(vxge_mBIT(channel->first_vp_id+(msix_id/4)), 254 (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
256 0, 32),
257 &channel->common_reg->clear_msix_mask_vect[msix_id%4]); 255 &channel->common_reg->clear_msix_mask_vect[msix_id%4]);
258 256
259 return; 257 return;
@@ -2220,29 +2218,24 @@ exit:
2220 * This API will associate a given MSIX vector numbers with the four TIM 2218 * This API will associate a given MSIX vector numbers with the four TIM
2221 * interrupts and alarm interrupt. 2219 * interrupts and alarm interrupt.
2222 */ 2220 */
2223enum vxge_hw_status 2221void
2224vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vp, int *tim_msix_id, 2222vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vp, int *tim_msix_id,
2225 int alarm_msix_id) 2223 int alarm_msix_id)
2226{ 2224{
2227 u64 val64; 2225 u64 val64;
2228 struct __vxge_hw_virtualpath *vpath = vp->vpath; 2226 struct __vxge_hw_virtualpath *vpath = vp->vpath;
2229 struct vxge_hw_vpath_reg __iomem *vp_reg = vpath->vp_reg; 2227 struct vxge_hw_vpath_reg __iomem *vp_reg = vpath->vp_reg;
2230 u32 first_vp_id = vpath->hldev->first_vp_id; 2228 u32 vp_id = vp->vpath->vp_id;
2231 2229
2232 val64 = VXGE_HW_INTERRUPT_CFG0_GROUP0_MSIX_FOR_TXTI( 2230 val64 = VXGE_HW_INTERRUPT_CFG0_GROUP0_MSIX_FOR_TXTI(
2233 (first_vp_id * 4) + tim_msix_id[0]) | 2231 (vp_id * 4) + tim_msix_id[0]) |
2234 VXGE_HW_INTERRUPT_CFG0_GROUP1_MSIX_FOR_TXTI( 2232 VXGE_HW_INTERRUPT_CFG0_GROUP1_MSIX_FOR_TXTI(
2235 (first_vp_id * 4) + tim_msix_id[1]) | 2233 (vp_id * 4) + tim_msix_id[1]);
2236 VXGE_HW_INTERRUPT_CFG0_GROUP2_MSIX_FOR_TXTI(
2237 (first_vp_id * 4) + tim_msix_id[2]);
2238
2239 val64 |= VXGE_HW_INTERRUPT_CFG0_GROUP3_MSIX_FOR_TXTI(
2240 (first_vp_id * 4) + tim_msix_id[3]);
2241 2234
2242 writeq(val64, &vp_reg->interrupt_cfg0); 2235 writeq(val64, &vp_reg->interrupt_cfg0);
2243 2236
2244 writeq(VXGE_HW_INTERRUPT_CFG2_ALARM_MAP_TO_MSG( 2237 writeq(VXGE_HW_INTERRUPT_CFG2_ALARM_MAP_TO_MSG(
2245 (first_vp_id * 4) + alarm_msix_id), 2238 (vpath->hldev->first_vp_id * 4) + alarm_msix_id),
2246 &vp_reg->interrupt_cfg2); 2239 &vp_reg->interrupt_cfg2);
2247 2240
2248 if (vpath->hldev->config.intr_mode == 2241 if (vpath->hldev->config.intr_mode ==
@@ -2263,7 +2256,7 @@ vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vp, int *tim_msix_id,
2263 0, 32), &vp_reg->one_shot_vect3_en); 2256 0, 32), &vp_reg->one_shot_vect3_en);
2264 } 2257 }
2265 2258
2266 return VXGE_HW_OK; 2259 return;
2267} 2260}
2268 2261
2269/** 2262/**
@@ -2283,8 +2276,7 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw_vpath_handle *vp, int msix_id)
2283{ 2276{
2284 struct __vxge_hw_device *hldev = vp->vpath->hldev; 2277 struct __vxge_hw_device *hldev = vp->vpath->hldev;
2285 __vxge_hw_pio_mem_write32_upper( 2278 __vxge_hw_pio_mem_write32_upper(
2286 (u32) vxge_bVALn(vxge_mBIT(hldev->first_vp_id + 2279 (u32) vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
2287 (msix_id / 4)), 0, 32),
2288 &hldev->common_reg->set_msix_mask_vect[msix_id % 4]); 2280 &hldev->common_reg->set_msix_mask_vect[msix_id % 4]);
2289 2281
2290 return; 2282 return;
@@ -2309,14 +2301,12 @@ vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vp, int msix_id)
2309 if (hldev->config.intr_mode == 2301 if (hldev->config.intr_mode ==
2310 VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) { 2302 VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) {
2311 __vxge_hw_pio_mem_write32_upper( 2303 __vxge_hw_pio_mem_write32_upper(
2312 (u32)vxge_bVALn(vxge_mBIT(hldev->first_vp_id + 2304 (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
2313 (msix_id/4)), 0, 32),
2314 &hldev->common_reg-> 2305 &hldev->common_reg->
2315 clr_msix_one_shot_vec[msix_id%4]); 2306 clr_msix_one_shot_vec[msix_id%4]);
2316 } else { 2307 } else {
2317 __vxge_hw_pio_mem_write32_upper( 2308 __vxge_hw_pio_mem_write32_upper(
2318 (u32)vxge_bVALn(vxge_mBIT(hldev->first_vp_id + 2309 (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
2319 (msix_id/4)), 0, 32),
2320 &hldev->common_reg-> 2310 &hldev->common_reg->
2321 clear_msix_mask_vect[msix_id%4]); 2311 clear_msix_mask_vect[msix_id%4]);
2322 } 2312 }
@@ -2341,8 +2331,7 @@ vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vp, int msix_id)
2341{ 2331{
2342 struct __vxge_hw_device *hldev = vp->vpath->hldev; 2332 struct __vxge_hw_device *hldev = vp->vpath->hldev;
2343 __vxge_hw_pio_mem_write32_upper( 2333 __vxge_hw_pio_mem_write32_upper(
2344 (u32)vxge_bVALn(vxge_mBIT(hldev->first_vp_id + 2334 (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
2345 (msix_id/4)), 0, 32),
2346 &hldev->common_reg->clear_msix_mask_vect[msix_id%4]); 2335 &hldev->common_reg->clear_msix_mask_vect[msix_id%4]);
2347 2336
2348 return; 2337 return;
diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h
index bed65280d988..c252f3d3f650 100644
--- a/drivers/net/vxge/vxge-traffic.h
+++ b/drivers/net/vxge/vxge-traffic.h
@@ -2376,7 +2376,7 @@ enum vxge_hw_status vxge_hw_vpath_alarm_process(
2376 struct __vxge_hw_vpath_handle *vpath_handle, 2376 struct __vxge_hw_vpath_handle *vpath_handle,
2377 u32 skip_alarms); 2377 u32 skip_alarms);
2378 2378
2379enum vxge_hw_status 2379void
2380vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vpath_handle, 2380vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vpath_handle,
2381 int *tim_msix_id, int alarm_msix_id); 2381 int *tim_msix_id, int alarm_msix_id);
2382 2382