Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbbfa34c authored by David S. Miller's avatar David S. Miller
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 76506a98 8c93beaf
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -107,10 +107,14 @@ config QEDE
	---help---
	  This enables the support for ...

config QED_RDMA
	bool

config INFINIBAND_QEDR
	tristate "QLogic qede RoCE sources [debug]"
	depends on QEDE && 64BIT
	select QED_LL2
	select QED_RDMA
	default n
	---help---
	  This provides a temporary node that allows the compilation
+1 −1
Original line number Diff line number Diff line
@@ -5,4 +5,4 @@ qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \
	 qed_selftest.o qed_dcbx.o qed_debug.o
qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o
qed-$(CONFIG_QED_LL2) += qed_ll2.o
qed-$(CONFIG_INFINIBAND_QEDR) += qed_roce.o
qed-$(CONFIG_QED_RDMA) += qed_roce.o
+5 −10
Original line number Diff line number Diff line
@@ -47,13 +47,8 @@
#define TM_ALIGN        BIT(TM_SHIFT)
#define TM_ELEM_SIZE    4

/* ILT constants */
#if IS_ENABLED(CONFIG_INFINIBAND_QEDR)
/* For RoCE we configure to 64K to cover for RoCE max tasks 256K purpose. */
#define ILT_DEFAULT_HW_P_SIZE		4
#else
#define ILT_DEFAULT_HW_P_SIZE		3
#endif
#define ILT_DEFAULT_HW_P_SIZE	(IS_ENABLED(CONFIG_QED_RDMA) ? 4 : 3)

#define ILT_PAGE_IN_BYTES(hw_p_size)	(1U << ((hw_p_size) + 12))
#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,
	return NULL;
}

void qed_cxt_set_srq_count(struct qed_hwfn *p_hwfn, u32 num_srqs)
static void qed_cxt_set_srq_count(struct qed_hwfn *p_hwfn, u32 num_srqs)
{
	struct qed_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr;

	p_mgr->srq_count = num_srqs;
}

u32 qed_cxt_get_srq_count(struct qed_hwfn *p_hwfn)
static u32 qed_cxt_get_srq_count(struct qed_hwfn *p_hwfn)
{
	struct qed_cxt_mngr *p_mgr = p_hwfn->p_cxt_mngr;

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

void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
static void qed_rdma_set_pf_params(struct qed_hwfn *p_hwfn,
				   struct qed_rdma_pf_params *p_params)
{
	u32 num_cons, num_tasks, num_qps, num_mrs, num_srqs;
+28 −25
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ struct phy_defs {
/***************************** Constant Arrays *******************************/

/* Debug arrays */
static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {0} };
static struct dbg_array s_dbg_arrays[MAX_BIN_DBG_BUFFER_TYPE] = { {NULL} };

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

/* Dump MCP Trace */
enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
static enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
					  struct qed_ptt *p_ptt,
					  u32 *dump_buf,
					  bool dump, u32 *num_dumped_dwords)
@@ -4130,7 +4130,7 @@ enum dbg_status qed_mcp_trace_dump(struct qed_hwfn *p_hwfn,
}

/* Dump GRC FIFO */
enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
static enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
					 struct qed_ptt *p_ptt,
					 u32 *dump_buf,
					 bool dump, u32 *num_dumped_dwords)
@@ -4192,7 +4192,7 @@ enum dbg_status qed_reg_fifo_dump(struct qed_hwfn *p_hwfn,
}

/* Dump IGU FIFO */
enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
static enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
					 struct qed_ptt *p_ptt,
					 u32 *dump_buf,
					 bool dump, u32 *num_dumped_dwords)
@@ -4255,10 +4255,11 @@ enum dbg_status qed_igu_fifo_dump(struct qed_hwfn *p_hwfn,
}

/* Protection Override dump */
enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn,
static enum dbg_status qed_protection_override_dump(struct qed_hwfn *p_hwfn,
						    struct qed_ptt *p_ptt,
						    u32 *dump_buf,
					     bool dump, u32 *num_dumped_dwords)
						    bool dump,
						    u32 *num_dumped_dwords)
{
	u32 offset = 0, size_param_offset, override_window_dwords;

@@ -6339,7 +6340,8 @@ enum dbg_status qed_print_fw_asserts_results(struct qed_hwfn *p_hwfn,
}

/* Wrapper for unifying the idle_chk and mcp_trace api */
enum dbg_status qed_print_idle_chk_results_wrapper(struct qed_hwfn *p_hwfn,
static enum dbg_status
qed_print_idle_chk_results_wrapper(struct qed_hwfn *p_hwfn,
				   u32 *dump_buf,
				   u32 num_dumped_dwords,
				   char *results_buf)
@@ -6413,7 +6415,7 @@ static void qed_dbg_print_feature(u8 *p_text_buf, u32 text_size)

#define QED_RESULTS_BUF_MIN_SIZE 16
/* Generic function for decoding debug feature info */
enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
static enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
				      enum qed_dbg_features feature_idx)
{
	struct qed_dbg_feature *feature =
@@ -6480,7 +6482,8 @@ enum dbg_status format_feature(struct qed_hwfn *p_hwfn,
}

/* Generic function for performing the dump of a debug feature. */
enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
static enum dbg_status qed_dbg_dump(struct qed_hwfn *p_hwfn,
				    struct qed_ptt *p_ptt,
				    enum qed_dbg_features feature_idx)
{
	struct qed_dbg_feature *feature =
+10 −9
Original line number Diff line number Diff line
@@ -497,12 +497,13 @@ int qed_resc_alloc(struct qed_dev *cdev)
		if (p_hwfn->hw_info.personality == QED_PCI_ETH_ROCE) {
			num_cons = qed_cxt_get_proto_cid_count(p_hwfn,
							       PROTOCOLID_ROCE,
							       0) * 2;
							       NULL) * 2;
			n_eqes += num_cons + 2 * MAX_NUM_VFS_BB;
		} else if (p_hwfn->hw_info.personality == QED_PCI_ISCSI) {
			num_cons =
			    qed_cxt_get_proto_cid_count(p_hwfn,
							PROTOCOLID_ISCSI, 0);
							PROTOCOLID_ISCSI,
							NULL);
			n_eqes += 2 * num_cons;
		}

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

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

		feat_num[QED_RDMA_CNQ] =
			min_t(u32, RESC_NUM(p_hwfn, QED_SB) / num_features,
			      RESC_NUM(p_hwfn, QED_RDMA_CNQ_RAM));
	}
#endif

	feat_num[QED_PF_L2_QUE] = min_t(u32, RESC_NUM(p_hwfn, QED_SB) /
						num_features,
					RESC_NUM(p_hwfn, QED_L2_QUEUE));
Loading