Skip to content

Commit fbbfa34

Browse files
committed
Merge branch 'qed-fixes'
Yuval Mintz says: ==================== qed: Fix dependencies and warnings series The first patch in this series follows Dan Carpenter's reports about Smatch warnings for recent qed additions and fixes those. The second patch is the most significant one [and the reason this is ntended for 'net'] - it's based on Arnd Bermann's suggestion for fixing compilation issues that were introduced with the roce addition as a result of certain combinations of qed, qede and qedr Kconfig options. The third follows the discussion with Arnd and clears a lot of the warnings that arise when compiling the drivers with "C=1". Please consider applying this series to 'net'. ==================== Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2 parents 76506a9 + 8c93bea commit fbbfa34

File tree

14 files changed

+179
-300
lines changed

14 files changed

+179
-300
lines changed

drivers/net/ethernet/qlogic/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,14 @@ config QEDE
107107
---help---
108108
This enables the support for ...
109109

110+
config QED_RDMA
111+
bool
112+
110113
config INFINIBAND_QEDR
111114
tristate "QLogic qede RoCE sources [debug]"
112115
depends on QEDE && 64BIT
113116
select QED_LL2
117+
select QED_RDMA
114118
default n
115119
---help---
116120
This provides a temporary node that allows the compilation

drivers/net/ethernet/qlogic/qed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \
55
qed_selftest.o qed_dcbx.o qed_debug.o
66
qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o
77
qed-$(CONFIG_QED_LL2) += qed_ll2.o
8-
qed-$(CONFIG_INFINIBAND_QEDR) += qed_roce.o
8+
qed-$(CONFIG_QED_RDMA) += qed_roce.o

drivers/net/ethernet/qlogic/qed/qed_cxt.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,8 @@
4747
#define TM_ALIGN BIT(TM_SHIFT)
4848
#define TM_ELEM_SIZE 4
4949

50-
/* ILT constants */
51-
#if IS_ENABLED(CONFIG_INFINIBAND_QEDR)
5250
/* For RoCE we configure to 64K to cover for RoCE max tasks 256K purpose. */
53-
#define ILT_DEFAULT_HW_P_SIZE 4
54-
#else
55-
#define ILT_DEFAULT_HW_P_SIZE 3
56-
#endif
51+
#define ILT_DEFAULT_HW_P_SIZE (IS_ENABLED(CONFIG_QED_RDMA) ? 4 : 3)
5752

5853
#define ILT_PAGE_IN_BYTES(hw_p_size) (1U << ((hw_p_size) + 12))
5954
#define ILT_CFG_REG(cli, reg) PSWRQ2_REG_ ## cli ## _ ## reg ## _RT_OFFSET
@@ -349,14 +344,14 @@ static struct qed_tid_seg *qed_cxt_tid_seg_info(struct qed_hwfn *p_hwfn,
349344
return NULL;
350345
}
351346

352-
void qed_cxt_set_srq_count(struct qed_hwfn *p_hwfn, u32 num_srqs)
347+
static void qed_cxt_set_srq_count(struct qed_hwfn *p_hwfn, u32 num_srqs)
353348
{
354349
struct qed_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr;
355350

356351
p_mgr->srq_count = num_srqs;
357352
}
358353

359-
u32 qed_cxt_get_srq_count(struct qed_hwfn *p_hwfn)
354+
static u32 qed_cxt_get_srq_count(struct qed_hwfn *p_hwfn)
360355
{
361356
struct qed_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr;
362357

@@ -1804,8 +1799,8 @@ int qed_cxt_get_cid_info(struct qed_hwfn *p_hwfn, struct qed_cxt_info *p_info)
18041799
return 0;
18051800
}
18061801

1807-
void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
1808-
struct qed_rdma_pf_params *p_params)
1802+
static void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
1803+
struct qed_rdma_pf_params *p_params)
18091804
{
18101805
u32 num_cons, num_tasks, num_qps, num_mrs, num_srqs;
18111806
enum protocol_type proto;

drivers/net/ethernet/qlogic/qed/qed_debug.c

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ struct phy_defs {
405405
/***************************** Constant Arrays *******************************/
406406

407407
/* Debug arrays */
408-
static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {0} };
408+
static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {NULL} };
409409

410410
/* Chip constant definitions array */
411411
static struct chip_defs s_chip_defs[MAX_CHIP_IDS] = {
@@ -4028,10 +4028,10 @@ static enum dbg_status qed_mcp_trace_read_meta(struct qed_hwfn *p_hwfn,
40284028
}
40294029

40304030
/* Dump MCP Trace */
4031-
enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
4032-
struct qed_ptt *p_ptt,
4033-
u32 *dump_buf,
4034-
bool dump, u32 *num_dumped_dwords)
4031+
static enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
4032+
struct qed_ptt *p_ptt,
4033+
u32 *dump_buf,
4034+
bool dump, u32 *num_dumped_dwords)
40354035
{
40364036
u32 trace_data_grc_addr, trace_data_size_bytes, trace_data_size_dwords;
40374037
u32 trace_meta_size_dwords, running_bundle_id, offset = 0;
@@ -4130,10 +4130,10 @@ enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
41304130
}
41314131

