[ovs-dev] [PATCHv2] ofproto-dpif: Expose datapath capability to ovsdb.

William Tu u9012063 at gmail.com
Thu Oct 17 16:27:27 UTC 2019


On Wed, Oct 16, 2019 at 9:36 AM Gregory Rose <gvrose8192 at gmail.com> wrote:
>
>
> On 10/15/2019 2:06 PM, Gregory Rose wrote:
>
>
> On 10/4/2019 3:32 PM, William Tu wrote:
>
> The patch adds support for fetching the datapath's capabilities
> from the result of 'check_support()', and write the supported capability
> to a new database column, called 'capabilities' under Datapath table.
>
> To see how it works, run:
>   # ovs-vsctl -- add-br br0 -- set Bridge br0 datapath_type=netdev
>   # ovs-vsctl -- --id=@m create Datapath datapath_version=0 \
>       'ct_zones={}' 'capabilities={}' \
>       -- set Open_vSwitch . datapaths:"netdev"=@m
>
>   # ovs-vsctl list-dp-cap netdev
>   ufid=true sample_nesting=true clone=true tnl_push_pop=true \
>   ct_orig_tuple=true ct_eventmask=true ct_state=true \
>   ct_clear=true max_vlan_headers=1 recirc=true ct_label=true \
>   max_hash_alg=1 ct_state_nat=true ct_timeout=true \
>   ct_mark=true ct_orig_tuple6=true check_pkt_len=true \
>   masked_set_action=true max_mpls_depth=3 trunc=true ct_zone=true
>
> Tested-at: https://travis-ci.org/williamtu/ovs-travis/builds/593749381
> Signed-off-by: William Tu <u9012063 at gmail.com>
>
>
> Patch works as advertised and the code looks fine to me.
>
> Tested-by: Greg Rose <gvrose8192 at gmail.com>
> Reviewed-by: Greg Rose <gvrose8192 at gmail.com>
>
>
> I have to take this back.  While doing other work I found that this patch has an issue on 32bit
> architecture:
>
> ofproto/ofproto-dpif.c: In function ‘get_datapath_cap’:
>
> ofproto/ofproto-dpif.c:5458:27: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Werror=format=]
>
>      str_value = xasprintf("%lu", odp.max_vlan_headers);
>
>                            ^
>
> ofproto/ofproto-dpif.c:5462:27: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Werror=format=]
>
>      str_value = xasprintf("%lu", odp.max_mpls_depth);
>
>                            ^
>
> ofproto/ofproto-dpif.c:5485:27: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Werror=format=]
>
>      str_value = xasprintf("%lu", s.max_hash_alg);
>
> You'll need to fixup your formatting there.  I don't give 32 bit architectures all the attention I should but I suppose they're
> still in use.
>

Thanks Greg!

I kept making the same mistake. I will fix it next version.

William


More information about the dev mailing list