patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] kni: fix build with Linux 5.18
@ 2022-05-25 10:12 Jiri Slaby
  2022-05-25 10:26 ` [PATCH v2] " Jiri Slaby
  2022-06-05  7:54 ` [PATCH v3] kni: fix build with Linux 5.18 Andrew Rybchenko
  0 siblings, 2 replies; 11+ messages in thread
From: Jiri Slaby @ 2022-05-25 10:12 UTC (permalink / raw)
  To: dev; +Cc: Jiri Slaby, stable

Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
can be called from any context. So define HAVE_NETIF_RX_NI for older
releases and call the appropriate function in kni_net.

Cc: stable@dpdk.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/linux/kni/compat.h  | 4 ++++
 kernel/linux/kni/kni_net.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 664785674ff1..a81846a8a895 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -141,3 +141,7 @@
 #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
 #define HAVE_TSK_IN_GUP
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
+#define HAVE_NETIF_RX_NI
+#endif
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index 29e5b9e21f9e..a8b092b7567d 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		/* Call netif interface */
+#ifdef HAVE_NETIF_RX_NI
 		netif_rx_ni(skb);
+#else
+		netif_rx(skb);
+#else
 
 		/* Update statistics */
 		dev->stats.rx_bytes += len;
-- 
2.36.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] kni: fix build with Linux 5.18
  2022-05-25 10:12 [PATCH] kni: fix build with Linux 5.18 Jiri Slaby
@ 2022-05-25 10:26 ` Jiri Slaby
  2022-05-31 16:25   ` Ferruh Yigit
  2022-06-01  6:51   ` [PATCH v3] " Jiri Slaby
  2022-06-05  7:54 ` [PATCH v3] kni: fix build with Linux 5.18 Andrew Rybchenko
  1 sibling, 2 replies; 11+ messages in thread
From: Jiri Slaby @ 2022-05-25 10:26 UTC (permalink / raw)
  To: dev; +Cc: Jiri Slaby, stable

Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
can be called from any context. So define HAVE_NETIF_RX_NI for older
releases and call the appropriate function in kni_net.

Cc: stable@dpdk.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
[v2]
- forgot to amend the #else/#endif typo fix

 kernel/linux/kni/compat.h  | 4 ++++
 kernel/linux/kni/kni_net.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 664785674ff1..a81846a8a895 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -141,3 +141,7 @@
 #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
 #define HAVE_TSK_IN_GUP
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
+#define HAVE_NETIF_RX_NI
+#endif
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index 29e5b9e21f9e..41805fcabf7b 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		/* Call netif interface */
+#ifdef HAVE_NETIF_RX_NI
 		netif_rx_ni(skb);
+#else
+		netif_rx(skb);
+#endif
 
 		/* Update statistics */
 		dev->stats.rx_bytes += len;
-- 
2.36.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] kni: fix build with Linux 5.18
  2022-05-25 10:26 ` [PATCH v2] " Jiri Slaby
@ 2022-05-31 16:25   ` Ferruh Yigit
  2022-06-01  6:51   ` [PATCH v3] " Jiri Slaby
  1 sibling, 0 replies; 11+ messages in thread
From: Ferruh Yigit @ 2022-05-31 16:25 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: stable, dev

On 5/25/2022 11:26 AM, Jiri Slaby wrote:
> Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
> netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
> can be called from any context. So define HAVE_NETIF_RX_NI for older
> releases and call the appropriate function in kni_net.
> 

I think there is another commit that makes 'netif_rx()' usable in place 
of 'netif_rx_ni()', can you please document that commit too for reference.

> Cc: stable@dpdk.org
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
> [v2]
> - forgot to amend the #else/#endif typo fix
> 
>   kernel/linux/kni/compat.h  | 4 ++++
>   kernel/linux/kni/kni_net.c | 4 ++++
>   2 files changed, 8 insertions(+)
> 
> diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
> index 664785674ff1..a81846a8a895 100644
> --- a/kernel/linux/kni/compat.h
> +++ b/kernel/linux/kni/compat.h
> @@ -141,3 +141,7 @@
>   #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
>   #define HAVE_TSK_IN_GUP
>   #endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
> +#define HAVE_NETIF_RX_NI
> +#endif

Can you please switch sides in the comparison [1] to be compatible with 
rest of the file and to prevent checkpatch warning [2]?

Rest looks good to me.

[1]
#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE

[2]
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on 
the right side of the test
#97: FILE: kernel/linux/kni/compat.h:145:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)

> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
> index 29e5b9e21f9e..41805fcabf7b 100644
> --- a/kernel/linux/kni/kni_net.c
> +++ b/kernel/linux/kni/kni_net.c
> @@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
>   		skb->ip_summed = CHECKSUM_UNNECESSARY;
>   
>   		/* Call netif interface */
> +#ifdef HAVE_NETIF_RX_NI
>   		netif_rx_ni(skb);
> +#else
> +		netif_rx(skb);
> +#endif
>   
>   		/* Update statistics */
>   		dev->stats.rx_bytes += len;


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3] kni: fix build with Linux 5.18
  2022-05-25 10:26 ` [PATCH v2] " Jiri Slaby
  2022-05-31 16:25   ` Ferruh Yigit
@ 2022-06-01  6:51   ` Jiri Slaby
  2022-06-01  6:53     ` [PATCH v4] " Jiri Slaby
  1 sibling, 1 reply; 11+ messages in thread
From: Jiri Slaby @ 2022-06-01  6:51 UTC (permalink / raw)
  To: dev; +Cc: Jiri Slaby, stable

Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
can be called from any context. So define HAVE_NETIF_RX_NI for older
releases and call the appropriate function in kni_net.

There were other attempts to fix this:
https://patches.dpdk.org/project/dpdk/patch/20220521070642.35413-1-humin29@huawei.com/
https://patches.dpdk.org/project/dpdk/patch/20220511112334.3233433-1-mingli.yu@windriver.com/

But neither of them ensures netif_rx_ni() is used on older kernel. This
might lead to deadlocks or other problems there.

Cc: stable@dpdk.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
[v3]
- reference other patches
- switch the #if test expressions to conform to the checker
[v2]
- forgot to amend the #else/#endif typo fix

 kernel/linux/kni/compat.h  | 4 ++++
 kernel/linux/kni/kni_net.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 664785674ff1..a81846a8a895 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -141,3 +141,7 @@
 #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
 #define HAVE_TSK_IN_GUP
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
+#define HAVE_NETIF_RX_NI
+#endif
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index 29e5b9e21f9e..a8b092b7567d 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		/* Call netif interface */
+#ifdef HAVE_NETIF_RX_NI
 		netif_rx_ni(skb);
+#else
+		netif_rx(skb);
+#else
 
 		/* Update statistics */
 		dev->stats.rx_bytes += len;
-- 
2.36.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v4] kni: fix build with Linux 5.18
  2022-06-01  6:51   ` [PATCH v3] " Jiri Slaby
@ 2022-06-01  6:53     ` Jiri Slaby
  2022-06-05  8:22       ` Andrew Rybchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Jiri Slaby @ 2022-06-01  6:53 UTC (permalink / raw)
  To: dev; +Cc: Jiri Slaby, stable

Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
can be called from any context. So define HAVE_NETIF_RX_NI for older
releases and call the appropriate function in kni_net.

There were other attempts to fix this:
https://patches.dpdk.org/project/dpdk/patch/20220521070642.35413-1-humin29@huawei.com/
https://patches.dpdk.org/project/dpdk/patch/20220511112334.3233433-1-mingli.yu@windriver.com/

But neither of them ensures netif_rx_ni() is used on older kernel. This
might lead to deadlocks or other problems there.

Cc: stable@dpdk.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
[v4]
- really switch the #if test
[v3]
- reference other patches
- switch the #if test expressions to conform to the checker
[v2]
- forgot to amend the #else/#endif typo fix

 kernel/linux/kni/compat.h  | 4 ++++
 kernel/linux/kni/kni_net.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 664785674ff1..0db29a4a6f61 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -141,3 +141,7 @@
 #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
 #define HAVE_TSK_IN_GUP
 #endif
+
+#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
+#define HAVE_NETIF_RX_NI
+#endif
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index 29e5b9e21f9e..a8b092b7567d 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		/* Call netif interface */
+#ifdef HAVE_NETIF_RX_NI
 		netif_rx_ni(skb);
+#else
+		netif_rx(skb);
+#else
 
 		/* Update statistics */
 		dev->stats.rx_bytes += len;
