net/vmxnet3: fix use of interrupts on FreeBSD

Message ID 20240109142343.163814-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/vmxnet3: fix use of interrupts on FreeBSD |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Bruce Richardson Jan. 9, 2024, 2:23 p.m. UTC
  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: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")

Reported-by: Lewis Donzis <lew@perftech.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Lewis Donzis Jan. 9, 2024, 4 p.m. UTC | #1
----- On Jan 9, 2024, at 8:23 AM, Bruce Richardson bruce.richardson@intel.com wrote:

> 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: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")
> 
> Reported-by: Lewis Donzis <lew@perftech.com>
Tested-by: Lewis Donzis <lew@perftech.com>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index e49191718a..7032f0e324 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -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
>  */
> @@ -280,6 +281,7 @@ vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
> 			vmxnet3_enable_intr(hw, i);
> 	}
> }
> +#endif
> 
> /*
>  * Gets tx data ring descriptor size.
> @@ -1129,6 +1131,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);
> @@ -1140,6 +1143,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
> 
> 	/* enable all intrs */
> 	vmxnet3_enable_all_intrs(hw);
> +#endif
> 
> 	vmxnet3_process_events(dev);
> 
> --
> 2.42.0
  
Ferruh Yigit Jan. 11, 2024, 12:03 p.m. UTC | #2
On 1/9/2024 4:00 PM, Lewis Donzis wrote:
> 
> 
> ----- On Jan 9, 2024, at 8:23 AM, Bruce Richardson bruce.richardson@intel.com wrote:
> 
>> 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: 046f11619567 ("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>

Applied to dpdk-next-net/main, thanks.
  
Lewis Donzis Jan. 24, 2024, 12:34 p.m. UTC | #3
Did this get checked in?

Just curious because I don't see it in 22.11.4 that was released yesterday, so wasn't sure when it would show up.

Thanks,
lew

----- On Jan 11, 2024, at 6:03 AM, Ferruh Yigit ferruh.yigit@amd.com wrote:

> On 1/9/2024 4:00 PM, Lewis Donzis wrote:
>> 
>> 
>> ----- On Jan 9, 2024, at 8:23 AM, Bruce Richardson bruce.richardson@intel.com
>> wrote:
>> 
>>> 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: 046f11619567 ("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>
> 
> Applied to dpdk-next-net/main, thanks.
  
Ferruh Yigit Jan. 24, 2024, 1:58 p.m. UTC | #4
On 1/24/2024 12:34 PM, Lewis Donzis wrote:

> ----- On Jan 11, 2024, at 6:03 AM, Ferruh Yigit ferruh.yigit@amd.com wrote:
> 
>> On 1/9/2024 4:00 PM, Lewis Donzis wrote:
>>>
>>>
>>> ----- On Jan 9, 2024, at 8:23 AM, Bruce Richardson bruce.richardson@intel.com
>>> wrote:
>>>
>>>> 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: 046f11619567 ("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>
>>
>> Applied to dpdk-next-net/main, thanks.
>
> Did this get checked in?
>
> Just curious because I don't see it in 22.11.4 that was released
yesterday, so wasn't sure when it would show up.
>
>

Hi Lew,

It has been merged into the 'next-net' subtree and will be subsequently
pulled into the 'main' tree. Eventually, it will be included in the
24.03 release.

LTS releases will backport the fix after the release of v24.03.

If you are interested in 22.11.# LTS, this fix is expected to be
included in v22.11.5 scheduled for release in April."
  
Lewis Donzis Jan. 24, 2024, 2:04 p.m. UTC | #5
----- On Jan 24, 2024, at 7:58 AM, Ferruh Yigit ferruh.yigit@amd.com wrote:

> On 1/24/2024 12:34 PM, Lewis Donzis wrote:
> 
>> ----- On Jan 11, 2024, at 6:03 AM, Ferruh Yigit ferruh.yigit@amd.com wrote:
>> 
>>> On 1/9/2024 4:00 PM, Lewis Donzis wrote:
>>>>
>>>>
>>>> ----- On Jan 9, 2024, at 8:23 AM, Bruce Richardson bruce.richardson@intel.com
>>>> wrote:
>>>>
>>>>> 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: 046f11619567 ("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>
>>>
>>> Applied to dpdk-next-net/main, thanks.
>>
>> Did this get checked in?
>>
>> Just curious because I don't see it in 22.11.4 that was released
> yesterday, so wasn't sure when it would show up.
>>
>>
> 
> Hi Lew,
> 
> It has been merged into the 'next-net' subtree and will be subsequently
> pulled into the 'main' tree. Eventually, it will be included in the
> 24.03 release.
> 
> LTS releases will backport the fix after the release of v24.03.
> 
> If you are interested in 22.11.# LTS, this fix is expected to be
> included in v22.11.5 scheduled for release in April."

Perfect, thanks very much for the explanation.

lew
  

Patch

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index e49191718a..7032f0e324 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -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
  */
@@ -280,6 +281,7 @@  vmxnet3_enable_all_intrs(struct vmxnet3_hw *hw)
 			vmxnet3_enable_intr(hw, i);
 	}
 }
+#endif
 
 /*
  * Gets tx data ring descriptor size.
@@ -1129,6 +1131,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);
@@ -1140,6 +1143,7 @@  vmxnet3_dev_start(struct rte_eth_dev *dev)
 
 	/* enable all intrs */
 	vmxnet3_enable_all_intrs(hw);
+#endif
 
 	vmxnet3_process_events(dev);