Commit f436baf3 authored by Michal Kalderon's avatar Michal Kalderon Committed by David S. Miller

qed: Fix iWARP out of order flow

Out of order flow is not working for iWARP.
This patch got cut out from initial series that added out
of order support for iWARP.

Make out of order code common for iWARP and iSCSI.
Add new configuration option CONFIG_QED_OOO. Set by
qedr and qedi Kconfigs.

Fixes: d1abfd0b ("qed: Add iWARP out of order support")
Signed-off-by: default avatarMichal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: default avatarManish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: default avatarAriel Elior <Ariel.Elior@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30d240df
...@@ -2,6 +2,7 @@ config INFINIBAND_QEDR ...@@ -2,6 +2,7 @@ config INFINIBAND_QEDR
tristate "QLogic RoCE driver" tristate "QLogic RoCE driver"
depends on 64BIT && QEDE depends on 64BIT && QEDE
select QED_LL2 select QED_LL2
select QED_OOO
select QED_RDMA select QED_RDMA
---help--- ---help---
This driver provides low-level InfiniBand over Ethernet This driver provides low-level InfiniBand over Ethernet
......
...@@ -117,4 +117,7 @@ config QED_ISCSI ...@@ -117,4 +117,7 @@ config QED_ISCSI
config QED_FCOE config QED_FCOE
bool bool
config QED_OOO
bool
endif # NET_VENDOR_QLOGIC endif # NET_VENDOR_QLOGIC
...@@ -6,5 +6,6 @@ qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \ ...@@ -6,5 +6,6 @@ qed-y := qed_cxt.o qed_dev.o qed_hw.o qed_init_fw_funcs.o qed_init_ops.o \
qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o qed-$(CONFIG_QED_SRIOV) += qed_sriov.o qed_vf.o
qed-$(CONFIG_QED_LL2) += qed_ll2.o qed-$(CONFIG_QED_LL2) += qed_ll2.o
qed-$(CONFIG_QED_RDMA) += qed_roce.o qed_rdma.o qed_iwarp.o qed-$(CONFIG_QED_RDMA) += qed_roce.o qed_rdma.o qed_iwarp.o
qed-$(CONFIG_QED_ISCSI) += qed_iscsi.o qed_ooo.o qed-$(CONFIG_QED_ISCSI) += qed_iscsi.o
qed-$(CONFIG_QED_FCOE) += qed_fcoe.o qed-$(CONFIG_QED_FCOE) += qed_fcoe.o
qed-$(CONFIG_QED_OOO) += qed_ooo.o
...@@ -1410,13 +1410,18 @@ int qed_iwarp_alloc(struct qed_hwfn *p_hwfn) ...@@ -1410,13 +1410,18 @@ int qed_iwarp_alloc(struct qed_hwfn *p_hwfn)
INIT_LIST_HEAD(&p_hwfn->p_rdma_info->iwarp.ep_free_list); INIT_LIST_HEAD(&p_hwfn->p_rdma_info->iwarp.ep_free_list);
spin_lock_init(&p_hwfn->p_rdma_info->iwarp.iw_lock); spin_lock_init(&p_hwfn->p_rdma_info->iwarp.iw_lock);
return qed_iwarp_prealloc_ep(p_hwfn, true); rc = qed_iwarp_prealloc_ep(p_hwfn, true);
if (rc)
return rc;
return qed_ooo_alloc(p_hwfn);
} }
void qed_iwarp_resc_free(struct qed_hwfn *p_hwfn) void qed_iwarp_resc_free(struct qed_hwfn *p_hwfn)
{ {
struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp;
qed_ooo_free(p_hwfn);
qed_rdma_bmap_free(p_hwfn, &p_hwfn->p_rdma_info->tcp_cid_map, 1); qed_rdma_bmap_free(p_hwfn, &p_hwfn->p_rdma_info->tcp_cid_map, 1);
kfree(iwarp_info->mpa_bufs); kfree(iwarp_info->mpa_bufs);
kfree(iwarp_info->partial_fpdus); kfree(iwarp_info->partial_fpdus);
......
...@@ -103,18 +103,28 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn) ...@@ -103,18 +103,28 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn)
{ {
u16 max_num_archipelagos = 0, cid_base; u16 max_num_archipelagos = 0, cid_base;
struct qed_ooo_info *p_ooo_info; struct qed_ooo_info *p_ooo_info;
enum protocol_type proto;
u16 max_num_isles = 0; u16 max_num_isles = 0;
u32 i; u32 i;
if (p_hwfn->hw_info.personality != QED_PCI_ISCSI) { switch (p_hwfn->hw_info.personality) {
case QED_PCI_ISCSI:
proto = PROTOCOLID_ISCSI;
break;
case QED_PCI_ETH_RDMA:
case QED_PCI_ETH_IWARP:
proto = PROTOCOLID_IWARP;
break;
default:
DP_NOTICE(p_hwfn, DP_NOTICE(p_hwfn,
"Failed to allocate qed_ooo_info: unknown personality\n"); "Failed to allocate qed_ooo_info: unknown personality\n");
return -EINVAL; return -EINVAL;
} }
max_num_archipelagos = p_hwfn->pf_params.iscsi_pf_params.num_cons; max_num_archipelagos = (u16)qed_cxt_get_proto_cid_count(p_hwfn, proto,
NULL);
max_num_isles = QED_MAX_NUM_ISLES + max_num_archipelagos; max_num_isles = QED_MAX_NUM_ISLES + max_num_archipelagos;
cid_base = (u16)qed_cxt_get_proto_cid_start(p_hwfn, PROTOCOLID_ISCSI); cid_base = (u16)qed_cxt_get_proto_cid_start(p_hwfn, proto);
if (!max_num_archipelagos) { if (!max_num_archipelagos) {
DP_NOTICE(p_hwfn, DP_NOTICE(p_hwfn,
......
...@@ -83,7 +83,7 @@ struct qed_ooo_info { ...@@ -83,7 +83,7 @@ struct qed_ooo_info {
u16 cid_base; u16 cid_base;
}; };
#if IS_ENABLED(CONFIG_QED_ISCSI) #if IS_ENABLED(CONFIG_QED_OOO)
void qed_ooo_save_history_entry(struct qed_hwfn *p_hwfn, void qed_ooo_save_history_entry(struct qed_hwfn *p_hwfn,
struct qed_ooo_info *p_ooo_info, struct qed_ooo_info *p_ooo_info,
struct ooo_opaque *p_cqe); struct ooo_opaque *p_cqe);
......
...@@ -4,6 +4,7 @@ config QEDI ...@@ -4,6 +4,7 @@ config QEDI
depends on QED depends on QED
select SCSI_ISCSI_ATTRS select SCSI_ISCSI_ATTRS
select QED_LL2 select QED_LL2
select QED_OOO
select QED_ISCSI select QED_ISCSI
select ISCSI_BOOT_SYSFS select ISCSI_BOOT_SYSFS
---help--- ---help---
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment