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 05824A0032; Mon, 11 Jul 2022 14:45:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D592C40C35; Mon, 11 Jul 2022 14:45:51 +0200 (CEST) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by mails.dpdk.org (Postfix) with ESMTP id DBE8E40695; Mon, 11 Jul 2022 14:45:49 +0200 (CEST) Received: by mail-qv1-f45.google.com with SMTP id d17so257425qvs.0; Mon, 11 Jul 2022 05:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=DNZWu6ps1IpjDMClUU6WWyFRO4Us/C34AAz7XsdWx+U=; b=eAVkoG2lzLuhEGTpojxuNKmdhaCqGDfmQYHjV4rFKrplbjzFzQ3G3qKLHfk56oZwhX 3sJrxQht7LcfLYvpHd1PqdpgOymXsE+TZXlvfnG/xI5rluyRdKG0DtCAOCVGLVPxqFfO IvJIlSiquWlRmh0A+b41IK9No/j/0Cf+px+xNdL0W+XSdCPGeBtfKDGjL3l2qW6IC0wM R00Vwr6mzQ18+bKbe7p6Mkhh4XdV0lTtmc0b0WGcEQdZH7WEhtHRiWt0nEuv+kgcsgnB 1sJccF99fKJR0Ut8KOwuGPJV13rfZRBKd9J63gjjh5SyKhTONiV88ZgBEOe+eYI2OdZy ZoTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=DNZWu6ps1IpjDMClUU6WWyFRO4Us/C34AAz7XsdWx+U=; b=J1+wJQa3vTyWk2l2nIcjPSR3KFrcfhH6T6/IuwJ6cVjQH32NspFfykJFbELqYjf0zC 8AKQDwpxx/hNrZQJy8YQS9AIy7bM1nxwvrRPC0uGL+MIA8tuKaV2o+GUNOv/t+P23r1X La6RONrJ/kb6mdIOenuinP66NgAaTVYgEoM1D/C4Zzk22rlQXNAYsHtFYImp6VAB0vVH NrnZcKXl2jOvxXL/33J1oUoJqASjeAA+R3QrD0NCxyWjLyJGfCq3GmqIqVAJjq2w8u46 PlCKCAHsfgVxOsd2UjJjDLUVte95YdGmwAS6GvHi+BVFLvzLabbPepG/NBd2F02wqTEG ZMSA== X-Gm-Message-State: AJIora/ly0K7uOJjVDzwYz8sEPpMnNvrXoD3ssI/BoJdKgy9PB6K1qG+ HY4NBwDwKaWQJO4YpTiGjhXBeqN6was5nvPYOJg= X-Google-Smtp-Source: AGRyM1uRuHuhBr6I9AP2pqVsDiFuXDjAzTRaaOokkXbDnvQVa9VKx3ga8WV0NghQ/pEhWUJTtxN41IvunlnUnL55Juw= X-Received: by 2002:ad4:5bea:0:b0:473:301:3859 with SMTP id k10-20020ad45bea000000b0047303013859mr12937929qvc.16.1657543549200; Mon, 11 Jul 2022 05:45:49 -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: Mon, 11 Jul 2022 18:15:23 +0530 Message-ID: Subject: Re: [PATCH] event/dsw: fix migration bug To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Thomas Monjalon Cc: Jerin Jacob , dpdk-dev , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , dpdk stable 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 + @Thomas Monjalon to merge to the main tree directly.