Skip to content

Commit

Permalink
net/vmxnet3: fix initialization on FreeBSD
Browse files Browse the repository at this point in the history
[ upstream commit 40d5676ff1ea43cc2c121fd66d19a29a1c9107bb ]

DPDK does not support interrupts on FreeBSD, so the vmxnet3 driver
returns error when enabling interrupts as it initializes. We can fix
this by #ifdef'ing out the interrupt calls when building for FreeBSD,
allowing the driver to initialize correctly.

Fixes: 046f116 ("net/vmxnet3: support MSI-X interrupt")

Reported-by: Lewis Donzis <lew@perftech.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Lewis Donzis <lew@perftech.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
bruce-richardson authored and bluca committed Mar 7, 2024
1 parent 6d4646c commit ef5454b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ Leszek Zygo <leszek.zygo@intel.com>
Levend Sayar <levendsayar@gmail.com>
Lev Faerman <lev.faerman@intel.com>
Lewei Yang <leweix.yang@intel.com>
Lewis Donzis <lew@perftech.com>
Leyi Rong <leyi.rong@intel.com>
Liang Ma <liangma@bytedance.com> <liangma@liangbit.com> <liang.j.ma@intel.com>
Liang-Min Larry Wang <liang-min.wang@intel.com>
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/vmxnet3/vmxnet3_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ vmxnet3_disable_all_intrs(struct vmxnet3_hw *hw)
vmxnet3_disable_intr(hw, i);
}

#ifndef RTE_EXEC_ENV_FREEBSD
/*
* Enable all intrs used by the device
*/
Expand All @@ -280,6 +281,7 @@ vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
vmxnet3_enable_intr(hw, i);
}
}
#endif

/*
* Gets tx data ring descriptor size.
Expand Down Expand Up @@ -1036,6 +1038,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
/* Setting proper Rx Mode and issue Rx Mode Update command */
vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_UCAST | VMXNET3_RXM_BCAST, 1);

#ifndef RTE_EXEC_ENV_FREEBSD
/* Setup interrupt callback */
rte_intr_callback_register(dev->intr_handle,
vmxnet3_interrupt_handler, dev);
Expand All @@ -1047,6 +1050,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)

/* enable all intrs */
vmxnet3_enable_all_intrs(hw);
#endif

vmxnet3_process_events(dev);

Expand Down

0 comments on commit ef5454b

Please sign in to comment.