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 553E942B83 for ; Tue, 23 May 2023 18:23:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48E1D4282D; Tue, 23 May 2023 18:23:27 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id C7BB640689 for ; Tue, 23 May 2023 18:23:25 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-64d2a87b9daso4045652b3a.0 for ; Tue, 23 May 2023 09:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1684859005; x=1687451005; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=9maZdRfOTYLnajMDIvZfamDs7WcEogS/xsaNdsR0o44=; b=McPytAKb7SADzxyWsAKXEI20zMejslfsXusnu5L8iSmyrq/Vf9uaLZjL7ChrFILPOP IEvKYQGih+WbomUYo1PB3P/PahbAvQ4u/egI0/ZqeO0G2zXvsXfa4RjWu2eGPlb2CUXk vVWkZkFD9EGlo+zrIwogO2TxiR98zPx3QjiyO4/buq7cj7tq5dOSp3Wmdw+Pcw3GfhPF A+zRRlguwsGqCktJU6EjSnLfbXv/feu3vK6Y8ZmVQD9FKrAAbxa1B3DPLwPcNP2L0+V0 Q9QVCSmTXDpNBnhSmvsj7gqlus/WSG0jfQYqalgFnpzZg1efoRFijqvK6pehG3McZE/+ ZCyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684859005; x=1687451005; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9maZdRfOTYLnajMDIvZfamDs7WcEogS/xsaNdsR0o44=; b=kLPvRzKOksRmyaYuzfxHtbtFtIV73nXtNk6nPnLD+41GotvdJGrM9Ew3aYi9LQ7Xo7 hlcL27sHYFRlkE/9I5JYSU+9/PU/RGSDJKApBfaQhzfxXqvex0AszfEheFrsKBWRH41u kFFs0tErN3nBZo0nTfRruS39uPZVQ5FcUtuRf51U7eHeDcfthO10Nh7btyM9fe4zroWJ ZY3lWJQUN/qEZK0EO46mANg+ZjcWZo5eaZUXQZeloVyf/KYTvuZZXRJ4UGTSnZG0WLCK VnTLsnWCBtimo5f5pTryX6t00W7AeB/hDdgDgfkZ+kR67LlENFoMGhVfdTK+vbrYbWsC O9VQ== X-Gm-Message-State: AC+VfDxO/pimQz/X6WDzX5EiMIyANPQMOwdtHQPElAs5lZjJf8xjfQF1 ImokaoZaR1B7XLck+ybocbvrIg== X-Google-Smtp-Source: ACHHUZ705cDb4VOgGoP1H15hO9P1BTpvWTWkOjKRo39juvhHQlmQeYCr2Qx/0wq8JA0mLaSTsJP91A== X-Received: by 2002:a05:6a20:4315:b0:ef:7aa2:3cfd with SMTP id h21-20020a056a20431500b000ef7aa23cfdmr13743767pzk.50.1684859004912; Tue, 23 May 2023 09:23:24 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id t10-20020a63dd0a000000b005346b9a7fe5sm6293402pgg.22.2023.05.23.09.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 09:23:24 -0700 (PDT) Date: Tue, 23 May 2023 09:23:22 -0700 From: Stephen Hemminger To: Igor de Paula Cc: users@dpdk.org Subject: Re: help with virtio_port Message-ID: <20230523092322.25757e84@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Tue, 23 May 2023 16:46:24 +0100 Igor de Paula wrote: > Hi, > I am running the DPDK version: 21.08.0 and Ubuntu 20.04.3 LTS. > I have an application that uses KNI to interface with the kernel. > I want to replace it with virtio_user ports as KNI will be deprecated in > the future. > Most of the functionality I am able to replace but there is one thing I am > struggling with. > In KNI we can add functions that will be called in case the network stack > makes a request. The following code shows this: > struct rte_kni *kni; > struct rte_kni_conf conf; > struct rte_kni_ops ops; > struct rte_eth_dev_info dev_info; > int ret; > /* Clear conf at first */ > memset(&conf, 0, sizeof(conf)); > conf.core_id = 0; > memset(&ops, 0, sizeof(ops)); > ops.port_id = ppo->id; > ops.config_promiscusity = ippe_ppo_set_kni_promiscuous_mode; > ops.change_mtu = ippe_ppo_set_kni_mtu; > ops.config_network_if = ippe_ppo_set_kni_interface; > ops.config_mac_address = ippe_ppo_set_kni_mac_address; > kni = rte_kni_alloc(pktmbuf_pool[0], &conf, &ops); > > > And there is a handle_request function supplied by KNI that calls these > functions when need be, > I haven't found any documentation on how to replace this functionality. I > am no expert in how to set up and interact with the kernel stack, Some help > on how to achieve this would be appreciated. If you want to handle changes to kernel network device, then you will have to build a netlink listener that monitors these changes.