Lines Matching full:adapter

10  * @adapter: board private structure to initialize
17 static bool ixgbe_cache_ring_dcb_sriov(struct ixgbe_adapter *adapter) in ixgbe_cache_ring_dcb_sriov() argument
20 struct ixgbe_ring_feature *fcoe = &adapter->ring_feature[RING_F_FCOE]; in ixgbe_cache_ring_dcb_sriov()
22 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ]; in ixgbe_cache_ring_dcb_sriov()
25 u8 tcs = adapter->hw_tcs; in ixgbe_cache_ring_dcb_sriov()
32 if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) in ixgbe_cache_ring_dcb_sriov()
37 for (i = 0, pool = 0; i < adapter->num_rx_queues; i++, reg_idx++) { in ixgbe_cache_ring_dcb_sriov()
43 adapter->rx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_dcb_sriov()
44 adapter->rx_ring[i]->netdev = pool ? NULL : adapter->netdev; in ixgbe_cache_ring_dcb_sriov()
48 for (i = 0; i < adapter->num_tx_queues; i++, reg_idx++) { in ixgbe_cache_ring_dcb_sriov()
52 adapter->tx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_dcb_sriov()
57 if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) in ixgbe_cache_ring_dcb_sriov()
67 u8 fcoe_tc = ixgbe_fcoe_get_tc(adapter); in ixgbe_cache_ring_dcb_sriov()
70 for (i = fcoe->offset; i < adapter->num_rx_queues; i++) { in ixgbe_cache_ring_dcb_sriov()
72 adapter->rx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_dcb_sriov()
73 adapter->rx_ring[i]->netdev = adapter->netdev; in ixgbe_cache_ring_dcb_sriov()
78 for (i = fcoe->offset; i < adapter->num_tx_queues; i++) { in ixgbe_cache_ring_dcb_sriov()
80 adapter->tx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_dcb_sriov()
90 static void ixgbe_get_first_reg_idx(struct ixgbe_adapter *adapter, u8 tc, in ixgbe_get_first_reg_idx() argument
93 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_get_first_reg_idx()
94 u8 num_tcs = adapter->hw_tcs; in ixgbe_get_first_reg_idx()
143 * @adapter: board private structure to initialize
148 static bool ixgbe_cache_ring_dcb(struct ixgbe_adapter *adapter) in ixgbe_cache_ring_dcb() argument
150 u8 num_tcs = adapter->hw_tcs; in ixgbe_cache_ring_dcb()
158 rss_i = adapter->ring_feature[RING_F_RSS].indices; in ixgbe_cache_ring_dcb()
161 ixgbe_get_first_reg_idx(adapter, tc, &tx_idx, &rx_idx); in ixgbe_cache_ring_dcb()
163 adapter->tx_ring[offset + i]->reg_idx = tx_idx; in ixgbe_cache_ring_dcb()
164 adapter->rx_ring[offset + i]->reg_idx = rx_idx; in ixgbe_cache_ring_dcb()
165 adapter->rx_ring[offset + i]->netdev = adapter->netdev; in ixgbe_cache_ring_dcb()
166 adapter->tx_ring[offset + i]->dcb_tc = tc; in ixgbe_cache_ring_dcb()
167 adapter->rx_ring[offset + i]->dcb_tc = tc; in ixgbe_cache_ring_dcb()
177 * @adapter: board private structure to initialize
183 static bool ixgbe_cache_ring_sriov(struct ixgbe_adapter *adapter) in ixgbe_cache_ring_sriov() argument
186 struct ixgbe_ring_feature *fcoe = &adapter->ring_feature[RING_F_FCOE]; in ixgbe_cache_ring_sriov()
188 struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ]; in ixgbe_cache_ring_sriov()
189 struct ixgbe_ring_feature *rss = &adapter->ring_feature[RING_F_RSS]; in ixgbe_cache_ring_sriov()
194 if (!(adapter->flags & IXGBE_FLAG_VMDQ_ENABLED)) in ixgbe_cache_ring_sriov()
200 for (i = 0; i < adapter->num_rx_queues; i++, reg_idx++) { in ixgbe_cache_ring_sriov()
211 adapter->rx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_sriov()
212 adapter->rx_ring[i]->netdev = pool ? NULL : adapter->netdev; in ixgbe_cache_ring_sriov()
217 for (; i < adapter->num_rx_queues; i++, reg_idx++) { in ixgbe_cache_ring_sriov()
218 adapter->rx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_sriov()
219 adapter->rx_ring[i]->netdev = adapter->netdev; in ixgbe_cache_ring_sriov()
224 for (i = 0; i < adapter->num_tx_queues; i++, reg_idx++) { in ixgbe_cache_ring_sriov()
233 adapter->tx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_sriov()
238 for (; i < adapter->num_tx_queues; i++, reg_idx++) in ixgbe_cache_ring_sriov()
239 adapter->tx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_sriov()
248 * @adapter: board private structure to initialize
253 static bool ixgbe_cache_ring_rss(struct ixgbe_adapter *adapter) in ixgbe_cache_ring_rss() argument
257 for (i = 0; i < adapter->num_rx_queues; i++) { in ixgbe_cache_ring_rss()
258 adapter->rx_ring[i]->reg_idx = i; in ixgbe_cache_ring_rss()
259 adapter->rx_ring[i]->netdev = adapter->netdev; in ixgbe_cache_ring_rss()
261 for (i = 0, reg_idx = 0; i < adapter->num_tx_queues; i++, reg_idx++) in ixgbe_cache_ring_rss()
262 adapter->tx_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_rss()
263 for (i = 0; i < adapter->num_xdp_queues; i++, reg_idx++) in ixgbe_cache_ring_rss()
264 adapter->xdp_ring[i]->reg_idx = reg_idx; in ixgbe_cache_ring_rss()
271 * @adapter: board private structure to initialize
280 static void ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) in ixgbe_cache_ring_register() argument
283 adapter->rx_ring[0]->reg_idx = 0; in ixgbe_cache_ring_register()
284 adapter->tx_ring[0]->reg_idx = 0; in ixgbe_cache_ring_register()
287 if (ixgbe_cache_ring_dcb_sriov(adapter)) in ixgbe_cache_ring_register()
290 if (ixgbe_cache_ring_dcb(adapter)) in ixgbe_cache_ring_register()
294 if (ixgbe_cache_ring_sriov(adapter)) in ixgbe_cache_ring_register()
297 ixgbe_cache_ring_rss(adapter); in ixgbe_cache_ring_register()
300 static int ixgbe_xdp_queues(struct ixgbe_adapter *adapter) in ixgbe_xdp_queues() argument
305 return adapter->xdp_prog ? queues : 0; in ixgbe_xdp_queues()
318 * @adapter: board private structure to initialize
325 static bool ixgbe_set_dcb_sriov_queues(struct ixgbe_adapter *adapter) in ixgbe_set_dcb_sriov_queues() argument
328 u16 vmdq_i = adapter->ring_feature[RING_F_VMDQ].limit; in ixgbe_set_dcb_sriov_queues()
333 u8 tcs = adapter->hw_tcs; in ixgbe_set_dcb_sriov_queues()
340 if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) in ixgbe_set_dcb_sriov_queues()
347 vmdq_i += adapter->ring_feature[RING_F_VMDQ].offset; in ixgbe_set_dcb_sriov_queues()
365 vmdq_i -= adapter->ring_feature[RING_F_VMDQ].offset; in ixgbe_set_dcb_sriov_queues()
368 adapter->ring_feature[RING_F_VMDQ].indices = vmdq_i; in ixgbe_set_dcb_sriov_queues()
369 adapter->ring_feature[RING_F_VMDQ].mask = vmdq_m; in ixgbe_set_dcb_sriov_queues()
375 adapter->ring_feature[RING_F_RSS].indices = 1; in ixgbe_set_dcb_sriov_queues()
376 adapter->ring_feature[RING_F_RSS].mask = IXGBE_RSS_DISABLED_MASK; in ixgbe_set_dcb_sriov_queues()
379 adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; in ixgbe_set_dcb_sriov_queues()
381 adapter->num_rx_pools = vmdq_i; in ixgbe_set_dcb_sriov_queues()
382 adapter->num_rx_queues_per_pool = tcs; in ixgbe_set_dcb_sriov_queues()
384 adapter->num_tx_queues = vmdq_i * tcs; in ixgbe_set_dcb_sriov_queues()
385 adapter->num_xdp_queues = 0; in ixgbe_set_dcb_sriov_queues()
386 adapter->num_rx_queues = vmdq_i * tcs; in ixgbe_set_dcb_sriov_queues()
389 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { in ixgbe_set_dcb_sriov_queues()
392 fcoe = &adapter->ring_feature[RING_F_FCOE]; in ixgbe_set_dcb_sriov_queues()
402 /* add queues to adapter */ in ixgbe_set_dcb_sriov_queues()
403 adapter->num_tx_queues += fcoe_i; in ixgbe_set_dcb_sriov_queues()
404 adapter->num_rx_queues += fcoe_i; in ixgbe_set_dcb_sriov_queues()
408 fcoe->offset = ixgbe_fcoe_get_tc(adapter); in ixgbe_set_dcb_sriov_queues()
410 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; in ixgbe_set_dcb_sriov_queues()
420 netdev_set_tc_queue(adapter->netdev, i, 1, i); in ixgbe_set_dcb_sriov_queues()
425 static bool ixgbe_set_dcb_queues(struct ixgbe_adapter *adapter) in ixgbe_set_dcb_queues() argument
427 struct net_device *dev = adapter->netdev; in ixgbe_set_dcb_queues()
433 tcs = adapter->hw_tcs; in ixgbe_set_dcb_queues()
441 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { in ixgbe_set_dcb_queues()
456 f = &adapter->ring_feature[RING_F_RSS]; in ixgbe_set_dcb_queues()
462 adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; in ixgbe_set_dcb_queues()
470 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { in ixgbe_set_dcb_queues()
471 u8 tc = ixgbe_fcoe_get_tc(adapter); in ixgbe_set_dcb_queues()
473 f = &adapter->ring_feature[RING_F_FCOE]; in ixgbe_set_dcb_queues()
482 adapter->num_tx_queues = rss_i * tcs; in ixgbe_set_dcb_queues()
483 adapter->num_xdp_queues = 0; in ixgbe_set_dcb_queues()
484 adapter->num_rx_queues = rss_i * tcs; in ixgbe_set_dcb_queues()
492 * @adapter: board private structure to initialize
499 static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter) in ixgbe_set_sriov_queues() argument
501 u16 vmdq_i = adapter->ring_feature[RING_F_VMDQ].limit; in ixgbe_set_sriov_queues()
503 u16 rss_i = adapter->ring_feature[RING_F_RSS].limit; in ixgbe_set_sriov_queues()
510 if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) in ixgbe_set_sriov_queues()
517 vmdq_i += adapter->ring_feature[RING_F_VMDQ].offset; in ixgbe_set_sriov_queues()
541 vmdq_i -= adapter->ring_feature[RING_F_VMDQ].offset; in ixgbe_set_sriov_queues()
544 adapter->ring_feature[RING_F_VMDQ].indices = vmdq_i; in ixgbe_set_sriov_queues()
545 adapter->ring_feature[RING_F_VMDQ].mask = vmdq_m; in ixgbe_set_sriov_queues()
548 adapter->ring_feature[RING_F_RSS].indices = rss_i; in ixgbe_set_sriov_queues()
549 adapter->ring_feature[RING_F_RSS].mask = rss_m; in ixgbe_set_sriov_queues()
551 adapter->num_rx_pools = vmdq_i; in ixgbe_set_sriov_queues()
552 adapter->num_rx_queues_per_pool = rss_i; in ixgbe_set_sriov_queues()
554 adapter->num_rx_queues = vmdq_i * rss_i; in ixgbe_set_sriov_queues()
555 adapter->num_tx_queues = vmdq_i * rss_i; in ixgbe_set_sriov_queues()
556 adapter->num_xdp_queues = 0; in ixgbe_set_sriov_queues()
559 adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; in ixgbe_set_sriov_queues()
567 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { in ixgbe_set_sriov_queues()
570 fcoe = &adapter->ring_feature[RING_F_FCOE]; in ixgbe_set_sriov_queues()
584 if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) in ixgbe_set_sriov_queues()
594 /* add queues to adapter */ in ixgbe_set_sriov_queues()
595 adapter->num_tx_queues += fcoe_i; in ixgbe_set_sriov_queues()
596 adapter->num_rx_queues += fcoe_i; in ixgbe_set_sriov_queues()
606 netdev_set_num_tc(adapter->netdev, 1); in ixgbe_set_sriov_queues()
609 netdev_set_tc_queue(adapter->netdev, 0, in ixgbe_set_sriov_queues()
610 adapter->num_rx_queues_per_pool, 0); in ixgbe_set_sriov_queues()
617 * @adapter: board private structure to initialize
623 static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) in ixgbe_set_rss_queues() argument
625 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_set_rss_queues()
630 f = &adapter->ring_feature[RING_F_RSS]; in ixgbe_set_rss_queues()
641 adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; in ixgbe_set_rss_queues()
648 if (rss_i > 1 && adapter->atr_sample_rate) { in ixgbe_set_rss_queues()
649 f = &adapter->ring_feature[RING_F_FDIR]; in ixgbe_set_rss_queues()
653 if (!(adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) in ixgbe_set_rss_queues()
654 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; in ixgbe_set_rss_queues()
666 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { in ixgbe_set_rss_queues()
667 struct net_device *dev = adapter->netdev; in ixgbe_set_rss_queues()
670 f = &adapter->ring_feature[RING_F_FCOE]; in ixgbe_set_rss_queues()
677 if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) in ixgbe_set_rss_queues()
687 adapter->num_rx_queues = rss_i; in ixgbe_set_rss_queues()
688 adapter->num_tx_queues = rss_i; in ixgbe_set_rss_queues()
689 adapter->num_xdp_queues = ixgbe_xdp_queues(adapter); in ixgbe_set_rss_queues()
696 * @adapter: board private structure to initialize
705 static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter) in ixgbe_set_num_queues() argument
708 adapter->num_rx_queues = 1; in ixgbe_set_num_queues()
709 adapter->num_tx_queues = 1; in ixgbe_set_num_queues()
710 adapter->num_xdp_queues = 0; in ixgbe_set_num_queues()
711 adapter->num_rx_pools = 1; in ixgbe_set_num_queues()
712 adapter->num_rx_queues_per_pool = 1; in ixgbe_set_num_queues()
715 if (ixgbe_set_dcb_sriov_queues(adapter)) in ixgbe_set_num_queues()
718 if (ixgbe_set_dcb_queues(adapter)) in ixgbe_set_num_queues()
722 if (ixgbe_set_sriov_queues(adapter)) in ixgbe_set_num_queues()
725 ixgbe_set_rss_queues(adapter); in ixgbe_set_num_queues()
730 * @adapter: board private structure
736 static int ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter) in ixgbe_acquire_msix_vectors() argument
738 struct ixgbe_hw *hw = &adapter->hw; in ixgbe_acquire_msix_vectors()
744 vectors = max(adapter->num_rx_queues, adapter->num_tx_queues); in ixgbe_acquire_msix_vectors()
745 vectors = max(vectors, adapter->num_xdp_queues); in ixgbe_acquire_msix_vectors()
770 adapter->msix_entries = kcalloc(vectors, in ixgbe_acquire_msix_vectors()
773 if (!adapter->msix_entries) in ixgbe_acquire_msix_vectors()
777 adapter->msix_entries[i].entry = i; in ixgbe_acquire_msix_vectors()
779 vectors = pci_enable_msix_range(adapter->pdev, adapter->msix_entries, in ixgbe_acquire_msix_vectors()
789 adapter->flags &= ~IXGBE_FLAG_MSIX_ENABLED; in ixgbe_acquire_msix_vectors()
790 kfree(adapter->msix_entries); in ixgbe_acquire_msix_vectors()
791 adapter->msix_entries = NULL; in ixgbe_acquire_msix_vectors()
799 adapter->flags |= IXGBE_FLAG_MSIX_ENABLED; in ixgbe_acquire_msix_vectors()
805 adapter->num_q_vectors = min_t(int, vectors, adapter->max_q_vectors); in ixgbe_acquire_msix_vectors()
821 * @adapter: board private structure to initialize
822 * @v_count: q_vectors allocated on adapter, used for ring interleaving
823 * @v_idx: index of vector in adapter struct
833 static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, in ixgbe_alloc_q_vector() argument
839 int node = dev_to_node(&adapter->pdev->dev); in ixgbe_alloc_q_vector()
844 u8 tcs = adapter->hw_tcs; in ixgbe_alloc_q_vector()
849 if ((tcs <= 1) && !(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) { in ixgbe_alloc_q_vector()
850 u16 rss_i = adapter->ring_feature[RING_F_RSS].indices; in ixgbe_alloc_q_vector()
851 if (rss_i > 1 && adapter->atr_sample_rate) { in ixgbe_alloc_q_vector()
877 netif_napi_add(adapter->netdev, &q_vector->napi, ixgbe_poll); in ixgbe_alloc_q_vector()
879 /* tie q_vector and adapter together */ in ixgbe_alloc_q_vector()
880 adapter->q_vector[v_idx] = q_vector; in ixgbe_alloc_q_vector()
881 q_vector->adapter = adapter; in ixgbe_alloc_q_vector()
885 q_vector->tx.work_limit = adapter->tx_work_limit; in ixgbe_alloc_q_vector()
896 if (adapter->tx_itr_setting == 1) in ixgbe_alloc_q_vector()
899 q_vector->itr = adapter->tx_itr_setting; in ixgbe_alloc_q_vector()
902 if (adapter->rx_itr_setting == 1) in ixgbe_alloc_q_vector()
905 q_vector->itr = adapter->rx_itr_setting; in ixgbe_alloc_q_vector()
913 ring->dev = &adapter->pdev->dev; in ixgbe_alloc_q_vector()
914 ring->netdev = adapter->netdev; in ixgbe_alloc_q_vector()
923 ring->count = adapter->tx_ring_count; in ixgbe_alloc_q_vector()
926 /* assign ring to adapter */ in ixgbe_alloc_q_vector()
927 WRITE_ONCE(adapter->tx_ring[txr_idx], ring); in ixgbe_alloc_q_vector()
939 ring->dev = &adapter->pdev->dev; in ixgbe_alloc_q_vector()
940 ring->netdev = adapter->netdev; in ixgbe_alloc_q_vector()
949 ring->count = adapter->tx_ring_count; in ixgbe_alloc_q_vector()
954 /* assign ring to adapter */ in ixgbe_alloc_q_vector()
955 WRITE_ONCE(adapter->xdp_ring[xdp_idx], ring); in ixgbe_alloc_q_vector()
967 ring->dev = &adapter->pdev->dev; in ixgbe_alloc_q_vector()
968 ring->netdev = adapter->netdev; in ixgbe_alloc_q_vector()
980 if (adapter->hw.mac.type == ixgbe_mac_82599EB) in ixgbe_alloc_q_vector()
984 if (adapter->netdev->fcoe_mtu) { in ixgbe_alloc_q_vector()
986 f = &adapter->ring_feature[RING_F_FCOE]; in ixgbe_alloc_q_vector()
994 ring->count = adapter->rx_ring_count; in ixgbe_alloc_q_vector()
997 /* assign ring to adapter */ in ixgbe_alloc_q_vector()
998 WRITE_ONCE(adapter->rx_ring[rxr_idx], ring); in ixgbe_alloc_q_vector()
1013 * @adapter: board private structure to initialize
1020 static void ixgbe_free_q_vector(struct ixgbe_adapter *adapter, int v_idx) in ixgbe_free_q_vector() argument
1022 struct ixgbe_q_vector *q_vector = adapter->q_vector[v_idx]; in ixgbe_free_q_vector()
1027 WRITE_ONCE(adapter->xdp_ring[ring->queue_index], NULL); in ixgbe_free_q_vector()
1029 WRITE_ONCE(adapter->tx_ring[ring->queue_index], NULL); in ixgbe_free_q_vector()
1033 WRITE_ONCE(adapter->rx_ring[ring->queue_index], NULL); in ixgbe_free_q_vector()
1035 adapter->q_vector[v_idx] = NULL; in ixgbe_free_q_vector()
1048 * @adapter: board private structure to initialize
1053 static int ixgbe_alloc_q_vectors(struct ixgbe_adapter *adapter) in ixgbe_alloc_q_vectors() argument
1055 int q_vectors = adapter->num_q_vectors; in ixgbe_alloc_q_vectors()
1056 int rxr_remaining = adapter->num_rx_queues; in ixgbe_alloc_q_vectors()
1057 int txr_remaining = adapter->num_tx_queues; in ixgbe_alloc_q_vectors()
1058 int xdp_remaining = adapter->num_xdp_queues; in ixgbe_alloc_q_vectors()
1063 if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) in ixgbe_alloc_q_vectors()
1068 err = ixgbe_alloc_q_vector(adapter, q_vectors, v_idx, in ixgbe_alloc_q_vectors()
1085 err = ixgbe_alloc_q_vector(adapter, q_vectors, v_idx, in ixgbe_alloc_q_vectors()
1102 for (i = 0; i < adapter->num_rx_queues; i++) { in ixgbe_alloc_q_vectors()
1103 if (adapter->rx_ring[i]) in ixgbe_alloc_q_vectors()
1104 adapter->rx_ring[i]->ring_idx = i; in ixgbe_alloc_q_vectors()
1107 for (i = 0; i < adapter->num_tx_queues; i++) { in ixgbe_alloc_q_vectors()
1108 if (adapter->tx_ring[i]) in ixgbe_alloc_q_vectors()
1109 adapter->tx_ring[i]->ring_idx = i; in ixgbe_alloc_q_vectors()
1112 for (i = 0; i < adapter->num_xdp_queues; i++) { in ixgbe_alloc_q_vectors()
1113 if (adapter->xdp_ring[i]) in ixgbe_alloc_q_vectors()
1114 adapter->xdp_ring[i]->ring_idx = i; in ixgbe_alloc_q_vectors()
1120 adapter->num_tx_queues = 0; in ixgbe_alloc_q_vectors()
1121 adapter->num_xdp_queues = 0; in ixgbe_alloc_q_vectors()
1122 adapter->num_rx_queues = 0; in ixgbe_alloc_q_vectors()
1123 adapter->num_q_vectors = 0; in ixgbe_alloc_q_vectors()
1126 ixgbe_free_q_vector(adapter, v_idx); in ixgbe_alloc_q_vectors()
1133 * @adapter: board private structure to initialize
1139 static void ixgbe_free_q_vectors(struct ixgbe_adapter *adapter) in ixgbe_free_q_vectors() argument
1141 int v_idx = adapter->num_q_vectors; in ixgbe_free_q_vectors()
1143 adapter->num_tx_queues = 0; in ixgbe_free_q_vectors()
1144 adapter->num_xdp_queues = 0; in ixgbe_free_q_vectors()
1145 adapter->num_rx_queues = 0; in ixgbe_free_q_vectors()
1146 adapter->num_q_vectors = 0; in ixgbe_free_q_vectors()
1149 ixgbe_free_q_vector(adapter, v_idx); in ixgbe_free_q_vectors()
1152 static void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter) in ixgbe_reset_interrupt_capability() argument
1154 if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { in ixgbe_reset_interrupt_capability()
1155 adapter->flags &= ~IXGBE_FLAG_MSIX_ENABLED; in ixgbe_reset_interrupt_capability()
1156 pci_disable_msix(adapter->pdev); in ixgbe_reset_interrupt_capability()
1157 kfree(adapter->msix_entries); in ixgbe_reset_interrupt_capability()
1158 adapter->msix_entries = NULL; in ixgbe_reset_interrupt_capability()
1159 } else if (adapter->flags & IXGBE_FLAG_MSI_ENABLED) { in ixgbe_reset_interrupt_capability()
1160 adapter->flags &= ~IXGBE_FLAG_MSI_ENABLED; in ixgbe_reset_interrupt_capability()
1161 pci_disable_msi(adapter->pdev); in ixgbe_reset_interrupt_capability()
1167 * @adapter: board private structure to initialize
1172 static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter) in ixgbe_set_interrupt_capability() argument
1177 if (!ixgbe_acquire_msix_vectors(adapter)) in ixgbe_set_interrupt_capability()
1186 if (adapter->hw_tcs > 1) { in ixgbe_set_interrupt_capability()
1188 netdev_reset_tc(adapter->netdev); in ixgbe_set_interrupt_capability()
1190 if (adapter->hw.mac.type == ixgbe_mac_82598EB) in ixgbe_set_interrupt_capability()
1191 adapter->hw.fc.requested_mode = adapter->last_lfc_mode; in ixgbe_set_interrupt_capability()
1193 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; in ixgbe_set_interrupt_capability()
1194 adapter->temp_dcb_cfg.pfc_mode_enable = false; in ixgbe_set_interrupt_capability()
1195 adapter->dcb_cfg.pfc_mode_enable = false; in ixgbe_set_interrupt_capability()
1198 adapter->hw_tcs = 0; in ixgbe_set_interrupt_capability()
1199 adapter->dcb_cfg.num_tcs.pg_tcs = 1; in ixgbe_set_interrupt_capability()
1200 adapter->dcb_cfg.num_tcs.pfc_tcs = 1; in ixgbe_set_interrupt_capability()
1204 ixgbe_disable_sriov(adapter); in ixgbe_set_interrupt_capability()
1208 adapter->ring_feature[RING_F_RSS].limit = 1; in ixgbe_set_interrupt_capability()
1213 ixgbe_set_num_queues(adapter); in ixgbe_set_interrupt_capability()
1214 adapter->num_q_vectors = 1; in ixgbe_set_interrupt_capability()
1216 err = pci_enable_msi(adapter->pdev); in ixgbe_set_interrupt_capability()
1221 adapter->flags |= IXGBE_FLAG_MSI_ENABLED; in ixgbe_set_interrupt_capability()
1226 * @adapter: board private structure to initialize
1234 int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter) in ixgbe_init_interrupt_scheme() argument
1239 ixgbe_set_num_queues(adapter); in ixgbe_init_interrupt_scheme()
1242 ixgbe_set_interrupt_capability(adapter); in ixgbe_init_interrupt_scheme()
1244 err = ixgbe_alloc_q_vectors(adapter); in ixgbe_init_interrupt_scheme()
1250 ixgbe_cache_ring_register(adapter); in ixgbe_init_interrupt_scheme()
1253 (adapter->num_rx_queues > 1) ? "Enabled" : "Disabled", in ixgbe_init_interrupt_scheme()
1254 adapter->num_rx_queues, adapter->num_tx_queues, in ixgbe_init_interrupt_scheme()
1255 adapter->num_xdp_queues); in ixgbe_init_interrupt_scheme()
1257 set_bit(__IXGBE_DOWN, &adapter->state); in ixgbe_init_interrupt_scheme()
1262 ixgbe_reset_interrupt_capability(adapter); in ixgbe_init_interrupt_scheme()
1268 * @adapter: board private structure to clear interrupt scheme on
1273 void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter) in ixgbe_clear_interrupt_scheme() argument
1275 adapter->num_tx_queues = 0; in ixgbe_clear_interrupt_scheme()
1276 adapter->num_xdp_queues = 0; in ixgbe_clear_interrupt_scheme()
1277 adapter->num_rx_queues = 0; in ixgbe_clear_interrupt_scheme()
1279 ixgbe_free_q_vectors(adapter); in ixgbe_clear_interrupt_scheme()
1280 ixgbe_reset_interrupt_capability(adapter); in ixgbe_clear_interrupt_scheme()