Commit dd326565 authored by Amit Cohen's avatar Amit Cohen Committed by David S. Miller
Browse files

mlxsw: reg: Add ingress RIF related fields to SVFA register



SVFA register controls the VID to FID mapping and {Port, VID} to FID
mapping for virtualized ports. As preparation for unified bridge model,
add some required fields for future use.

On ingress, after ingress ACL, a packet needs to be classified to a FID.
The key for this lookup can be one of:
1. VID. When port is not in virtual mode.
2. {RQ, VID}. When port is in virtual mode.
3. FID. When FID was set by ingress ACL.

Since RITR no longer performs ingress configuration, the ingress RIF for
the first two entry types needs to be set via new fields in SVFA -
'irif_v' and 'irif'.

Add the two mentioned fields for future use and increase the length of
the register accordingly.

Signed-off-by: default avatarAmit Cohen <amcohen@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e459466a
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -1516,7 +1516,7 @@ static inline void mlxsw_reg_spmlr_pack(char *payload, u16 local_port,
 * virtualized ports.
 */
#define MLXSW_REG_SVFA_ID 0x201C
#define MLXSW_REG_SVFA_LEN 0x10
#define MLXSW_REG_SVFA_LEN 0x18

MLXSW_REG_DEFINE(svfa, MLXSW_REG_SVFA_ID, MLXSW_REG_SVFA_LEN);

@@ -1586,6 +1586,26 @@ MLXSW_ITEM32(reg, svfa, counter_set_type, 0x08, 24, 8);
 */
MLXSW_ITEM32(reg, svfa, counter_index, 0x08, 0, 24);

/* reg_svfa_irif_v
 * Ingress RIF valid.
 * 0 - Ingress RIF is not valid, no ingress RIF assigned.
 * 1 - Ingress RIF valid.
 * Must not be set for a non enabled RIF.
 * Access: RW
 *
 * Note: Reserved when legacy bridge model is used.
 */
MLXSW_ITEM32(reg, svfa, irif_v, 0x14, 24, 1);

/* reg_svfa_irif
 * Ingress RIF (Router Interface).
 * Range is 0..cap_max_router_interfaces-1.
 * Access: RW
 *
 * Note: Reserved when legacy bridge model is used and when irif_v=0.
 */
MLXSW_ITEM32(reg, svfa, irif, 0x14, 0, 16);

static inline void mlxsw_reg_svfa_pack(char *payload, u16 local_port,
				       enum mlxsw_reg_svfa_mt mt, bool valid,
				       u16 fid, u16 vid)