[vpp-dev] packed enums

2020-05-02 Thread Christian Hopps
Some recent changes related to packed enums in the API have broken already 
written code for low level API use. I think the main commit that did this was 
the one that added __packed__ to the generated enum declaration, but there are 
the related changes that add the enum size declarations I guess. Those appear 
to be percolating slowly (e.g., in ip_types.api), although version numbers are 
not being changed inline (e.g., "enum address_family" went from default u32 to 
u8 but the ip_types.api version didn't change)

I understand that the API needs to be able to change, but I'm using like maybe 
7 or 8 API calls and I now have conditional code for seemingly every release 
since 19.04. It's frustrating.

The project encourages running the latest code by moving support away from old 
releases quickly, but then is making it hard to follow with API churn.

That said I would not be being bitten by this particular change I think if I 
were using the higher level API; however, I have resisted this b/c that API 
with synchronous calls requiring a callback for results is ... inelegant, to 
put it nicely. :)

Thanks,
Chris.-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16220): https://lists.fd.io/g/vpp-dev/message/16220
Mute This Topic: https://lists.fd.io/mt/73933468/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] ACL question

2020-05-02 Thread Neale Ranns via lists.fd.io


From: Govindarajan Mohandoss 
Date: Friday 1 May 2020 at 21:15
To: "Neale Ranns (nranns)" , Andrew Yourtchenko 

Cc: "John Lo (loj)" , Paul Vinciguerra 
, "vpp-dev@lists.fd.io" , nd 
, Lijian Zhang , Jieqiang Wang 
, nd 
Subject: RE: [vpp-dev] ACL question

Hi Neale,
  I tried to use the CLI for ACL in master. But the following command is not 
associating the ACL to ingress interface.
 Show command is not listing anything and “show run time” doesn’t show the ACL 
node.
  Am I missing any config ?

vpp# set acl-plugin acl permit+reflect src 192.81.1.1/32 dst 192.82.1.1/32 
proto 17 sport 100 dport 1
ACL index:0
vpp# show acl-plugin acl
acl-index 0 count 1 tag {cli}
  0: ipv4 permit+reflect src 192.81.1.1/32 dst 192.82.1.1/32 proto 17 
sport 100 dport 1
vpp# set acl-plugin ?
  set acl-plugin acl   set acl-plugin acl  src 
 dst  proto X sport X-Y dport X-Y [tag FOO] {use comma 
separated list for multiple rules}
  set acl-plugin interface set acl-plugin interface  
  [del]
  set acl-plugin   set acl-plugin session timeout {{udp 
idle}|tcp {idle|transient}} 
vpp# set acl-plugin interface TenGigabitEthernet7/0/0 input 0

you have to specify which ACL you want to bind to the interface:
 set acl-plugin interface TenGigabitEthernet7/0/0 input 0 acl 0

/neale

vpp# show acl-plugin interface   <<< No output.

Thanks
Govind

From: Neale Ranns (nranns) 
Sent: Wednesday, April 29, 2020 4:24 AM
To: Andrew Yourtchenko ; Govindarajan Mohandoss 

Cc: John Lo (loj) ; Paul Vinciguerra 
; vpp-dev@lists.fd.io; nd ; Lijian 
Zhang ; Jieqiang Wang 
Subject: Re: [vpp-dev] ACL question


Or in the latest version you can create ACLs on the CLI:
  set acl-plugin acl ?
  set acl-plugin interface ?

/neale

From: mailto:vpp-dev@lists.fd.io>> on behalf of Andrew 
Yourtchenko mailto:ayour...@gmail.com>>
Date: Wednesday 29 April 2020 at 10:59
To: Govindarajan Mohandoss 
mailto:govindarajan.mohand...@arm.com>>
Cc: "John Lo (loj)" mailto:l...@cisco.com>>, Paul Vinciguerra 
mailto:pvi...@vinciconsulting.com>>, 
"vpp-dev@lists.fd.io" 
mailto:vpp-dev@lists.fd.io>>, nd 
mailto:n...@arm.com>>, Lijian Zhang 
mailto:lijian.zh...@arm.com>>, Jieqiang Wang 
mailto:jieqiang.w...@arm.com>>
Subject: Re: [vpp-dev] ACL question

