DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: stable@dpdk.org, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 1/2] common/sfc_efx/base: update MCDI headers for MAE privilege
Date: Fri, 11 Dec 2020 18:34:20 +0300
Message-ID: <20201211153421.28382-1-ivan.malov@oktetlabs.ru> (raw)

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>
---
 drivers/common/sfc_efx/base/efx_regs_mcdi.h | 54 +++++++++++++--------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/drivers/common/sfc_efx/base/efx_regs_mcdi.h b/drivers/common/sfc_efx/base/efx_regs_mcdi.h
index 0388acf72..689a491d0 100644
--- a/drivers/common/sfc_efx/base/efx_regs_mcdi.h
+++ b/drivers/common/sfc_efx/base/efx_regs_mcdi.h
@@ -20349,6 +20349,8 @@
  * 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.
  */
@@ -26823,7 +26825,7 @@
 #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
@@ -26855,7 +26857,7 @@
 #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
@@ -26885,7 +26887,7 @@
 #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
@@ -26928,7 +26930,7 @@
 #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
@@ -26993,6 +26995,9 @@
  * 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
@@ -27026,6 +27031,9 @@
  * 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
@@ -27052,6 +27060,9 @@
  * 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
@@ -27070,7 +27081,7 @@
 #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
@@ -27103,7 +27114,7 @@
 #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
@@ -27132,7 +27143,7 @@
 #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
@@ -27170,7 +27181,7 @@
 #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
@@ -27195,7 +27206,7 @@
 #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
@@ -27232,7 +27243,7 @@
 #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
@@ -27317,7 +27328,7 @@
 #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
@@ -27355,7 +27366,7 @@
 #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
@@ -27398,7 +27409,7 @@
 #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
@@ -27435,7 +27446,7 @@
 #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
@@ -27495,7 +27506,7 @@
 #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
@@ -27577,7 +27588,7 @@
 #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
@@ -27618,7 +27629,7 @@
 #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
@@ -27639,7 +27650,7 @@
 #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
@@ -27696,7 +27707,7 @@
 #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
@@ -27803,7 +27814,7 @@
 #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
@@ -27907,6 +27918,9 @@
 /* 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
-- 
2.20.1


             reply	other threads:[~2020-12-11 15:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 15:34 Ivan Malov [this message]
2020-12-11 15:34 ` [dpdk-dev] [PATCH 2/2] common/sfc_efx/base: check " Ivan Malov
2020-12-11 15:38   ` Andrew Rybchenko
2020-12-11 15:37 ` [dpdk-dev] [PATCH 1/2] common/sfc_efx/base: update MCDI headers " Andrew Rybchenko
2020-12-15 17:40   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201211153421.28382-1-ivan.malov@oktetlabs.ru \
    --to=ivan.malov@oktetlabs.ru \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git