Skip to content

Commit 997af5d

Browse files
Michal Kalderondavem330
authored andcommitted
qed: FW 8.42.2.0 Additional ll2 type
LL2 queues were a limited resource due to FW constraints. This FW introduced a new resource which is a context based ll2 queue (memory on host). The additional ll2 queues are required for RDMA SRIOV. The code refers to the previous ll2 queues as ram-based or legacy, and the new queues as ctx-based. This change decreased the "legacy" ram-based queues therefore the first ll2 queue used for iWARP was converted to the ctx-based ll2 queue. This feature also exposed a bug in the DIRECT_REG_WR64 macro implementation which didn't have an effect in other use cases. Signed-off-by: Ariel Elior <ariel.elior@marvell.com> Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 804c570 commit 997af5d

11 files changed

Lines changed: 235 additions & 37 deletions

File tree

‎drivers/net/ethernet/qlogic/qed/qed.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ enum qed_resources {
253253
QED_VLAN,
254254
QED_RDMA_CNQ_RAM,
255255
QED_ILT,
256-
QED_LL2_QUEUE,
256+
QED_LL2_RAM_QUEUE,
257+
QED_LL2_CTX_QUEUE,
257258
QED_CMDQS_CQS,
258259
QED_RDMA_STATS_QUEUE,
259260
QED_BDQ,

‎drivers/net/ethernet/qlogic/qed/qed_dev.c‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3565,8 +3565,10 @@ const char *qed_hw_get_resc_name(enum qed_resources res_id)
35653565
return "RDMA_CNQ_RAM";
35663566
case QED_ILT:
35673567
return "ILT";
3568-
case QED_LL2_QUEUE:
3569-
return "LL2_QUEUE";
3568+
case QED_LL2_RAM_QUEUE:
3569+
return "LL2_RAM_QUEUE";
3570+
case QED_LL2_CTX_QUEUE:
3571+
return "LL2_CTX_QUEUE";
35703572
case QED_CMDQS_CQS:
35713573
return "CMDQS_CQS";
35723574
case QED_RDMA_STATS_QUEUE:
@@ -3615,8 +3617,11 @@ qed_hw_set_soft_resc_size(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
36153617

36163618
for (res_id = 0; res_id < QED_MAX_RESC; res_id++) {
36173619
switch (res_id) {
3618-
case QED_LL2_QUEUE:
3619-
resc_max_val = MAX_NUM_LL2_RX_QUEUES;
3620+
case QED_LL2_RAM_QUEUE:
3621+
resc_max_val = MAX_NUM_LL2_RX_RAM_QUEUES;
3622+
break;
3623+
case QED_LL2_CTX_QUEUE:
3624+
resc_max_val = MAX_NUM_LL2_RX_CTX_QUEUES;
36203625
break;
36213626
case QED_RDMA_CNQ_RAM:
36223627
/* No need for a case for QED_CMDQS_CQS since
@@ -3691,8 +3696,11 @@ int qed_hw_get_dflt_resc(struct qed_hwfn *p_hwfn,
36913696
*p_resc_num = (b_ah ? PXP_NUM_ILT_RECORDS_K2 :
36923697
PXP_NUM_ILT_RECORDS_BB) / num_funcs;
36933698
break;
3694-
case QED_LL2_QUEUE:
3695-
*p_resc_num = MAX_NUM_LL2_RX_QUEUES / num_funcs;
3699+
case QED_LL2_RAM_QUEUE:
3700+
*p_resc_num = MAX_NUM_LL2_RX_RAM_QUEUES / num_funcs;
3701+
break;
3702+
case QED_LL2_CTX_QUEUE:
3703+
*p_resc_num = MAX_NUM_LL2_RX_CTX_QUEUES / num_funcs;
36963704
break;
36973705
case QED_RDMA_CNQ_RAM:
36983706
case QED_CMDQS_CQS:

‎drivers/net/ethernet/qlogic/qed/qed_hsi.h‎

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ enum core_event_opcode {
9898
CORE_EVENT_RX_QUEUE_STOP,
9999
CORE_EVENT_RX_QUEUE_FLUSH,
100100
CORE_EVENT_TX_QUEUE_UPDATE,
101+
CORE_EVENT_QUEUE_STATS_QUERY,
101102
MAX_CORE_EVENT_OPCODE
102103
};
103104

@@ -116,21 +117,21 @@ struct core_ll2_port_stats {
116117
struct regpair gsi_crcchksm_error;
117118
};
118119

119-
/* Ethernet TX Per Queue Stats */
120+
/* LL2 TX Per Queue Stats */
120121
struct core_ll2_pstorm_per_queue_stat {
121122
struct regpair sent_ucast_bytes;
122123
struct regpair sent_mcast_bytes;
123124
struct regpair sent_bcast_bytes;
124125
struct regpair sent_ucast_pkts;
125126
struct regpair sent_mcast_pkts;
126127
struct regpair sent_bcast_pkts;
128+
struct regpair error_drop_pkts;
127129
};
128130

129131
/* Light-L2 RX Producers in Tstorm RAM */
130132
struct core_ll2_rx_prod {
131133
__le16 bd_prod;
132134
__le16 cqe_prod;
133-
__le32 reserved;
134135
};
135136

136137
struct core_ll2_tstorm_per_queue_stat {
@@ -147,6 +148,18 @@ struct core_ll2_ustorm_per_queue_stat {
147148
struct regpair rcv_bcast_pkts;
148149
};
149150

151+
/* Structure for doorbell data, in PWM mode, for RX producers update. */
152+
struct core_pwm_prod_update_data {
153+
__le16 icid; /* internal CID */
154+
u8 reserved0;
155+
u8 params;
156+
#define CORE_PWM_PROD_UPDATE_DATA_AGG_CMD_MASK 0x3
157+
#define CORE_PWM_PROD_UPDATE_DATA_AGG_CMD_SHIFT 0
158+
#define CORE_PWM_PROD_UPDATE_DATA_RESERVED1_MASK 0x3F /* Set 0 */
159+
#define CORE_PWM_PROD_UPDATE_DATA_RESERVED1_SHIFT 2
160+
struct core_ll2_rx_prod prod; /* Producers */
161+
};
162+
150163
/* Core Ramrod Command IDs (light L2) */
151164
enum core_ramrod_cmd_id {
152165
CORE_RAMROD_UNUSED,
@@ -156,6 +169,7 @@ enum core_ramrod_cmd_id {
156169
CORE_RAMROD_TX_QUEUE_STOP,
157170
CORE_RAMROD_RX_QUEUE_FLUSH,
158171
CORE_RAMROD_TX_QUEUE_UPDATE,
172+
CORE_RAMROD_QUEUE_STATS_QUERY,
159173
MAX_CORE_RAMROD_CMD_ID
160174
};
161175

@@ -274,8 +288,11 @@ struct core_rx_start_ramrod_data {
274288
u8 mf_si_mcast_accept_all;
275289
struct core_rx_action_on_error action_on_error;
276290
u8 gsi_offload_flag;
291+
u8 vport_id_valid;
292+
u8 vport_id;
293+
u8 zero_prod_flg;
277294
u8 wipe_inner_vlan_pri_en;
278-
u8 reserved[5];
295+
u8 reserved[2];
279296
};
280297

281298
/* Ramrod data for rx queue stop ramrod */
@@ -352,8 +369,11 @@ struct core_tx_start_ramrod_data {
352369
__le16 pbl_size;
353370
__le16 qm_pq_id;
354371
u8 gsi_offload_flag;
372+
u8 ctx_stats_en;
373+
u8 vport_id_valid;
355374
u8 vport_id;
356-
u8 resrved[2];
375+
u8 enforce_security_flag;
376+
u8 reserved[7];
357377
};
358378

359379
/* Ramrod data for tx queue stop ramrod */
@@ -761,7 +781,7 @@ struct e4_tstorm_core_conn_ag_ctx {
761781
__le16 word1;
762782
__le16 word2;
763783
__le16 word3;
764-
__le32 reg9;
784+
__le32 ll2_rx_prod;
765785
__le32 reg10;
766786
};
767787

@@ -844,6 +864,11 @@ struct ustorm_core_conn_st_ctx {
844864
__le32 reserved[4];
845865
};
846866

867+
/* The core storm context for the Tstorm */
868+
struct tstorm_core_conn_st_ctx {
869+
__le32 reserved[4];
870+
};
871+
847872
/* core connection context */
848873
struct e4_core_conn_context {
849874
struct ystorm_core_conn_st_ctx ystorm_st_context;
@@ -857,6 +882,8 @@ struct e4_core_conn_context {
857882
struct mstorm_core_conn_st_ctx mstorm_st_context;
858883
struct ustorm_core_conn_st_ctx ustorm_st_context;
859884
struct regpair ustorm_st_padding[2];
885+
struct tstorm_core_conn_st_ctx tstorm_st_context;
886+
struct regpair tstorm_st_padding[2];
860887
};
861888

862889
struct eth_mstorm_per_pf_stat {
@@ -12483,6 +12510,11 @@ enum resource_id_enum {
1248312510
RESOURCE_LL2_QUEUE_E = 15,
1248412511
RESOURCE_RDMA_STATS_QUEUE_E = 16,
1248512512
RESOURCE_BDQ_E = 17,
12513+
RESOURCE_QCN_E = 18,
12514+
RESOURCE_LLH_FILTER_E = 19,
12515+
RESOURCE_VF_MAC_ADDR = 20,
12516+
RESOURCE_LL2_CQS_E = 21,
12517+
RESOURCE_VF_CNQS = 22,
1248612518
RESOURCE_MAX_NUM,
1248712519
RESOURCE_NUM_INVALID = 0xFFFFFFFF
1248812520
};

‎drivers/net/ethernet/qlogic/qed/qed_iscsi.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ qed_sp_iscsi_func_start(struct qed_hwfn *p_hwfn,
213213
p_init->num_sq_pages_in_ring = p_params->num_sq_pages_in_ring;
214214
p_init->num_r2tq_pages_in_ring = p_params->num_r2tq_pages_in_ring;
215215
p_init->num_uhq_pages_in_ring = p_params->num_uhq_pages_in_ring;
216-
p_init->ll2_rx_queue_id = p_hwfn->hw_info.resc_start[QED_LL2_QUEUE] +
217-
p_params->ll2_ooo_queue_id;
216+
p_init->ll2_rx_queue_id =
217+
p_hwfn->hw_info.resc_start[QED_LL2_RAM_QUEUE] +
218+
p_params->ll2_ooo_queue_id;
218219

219220
p_init->func_params.log_page_size = p_params->log_page_size;
220221
val = p_params->num_tasks;

‎drivers/net/ethernet/qlogic/qed/qed_iwarp.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ qed_iwarp_init_fw_ramrod(struct qed_hwfn *p_hwfn,
137137
struct iwarp_init_func_ramrod_data *p_ramrod)
138138
{
139139
p_ramrod->iwarp.ll2_ooo_q_index =
140-
RESC_START(p_hwfn, QED_LL2_QUEUE) +
141-
p_hwfn->p_rdma_info->iwarp.ll2_ooo_handle;
140+
RESC_START(p_hwfn, QED_LL2_RAM_QUEUE) +
141+
p_hwfn->p_rdma_info->iwarp.ll2_ooo_handle;
142142

143143
p_ramrod->tcp.max_fin_rt = QED_IWARP_MAX_FIN_RT_DEFAULT;
144144

@@ -2651,6 +2651,8 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
26512651

26522652
memset(&data, 0, sizeof(data));
26532653
data.input.conn_type = QED_LL2_TYPE_IWARP;
2654+
/* SYN will use ctx based queues */
2655+
data.input.rx_conn_type = QED_LL2_RX_TYPE_CTX;
26542656
data.input.mtu = params->max_mtu;
26552657
data.input.rx_num_desc = QED_IWARP_LL2_SYN_RX_SIZE;
26562658
data.input.tx_num_desc = QED_IWARP_LL2_SYN_TX_SIZE;
@@ -2683,6 +2685,8 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
26832685

26842686
/* Start OOO connection */
26852687
data.input.conn_type = QED_LL2_TYPE_OOO;
2688+
/* OOO/unaligned will use legacy ll2 queues (ram based) */
2689+
data.input.rx_conn_type = QED_LL2_RX_TYPE_LEGACY;
26862690
data.input.mtu = params->max_mtu;
26872691

26882692
n_ooo_bufs = (QED_IWARP_MAX_OOO * rcv_wnd_size) /

0 commit comments

Comments
 (0)