]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mlxsw: spectrum_router: Add underlay RIF ID support
authorNir Dotan <nird@mellanox.com>
Sun, 20 Jan 2019 06:50:47 +0000 (06:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 20 Jan 2019 19:12:57 +0000 (11:12 -0800)
Spectrum-2 GRE tunnels underlay should be given not only the virtual router
information for an encapsulated packet lookup, but also an underlay RIF
object which belongs to a virtual router.

Therefore add ul_rif_id field in struct mlxsw_sp_rif_ipip_lb, to be used
later in Spectrum-2 underlay RIF implementation. This field complements
ul_vr_id field, already present and defined as reserved for Spectrum-2.

Signed-off-by: Nir Dotan <nird@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

index 1cac3836550389db113c0d6d5d6a9140d5f57407..c9dbef5ed6e36209f333d2404b2228c03b10ff54 100644 (file)
@@ -120,6 +120,7 @@ struct mlxsw_sp_rif_ipip_lb {
        struct mlxsw_sp_rif common;
        struct mlxsw_sp_rif_ipip_lb_config lb_config;
        u16 ul_vr_id; /* Reserved for Spectrum-2. */
+       u16 ul_rif_id; /* Reserved for Spectrum. */
 };
 
 struct mlxsw_sp_rif_params_ipip_lb {
@@ -1468,14 +1469,13 @@ static int mlxsw_sp_netdevice_ipip_ol_update_mtu(struct mlxsw_sp *mlxsw_sp,
 {
        struct mlxsw_sp_ipip_entry *ipip_entry;
        struct mlxsw_sp_rif_ipip_lb *lb_rif;
-       struct mlxsw_sp_vr *ul_vr;
        int err = 0;
 
        ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev);
        if (ipip_entry) {
                lb_rif = ipip_entry->ol_lb;
-               ul_vr = &mlxsw_sp->router->vrs[lb_rif->ul_vr_id];
-               err = mlxsw_sp_rif_ipip_lb_op(lb_rif, ul_vr->id, 0, true);
+               err = mlxsw_sp_rif_ipip_lb_op(lb_rif, lb_rif->ul_vr_id,
+                                             lb_rif->ul_rif_id, true);
                if (err)
                        goto out;
                lb_rif->common.mtu = ol_dev->mtu;
@@ -7442,6 +7442,7 @@ mlxsw_sp1_rif_ipip_lb_configure(struct mlxsw_sp_rif *rif)
                goto err_loopback_op;
 
        lb_rif->ul_vr_id = ul_vr->id;
+       lb_rif->ul_rif_id = 0;
        ++ul_vr->rif_count;
        return 0;