Hi Govind,

1) make an api trace and inspect the message there - whether it contains the 
entries you are expecting.

1a) If it does, then you can trivially recreate the same message using the 
python api just by hacking an existing testcase.

1b) if it doesn’t - run the vat itself under gdb and trace how the api message 
is built before it’s sent. I suspect what you are seeing is some issue between 
the command line that you are putting in and the api message being formed.

Also, it may give more clues if you do the above side by side on x86 and arm 
and compare the behaviors.

--a

On 29 Apr 2020, at 06:27, Govindarajan Mohandoss 
mailto:govindarajan.mohand...@arm.com>> wrote:
Hi Andrew,
   I have to work on make test test case. Before that, I would like to confirm 
whether this is a problem (or) misconfiguration.
   I added 50 rules using acl_add_replace in VAT CLI.  In the ACL dump (show 
acl-plugin acl 0), only 48 rules are present. 2 rules are missing and a default 
rule of “permit all” is also getting added.
   I have put the ACL config and ACL dump info in the attached file.


Thanks
Govind

From: John Lo (loj) mailto:l...@cisco.com>>
Sent: Tuesday, April 28, 2020 10:38 PM
To: Govindarajan Mohandoss 
mailto:govindarajan.mohand...@arm.com>>; Paul 
Vinciguerra mailto:pvi...@vinciconsulting.com>>
Cc: Andrew 👽 Yourtchenko mailto:ayour...@gmail.com>>; 
vpp-dev@lists.fd.io; nd 
mailto:n...@arm.com>>; Lijian Zhang 
mailto:lijian.zh...@arm.com>>; Jieqiang Wang 
mailto:jieqiang.w...@arm.com>>; nd 
mailto:n...@arm.com>>
Subject: RE: [vpp-dev] ACL question

Try “make test TEST=acl_plugin”.   -John

From: vpp-dev@lists.fd.io 
mailto:vpp-dev@lists.fd.io>> On Behalf Of Govindarajan 
Mohandoss
Sent: Tuesday, April 28, 2020 11:22 PM
To: Paul Vinciguerra 
mailto:pvi...@vinciconsulting.com>>
Cc: Andrew 👽 Yourtchenko mailto:ayour...@gmail.com>>; 
vpp-dev@lists.fd.io; nd 
mailto:n...@arm.com>>; Lijian Zhang 
mailto:lijian.zh...@arm.com>>; Jieqiang Wang 
mailto:jieqiang.w...@arm.com>>; nd 
mailto:n...@arm.com>>
Subject: Re: [vpp-dev] ACL question

Hi Paul,
  How can I selectively run only the test_acl_plugin.py instead of running make 
test ?

Thanks
Govind

From: Paul Vinciguerra 
mailto:pvi...@vinciconsulting.com>>
Sent: Tuesday, April 28, 2020 9:22 PM
To: Govindarajan Mohandoss 
mailto:govindarajan.mohand...@arm.com>>
Cc: Andrew 👽 Yourtchenko mailto:ayour...@gmail.com>>; 
vpp-dev@lists.fd.io; nd 
mailto:n...@arm.com>>; Lijian Zhang 
mailto:lijian.zh...@arm.com>>; Jieqiang Wang 
mailto:jieqiang.w...@arm.com>>
Subject: Re: [vpp-dev] ACL

bug in api generation [Re: [vpp-dev] packed enums]

2020-05-02 Thread Christian Hopps
The fallout is a bit worse than first anticipated.

I converted my code to use the vl_api_*_t_endian functions rather than doing 
the hton*/ntoh* by hand (since a bunch of them were now doing the wrong thing), 
and discovered another bigger problem. Unions are not handled correctly by the 
generated endian functions e.g.,:

