Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start vhost port - Ubuntu 20.04 5.8.0-63 kernel #1032

Closed
manojmpanicker opened this issue Aug 24, 2021 · 4 comments
Closed

Cannot start vhost port - Ubuntu 20.04 5.8.0-63 kernel #1032

manojmpanicker opened this issue Aug 24, 2021 · 4 comments

Comments

@manojmpanicker
Copy link

I'm trying to get a create a vhost interface as shown below following the example semantics provided in the documentation:
VhostUser0::PMDPort(name='VhostUser0',vdev='vhost0,iface=/tmp/vhost_user0.sock,queues=1')

but I run into a failure:
localhost:10514 $ run samples/mysample
*** Error: Unhandled exception in the configuration script (most recent call last)
File "/home/amd/BESS/bess/bessctl/conf/samples/mysample.bess", line 5, in
VhostUser0::PMDPort(name='VhostUser_0',vdev='vhost0,iface=/tmp/vhost_user0.sock,queues=1')
File "/home/amd/BESS/bess/bessctl/commands.py", line 139, in bess_module
return make_modules([module_names])[0]
File "/home/amd/BESS/bess/bessctl/commands.py", line 119, in make_modules
obj = mclass_obj(*args, name=module, **kwargs)
TypeError: type object got multiple values for keyword argument 'name'

Another simple test using a basic forwarding conf script shown below worked fine:
_dpdkp0::PMDPort(port_id=0, num_inc_q=1, num_out_q=1)
dpdkp1::PMDPort(port_id=1, num_inc_q=1, num_out_q=1)

InDpdkP0::QueueInc(port=dpdkp0, qid=0)
InDpdkP1::QueueInc(port=dpdkp1, qid=0)

OutDpdkP0::QueueOut(port=dpdkp0, qid=0)
OutDpdkP1::QueueOut(port=dpdkp1, qid=0)

InDpdkP0 -> OutDpdkP0
InDpdkP1 -> OutDpdkP1_

I just added the line to create the vhost interface when I ran into this failure.

The git commit for the BESS sources is
commit ae52fc5

Python version is Python 3.8.10.

@krsna1729
Copy link
Collaborator

TypeError: type object got multiple values for keyword argument 'name'

You are sending the name explicitly as well as implicitly by using the syntactic sugar

VhostUser0::PMDPort(name='VhostUser0',vdev='vhost0,iface=/tmp/vhost_user0.sock,queues=1')

Instead, do this

VhostUser0::PMDPort(vdev='vhost0,iface=/tmp/vhost_user0.sock,queues=1')

@manojmpanicker
Copy link
Author

I had tried that as well but that ran into another error:

*** Error: Unhandled exception in the configuration script (most recent call last)
File "/home/amd/BESS/bess/bessctl/conf/samples/mysample.bess", line 7, in
VhostUser0::PMDPort(vdev='vhost0,iface=/tmp/vhost_user0.sock,queues=1')
File "/home/amd/BESS/bess/bessctl/commands.py", line 139, in bess_module
return make_modules([module_names])[0]
File "/home/amd/BESS/bess/bessctl/commands.py", line 119, in make_modules
obj = mclass_obj(*args, name=module, **kwargs)
File "/home/amd/BESS/bess/bessctl/../pybess/port.py", line 41, in init
ret = self.bess.create_port(self.driver, name,
File "/home/amd/BESS/bess/bessctl/../pybess/bess.py", line 389, in create_port
return self._request('CreatePort', request)
File "/home/amd/BESS/bess/bessctl/../pybess/bess.py", line 278, in _request
raise self.Error(code, errmsg, query=name, query_arg=req_dict)
*** Error: Cannot attach vdev vhost0,iface=/tmp/vhost_user0.sock,queues=1
BESS daemon response - errno=19 (ENODEV: No such device)
query: CreatePort
query_arg: {'name': 'VhostUser0', 'driver': 'PMDPort', 'arg': {'type_url': 'type.googleapis.com/bess.pb.PMDPortArg', 'value': b'"+vhost0,iface=/tmp/vhost_user0.sock,queues=1'}}

@krsna1729
Copy link
Collaborator

@manojmpanicker net_ prefix is required when conveying vdev names as per DPDK. These errors are reported by DPDK. BESS simply passes the args.

https://github.com/DPDK/dpdk/blob/v20.11/drivers/net/vhost/rte_eth_vhost.c#L1663-L1673

Try this

VhostUser0::PMDPort(vdev='net_vhost0,iface=/tmp/vhost_user0.sock,queues=1')

@manojmpanicker
Copy link
Author

Thanks @krsna1729. With the change you suggested, I am able to create the vhost interfaces and create a pipeline with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants