On Fri, May 26, 2017 at 12:37:14PM +0000, Kavanagh, Mark B wrote:
> 
> >From: ovs-dev-boun...@openvswitch.org 
> >[mailto:ovs-dev-boun...@openvswitch.org] On Behalf Of
> >Ilya Maximets
> >Sent: Friday, May 19, 2017 2:38 PM
> >To: d...@openvswitch.org; Daniele Di Proietto <diproiet...@ovn.org>; Darrell 
> >Ball
> ><db...@vmware.com>
> >Cc: Ilya Maximets <i.maxim...@samsung.com>; Heetae Ahn 
> ><heetae82....@samsung.com>
> >Subject: [ovs-dev] [PATCH v4 3/3] netdev-dpdk: Use uint8_t for port_id.
> >
> >Currently, signed integer is used for 'port_id' variable and
> >'-1' as identifier of bad or uninitialized 'port_id'.
> >
> >This inconsistent with dpdk library and, also, in few cases,
> >leads to passing '-1' to dpdk functions where uint8_t expected.
> >
> >Such behaviour doesn't produce any issues, but it's better to
> >use same type as in dpdk library for consistency.
> >Introduced 'dpdk_port_t' typedef for better maintainability.
> >
> >Also, magic number '-1' replaced with DPDK_ETH_PORT_ID_INVALID
> >macro.
> >
> >Signed-off-by: Ilya Maximets <i.maxim...@samsung.com>
> 
> Hi Ilya,
> 
> Darrell has pretty much covered any concerns that I had with these changes in 
> his comments on V3.
> 
> On initial reading of V4, I found 'dpdk_port_t' slightly non-intuitive; 
> however, having read your rationale for this typedef, and given that it 
> adheres to existing port ID conventions, I'm happy with this change.
> I also like the introduction of 'DPDK_ETH_PORT_ID_INVALID'.
> 
> I've also conducted the following sanity checks on the patch, and found no 
> issues:
>  - checkpatch.py
>  - compilation with clang
>  - compilation with gcc
>  - sparse
>  - make check (no additional tests fail after application of this patch)
> 
> Acked-by: Mark Kavanagh <mark.b.kavan...@intel.com>

Thanks Ilya and Mark.

I'd tend to go for a new "DPDK_PORT_FMT" macro, like this:
        #define DPDK_PORT_FMT PRIu8
to better abstract dpdk_port_t for use in printf() contexts.

However, this patch makes sense to me anyway, so I applied this to
master.

Thanks,

Ben.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to