<br><tt><font size=2>Scott Feldman <scofeldm@cisco.com> wrote on
05/08/2010 07:28:11 PM:<br>
<br>
<br>
> chrisw, libvir-list, libvir-list-bounces, Vivek Kashyap</font></tt>
<br><tt><font size=2>> <br>
> On 5/8/10 12:12 PM, "Stefan Berger" <stefanb@us.ibm.com>
wrote:<br>
> <br>
> >> From: Scott Feldman <scofeldm@cisco.com><br>
> >> The device XML is:<br>
> >> <br>
> >>     <interface type='direct'><br>
> >>         <source dev='eth2' mode='private'
profileid='dc_test'/><br>
> >>         <mac address='00:16:3e:1a:b3:4b'/><br>
> >>     </interface><br>
> >> <br>
> >> The port-profile ID msg is sent to source dev.<br>
> > <br>
> > Great. Now we have two competing implementations where the underlying<br>
> > technology is supposed to be VEPA in both but the parameters
to set<br>
> > it up are vastly different --<br>
> > if you compare<br>
> > against Vivek's post yesterfa. Above you are providing a profile
id in<br>
> > form of a string.<br>
> > Is that string above just a dummy example or a real-world parameter
that<br>
> > can actually be passed?<br>
> <br>
> It was an example string.  The RTM_SETLINK IFLA_VF_PORT_PROFILE
msg type<br>
> uses u8 array for port_profile, with the idea that it can hold a string
(as<br>
> in the above example) or some encoded bytes.<br>
> <br>
> > Vivek posted a message yesterday showing now 4 different parameters...
are<br>
> > these somehow encoded in the profileid in your case or you simply
don't<br>
> > need them?<br>
> <br>
> Yes, somehow encoded.  There was discussion on the kernel netdev
mailing<br>
> list on how to merge the VDP tuple into the port-profile, but I haven't
seen<br>
> the final form.  Can you help push that discussion along?  Our
case doesn't</font></tt>
<br><tt><font size=2>> need the VDP tuple encoded in port-profile.  We
need a string to identify<br>
> the desired port-profile.</font></tt>
<br>
<br><tt><font size=2>I thought this was the work of the standards committee
... If I understand the </font></tt>
<br><tt><font size=2>situation correctly, then there is a setup protocol
that needs to be run with</font></tt>
<br><tt><font size=2>the switch to setup parameters for clients' network
streams on a port. That </font></tt>
<br><tt><font size=2>protocol needs a couple of parameters. In your case
you seem to need the </font></tt>
<br><tt><font size=2>profile id and then the hosts' uuid. What else do
you need? Do you need the</font></tt>
<br><tt><font size=2>manager ID in that protocol + type id + type id version
as proposed yesterday?</font></tt>
<br><tt><font size=2>Or is the protocol not 100% defined, yet?</font></tt>
<br>
<br><tt><font size=2>>     VSI Manager ID      1
octet<br>
>     VSI Type ID         3 octets<br>
>     VSI Type ID Version 1 octet<br>
>     VSI Instance ID    16 octets    
           <-- taken care
