Hi Jon,

> So I was reading src/vnet/api_errno.h, as you do, and I noticed
> this weird line:
> 
>     _(IN_PROGRESS, 10, "Operation in progress")                             \
> 
> That's right, an error number that is positive.  It just doesn't sound 
> right...
> And I don't think it is simply missing a negative sign as there is also this 
> line:
> 
>     _(INVALID_SW_IF_INDEX_2, -10, "Invalid sw_if_index #2")                 \
> 
> So, digging some:
> 
> jdl $ git grep VNET_API_ERROR_IN_PROGRESS
> src/plugins/nat/nat_ha.c:    return VNET_API_ERROR_IN_PROGRESS;
> 
> Which is here:
> 
>     int
>     nat44_ha_resync (u32 client_index, u32 pid,
>                      nat_ha_resync_event_cb_t event_callback)
>     {
>       nat_ha_main_t *ha = &nat_ha_main;
>       snat_main_t *sm = &snat_main;
>       snat_session_t *ses;
>       snat_main_per_thread_data_t *tsm;
> 
>       if (ha->in_resync)
>         return VNET_API_ERROR_IN_PROGRESS;
> 
> But then this too:
> 
>     jdl $ git grep nat44_ha_resync
>     src/plugins/nat/nat_ha.c:nat44_ha_resync (u32 client_index, u32 pid,
> 
> So it appears that it may not even be being used...?
> 
> Can anyone shed some light here?

I guess the purpose of a positive value is to indicate that you can try again 
with the same arguments and get a different response,
as opposed to a negative value.

I would be in favour of removing that error from api_errno.h.
Especially for these corner cases I'd much rather want a documented separate 
error number space for the module / message.

Best regards,
Ole





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

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

Reply via email to