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 520324317C; Mon, 16 Oct 2023 10:48:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EE8D4067C; Mon, 16 Oct 2023 10:48:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id AF4B0402BD for ; Mon, 16 Oct 2023 10:48:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697446090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gpa2iEO5M/KlnRNDFBT0cg0VpX70lTKQTbFXWDqHVvU=; b=Xm3Px95iuWo7cCD0DJNGGC1Ya93Z+OYSQw22x6b78NcCx437v+tWwefn3naBDDXHmCW09r Ldll8fFXIMK9fNfogOndKI4rlmiDSCLr3RouHFE6QWfOdYCS2sEJWhV0g25HKecuUoCXMy Q6nEFXH029gHfrR5MPUZBiz/YBuscDc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-R2REZq0YPQ-qnUzjf55RVA-1; Mon, 16 Oct 2023 04:47:51 -0400 X-MC-Unique: R2REZq0YPQ-qnUzjf55RVA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8429E889066; Mon, 16 Oct 2023 08:47:50 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46B7463F48; Mon, 16 Oct 2023 08:47:49 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Chas Williams , "Min Hu (Connor)" , Pablo de Lara , Declan Doherty Subject: [PATCH] net/bonding: fix link status callback stop Date: Mon, 16 Oct 2023 10:47:43 +0200 Message-ID: <20231016084744.734493-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 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; for (i = 0; i < internals->member_count; i++) { uint16_t member_id = internals->members[i].port_id; -- 2.41.0