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 CBF18426AD for ; Tue, 3 Oct 2023 08:38:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6FD1402D7; Tue, 3 Oct 2023 08:38:50 +0200 (CEST) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by mails.dpdk.org (Postfix) with ESMTP id 2790640262; Tue, 3 Oct 2023 08:38:49 +0200 (CEST) Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-417f872fb94so4765821cf.0; Mon, 02 Oct 2023 23:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696315128; x=1696919928; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IVyD5F0s7n0+fv8WXgyKd3o9K0ROt92u89j8rLMU4xY=; b=WlhpE23ian3aZ7rDwYu+c4ZLnzHP9mBx4/SGb6KsIOYrfD0JlpBxJ+/xxPR6ely6uB iVLuxB3LePUgenXhPSa+ioZq9dTrcyxNykCe8is+H18e7MidA6WjLuBvAmeS3S5JOm4K tQgyRSFYzzXHZcGsLgW9SFM2jEP7zZ8IxGirx2lDbD/T8CR5p8kq7stStDXz9vACqViZ MFBADhi50hDVeu2oEx92rJvjp/QoYwS5qBbCDdjKjywPSBmzbLOjVEAwbNalNvaLaff2 hy/zmW0rFa5hcIH5m/T+Tiwuahr3t7STcJihsQ7oRFZ5YllXgMStOhd64PW0MznjtAYB +flw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696315128; x=1696919928; 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:message-id:reply-to; bh=IVyD5F0s7n0+fv8WXgyKd3o9K0ROt92u89j8rLMU4xY=; b=Udcf92xLbJ6u4nUnIxlKqWeg3TbqEgXFlRvDcA+BPBditunRrqJMk2N92dZb65Vk7k 93GB0W0RXH/BI9bHrkWpF8TxV26J/AGxsaEmTqi/o1YczEi/wDOxqW5zDoMizPB8nmRl Y/SP1csBks+TL3ZeIf0+Zdoypg45NYRc/9WjGzW8SG3V8UfKEJW/oj/A0/vziwXkXwcQ nASpSnen0CVst2yNidNl1qyAuRLhckiXTiDcWEqE8Uid5lhmvA2KcbE07MNHxePK3EZN eRJdcD+0xpOqEmwG1Vyx3ksMu6wcVya5yCbbKQoHTJAypVrAiYed6ou/XLDFJLEyyx5z ga4g== X-Gm-Message-State: AOJu0YwWweAV8mePPt7l4jUTJOrnATsa7IyzgWUQ3TZptP5/xSydmvkJ 32/pY5ZCS3DM8yx/mWSo70G6y2LSKBuXrt5LWCk= X-Google-Smtp-Source: AGHT+IHFIvmEA7lV90EnHtjut++o/w1cgc28eHOcCwezbfeCEwseFPl3963ldsLsw2vUBSo8VPRoYZw8vOzfkDaV9os= X-Received: by 2002:a05:622a:14:b0:417:d68d:2b24 with SMTP id x20-20020a05622a001400b00417d68d2b24mr16599242qtw.33.1696315128361; Mon, 02 Oct 2023 23:38:48 -0700 (PDT) MIME-Version: 1.0 References: <20230914105852.82471-2-harry.van.haaren@intel.com> <20231002105836.3055379-1-harry.van.haaren@intel.com> In-Reply-To: <20231002105836.3055379-1-harry.van.haaren@intel.com> From: Jerin Jacob Date: Tue, 3 Oct 2023 12:08:22 +0530 Message-ID: Subject: Re: [PATCH v3 1/2] event/sw: fix ordering corruption with op release To: Harry van Haaren Cc: dev@dpdk.org, jerinj@marvell.com, stable@dpdk.org, Bruce Richardson Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Mon, Oct 2, 2023 at 11:36=E2=80=AFPM Harry van Haaren wrote: > > This commit changes the logic in the scheduler to always > reset reorder-buffer (and QID/FID) entries when writing > them. This avoids stale ROB/QID/FID data re-use, which > previously caused ordering issues. > > Before this commit, release events left the history-list > in an inconsistent state, and future events with op type of > forward could be incorrectly reordered. > > There was a partial fix previously committed which is now > being resolved for all cases in a more general way, hence > the two fixlines here. > > Fixes: 2e516d18dc01 ("event/sw: fix events mis-identified as needing reor= der") > Fixes: 617995dfc5b2 ("event/sw: add scheduling logic") > Cc: stable@dpdk.org > > Suggested-by: Bruce Richardson > Signed-off-by: Harry van Haaren > Acked-by: Bruce Richardson Series applied to dpdk-next-net-eventdev/for-main. Thanks > > --- > > v3: > - Fixup whitespace and line wrapping suggestions (Bruce) > - Add Fixes lines (Bruce) > - Cc stable, as this is a functionality bugfix > - Including Ack from v2, as no significant code changes > > v2: > - Rework fix to simpler suggestion (Bruce) > - Respin patchset to "apply order" (Bruce) > --- > drivers/event/sw/sw_evdev_scheduler.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_= evdev_scheduler.c > index de6ed21643..cc652815e4 100644 > --- a/drivers/event/sw/sw_evdev_scheduler.c > +++ b/drivers/event/sw/sw_evdev_scheduler.c > @@ -90,8 +90,10 @@ sw_schedule_atomic_to_cq(struct sw_evdev *sw, struct s= w_qid * const qid, > sw->cq_ring_space[cq]--; > > int head =3D (p->hist_head++ & (SW_PORT_HIST_LIST-1)); > - p->hist_list[head].fid =3D flow_id; > - p->hist_list[head].qid =3D qid_id; > + p->hist_list[head] =3D (struct sw_hist_list_entry) { > + .qid =3D qid_id, > + .fid =3D flow_id, > + }; > > p->stats.tx_pkts++; > qid->stats.tx_pkts++; > @@ -162,8 +164,10 @@ sw_schedule_parallel_to_cq(struct sw_evdev *sw, stru= ct sw_qid * const qid, > qid->stats.tx_pkts++; > > const int head =3D (p->hist_head & (SW_PORT_HIST_LIST-1))= ; > - p->hist_list[head].fid =3D SW_HASH_FLOWID(qe->flow_id); > - p->hist_list[head].qid =3D qid_id; > + p->hist_list[head] =3D (struct sw_hist_list_entry) { > + .qid =3D qid_id, > + .fid =3D SW_HASH_FLOWID(qe->flow_id), > + }; > > if (keep_order) > rob_ring_dequeue(qid->reorder_buffer_freelist, > @@ -419,7 +423,6 @@ __pull_port_lb(struct sw_evdev *sw, uint32_t port_id,= int allow_reorder) > struct reorder_buffer_entry *rob_entry = =3D > hist_entry->rob_entry; > > - hist_entry->rob_entry =3D NULL; > /* Although fragmentation not currently > * supported by eventdev API, we support = it > * here. Open: How do we alert the user t= hat > -- > 2.34.1 >