Re: [vpp-dev] Tap IF Names

2017-03-28 Thread Jon Loeliger
On Tue, Mar 28, 2017 at 2:28 PM, Pierre Pfister (ppfister) <
ppfis...@cisco.com> wrote:

>
>
> tapcli.c implements all tap nodes, plus the CLI calls.
> tapapi.c only implements api calls and then calls tapcli functions.
>
> Admittedly tapcli is not the perfect name,
>

It's not a matter of names.

but file renaming in git makes the history of changes way harder to follow.
>

I beg to differ. [*1*]


> So I don't think it is necessary to rename tapcli.c
>

Wouldn't do that anyway.  It's not a matter of file names.

My concern is that a pure user of the C API shouldn't drag in
anything to do with the VAT and vppctl CLI command infrastructure.
Having conflated the CLI bits (parsing, param checking, marshalling)
and the CLI output (format(), etc), with the underlying implementaion
of the actual TAP requirements (control sockets, setting the mac
and IP addrs, etc) runs the risk of having the pure C API users
drag in a lot of unneeded CLI code.

There should be a *new* file that has the underlying implementaion
without the CLI bits.


tuntap.c, on the other hand, I think is legacy code. There probably is some
> cleaning to be done there.
>

Haven't peered over there yet... :-/

> - Pierre
>

HTH,
jdl

[*1*] -- http://shop.oreilly.com/product/0636920022862.do
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] Tap IF Names

2017-03-28 Thread Pierre Pfister (ppfister)

Le 28 mars 2017 à 13:54, Jon Loeliger 
> a écrit :

On Tue, Mar 28, 2017 at 11:59 AM, Jon Loeliger 
> wrote:


On Tue, Mar 28, 2017 at 11:50 AM, Damjan Marion (damarion) 
> wrote:

> On 28 Mar 2017, at 12:15, Kinsella, Ray 
> > wrote:
>
> +1 to Jon's comments.
>
>
> On 24/03/2017 14:07, Pierre Pfister (ppfister) wrote:
>> Hello Jon,
>>
>> No strong opinion on my side, but I'd just like to notice that there might 
>> be cases where multiple interfaces, in linux, have the same name, if they 
>> are in different network namespaces.
>> VPP could literally control the back-end of thousands of containers' 
>> interfaces, all called eth0.
>
> Well your backend and your frontend device names are typically named 
> different. You are correct in that frontend device in the container is always 
> eth0, the backend device for each container's eth0 is uniquely named in the 
> default network namespace.

Can somebody come up with the patch proposal?

Thanks!

Happy to do so.  One question, though: what is the purpose of
the "renumber" and "custom_dev_instance" fields?

Thanks,
jdl

OK.  I've read through bunch of that custom_dev_instance code now.
I was initially not paying attention to it, as it stumbled into the so-called
"tapcli" data, and we're not using the VPP CLI.

I think the dev_custom_instance will do what we want (Allow the user
to specify the number that will be used as the "show" name for the
corresponding tap interface.  Good.).

However, I now have a different issue with this code.  Almost all the
code in the tapcli.c file is implementation that should be shared by
both the CLI and the API.  RIght now, the API sort of cannibalizes
into the CLI code.

Instead, there should be three files here: the CLI, the API and the
underlying implementation of Tap data structures.

tapcli.c implements all tap nodes, plus the CLI calls.
tapapi.c only implements api calls and then calls tapcli functions.

Admittedly tapcli is not the perfect name, but file renaming in git makes the 
history of changes way harder to follow.
So I don't think it is necessary to rename tapcli.c

tuntap.c, on the other hand, I think is legacy code. There probably is some 
cleaning to be done there.

- Pierre


___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] Tap IF Names

2017-03-28 Thread Jon Loeliger
On Tue, Mar 28, 2017 at 11:59 AM, Jon Loeliger  wrote:

>
>
> On Tue, Mar 28, 2017 at 11:50 AM, Damjan Marion (damarion) <
> damar...@cisco.com> wrote:
>
>>
>> > On 28 Mar 2017, at 12:15, Kinsella, Ray  wrote:
>> >
>> > +1 to Jon's comments.
>> >
>> >
>> > On 24/03/2017 14:07, Pierre Pfister (ppfister) wrote:
>> >> Hello Jon,
>> >>
>> >> No strong opinion on my side, but I'd just like to notice that there
>> might be cases where multiple interfaces, in linux, have the same name, if
>> they are in different network namespaces.
>> >> VPP could literally control the back-end of thousands of containers'
>> interfaces, all called eth0.
>> >
>> > Well your backend and your frontend device names are typically named
>> different. You are correct in that frontend device in the container is
>> always eth0, the backend device for each container's eth0 is uniquely named
>> in the default network namespace.
>>
>> Can somebody come up with the patch proposal?
>>
>> Thanks!
>
>
> Happy to do so.  One question, though: what is the purpose of
> the "renumber" and "custom_dev_instance" fields?
>
> Thanks,
> jdl
>

