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 6E41DA034F for ; Mon, 30 Aug 2021 17:29:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37260410E8; Mon, 30 Aug 2021 17:29:28 +0200 (CEST) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mails.dpdk.org (Postfix) with ESMTP id CFDB0410D8 for ; Mon, 30 Aug 2021 17:29:26 +0200 (CEST) Received: by mail-pg1-f181.google.com with SMTP id w8so13791514pgf.5 for ; Mon, 30 Aug 2021 08:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ck/aJqqyjAstoUY9eKkPlgU8T4p5GF37UUYS4zQ1M+g=; b=QBj5It0Wrpom4aka4BaNykzH0WTe9IkQOvI38uxQ1KU/UESE87Ehk2bQ6axULMCn5a 5rwjMS7JfquJ3gKtRPJe+veN+rgg7FJunKJbeb62U36FQalbLQEXyGczSQnUfOZ4Ct24 nAxpmZZLfV45FxhOvYMpT52MUaR5CACU72HhLzEbTQe/GdZJbe913nHFaGumrtqbwNEp TTYiN/rq2VXkLHx4549Flllc18SSC0O97ZZwKln6xiG2ImxJvYb/7fEhVd5sCcuRoRXg HJYt4wn2gwnciFxevHzCCKHkK6r+CsONW+ynp8EIuVhSUgtfkmlKrPIwCO1Pge89vZFI 4I1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ck/aJqqyjAstoUY9eKkPlgU8T4p5GF37UUYS4zQ1M+g=; b=WoE+pBmlMEvLAQgsR/bkRMN00Q0hWnnARXyy2/JEslRPCp3BtIou521qxmpYlXFnYD /4QjS1Y07F5UxlJzCsoU+jLmULCpqMon1TFy6FMX63zgz8RfI5LQvMPvwr9+/nG/+Hzt 9DDTiTNilCAE7HaebKu+biQEnOACrUMc93dnliPmvtNJyzwXwuonrMcXPNZdpKSuvjsA LTidZzJ7aVnXGupm1m8M9iGAz+JNe/RnZqbmBB6Eo5kDBuYgoUnzIJHGNmiLfU9Jtiua Dy/S+vWcfK+0aT2xE53GsoQxhxILwR6n1N0qPC1E/KPiSWcuua/lkeeftuMUJgFHKmR3 fbWQ== X-Gm-Message-State: AOAM53077MF0y+e1/LQAHZ5PiBquD+McFshs00eZJrYrUf2NW0LsMCis Fw1twdby91dZjjydw+2Oy2rtEgBAX5A3Jw== X-Google-Smtp-Source: ABdhPJwOaRtgkhzCh+2bB38z/whcQMuk0Jd3m7Wid+7CH0YUgizdcITwZdGXBby4TamwzVLGEx34mA== X-Received: by 2002:a63:e00b:: with SMTP id e11mr22593448pgh.190.1630337365830; Mon, 30 Aug 2021 08:29:25 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id v17sm14755612pff.6.2021.08.30.08.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 08:29:25 -0700 (PDT) Date: Mon, 30 Aug 2021 08:29:22 -0700 From: Stephen Hemminger To: "Wu, Jianyue (NSB - CN/Hangzhou)" Cc: "users@dpdk.org" Message-ID: <20210830082922.7e070c4b@hermes.local> In-Reply-To: <7ca8ec25d2db48baa50a82cec676896a@nokia-sbell.com> References: <7ca8ec25d2db48baa50a82cec676896a@nokia-sbell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [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" On Mon, 30 Aug 2021 02:20:09 +0000 "Wu, Jianyue (NSB - CN/Hangzhou)" wrote: > Hi, > > May I ask some questions about how can link status interrupt callback trigger? 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 = rte_eth_dev_callback_register(portid, RTE_ETH_EVENT_INTR_LSC, link_status_interrupt_event_callback, NULL); > > static int > link_status_interrupt_event_callback(uint16_t port_id, enum rte_eth_event_type 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 == RTE_ETH_EVENT_INTR_LSC ? "LSC interrupt" : "unknown event"); > > ret = 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, (unsigned)link.link_speed, > (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex")); > } else { > printf("Port %d Link Down\n\n", port_id); > } > return 0; > } > > Best Regards, > Dave(Jianyue) > The link status interrupt reflects changes to the DPDK interface (not the kernel interface). When you changed the eth0 it was a kernel interface. If it was a PF, then it may not be propogating that change the VF that DPDK is using. What hardware is this?