VFs and unprivileged PFs should not be able to control MAE.
Add MAE privilege to MCDI headers in order to reflect that.
Fixes:
84d3fb7d7e1e ("common/sfc_efx/base: add MAE definitions to MCDI")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
* SF-117064-DG for background).
*/
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN_TSA_UNBOUND 0x8000
* SF-117064-DG for background).
*/
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN_TSA_UNBOUND 0x8000
+/* enum: Control the Match-Action Engine if present. See mcdi_mae.yml. */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAE 0x10000
/* enum: Set this bit to indicate that a new privilege mask is to be set,
* otherwise the command will only read the existing mask.
*/
/* enum: Set this bit to indicate that a new privilege mask is to be set,
* otherwise the command will only read the existing mask.
*/
#define MC_CMD_MAE_GET_AR_CAPS 0x141
#undef MC_CMD_0x141_PRIVILEGE_CTG
#define MC_CMD_MAE_GET_AR_CAPS 0x141
#undef MC_CMD_0x141_PRIVILEGE_CTG
-#define MC_CMD_0x141_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x141_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_GET_AR_CAPS_IN msgrequest */
#define MC_CMD_MAE_GET_AR_CAPS_IN_LEN 0
/* MC_CMD_MAE_GET_AR_CAPS_IN msgrequest */
#define MC_CMD_MAE_GET_AR_CAPS_IN_LEN 0
#define MC_CMD_MAE_GET_OR_CAPS 0x142
#undef MC_CMD_0x142_PRIVILEGE_CTG
#define MC_CMD_MAE_GET_OR_CAPS 0x142
#undef MC_CMD_0x142_PRIVILEGE_CTG
-#define MC_CMD_0x142_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x142_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_GET_OR_CAPS_IN msgrequest */
#define MC_CMD_MAE_GET_OR_CAPS_IN_LEN 0
/* MC_CMD_MAE_GET_OR_CAPS_IN msgrequest */
#define MC_CMD_MAE_GET_OR_CAPS_IN_LEN 0
#define MC_CMD_MAE_COUNTER_ALLOC 0x143
#undef MC_CMD_0x143_PRIVILEGE_CTG
#define MC_CMD_MAE_COUNTER_ALLOC 0x143
#undef MC_CMD_0x143_PRIVILEGE_CTG
-#define MC_CMD_0x143_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x143_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_COUNTER_ALLOC_IN msgrequest */
#define MC_CMD_MAE_COUNTER_ALLOC_IN_LEN 4
/* MC_CMD_MAE_COUNTER_ALLOC_IN msgrequest */
#define MC_CMD_MAE_COUNTER_ALLOC_IN_LEN 4
#define MC_CMD_MAE_COUNTER_FREE 0x144
#undef MC_CMD_0x144_PRIVILEGE_CTG
#define MC_CMD_MAE_COUNTER_FREE 0x144
#undef MC_CMD_0x144_PRIVILEGE_CTG
-#define MC_CMD_0x144_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x144_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_COUNTER_FREE_IN msgrequest */
#define MC_CMD_MAE_COUNTER_FREE_IN_LENMIN 8
/* MC_CMD_MAE_COUNTER_FREE_IN msgrequest */
#define MC_CMD_MAE_COUNTER_FREE_IN_LENMIN 8
* delivering packets to the current queue first.
*/
#define MC_CMD_MAE_COUNTERS_STREAM_START 0x151
* delivering packets to the current queue first.
*/
#define MC_CMD_MAE_COUNTERS_STREAM_START 0x151
+#undef MC_CMD_0x151_PRIVILEGE_CTG
+
+#define MC_CMD_0x151_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_COUNTERS_STREAM_START_IN msgrequest */
#define MC_CMD_MAE_COUNTERS_STREAM_START_IN_LEN 8
/* MC_CMD_MAE_COUNTERS_STREAM_START_IN msgrequest */
#define MC_CMD_MAE_COUNTERS_STREAM_START_IN_LEN 8
* Stop streaming counter values to the specified RxQ.
*/
#define MC_CMD_MAE_COUNTERS_STREAM_STOP 0x152
* Stop streaming counter values to the specified RxQ.
*/
#define MC_CMD_MAE_COUNTERS_STREAM_STOP 0x152
+#undef MC_CMD_0x152_PRIVILEGE_CTG
+
+#define MC_CMD_0x152_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_COUNTERS_STREAM_STOP_IN msgrequest */
#define MC_CMD_MAE_COUNTERS_STREAM_STOP_IN_LEN 2
/* MC_CMD_MAE_COUNTERS_STREAM_STOP_IN msgrequest */
#define MC_CMD_MAE_COUNTERS_STREAM_STOP_IN_LEN 2
* MAE_COUNTERS_PACKETISER_STREAM_START/PACKET_SIZE and rung the doorbell.
*/
#define MC_CMD_MAE_COUNTERS_STREAM_GIVE_CREDITS 0x153
* MAE_COUNTERS_PACKETISER_STREAM_START/PACKET_SIZE and rung the doorbell.
*/
#define MC_CMD_MAE_COUNTERS_STREAM_GIVE_CREDITS 0x153
+#undef MC_CMD_0x153_PRIVILEGE_CTG
+
+#define MC_CMD_0x153_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_COUNTERS_STREAM_GIVE_CREDITS_IN msgrequest */
#define MC_CMD_MAE_COUNTERS_STREAM_GIVE_CREDITS_IN_LEN 4
/* MC_CMD_MAE_COUNTERS_STREAM_GIVE_CREDITS_IN msgrequest */
#define MC_CMD_MAE_COUNTERS_STREAM_GIVE_CREDITS_IN_LEN 4
#define MC_CMD_MAE_ENCAP_HEADER_ALLOC 0x148
#undef MC_CMD_0x148_PRIVILEGE_CTG
#define MC_CMD_MAE_ENCAP_HEADER_ALLOC 0x148
#undef MC_CMD_0x148_PRIVILEGE_CTG
-#define MC_CMD_0x148_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x148_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN msgrequest */
#define MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN_LENMIN 4
/* MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN msgrequest */
#define MC_CMD_MAE_ENCAP_HEADER_ALLOC_IN_LENMIN 4
#define MC_CMD_MAE_ENCAP_HEADER_UPDATE 0x149
#undef MC_CMD_0x149_PRIVILEGE_CTG
#define MC_CMD_MAE_ENCAP_HEADER_UPDATE 0x149
#undef MC_CMD_0x149_PRIVILEGE_CTG
-#define MC_CMD_0x149_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x149_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ENCAP_HEADER_UPDATE_IN msgrequest */
#define MC_CMD_MAE_ENCAP_HEADER_UPDATE_IN_LENMIN 8
/* MC_CMD_MAE_ENCAP_HEADER_UPDATE_IN msgrequest */
#define MC_CMD_MAE_ENCAP_HEADER_UPDATE_IN_LENMIN 8
#define MC_CMD_MAE_ENCAP_HEADER_FREE 0x14a
#undef MC_CMD_0x14a_PRIVILEGE_CTG
#define MC_CMD_MAE_ENCAP_HEADER_FREE 0x14a
#undef MC_CMD_0x14a_PRIVILEGE_CTG
-#define MC_CMD_0x14a_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x14a_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ENCAP_HEADER_FREE_IN msgrequest */
#define MC_CMD_MAE_ENCAP_HEADER_FREE_IN_LENMIN 4
/* MC_CMD_MAE_ENCAP_HEADER_FREE_IN msgrequest */
#define MC_CMD_MAE_ENCAP_HEADER_FREE_IN_LENMIN 4
#define MC_CMD_MAE_MAC_ADDR_ALLOC 0x15e
#undef MC_CMD_0x15e_PRIVILEGE_CTG
#define MC_CMD_MAE_MAC_ADDR_ALLOC 0x15e
#undef MC_CMD_0x15e_PRIVILEGE_CTG
-#define MC_CMD_0x15e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x15e_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_MAC_ADDR_ALLOC_IN msgrequest */
#define MC_CMD_MAE_MAC_ADDR_ALLOC_IN_LEN 6
/* MC_CMD_MAE_MAC_ADDR_ALLOC_IN msgrequest */
#define MC_CMD_MAE_MAC_ADDR_ALLOC_IN_LEN 6
#define MC_CMD_MAE_MAC_ADDR_FREE 0x15f
#undef MC_CMD_0x15f_PRIVILEGE_CTG
#define MC_CMD_MAE_MAC_ADDR_FREE 0x15f
#undef MC_CMD_0x15f_PRIVILEGE_CTG
-#define MC_CMD_0x15f_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x15f_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_MAC_ADDR_FREE_IN msgrequest */
#define MC_CMD_MAE_MAC_ADDR_FREE_IN_LENMIN 4
/* MC_CMD_MAE_MAC_ADDR_FREE_IN msgrequest */
#define MC_CMD_MAE_MAC_ADDR_FREE_IN_LENMIN 4
#define MC_CMD_MAE_ACTION_SET_ALLOC 0x14d
#undef MC_CMD_0x14d_PRIVILEGE_CTG
#define MC_CMD_MAE_ACTION_SET_ALLOC 0x14d
#undef MC_CMD_0x14d_PRIVILEGE_CTG
-#define MC_CMD_0x14d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x14d_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ACTION_SET_ALLOC_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_ALLOC_IN_LEN 44
/* MC_CMD_MAE_ACTION_SET_ALLOC_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_ALLOC_IN_LEN 44
#define MC_CMD_MAE_ACTION_SET_FREE 0x14e
#undef MC_CMD_0x14e_PRIVILEGE_CTG
#define MC_CMD_MAE_ACTION_SET_FREE 0x14e
#undef MC_CMD_0x14e_PRIVILEGE_CTG
-#define MC_CMD_0x14e_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x14e_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ACTION_SET_FREE_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_FREE_IN_LENMIN 4
/* MC_CMD_MAE_ACTION_SET_FREE_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_FREE_IN_LENMIN 4
#define MC_CMD_MAE_ACTION_SET_LIST_ALLOC 0x14f
#undef MC_CMD_0x14f_PRIVILEGE_CTG
#define MC_CMD_MAE_ACTION_SET_LIST_ALLOC 0x14f
#undef MC_CMD_0x14f_PRIVILEGE_CTG
-#define MC_CMD_0x14f_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x14f_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ACTION_SET_LIST_ALLOC_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_LIST_ALLOC_IN_LENMIN 8
/* MC_CMD_MAE_ACTION_SET_LIST_ALLOC_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_LIST_ALLOC_IN_LENMIN 8
#define MC_CMD_MAE_ACTION_SET_LIST_FREE 0x150
#undef MC_CMD_0x150_PRIVILEGE_CTG
#define MC_CMD_MAE_ACTION_SET_LIST_FREE 0x150
#undef MC_CMD_0x150_PRIVILEGE_CTG
-#define MC_CMD_0x150_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x150_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ACTION_SET_LIST_FREE_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_LIST_FREE_IN_LENMIN 4
/* MC_CMD_MAE_ACTION_SET_LIST_FREE_IN msgrequest */
#define MC_CMD_MAE_ACTION_SET_LIST_FREE_IN_LENMIN 4
#define MC_CMD_MAE_OUTER_RULE_INSERT 0x15a
#undef MC_CMD_0x15a_PRIVILEGE_CTG
#define MC_CMD_MAE_OUTER_RULE_INSERT 0x15a
#undef MC_CMD_0x15a_PRIVILEGE_CTG
-#define MC_CMD_0x15a_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+#define MC_CMD_0x15a_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_OUTER_RULE_INSERT_IN msgrequest */
#define MC_CMD_MAE_OUTER_RULE_INSERT_IN_LENMIN 16
/* MC_CMD_MAE_OUTER_RULE_INSERT_IN msgrequest */
#define MC_CMD_MAE_OUTER_RULE_INSERT_IN_LENMIN 16
#define MC_CMD_MAE_OUTER_RULE_REMOVE 0x15b
#undef MC_CMD_0x15b_PRIVILEGE_CTG
#define MC_CMD_MAE_OUTER_RULE_REMOVE 0x15b
#undef MC_CMD_0x15b_PRIVILEGE_CTG
-#define MC_CMD_0x15b_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+#define MC_CMD_0x15b_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_OUTER_RULE_REMOVE_IN msgrequest */
#define MC_CMD_MAE_OUTER_RULE_REMOVE_IN_LENMIN 4
/* MC_CMD_MAE_OUTER_RULE_REMOVE_IN msgrequest */
#define MC_CMD_MAE_OUTER_RULE_REMOVE_IN_LENMIN 4
#define MC_CMD_MAE_ACTION_RULE_INSERT 0x15c
#undef MC_CMD_0x15c_PRIVILEGE_CTG
#define MC_CMD_MAE_ACTION_RULE_INSERT 0x15c
#undef MC_CMD_0x15c_PRIVILEGE_CTG
-#define MC_CMD_0x15c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x15c_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ACTION_RULE_INSERT_IN msgrequest */
#define MC_CMD_MAE_ACTION_RULE_INSERT_IN_LENMIN 28
/* MC_CMD_MAE_ACTION_RULE_INSERT_IN msgrequest */
#define MC_CMD_MAE_ACTION_RULE_INSERT_IN_LENMIN 28
#define MC_CMD_MAE_ACTION_RULE_UPDATE 0x15d
#undef MC_CMD_0x15d_PRIVILEGE_CTG
#define MC_CMD_MAE_ACTION_RULE_UPDATE 0x15d
#undef MC_CMD_0x15d_PRIVILEGE_CTG
-#define MC_CMD_0x15d_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x15d_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ACTION_RULE_UPDATE_IN msgrequest */
#define MC_CMD_MAE_ACTION_RULE_UPDATE_IN_LEN 24
/* MC_CMD_MAE_ACTION_RULE_UPDATE_IN msgrequest */
#define MC_CMD_MAE_ACTION_RULE_UPDATE_IN_LEN 24
#define MC_CMD_MAE_ACTION_RULE_DELETE 0x155
#undef MC_CMD_0x155_PRIVILEGE_CTG
#define MC_CMD_MAE_ACTION_RULE_DELETE 0x155
#undef MC_CMD_0x155_PRIVILEGE_CTG
-#define MC_CMD_0x155_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x155_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_ACTION_RULE_DELETE_IN msgrequest */
#define MC_CMD_MAE_ACTION_RULE_DELETE_IN_LENMIN 4
/* MC_CMD_MAE_ACTION_RULE_DELETE_IN msgrequest */
#define MC_CMD_MAE_ACTION_RULE_DELETE_IN_LENMIN 4
#define MC_CMD_MAE_MPORT_ALLOC 0x163
#undef MC_CMD_0x163_PRIVILEGE_CTG
#define MC_CMD_MAE_MPORT_ALLOC 0x163
#undef MC_CMD_0x163_PRIVILEGE_CTG
-#define MC_CMD_0x163_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x163_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_MPORT_ALLOC_IN msgrequest */
#define MC_CMD_MAE_MPORT_ALLOC_IN_LEN 20
/* MC_CMD_MAE_MPORT_ALLOC_IN msgrequest */
#define MC_CMD_MAE_MPORT_ALLOC_IN_LEN 20
#define MC_CMD_MAE_MPORT_FREE 0x164
#undef MC_CMD_0x164_PRIVILEGE_CTG
#define MC_CMD_MAE_MPORT_FREE 0x164
#undef MC_CMD_0x164_PRIVILEGE_CTG
-#define MC_CMD_0x164_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+#define MC_CMD_0x164_PRIVILEGE_CTG SRIOV_CTG_MAE
/* MC_CMD_MAE_MPORT_FREE_IN msgrequest */
#define MC_CMD_MAE_MPORT_FREE_IN_LEN 4
/* MC_CMD_MAE_MPORT_FREE_IN msgrequest */
#define MC_CMD_MAE_MPORT_FREE_IN_LEN 4
/* MC_CMD_MAE_MPORT_ENUMERATE
*/
#define MC_CMD_MAE_MPORT_ENUMERATE 0x17c
/* MC_CMD_MAE_MPORT_ENUMERATE
*/
#define MC_CMD_MAE_MPORT_ENUMERATE 0x17c
+#undef MC_CMD_0x17c_PRIVILEGE_CTG
+
+#define MC_CMD_0x17c_PRIVILEGE_CTG SRIOV_CTG_GENERAL
/* MC_CMD_MAE_MPORT_ENUMERATE_IN msgrequest */
#define MC_CMD_MAE_MPORT_ENUMERATE_IN_LEN 0
/* MC_CMD_MAE_MPORT_ENUMERATE_IN msgrequest */
#define MC_CMD_MAE_MPORT_ENUMERATE_IN_LEN 0