-- 
2.36.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3] kni: fix build with Linux 5.18
  2022-05-25 10:12 [PATCH] kni: fix build with Linux 5.18 Jiri Slaby
  2022-05-25 10:26 ` [PATCH v2] " Jiri Slaby
@ 2022-06-05  7:54 ` Andrew Rybchenko
  2022-06-05  8:20   ` Andrew Rybchenko
  1 sibling, 1 reply; 11+ messages in thread
From: Andrew Rybchenko @ 2022-06-05  7:54 UTC (permalink / raw)
  To: Ferruh Yigit, Stephen Hemminger
  Cc: dev, Min Hu, mingli.yu, Jiri Slaby, stable

From: Jiri Slaby <jslaby@suse.cz>

Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
can be called from any context. So define HAVE_NETIF_RX_NI for older
releases and call the appropriate function in kni_net.

Cc: stable@dpdk.org

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
v3:
 - swap comparison in compat.h to make checkpatches.sh happy

 kernel/linux/kni/compat.h  | 4 ++++
 kernel/linux/kni/kni_net.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 664785674f..0db29a4a6f 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -141,3 +141,7 @@
 #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
 #define HAVE_TSK_IN_GUP
 #endif
+
+#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
+#define HAVE_NETIF_RX_NI
+#endif
diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index 29e5b9e21f..41805fcabf 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
 		skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		/* Call netif interface */
+#ifdef HAVE_NETIF_RX_NI
 		netif_rx_ni(skb);
+#else
+		netif_rx(skb);
+#endif
 
 		/* Update statistics */
 		dev->stats.rx_bytes += len;
-- 
2.30.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3] kni: fix build with Linux 5.18
  2022-06-05  7:54 ` [PATCH v3] kni: fix build with Linux 5.18 Andrew Rybchenko
@ 2022-06-05  8:20   ` Andrew Rybchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Rybchenko @ 2022-06-05  8:20 UTC (permalink / raw)
  To: Ferruh Yigit, Stephen Hemminger
  Cc: dev, Min Hu, mingli.yu, Jiri Slaby, stable

On 6/5/22 10:54, Andrew Rybchenko wrote:
> From: Jiri Slaby <jslaby@suse.cz>
> 
> Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
> netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
> can be called from any context. So define HAVE_NETIF_RX_NI for older
> releases and call the appropriate function in kni_net.
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Self NACK. I've found correct patch in patchwork finally.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v4] kni: fix build with Linux 5.18
  2022-06-01  6:53     ` [PATCH v4] " Jiri Slaby
@ 2022-06-05  8:22       ` Andrew Rybchenko
  2022-06-06  5:59         ` Jiri Slaby
  2022-06-06 10:46         ` [PATCH] kni: fix build Thomas Monjalon
  0 siblings, 2 replies; 11+ messages in thread
From: Andrew Rybchenko @ 2022-06-05  8:22 UTC (permalink / raw)
  To: Jiri Slaby, dev
  Cc: stable, Stephen Hemminger, Ferruh Yigit, mingli.yu, Min Hu (Connor)

On 6/1/22 09:53, Jiri Slaby wrote:
> Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
> netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
> can be called from any context. So define HAVE_NETIF_RX_NI for older
> releases and call the appropriate function in kni_net.
> 
> There were other attempts to fix this:
> https://patches.dpdk.org/project/dpdk/patch/20220521070642.35413-1-humin29@huawei.com/
> https://patches.dpdk.org/project/dpdk/patch/20220511112334.3233433-1-mingli.yu@windriver.com/
> 
> But neither of them ensures netif_rx_ni() is used on older kernel. This
> might lead to deadlocks or other problems there.
> 
> Cc: stable@dpdk.org
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> ---
> [v4]
> - really switch the #if test
> [v3]
> - reference other patches
> - switch the #if test expressions to conform to the checker
> [v2]
> - forgot to amend the #else/#endif typo fix
> 
>   kernel/linux/kni/compat.h  | 4 ++++
>   kernel/linux/kni/kni_net.c | 4 ++++
>   2 files changed, 8 insertions(+)
> 
> diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
> index 664785674ff1..0db29a4a6f61 100644
> --- a/kernel/linux/kni/compat.h
> +++ b/kernel/linux/kni/compat.h
> @@ -141,3 +141,7 @@
>   #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
>   #define HAVE_TSK_IN_GUP
>   #endif
> +
> +#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
> +#define HAVE_NETIF_RX_NI
> +#endif
> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
> index 29e5b9e21f9e..a8b092b7567d 100644
> --- a/kernel/linux/kni/kni_net.c
> +++ b/kernel/linux/kni/kni_net.c
> @@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
>   		skb->ip_summed = CHECKSUM_UNNECESSARY;
>   
>   		/* Call netif interface */
> +#ifdef HAVE_NETIF_RX_NI
>   		netif_rx_ni(skb);
> +#else
> +		netif_rx(skb);
> +#else
>   
>   		/* Update statistics */
>   		dev->stats.rx_bytes += len;

Applied to dpdk-next-net/main with minor fixes in the description, thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v4] kni: fix build with Linux 5.18
  2022-06-05  8:22       ` Andrew Rybchenko
