]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mlxsw: pci: Add lag related resources to resources query
authorNogah Frankel <nogahf@mellanox.com>
Tue, 20 Sep 2016 09:16:49 +0000 (11:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 21 Sep 2016 05:00:58 +0000 (01:00 -0400)
Add max lag and max ports in lag resources to resources query.

Signed-off-by: Nogah Frankel <nogahf@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/core.h
drivers/net/ethernet/mellanox/mlxsw/pci.c

index d2e32979319c93ce8be7a9591c92212b4d69ed9a..51f27a35749e8f247db834a78fc03f0491f39d46 100644 (file)
@@ -269,8 +269,12 @@ struct mlxsw_driver {
 };
 
 struct mlxsw_resources {
-       u8      max_span_valid:1;
+       u8      max_span_valid:1,
+               max_lag_valid:1,
+               max_ports_in_lag_valid:1;
        u8      max_span;
+       u8      max_lag;
+       u8      max_ports_in_lag;
 };
 
 struct mlxsw_resources *mlxsw_core_resources_get(struct mlxsw_core *mlxsw_core);
index 1d1360c178bb5df47009a2174b688974b8f3db31..cb284eaeec39b139c8b424ed1dbd25c5758d7521 100644 (file)
@@ -1156,6 +1156,8 @@ mlxsw_pci_config_profile_swid_config(struct mlxsw_pci *mlxsw_pci,
 
 #define MLXSW_RESOURCES_TABLE_END_ID 0xffff
 #define MLXSW_MAX_SPAN_ID 0x2420
+#define MLXSW_MAX_LAG_ID 0x2520
+#define MLXSW_MAX_PORTS_IN_LAG_ID 0x2521
 #define MLXSW_RESOURCES_QUERY_MAX_QUERIES 100
 #define MLXSW_RESOURCES_PER_QUERY 32
 
@@ -1167,6 +1169,14 @@ static void mlxsw_pci_resources_query_parse(int id, u64 val,
                resources->max_span = val;
                resources->max_span_valid = 1;
                break;
+       case MLXSW_MAX_LAG_ID:
+               resources->max_lag = val;
+               resources->max_lag_valid = 1;
+               break;
+       case MLXSW_MAX_PORTS_IN_LAG_ID:
+               resources->max_ports_in_lag = val;
+               resources->max_ports_in_lag_valid = 1;
+               break;
        default:
                break;
        }