spectrum.c (ff41c7fa64854cc95a472d43af82c17c043aa757) | spectrum.c (230ead0141be9668fbaf6c0b708533064d46a9a2) |
---|---|
1/* 2 * drivers/net/ethernet/mellanox/mlxsw/spectrum.c 3 * Copyright (c) 2015-2017 Mellanox Technologies. All rights reserved. 4 * Copyright (c) 2015-2017 Jiri Pirko <jiri@mellanox.com> 5 * Copyright (c) 2015 Ido Schimmel <idosch@mellanox.com> 6 * Copyright (c) 2015 Elad Raz <eladr@mellanox.com> 7 * 8 * Redistribution and use in source and binary forms, with or without --- 53 unchanged lines hidden (view full) --- 62#include "spectrum.h" 63#include "pci.h" 64#include "core.h" 65#include "reg.h" 66#include "port.h" 67#include "trap.h" 68#include "txheader.h" 69#include "spectrum_cnt.h" | 1/* 2 * drivers/net/ethernet/mellanox/mlxsw/spectrum.c 3 * Copyright (c) 2015-2017 Mellanox Technologies. All rights reserved. 4 * Copyright (c) 2015-2017 Jiri Pirko <jiri@mellanox.com> 5 * Copyright (c) 2015 Ido Schimmel <idosch@mellanox.com> 6 * Copyright (c) 2015 Elad Raz <eladr@mellanox.com> 7 * 8 * Redistribution and use in source and binary forms, with or without --- 53 unchanged lines hidden (view full) --- 62#include "spectrum.h" 63#include "pci.h" 64#include "core.h" 65#include "reg.h" 66#include "port.h" 67#include "trap.h" 68#include "txheader.h" 69#include "spectrum_cnt.h" |
70#include "spectrum_dpipe.h" |
|
70 71static const char mlxsw_sp_driver_name[] = "mlxsw_spectrum"; 72static const char mlxsw_sp_driver_version[] = "1.0"; 73 74/* tx_hdr_version 75 * Tx header version. 76 * Must be set to 1. 77 */ --- 3256 unchanged lines hidden (view full) --- 3334 } 3335 3336 err = mlxsw_sp_counter_pool_init(mlxsw_sp); 3337 if (err) { 3338 dev_err(mlxsw_sp->bus_info->dev, "Failed to init counter pool\n"); 3339 goto err_counter_pool_init; 3340 } 3341 | 71 72static const char mlxsw_sp_driver_name[] = "mlxsw_spectrum"; 73static const char mlxsw_sp_driver_version[] = "1.0"; 74 75/* tx_hdr_version 76 * Tx header version. 77 * Must be set to 1. 78 */ --- 3256 unchanged lines hidden (view full) --- 3335 } 3336 3337 err = mlxsw_sp_counter_pool_init(mlxsw_sp); 3338 if (err) { 3339 dev_err(mlxsw_sp->bus_info->dev, "Failed to init counter pool\n"); 3340 goto err_counter_pool_init; 3341 } 3342 |
3343 err = mlxsw_sp_dpipe_init(mlxsw_sp); 3344 if (err) { 3345 dev_err(mlxsw_sp->bus_info->dev, "Failed to init pipeline debug\n"); 3346 goto err_dpipe_init; 3347 } 3348 |
|
3342 err = mlxsw_sp_ports_create(mlxsw_sp); 3343 if (err) { 3344 dev_err(mlxsw_sp->bus_info->dev, "Failed to create ports\n"); 3345 goto err_ports_create; 3346 } 3347 3348 return 0; 3349 3350err_ports_create: | 3349 err = mlxsw_sp_ports_create(mlxsw_sp); 3350 if (err) { 3351 dev_err(mlxsw_sp->bus_info->dev, "Failed to create ports\n"); 3352 goto err_ports_create; 3353 } 3354 3355 return 0; 3356 3357err_ports_create: |
3358 mlxsw_sp_dpipe_fini(mlxsw_sp); 3359err_dpipe_init: |
|
3351 mlxsw_sp_counter_pool_fini(mlxsw_sp); 3352err_counter_pool_init: 3353 mlxsw_sp_acl_fini(mlxsw_sp); 3354err_acl_init: 3355 mlxsw_sp_span_fini(mlxsw_sp); 3356err_span_init: 3357 mlxsw_sp_router_fini(mlxsw_sp); 3358err_router_init: --- 8 unchanged lines hidden (view full) --- 3367 return err; 3368} 3369 3370static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core) 3371{ 3372 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); 3373 3374 mlxsw_sp_ports_remove(mlxsw_sp); | 3360 mlxsw_sp_counter_pool_fini(mlxsw_sp); 3361err_counter_pool_init: 3362 mlxsw_sp_acl_fini(mlxsw_sp); 3363err_acl_init: 3364 mlxsw_sp_span_fini(mlxsw_sp); 3365err_span_init: 3366 mlxsw_sp_router_fini(mlxsw_sp); 3367err_router_init: --- 8 unchanged lines hidden (view full) --- 3376 return err; 3377} 3378 3379static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core) 3380{ 3381 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); 3382 3383 mlxsw_sp_ports_remove(mlxsw_sp); |
3384 mlxsw_sp_dpipe_fini(mlxsw_sp); |
|
3375 mlxsw_sp_counter_pool_fini(mlxsw_sp); 3376 mlxsw_sp_acl_fini(mlxsw_sp); 3377 mlxsw_sp_span_fini(mlxsw_sp); 3378 mlxsw_sp_router_fini(mlxsw_sp); 3379 mlxsw_sp_switchdev_fini(mlxsw_sp); 3380 mlxsw_sp_lag_fini(mlxsw_sp); 3381 mlxsw_sp_buffers_fini(mlxsw_sp); 3382 mlxsw_sp_traps_fini(mlxsw_sp); --- 1238 unchanged lines hidden --- | 3385 mlxsw_sp_counter_pool_fini(mlxsw_sp); 3386 mlxsw_sp_acl_fini(mlxsw_sp); 3387 mlxsw_sp_span_fini(mlxsw_sp); 3388 mlxsw_sp_router_fini(mlxsw_sp); 3389 mlxsw_sp_switchdev_fini(mlxsw_sp); 3390 mlxsw_sp_lag_fini(mlxsw_sp); 3391 mlxsw_sp_buffers_fini(mlxsw_sp); 3392 mlxsw_sp_traps_fini(mlxsw_sp); --- 1238 unchanged lines hidden --- |