help with virtio_port
Igor de Paula
igordptx at gmail.com
Sat May 27 12:04:10 CEST 2023
Thanks!
It's weird because on the KNI version, I am listening on the port and
waiting for a link message. If I run tcpdump there is no packet coming
on that port but the rte_handle_kni_request doe's deal with it.
When I try to listen on the port, without KNI, when I am using
virtio_user I do get a packet when I use tcpdump.
I guess when KNI initialized it takes the traffic associated with the
functions it supports.
Can someone confirm that this is actually the case?
Many thanks for the help so far
On Tue, May 23, 2023 at 5:23 PM Stephen Hemminger
<stephen at networkplumber.org> wrote:
>
> On Tue, 23 May 2023 16:46:24 +0100
> Igor de Paula <igordptx at gmail.com> 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.
More information about the users
mailing list