On 11/27/2019 5:27 PM, Marcelo Ricardo Leitner wrote:
> On Wed, Nov 27, 2019 at 02:55:14PM +0200, Roi Dayan wrote:
>> From: Paul Blakey <[email protected]>
>>
>> Changelog:
>> V1->V2:
>>      Missing ntohs/htons on nat port range.
>>
>> Signed-off-by: Paul Blakey <[email protected]>
>> ---
>>   lib/netdev-offload-tc.c | 104 
>> ++++++++++++++++++++++++++++++++++++++++++++++++
>>   lib/tc.c                |  91 ++++++++++++++++++++++++++++++++++++++++++
>>   lib/tc.h                |  24 +++++++++++
>>   3 files changed, 219 insertions(+)
>>
>> diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
>> index 2b4ecfb9ca48..3a9b9e144311 100644
>> --- a/lib/netdev-offload-tc.c
>> +++ b/lib/netdev-offload-tc.c
>> @@ -814,6 +814,40 @@ parse_tc_flower_to_match(struct tc_flower *flower,
>>                       ct_label->mask = action->ct.label_mask;
>>                   }
>>   
>> +                if (action->ct.nat_type) {
>> +                    size_t nat_offset = nl_msg_start_nested(buf,
>> +                                                            
>> OVS_CT_ATTR_NAT);
>> +
>> +                    if (action->ct.nat_type == TC_NAT_SRC) {
>> +                        nl_msg_put_flag(buf, OVS_NAT_ATTR_SRC);
>> +                    } else if (action->ct.nat_type == TC_NAT_DST) {
>> +                        nl_msg_put_flag(buf, OVS_NAT_ATTR_DST);
>> +                    }
>> +
>> +                    if (action->ct.range.ip_family == AF_INET) {
>> +                        nl_msg_put_be32(buf, OVS_NAT_ATTR_IP_MIN,
>                                                          ^^^^^^^^^^^
>> +                                        action->ct.range.min_addr.ipv4);
>                                                              ^^^^^^^^
>
> Sorry, more bikeshedding here.
> OVS seems to use _MIN and _MAX as suffix, and tc act ct also uses it
> that way: TCA_CT_NAT_IPV4_MIN, etc.
>
> I'm wondering, should we do the same for tc_action members here?
>
Sure, will do.

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to