of via dimdecode<br>
</font></tt>
<br><tt><font size=2><br>
> <br>
> I think we can agree on these goals:<br>
> <br>
> 1) single RTM_SETLINK netlink msg type for set/unset of port-profile<br>
> 2) single method in libvirt to send port-profile using RTM_SETLINK<br>
> 3) single representation in XML<br>
> <br>
> I'm not sure is 3) is possible given the different encodings of<br>
> port-profile.  Can the VDP tuple be represented as a string,
e.g.<br>
> "1.2345.6"?</font></tt>
<br>
<br><tt><font size=2>This is fine by me, but we could also split it up
into different fields.</font></tt>
<br><tt><font size=2>I assume that different vendors' switches will all
somehow need to see the</font></tt>
<br><tt><font size=2>same parameters so they can run the protocol? Virtual
machines will also</font></tt>
<br><tt><font size=2>be able to migrate to hosts that are connected to
different vendors' switches</font></tt>
<br><tt><font size=2>and then will always present the same set of parameters
since they migrate </font></tt>
<br><tt><font size=2>along. So I hope this is completely independent of
what vendor's switch</font></tt>
<br><tt><font size=2>is connected to a host.</font></tt>
<br><tt><font size=2><br>
> <br>
> > I see you are getting the host UUID<br>
> > vid dmidecode, so there are still3 parameters left. Anyway, I
let you guys<br>
> > figure that out.<br>
> <br>
> Ideally, we'd like to have host UUID, guest UUID, and even name of
guest<br>
> port, if available.  Any extra information passed with the port-profile</font></tt>
<br>
<br><tt><font size=2>The guest UUID is available in libvirt and can be
passed through to where it </font></tt>
<br><tt><font size=2>is needed but I didn't see you sending it via the
netlink message so far.</font></tt>
<br>
<br><tt><font size=2>What is a 'guest port'? The port the cable from the
host is connected to the</font></tt>
<br><tt><font size=2>switch (port)?</font></tt>
<br><tt><font size=2><br>
> helps mgmt software organize the virtual ports.<br>
>  <br>
> > I suppose in your case we would use the external daemon to derive
eth0<br>
> > from eth0.100 where the<br>
> > macvtap would be connected on along with the vlan id in eth0.100.
So the<br>
> > functions I posted<br>
> > yesterday may need to go into that code then.<br>
> <br>
> In our case, the src device driver in the kernel receives the RTM_SETLINK<br>
> msg directly; there is no external daemon on the host.  Our driver
will<br>
> handle the RTM_SETLINK msg directly to make sure the virtual port
is set up<br>
> accordingly.</font></tt>
<br>
<br><tt><font size=2>Yeah, I guess you can figure out in the kernel whether
to contact the hardware</font></tt>
<br><tt><font size=2>for eth{0, 1, or 2} to run the protocol on.</font></tt>
<br><tt><font size=2><br>
> <br>
> Note the RTM_SETLINK msg is sent with multicast RTNLGRP_LINK so either
a<br>
> host daemon or a kernel netdev driver may receive the port-profile
msg.<br>
>  <br>
> >> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c<br>
> >> index 5fa8c0a..aff6f28 100644<br>
> >> --- a/src/qemu/qemu_conf.c<br>
> >> +++ b/src/qemu/qemu_conf.c<br>
> >> @@ -1479,6 +1479,11 @@ qemudPhysIfaceConnect(virConnectPtr
conn,<br>
> >>          net->model &&
STREQ(net->model, "virtio"))<br>
> >>          vnet_hdr = 1;<br>
> >> <br>
> >> +    if (!STREQ(net->data.direct.profileid,
""))<br>
> >> +        setPortProfileId(net->data.direct.linkdev,<br>
> >> +                
        net->data.direct.profileid,<br>
> >> +                
        net->mac);<br>
> >> +<br>
> > <br>
> > Since setting up a port profile seems to be a step tightly connected<br>
> > to opening the macvtap I'd push this into the openMactapTap function.<br>
> <br>
> I don't think port-profile should be tightly coupled with macvtap.
 For<br>
> example, port-profile would be applicable for vhost-net where the
emu device<br>
> sits right on top of the kernel netdev.  There is no macvtap
in that case.</font></tt>
<br>
<br><tt><font size=2>Though it seemed a pattern that when a macvtap was
opened or closed that the</font></tt>
<br><tt><font size=2>function to set or unset the port profile was always
called. So instead of calling</font></tt>
<br><tt><font size=2>the close macvtap function + the unset function for
the profile in 3 different places, </font></tt>
<br><tt><font size=2>just call the close macvtap function in 3 places and
have the close macvtap</font></tt>
<br><tt><font size=2>call the unset function for the profile. If other
components can also use the </font></tt>
<br><tt><font size=2>profile related functions, we can still export them,
but at the moment we don't</font></tt>
<br><tt><font size=2>have  the necessary parameters available if anything
else than the 'direct' type of </font></tt>
<br><tt><font size=2>interface was to be used.</font></tt>
<br>
<br><tt><font size=2><br>
> Here are some of the examples use-cases for port-profile that don't
involve<br>
> macvtap:<br>
> <br>
>     PCI device passthru<br>
>     vhost-net<br>
>     software tagging switch over simple nics that passthru
tags<br>
> <br>
> I'm sure there will be other ways invented to plumb the virtual device
to<br>
> the guest interface.</font></tt>
<br>
<br><tt><font size=2>Yes, as said, the setPortProfile can then become {vsi|vepa}SetPortProfile,
and be exported</font></tt>
<br><tt><font size=2>for other functions to use.</font></tt>
<br><tt><font size=2><br>
> <br>
> > <br>
> > use the libvirt function to copy string<br>
> > <br>
> > <br>
> > check for error<br>
> > <br>
> > <br>
> > use libvirt function to copy string<br>
> > <br>
> <br>
> I'll resend with this fixes.  Thanks for the review.</font></tt>
<br>
<br><tt><font size=2>Yes, and you are using #define's that aren't available
for many, yet, so you</font></tt>
<br><tt><font size=2>may need to add #ifdef's around certain code parts
and fail the function</font></tt>
<br><tt><font size=2>with error related to unavailable kernel functionality
if #ifndef.</font></tt>
<br>
<br><tt><font size=2>Also we'll probably need an rpm dependency on the
dmidecode package.</font></tt>
<br>
<br><tt><font size=2>   Stefan</font></tt>
<br><tt><font size=2><br>
> <br>
> -scott<br>
> <br>
</font></tt>