MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngbe_configure_msix

Function ngbe_configure_msix

dpdk/drivers/net/ngbe/ngbe_ethdev.c:2793–2844  ·  view source on GitHub ↗

* Sets up the hardware to properly generate MSI-X interrupts * @hw * board private structure */

Source from the content-addressed store, hash-verified

2791 * board private structure
2792 */
2793static void
2794ngbe_configure_msix(struct rte_eth_dev *dev)
2795{
2796 struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
2797 struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
2798 struct ngbe_hw *hw = ngbe_dev_hw(dev);
2799 uint32_t queue_id, base = NGBE_MISC_VEC_ID;
2800 uint32_t vec = NGBE_MISC_VEC_ID;
2801 uint32_t gpie;
2802
2803 /*
2804 * Won't configure MSI-X register if no mapping is done
2805 * between intr vector and event fd
2806 * but if MSI-X has been enabled already, need to configure
2807 * auto clean, auto mask and throttling.
2808 */
2809 gpie = rd32(hw, NGBE_GPIE);
2810 if (!rte_intr_dp_is_en(intr_handle) &&
2811 !(gpie & NGBE_GPIE_MSIX))
2812 return;
2813
2814 if (rte_intr_allow_others(intr_handle)) {
2815 base = NGBE_RX_VEC_START;
2816 vec = base;
2817 }
2818
2819 /* setup GPIE for MSI-X mode */
2820 gpie = rd32(hw, NGBE_GPIE);
2821 gpie |= NGBE_GPIE_MSIX;
2822 wr32(hw, NGBE_GPIE, gpie);
2823
2824 /* Populate the IVAR table and set the ITR values to the
2825 * corresponding register.
2826 */
2827 if (rte_intr_dp_is_en(intr_handle)) {
2828 for (queue_id = 0; queue_id < dev->data->nb_rx_queues;
2829 queue_id++) {
2830 /* by default, 1:1 mapping */
2831 ngbe_set_ivar_map(hw, 0, queue_id, vec);
2832 rte_intr_vec_list_index_set(intr_handle,
2833 queue_id, vec);
2834 if (vec < base + rte_intr_nb_efd_get(intr_handle)
2835 - 1)
2836 vec++;
2837 }
2838
2839 ngbe_set_ivar_map(hw, -1, 1, NGBE_MISC_VEC_ID);
2840 }
2841 wr32(hw, NGBE_ITR(NGBE_MISC_VEC_ID),
2842 NGBE_ITR_IVAL_1G(NGBE_QUEUE_ITR_INTERVAL_DEFAULT)
2843 | NGBE_ITR_WRDSA);
2844}
2845
2846static u8 *
2847ngbe_dev_addr_list_itr(__rte_unused struct ngbe_hw *hw,

Callers 1

ngbe_dev_startFunction · 0.85

Calls 8

ngbe_dev_hwFunction · 0.85
ngbe_set_ivar_mapFunction · 0.85
rte_intr_nb_efd_getFunction · 0.85
rd32Function · 0.50
rte_intr_dp_is_enFunction · 0.50
rte_intr_allow_othersFunction · 0.50
wr32Function · 0.50

Tested by

no test coverage detected