diff mbox

[ovs-dev,1/3] lib: Use nl_attr_get_odp_port().

Message ID 20161111130109.GC31511@penelope.isobedori.kobe.vergenet.net
State Not Applicable
Headers show

Commit Message

Simon Horman Nov. 11, 2016, 1:01 p.m. UTC
Hi Joe,

On Wed, Nov 09, 2016 at 05:00:20PM -0800, Joe Stringer wrote:
> This helper is a little tidier than the alternative. Use it treewide.
> 
> Signed-off-by: Joe Stringer <joe@ovn.org>
> ---
>  lib/dpif-netdev.c            | 2 +-
>  lib/odp-util.c               | 2 +-
>  ofproto/ofproto-dpif-sflow.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

This looks good to me but I think you forgot one place where this change seems
appropriate:

Comments

Joe Stringer Nov. 14, 2016, 9:29 p.m. UTC | #1
On 11 November 2016 at 05:01, Simon Horman <simon.horman@netronome.com> wrote:
> Hi Joe,
>
> On Wed, Nov 09, 2016 at 05:00:20PM -0800, Joe Stringer wrote:
>> This helper is a little tidier than the alternative. Use it treewide.
>>
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>> ---
>>  lib/dpif-netdev.c            | 2 +-
>>  lib/odp-util.c               | 2 +-
>>  ofproto/ofproto-dpif-sflow.c | 2 +-
>>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> This looks good to me but I think you forgot one place where this change seems
> appropriate:
>
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 66ba2c02b3f8..ab95952611d1 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -4425,7 +4425,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
>      case OVS_ACTION_ATTR_TUNNEL_POP:
>          if (*depth < MAX_RECIRC_DEPTH) {
>              struct dp_packet_batch *orig_packets_ = packets_;
> -            odp_port_t portno = u32_to_odp(nl_attr_get_u32(a));
> +            odp_port_t portno = nl_attr_get_odp_port(a);
>
>              p = pmd_tx_port_cache_lookup(pmd, portno);
>              if (p) {

Ah, good catch. I sent v2.
diff mbox

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 66ba2c02b3f8..ab95952611d1 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4425,7 +4425,7 @@  dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
     case OVS_ACTION_ATTR_TUNNEL_POP:
         if (*depth < MAX_RECIRC_DEPTH) {
             struct dp_packet_batch *orig_packets_ = packets_;
-            odp_port_t portno = u32_to_odp(nl_attr_get_u32(a));
+            odp_port_t portno = nl_attr_get_odp_port(a);
 
             p = pmd_tx_port_cache_lookup(pmd, portno);
             if (p) {