* [PATCH net 1/1] bnx2x: Assign unique DMAE channel number for FW DMAE transactions.
@ 2018-11-09 10:10 Sudarsana Reddy Kalluru
2018-11-09 23:22 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-11-09 10:10 UTC (permalink / raw)
To: davem; +Cc: netdev, Michal.Kalderon
Driver assigns DMAE channel 0 for FW as part of START_RAMROD command. FW
uses this channel for DMAE operations (e.g., TIME_SYNC implementation).
Driver also uses the same channel 0 for DMAE operations for some of the PFs
(e.g., PF0 on Port0). This could lead to concurrent access to the DMAE
channel by FW and driver which is not legal. Hence need to assign unique
DMAE id for FW.
Currently following DMAE channels are used by the clients,
MFW - OCBB/OCSD functionality uses DMAE channel 14/15
Driver 0-3 and 8-11 (for PF dmae operations)
4 and 12 (for stats requests)
Assigning unique dmae_id '13' to the FW.
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 7 +++++++
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 3 +++
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 1 +
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 3 +++
4 files changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index be15061..0de487a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -2191,6 +2191,13 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
#define PMF_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \
E1HVN_MAX)
+/* Following is the DMAE channel number allocation for the clients.
+ * MFW: OCBB/OCSD implementations use DMAE channels 14/15 respectively.
+ * Driver: 0-3 and 8-11 (for PF dmae operations)
+ * 4 and 12 (for stats requests)
+ */
+#define BNX2X_FW_DMAE_C 13 /* Channel for FW DMAE operations */
+
/* PCIE link and speed */
#define PCICFG_LINK_WIDTH 0x1f00000
#define PCICFG_LINK_WIDTH_SHIFT 20
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index 142bc11..b9059f4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -965,6 +965,9 @@ static inline int bnx2x_func_start(struct bnx2x *bp)
start_params->network_cos_mode = STATIC_COS;
else /* CHIP_IS_E1X */
start_params->network_cos_mode = FW_WRR;
+
+ start_params->dmae_cmd_id = BNX2X_FW_DMAE_C;
+
if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].count) {
port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].dst_port;
start_params->vxlan_dst_port = port;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 3f4d2c8..1a33017 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -6149,6 +6149,7 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp,
rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag);
rdata->path_id = BP_PATH(bp);
rdata->network_cos_mode = start_params->network_cos_mode;
+ rdata->dmae_cmd_id = start_params->dmae_cmd_id;
rdata->vxlan_dst_port = cpu_to_le16(start_params->vxlan_dst_port);
rdata->geneve_dst_port = cpu_to_le16(start_params->geneve_dst_port);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
index 0bf2fd4..6cc3301 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h
@@ -1188,6 +1188,9 @@ struct bnx2x_func_start_params {
/* Function cos mode */
u8 network_cos_mode;
+ /* DMAE command id to be used for FW DMAE transactions */
+ u8 dmae_cmd_id;
+
/* UDP dest port for VXLAN */
u16 vxlan_dst_port;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net 1/1] bnx2x: Assign unique DMAE channel number for FW DMAE transactions.
2018-11-09 10:10 [PATCH net 1/1] bnx2x: Assign unique DMAE channel number for FW DMAE transactions Sudarsana Reddy Kalluru
@ 2018-11-09 23:22 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-11-09 23:22 UTC (permalink / raw)
To: sudarsana.kalluru; +Cc: netdev, Michal.Kalderon
From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Date: Fri, 9 Nov 2018 02:10:43 -0800
> +/* Following is the DMAE channel number allocation for the clients.
> + * MFW: OCBB/OCSD implementations use DMAE channels 14/15 respectively.
> + * Driver: 0-3 and 8-11 (for PF dmae operations)
> + * 4 and 12 (for stats requests)
> + */
> +#define BNX2X_FW_DMAE_C 13 /* Channel for FW DMAE operations */
...
> + start_params->dmae_cmd_id = BNX2X_FW_DMAE_C;
Why do you need this, it never changes, and:
> + rdata->dmae_cmd_id = start_params->dmae_cmd_id;
It always is the same value here in the one place it is used.
Just assign BNX2X_FW_DMAE_C directly to rdata->dmae_cmd_id please.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-10 9:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-09 10:10 [PATCH net 1/1] bnx2x: Assign unique DMAE channel number for FW DMAE transactions Sudarsana Reddy Kalluru
2018-11-09 23:22 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox