rocker: Provide offload indication using nexthop flags
authorIdo Schimmel <idosch@mellanox.com>
Wed, 2 Aug 2017 07:56:02 +0000 (09:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Aug 2017 00:00:23 +0000 (17:00 -0700)
We want to stop using the FIB info's flags to provide the offlaod
indication and instead do that on a per-nexthop basis.

Convert rocker to do just that. It only supports one nexthop per-route,
so conversion is simple.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/rocker/rocker_ofdpa.c

index 600e30e8f0be3156b764fdc7c762504cb74bab7a..da4e26b53a5242a66f17714a901e0ee48e7f0d11 100644 (file)
@@ -2761,7 +2761,7 @@ static int ofdpa_fib4_add(struct rocker *rocker,
                                  fen_info->tb_id, 0);
        if (err)
                return err;
-       fib_info_offload_inc(fen_info->fi);
+       fen_info->fi->fib_nh->nh_flags |= RTNH_F_OFFLOAD;
        return 0;
 }
 
@@ -2776,7 +2776,7 @@ static int ofdpa_fib4_del(struct rocker *rocker,
        ofdpa_port = ofdpa_port_dev_lower_find(fen_info->fi->fib_dev, rocker);
        if (!ofdpa_port)
                return 0;
-       fib_info_offload_dec(fen_info->fi);
+       fen_info->fi->fib_nh->nh_flags &= ~RTNH_F_OFFLOAD;
        return ofdpa_port_fib_ipv4(ofdpa_port, htonl(fen_info->dst),
                                   fen_info->dst_len, fen_info->fi,
                                   fen_info->tb_id, OFDPA_OP_FLAG_REMOVE);
@@ -2803,7 +2803,7 @@ static void ofdpa_fib4_abort(struct rocker *rocker)
                                                       rocker);
                if (!ofdpa_port)
                        continue;
-               fib_info_offload_dec(flow_entry->fi);
+               flow_entry->fi->fib_nh->nh_flags &= ~RTNH_F_OFFLOAD;
                ofdpa_flow_tbl_del(ofdpa_port, OFDPA_OP_FLAG_REMOVE,
                                   flow_entry);
        }