OpenVZ Forum


Home » Mailing lists » Devel » Re: [PATCH] Virtual ethernet tunnel (v.2)
Re: [PATCH] Virtual ethernet tunnel (v.2) [message #18786] Thu, 07 June 2007 15:51 Go to next message
Ben Greear is currently offline  Ben Greear
Messages: 30
Registered: June 2006
Member
Pavel Emelianov wrote:
> Ben Greear wrote:
>   
>> Pavel Emelianov wrote:
>>     
>>> Veth stands for Virtual ETHernet. It is a simple tunnel driver
>>> that works at the link layer and looks like a pair of ethernet
>>> devices interconnected with each other.
>>>   
>>>       
>> As Dave mentioned, there is already a driver known as 'veth'.  Maybe borrow
>> the etun name as well?
>>     
>
> We have already seen that this driver uses ethXXX names for
> its devices and Dave agreed with veth one. Moreover Alexey
> Kuznetsov said that he would prefer the name veth for etun.
>   
Ok, fine by me.  I started reading mail from the wrong direction this 
morning :)
>   
>> I would also like some way to identify veth from other device types,
>> preferably
>> something like a value in sysfs.   However, that should not hold up
>>     
>
> We can do this with ethtool. It can get and print the driver 
> name of the device.
>   
I think I'd like something in sysfs that we could query for any 
interface.  Possible return
strings could be:
VLAN
VETH
ETH
PPP
BRIDGE
AP /* wifi access point interface */
STA /* wifi station */
....

I will cook up a patch for consideration after veth goes in.

>> I think you need at least the option to zero out the time-stamp,
>> otherwise it will
>> not be re-calculated when received on the peer, and it potentially spent
>> significant
>> time since it was last calculated (think netem delay or similar).
>>
>> +        /* Zero out the time-stamp so that receiving code is forced
>> +         * to recalculate it.
>> +         */
>> +        skb->tstamp.off_sec = 0;
>> +        skb->tstamp.off_usec = 0;
>>
>>     
>>> +
>>> +    rcv_priv = netdev_priv(rcv);
>>> +    skb->pkt_type = PACKET_HOST;
>>> +    skb->protocol = eth_type_trans(skb, rcv);
>>> +    if (dev->features & NETIF_F_NO_CSUM)
>>> +        skb->ip_summed = rcv_priv->ip_summed;
>>> +
>>> +    dst_release(skb->dst);
>>> +    skb->dst = NULL;
>>> +    secpath_reset(skb);
>>> +    nf_reset(skb);
>>> +    skb->mark = 0;
>>> +
>>> +    length = skb->len;
>>>   
>>>       
>> This should be done before you do the eth_type_trans, as that pulls the
>> header and your
>> byte counters will be off.
>>     
>
> This will be ETH_HLEN larger, do you mean this? I think this is
> normal as this device tries to look like an "iron" ethernet card :)
>   
For device counters, it should count the number of bytes received, 
including all headers,
but excluding the ethernet FCS.   If an 'iron' card did differently, I'd 
consider it a bug.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com


_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH] Virtual ethernet tunnel (v.2) [message #18828 is a reply to message #18786] Thu, 07 June 2007 16:04 Go to previous messageGo to next message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
Ben Greear wrote:
> Pavel Emelianov wrote:
>> Ben Greear wrote:
>>  
>>> Pavel Emelianov wrote:
>>>    
>>>> Veth stands for Virtual ETHernet. It is a simple tunnel driver
>>>> that works at the link layer and looks like a pair of ethernet
>>>> devices interconnected with each other.
>>>>         
>>> As Dave mentioned, there is already a driver known as 'veth'.  Maybe
>>> borrow
>>> the etun name as well?
>>>     
>>
>> We have already seen that this driver uses ethXXX names for
>> its devices and Dave agreed with veth one. Moreover Alexey
>> Kuznetsov said that he would prefer the name veth for etun.
>>   
> Ok, fine by me.  I started reading mail from the wrong direction this
> morning :)
>>  
>>> I would also like some way to identify veth from other device types,
>>> preferably
>>> something like a value in sysfs.   However, that should not hold up
>>>     
>>
>> We can do this with ethtool. It can get and print the driver name of
>> the device.
>>   
> I think I'd like something in sysfs that we could query for any
> interface.  Possible return
> strings could be:
> VLAN
> VETH
> ETH
> PPP
> BRIDGE
> AP /* wifi access point interface */
> STA /* wifi station */
> ....
> 
> I will cook up a patch for consideration after veth goes in.

OK.

>>> I think you need at least the option to zero out the time-stamp,
>>> otherwise it will
>>> not be re-calculated when received on the peer, and it potentially spent
>>> significant
>>> time since it was last calculated (think netem delay or similar).
>>>
>>> +        /* Zero out the time-stamp so that receiving code is forced
>>> +         * to recalculate it.
>>> +         */
>>> +        skb->tstamp.off_sec = 0;
>>> +        skb->tstamp.off_usec = 0;
>>>
>>>    
>>>> +
>>>> +    rcv_priv = netdev_priv(rcv);
>>>> +    skb->pkt_type = PACKET_HOST;
>>>> +    skb->protocol = eth_type_trans(skb, rcv);
>>>> +    if (dev->features & NETIF_F_NO_CSUM)
>>>> +        skb->ip_summed = rcv_priv->ip_summed;
>>>> +
>>>> +    dst_release(skb->dst);
>>>> +    skb->dst = NULL;
>>>> +    secpath_reset(skb);
>>>> +    nf_reset(skb);
>>>> +    skb->mark = 0;
>>>> +
>>>> +    length = skb->len;
>>>>         
>>> This should be done before you do the eth_type_trans, as that pulls the
>>> header and your
>>> byte counters will be off.
>>>     
>>
>> This will be ETH_HLEN larger, do you mean this? I think this is
>> normal as this device tries to look like an "iron" ethernet card :)
>>   
> For device counters, it should count the number of bytes received,
> including all headers,
> but excluding the ethernet FCS.   If an 'iron' card did differently, I'd
> consider it a bug.

Hmm... The loopback must be doing bad things then. It first calls
eth_type_trans and then accounts for the new skb->len.

> Thanks,
> Ben
> 

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH] Virtual ethernet tunnel (v.2) [message #18846 is a reply to message #18786] Fri, 08 June 2007 16:00 Go to previous messageGo to next message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
Ben Greear wrote:

[snip]

>>> I would also like some way to identify veth from other device types,
>>> preferably
>>> something like a value in sysfs.   However, that should not hold up
>>>     
>>
>> We can do this with ethtool. It can get and print the driver name of
>> the device.
>>   
> I think I'd like something in sysfs that we could query for any
> interface.  Possible return
> strings could be:
> VLAN
> VETH
> ETH
> PPP
> BRIDGE
> AP /* wifi access point interface */
> STA /* wifi station */
> ....
> 
> I will cook up a patch for consideration after veth goes in.
> 

Ben, could you please tell what sysfs features do you
plan to implement?

Thanks,
Pavel
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH] Virtual ethernet tunnel (v.2) [message #18868 is a reply to message #18786] Mon, 11 June 2007 11:42 Go to previous message
Patrick McHardy is currently offline  Patrick McHardy
Messages: 107
Registered: March 2006
Senior Member
Ben Greear wrote:
> Pavel Emelianov wrote:
> 
>>> I would also like some way to identify veth from other device types,
>>> preferably
>>> something like a value in sysfs.   However, that should not hold up
>>>     
>>
>>
>> We can do this with ethtool. It can get and print the driver name of
>> the device.
>>   
> 
> I think I'd like something in sysfs that we could query for any
> interface.  Possible return
> strings could be:
> VLAN
> VETH
> ETH
> PPP
> BRIDGE
> AP /* wifi access point interface */
> STA /* wifi station */
> ....
> 
> I will cook up a patch for consideration after veth goes in.


The rtnl_link API gives you the name of the driver (IFLA_INFO_KIND).

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: Re: [0/1] [patch -mm] Add containerstats (v3)
Next Topic: PATCH -mm] fix create_new_namespaces() return value
Goto Forum:
  


Current Time: Mon Oct 14 20:22:36 GMT 2024

Total time taken to generate the page: 0.05506 seconds