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 203CEA0548 for ; Mon, 30 Aug 2021 04:20:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A54164068A; Mon, 30 Aug 2021 04:20:20 +0200 (CEST) Received: from CNSHJSMIN03.NOKIA-SBELL.COM (unknown [116.246.26.71]) by mails.dpdk.org (Postfix) with ESMTP id 291AA40142 for ; Mon, 30 Aug 2021 04:20:18 +0200 (CEST) X-AuditID: ac189297-dedff700000025fe-58-612c405a54ed Received: from CNSHPPEXCH1604.nsn-intra.net (Unknown_Domain [135.251.51.104]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by CNSHJSMIN03.NOKIA-SBELL.COM (Symantec Messaging Gateway) with SMTP id 7F.96.09726.A504C216; Mon, 30 Aug 2021 10:20:10 +0800 (HKT) Received: from CNSHPPEXCH1605.nsn-intra.net (135.251.51.105) by CNSHPPEXCH1604.nsn-intra.net (135.251.51.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 30 Aug 2021 10:20:09 +0800 Received: from CNSHPPEXCH1605.nsn-intra.net ([135.251.51.105]) by CNSHPPEXCH1605.nsn-intra.net ([135.251.51.105]) with mapi id 15.01.2176.012; Mon, 30 Aug 2021 10:20:09 +0800 From: "Wu, Jianyue (NSB - CN/Hangzhou)" To: "users@dpdk.org" Thread-Topic: How can link status interrupt callback trigger? Thread-Index: AdedQ8RoXkfnIgeoSFaJzy/qFx/c3gAAXXtQ Date: Mon, 30 Aug 2021 02:20:09 +0000 Message-ID: <7ca8ec25d2db48baa50a82cec676896a@nokia-sbell.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [135.251.51.115] MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeLIzCtJLcpLzFFi42Jp/22coRvloJNosHwbp0XzwfUsDowevxYs ZQ1gjOKySUnNySxLLdK3S+DKmHv4HnvB1t2MFfdmHGFuYJyxnrGLkZNDQsBEYu6uySxdjFwc QgKHmCQurN7PDJIQEvjLKLFlcSFEYhOjxNueF+wgCTYBF4mpO+azgtgiAqoSX2btZQGxhQUs JFo/PWCCiNtKNMyZC1VjJPHj7i2wOAtQ/eHnE8FsXgE7icu7TrFALLOTeH9sOVg9p4C9xN/+ VWDXMQqISXw/tQasnllAXOLWk/lMEFcLSCzZc54ZwhaVePn4H1AvB5CtJNG3Aao8VWJB/zY2 iFWCEidnPmGZwCgyC8mkWUjKZiEpg4jrSCzY/YkNwtaWWLbwNTOMfebAYyZk8QWM7KsYpZ39 gj28gn09/QyM9fz8vT0ddYOdXH189Jz9fTcxAmNqjcSk6TsYz839pneIkYmD8RCjBAezkghv 9hutRCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8hwqEE4UE0hNLUrNTUwtSi2CyTBycUg1M1/on /bjd8zMi1kupUErg14faAyW22ea8buVRd0N3cEZleW24u7EqqvdmzgS/kndrLN4In7gX86x6 eu/l2jYF+2anGewBjx89XPZ7I0vPldpH/9eYzpl3UPSoxr6rMheXPzqR+69I8GzN0XkMUjeu PJ1zY+mU172TbbsS3ExVl0zp177XPYWp0tBrmvdfQQnb/VKfJA5nCez45Xj7atas89PiVv/S k5j5qdtGOEny5lvbD45uvwX2LN8d6FD4W/GY1CkBrxONF14lnuxSK1sQfuHKmt2818P0D+7Q 6787JWqVf37ww/vpxVM/N+148GmGy09m+xrNUtc7BozeV54mKmYvu81+b0nR36CAxh0rPyqx FGckGmoxFxUnAgBJKTlVGAMAAA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-users] How can link status interrupt callback trigger? X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hi, May I ask some questions about how can link status interrupt callback trigg= er? Thanks in advance! I tried to do register right after rte_eth_dev_configure(), but when I set #ip link set eth0 down Nothing happens, no callback triggered. These links I registered are the vf(virtual functions) under eth0. I also tried to set the vf as disabled, but seems not allowed. #ip link set eth0 vf 0 state disable RTNETLINK answers: Operation not supported. ret =3D rte_eth_dev_callback_register(portid, RTE_ETH_EVENT_INTR_LSC, l= ink_status_interrupt_event_callback, NULL); static int link_status_interrupt_event_callback(uint16_t port_id, enum rte_eth_event_t= ype type, void *param, void *param1) { struct rte_eth_link link; int ret; (void)param; (void)param1; printf("\nIn registered callback %s(): event type(%d): %s\n", __func__, type, type =3D=3D RTE_ETH_EVENT_INTR_LSC ? "LSC interrupt" : "unk= nown event"); ret =3D rte_eth_link_get_nowait(port_id, &link); if (ret < 0) { printf("Failed to get port %d link status: %s\n\n", port_id, rte_strerror(-ret)); return ret; } else if (link.link_status) { printf("Port %d Link Up - speed %u Mbps - %s\n\n", port_id, (unsign= ed)link.link_speed, (link.link_duplex =3D=3D ETH_LINK_FULL_DUPLEX) ? ("full-duple= x") : ("half-duplex")); } else { printf("Port %d Link Down\n\n", port_id); } return 0; } Best Regards, Dave(Jianyue)