41324132
/* Dump GRC FIFO */
4133-
enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
4134-
struct qed_ptt *p_ptt,
4135-
u32 *dump_buf,
4136-
bool dump, u32 *num_dumped_dwords)
4133+
static enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
4134+
struct qed_ptt *p_ptt,
4135+
u32 *dump_buf,
4136+
bool dump, u32 *num_dumped_dwords)
41374137
{
41384138
u32 offset = 0, dwords_read, size_param_offset;
41394139
bool fifo_has_data;
@@ -4192,10 +4192,10 @@ enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
41924192
}
41934193

41944194
/* Dump IGU FIFO */
4195-
enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
4196-
struct qed_ptt *p_ptt,
4197-
u32 *dump_buf,
4198-
bool dump, u32 *num_dumped_dwords)
4195+
static enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
4196+
struct qed_ptt *p_ptt,
4197+
u32 *dump_buf,
4198+
bool dump, u32 *num_dumped_dwords)
41994199
{
42004200
u32 offset = 0, dwords_read, size_param_offset;
42014201
bool fifo_has_data;
@@ -4255,10 +4255,11 @@ enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
42554255
}
42564256

42574257
/* Protection Override dump */
4258-
enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn,
4259-
struct qed_ptt *p_ptt,
4260-
u32 *dump_buf,
4261-
bool dump, u32 *num_dumped_dwords)
4258+
static enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn,
4259+
struct qed_ptt *p_ptt,
4260+
u32 *dump_buf,
4261+
bool dump,
4262+
u32 *num_dumped_dwords)
42624263
{
42634264
u32 offset = 0, size_param_offset, override_window_dwords;
42644265

@@ -6339,10 +6340,11 @@ enum dbg_status qed_print_fw_asserts_results(struct qed_hwfn *p_hwfn,
63396340
}
63406341

63416342
/* Wrapper for unifying the idle_chk and mcp_trace api */
6342-
enum dbg_status qed_print_idle_chk_results_wrapper(struct qed_hwfn *p_hwfn,
6343-
u32 *dump_buf,
6344-
u32 num_dumped_dwords,
6345-
char *results_buf)
6343+
static enum dbg_status
6344+
qed_print_idle_chk_results_wrapper(struct qed_hwfn *p_hwfn,
6345+
u32 *dump_buf,
6346+
u32 num_dumped_dwords,
6347+
char *results_buf)
63466348
{
63476349
u32 num_errors, num_warnnings;
63486350

@@ -6413,8 +6415,8 @@ static void qed_dbg_print_feature(u8 *p_text_buf, u32 text_size)
64136415

64146416
#define QED_RESULTS_BUF_MIN_SIZE 16
64156417
/* Generic function for decoding debug feature info */
6416-
enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
6417-
enum qed_dbg_features feature_idx)
6418+
static enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
6419+
enum qed_dbg_features feature_idx)
64186420
{
64196421
struct qed_dbg_feature *feature =
64206422
&p_hwfn->cdev->dbg_params.features[feature_idx];
@@ -6480,8 +6482,9 @@ enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
64806482
}
64816483

64826484
/* Generic function for performing the dump of a debug feature. */
6483-
enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
6484-
enum qed_dbg_features feature_idx)
6485+
static enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn,
6486+
struct qed_ptt *p_ptt,
6487+
enum qed_dbg_features feature_idx)
64856488
{
64866489
struct qed_dbg_feature *feature =
64876490
&p_hwfn->cdev->dbg_params.features[feature_idx];

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,13 @@ int qed_resc_alloc(struct qed_dev *cdev)
497497
if (p_hwfn->hw_info.personality == QED_PCI_ETH_ROCE) {
498498
num_cons = qed_cxt_get_proto_cid_count(p_hwfn,
499499
PROTOCOLID_ROCE,
500-
0) * 2;
500+
NULL) * 2;
501501
n_eqes += num_cons + 2 * MAX_NUM_VFS_BB;
502502
} else if (p_hwfn->hw_info.personality == QED_PCI_ISCSI) {
503503
num_cons =
504504
qed_cxt_get_proto_cid_count(p_hwfn,
505-
PROTOCOLID_ISCSI, 0);
505+
PROTOCOLID_ISCSI,
506+
NULL);
506507
n_eqes += 2 * num_cons;
507508
}
508509

