Skip to content

Commit 2c63a55

Browse files
idoschdavem330
authored andcommitted
mlxsw: reg: Add QoS Switch Traffic Class Table register
As part of DCB ops we'll have to configure the priority to traffic class mapping of a port. Add the QoS Switch Traffic Class Table (QTCT) register, which configures the mapping between the packet switch priority and traffic class on the transmit port. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b9b7cee commit 2c63a55

File tree

1 file changed

+55
-0
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+55
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,6 +1805,59 @@ static inline void mlxsw_reg_spvmlr_pack(char *payload, u8 local_port,
18051805
}
18061806
}
18071807

1808+
/* QTCT - QoS Switch Traffic Class Table
1809+
* -------------------------------------
1810+
* Configures the mapping between the packet switch priority and the
1811+
* traffic class on the transmit port.
1812+
*/
1813+
#define MLXSW_REG_QTCT_ID 0x400A
1814+
#define MLXSW_REG_QTCT_LEN 0x08
1815+
1816+
static const struct mlxsw_reg_info mlxsw_reg_qtct = {
1817+
.id = MLXSW_REG_QTCT_ID,
1818+
.len = MLXSW_REG_QTCT_LEN,
1819+
};
1820+
1821+
/* reg_qtct_local_port
1822+
* Local port number.
1823+
* Access: Index
1824+
*
1825+
* Note: CPU port is not supported.
1826+
*/
1827+
MLXSW_ITEM32(reg, qtct, local_port, 0x00, 16, 8);
1828+
1829+
/* reg_qtct_sub_port
1830+
* Virtual port within the physical port.
1831+
* Should be set to 0 when virtual ports are not enabled on the port.
1832+
* Access: Index
1833+
*/
1834+
MLXSW_ITEM32(reg, qtct, sub_port, 0x00, 8, 8);
1835+
1836+
/* reg_qtct_switch_prio
1837+
* Switch priority.
1838+
* Access: Index
1839+
*/
1840+
MLXSW_ITEM32(reg, qtct, switch_prio, 0x00, 0, 4);
1841+
1842+
/* reg_qtct_tclass
1843+
* Traffic class.
1844+
* Default values:
1845+
* switch_prio 0 : tclass 1
1846+
* switch_prio 1 : tclass 0
1847+
* switch_prio i : tclass i, for i > 1
1848+
* Access: RW
1849+
*/
1850+
MLXSW_ITEM32(reg, qtct, tclass, 0x04, 0, 4);
1851+
1852+
static inline void mlxsw_reg_qtct_pack(char *payload, u8 local_port,
1853+
u8 switch_prio, u8 tclass)
1854+
{
1855+
MLXSW_REG_ZERO(qtct, payload);
1856+
mlxsw_reg_qtct_local_port_set(payload, local_port);
1857+
mlxsw_reg_qtct_switch_prio_set(payload, switch_prio);
1858+
mlxsw_reg_qtct_tclass_set(payload, tclass);
1859+
}
1860+
18081861
/* QEEC - QoS ETS Element Configuration Register
18091862
* ---------------------------------------------
18101863
* Configures the ETS elements.
@@ -3491,6 +3544,8 @@ static inline const char *mlxsw_reg_id_str(u16 reg_id)
34913544
return "SFMR";
34923545
case MLXSW_REG_SPVMLR_ID:
34933546
return "SPVMLR";
3547+
case MLXSW_REG_QTCT_ID:
3548+
return "QTCT";
34943549
case MLXSW_REG_QEEC_ID:
34953550
return "QEEC";
34963551
case MLXSW_REG_PMLP_ID:

0 commit comments

Comments
 (0)