@ 2022-06-06  5:59         ` Jiri Slaby
  2022-06-06 16:20           ` Andrew Rybchenko
  2022-06-06 10:46         ` [PATCH] kni: fix build Thomas Monjalon
  1 sibling, 1 reply; 11+ messages in thread
From: Jiri Slaby @ 2022-06-06  5:59 UTC (permalink / raw)
  To: Andrew Rybchenko, dev
  Cc: stable, Stephen Hemminger, Ferruh Yigit, mingli.yu, Min Hu (Connor)

On 05. 06. 22, 10:22, Andrew Rybchenko wrote:
> On 6/1/22 09:53, Jiri Slaby wrote:
>> Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
>> netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
>> can be called from any context. So define HAVE_NETIF_RX_NI for older
>> releases and call the appropriate function in kni_net.
>>
>> There were other attempts to fix this:
>> https://patches.dpdk.org/project/dpdk/patch/20220521070642.35413-1-humin29@huawei.com/ 
>>
>> https://patches.dpdk.org/project/dpdk/patch/20220511112334.3233433-1-mingli.yu@windriver.com/ 
>>
>>
>> But neither of them ensures netif_rx_ni() is used on older kernel. This
>> might lead to deadlocks or other problems there.
>>
>> Cc: stable@dpdk.org
>> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
>> ---
>> [v4]
>> - really switch the #if test
>> [v3]
>> - reference other patches
>> - switch the #if test expressions to conform to the checker
>> [v2]
>> - forgot to amend the #else/#endif typo fix
>>
>>   kernel/linux/kni/compat.h  | 4 ++++
>>   kernel/linux/kni/kni_net.c | 4 ++++
>>   2 files changed, 8 insertions(+)
>>
>> diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
>> index 664785674ff1..0db29a4a6f61 100644
>> --- a/kernel/linux/kni/compat.h
>> +++ b/kernel/linux/kni/compat.h
>> @@ -141,3 +141,7 @@
>>   #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
>>   #define HAVE_TSK_IN_GUP
>>   #endif
>> +
>> +#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
>> +#define HAVE_NETIF_RX_NI
>> +#endif
>> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
>> index 29e5b9e21f9e..a8b092b7567d 100644
>> --- a/kernel/linux/kni/kni_net.c
>> +++ b/kernel/linux/kni/kni_net.c
>> @@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
>>           skb->ip_summed = CHECKSUM_UNNECESSARY;
>>           /* Call netif interface */
>> +#ifdef HAVE_NETIF_RX_NI
>>           netif_rx_ni(skb);
>> +#else
>> +        netif_rx(skb);
>> +#else
>>           /* Update statistics */
>>           dev->stats.rx_bytes += len;
> 
> Applied to dpdk-next-net/main with minor fixes in the description, thanks.

Sorry, it appears I sent the old version again. The latter #else should 
have been #endif. Do you want me to send a followup patch?

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] kni: fix build
  2022-06-05  8:22       ` Andrew Rybchenko
  2022-06-06  5:59         ` Jiri Slaby
@ 2022-06-06 10:46         ` Thomas Monjalon
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2022-06-06 10:46 UTC (permalink / raw)
  To: dev; +Cc: daxuex.gao, stable, Andrew Rybchenko, Jiri Slaby

A previous fix had #else instead of #endif.
The error message is:
	kernel/linux/kni/kni_net.c: In function ‘kni_net_rx_normal’:
	kernel/linux/kni/kni_net.c:448:2: error: #else after #else

Bugzilla ID: 1025
Fixes: c98600d4bed6 ("kni: fix build with Linux 5.18")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 kernel/linux/kni/kni_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
index a8b092b756..41805fcabf 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -445,7 +445,7 @@ kni_net_rx_normal(struct kni_dev *kni)
 		netif_rx_ni(skb);
 #else
 		netif_rx(skb);
-#else
+#endif
 
 		/* Update statistics */
 		dev->stats.rx_bytes += len;
