mlxsw: reg: Give mlxsw_reg_ratr_pack a type parameter
authorPetr Machata <petrm@mellanox.com>
Sat, 2 Sep 2017 21:49:15 +0000 (23:49 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Sep 2017 03:23:25 +0000 (20:23 -0700)
To support IPIP, the driver needs to be able to construct an IPIP
adjacency. Change mlxsw_reg_ratr_pack to take an adjacency type as an
argument. Adjust the one existing caller.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-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/mellanox/mlxsw/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

index d80cf9b..cc27c5d 100644 (file)
@@ -4483,11 +4483,13 @@ MLXSW_ITEM32(reg, ratr, ipip_ipv6_ptr, 0x1C, 0, 24);
 static inline void
 mlxsw_reg_ratr_pack(char *payload,
                    enum mlxsw_reg_ratr_op op, bool valid,
+                   enum mlxsw_reg_ratr_type type,
                    u32 adjacency_index, u16 egress_rif)
 {
        MLXSW_REG_ZERO(ratr, payload);
        mlxsw_reg_ratr_op_set(payload, op);
        mlxsw_reg_ratr_v_set(payload, valid);
+       mlxsw_reg_ratr_type_set(payload, type);
        mlxsw_reg_ratr_adjacency_index_low_set(payload, adjacency_index);
        mlxsw_reg_ratr_adjacency_index_high_set(payload, adjacency_index >> 16);
        mlxsw_reg_ratr_egress_router_interface_set(payload, egress_rif);
index 3ddfbe3..4e47d45 100644 (file)
@@ -1928,7 +1928,8 @@ static int mlxsw_sp_nexthop_mac_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
        char ratr_pl[MLXSW_REG_RATR_LEN];
 
        mlxsw_reg_ratr_pack(ratr_pl, MLXSW_REG_RATR_OP_WRITE_WRITE_ENTRY,
-                           true, adj_index, neigh_entry->rif);
+                           true, MLXSW_REG_RATR_TYPE_ETHERNET,
+                           adj_index, neigh_entry->rif);
        mlxsw_reg_ratr_eth_entry_pack(ratr_pl, neigh_entry->ha);
        return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ratr), ratr_pl);
 }