Skip to content

Commit

Permalink
Merge branch 'mlxsw-Add-router-adjacency-dpipe-table'
Browse files Browse the repository at this point in the history
Jiri Pirko says:

====================
mlxsw: Add router adjacency dpipe table

Arkadi says:

This patchset adds router adjacency dpipe table support. This will provide
the ability to observe the hardware offloaded IPv4/6 nexthops.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 27, 2017
2 parents 390e96e + 427e652 commit f6fc5b4
Show file tree
Hide file tree
Showing 5 changed files with 572 additions and 24 deletions.
44 changes: 35 additions & 9 deletions drivers/net/ethernet/mellanox/mlxsw/reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -4549,6 +4549,27 @@ MLXSW_ITEM32(reg, ratr, ipip_ipv4_udip, 0x18, 0, 32);
*/
MLXSW_ITEM32(reg, ratr, ipip_ipv6_ptr, 0x1C, 0, 24);

enum mlxsw_reg_flow_counter_set_type {
/* No count */
MLXSW_REG_FLOW_COUNTER_SET_TYPE_NO_COUNT = 0x00,
/* Count packets and bytes */
MLXSW_REG_FLOW_COUNTER_SET_TYPE_PACKETS_BYTES = 0x03,
/* Count only packets */
MLXSW_REG_FLOW_COUNTER_SET_TYPE_PACKETS = 0x05,
};

/* reg_ratr_counter_set_type
* Counter set type for flow counters
* Access: RW
*/
MLXSW_ITEM32(reg, ratr, counter_set_type, 0x28, 24, 8);

/* reg_ratr_counter_index
* Counter index for flow counters
* Access: RW
*/
MLXSW_ITEM32(reg, ratr, counter_index, 0x28, 0, 24);

static inline void
mlxsw_reg_ratr_pack(char *payload,
enum mlxsw_reg_ratr_op op, bool valid,
Expand Down Expand Up @@ -4576,6 +4597,20 @@ static inline void mlxsw_reg_ratr_ipip4_entry_pack(char *payload, u32 ipv4_udip)
mlxsw_reg_ratr_ipip_ipv4_udip_set(payload, ipv4_udip);
}

static inline void mlxsw_reg_ratr_counter_pack(char *payload, u64 counter_index,
bool counter_enable)
{
enum mlxsw_reg_flow_counter_set_type set_type;

if (counter_enable)
set_type = MLXSW_REG_FLOW_COUNTER_SET_TYPE_PACKETS_BYTES;
else
set_type = MLXSW_REG_FLOW_COUNTER_SET_TYPE_NO_COUNT;

mlxsw_reg_ratr_counter_index_set(payload, counter_index);
mlxsw_reg_ratr_counter_set_type_set(payload, set_type);
}

/* RICNT - Router Interface Counter Register
* -----------------------------------------
* The RICNT register retrieves per port performance counters
Expand Down Expand Up @@ -5297,15 +5332,6 @@ enum mlxsw_reg_rauht_trap_id {
*/
MLXSW_ITEM32(reg, rauht, trap_id, 0x60, 0, 9);

enum mlxsw_reg_flow_counter_set_type {
/* No count */
MLXSW_REG_FLOW_COUNTER_SET_TYPE_NO_COUNT = 0x00,
/* Count packets and bytes */
MLXSW_REG_FLOW_COUNTER_SET_TYPE_PACKETS_BYTES = 0x03,
/* Count only packets */
MLXSW_REG_FLOW_COUNTER_SET_TYPE_PACKETS = 0x05,
};

/* reg_rauht_counter_set_type
* Counter set type for flow counters
* Access: RW
Expand Down
Loading

0 comments on commit f6fc5b4

Please sign in to comment.