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 DBC11454EB for ; Tue, 25 Jun 2024 07:11:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE912402A3; Tue, 25 Jun 2024 07:11:04 +0200 (CEST) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by mails.dpdk.org (Postfix) with ESMTP id 5F43E4026F; Tue, 25 Jun 2024 07:11:04 +0200 (CEST) Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6b505f11973so43656296d6.1; Mon, 24 Jun 2024 22:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719292264; x=1719897064; 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=4UzymafyTMukbPAFOWBzsaVXXBOp2I9VfhsddxtXy/c=; b=jYUst2/2/+6oPpC/dmb5a9uKRzAX+THttz3uOrKNdADNTxJ0LloS74J3MNQqooCX6j 8o/Kh7q6t7o7ZEz29H8uZBDf6ljHv15TFftJjN1cFTQhSh9t+FJdHrUq6JPhF+0hyOKX kWPIOf7mvH9AVTdgvWjD50h6W+RzeSTrXlLxDvhLJMp8uUA6xsYOPiVPqjnD5ZbHHojK 3nET5Jl8Y4XTuEzrEl+uG7hW3sFDBkz7IIpKqh5zCyh1U4o5x8ZsDFXBOpR+YsZOIevZ IziehKvIbJY49YyZg/Jkwz7FPlauhQnwtW/9VRiRq0lHi2b3XiK0i46GvkxkYAdY+fqR OeaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719292264; x=1719897064; 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=4UzymafyTMukbPAFOWBzsaVXXBOp2I9VfhsddxtXy/c=; b=tbe/qjj4BHmAuYkUWlgSgbcrwzyykUmSSjvtrirAqDu6G9UqTujCxFxT718sK5Geth MuQlPmnn74XKdGFITVAB5bFDJq354dpyFt8MFL2lChy68iz4oHMObpK87Z/+hY9Rm0vN jBQtqYd4rJzZjTLJQkxZXSSTZ5D+K9NtvP6ErU25zNjRhaCUlAXrjVvmHHS9uGIzkQqq DdCPAVkL8TYHfH2EbaFW8P7bgGf5/vc0IavpEaKHI4N/C5fPiIse6EIjzUh0It+s+ceE ogFDzH7uDR0e8McPhW3Gvh8eUwaRF0r2BA8yNoGngXd7wKU4mdtFHLXq195zvkiHSAf1 C/cQ== X-Forwarded-Encrypted: i=1; AJvYcCWTSMUlbpW/SwYdATuMzD55C14Fvlbpbc7HpwZMLscm820j35n5rmnd7KYbIz09aa2Ev+7bM5Mk66biyEXcGOl2H36bSNB3AV9he0N6Ag== X-Gm-Message-State: AOJu0YxVv3PEbNCosLzmB3AWFVieldaXm2AJAcbrqdithbtkVxtRIksn 9MiBktTklYf2L/WktAOwC4bl1TvrouVjkJ3hc5BwxD/hY3Hb5pgOt721K50UaFAgNQHn3vwGVn7 N9dHf/6lyodIUKIIgYg6HCa728zZk3Kb0mZI= X-Google-Smtp-Source: AGHT+IHiKAOx73TphfdzzPr8ED8k/gbOTD0JX4PlJW1/CpjRPsSWdint4owQL0zYjFQDsvdFA4jlQ0OR5XYZl5Ccu70= X-Received: by 2002:a05:6214:29c3:b0:6b5:2be1:cd6e with SMTP id 6a1803df08f44-6b531fceb23mr123045516d6.4.1719292263699; Mon, 24 Jun 2024 22:11:03 -0700 (PDT) MIME-Version: 1.0 References: <20240617112754.4080314-1-psatheesh@marvell.com> In-Reply-To: <20240617112754.4080314-1-psatheesh@marvell.com> From: Jerin Jacob Date: Tue, 25 Jun 2024 10:40:37 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH] common/cnxk: fix flow aging application exit To: psatheesh@marvell.com Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra , dev@dpdk.org, stable@dpdk.org, Jerin Jacob 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, Jun 17, 2024 at 4:58=E2=80=AFPM wrote: > > From: Kiran Kumar K > > If flow aging is enabled application termination may take time > equivalent to aging timeout. This is because on termination flow > thread uses a sleep call which is uninterruptible. > > Fixes: 357f5ebc8a24 ("common/cnxk: support flow aging") > Cc: stable@dpdk.org > > Signed-off-by: Kiran Kumar K > Signed-off-by: Harman Kalra > Reviewed-by: Jerin Jacob Updated the git commit as follows and applied to dpdk-next-net-mrvl/for-main. Thanks common/cnxk: fix flow aging handling on application exit If flow aging is enabled application termination may take time equivalent to aging timeout. This is because on termination flow thread uses a sleep call which is uninterruptible. Fixes: 357f5ebc8a24 ("common/cnxk: support flow aging") Cc: stable@dpdk.org Signed-off-by: Kiran Kumar K Signed-off-by: Harman Kalra > --- > drivers/common/cnxk/roc_npc_aging.c | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/common/cnxk/roc_npc_aging.c b/drivers/common/cnxk/ro= c_npc_aging.c > index 15f6e61d76..66c953135a 100644 > --- a/drivers/common/cnxk/roc_npc_aging.c > +++ b/drivers/common/cnxk/roc_npc_aging.c > @@ -133,6 +133,21 @@ npc_mcam_get_hit_status(struct npc *npc, uint64_t *m= cam_ids, uint16_t start_id, > return rc; > } > > +static void > +npc_age_wait_until(struct roc_npc_flow_age *flow_age) > +{ > +#define NPC_AGE_WAIT_TIMEOUT_MS 1000 > +#define NPC_AGE_WAIT_TIMEOUT_US (NPC_AGE_WAIT_TIMEOUT_MS * NPC_AGE_WAIT_= TIMEOUT_MS) > + uint64_t timeout =3D 0; > + uint64_t sleep =3D 10 * NPC_AGE_WAIT_TIMEOUT_MS; > + > + do { > + plt_delay_us(sleep); > + timeout +=3D sleep; > + } while (!flow_age->aged_flows_get_thread_exit && > + (timeout < (flow_age->aging_poll_freq * NPC_AGE_WAIT_TIM= EOUT_US))); > +} > + > uint32_t > npc_aged_flows_get(void *args) > { > @@ -197,7 +212,7 @@ npc_aged_flows_get(void *args) > plt_seqcount_write_end(&flow_age->seq_cnt); > > lbl_sleep: > - sleep(flow_age->aging_poll_freq); > + npc_age_wait_until(flow_age); > } > > return 0; > -- > 2.39.2 >