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 04A16A0351 for ; Mon, 10 Jan 2022 08:46:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA94C4013F; Mon, 10 Jan 2022 08:46:14 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id ED81C4013F for ; Mon, 10 Jan 2022 08:46:13 +0100 (CET) Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id C8F5C3F044 for ; Mon, 10 Jan 2022 07:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641800773; bh=b6KP8jP7A89Us9hji/bST/m92OeXLY5GMZlFCT0Ew6c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Xp8dO2GD9n5vQOQge71t070aI4QVbWracmCYgAXq0au/B9SQxy948VTXd5XQaVmEm 0Rcney1HHN42a0+ibbbrxH//qgx+HaFKM/Kcviww/TMng47Wapmp0xSOhcvnxlGKAG 21k6JBWssXbmVTEnD7QuKD9LFClb3YFBk/vQSEDrENO5qGa8qWr0rGMRrKTkFvWynd JJg2Ddj8U+M/5/W8K2Y+VhByHraa6PjttVUnd9FvO9HParwkGa3p11bWWLQO0lt4ty GBlFfG/watJ6vzD9EVZvIyHvihKNtWxUWQJpVSyxHbz5W+9NkpKrTYQWEHkizZxCpb 0wJCDpVuuEBSQ== Received: by mail-qv1-f69.google.com with SMTP id i3-20020ad45c63000000b0041143710adbso12388980qvh.18 for ; Sun, 09 Jan 2022 23:46:13 -0800 (PST) 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; bh=b6KP8jP7A89Us9hji/bST/m92OeXLY5GMZlFCT0Ew6c=; b=5tXslh+mzQPn/knx6BZbj1JAyILv21kA1rwPIgct847lPFLKV/ZXOYzJmYawm9LWys LdQHsTuGQQUZ+fItOpODEyzL/IlTH4xipl4tOmUZWHSKLrPjGR6DawQdeOgLnvUJPLbu m9G79LP+xfpDAE3lgfmsLyhZu7Q56G/9ldLW2WNMFEtym2NeQ8C7dSOOEcvqEHfICE4z No8li8se812/hlmKs82qlF1cS/+lZtf7slBpRPXmxFJDdOa15v5BcdlaqxQ4Ta9DE/o6 sXNby002MECewEIVU1ITfheqpn3jauz4BF+n19BJIbecUtgjoPltPFlJpyYepH3KoP2f ochg== X-Gm-Message-State: AOAM5311w4bzOVmGlwMrKItAcsYwGPtpTKyS/FchCIQdpUYEFS+nybhw KfWnOwe9H8HMbVRk7ZIz0uB8J06e8xsWXWyMrXiAM65GjXDts+IAxruUWOSxFeyVEbo2Mfjv5nJ 6TtdaGpnnlFmjU4mkPQySF6FHEK+7Fq9mkCEE9U4k X-Received: by 2002:a05:620a:1370:: with SMTP id d16mr10554005qkl.759.1641800772919; Sun, 09 Jan 2022 23:46:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2p/2WUljYCbYcX4o7xyxpdDxmc6xEfxZSViNnbCQ8SWn7Ahxar+DDWwW1J15QNFdLrIvv5HI0uVMr7pVVw54= X-Received: by 2002:a05:620a:1370:: with SMTP id d16mr10554001qkl.759.1641800772675; Sun, 09 Jan 2022 23:46:12 -0800 (PST) MIME-Version: 1.0 References: <20211225105344.28355-1-lihuisong@huawei.com> <20211225105344.28355-5-lihuisong@huawei.com> In-Reply-To: <20211225105344.28355-5-lihuisong@huawei.com> From: Christian Ehrhardt Date: Mon, 10 Jan 2022 08:45:46 +0100 Message-ID: Subject: Re: [PATCH 19.11 4/4] net/hns3: unregister MP action on close for secondary To: Huisong Li Cc: stable@dpdk.org, humin29@huawei.com Content-Type: text/plain; charset="UTF-8" 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 Sat, Dec 25, 2021 at 11:58 AM Huisong Li wrote: > > [ upstream commit 443242212baeb67d298c54cc927553c92aa29bec ] > Thank you, queued for 19.11.12 (later this year) > This patch fixes lack of unregistering MP action for secondary process > when PMD is closed. > > Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result") > Fixes: 23d4b61fee5d ("net/hns3: support multiple process") > > Signed-off-by: Huisong Li > Signed-off-by: Min Hu (Connor) > --- > drivers/net/hns3/hns3_ethdev.c | 6 ++++-- > drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++-- > drivers/net/hns3/hns3_mp.c | 5 +---- > drivers/net/hns3/hns3_mp.h | 2 +- > 4 files changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c > index 122a2bc66c..df76dfce7f 100644 > --- a/drivers/net/hns3/hns3_ethdev.c > +++ b/drivers/net/hns3/hns3_ethdev.c > @@ -4750,6 +4750,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) > rte_free(eth_dev->process_private); > eth_dev->process_private = NULL; > __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); > + hns3_mp_uninit(); > return; > } > > @@ -4768,7 +4769,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) > rte_free(hw->reset.wait_data); > rte_free(eth_dev->process_private); > eth_dev->process_private = NULL; > - hns3_mp_uninit_primary(); > + hns3_mp_uninit(); > hns3_warn(hw, "Close port %d finished", hw->data->port_id); > } > > @@ -5529,7 +5530,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev) > rte_free(hw->reset.wait_data); > > err_init_reset: > - hns3_mp_uninit_primary(); > + hns3_mp_uninit(); > > err_mp_init_primary: > err_mp_init_secondary: > @@ -5554,6 +5555,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) > rte_free(eth_dev->process_private); > eth_dev->process_private = NULL; > __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); > + hns3_mp_uninit(); > return 0; > } > > diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c > index 562f6f7662..dbd46cd278 100644 > --- a/drivers/net/hns3/hns3_ethdev_vf.c > +++ b/drivers/net/hns3/hns3_ethdev_vf.c > @@ -1655,6 +1655,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) > rte_free(eth_dev->process_private); > eth_dev->process_private = NULL; > __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); > + hns3_mp_uninit(); > return; > } > > @@ -1672,7 +1673,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) > rte_free(hw->reset.wait_data); > rte_free(eth_dev->process_private); > eth_dev->process_private = NULL; > - hns3_mp_uninit_primary(); > + hns3_mp_uninit(); > hns3_warn(hw, "Close port %d finished", hw->data->port_id); > } > > @@ -2364,7 +2365,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev) > rte_free(hw->reset.wait_data); > > err_init_reset: > - hns3_mp_uninit_primary(); > + hns3_mp_uninit(); > > err_mp_init_primary: > err_mp_init_secondary: > @@ -2390,6 +2391,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) > rte_free(eth_dev->process_private); > eth_dev->process_private = NULL; > __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); > + hns3_mp_uninit(); > return 0; > } > > diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c > index c7e49a798a..b017387efd 100644 > --- a/drivers/net/hns3/hns3_mp.c > +++ b/drivers/net/hns3/hns3_mp.c > @@ -213,10 +213,7 @@ int hns3_mp_init_primary(void) > return 0; > } > > -/* > - * Un-initialize by primary process. > - */ > -void hns3_mp_uninit_primary(void) > +void hns3_mp_uninit(void) > { > process_data.eth_dev_cnt--; > > diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h > index 8ef432e763..ef334648ff 100644 > --- a/drivers/net/hns3/hns3_mp.h > +++ b/drivers/net/hns3/hns3_mp.h > @@ -15,7 +15,7 @@ extern struct hns3_process_local_data process_data; > void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev); > void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev); > int hns3_mp_init_primary(void); > -void hns3_mp_uninit_primary(void); > +void hns3_mp_uninit(void); > int hns3_mp_init_secondary(void); > > #endif /* _HNS3_MP_H_ */ > -- > 2.33.0 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd