Lines Matching refs:mlxsw_sp_port
599 struct mlxsw_sp_port *mlxsw_sp_port; in mlxsw_sp1_ptp_packet_finish() local
605 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp1_ptp_packet_finish()
606 if (!(mlxsw_sp_port && (!skb->dev || skb->dev == mlxsw_sp_port->dev))) { in mlxsw_sp1_ptp_packet_finish()
721 struct mlxsw_sp_port *mlxsw_sp_port; in mlxsw_sp1_ptp_got_packet() local
726 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp1_ptp_got_packet()
727 if (!mlxsw_sp_port) in mlxsw_sp1_ptp_got_packet()
730 types = ingress ? mlxsw_sp_port->ptp.ing_types : in mlxsw_sp1_ptp_got_packet()
731 mlxsw_sp_port->ptp.egr_types; in mlxsw_sp1_ptp_got_packet()
762 struct mlxsw_sp_port *mlxsw_sp_port; in mlxsw_sp1_ptp_got_timestamp() local
768 mlxsw_sp_port = mlxsw_sp->ports[local_port]; in mlxsw_sp1_ptp_got_timestamp()
769 if (!mlxsw_sp_port) in mlxsw_sp1_ptp_got_timestamp()
772 types = ingress ? mlxsw_sp_port->ptp.ing_types : in mlxsw_sp1_ptp_got_timestamp()
773 mlxsw_sp_port->ptp.egr_types; in mlxsw_sp1_ptp_got_timestamp()
810 struct mlxsw_sp_port *mlxsw_sp_port; in mlxsw_sp1_ptp_ht_gc_collect() local
831 mlxsw_sp_port = mlxsw_sp->ports[unmatched->key.local_port]; in mlxsw_sp1_ptp_ht_gc_collect()
832 if (mlxsw_sp_port) { in mlxsw_sp1_ptp_ht_gc_collect()
834 &mlxsw_sp_port->ptp.stats.rx_gcd : in mlxsw_sp1_ptp_ht_gc_collect()
835 &mlxsw_sp_port->ptp.stats.tx_gcd; in mlxsw_sp1_ptp_ht_gc_collect()
1096 int mlxsw_sp1_ptp_hwtstamp_get(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp1_ptp_hwtstamp_get() argument
1099 *config = mlxsw_sp_port->ptp.hwtstamp_config; in mlxsw_sp1_ptp_hwtstamp_get()
1165 static int mlxsw_sp1_ptp_mtpppc_update(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp1_ptp_mtpppc_update() argument
1168 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp1_ptp_mtpppc_update()
1169 struct mlxsw_sp_port *tmp; in mlxsw_sp1_ptp_mtpppc_update()
1184 if (tmp && tmp != mlxsw_sp_port) { in mlxsw_sp1_ptp_mtpppc_update()
1193 netdev_err(mlxsw_sp_port->dev, "Failed to increase parsing depth"); in mlxsw_sp1_ptp_mtpppc_update()
1200 return mlxsw_sp1_ptp_mtpppc_set(mlxsw_sp_port->mlxsw_sp, in mlxsw_sp1_ptp_mtpppc_update()
1204 static bool mlxsw_sp1_ptp_hwtstamp_enabled(struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp1_ptp_hwtstamp_enabled() argument
1206 return mlxsw_sp_port->ptp.ing_types || mlxsw_sp_port->ptp.egr_types; in mlxsw_sp1_ptp_hwtstamp_enabled()
1210 mlxsw_sp1_ptp_port_shaper_set(struct mlxsw_sp_port *mlxsw_sp_port, bool enable) in mlxsw_sp1_ptp_port_shaper_set() argument
1212 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp1_ptp_port_shaper_set()
1215 mlxsw_reg_qeec_ptps_pack(qeec_pl, mlxsw_sp_port->local_port, enable); in mlxsw_sp1_ptp_port_shaper_set()
1219 static int mlxsw_sp1_ptp_port_shaper_check(struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp1_ptp_port_shaper_check() argument
1225 if (!mlxsw_sp1_ptp_hwtstamp_enabled(mlxsw_sp_port)) in mlxsw_sp1_ptp_port_shaper_check()
1226 return mlxsw_sp1_ptp_port_shaper_set(mlxsw_sp_port, false); in mlxsw_sp1_ptp_port_shaper_check()
1228 err = mlxsw_sp_port_speed_get(mlxsw_sp_port, &speed); in mlxsw_sp1_ptp_port_shaper_check()
1239 return mlxsw_sp1_ptp_port_shaper_set(mlxsw_sp_port, ptps); in mlxsw_sp1_ptp_port_shaper_check()
1245 struct mlxsw_sp_port *mlxsw_sp_port; in mlxsw_sp1_ptp_shaper_work() local
1248 mlxsw_sp_port = container_of(dwork, struct mlxsw_sp_port, in mlxsw_sp1_ptp_shaper_work()
1251 if (!mlxsw_sp1_ptp_hwtstamp_enabled(mlxsw_sp_port)) in mlxsw_sp1_ptp_shaper_work()
1254 err = mlxsw_sp1_ptp_port_shaper_check(mlxsw_sp_port); in mlxsw_sp1_ptp_shaper_work()
1256 netdev_err(mlxsw_sp_port->dev, "Failed to set up PTP shaper\n"); in mlxsw_sp1_ptp_shaper_work()
1259 int mlxsw_sp1_ptp_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp1_ptp_hwtstamp_set() argument
1272 err = mlxsw_sp1_ptp_mtpppc_update(mlxsw_sp_port, ing_types, egr_types); in mlxsw_sp1_ptp_hwtstamp_set()
1276 mlxsw_sp_port->ptp.hwtstamp_config = *config; in mlxsw_sp1_ptp_hwtstamp_set()
1277 mlxsw_sp_port->ptp.ing_types = ing_types; in mlxsw_sp1_ptp_hwtstamp_set()
1278 mlxsw_sp_port->ptp.egr_types = egr_types; in mlxsw_sp1_ptp_hwtstamp_set()
1280 err = mlxsw_sp1_ptp_port_shaper_check(mlxsw_sp_port); in mlxsw_sp1_ptp_hwtstamp_set()
1348 void mlxsw_sp1_get_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp1_get_stats() argument
1351 void *stats = &mlxsw_sp_port->ptp.stats; in mlxsw_sp1_get_stats()
1460 int mlxsw_sp2_ptp_hwtstamp_get(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp2_ptp_hwtstamp_get() argument
1465 ptp_state = mlxsw_sp2_ptp_state(mlxsw_sp_port->mlxsw_sp); in mlxsw_sp2_ptp_hwtstamp_get()
1579 static int mlxsw_sp2_ptp_configure_port(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp2_ptp_configure_port() argument
1586 ptp_state = mlxsw_sp2_ptp_state(mlxsw_sp_port->mlxsw_sp); in mlxsw_sp2_ptp_configure_port()
1591 err = mlxsw_sp2_ptp_enable(mlxsw_sp_port->mlxsw_sp, ing_types, in mlxsw_sp2_ptp_configure_port()
1601 static int mlxsw_sp2_ptp_deconfigure_port(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp2_ptp_deconfigure_port() argument
1607 ptp_state = mlxsw_sp2_ptp_state(mlxsw_sp_port->mlxsw_sp); in mlxsw_sp2_ptp_deconfigure_port()
1612 err = mlxsw_sp2_ptp_disable(mlxsw_sp_port->mlxsw_sp, new_config); in mlxsw_sp2_ptp_deconfigure_port()
1623 int mlxsw_sp2_ptp_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp2_ptp_hwtstamp_set() argument
1633 ptp_state = mlxsw_sp2_ptp_state(mlxsw_sp_port->mlxsw_sp); in mlxsw_sp2_ptp_hwtstamp_set()
1645 ptp_enabled = mlxsw_sp_port->ptp.ing_types || in mlxsw_sp2_ptp_hwtstamp_set()
1646 mlxsw_sp_port->ptp.egr_types; in mlxsw_sp2_ptp_hwtstamp_set()
1649 err = mlxsw_sp2_ptp_configure_port(mlxsw_sp_port, new_ing_types, in mlxsw_sp2_ptp_hwtstamp_set()
1654 err = mlxsw_sp2_ptp_deconfigure_port(mlxsw_sp_port, new_config); in mlxsw_sp2_ptp_hwtstamp_set()
1659 mlxsw_sp_port->ptp.ing_types = new_ing_types; in mlxsw_sp2_ptp_hwtstamp_set()
1660 mlxsw_sp_port->ptp.egr_types = new_egr_types; in mlxsw_sp2_ptp_hwtstamp_set()
1695 struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_ptp_txhdr_construct() argument
1704 struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp2_ptp_txhdr_construct() argument
1719 this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped); in mlxsw_sp2_ptp_txhdr_construct()
1724 return mlxsw_sp_txhdr_ptp_data_construct(mlxsw_core, mlxsw_sp_port, skb, in mlxsw_sp2_ptp_txhdr_construct()