@@ -1422,19 +1423,19 @@ static void qed_hw_set_feat(struct qed_hwfn *p_hwfn)
14221423
u32 *feat_num = p_hwfn->hw_info.feat_num;
14231424
int num_features = 1;
14241425

1425-
#if IS_ENABLED(CONFIG_INFINIBAND_QEDR)
1426-
/* Roce CNQ each requires: 1 status block + 1 CNQ. We divide the
1427-
* status blocks equally between L2 / RoCE but with consideration as
1428-
* to how many l2 queues / cnqs we have
1429-
*/
1430-
if (p_hwfn->hw_info.personality == QED_PCI_ETH_ROCE) {
1426+
if (IS_ENABLED(CONFIG_QED_RDMA) &&
1427+
p_hwfn->hw_info.personality == QED_PCI_ETH_ROCE) {
1428+
/* Roce CNQ each requires: 1 status block + 1 CNQ. We divide
1429+
* the status blocks equally between L2 / RoCE but with
1430+
* consideration as to how many l2 queues / cnqs we have.
1431+
*/
14311432
num_features++;
14321433

14331434
feat_num[QED_RDMA_CNQ] =
14341435
min_t(u32, RESC_NUM(p_hwfn, QED_SB) / num_features,
14351436
RESC_NUM(p_hwfn, QED_RDMA_CNQ_RAM));
14361437
}
1437-
#endif
1438+
14381439
feat_num[QED_PF_L2_QUE] = min_t(u32, RESC_NUM(p_hwfn, QED_SB) /
14391440
num_features,
14401441
RESC_NUM(p_hwfn, QED_L2_QUEUE));

drivers/net/ethernet/qlogic/qed/qed_ll2.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "qed_mcp.h"
3939
#include "qed_reg_addr.h"
4040
#include "qed_sp.h"
41+
#include "qed_roce.h"
4142

4243
#define QED_LL2_RX_REGISTERED(ll2) ((ll2)->rx_queue.b_cb_registred)
4344
#define QED_LL2_TX_REGISTERED(ll2) ((ll2)->tx_queue.b_cb_registred)
@@ -140,11 +141,11 @@ static void qed_ll2_kill_buffers(struct qed_dev *cdev)
140141
qed_ll2_dealloc_buffer(cdev, buffer);
141142
}
142143

143-
void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn,
144-
u8 connection_handle,
145-
struct qed_ll2_rx_packet *p_pkt,
146-
struct core_rx_fast_path_cqe *p_cqe,
147-
bool b_last_packet)
144+
static void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn,
145+
u8 connection_handle,
146+
struct qed_ll2_rx_packet *p_pkt,
147+
struct core_rx_fast_path_cqe *p_cqe,
148+
bool b_last_packet)
148149
{
149150
u16 packet_length = le16_to_cpu(p_cqe->packet_length);
150151
struct qed_ll2_buffer *buffer = p_pkt->cookie;
@@ -515,7 +516,7 @@ static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie)
515516
return rc;
516517
}
517518