OK.  I've read through bunch of that custom_dev_instance code now.
I was initially not paying attention to it, as it stumbled into the
so-called
"tapcli" data, and we're not using the VPP CLI.

I think the dev_custom_instance will do what we want (Allow the user
to specify the number that will be used as the "show" name for the
corresponding tap interface.  Good.).

However, I now have a different issue with this code.  Almost all the
code in the tapcli.c file is implementation that should be shared by
both the CLI and the API.  RIght now, the API sort of cannibalizes
into the CLI code.

Instead, there should be three files here: the CLI, the API and the
underlying implementation of Tap data structures.

Will you entertain a patch down that line?

Thanks,
jdl
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] Tap IF Names

2017-03-28 Thread Jon Loeliger
On Tue, Mar 28, 2017 at 11:50 AM, Damjan Marion (damarion) <
damar...@cisco.com> wrote:

>
> > On 28 Mar 2017, at 12:15, Kinsella, Ray  wrote:
> >
> > +1 to Jon's comments.
> >
> >
> > On 24/03/2017 14:07, Pierre Pfister (ppfister) wrote:
> >> Hello Jon,
> >>
> >> No strong opinion on my side, but I'd just like to notice that there
> might be cases where multiple interfaces, in linux, have the same name, if
> they are in different network namespaces.
> >> VPP could literally control the back-end of thousands of containers'
> interfaces, all called eth0.
> >
> > Well your backend and your frontend device names are typically named
> different. You are correct in that frontend device in the container is
> always eth0, the backend device for each container's eth0 is uniquely named
> in the default network namespace.
>
> Can somebody come up with the patch proposal?
>
> Thanks!


Happy to do so.  One question, though: what is the purpose of
the "renumber" and "custom_dev_instance" fields?

Thanks,
jdl
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] Tap IF Names

2017-03-28 Thread Damjan Marion (damarion)

> On 28 Mar 2017, at 12:15, Kinsella, Ray  wrote:
> 
> +1 to Jon's comments.
> 
> 
> On 24/03/2017 14:07, Pierre Pfister (ppfister) wrote:
>> Hello Jon,
>> 
>> No strong opinion on my side, but I'd just like to notice that there might 
>> be cases where multiple interfaces, in linux, have the same name, if they 
>> are in different network namespaces.
>> VPP could literally control the back-end of thousands of containers' 
>> interfaces, all called eth0.
> 
> Well your backend and your frontend device names are typically named 
> different. You are correct in that frontend device in the container is always 
> eth0, the backend device for each container's eth0 is uniquely named in the 
> default network namespace.

Can somebody come up with the patch proposal?

Thanks!
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev


Re: [vpp-dev] Tap IF Names

2017-03-28 Thread Kinsella, Ray

+1 to Jon's comments.


On 24/03/2017 14:07, Pierre Pfister (ppfister) wrote:

Hello Jon,

No strong opinion on my side, but I'd just like to notice that there might be 
cases where multiple interfaces, in linux, have the same name, if they are in 
different network namespaces.
VPP could literally control the back-end of thousands of containers' 
interfaces, all called eth0.


Well your backend and your frontend device names are typically named 
different. You are correct in that frontend device in the container is 
always eth0, the backend device for each container's eth0 is uniquely 
named in the default network namespace.


Ray K
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev


Re: [vpp-dev] Tap IF Names

2017-03-24 Thread Jon Loeliger
On Fri, Mar 24, 2017 at 9:07 AM, Pierre Pfister (ppfister) <
ppfis...@cisco.com> wrote:

> Hello Jon,
>
> No strong opinion on my side, but I'd just like to notice that there might
> be cases where multiple interfaces, in linux, have the same name, if they
> are in different network namespaces.
> VPP could literally control the back-end of thousands of containers'
> interfaces, all called eth0.
>
> I know this is a rather specific use-case, so I understand it might be
> helpful to change the default, but don't make the assumption that linux
> interface names are unique.
>
> - Pierre


Pierre and others,

Where did VPP get the names for those thousands of interfaces?

My point is that having VPP make up names for entities that the
user is going to want to name makes for a very bad UI design and
a bad User Experience.

Instead, the user needs to be in control of the namespace and be
able to predict, or out-right state, the names VPP will assign to
any entity that it allows the user to name.

