From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id B6388237 for ; Tue, 21 Nov 2017 14:30:11 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6B5E720B00; Tue, 21 Nov 2017 08:30:11 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:30:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=F36P/QinOvrskqTTm KlK8TK5EA7iraQguYsf3hCG7uM=; b=TeRGl4t78XP4eUuxhwMZCwVo9lre2tAgi umNfojLkDMqeB2ozkj2anyM2rtAHy5SjRmRS9O5cnm+aAuUG5wARP7JYcSNMnThV WKaSVvG0e1KdV/5d/mrnp0WoCNfnt5pcPB/gTOa1k7+H3nQggFKG7C2abr8XEOhV L5jXbT87dtxx/2wFl2C9983Oa8TbHX2Nrnz03dpUAa1cMtuQy+NJwo3H4l4o9Jv9 x6zmPlMSbipIphgzdklRQcIztyWqt6HU/0dpLpLgZ+Ld1r/B11beVHAYcg35wvjE GYymGGa9NgiKoE8ke1NYKvdPDUp23nq8RBTZqTyruhjMwFu7yVNEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=F36P/QinOvrskqTTmKlK8TK5EA7iraQguYsf3hCG7uM=; b=dUUNHoZw EUwcyM+3LFl/JsjAjOnD96oFaz0R98eO30rtGx/nRNq8Ji6ug3zVGJuyAuwTe5St DUmWsGqaajfqbvbl4fICuyaZnaOmfrwIFT4yMJnF9dPm1z0aI/8lHqJHfHyNgLxs nVdAJ8iArIrq5hwMll3Il9nUQ8vYmePPitxcqJaiVE0cAGaLBUfJhUDfoOj7j2LY QFJkS1farCRj4H36hclQs6YsQUGg/BsLNhiEix/lro/11MYeoerGyLgXHR4hUCqp WX8I7OC8Vs7ZEJFhENlqR5mO7v/jWPkHXFUl4F1ADyKthjiV2eABgAVSd22YsJUu F+K+8UzzDfnTlw== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 0942C243B9; Tue, 21 Nov 2017 08:30:07 -0500 (EST) From: Yuanhan Liu To: Matan Azrad Cc: Gaetan Rivet , dpdk stable Date: Tue, 21 Nov 2017 21:18:31 +0800 Message-Id: <1511270333-31002-169-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/failsafe: fix Rx clean race' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:30:11 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From c4803dd1ad0aa2e1bea862f2f16659c03035cb75 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Sun, 22 Oct 2017 05:51:08 +0000 Subject: [PATCH] net/failsafe: fix Rx clean race [ upstream commit 295f7ed2dd452aba090080f380c2981b366aa2da ] When removing a device, the fail-safe checks that it is not within its datapath before cleaning it. When checking whether an Rx burst should be performed on a device, the remove flag is not checked. Thus the port could still enter its datapath and miss a removal round. Furthermore, there is a race between the thread removing the device and the polling thread. Check the remove flag before entering a sub-device Rx burst when in safe mode. This check mitigates the aforementioned race condition. Fixes: 72a57bfd9a0e ("net/failsafe: add fast burst functions") Signed-off-by: Matan Azrad Acked-by: Gaetan Rivet --- drivers/net/failsafe/failsafe_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_rxtx.c b/drivers/net/failsafe/failsafe_rxtx.c index 7311421..70157c8 100644 --- a/drivers/net/failsafe/failsafe_rxtx.c +++ b/drivers/net/failsafe/failsafe_rxtx.c @@ -43,7 +43,8 @@ fs_rx_unsafe(struct sub_device *sdev) { return (ETH(sdev) == NULL) || (ETH(sdev)->rx_pkt_burst == NULL) || - (sdev->state != DEV_STARTED); + (sdev->state != DEV_STARTED) || + (sdev->remove != 0); } static inline int -- 2.7.4