518-
void qed_ll2_rxq_flush(struct qed_hwfn *p_hwfn, u8 connection_handle)
519+
static void qed_ll2_rxq_flush(struct qed_hwfn *p_hwfn, u8 connection_handle)
519520
{
520521
struct qed_ll2_info *p_ll2_conn = NULL;
521522
struct qed_ll2_rx_packet *p_pkt = NULL;
@@ -1123,9 +1124,6 @@ static void qed_ll2_prepare_tx_packet_set_bd(struct qed_hwfn *p_hwfn,
11231124
DMA_REGPAIR_LE(start_bd->addr, first_frag);
11241125
start_bd->nbytes = cpu_to_le16(first_frag_len);
11251126

1126-
SET_FIELD(start_bd->bd_flags.as_bitfield, CORE_TX_BD_FLAGS_ROCE_FLAV,
1127-
type);
1128-
11291127
DP_VERBOSE(p_hwfn,
11301128
(NETIF_MSG_TX_QUEUED | QED_MSG_LL2),
11311129
"LL2 [q 0x%02x cid 0x%08x type 0x%08x] Tx Producer at [0x%04x] - set with a %04x bytes %02x BDs buffer at %08x:%08x\n",

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -293,24 +293,4 @@ void qed_ll2_setup(struct qed_hwfn *p_hwfn,
293293
*/
294294
void qed_ll2_free(struct qed_hwfn *p_hwfn,
295295
struct qed_ll2_info *p_ll2_connections);
296-
void qed_ll2b_complete_rx_gsi_packet(struct qed_hwfn *p_hwfn,
297-
u8 connection_handle,
298-
void *cookie,
299-
dma_addr_t rx_buf_addr,
300-
u16 data_length,
301-
u8 data_length_error,
302-
u16 parse_flags,
303-
u16 vlan,
304-
u32 src_mac_addr_hi,
305-
u16 src_mac_addr_lo, bool b_last_packet);
306-
void qed_ll2b_complete_tx_gsi_packet(struct qed_hwfn *p_hwfn,
307-
u8 connection_handle,
308-
void *cookie,
309-
dma_addr_t first_frag_addr,
310-
bool b_last_fragment, bool b_last_packet);
311-
void qed_ll2b_release_tx_gsi_packet(struct qed_hwfn *p_hwfn,
312-
u8 connection_handle,
313-
void *cookie,
314-
dma_addr_t first_frag_addr,
315-
bool b_last_fragment, bool b_last_packet);
316296
#endif

drivers/net/ethernet/qlogic/qed/qed_main.c

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@
3333
#include "qed_hw.h"
3434
#include "qed_selftest.h"
3535

36-
#if IS_ENABLED(CONFIG_INFINIBAND_QEDR)
3736
#define QED_ROCE_QPS (8192)
3837
#define QED_ROCE_DPIS (8)
39-
#endif
4038

4139
static char version[] =
4240
"QLogic FastLinQ 4xxxx Core Module qed " DRV_MODULE_VERSION "\n";
@@ -682,9 +680,7 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev,
682680
enum qed_int_mode int_mode)
683681
{
684682
struct qed_sb_cnt_info sb_cnt_info;
685-
#if IS_ENABLED(CONFIG_INFINIBAND_QEDR)
686-
int num_l2_queues;
687-
#endif
683+
int num_l2_queues = 0;
688684
int rc;
689685
int i;
690686

@@ -715,8 +711,9 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev,
715711
cdev->int_params.fp_msix_cnt = cdev->int_params.out.num_vectors -
716712
cdev->num_hwfns;
717713

718-
#if IS_ENABLED(CONFIG_INFINIBAND_QEDR)
719-
num_l2_queues = 0;
714+
if (!IS_ENABLED(CONFIG_QED_RDMA))
715+
return 0;
716+
720717
for_each_hwfn(cdev, i)
721718
num_l2_queues += FEAT_NUM(&cdev->hwfns[i], QED_PF_L2_QUE);
722719

@@ -738,7 +735,6 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev,
738735
DP_VERBOSE(cdev, QED_MSG_RDMA, "roce_msix_cnt=%d roce_msix_base=%d\n",
739736
cdev->int_params.rdma_msix_cnt,
740737
cdev->int_params.rdma_msix_base);
741-
#endif
742738

743739
return 0;
744740
}
@@ -843,18 +839,20 @@ static void qed_update_pf_params(struct qed_dev *cdev,
843839
{
844840
int i;
845841

846-
#if IS_ENABLED(CONFIG_INFINIBAND_QEDR)
847-
params->rdma_pf_params.num_qps = QED_ROCE_QPS;
848-
params->rdma_pf_params.min_dpis = QED_ROCE_DPIS;
849-
/* divide by 3 the MRs to avoid MF ILT overflow */
850-
params->rdma_pf_params.num_mrs = RDMA_MAX_TIDS;
851-
params->rdma_pf_params.gl_pi = QED_ROCE_PROTOCOL_INDEX;
852-
#endif
853842
for (i = 0; i < cdev->num_hwfns; i++) {
854843
struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
855844

856845
p_hwfn->pf_params = *params;
857846
}
847+
848+
if (!IS_ENABLED(CONFIG_QED_RDMA))
849+
return;
850+
851+
params->rdma_pf_params.num_qps = QED_ROCE_QPS;
852+
params->rdma_pf_params.min_dpis = QED_ROCE_DPIS;
853+
/* divide by 3 the MRs to avoid MF ILT overflow */
854+
params->rdma_pf_params.num_mrs = RDMA_MAX_TIDS;
855+
params->rdma_pf_params.gl_pi = QED_ROCE_PROTOCOL_INDEX;
858856
}
859857

860858
static int qed_slowpath_start(struct qed_dev *cdev,
@@ -1432,7 +1430,7 @@ static int qed_set_led(struct qed_dev *cdev, enum qed_led_mode mode)
14321430
return status;
14331431
}
14341432

1435-
struct qed_selftest_ops qed_selftest_ops_pass = {
1433+
static struct qed_selftest_ops qed_selftest_ops_pass = {
14361434
.selftest_memory = &qed_selftest_memory,
14371435
.selftest_interrupt = &qed_selftest_interrupt,
14381436
.selftest_register = &qed_selftest_register,

0 commit comments

Comments
 (0)