From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 40569A0032; Tue, 13 Sep 2022 14:53:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 355B24021D; Tue, 13 Sep 2022 14:53:37 +0200 (CEST) Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by mails.dpdk.org (Postfix) with ESMTP id A1F6B400D6; Tue, 13 Sep 2022 14:53:35 +0200 (CEST) Received: by mail-qv1-f44.google.com with SMTP id m9so9076431qvv.7; Tue, 13 Sep 2022 05:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=dF9IGFA6eyhKFfayWKImTvmTS4Sat7JzSlj+u05SVmw=; b=FEe5uQZ4XMPIGY7xs3s9csudT1BGzPVpntI0bJph2Qx4g8AXAwjRPECWXEmyzXvQ74 AzFB42haHsCCiWBFGu6GATusFUtg72+tdLuPJZh3Zc6Z2LGmId13cDuJ/SkiqJHN17r/ zJR8U72mLSXa9yq7rjbApyiwEq+2Sa3Ix+ufC7SmhY8rt2N+ZTvuEriGBq1FTBienDZJ Ltw21+sbJ8xQpxhpdXOwdu8X8cppyHIHyZGBjsozD85lHw2iPrvfrJm3an2iczY8n0T5 ER17E4FhvnPamPzSc9u1M2uhUO1YyUdSH1St7YIi7nGhWHwpRIcAv7MEaWTp9hQcwSBT ofnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=dF9IGFA6eyhKFfayWKImTvmTS4Sat7JzSlj+u05SVmw=; b=ir0Nw1tDYP9079YTBbdixQKVwfJLiGMbiHlhba6arG6qrGb+GSiuvt2EcGFt2IlB5u fFqAe5E1gNv9Knf3fkWaMrlnPVGYXKDvaHFbbYzjof3VuC8CnCrBzrfEd0EugPAUNKtL JR630n4/xZ4Oa68GorUqWfevQHSCkFyJ5g8dOkxGat7+vq4Fnp34P0cWabE1vxdCNLlu 4CTey931hNyzFevctmdRa1VcP07hqv7x30bu0CnMXiAxkEkNJcbqu+3kebCYeNbgm0h0 4WEl9zuEKaUtzs+UV9bcc7Jic1tPMcDCYXEOoTp2rdFHIWNX6QtDEIViI6RexrhnHieJ 9oqA== X-Gm-Message-State: ACgBeo2phCt+HQ7JJaEdgSlRVpBwkqlrZlTovtOypH3YTukY7hUZAX85 ONkVSlYRBVrktBjfHKEg1no/rfrrgI7dyid3efot77IlwJfVYw== X-Google-Smtp-Source: AA6agR6XmPJgd15DT9uwoFQvF3r7BCm9OOmeXGFwEmj1gE3g7tvd/AnQJG3e9uQp0PC5xRHBRPg+eZWXfnYYVAIU1+E= X-Received: by 2002:a05:6214:c89:b0:4ac:bb5b:fe94 with SMTP id r9-20020a0562140c8900b004acbb5bfe94mr5969280qvr.11.1663073615027; Tue, 13 Sep 2022 05:53:35 -0700 (PDT) MIME-Version: 1.0 References: <20220707114325.3098735-1-hofors@lysator.liu.se> In-Reply-To: <20220707114325.3098735-1-hofors@lysator.liu.se> From: Jerin Jacob Date: Tue, 13 Sep 2022 18:23:09 +0530 Message-ID: Subject: Re: [PATCH] event/dsw: fix migration bug To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: Jerin Jacob , dev@dpdk.org, =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , stable@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Jul 7, 2022 at 5:13 PM Mattias R=C3=B6nnblom wrote: > > From: Mattias R=C3=B6nnblom > > Fix bug in flow migration, which under certain conditions causes > reordering and violation of atomicity guarantees. > > The issue occurs when the processing of a flow (on an atomic queue) > has resulted in events enqueued to a flow currently being migrated, > and the former (producer) flow is also selected for migration. The > events are buffered ("paused") on the originating port, and released > (forwarded) when the migration has completed. However, at the time of > "unpausing" the latter (consumer) flow, processing of the producer > flow on the port to which it was migrated may have already produced > events, for the same paused flow. This constitutes a race condition, > and depending on which port wins, reordering may have been introduced. > > This patch forbids migration when a port has paused events, since > those events may have been the result of processing a to-be-migrated > flow. > > This patch also disallows processing events pertaining to a flow under > migration, for the same reason. A new buffer is introduced, which > holds such not-yet-processed events dequeued from the port's input > ring. Such events are forwarded to the target port as a part of the > migration process. > > The 'forwarding' migration state is eliminated, and instead background > processing is only performed if there are no unreleased events on the > port. > > The bug is primarily triggered in situations where multiple flows are > migrated as one transaction, but may occur even if only a single flow > is migrated (e.g., with older DSW versions, which does not support > multi-flow migration). > > Fixes: f6257b22e767 ("event/dsw: add load balancing") > Cc: stable@dpdk.org > > Signed-off-by: Mattias R=C3=B6nnblom Applied to dpdk-next-net-eventdev/for-main. Thanks