Lines Matching defs:vpath
631 /* select a vpath to transmit the packet */
657 struct vxge_vpath *vpath, u64 del_mac)
660 list_for_each_safe(entry, next, &vpath->mac_addr_list) {
667 static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
672 if (vpath->mac_addr_cnt >= VXGE_MAX_LEARN_MAC_ADDR_CNT)
683 list_add(&new_mac_entry->item, &vpath->mac_addr_list);
690 vpath->mac_addr_cnt++;
693 vpath->mcast_addr_cnt++;
703 struct vxge_vpath *vpath;
711 vpath = &vdev->vpaths[mac->vpath_no];
712 status = vxge_hw_vpath_mac_addr_add(vpath->handle, mac->macaddr,
716 "DA config add entry failed for vpath:%d",
717 vpath->device_id);
719 if (FALSE == vxge_mac_list_add(vpath, mac))
732 struct vxge_vpath *vpath = NULL;
739 vpath = &vdev->vpaths[vpath_idx];
740 if (vxge_search_mac_addr_in_list(vpath, mac_addr))
747 /* Any vpath has room to add mac address to its da table? */
749 vpath = &vdev->vpaths[vpath_idx];
750 if (vpath->mac_addr_cnt < vpath->max_mac_addr_cnt) {
751 /* Add this mac address to this vpath */
764 /* Is the first vpath already selected as catch-basin ? */
765 vpath = &vdev->vpaths[vpath_idx];
766 if (vpath->mac_addr_cnt > vpath->max_mac_addr_cnt) {
767 /* Add this mac address to this vpath */
768 if (FALSE == vxge_mac_list_add(vpath, &mac_info))
773 /* Select first vpath as catch-basin */
774 vpath_vector = vxge_mBIT(vpath->device_id);
775 status = vxge_hw_mgmt_reg_write(vpath->vdev->devh,
784 "%s: Unable to set the vpath-%d in catch-basin mode",
785 VXGE_DRIVER_NAME, vpath->device_id);
789 if (FALSE == vxge_mac_list_add(vpath, &mac_info))
1067 static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
1076 list_for_each_safe(entry, next, &vpath->mac_addr_list) {
1080 vpath->mac_addr_cnt--;
1083 vpath->mcast_addr_cnt--;
1096 struct vxge_vpath *vpath;
1098 vpath = &vdev->vpaths[mac->vpath_no];
1099 status = vxge_hw_vpath_mac_addr_delete(vpath->handle, mac->macaddr,
1103 "DA config delete entry failed for vpath:%d",
1104 vpath->device_id);
1106 vxge_mac_list_del(vpath, mac);
1126 struct vxge_vpath *vpath;
1145 vpath = &vdev->vpaths[i];
1146 vxge_assert(vpath->is_open);
1147 status = vxge_hw_vpath_mcast_enable(vpath->handle);
1155 vpath = &vdev->vpaths[i];
1156 vxge_assert(vpath->is_open);
1157 status = vxge_hw_vpath_mcast_disable(vpath->handle);
1168 vpath = &vdev->vpaths[i];
1169 vxge_assert(vpath->is_open);
1173 vpath->handle);
1176 vpath->handle);
1257 vpath = &vdev->vpaths[i];
1258 vxge_assert(vpath->is_open);
1260 status = vxge_hw_vpath_mcast_enable(vpath->handle);
1312 struct vxge_vpath *vpath = &vdev->vpaths[vpath_idx];
1313 if (!vpath->is_open) {
1317 vxge_mac_list_del(vpath, &mac_info_old);
1321 vxge_mac_list_add(vpath, &mac_info_new);
1352 * @vp_id: vpath for which to enable the interrupts
1354 * Enables the interrupts for the vpath
1358 struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
1363 vxge_hw_vpath_intr_enable(vpath->handle);
1366 vxge_hw_vpath_inta_unmask_tx_rx(vpath->handle);
1368 vxge_hw_vpath_msix_set(vpath->handle, tim_msix_id,
1371 msix_id = vpath->device_id * VXGE_HW_VPATH_MSIX_ACTIVE;
1372 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id);
1373 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id + 1);
1376 msix_id = (vpath->handle->vpath->hldev->first_vp_id *
1378 vxge_hw_vpath_msix_unmask(vpath->handle, msix_id);
1385 * @vp_id: vpath for which to disable the interrupts
1387 * Disables the interrupts for the vpath
1391 struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
1397 vxge_hw_vpath_wait_receive_idle(hldev, vpath->device_id);
1399 vxge_hw_vpath_intr_disable(vpath->handle);
1402 vxge_hw_vpath_inta_mask_tx_rx(vpath->handle);
1404 msix_id = vpath->device_id * VXGE_HW_VPATH_MSIX_ACTIVE;
1405 vxge_hw_vpath_msix_mask(vpath->handle, msix_id);
1406 vxge_hw_vpath_msix_mask(vpath->handle, msix_id + 1);
1409 msix_id = (vpath->handle->vpath->hldev->first_vp_id *
1411 vxge_hw_vpath_msix_mask(vpath->handle, msix_id);
1417 vxge_search_mac_addr_in_da_table(struct vxge_vpath *vpath, struct macInfo *mac)
1423 status = vxge_hw_vpath_mac_addr_get(vpath->handle,
1427 "DA config list entry failed for vpath:%d",
1428 vpath->device_id);
1433 status = vxge_hw_vpath_mac_addr_get_next(vpath->handle,
1443 static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath)
1452 if (vpath->is_open) {
1453 list_for_each_safe(entry, next, &vpath->mac_addr_list) {
1461 status = vxge_search_mac_addr_in_da_table(vpath,
1466 vpath->handle, mac_info.macaddr,
1471 "DA add entry failed for vpath:%d",
1472 vpath->device_id);
1485 vxge_restore_vpath_vid_table(struct vxge_vpath *vpath)
1488 struct vxgedev *vdev = vpath->vdev;
1491 if (!vpath->is_open)
1495 status = vxge_hw_vpath_vid_add(vpath->handle, vid);
1503 * @vp_id: vpath to reset
1505 * Resets the vpath
1510 struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
1521 if (vpath->handle) {
1522 if (vxge_hw_vpath_reset(vpath->handle) == VXGE_HW_OK) {
1524 vxge_hw_vpath_recover_from_reset(vpath->handle)
1528 "failed for vpath:%d", vp_id);
1534 "vpath:%d", vp_id);
1540 vxge_restore_vpath_mac_addr(vpath);
1541 vxge_restore_vpath_vid_table(vpath);
1544 vxge_hw_vpath_bcast_enable(vpath->handle);
1548 status = vxge_hw_vpath_mcast_enable(vpath->handle);
1560 /* Enable the flow of traffic through the vpath */
1561 vxge_hw_vpath_enable(vpath->handle);
1564 vxge_hw_vpath_rx_doorbell_init(vpath->handle);
1565 vpath->ring.last_status = VXGE_HW_OK;
1570 /* Start the vpath queue */
1571 if (netif_tx_queue_stopped(vpath->fifo.txq))
1572 netif_tx_wake_queue(vpath->fifo.txq);
1598 * vpath. (Have only one free running timer).
1627 /* wait for all the vpath reset to complete */
1730 "from_reset failed for vpath: "
1738 "vpath:%d", i);
1751 /* enable vpath interrupts */
1827 /* Re enable the Rx interrupts for the vpath */
1914 u8 mtable[256] = {0}; /* CPU to vpath mapping */
1920 * - mtable with bucket-to-vpath mapping
1927 /* set indirection table, bucket-to-vpath mapping */
1935 "for vpath:%d", vdev->vpaths[0].device_id);
1962 "RTH configuration failed for vpath:%d",
1975 struct vxge_vpath *vpath;
1979 vpath = &vdev->vpaths[i];
1980 if (vpath->handle) {
1981 if (vxge_hw_vpath_reset(vpath->handle) == VXGE_HW_OK) {
1984 vpath->handle) != VXGE_HW_OK) {
1987 "from_reset failed for vpath: "
1994 "vpath:%d", i);
2006 struct vxge_vpath *vpath;
2010 vpath = &vdev->vpaths[i];
2012 if (vpath->handle && vpath->is_open) {
2013 vxge_hw_vpath_close(vpath->handle);
2016 vpath->is_open = 0;
2017 vpath->handle = NULL;
2026 struct vxge_vpath *vpath;
2031 vpath = &vdev->vpaths[i];
2032 vxge_assert(vpath->is_configured);
2036 vcfg = &vdev->devh->config.vp_config[vpath->device_id];
2049 attr.vp_id = vpath->device_id;
2053 attr.fifo_attr.userdata = &vpath->fifo;
2059 attr.ring_attr.userdata = &vpath->ring;
2061 vpath->ring.ndev = vdev->ndev;
2062 vpath->ring.pdev = vdev->pdev;
2064 status = vxge_hw_vpath_open(vdev->devh, &attr, &vpath->handle);
2066 vpath->fifo.handle =
2068 vpath->ring.handle =
2070 vpath->fifo.tx_steering_type =
2072 vpath->fifo.ndev = vdev->ndev;
2073 vpath->fifo.pdev = vdev->pdev;
2075 u64_stats_init(&vpath->fifo.stats.syncp);
2076 u64_stats_init(&vpath->ring.stats.syncp);
2079 vpath->fifo.txq =
2082 vpath->fifo.txq =
2084 vpath->fifo.indicate_max_pkts =
2086 vpath->fifo.tx_vector_no = 0;
2087 vpath->ring.rx_vector_no = 0;
2088 vpath->ring.rx_hwts = vdev->rx_hwts;
2089 vpath->is_open = 1;
2090 vdev->vp_handles[i] = vpath->handle;
2091 vpath->ring.vlan_tag_strip = vdev->vlan_tag_strip;
2095 vxge_debug_init(VXGE_ERR, "%s: vpath: %d failed to "
2097 vdev->ndev->name, vpath->device_id,
2103 vp_id = vpath->handle->vpath->vp_id;
2262 struct vxge_vpath *vpath = (struct vxge_vpath *)dev_id;
2263 struct vxgedev *vdev = vpath->vdev;
2264 int msix_id = (vpath->handle->vpath->vp_id *
2393 struct vxge_vpath *vpath = &vdev->vpaths[i];
2398 vpath->ring.rx_vector_no = (vpath->device_id *
2401 vpath->fifo.tx_vector_no = (vpath->device_id *
2404 vxge_hw_vpath_msix_set(vpath->handle, tim_msix_id,
2474 "%s:vxge:MSI-X %d - Tx - fn:%d vpath:%d",
2489 "%s:vxge:MSI-X %d - Rx - fn:%d vpath:%d",
2527 /* Point to next vpath handler */
2556 msix_idx = (vdev->vpaths[0].handle->vpath->vp_id *
2613 struct vxge_vpath *vpath;
2624 /* Did this vpath received any packets */
2632 /* schedule vpath reset */
2634 vpath = &vdev->vpaths[i];
2636 /* disable interrupts for this vpath */
2639 /* stop the queue for this vpath */
2640 netif_tx_stop_queue(vpath->fifo.txq);
2659 * vpath reset. Due to these restrictions, only allow modification
2703 struct vxge_vpath *vpath;
2742 vpath = &vdev->vpaths[i];
2743 vpath->ring.napi_p = &vdev->napi;
2747 vpath = &vdev->vpaths[i];
2748 netif_napi_add(dev, &vpath->ring.napi,
2750 napi_enable(&vpath->ring.napi);
2751 vpath->ring.napi_p = &vpath->ring.napi;
2770 vpath = &vdev->vpaths[i];
2773 status = vxge_hw_vpath_mtu_set(vpath->handle, vdev->mtu);
2792 vpath = &vdev->vpaths[i];
2793 vxge_restore_vpath_mac_addr(vpath);
2794 vxge_restore_vpath_vid_table(vpath);
2796 status = vxge_hw_vpath_mcast_enable(vpath->handle);
2804 /* Enable vpath to sniff all unicast/multicast traffic that not
2828 /* Enabling Bcast and mcast for all vpath */
2830 vpath = &vdev->vpaths[i];
2831 status = vxge_hw_vpath_bcast_enable(vpath->handle);
2834 "%s : Can not enable bcast for vpath "
2837 status = vxge_hw_vpath_mcast_enable(vpath->handle);
2840 "%s : Can not enable mcast for vpath "
2873 vpath = &vdev->vpaths[i];
2875 vxge_hw_vpath_enable(vpath->handle);
2877 vxge_hw_vpath_rx_doorbell_init(vpath->handle);
2908 static void vxge_free_mac_add_list(struct vxge_vpath *vpath)
2912 if (list_empty(&vpath->mac_addr_list))
2915 list_for_each_safe(entry, next, &vpath->mac_addr_list) {
2954 /* Put the vpath back in normal mode */
3306 struct vxge_vpath *vpath;
3311 vpath = &vdev->vpaths[vp_id];
3312 if (!vpath->is_open)
3314 vxge_hw_vpath_vid_add(vpath->handle, vid);
3332 struct vxge_vpath *vpath;
3339 vpath = &vdev->vpaths[vp_id];
3340 if (!vpath->is_open)
3342 vxge_hw_vpath_vid_delete(vpath->handle, vid);
3429 /* Allocate memory for vpath */
3434 "%s: vpath memory allocation failed",
3551 struct vxge_vpath *vpath = NULL;
3563 vpath = &vdev->vpaths[vpath_idx];
3564 if (vpath->device_id == vp_id)
3596 /* check if this vpath is already set for reset */
3599 /* disable interrupts for this vpath */
3602 /* stop the queue for this vpath */
3603 netif_tx_stop_queue(vpath->fifo.txq);
3683 /* No more CPU. Return vpath number as zero.*/
3712 "as single vpath is configured", VXGE_DRIVER_NAME);
3728 "%s: vpath: %d is not available",
3733 "%s: vpath: %d available",
3739 "%s: vpath: %d is not configured, "
4347 /* Now making the CPU based no of vpath calculation