• Home
  • Raw
  • Download

Lines Matching refs:vdev

90 static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
92 static inline int is_vxge_card_up(struct vxgedev *vdev) in is_vxge_card_up() argument
94 return test_bit(__VXGE_STATE_CARD_UP, &vdev->state); in is_vxge_card_up()
121 static inline void VXGE_COMPLETE_ALL_TX(struct vxgedev *vdev) in VXGE_COMPLETE_ALL_TX() argument
126 for (i = 0; i < vdev->no_of_vpath; i++) in VXGE_COMPLETE_ALL_TX()
127 VXGE_COMPLETE_VPATH_TX(&vdev->vpaths[i].fifo); in VXGE_COMPLETE_ALL_TX()
130 static inline void VXGE_COMPLETE_ALL_RX(struct vxgedev *vdev) in VXGE_COMPLETE_ALL_RX() argument
136 for (i = 0; i < vdev->no_of_vpath; i++) { in VXGE_COMPLETE_ALL_RX()
137 ring = &vdev->vpaths[i].ring; in VXGE_COMPLETE_ALL_RX()
151 struct vxgedev *vdev = netdev_priv(dev); in vxge_callback_link_up() local
154 vdev->ndev->name, __func__, __LINE__); in vxge_callback_link_up()
155 netdev_notice(vdev->ndev, "Link Up\n"); in vxge_callback_link_up()
156 vdev->stats.link_up++; in vxge_callback_link_up()
158 netif_carrier_on(vdev->ndev); in vxge_callback_link_up()
159 netif_tx_wake_all_queues(vdev->ndev); in vxge_callback_link_up()
162 "%s: %s:%d Exiting...", vdev->ndev->name, __func__, __LINE__); in vxge_callback_link_up()
174 struct vxgedev *vdev = netdev_priv(dev); in vxge_callback_link_down() local
177 "%s: %s:%d", vdev->ndev->name, __func__, __LINE__); in vxge_callback_link_down()
178 netdev_notice(vdev->ndev, "Link Down\n"); in vxge_callback_link_down()
180 vdev->stats.link_down++; in vxge_callback_link_down()
181 netif_carrier_off(vdev->ndev); in vxge_callback_link_down()
182 netif_tx_stop_all_queues(vdev->ndev); in vxge_callback_link_down()
185 "%s: %s:%d Exiting...", vdev->ndev->name, __func__, __LINE__); in vxge_callback_link_down()
631 static u32 vxge_get_vpath_no(struct vxgedev *vdev, struct sk_buff *skb) in vxge_get_vpath_no() argument
644 queue_len = vdev->no_of_vpath; in vxge_get_vpath_no()
647 vdev->vpath_selector[queue_len - 1]; in vxge_get_vpath_no()
699 vxge_add_mac_addr(struct vxgedev *vdev, struct macInfo *mac) in vxge_add_mac_addr() argument
710 vpath = &vdev->vpaths[mac->vpath_no]; in vxge_add_mac_addr()
724 static int vxge_learn_mac(struct vxgedev *vdev, u8 *mac_header) in vxge_learn_mac() argument
737 for (vpath_idx = 0; vpath_idx < vdev->no_of_vpath; vpath_idx++) { in vxge_learn_mac()
738 vpath = &vdev->vpaths[vpath_idx]; in vxge_learn_mac()
747 for (vpath_idx = 0; vpath_idx < vdev->no_of_vpath; vpath_idx++) { in vxge_learn_mac()
748 vpath = &vdev->vpaths[vpath_idx]; in vxge_learn_mac()
753 status = vxge_add_mac_addr(vdev, &mac_info); in vxge_learn_mac()
764 vpath = &vdev->vpaths[vpath_idx]; in vxge_learn_mac()
774 status = vxge_hw_mgmt_reg_write(vpath->vdev->devh, in vxge_learn_mac()
808 struct vxgedev *vdev = NULL; in vxge_xmit() local
830 vdev = netdev_priv(dev); in vxge_xmit()
832 if (unlikely(!is_vxge_card_up(vdev))) { in vxge_xmit()
839 if (vdev->config.addr_learn_en) { in vxge_xmit()
840 vpath_no = vxge_learn_mac(vdev, skb->data + ETH_ALEN); in vxge_xmit()
850 if (vdev->config.tx_steering_type == TX_MULTIQ_STEERING) in vxge_xmit()
852 else if (vdev->config.tx_steering_type == TX_PORT_STEERING) in vxge_xmit()
853 vpath_no = vxge_get_vpath_no(vdev, skb); in vxge_xmit()
857 if (vpath_no >= vdev->no_of_vpath) in vxge_xmit()
860 fifo = &vdev->vpaths[vpath_no].fifo; in vxge_xmit()
1092 vxge_del_mac_addr(struct vxgedev *vdev, struct macInfo *mac) in vxge_del_mac_addr() argument
1097 vpath = &vdev->vpaths[mac->vpath_no]; in vxge_del_mac_addr()
1123 struct vxgedev *vdev; in vxge_set_multicast() local
1138 vdev = netdev_priv(dev); in vxge_set_multicast()
1139 hldev = vdev->devh; in vxge_set_multicast()
1141 if (unlikely(!is_vxge_card_up(vdev))) in vxge_set_multicast()
1144 if ((dev->flags & IFF_ALLMULTI) && (!vdev->all_multi_flg)) { in vxge_set_multicast()
1145 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_set_multicast()
1146 vpath = &vdev->vpaths[i]; in vxge_set_multicast()
1152 vdev->all_multi_flg = 1; in vxge_set_multicast()
1154 } else if (!(dev->flags & IFF_ALLMULTI) && (vdev->all_multi_flg)) { in vxge_set_multicast()
1155 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_set_multicast()
1156 vpath = &vdev->vpaths[i]; in vxge_set_multicast()
1162 vdev->all_multi_flg = 0; in vxge_set_multicast()
1167 if (!vdev->config.addr_learn_en) { in vxge_set_multicast()
1168 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_set_multicast()
1169 vpath = &vdev->vpaths[i]; in vxge_set_multicast()
1187 if ((!vdev->all_multi_flg) && netdev_mc_count(dev)) { in vxge_set_multicast()
1188 mcast_cnt = vdev->vpaths[0].mcast_addr_cnt; in vxge_set_multicast()
1189 list_head = &vdev->vpaths[0].mac_addr_list; in vxge_set_multicast()
1191 (vdev->vpaths[0].mac_addr_cnt - mcast_cnt)) > in vxge_set_multicast()
1192 vdev->vpaths[0].max_mac_addr_cnt) in vxge_set_multicast()
1205 vdev->no_of_vpath; in vxge_set_multicast()
1209 vdev, in vxge_set_multicast()
1219 for (vpath_idx = 0; vpath_idx < vdev->no_of_vpath; in vxge_set_multicast()
1223 status = vxge_add_mac_addr(vdev, &mac_info); in vxge_set_multicast()
1236 mcast_cnt = vdev->vpaths[0].mcast_addr_cnt; in vxge_set_multicast()
1249 for (vpath_idx = 0; vpath_idx < vdev->no_of_vpath; in vxge_set_multicast()
1252 status = vxge_del_mac_addr(vdev, &mac_info); in vxge_set_multicast()
1257 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_set_multicast()
1258 vpath = &vdev->vpaths[i]; in vxge_set_multicast()
1267 vdev->all_multi_flg = 1; in vxge_set_multicast()
1285 struct vxgedev *vdev; in vxge_set_mac_addr() local
1293 vdev = netdev_priv(dev); in vxge_set_mac_addr()
1294 hldev = vdev->devh; in vxge_set_mac_addr()
1313 for (vpath_idx = 0; vpath_idx < vdev->no_of_vpath; vpath_idx++) { in vxge_set_mac_addr()
1314 struct vxge_vpath *vpath = &vdev->vpaths[vpath_idx]; in vxge_set_mac_addr()
1329 status = vxge_del_mac_addr(vdev, &mac_info_old); in vxge_set_mac_addr()
1332 if (unlikely(!is_vxge_card_up(vdev))) { in vxge_set_mac_addr()
1338 for (vpath_idx = 0; vpath_idx < vdev->no_of_vpath; vpath_idx++) { in vxge_set_mac_addr()
1341 status = vxge_add_mac_addr(vdev, &mac_info_new); in vxge_set_mac_addr()
1358 static void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id) in vxge_vpath_intr_enable() argument
1360 struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; in vxge_vpath_intr_enable()
1367 if (vdev->config.intr_type == INTA) in vxge_vpath_intr_enable()
1391 static void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id) in vxge_vpath_intr_disable() argument
1393 struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; in vxge_vpath_intr_disable()
1397 hldev = pci_get_drvdata(vdev->pdev); in vxge_vpath_intr_disable()
1403 if (vdev->config.intr_type == INTA) in vxge_vpath_intr_disable()
1490 struct vxgedev *vdev = vpath->vdev; in vxge_restore_vpath_vid_table() local
1496 for_each_set_bit(vid, vdev->active_vlans, VLAN_N_VID) in vxge_restore_vpath_vid_table()
1509 static int vxge_reset_vpath(struct vxgedev *vdev, int vp_id) in vxge_reset_vpath() argument
1512 struct vxge_vpath *vpath = &vdev->vpaths[vp_id]; in vxge_reset_vpath()
1516 if (unlikely(!is_vxge_card_up(vdev))) in vxge_reset_vpath()
1520 if (test_bit(__VXGE_STATE_RESET_CARD, &vdev->state)) in vxge_reset_vpath()
1525 if (is_vxge_card_up(vdev) && in vxge_reset_vpath()
1549 if (vdev->all_multi_flg) { in vxge_reset_vpath()
1558 vxge_vpath_intr_enable(vdev, vp_id); in vxge_reset_vpath()
1570 clear_bit(vp_id, &vdev->vp_reset); in vxge_reset_vpath()
1580 static void vxge_config_ci_for_tti_rti(struct vxgedev *vdev) in vxge_config_ci_for_tti_rti() argument
1585 if (vdev->config.intr_type == MSI_X) { in vxge_config_ci_for_tti_rti()
1586 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_config_ci_for_tti_rti()
1589 hw_ring = vdev->vpaths[i].ring.handle; in vxge_config_ci_for_tti_rti()
1595 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_config_ci_for_tti_rti()
1596 struct __vxge_hw_fifo *hw_fifo = vdev->vpaths[i].fifo.handle; in vxge_config_ci_for_tti_rti()
1602 if ((vdev->config.intr_type == INTA) && (i == 0)) in vxge_config_ci_for_tti_rti()
1609 static int do_vxge_reset(struct vxgedev *vdev, int event) in do_vxge_reset() argument
1618 if (unlikely(!is_vxge_card_up(vdev))) in do_vxge_reset()
1622 if (test_and_set_bit(__VXGE_STATE_RESET_CARD, &vdev->state)) in do_vxge_reset()
1627 netif_carrier_off(vdev->ndev); in do_vxge_reset()
1630 for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) { in do_vxge_reset()
1631 while (test_bit(vp_id, &vdev->vp_reset)) in do_vxge_reset()
1635 netif_carrier_on(vdev->ndev); in do_vxge_reset()
1638 if (unlikely(vdev->exec_mode)) { in do_vxge_reset()
1641 vdev->ndev->name); in do_vxge_reset()
1642 clear_bit(__VXGE_STATE_CARD_UP, &vdev->state); in do_vxge_reset()
1643 netif_tx_stop_all_queues(vdev->ndev); in do_vxge_reset()
1649 vxge_hw_device_wait_receive_idle(vdev->devh); in do_vxge_reset()
1650 vxge_hw_device_intr_disable(vdev->devh); in do_vxge_reset()
1652 switch (vdev->cric_err_event) { in do_vxge_reset()
1654 netif_tx_stop_all_queues(vdev->ndev); in do_vxge_reset()
1658 vdev->ndev->name); in do_vxge_reset()
1675 netif_tx_stop_all_queues(vdev->ndev); in do_vxge_reset()
1679 vdev->ndev->name); in do_vxge_reset()
1685 netif_tx_stop_all_queues(vdev->ndev); in do_vxge_reset()
1689 vdev->ndev->name); in do_vxge_reset()
1697 netif_tx_stop_all_queues(vdev->ndev); in do_vxge_reset()
1701 vdev->ndev->name); in do_vxge_reset()
1711 netif_tx_stop_all_queues(vdev->ndev); in do_vxge_reset()
1714 status = vxge_reset_all_vpaths(vdev); in do_vxge_reset()
1718 vdev->ndev->name); in do_vxge_reset()
1725 for (i = 0; i < vdev->no_of_vpath; i++) in do_vxge_reset()
1726 if (vdev->vpaths[i].handle) { in do_vxge_reset()
1728 vdev->vpaths[i].handle) in do_vxge_reset()
1748 for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) { in do_vxge_reset()
1749 vxge_restore_vpath_mac_addr(&vdev->vpaths[vp_id]); in do_vxge_reset()
1750 vxge_restore_vpath_vid_table(&vdev->vpaths[vp_id]); in do_vxge_reset()
1754 for (i = 0; i < vdev->no_of_vpath; i++) in do_vxge_reset()
1755 vxge_vpath_intr_enable(vdev, i); in do_vxge_reset()
1757 vxge_hw_device_intr_enable(vdev->devh); in do_vxge_reset()
1762 set_bit(__VXGE_STATE_CARD_UP, &vdev->state); in do_vxge_reset()
1765 for (i = 0; i < vdev->no_of_vpath; i++) { in do_vxge_reset()
1766 vxge_hw_vpath_enable(vdev->vpaths[i].handle); in do_vxge_reset()
1768 vxge_hw_vpath_rx_doorbell_init(vdev->vpaths[i].handle); in do_vxge_reset()
1771 netif_tx_wake_all_queues(vdev->ndev); in do_vxge_reset()
1775 vxge_config_ci_for_tti_rti(vdev); in do_vxge_reset()
1783 clear_bit(__VXGE_STATE_RESET_CARD, &vdev->state); in do_vxge_reset()
1795 struct vxgedev *vdev = container_of(work, struct vxgedev, reset_task); in vxge_reset() local
1797 if (!netif_running(vdev->ndev)) in vxge_reset()
1800 do_vxge_reset(vdev, VXGE_LL_FULL_RESET); in vxge_reset()
1844 struct vxgedev *vdev = container_of(napi, struct vxgedev, napi); in vxge_poll_inta() local
1850 struct __vxge_hw_device *hldev = pci_get_drvdata(vdev->pdev); in vxge_poll_inta()
1852 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_poll_inta()
1853 ring = &vdev->vpaths[i].ring; in vxge_poll_inta()
1863 VXGE_COMPLETE_ALL_TX(vdev); in vxge_poll_inta()
1887 struct vxgedev *vdev = netdev_priv(dev); in vxge_netpoll() local
1888 struct pci_dev *pdev = vdev->pdev; in vxge_netpoll()
1901 VXGE_COMPLETE_ALL_RX(vdev); in vxge_netpoll()
1902 VXGE_COMPLETE_ALL_TX(vdev); in vxge_netpoll()
1912 static enum vxge_hw_status vxge_rth_configure(struct vxgedev *vdev) in vxge_rth_configure() argument
1925 for (index = 0; index < (1 << vdev->config.rth_bkt_sz); index++) { in vxge_rth_configure()
1927 mtable[index] = index % vdev->no_of_vpath; in vxge_rth_configure()
1931 status = vxge_hw_vpath_rts_rth_itable_set(vdev->vp_handles, in vxge_rth_configure()
1932 vdev->no_of_vpath, in vxge_rth_configure()
1934 vdev->config.rth_bkt_sz); in vxge_rth_configure()
1938 "for vpath:%d", vdev->vpaths[0].device_id); in vxge_rth_configure()
1943 hash_types.hash_type_tcpipv4_en = vdev->config.rth_hash_type_tcpipv4; in vxge_rth_configure()
1944 hash_types.hash_type_ipv4_en = vdev->config.rth_hash_type_ipv4; in vxge_rth_configure()
1945 hash_types.hash_type_tcpipv6_en = vdev->config.rth_hash_type_tcpipv6; in vxge_rth_configure()
1946 hash_types.hash_type_ipv6_en = vdev->config.rth_hash_type_ipv6; in vxge_rth_configure()
1948 vdev->config.rth_hash_type_tcpipv6ex; in vxge_rth_configure()
1949 hash_types.hash_type_ipv6ex_en = vdev->config.rth_hash_type_ipv6ex; in vxge_rth_configure()
1957 for (index = 0; index < vdev->no_of_vpath; index++) { in vxge_rth_configure()
1959 vdev->vpaths[index].handle, in vxge_rth_configure()
1960 vdev->config.rth_algorithm, in vxge_rth_configure()
1962 vdev->config.rth_bkt_sz); in vxge_rth_configure()
1966 vdev->vpaths[index].device_id); in vxge_rth_configure()
1975 static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev) in vxge_reset_all_vpaths() argument
1981 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_reset_all_vpaths()
1982 vpath = &vdev->vpaths[i]; in vxge_reset_all_vpaths()
1985 if (is_vxge_card_up(vdev) && in vxge_reset_all_vpaths()
2007 static void vxge_close_vpaths(struct vxgedev *vdev, int index) in vxge_close_vpaths() argument
2012 for (i = index; i < vdev->no_of_vpath; i++) { in vxge_close_vpaths()
2013 vpath = &vdev->vpaths[i]; in vxge_close_vpaths()
2017 vdev->stats.vpaths_open--; in vxge_close_vpaths()
2025 static int vxge_open_vpaths(struct vxgedev *vdev) in vxge_open_vpaths() argument
2033 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_open_vpaths()
2034 vpath = &vdev->vpaths[i]; in vxge_open_vpaths()
2037 if (!vdev->titan1) { in vxge_open_vpaths()
2039 vcfg = &vdev->devh->config.vp_config[vpath->device_id]; in vxge_open_vpaths()
2046 vcfg->tti.uec_c = TTI_T1A_TX_UFC_C(vdev->mtu); in vxge_open_vpaths()
2047 vcfg->tti.uec_d = TTI_T1A_TX_UFC_D(vdev->mtu); in vxge_open_vpaths()
2064 vpath->ring.ndev = vdev->ndev; in vxge_open_vpaths()
2065 vpath->ring.pdev = vdev->pdev; in vxge_open_vpaths()
2067 status = vxge_hw_vpath_open(vdev->devh, &attr, &vpath->handle); in vxge_open_vpaths()
2074 vdev->config.tx_steering_type; in vxge_open_vpaths()
2075 vpath->fifo.ndev = vdev->ndev; in vxge_open_vpaths()
2076 vpath->fifo.pdev = vdev->pdev; in vxge_open_vpaths()
2081 if (vdev->config.tx_steering_type) in vxge_open_vpaths()
2083 netdev_get_tx_queue(vdev->ndev, i); in vxge_open_vpaths()
2086 netdev_get_tx_queue(vdev->ndev, 0); in vxge_open_vpaths()
2088 vdev->config.fifo_indicate_max_pkts; in vxge_open_vpaths()
2091 vpath->ring.rx_hwts = vdev->rx_hwts; in vxge_open_vpaths()
2093 vdev->vp_handles[i] = vpath->handle; in vxge_open_vpaths()
2094 vpath->ring.vlan_tag_strip = vdev->vlan_tag_strip; in vxge_open_vpaths()
2095 vdev->stats.vpaths_open++; in vxge_open_vpaths()
2097 vdev->stats.vpath_open_fail++; in vxge_open_vpaths()
2100 vdev->ndev->name, vpath->device_id, in vxge_open_vpaths()
2102 vxge_close_vpaths(vdev, 0); in vxge_open_vpaths()
2107 vdev->vpaths_deployed |= vxge_mBIT(vp_id); in vxge_open_vpaths()
2184 struct vxgedev *vdev = (struct vxgedev *)dev_id; in vxge_isr_napi() local
2188 dev = vdev->ndev; in vxge_isr_napi()
2189 hldev = pci_get_drvdata(vdev->pdev); in vxge_isr_napi()
2191 if (pci_channel_offline(vdev->pdev)) in vxge_isr_napi()
2194 if (unlikely(!is_vxge_card_up(vdev))) in vxge_isr_napi()
2197 status = vxge_hw_device_begin_irq(hldev, vdev->exec_mode, &reason); in vxge_isr_napi()
2203 vdev->vpaths_deployed >> in vxge_isr_napi()
2207 napi_schedule(&vdev->napi); in vxge_isr_napi()
2270 struct vxgedev *vdev = vpath->vdev; in vxge_alarm_msix_handle() local
2274 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_alarm_msix_handle()
2279 vxge_hw_vpath_msix_mask(vdev->vpaths[i].handle, msix_id); in vxge_alarm_msix_handle()
2280 vxge_hw_vpath_msix_clear(vdev->vpaths[i].handle, msix_id); in vxge_alarm_msix_handle()
2283 status = vxge_hw_vpath_alarm_process(vdev->vpaths[i].handle, in vxge_alarm_msix_handle()
2284 vdev->exec_mode); in vxge_alarm_msix_handle()
2286 vxge_hw_vpath_msix_unmask(vdev->vpaths[i].handle, in vxge_alarm_msix_handle()
2298 static int vxge_alloc_msix(struct vxgedev *vdev) in vxge_alloc_msix() argument
2302 vdev->intr_cnt = 0; in vxge_alloc_msix()
2306 vdev->intr_cnt = vdev->no_of_vpath * 2; in vxge_alloc_msix()
2309 vdev->intr_cnt++; in vxge_alloc_msix()
2311 vdev->entries = kcalloc(vdev->intr_cnt, sizeof(struct msix_entry), in vxge_alloc_msix()
2313 if (!vdev->entries) { in vxge_alloc_msix()
2321 vdev->vxge_entries = kcalloc(vdev->intr_cnt, in vxge_alloc_msix()
2324 if (!vdev->vxge_entries) { in vxge_alloc_msix()
2331 for (i = 0, j = 0; i < vdev->no_of_vpath; i++) { in vxge_alloc_msix()
2336 vdev->entries[j].entry = msix_intr_vect; in vxge_alloc_msix()
2337 vdev->vxge_entries[j].entry = msix_intr_vect; in vxge_alloc_msix()
2338 vdev->vxge_entries[j].in_use = 0; in vxge_alloc_msix()
2342 vdev->entries[j].entry = msix_intr_vect + 1; in vxge_alloc_msix()
2343 vdev->vxge_entries[j].entry = msix_intr_vect + 1; in vxge_alloc_msix()
2344 vdev->vxge_entries[j].in_use = 0; in vxge_alloc_msix()
2349 vdev->entries[j].entry = VXGE_ALARM_MSIX_ID; in vxge_alloc_msix()
2350 vdev->vxge_entries[j].entry = VXGE_ALARM_MSIX_ID; in vxge_alloc_msix()
2351 vdev->vxge_entries[j].in_use = 0; in vxge_alloc_msix()
2353 ret = pci_enable_msix_range(vdev->pdev, in vxge_alloc_msix()
2354 vdev->entries, 3, vdev->intr_cnt); in vxge_alloc_msix()
2358 } else if (ret < vdev->intr_cnt) { in vxge_alloc_msix()
2359 pci_disable_msix(vdev->pdev); in vxge_alloc_msix()
2363 VXGE_DRIVER_NAME, vdev->intr_cnt, ret); in vxge_alloc_msix()
2369 kfree(vdev->entries); in vxge_alloc_msix()
2370 kfree(vdev->vxge_entries); in vxge_alloc_msix()
2371 vdev->entries = NULL; in vxge_alloc_msix()
2372 vdev->vxge_entries = NULL; in vxge_alloc_msix()
2375 vxge_close_vpaths(vdev, temp); in vxge_alloc_msix()
2376 vdev->no_of_vpath = temp; in vxge_alloc_msix()
2382 kfree(vdev->vxge_entries); in vxge_alloc_msix()
2384 kfree(vdev->entries); in vxge_alloc_msix()
2389 static int vxge_enable_msix(struct vxgedev *vdev) in vxge_enable_msix() argument
2396 vdev->intr_cnt = 0; in vxge_enable_msix()
2399 ret = vxge_alloc_msix(vdev); in vxge_enable_msix()
2401 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_enable_msix()
2402 struct vxge_vpath *vpath = &vdev->vpaths[i]; in vxge_enable_msix()
2421 static void vxge_rem_msix_isr(struct vxgedev *vdev) in vxge_rem_msix_isr() argument
2425 for (intr_cnt = 0; intr_cnt < (vdev->no_of_vpath * 2 + 1); in vxge_rem_msix_isr()
2427 if (vdev->vxge_entries[intr_cnt].in_use) { in vxge_rem_msix_isr()
2428 synchronize_irq(vdev->entries[intr_cnt].vector); in vxge_rem_msix_isr()
2429 free_irq(vdev->entries[intr_cnt].vector, in vxge_rem_msix_isr()
2430 vdev->vxge_entries[intr_cnt].arg); in vxge_rem_msix_isr()
2431 vdev->vxge_entries[intr_cnt].in_use = 0; in vxge_rem_msix_isr()
2435 kfree(vdev->entries); in vxge_rem_msix_isr()
2436 kfree(vdev->vxge_entries); in vxge_rem_msix_isr()
2437 vdev->entries = NULL; in vxge_rem_msix_isr()
2438 vdev->vxge_entries = NULL; in vxge_rem_msix_isr()
2440 if (vdev->config.intr_type == MSI_X) in vxge_rem_msix_isr()
2441 pci_disable_msix(vdev->pdev); in vxge_rem_msix_isr()
2444 static void vxge_rem_isr(struct vxgedev *vdev) in vxge_rem_isr() argument
2447 vdev->config.intr_type == MSI_X) { in vxge_rem_isr()
2448 vxge_rem_msix_isr(vdev); in vxge_rem_isr()
2449 } else if (vdev->config.intr_type == INTA) { in vxge_rem_isr()
2450 synchronize_irq(vdev->pdev->irq); in vxge_rem_isr()
2451 free_irq(vdev->pdev->irq, vdev); in vxge_rem_isr()
2455 static int vxge_add_isr(struct vxgedev *vdev) in vxge_add_isr() argument
2459 int pci_fun = PCI_FUNC(vdev->pdev->devfn); in vxge_add_isr()
2461 if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) in vxge_add_isr()
2462 ret = vxge_enable_msix(vdev); in vxge_add_isr()
2469 vdev->config.intr_type = INTA; in vxge_add_isr()
2472 if (IS_ENABLED(CONFIG_PCI_MSI) && vdev->config.intr_type == MSI_X) { in vxge_add_isr()
2474 intr_idx < (vdev->no_of_vpath * in vxge_add_isr()
2482 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, in vxge_add_isr()
2484 vdev->ndev->name, in vxge_add_isr()
2485 vdev->entries[intr_cnt].entry, in vxge_add_isr()
2488 vdev->entries[intr_cnt].vector, in vxge_add_isr()
2490 vdev->desc[intr_cnt], in vxge_add_isr()
2491 &vdev->vpaths[vp_idx].fifo); in vxge_add_isr()
2492 vdev->vxge_entries[intr_cnt].arg = in vxge_add_isr()
2493 &vdev->vpaths[vp_idx].fifo; in vxge_add_isr()
2497 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, in vxge_add_isr()
2499 vdev->ndev->name, in vxge_add_isr()
2500 vdev->entries[intr_cnt].entry, in vxge_add_isr()
2503 vdev->entries[intr_cnt].vector, in vxge_add_isr()
2506 vdev->desc[intr_cnt], in vxge_add_isr()
2507 &vdev->vpaths[vp_idx].ring); in vxge_add_isr()
2508 vdev->vxge_entries[intr_cnt].arg = in vxge_add_isr()
2509 &vdev->vpaths[vp_idx].ring; in vxge_add_isr()
2517 vdev->ndev->name, intr_cnt); in vxge_add_isr()
2518 vxge_rem_msix_isr(vdev); in vxge_add_isr()
2519 vdev->config.intr_type = INTA; in vxge_add_isr()
2522 , vdev->ndev->name); in vxge_add_isr()
2528 vdev->vxge_entries[intr_cnt].in_use = 1; in vxge_add_isr()
2529 msix_idx += vdev->vpaths[vp_idx].device_id * in vxge_add_isr()
2532 vdev->vpaths[vp_idx].handle, in vxge_add_isr()
2539 (vp_idx < (vdev->no_of_vpath - 1))) in vxge_add_isr()
2543 intr_cnt = vdev->no_of_vpath * 2; in vxge_add_isr()
2544 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, in vxge_add_isr()
2546 vdev->ndev->name, in vxge_add_isr()
2547 vdev->entries[intr_cnt].entry, in vxge_add_isr()
2550 ret = request_irq(vdev->entries[intr_cnt].vector, in vxge_add_isr()
2552 vdev->desc[intr_cnt], in vxge_add_isr()
2553 &vdev->vpaths[0]); in vxge_add_isr()
2557 vdev->ndev->name, intr_cnt); in vxge_add_isr()
2558 vxge_rem_msix_isr(vdev); in vxge_add_isr()
2559 vdev->config.intr_type = INTA; in vxge_add_isr()
2562 vdev->ndev->name); in vxge_add_isr()
2566 msix_idx = (vdev->vpaths[0].handle->vpath->vp_id * in vxge_add_isr()
2568 vxge_hw_vpath_msix_unmask(vdev->vpaths[vp_idx].handle, in vxge_add_isr()
2570 vdev->vxge_entries[intr_cnt].in_use = 1; in vxge_add_isr()
2571 vdev->vxge_entries[intr_cnt].arg = &vdev->vpaths[0]; in vxge_add_isr()
2575 if (vdev->config.intr_type == INTA) { in vxge_add_isr()
2576 snprintf(vdev->desc[0], VXGE_INTR_STRLEN, in vxge_add_isr()
2577 "%s:vxge:INTA", vdev->ndev->name); in vxge_add_isr()
2578 vxge_hw_device_set_intr_type(vdev->devh, in vxge_add_isr()
2581 vxge_hw_vpath_tti_ci_set(vdev->vpaths[0].fifo.handle); in vxge_add_isr()
2583 ret = request_irq((int) vdev->pdev->irq, in vxge_add_isr()
2585 IRQF_SHARED, vdev->desc[0], vdev); in vxge_add_isr()
2589 VXGE_DRIVER_NAME, "IRQ", vdev->pdev->irq); in vxge_add_isr()
2594 "IRQ", vdev->pdev->irq); in vxge_add_isr()
2602 struct vxgedev *vdev = (struct vxgedev *)data; in vxge_poll_vp_reset() local
2605 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_poll_vp_reset()
2606 if (test_bit(i, &vdev->vp_reset)) { in vxge_poll_vp_reset()
2607 vxge_reset_vpath(vdev, i); in vxge_poll_vp_reset()
2611 if (j && (vdev->config.intr_type != MSI_X)) { in vxge_poll_vp_reset()
2612 vxge_hw_device_unmask_all(vdev->devh); in vxge_poll_vp_reset()
2613 vxge_hw_device_flush_io(vdev->devh); in vxge_poll_vp_reset()
2616 mod_timer(&vdev->vp_reset_timer, jiffies + HZ / 2); in vxge_poll_vp_reset()
2621 struct vxgedev *vdev = (struct vxgedev *)data; in vxge_poll_vp_lockup() local
2628 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_poll_vp_lockup()
2629 ring = &vdev->vpaths[i].ring; in vxge_poll_vp_lockup()
2643 if (!test_and_set_bit(i, &vdev->vp_reset)) { in vxge_poll_vp_lockup()
2644 vpath = &vdev->vpaths[i]; in vxge_poll_vp_lockup()
2647 vxge_vpath_intr_disable(vdev, i); in vxge_poll_vp_lockup()
2660 mod_timer(&vdev->vp_lockup_timer, jiffies + HZ / 1000); in vxge_poll_vp_lockup()
2680 struct vxgedev *vdev = netdev_priv(dev); in vxge_set_features() local
2688 vdev->devh->config.rth_en = !!(features & NETIF_F_RXHASH); in vxge_set_features()
2689 if (vxge_reset_all_vpaths(vdev) != VXGE_HW_OK) { in vxge_set_features()
2691 vdev->devh->config.rth_en = !!(dev->features & NETIF_F_RXHASH); in vxge_set_features()
2711 struct vxgedev *vdev; in vxge_open() local
2721 vdev = netdev_priv(dev); in vxge_open()
2722 hldev = pci_get_drvdata(vdev->pdev); in vxge_open()
2723 function_mode = vdev->config.device_hw_info.function_mode; in vxge_open()
2730 status = vxge_open_vpaths(vdev); in vxge_open()
2733 "%s: fatal: Vpath open failed", vdev->ndev->name); in vxge_open()
2738 vdev->mtu = dev->mtu; in vxge_open()
2740 status = vxge_add_isr(vdev); in vxge_open()
2748 if (vdev->config.intr_type != MSI_X) { in vxge_open()
2749 netif_napi_add(dev, &vdev->napi, vxge_poll_inta, in vxge_open()
2750 vdev->config.napi_weight); in vxge_open()
2751 napi_enable(&vdev->napi); in vxge_open()
2752 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_open()
2753 vpath = &vdev->vpaths[i]; in vxge_open()
2754 vpath->ring.napi_p = &vdev->napi; in vxge_open()
2757 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_open()
2758 vpath = &vdev->vpaths[i]; in vxge_open()
2760 vxge_poll_msix, vdev->config.napi_weight); in vxge_open()
2767 if (vdev->config.rth_steering) { in vxge_open()
2768 status = vxge_rth_configure(vdev); in vxge_open()
2780 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_open()
2781 vpath = &vdev->vpaths[i]; in vxge_open()
2784 status = vxge_hw_vpath_mtu_set(vpath->handle, vdev->mtu); in vxge_open()
2793 VXGE_DEVICE_DEBUG_LEVEL_SET(VXGE_TRACE, VXGE_COMPONENT_LL, vdev); in vxge_open()
2794 vxge_debug_init(vdev->level_trace, in vxge_open()
2795 "%s: MTU is %d", vdev->ndev->name, vdev->mtu); in vxge_open()
2796 VXGE_DEVICE_DEBUG_LEVEL_SET(VXGE_ERR, VXGE_COMPONENT_LL, vdev); in vxge_open()
2801 if (vdev->all_multi_flg) { in vxge_open()
2802 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_open()
2803 vpath = &vdev->vpaths[i]; in vxge_open()
2823 vxge_hw_mgmt_reg_write(vdev->devh, in vxge_open()
2830 vxge_hw_mgmt_reg_write(vdev->devh, in vxge_open()
2840 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_open()
2841 vpath = &vdev->vpaths[i]; in vxge_open()
2847 if (vdev->config.addr_learn_en) { in vxge_open()
2856 vxge_hw_device_setpause_data(vdev->devh, 0, in vxge_open()
2857 vdev->config.tx_pause_enable, in vxge_open()
2858 vdev->config.rx_pause_enable); in vxge_open()
2860 if (vdev->vp_reset_timer.function == NULL) in vxge_open()
2861 vxge_os_timer(&vdev->vp_reset_timer, vxge_poll_vp_reset, vdev, in vxge_open()
2865 if (vdev->titan1 && vdev->vp_lockup_timer.function == NULL) in vxge_open()
2866 vxge_os_timer(&vdev->vp_lockup_timer, vxge_poll_vp_lockup, vdev, in vxge_open()
2869 set_bit(__VXGE_STATE_CARD_UP, &vdev->state); in vxge_open()
2873 if (vxge_hw_device_link_state_get(vdev->devh) == VXGE_HW_LINK_UP) { in vxge_open()
2874 netif_carrier_on(vdev->ndev); in vxge_open()
2875 netdev_notice(vdev->ndev, "Link Up\n"); in vxge_open()
2876 vdev->stats.link_up++; in vxge_open()
2879 vxge_hw_device_intr_enable(vdev->devh); in vxge_open()
2883 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_open()
2884 vpath = &vdev->vpaths[i]; in vxge_open()
2891 netif_tx_start_all_queues(vdev->ndev); in vxge_open()
2894 vxge_config_ci_for_tti_rti(vdev); in vxge_open()
2899 vxge_rem_isr(vdev); in vxge_open()
2902 if (vdev->config.intr_type != MSI_X) in vxge_open()
2903 napi_disable(&vdev->napi); in vxge_open()
2905 for (i = 0; i < vdev->no_of_vpath; i++) in vxge_open()
2906 napi_disable(&vdev->vpaths[i].ring.napi); in vxge_open()
2910 vxge_close_vpaths(vdev, 0); in vxge_open()
2932 static void vxge_napi_del_all(struct vxgedev *vdev) in vxge_napi_del_all() argument
2935 if (vdev->config.intr_type != MSI_X) in vxge_napi_del_all()
2936 netif_napi_del(&vdev->napi); in vxge_napi_del_all()
2938 for (i = 0; i < vdev->no_of_vpath; i++) in vxge_napi_del_all()
2939 netif_napi_del(&vdev->vpaths[i].ring.napi); in vxge_napi_del_all()
2946 struct vxgedev *vdev; in do_vxge_close() local
2953 vdev = netdev_priv(dev); in do_vxge_close()
2954 hldev = pci_get_drvdata(vdev->pdev); in do_vxge_close()
2956 if (unlikely(!is_vxge_card_up(vdev))) in do_vxge_close()
2961 while (test_and_set_bit(__VXGE_STATE_RESET_CARD, &vdev->state)) in do_vxge_close()
2966 vpath_vector = vxge_mBIT(vdev->vpaths[0].device_id); in do_vxge_close()
2967 status = vxge_hw_mgmt_reg_read(vdev->devh, in do_vxge_close()
2976 status = vxge_hw_mgmt_reg_write(vdev->devh, in do_vxge_close()
2986 vxge_hw_mgmt_reg_write(vdev->devh, in do_vxge_close()
2993 vxge_hw_mgmt_reg_write(vdev->devh, in do_vxge_close()
3003 if (vdev->titan1) in do_vxge_close()
3004 del_timer_sync(&vdev->vp_lockup_timer); in do_vxge_close()
3006 del_timer_sync(&vdev->vp_reset_timer); in do_vxge_close()
3011 clear_bit(__VXGE_STATE_CARD_UP, &vdev->state); in do_vxge_close()
3014 if (vdev->config.intr_type != MSI_X) in do_vxge_close()
3015 napi_disable(&vdev->napi); in do_vxge_close()
3017 for (i = 0; i < vdev->no_of_vpath; i++) in do_vxge_close()
3018 napi_disable(&vdev->vpaths[i].ring.napi); in do_vxge_close()
3021 netif_carrier_off(vdev->ndev); in do_vxge_close()
3022 netdev_notice(vdev->ndev, "Link Down\n"); in do_vxge_close()
3023 netif_tx_stop_all_queues(vdev->ndev); in do_vxge_close()
3027 vxge_hw_device_intr_disable(vdev->devh); in do_vxge_close()
3029 vxge_rem_isr(vdev); in do_vxge_close()
3031 vxge_napi_del_all(vdev); in do_vxge_close()
3034 vxge_reset_all_vpaths(vdev); in do_vxge_close()
3036 vxge_close_vpaths(vdev, 0); in do_vxge_close()
3041 clear_bit(__VXGE_STATE_RESET_CARD, &vdev->state); in do_vxge_close()
3073 struct vxgedev *vdev = netdev_priv(dev); in vxge_change_mtu() local
3075 vxge_debug_entryexit(vdev->level_trace, in vxge_change_mtu()
3078 vxge_debug_init(vdev->level_err, in vxge_change_mtu()
3084 if (unlikely(!is_vxge_card_up(vdev))) { in vxge_change_mtu()
3087 vxge_debug_init(vdev->level_err, in vxge_change_mtu()
3092 vxge_debug_init(vdev->level_trace, in vxge_change_mtu()
3099 vdev->mtu = new_mtu; in vxge_change_mtu()
3104 vxge_debug_init(vdev->level_trace, in vxge_change_mtu()
3105 "%s: MTU changed to %d", vdev->ndev->name, new_mtu); in vxge_change_mtu()
3107 vxge_debug_entryexit(vdev->level_trace, in vxge_change_mtu()
3122 struct vxgedev *vdev = netdev_priv(dev); in vxge_get_stats64() local
3126 for (k = 0; k < vdev->no_of_vpath; k++) { in vxge_get_stats64()
3127 struct vxge_ring_stats *rxstats = &vdev->vpaths[k].ring.stats; in vxge_get_stats64()
3128 struct vxge_fifo_stats *txstats = &vdev->vpaths[k].fifo.stats; in vxge_get_stats64()
3187 static int vxge_hwtstamp_set(struct vxgedev *vdev, void __user *data) in vxge_hwtstamp_set() argument
3210 vdev->rx_hwts = 0; in vxge_hwtstamp_set()
3228 if (vdev->devh->config.hwts_en != VXGE_HW_HWTS_ENABLE) in vxge_hwtstamp_set()
3231 vdev->rx_hwts = 1; in vxge_hwtstamp_set()
3239 for (i = 0; i < vdev->no_of_vpath; i++) in vxge_hwtstamp_set()
3240 vdev->vpaths[i].ring.rx_hwts = vdev->rx_hwts; in vxge_hwtstamp_set()
3248 static int vxge_hwtstamp_get(struct vxgedev *vdev, void __user *data) in vxge_hwtstamp_get() argument
3254 config.rx_filter = (vdev->rx_hwts ? in vxge_hwtstamp_get()
3275 struct vxgedev *vdev = netdev_priv(dev); in vxge_ioctl() local
3279 return vxge_hwtstamp_set(vdev, rq->ifr_data); in vxge_ioctl()
3281 return vxge_hwtstamp_get(vdev, rq->ifr_data); in vxge_ioctl()
3297 struct vxgedev *vdev; in vxge_tx_watchdog() local
3301 vdev = netdev_priv(dev); in vxge_tx_watchdog()
3303 vdev->cric_err_event = VXGE_HW_EVENT_RESET_START; in vxge_tx_watchdog()
3305 schedule_work(&vdev->reset_task); in vxge_tx_watchdog()
3321 struct vxgedev *vdev = netdev_priv(dev); in vxge_vlan_rx_add_vid() local
3326 for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) { in vxge_vlan_rx_add_vid()
3327 vpath = &vdev->vpaths[vp_id]; in vxge_vlan_rx_add_vid()
3332 set_bit(vid, vdev->active_vlans); in vxge_vlan_rx_add_vid()
3347 struct vxgedev *vdev = netdev_priv(dev); in vxge_vlan_rx_kill_vid() local
3354 for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) { in vxge_vlan_rx_kill_vid()
3355 vpath = &vdev->vpaths[vp_id]; in vxge_vlan_rx_kill_vid()
3362 clear_bit(vid, vdev->active_vlans); in vxge_vlan_rx_kill_vid()
3392 struct vxgedev *vdev; in vxge_device_register() local
3415 vdev = netdev_priv(ndev); in vxge_device_register()
3416 memset(vdev, 0, sizeof(struct vxgedev)); in vxge_device_register()
3418 vdev->ndev = ndev; in vxge_device_register()
3419 vdev->devh = hldev; in vxge_device_register()
3420 vdev->pdev = hldev->pdev; in vxge_device_register()
3421 memcpy(&vdev->config, config, sizeof(struct vxge_config)); in vxge_device_register()
3422 vdev->rx_hwts = 0; in vxge_device_register()
3423 vdev->titan1 = (vdev->pdev->revision == VXGE_HW_TITAN1_PCI_REVISION); in vxge_device_register()
3425 SET_NETDEV_DEV(ndev, &vdev->pdev->dev); in vxge_device_register()
3431 if (vdev->config.rth_steering != NO_STEERING) in vxge_device_register()
3441 INIT_WORK(&vdev->reset_task, vxge_reset); in vxge_device_register()
3446 vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) * in vxge_device_register()
3448 if (!vdev->vpaths) { in vxge_device_register()
3451 vdev->ndev->name); in vxge_device_register()
3487 *vdev_out = vdev; in vxge_device_register()
3509 kfree(vdev->vpaths); in vxge_device_register()
3523 struct vxgedev *vdev; in vxge_device_unregister() local
3528 vdev = netdev_priv(dev); in vxge_device_unregister()
3530 vxge_debug_entryexit(vdev->level_trace, "%s: %s:%d", vdev->ndev->name, in vxge_device_unregister()
3535 flush_work(&vdev->reset_task); in vxge_device_unregister()
3540 kfree(vdev->vpaths); in vxge_device_unregister()
3545 vxge_debug_init(vdev->level_trace, "%s: ethernet device unregistered", in vxge_device_unregister()
3547 vxge_debug_entryexit(vdev->level_trace, "%s: %s:%d Exiting...", buf, in vxge_device_unregister()
3562 struct vxgedev *vdev = netdev_priv(dev); in vxge_callback_crit_err() local
3566 vxge_debug_entryexit(vdev->level_trace, in vxge_callback_crit_err()
3567 "%s: %s:%d", vdev->ndev->name, __func__, __LINE__); in vxge_callback_crit_err()
3572 vdev->cric_err_event = type; in vxge_callback_crit_err()
3574 for (vpath_idx = 0; vpath_idx < vdev->no_of_vpath; vpath_idx++) { in vxge_callback_crit_err()
3575 vpath = &vdev->vpaths[vpath_idx]; in vxge_callback_crit_err()
3580 if (!test_bit(__VXGE_STATE_RESET_CARD, &vdev->state)) { in vxge_callback_crit_err()
3583 "%s: Slot is frozen", vdev->ndev->name); in vxge_callback_crit_err()
3587 vdev->ndev->name); in vxge_callback_crit_err()
3591 vdev->ndev->name); in vxge_callback_crit_err()
3596 if (unlikely(vdev->exec_mode)) in vxge_callback_crit_err()
3597 clear_bit(__VXGE_STATE_CARD_UP, &vdev->state); in vxge_callback_crit_err()
3600 if (unlikely(vdev->exec_mode)) in vxge_callback_crit_err()
3601 clear_bit(__VXGE_STATE_CARD_UP, &vdev->state); in vxge_callback_crit_err()
3605 if (unlikely(vdev->exec_mode)) in vxge_callback_crit_err()
3606 clear_bit(__VXGE_STATE_CARD_UP, &vdev->state); in vxge_callback_crit_err()
3609 if (!test_and_set_bit(vpath_idx, &vdev->vp_reset)) { in vxge_callback_crit_err()
3612 vxge_vpath_intr_disable(vdev, vpath_idx); in vxge_callback_crit_err()
3620 vxge_debug_entryexit(vdev->level_trace, in vxge_callback_crit_err()
3622 vdev->ndev->name, __func__, __LINE__); in vxge_callback_crit_err()
3924 static void vxge_print_parm(struct vxgedev *vdev, u64 vpath_mask) in vxge_print_parm() argument
3930 vdev->ndev->name, vdev->no_of_vpath); in vxge_print_parm()
3932 switch (vdev->config.intr_type) { in vxge_print_parm()
3935 "%s: Interrupt type INTA", vdev->ndev->name); in vxge_print_parm()
3940 "%s: Interrupt type MSI-X", vdev->ndev->name); in vxge_print_parm()
3944 if (vdev->config.rth_steering) { in vxge_print_parm()
3947 vdev->ndev->name); in vxge_print_parm()
3950 "%s: RTH steering disabled", vdev->ndev->name); in vxge_print_parm()
3953 switch (vdev->config.tx_steering_type) { in vxge_print_parm()
3956 "%s: Tx steering disabled", vdev->ndev->name); in vxge_print_parm()
3961 vdev->ndev->name); in vxge_print_parm()
3963 "%s: Tx steering disabled", vdev->ndev->name); in vxge_print_parm()
3964 vdev->config.tx_steering_type = 0; in vxge_print_parm()
3969 vdev->ndev->name); in vxge_print_parm()
3971 "%s: Tx steering disabled", vdev->ndev->name); in vxge_print_parm()
3972 vdev->config.tx_steering_type = 0; in vxge_print_parm()
3977 vdev->ndev->name); in vxge_print_parm()
3982 vdev->ndev->name); in vxge_print_parm()
3987 vdev->ndev->name); in vxge_print_parm()
3989 "%s: Tx steering disabled", vdev->ndev->name); in vxge_print_parm()
3990 vdev->config.tx_steering_type = 0; in vxge_print_parm()
3993 if (vdev->config.addr_learn_en) in vxge_print_parm()
3995 "%s: MAC Address learning enabled", vdev->ndev->name); in vxge_print_parm()
4001 "%s: MTU size - %d", vdev->ndev->name, in vxge_print_parm()
4002 ((vdev->devh))-> in vxge_print_parm()
4005 "%s: VLAN tag stripping %s", vdev->ndev->name, in vxge_print_parm()
4006 ((vdev->devh))-> in vxge_print_parm()
4010 "%s: Max frags : %d", vdev->ndev->name, in vxge_print_parm()
4011 ((vdev->devh))-> in vxge_print_parm()
4080 struct vxgedev *vdev = netdev_priv(netdev); in vxge_io_slot_reset() local
4088 do_vxge_reset(vdev, VXGE_LL_FULL_RESET); in vxge_io_slot_reset()
4146 int vxge_fw_upgrade(struct vxgedev *vdev, char *fw_name, int override) in vxge_fw_upgrade() argument
4148 struct __vxge_hw_device *hldev = vdev->devh; in vxge_fw_upgrade()
4154 ret = request_firmware(&fw, fw_name, &vdev->pdev->dev); in vxge_fw_upgrade()
4181 cmaj = vdev->config.device_hw_info.fw_version.major; in vxge_fw_upgrade()
4182 cmin = vdev->config.device_hw_info.fw_version.minor; in vxge_fw_upgrade()
4183 cbld = vdev->config.device_hw_info.fw_version.build; in vxge_fw_upgrade()
4215 static int vxge_probe_fw_update(struct vxgedev *vdev) in vxge_probe_fw_update() argument
4221 maj = vdev->config.device_hw_info.fw_version.major; in vxge_probe_fw_update()
4222 min = vdev->config.device_hw_info.fw_version.minor; in vxge_probe_fw_update()
4223 bld = vdev->config.device_hw_info.fw_version.build; in vxge_probe_fw_update()
4251 if (vdev->devh->eprom_versions[i]) { in vxge_probe_fw_update()
4261 ret = vxge_fw_upgrade(vdev, fw_name, 0); in vxge_probe_fw_update()
4320 struct vxgedev *vdev; in vxge_probe() local
4593 &vdev); in vxge_probe()
4599 ret = vxge_probe_fw_update(vdev); in vxge_probe()
4604 VXGE_COPY_DEBUG_INFO_TO_LL(vdev, vxge_hw_device_error_level_get(hldev), in vxge_probe()
4608 vdev->mtu = VXGE_HW_DEFAULT_MTU; in vxge_probe()
4609 vdev->bar0 = attr.bar0; in vxge_probe()
4610 vdev->max_vpath_supported = max_vpath_supported; in vxge_probe()
4611 vdev->no_of_vpath = no_of_vpath; in vxge_probe()
4617 if (j >= vdev->no_of_vpath) in vxge_probe()
4620 vdev->vpaths[j].is_configured = 1; in vxge_probe()
4621 vdev->vpaths[j].device_id = i; in vxge_probe()
4622 vdev->vpaths[j].ring.driver_id = j; in vxge_probe()
4623 vdev->vpaths[j].vdev = vdev; in vxge_probe()
4624 vdev->vpaths[j].max_mac_addr_cnt = max_mac_vpath; in vxge_probe()
4625 memcpy((u8 *)vdev->vpaths[j].macaddr, in vxge_probe()
4630 INIT_LIST_HEAD(&vdev->vpaths[j].mac_addr_list); in vxge_probe()
4632 vdev->vpaths[j].mac_addr_cnt = 0; in vxge_probe()
4633 vdev->vpaths[j].mcast_addr_cnt = 0; in vxge_probe()
4636 vdev->exec_mode = VXGE_EXEC_MODE_DISABLE; in vxge_probe()
4637 vdev->max_config_port = max_config_port; in vxge_probe()
4639 vdev->vlan_tag_strip = vlan_tag_strip; in vxge_probe()
4642 for (i = 0; i < vdev->no_of_vpath; i++) in vxge_probe()
4643 vdev->vpath_selector[i] = vpath_selector[i]; in vxge_probe()
4645 macaddr = (u8 *)vdev->vpaths[0].macaddr; in vxge_probe()
4652 vdev->ndev->name, ll_config->device_hw_info.serial_number); in vxge_probe()
4655 vdev->ndev->name, ll_config->device_hw_info.part_number); in vxge_probe()
4658 vdev->ndev->name, ll_config->device_hw_info.product_desc); in vxge_probe()
4661 vdev->ndev->name, macaddr); in vxge_probe()
4664 vdev->ndev->name, vxge_hw_device_link_width_get(hldev)); in vxge_probe()
4667 "%s: Firmware version : %s Date : %s", vdev->ndev->name, in vxge_probe()
4675 "%s: Single Function Mode Enabled", vdev->ndev->name); in vxge_probe()
4679 "%s: Multi Function Mode Enabled", vdev->ndev->name); in vxge_probe()
4683 "%s: Single Root IOV Mode Enabled", vdev->ndev->name); in vxge_probe()
4687 "%s: Multi Root IOV Mode Enabled", vdev->ndev->name); in vxge_probe()
4692 vxge_print_parm(vdev, vpath_mask); in vxge_probe()
4695 strcpy(vdev->fw_version, ll_config->device_hw_info.fw_version.version); in vxge_probe()
4696 memcpy(vdev->ndev->dev_addr, (u8 *)vdev->vpaths[0].macaddr, ETH_ALEN); in vxge_probe()
4699 for (i = 0; i < vdev->no_of_vpath; i++) { in vxge_probe()
4704 vdev->ndev->name); in vxge_probe()
4709 memcpy(macaddr, vdev->ndev->dev_addr, ETH_ALEN); in vxge_probe()
4710 list_add(&entry->item, &vdev->vpaths[i].mac_addr_list); in vxge_probe()
4711 vdev->vpaths[i].mac_addr_cnt = 1; in vxge_probe()
4733 if (vdev->config.intr_type == INTA) in vxge_probe()
4737 vdev->ndev->name, __func__, __LINE__); in vxge_probe()
4740 VXGE_COPY_DEBUG_INFO_TO_LL(vdev, vxge_hw_device_error_level_get(hldev), in vxge_probe()
4747 for (i = 0; i < vdev->no_of_vpath; i++) in vxge_probe()
4748 vxge_free_mac_add_list(&vdev->vpaths[i]); in vxge_probe()
4777 struct vxgedev *vdev; in vxge_remove() local
4784 vdev = netdev_priv(hldev->ndev); in vxge_remove()
4786 vxge_debug_entryexit(vdev->level_trace, "%s:%d", __func__, __LINE__); in vxge_remove()
4787 vxge_debug_init(vdev->level_trace, "%s : removing PCI device...", in vxge_remove()
4790 for (i = 0; i < vdev->no_of_vpath; i++) in vxge_remove()
4791 vxge_free_mac_add_list(&vdev->vpaths[i]); in vxge_remove()
4796 iounmap(vdev->bar0); in vxge_remove()
4802 vxge_debug_init(vdev->level_trace, "%s:%d Device unregistered", in vxge_remove()
4804 vxge_debug_entryexit(vdev->level_trace, "%s:%d Exiting...", __func__, in vxge_remove()