> 
> On 2015/09/16 1:27, Loftus, Ciara wrote:
> >> +
> >> +static int
> >> +rte_pmd_vhost_devinit(const char *name, const char *params)
> >> +{
> >> +  struct rte_kvargs *kvlist = NULL;
> >> +  int ret = 0;
> >> +  int index;
> >> +  char *iface_name;
> >> +
> >> +  RTE_LOG(INFO, PMD, "Initializing pmd_vhost for %s\n", name);
> >> +
> >> +  kvlist = rte_kvargs_parse(params, valid_arguments);
> >> +  if (kvlist == NULL)
> >> +          return -1;
> >> +
> >> +  if (strlen(name) < strlen("eth_vhost"))
> >> +          return -1;
> >> +
> >> +  index = strtol(name + strlen("eth_vhost"), NULL, 0);
> >> +  if (errno == ERANGE)
> >> +          return -1;
> >> +
> >> +  if (rte_kvargs_count(kvlist, ETH_VHOST_IFACE_ARG) == 1) {
> >> +          ret = rte_kvargs_process(kvlist, ETH_VHOST_IFACE_ARG,
> >> +                          &open_iface, &iface_name);
> >> +          if (ret < 0)
> >> +                  goto out_free;
> >> +
> >> +          eth_dev_vhost_create(name, index, iface_name,
> >> rte_socket_id());
> >> +  }
> >> +
> >> +out_free:
> >> +  rte_kvargs_free(kvlist);
> >> +  return ret;
> >> +}
> >> +
> > This suggests to me that vHost ports will only be available/created if one
> supplies the " --vdev 'eth_vhost0,iface=...' " options when launching the
> application. There seems to be no option available to add vHost ports on-the-
> fly after the init process. One would have to restart the application with
> different parameters in order to modify the vHost port configuration. Is this
> correct?
> 
> Hi Ciara,
> 
> Thanks for your checking and description.
> We can attach and detach a port created by vhost PMD using Port Hotplug
> functionality.
> 
> example)
> ./testpmd -c f -n 4 -- -i
> testpmd> port attach eth_vhost0,iface=/tmp/aaa
> 
> Does this fit your case?
> 
> Thanks,
> Tetsuya

Hi,

Thanks for your reply. I wasn't aware of the hotplug functionality but this 
should work for this use case. Thanks!
I will continue to review the remainder of the patch and reply if I have any 
further feedback.

Ciara

> 
> > If so, this pmd implementation will not work with Open vSwitch. OVS relies
> on the ability to call the rte_vhost_driver_register function at any point in 
> the
> lifetime of the application, in order to create new vHost ports and
> subsequently register/create the sockets. Being bound to the selection
> chosen on the command line when launching the application is not suitable
> for OVS.
> >
> > Thanks,
> > Ciara

Reply via email to