diff mbox

[ovs-dev,v4,4/4] tests: Set default max_vlan_headers

Message ID 20160712153857.3559-5-shaw.leon@gmail.com
State Changes Requested
Headers show

Commit Message

Xiao Liang July 12, 2016, 3:38 p.m. UTC
Set default max_vlan_headers of test-odp and dpif-netdev to SIZE_MAX

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
---
 lib/dpif-netdev.c | 1 +
 tests/test-odp.c  | 1 +
 2 files changed, 2 insertions(+)

Comments

Thomas F Herbert July 15, 2016, 12:20 p.m. UTC | #1
On 7/12/16 11:38 AM, Xiao Liang wrote:
> Set default max_vlan_headers of test-odp and dpif-netdev to SIZE_MAX
>
> Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
> ---
>   lib/dpif-netdev.c | 1 +
>   tests/test-odp.c  | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 26cfaff..13c10f6 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -90,6 +90,7 @@ static struct shash dp_netdevs OVS_GUARDED_BY(dp_netdev_mutex)
>   static struct vlog_rate_limit upcall_rl = VLOG_RATE_LIMIT_INIT(600, 600);
>
>   static struct odp_support dp_netdev_support = {
> +    .max_vlan_headers = SIZE_MAX,
>       .max_mpls_depth = SIZE_MAX,
I realize that this is just a test but max MPLS depth is 3 but max vlan 
depth is 2. Should both these be set to the same value?
>       .recirc = true,
>   };
> diff --git a/tests/test-odp.c b/tests/test-odp.c
> index 8e4db09..735f2ff 100644
> --- a/tests/test-odp.c
> +++ b/tests/test-odp.c
> @@ -62,6 +62,7 @@ parse_keys(bool wc_keys)
>                       .ct_zone = true,
>                       .ct_mark = true,
>                       .ct_label = true,
> +                    .max_vlan_headers = SIZE_MAX,
>                   },
>               };
>
>
Xiao Liang July 15, 2016, 1:18 p.m. UTC | #2
On Fri, Jul 15, 2016 at 8:20 PM, Thomas F Herbert
<thomasfherbert@gmail.com> wrote:
> On 7/12/16 11:38 AM, Xiao Liang wrote:
>>
>> Set default max_vlan_headers of test-odp and dpif-netdev to SIZE_MAX
>>
>> Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
>> ---
>>   lib/dpif-netdev.c | 1 +
>>   tests/test-odp.c  | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>> index 26cfaff..13c10f6 100644
>> --- a/lib/dpif-netdev.c
>> +++ b/lib/dpif-netdev.c
>> @@ -90,6 +90,7 @@ static struct shash dp_netdevs
>> OVS_GUARDED_BY(dp_netdev_mutex)
>>   static struct vlog_rate_limit upcall_rl = VLOG_RATE_LIMIT_INIT(600,
>> 600);
>>
>>   static struct odp_support dp_netdev_support = {
>> +    .max_vlan_headers = SIZE_MAX,
>>       .max_mpls_depth = SIZE_MAX,
>
> I realize that this is just a test but max MPLS depth is 3 but max vlan
> depth is 2. Should both these be set to the same value?

I see your kernel patch is going to support 2 VLAN headers. Do you
have any special consideration why it should be the same value as
MPLS?

>
>>       .recirc = true,
>>   };
>> diff --git a/tests/test-odp.c b/tests/test-odp.c
>> index 8e4db09..735f2ff 100644
>> --- a/tests/test-odp.c
>> +++ b/tests/test-odp.c
>> @@ -62,6 +62,7 @@ parse_keys(bool wc_keys)
>>                       .ct_zone = true,
>>                       .ct_mark = true,
>>                       .ct_label = true,
>> +                    .max_vlan_headers = SIZE_MAX,
>>                   },
>>               };
>>
>>
>
Thomas F Herbert July 15, 2016, 2:51 p.m. UTC | #3
On 7/15/16 9:18 AM, Xiao Liang wrote:
> On Fri, Jul 15, 2016 at 8:20 PM, Thomas F Herbert
> <thomasfherbert@gmail.com> wrote:
>> On 7/12/16 11:38 AM, Xiao Liang wrote:
>>> Set default max_vlan_headers of test-odp and dpif-netdev to SIZE_MAX
>>>
>>> Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
>>> ---
>>>    lib/dpif-netdev.c | 1 +
>>>    tests/test-odp.c  | 1 +
>>>    2 files changed, 2 insertions(+)
>>>
>>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>>> index 26cfaff..13c10f6 100644
>>> --- a/lib/dpif-netdev.c
>>> +++ b/lib/dpif-netdev.c
>>> @@ -90,6 +90,7 @@ static struct shash dp_netdevs
>>> OVS_GUARDED_BY(dp_netdev_mutex)
>>>    static struct vlog_rate_limit upcall_rl = VLOG_RATE_LIMIT_INIT(600,
>>> 600);
>>>
>>>    static struct odp_support dp_netdev_support = {
>>> +    .max_vlan_headers = SIZE_MAX,
>>>        .max_mpls_depth = SIZE_MAX,
>> I realize that this is just a test but max MPLS depth is 3 but max vlan
>> depth is 2. Should both these be set to the same value?
> I see your kernel patch is going to support 2 VLAN headers. Do you
> have any special consideration why it should be the same value as
> MPLS?
No, it should not be the same value as MPLS. MPLS is supported with a 
max depth of 3 in OVS but 802.1ad has a max depth of 2 by spec. In your 
patch of the actual code you handle that correctly and I commented on 
that elsewhere. My comment above is limited to this test.
>
>>>        .recirc = true,
>>>    };
>>> diff --git a/tests/test-odp.c b/tests/test-odp.c
>>> index 8e4db09..735f2ff 100644
>>> --- a/tests/test-odp.c
>>> +++ b/tests/test-odp.c
>>> @@ -62,6 +62,7 @@ parse_keys(bool wc_keys)
>>>                        .ct_zone = true,
>>>                        .ct_mark = true,
>>>                        .ct_label = true,
>>> +                    .max_vlan_headers = SIZE_MAX,
>>>                    },
>>>                };
>>>
>>>
Xiao Liang July 15, 2016, 3:20 p.m. UTC | #4
On Fri, Jul 15, 2016 at 10:51 PM, Thomas F Herbert
<thomasfherbert@gmail.com> wrote:
> On 7/15/16 9:18 AM, Xiao Liang wrote:
>>
>> On Fri, Jul 15, 2016 at 8:20 PM, Thomas F Herbert
>> <thomasfherbert@gmail.com> wrote:
>>>
>>> On 7/12/16 11:38 AM, Xiao Liang wrote:
>>>>
>>>> Set default max_vlan_headers of test-odp and dpif-netdev to SIZE_MAX
>>>>
>>>> Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
>>>> ---
>>>>    lib/dpif-netdev.c | 1 +
>>>>    tests/test-odp.c  | 1 +
>>>>    2 files changed, 2 insertions(+)
>>>>
>>>> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
>>>> index 26cfaff..13c10f6 100644
>>>> --- a/lib/dpif-netdev.c
>>>> +++ b/lib/dpif-netdev.c
>>>> @@ -90,6 +90,7 @@ static struct shash dp_netdevs
>>>> OVS_GUARDED_BY(dp_netdev_mutex)
>>>>    static struct vlog_rate_limit upcall_rl = VLOG_RATE_LIMIT_INIT(600,
>>>> 600);
>>>>
>>>>    static struct odp_support dp_netdev_support = {
>>>> +    .max_vlan_headers = SIZE_MAX,
>>>>        .max_mpls_depth = SIZE_MAX,
>>>
>>> I realize that this is just a test but max MPLS depth is 3 but max vlan
>>> depth is 2. Should both these be set to the same value?
>>
>> I see your kernel patch is going to support 2 VLAN headers. Do you
>> have any special consideration why it should be the same value as
>> MPLS?
>
> No, it should not be the same value as MPLS. MPLS is supported with a max
> depth of 3 in OVS but 802.1ad has a max depth of 2 by spec. In your patch of
> the actual code you handle that correctly and I commented on that elsewhere.
> My comment above is limited to this test.
>

I'm a bit confused here. Are you talking about SIZE_MAX? This value
just tells the capability of datapath, and in odp_flow_key_from_flow__
in the patch:
    max_vlan_headers = MIN(parms->support.max_vlan_headers,
FLOW_MAX_VLAN_HEADERS);

So the actual max_vlan_headers is 2.
diff mbox

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 26cfaff..13c10f6 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -90,6 +90,7 @@  static struct shash dp_netdevs OVS_GUARDED_BY(dp_netdev_mutex)
 static struct vlog_rate_limit upcall_rl = VLOG_RATE_LIMIT_INIT(600, 600);
 
 static struct odp_support dp_netdev_support = {
+    .max_vlan_headers = SIZE_MAX,
     .max_mpls_depth = SIZE_MAX,
     .recirc = true,
 };
diff --git a/tests/test-odp.c b/tests/test-odp.c
index 8e4db09..735f2ff 100644
--- a/tests/test-odp.c
+++ b/tests/test-odp.c
@@ -62,6 +62,7 @@  parse_keys(bool wc_keys)
                     .ct_zone = true,
                     .ct_mark = true,
                     .ct_label = true,
+                    .max_vlan_headers = SIZE_MAX,
                 },
             };