-- 
2.36.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v4] kni: fix build with Linux 5.18
  2022-06-06  5:59         ` Jiri Slaby
@ 2022-06-06 16:20           ` Andrew Rybchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Andrew Rybchenko @ 2022-06-06 16:20 UTC (permalink / raw)
  To: Jiri Slaby, dev
  Cc: stable, Stephen Hemminger, Ferruh Yigit, mingli.yu,
	Min Hu (Connor),
	David Marchand

On 6/6/22 08:59, Jiri Slaby wrote:
> On 05. 06. 22, 10:22, Andrew Rybchenko wrote:
>> On 6/1/22 09:53, Jiri Slaby wrote:
>>> Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
>>> netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
>>> can be called from any context. So define HAVE_NETIF_RX_NI for older
>>> releases and call the appropriate function in kni_net.
>>>
>>> There were other attempts to fix this:
>>> https://patches.dpdk.org/project/dpdk/patch/20220521070642.35413-1-humin29@huawei.com/ 
>>>
>>> https://patches.dpdk.org/project/dpdk/patch/20220511112334.3233433-1-mingli.yu@windriver.com/ 
>>>
>>>
>>> But neither of them ensures netif_rx_ni() is used on older kernel. This
>>> might lead to deadlocks or other problems there.
>>>
>>> Cc: stable@dpdk.org
>>> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
>>> ---
>>> [v4]
>>> - really switch the #if test
>>> [v3]
>>> - reference other patches
>>> - switch the #if test expressions to conform to the checker
>>> [v2]
>>> - forgot to amend the #else/#endif typo fix
>>>
>>>   kernel/linux/kni/compat.h  | 4 ++++
>>>   kernel/linux/kni/kni_net.c | 4 ++++
>>>   2 files changed, 8 insertions(+)
>>>
>>> diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
>>> index 664785674ff1..0db29a4a6f61 100644
>>> --- a/kernel/linux/kni/compat.h
>>> +++ b/kernel/linux/kni/compat.h
>>> @@ -141,3 +141,7 @@
>>>   #if KERNEL_VERSION(5, 9, 0) > LINUX_VERSION_CODE
>>>   #define HAVE_TSK_IN_GUP
>>>   #endif
>>> +
>>> +#if KERNEL_VERSION(5, 18, 0) > LINUX_VERSION_CODE
>>> +#define HAVE_NETIF_RX_NI
>>> +#endif
>>> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
>>> index 29e5b9e21f9e..a8b092b7567d 100644
>>> --- a/kernel/linux/kni/kni_net.c
>>> +++ b/kernel/linux/kni/kni_net.c
>>> @@ -441,7 +441,11 @@ kni_net_rx_normal(struct kni_dev *kni)
>>>           skb->ip_summed = CHECKSUM_UNNECESSARY;
>>>           /* Call netif interface */
>>> +#ifdef HAVE_NETIF_RX_NI
>>>           netif_rx_ni(skb);
>>> +#else
>>> +        netif_rx(skb);
>>> +#else
>>>           /* Update statistics */
>>>           dev->stats.rx_bytes += len;
>>
>> Applied to dpdk-next-net/main with minor fixes in the description, 
>> thanks.
> 
> Sorry, it appears I sent the old version again. The latter #else should 
> have been #endif. Do you want me to send a followup patch?
> 
> thanks,

Oh, I'm sorry as well that I didn't catch it. Frankly speaking I'm
surprised that all CI does not catch it. test-meson-build.sh does
not catch it as well with default. I've tuned my build checks to care
about it.

Thomas, thanks a lot for the quick fix.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-07  8:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25 10:12 [PATCH] kni: fix build with Linux 5.18 Jiri Slaby
2022-05-25 10:26 ` [PATCH v2] " Jiri Slaby
2022-05-31 16:25   ` Ferruh Yigit
2022-06-01  6:51   ` [PATCH v3] " Jiri Slaby
2022-06-01  6:53     ` [PATCH v4] " Jiri Slaby
2022-06-05  8:22       ` Andrew Rybchenko
2022-06-06  5:59         ` Jiri Slaby
2022-06-06 16:20           ` Andrew Rybchenko
2022-06-06 10:46         ` [PATCH] kni: fix build Thomas Monjalon
2022-06-05  7:54 ` [PATCH v3] kni: fix build with Linux 5.18 Andrew Rybchenko
2022-06-05  8:20   ` Andrew Rybchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).