Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351595pxb; Mon, 20 Sep 2021 19:47:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5N36noSXox97NCUNsA7wpq9R1PJci4xs2bCfiz2E+cvuONE1TOHCX2spgI1eQVNDGRjK9 X-Received: by 2002:a92:ce48:: with SMTP id a8mr19861774ilr.115.1632192466693; Mon, 20 Sep 2021 19:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192466; cv=none; d=google.com; s=arc-20160816; b=YHODH9NHLXmhK+sX4s+8eW0A0W4DtOkjpxl8V0eAA9KKENf40J2o0rpJM2/v0g6YpK YkPswPreQgKUAkNQDXP8Jw+m7YvZEhSb5CIKuws4VLRRUGnrwF86wQjj5p+C2ZvgAdnv xcnhAcFb57C3U+AsqdCppdQChnfc7baB4Y0nIUmzkRts0WGV74LkMQd2fac4qKNqgWHc F+FCZM5J/rmLXh5WrbUSoMp2VOG0zpvdNR9330J5MiR0ClXfkVv1v1WEWaM1CLBX5ILO I2IKX6lKZtltpTqBdP1487ei3r54/zEyoskOZEWuCQM7wK/FD6HcpS9SDKmlZhnkKiT3 zOGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kHowJll03WNROStEVFz1JrRm0mHH54fVA3z4xhZGMCU=; b=a1PiDO94YkAIVrRObhQB31hrT0oFWtJqI3jjqqXc14+yyGzglENRiO00XNY18fP2Fk DgSytY3B9o5xwfxN64ZFSnu51t3bUY72P8yvsiQG13Qc9gn0OCyhg3JFWjYnOCcPcLhE p44IkradXrc8s0Rwgs4ObStLXr6jjUyRp8bM9EiiyBM46EC8sm4CeOv4VzXMcfmYSYFN 1rFH+xPlZypv62Uu+TfAIvXc6x7N/GssH7Xqm2xBzLsymEU8XR4/iyUOsqd2BZnKFgBm DAwfTJo0WYz4GlwY25AJPKHqru/9zTkk7SSHvFB6V8ZgkkU5SnQJv9rK9Q6MXjGkfAJA S12g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TMHbVti3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si14252435ile.86.2021.09.20.19.47.34; Mon, 20 Sep 2021 19:47:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TMHbVti3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380337AbhITSda (ORCPT + 99 others); Mon, 20 Sep 2021 14:33:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:45094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378885AbhITS04 (ORCPT ); Mon, 20 Sep 2021 14:26:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6A11C632EE; Mon, 20 Sep 2021 17:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158764; bh=yg4Ps3VUDzAa+n+FwBjZD7iXQmBjHkZuZ9/f/VvJoz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TMHbVti3iM9jTvM4Gr/LDV2Kd5kb33KjGFCgPkXd7iETlmj0H6kmHtT31lgUgr3Ib FLVmVReOWk91C+uDfAefTrS+BdqAipZD3LIawzgxsS49ce3QGAv5LmkltzsaDH5+ry g6jAiq7++cg0Ltq5A0lmmEVcIGbc33ymGgZ4RAGs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aya Levin , Tariq Toukan , "David S. Miller" Subject: [PATCH 5.10 045/122] udp_tunnel: Fix udp_tunnel_nic work-queue type Date: Mon, 20 Sep 2021 18:43:37 +0200 Message-Id: <20210920163917.269126860@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aya Levin commit e50e711351bdc656a8e6ca1022b4293cae8dcd59 upstream. 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 Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/udp_tunnel_nic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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_mo { 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;