The Tap interface fails in this regard.  I'm looking for a viable
solution, though.

Thanks,
jdl
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Re: [vpp-dev] Tap IF Names

2017-03-24 Thread Pierre Pfister (ppfister)
Hello Jon,

No strong opinion on my side, but I'd just like to notice that there might be 
cases where multiple interfaces, in linux, have the same name, if they are in 
different network namespaces.
VPP could literally control the back-end of thousands of containers' 
interfaces, all called eth0.

I know this is a rather specific use-case, so I understand it might be helpful 
to change the default, but don't make the assumption that linux interface names 
are unique.

- Pierre


> Le 23 mars 2017 à 20:55, Jon Loeliger  a écrit :
> 
> Guys,
> 
> Why do tap interfaces use the name "tap-%d" internally?  The user has
> given an actual name (that corresponds to the underlying Linux tap name),
> and yet VPP makes up a non-correlatable different name in the form "tap-%d"
> by making up some number and assigning it to the IF.
> 
> This issue is precisely the same problem that loopback IF names had,
> and for which I submitted a patch to at least allow deterministically 
> predictable
> IF names for user-assigned names on loopbacks.
> 
> Later, there is some form of ability to "renumber" tap interfaces.  Will this
> affect the numbering of the IF names the user sees?
> 
> Specifically, I'm wondering if we can somehow unify the tap name prefix
> with the other interface prefixing styles in a more standard, cohesive and
> predictable way.  In the case of tap IFs, having VPP instead at least use
> the name "tap-%s", formatted with the user-supplied name would make
> it predictable and somewhat similar to the other IF types.
> 
> I *think* this table summarizes the current state of IF names for many
> of the interface types.
> 
> Thanks,
> jdl
> 
> 
> 
> DPDK:
> User says : TenGigabitEthernet6/0/0
> VPP uses  : TenGigabitEthernet6/0/0
> Linux uses: 
> 
> Loopback:
> User says :- for "create" and "delete" commands
> VPP uses  : loop   - for any other reference to the IF
> Linux : 
> 
> Host AF_PACKET
> User says : - for "create" and "delete" commands
> VPP uses  : host-   - for any other reference to the IF
> Linux uses: 
> Note: Leftover(?) use of "veth" in all VPP Wiki pages still?
> 
> Tap:
> User says : - for "create" and "delete" commands
> VPP uses  : tap-   - for any other reference to the IF
> Linux uses: 
> Note: No relationship between  and 
> 
> netmap:
> User says : - for "create" and "delete" commands
> VPP uses  : netmap- - for any other reference to the IF
> Linux uses: 
> 
> ___
> vpp-dev mailing list
> vpp-dev@lists.fd.io
> https://lists.fd.io/mailman/listinfo/vpp-dev

___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

[vpp-dev] Tap IF Names

2017-03-23 Thread Jon Loeliger
Guys,

Why do tap interfaces use the name "tap-%d" internally?  The user has
given an actual name (that corresponds to the underlying Linux tap name),
and yet VPP makes up a non-correlatable different name in the form "tap-%d"
by making up some number and assigning it to the IF.

This issue is precisely the same problem that loopback IF names had,
and for which I submitted a patch to at least allow deterministically
predictable
IF names for user-assigned names on loopbacks.

Later, there is some form of ability to "renumber" tap interfaces.  Will
this
affect the numbering of the IF names the user sees?

Specifically, I'm wondering if we can somehow unify the tap name prefix
with the other interface prefixing styles in a more standard, cohesive and
predictable way.  In the case of tap IFs, having VPP instead at least use
the name "tap-%s", formatted with the user-supplied name would make
it predictable and somewhat similar to the other IF types.

I *think* this table summarizes the current state of IF names for many
of the interface types.

Thanks,
jdl



DPDK:
User says : TenGigabitEthernet6/0/0
VPP uses  : TenGigabitEthernet6/0/0
Linux uses: 

Loopback:
User says :  - for "create" and "delete" commands
VPP uses  : loop - for any other reference to the IF
Linux : 

Host AF_PACKET
User says :  - for "create" and "delete" commands
VPP uses  : host- - for any other reference to the IF
Linux uses: 
Note: Leftover(?) use of "veth" in all VPP Wiki pages still?

Tap:
User says :  - for "create" and "delete" commands
VPP uses  : tap- - for any other reference to the IF
Linux uses: 
Note: No relationship between  and 

netmap:
User says :  - for "create" and "delete" commands
VPP uses  : netmap- - for any other reference to the IF
Linux uses: 
___
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev