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 5E2754317D; Mon, 16 Oct 2023 12:33:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBFC840269; Mon, 16 Oct 2023 12:33:07 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id A79A94021D; Mon, 16 Oct 2023 12:33:05 +0200 (CEST) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4S8Czx505mz15Mq8; Mon, 16 Oct 2023 18:30:21 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 16 Oct 2023 18:33:01 +0800 Subject: Re: [PATCH] net/bonding: fix link status callback stop To: David Marchand , CC: , Chas Williams , "Min Hu (Connor)" , Pablo de Lara , Declan Doherty References: <20231016084744.734493-1-david.marchand@redhat.com> From: fengchengwen Message-ID: <8e752c64-1e94-7147-6f65-e9e924e998ab@huawei.com> Date: Mon, 16 Oct 2023 18:33:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20231016084744.734493-1-david.marchand@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected 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 2023/10/16 16:47, David Marchand wrote: > If a bonding port gets released, a link status alarm callback still > referenced the ethdev port that may be reused later. > Cancel this callback when stopping the port. > > Bugzilla ID: 1301 > Fixes: a45b288ef21a ("bond: support link status polling") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand > --- > Note: this issue was made apparent now that we release the ethdev port > shared mem, see 36c46e738120 ("ethdev: cleanup shared data with ..."). > > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 122b1187fd..b8ee8be50f 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -2159,6 +2159,10 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) > eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN; > eth_dev->data->dev_started = 0; > > + if (internals->link_status_polling_enabled) { > + rte_eal_alarm_cancel(bond_ethdev_member_link_status_change_monitor, > + (void *)&rte_eth_devices[internals->port_id]); > + } > internals->link_status_polling_enabled = 0; How about move this line in above {}. Anyway, both OK for me Acked-by: Chengwen Feng > for (i = 0; i < internals->member_count; i++) { > uint16_t member_id = internals->members[i].port_id; >