On Tue, May 17, 2016 at 4:41 PM, Jesse Gross <[email protected]> wrote:
> On Tue, May 10, 2016 at 10:30 AM, Pravin B Shelar <[email protected]> wrote:
>> This function can be used to build varius tunnel headers.
>
> "various"
>
ok.

>> diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
>> index 2e181f2..375713a 100644
>> --- a/lib/netdev-native-tnl.c
>> +++ b/lib/netdev-native-tnl.c
>> +eth_build_header(struct ovs_action_push_tnl *data,
>> +                 uint16_t eth_proto,
>> +                 const struct eth_addr dmac,
>> +                 const struct eth_addr smac,
>>                   unsigned int *hlen)
>>  {
>> -    struct ip_header *ip;
>> -    struct ovs_16aligned_ip6_hdr *ip6;
>> -    struct udp_header *udp;
>> -    bool is_ipv6;
>> +    struct eth_header *eth;
>> +
>> +    /* Build Ethernet and IP headers. */
>> +    memset(data->header, 0, sizeof data->header);
>
> I guess this comment doesn't really apply any more.
>
ok.

>> -    is_ipv6 = netdev_tnl_is_header_ipv6(data->header);
>> +void *
>> +netdev_tnl_ip_build_header(struct ovs_action_push_tnl *data,
>> +                           const struct flow *tnl_flow,
>> +                           uint8_t next_proto,
>> +                           unsigned int *hlen,
>> +                           const struct eth_addr dmac,
>> +                           const struct eth_addr smac,
>> +                           const struct in6_addr *src,
>> +                           bool *is_ipv6)
> [...]
>> +    } else {
>> +        struct ovs_16aligned_ip6_hdr *ip6;
>> +
>> +        ip6 = (struct ovs_16aligned_ip6_hdr *) l3;
>> +
>> +        ip6->ip6_vfc = 0x60;
>
> I realize that this is a problem in the original code but it looks
> like this doesn't set the traffic class - we should be able to set
> this to tnl_flow->tunnel.ip_tos, the same as IPv4.
>
I will post another patch to fix it.

>> diff --git a/lib/netdev.h b/lib/netdev.h
>> index a292167..2c76966 100644
>> --- a/lib/netdev.h
>> +++ b/lib/netdev.h
>> @@ -154,7 +154,10 @@ int netdev_send(struct netdev *, int qid, struct 
>> dp_packet_batch *,
>>  void netdev_send_wait(struct netdev *, int qid);
>>
>>  int netdev_build_header(const struct netdev *, struct ovs_action_push_tnl 
>> *data,
>> -                        const struct flow *tnl_flow);
>> +                        const struct flow *tnl_flow,
>> +                        const struct eth_addr dmac,
>> +                        const struct eth_addr smac,
>> +                        const struct in6_addr *src);
>
> Should we turn these arguments into a struct? It's pretty unwieldy
> passing them all around through different functions.

ok.
I am working on comments on rest of series. Meanwhile this patch is
general improvement. So I will post updated patch as separate series.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to