Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353563pxb; Mon, 20 Sep 2021 19:52:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3iFSYSQM3xEhth2T/LF85jVSl1ie+NU8JpW5S9/R8NRHElg22WRNlRzatblfX7ta2jJ7R X-Received: by 2002:a17:906:bce5:: with SMTP id op5mr32345439ejb.59.1632192722464; Mon, 20 Sep 2021 19:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192722; cv=none; d=google.com; s=arc-20160816; b=QiApuIO47Uy8q0YU5XXPmTck8h2EdHA0AGMvVJCCVHObsSCrv7Fwf12xUwQgOEnrJq rG68J1ZJTlOvsy3uyNE9eVMoUDA061QDXgH3HC488YLwvn1DBo+QgG9nb4/xHOeNjr55 9Fy9+p8LFXdLmOOXMLIRxQ3iDDGK2wr24kC/Rg3jXFBsQU7+ScW7BP0XTGbHCi0oOB4d voSsXTL256NXuj+xHkiw44ylJc6S8zTdC9BQQJ2LpNuoOfoUPrjzXBym/0HeoSZKnC/j 5LVAxdJDy/5JzPjypqXBAwi235uSmyemPX17zWwfYpHnupWWhd/cOAZK9bODVDiIhJcb wcFw== 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=hr1iouW45NfFKH2UyW58ra1UH6acwGl5rKHHnoN4GZNdQfzZUpDFUIXN5kLSyF998y wP1jesPH7h8uN452TeokqnkuyWdSQqeeZ+TL+gYDVEuArWQdfdM+gf63a8PFsQqFNFaC r13eEMdxOlGTjL1ZcsnZ1Ro3byu8+aGCqAyqZX4o640YRp2xNKeK5vZnOgQsEVJHY+/J Uif76+gIJxOx3CQ/ozys0PkAzEsy2DiFFoGRsUnYeO7Tlx4/xR8KhDaSXEXnJdq2fEnv atd2sPS+mEEU21oOS+Wk3QY8yshOPQX/rojJqpvMrBkHf/Jo1hBwhGQ5y8cE/An1SpBG svbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ETZG8H2y; 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 i21si19367306ejo.253.2021.09.20.19.51.37; Mon, 20 Sep 2021 19:52:02 -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=ETZG8H2y; 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 S1354662AbhITSrm (ORCPT + 99 others); Mon, 20 Sep 2021 14:47:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:58210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383238AbhITSoS (ORCPT ); Mon, 20 Sep 2021 14:44:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5FBCB63347; Mon, 20 Sep 2021 17:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159150; bh=yg4Ps3VUDzAa+n+FwBjZD7iXQmBjHkZuZ9/f/VvJoz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ETZG8H2y7oDUMtyn8rgxvoMcmRUU6HWvk1liDQFM30Q4Rqx9NGsIzLv8V1a6ED6ik ZdnKvdqDFZ2OJnyxIRgW8pfWh3FtIzGda6RU+7cH2MC4kGfBvYBIPvOXkpYgD/Utko xYyoO0oF7kvRbUTkfxppV28reOwx252wGkhgDaWI= 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.14 067/168] udp_tunnel: Fix udp_tunnel_nic work-queue type Date: Mon, 20 Sep 2021 18:43:25 +0200 Message-Id: <20210920163923.848301870@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@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;