Skip to content

Commit

Permalink
qed: Fix iWARP out of order flow
Browse files Browse the repository at this point in the history
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: d1abfd0 ("qed: Add iWARP out of order support")

Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michal Kalderon authored and David S. Miller committed Oct 19, 2017
1 parent 30d240d commit f436baf
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/hw/qedr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ config INFINIBAND_QEDR
tristate "QLogic RoCE driver"
depends on 64BIT && QEDE
select QED_LL2
select QED_OOO
select QED_RDMA
---help---
This driver provides low-level InfiniBand over Ethernet
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/qlogic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@ config QED_ISCSI
config QED_FCOE
bool

config QED_OOO
bool

endif # NET_VENDOR_QLOGIC
3 changes: 2 additions & 1 deletion drivers/net/ethernet/qlogic/qed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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_LL2) += qed_ll2.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_OOO) += qed_ooo.o
7 changes: 6 additions & 1 deletion drivers/net/ethernet/qlogic/qed/qed_iwarp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
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)
{
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);
kfree(iwarp_info->mpa_bufs);
kfree(iwarp_info->partial_fpdus);
Expand Down
16 changes: 13 additions & 3 deletions drivers/net/ethernet/qlogic/qed/qed_ooo.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,28 @@ int qed_ooo_alloc(struct qed_hwfn *p_hwfn)
{
u16 max_num_archipelagos = 0, cid_base;
struct qed_ooo_info *p_ooo_info;
enum protocol_type proto;
u16 max_num_isles = 0;
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,
"Failed to allocate qed_ooo_info: unknown personality\n");
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;
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) {
DP_NOTICE(p_hwfn,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qed/qed_ooo.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct qed_ooo_info {
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,
struct qed_ooo_info *p_ooo_info,
struct ooo_opaque *p_cqe);
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/qedi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ config QEDI
depends on QED
select SCSI_ISCSI_ATTRS
select QED_LL2
select QED_OOO
select QED_ISCSI
select ISCSI_BOOT_SYSFS
---help---
Expand Down

0 comments on commit f436baf

Please sign in to comment.