* [PATCH net] udp_tunnel: Fix udp_tunnel_nic work-queue type
@ 2021-09-13 7:53 Aya Levin
2021-09-13 11:40 ` patchwork-bot+netdevbpf
2021-09-13 16:29 ` Jakub Kicinski
0 siblings, 2 replies; 3+ messages in thread
From: Aya Levin @ 2021-09-13 7:53 UTC (permalink / raw)
To: Jakub Kicinski, David S . Miller, netdev
Cc: Hideaki YOSHIFUJI, David Ahern, Moshe Shemesh, Tariq Toukan, Aya Levin
Turn udp_tunnel_nic work-queue to an ordered work-queue. This queue
holds the UDP-tunnel configuration commands of the different netdevs.
When the netdevs are functions of the same NIC the order of
execution may be crucial.
Problem example:
NIC with 2 PFs, both PFs declare offload quota of up to 3 UDP-ports.
$ifconfig eth2 1.1.1.1/16 up
$ip link add eth2_19503 type vxlan id 5049 remote 1.1.1.2 dev eth2 dstport 19053
$ip link set dev eth2_19503 up
$ip link add eth2_19504 type vxlan id 5049 remote 1.1.1.3 dev eth2 dstport 19054
$ip link set dev eth2_19504 up
$ip link add eth2_19505 type vxlan id 5049 remote 1.1.1.4 dev eth2 dstport 19055
$ip link set dev eth2_19505 up
$ip link add eth2_19506 type vxlan id 5049 remote 1.1.1.5 dev eth2 dstport 19056
$ip link set dev eth2_19506 up
NIC RX port offload infrastructure offloads the first 3 UDP-ports (on
all devices which sets NETIF_F_RX_UDP_TUNNEL_PORT feature) and not
UDP-port 19056. So both PFs gets this offload configuration.
$ip link set dev eth2_19504 down
This triggers udp-tunnel-core to remove the UDP-port 19504 from
offload-ports-list and offload UDP-port 19056 instead.
In this scenario it is important that the UDP-port of 19504 will be
removed from both PFs before trying to add UDP-port 19056. The NIC can
stop offloading a UDP-port only when all references are removed.
Otherwise the NIC may report exceeding of the offload quota.
Fixes: cc4e3835eff4 ("udp_tunnel: add central NIC RX port offload infrastructure")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
---
net/ipv4/udp_tunnel_nic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Hi,
Please queue for -stable >= v5.9.
Thanks.
diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c
index 0d122edc368d..b91003538d87 100644
--- a/net/ipv4/udp_tunnel_nic.c
+++ b/net/ipv4/udp_tunnel_nic.c
@@ -935,7 +935,7 @@ static int __init udp_tunnel_nic_init_module(void)
{
int err;
- udp_tunnel_nic_workqueue = alloc_workqueue("udp_tunnel_nic", 0, 0);
+ udp_tunnel_nic_workqueue = alloc_ordered_workqueue("udp_tunnel_nic", 0);
if (!udp_tunnel_nic_workqueue)
return -ENOMEM;
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] udp_tunnel: Fix udp_tunnel_nic work-queue type
2021-09-13 7:53 [PATCH net] udp_tunnel: Fix udp_tunnel_nic work-queue type Aya Levin
@ 2021-09-13 11:40 ` patchwork-bot+netdevbpf
2021-09-13 16:29 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-13 11:40 UTC (permalink / raw)
To: Aya Levin; +Cc: kuba, davem, netdev, yoshfuji, dsahern, moshe, tariqt
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Mon, 13 Sep 2021 10:53:49 +0300 you wrote:
> Turn udp_tunnel_nic work-queue to an ordered work-queue. This queue
> holds the UDP-tunnel configuration commands of the different netdevs.
> When the netdevs are functions of the same NIC the order of
> execution may be crucial.
>
> Problem example:
> NIC with 2 PFs, both PFs declare offload quota of up to 3 UDP-ports.
> $ifconfig eth2 1.1.1.1/16 up
>
> [...]
Here is the summary with links:
- [net] udp_tunnel: Fix udp_tunnel_nic work-queue type
https://git.kernel.org/netdev/net/c/e50e711351bd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] udp_tunnel: Fix udp_tunnel_nic work-queue type
2021-09-13 7:53 [PATCH net] udp_tunnel: Fix udp_tunnel_nic work-queue type Aya Levin
2021-09-13 11:40 ` patchwork-bot+netdevbpf
@ 2021-09-13 16:29 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2021-09-13 16:29 UTC (permalink / raw)
To: Aya Levin
Cc: David S . Miller, netdev, Hideaki YOSHIFUJI, David Ahern,
Moshe Shemesh, Tariq Toukan
On Mon, 13 Sep 2021 10:53:49 +0300 Aya Levin wrote:
> Turn udp_tunnel_nic work-queue to an ordered work-queue. This queue
> holds the UDP-tunnel configuration commands of the different netdevs.
> When the netdevs are functions of the same NIC the order of
> execution may be crucial.
>
> Problem example:
> NIC with 2 PFs, both PFs declare offload quota of up to 3 UDP-ports.
> $ifconfig eth2 1.1.1.1/16 up
>
> $ip link add eth2_19503 type vxlan id 5049 remote 1.1.1.2 dev eth2 dstport 19053
> $ip link set dev eth2_19503 up
>
> $ip link add eth2_19504 type vxlan id 5049 remote 1.1.1.3 dev eth2 dstport 19054
> $ip link set dev eth2_19504 up
>
> $ip link add eth2_19505 type vxlan id 5049 remote 1.1.1.4 dev eth2 dstport 19055
> $ip link set dev eth2_19505 up
>
> $ip link add eth2_19506 type vxlan id 5049 remote 1.1.1.5 dev eth2 dstport 19056
> $ip link set dev eth2_19506 up
>
> NIC RX port offload infrastructure offloads the first 3 UDP-ports (on
> all devices which sets NETIF_F_RX_UDP_TUNNEL_PORT feature) and not
> UDP-port 19056. So both PFs gets this offload configuration.
>
> $ip link set dev eth2_19504 down
>
> This triggers udp-tunnel-core to remove the UDP-port 19504 from
> offload-ports-list and offload UDP-port 19056 instead.
>
> In this scenario it is important that the UDP-port of 19504 will be
> removed from both PFs before trying to add UDP-port 19056. The NIC can
> stop offloading a UDP-port only when all references are removed.
> Otherwise the NIC may report exceeding of the offload quota.
>
> Fixes: cc4e3835eff4 ("udp_tunnel: add central NIC RX port offload infrastructure")
> Signed-off-by: Aya Levin <ayal@nvidia.com>
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Obviously not. If you hardware uses a single port table regardless of
the number of PFs you should use the shared table version of the API,
like Intel does.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-13 16:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 7:53 [PATCH net] udp_tunnel: Fix udp_tunnel_nic work-queue type Aya Levin
2021-09-13 11:40 ` patchwork-bot+netdevbpf
2021-09-13 16:29 ` Jakub Kicinski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.