static inline void vl_api_punt_t_endian (vl_api_punt_t *a)
{
int i __attribute__((unused));
vl_api_punt_type_t_endian(&a->type);
vl_api_punt_union_t_endian(&a->punt);
}

static inline void vl_api_punt_union_t_endian (vl_api_punt_union_t *a)
{
int i __attribute__((unused));
vl_api_punt_exception_t_endian(&a->exception);
vl_api_punt_l4_t_endian(&a->l4);
vl_api_punt_ip_proto_t_endian(&a->ip_proto);
}

The second function there is flipping bits in the same memory space (union) 
multiple times in different ways according to each structure in the union.

Anything that has a union in the API will suffer this same bug; the recent enum 
size changes to very common types (address family, ip proto, etc) merely cause 
this bug to be hit more ofetn.

Thanks,
Chris.

> On May 2, 2020, at 8:20 AM, Christian Hopps  wrote:
> 
> Some recent changes related to packed enums in the API have broken already 
> written code for low level API use. I think the main commit that did this was 
> the one that added __packed__ to the generated enum declaration, but there 
> are the related changes that add the enum size declarations I guess. Those 
> appear to be percolating slowly (e.g., in ip_types.api), although version 
> numbers are not being changed inline (e.g., "enum address_family" went from 
> default u32 to u8 but the ip_types.api version didn't change)
> 
> I understand that the API needs to be able to change, but I'm using like 
> maybe 7 or 8 API calls and I now have conditional code for seemingly every 
> release since 19.04. It's frustrating.
> 
> The project encourages running the latest code by moving support away from 
> old releases quickly, but then is making it hard to follow with API churn.
> 
> That said I would not be being bitten by this particular change I think if I 
> were using the higher level API; however, I have resisted this b/c that API 
> with synchronous calls requiring a callback for results is ... inelegant, to 
> put it nicely. :)
> 
> Thanks,
> Chris.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16222): https://lists.fd.io/g/vpp-dev/message/16222
Mute This Topic: https://lists.fd.io/mt/73940014/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] route lookup api

2020-05-02 Thread Christian Hopps
I was able to do a minimal test on it so I submitted, but please review as 
well. :)

https://gerrit.fd.io/r/c/vpp/+/26829

Thanks,
Chris.

> On Apr 28, 2020, at 12:08 PM, Jon Loeliger via lists.fd.io 
>  wrote:
> 
> Chris,
> 
> If you can shoot me the patch, as is, I will rebase and submit it?
> 
> jdl
> 
> 
> On Mon, Apr 27, 2020 at 7:27 PM Dave Wallace  wrote:
> Gentle reminder that the VPP 20.05 API freeze is next Wed, May 6, 2020, so 
> please don't delay to long if this is required for 20.05.
> 
> Thanks,
> -daw- (wearing the friendly VPP release manager hat)
> 
> On 4/27/2020 5:02 PM, Christian Hopps wrote:
>>> On Apr 27, 2020, at 11:44 AM, Jon Loeliger via lists.fd.io 
>>> 
>>>  wrote:
>>> 
>>> 
>>> 
>>> On Wed, Feb 19, 2020 at 4:47 AM Christian Hopps 
>>> 
>>>  wrote:
>>> 
>>> 
 On Feb 19, 2020, at 2:02 AM, Neale Ranns via Lists.Fd.Io 
 
  wrote:
 

 Hi Chris,

 Adding an API to dump a single route would be a welcome addition to the 
 API.
 
>>> Ok, I'll do that then.
>>> 
>>> Hey Chris,
>>> 
>>> Did you ever get this API enhancement written?  If so, is there a Gerrit 
>>> for it?
>>> 
>> I have this written/tested, but it lives in my 19.08 (product) branch right 
>> now. I might have near the end of the week to cherry pick it to master and 
>> test it there.
>> 
>> Thanks,
>> Chris.
>> 
>> 
>>> Thanks,
>>> jdl
>>> 
>>> 
>>> 
>> 
>> 
> 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#16223): https://lists.fd.io/g/vpp-dev/message/16223
Mute This Topic: https://lists.fd.io/mt/71382541/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-