qlnx: purge EOL release compatibility
Drop code that supproted FreeBSD 10 and 11. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560
This commit is contained in:
parent
097e192a9c
commit
bbe35708ad
@ -35,16 +35,7 @@
|
||||
#include <sys/bitstring.h>
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#if __FreeBSD_version >= 1200032
|
||||
#include <linux/bitmap.h>
|
||||
#else
|
||||
#if __FreeBSD_version >= 1100090
|
||||
#include <compat/linuxkpi/common/include/linux/bitops.h>
|
||||
#else
|
||||
#include <ofed/include/linux/bitops.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define OSAL_NUM_CPUS() mp_ncpus
|
||||
/*
|
||||
@ -481,34 +472,12 @@ qlnx_test_and_change_bit(long bit, volatile unsigned long *var)
|
||||
|
||||
val = *var;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
if (val & bit)
|
||||
return (test_and_clear_bit(bit, var));
|
||||
|
||||
return (test_and_set_bit(bit, var));
|
||||
#else
|
||||
if (val & bit)
|
||||
return (test_and_clear_bit(bit, (long *)var));
|
||||
|
||||
return (test_and_set_bit(bit, (long *)var));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#if __FreeBSD_version < 1100000
|
||||
static inline unsigned
|
||||
bitmap_weight(unsigned long *bitmap, unsigned nbits)
|
||||
{
|
||||
unsigned bit;
|
||||
unsigned retval = 0;
|
||||
|
||||
for_each_set_bit(bit, bitmap, nbits)
|
||||
retval++;
|
||||
return (retval);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define OSAL_TEST_AND_FLIP_BIT qlnx_test_and_change_bit
|
||||
#define OSAL_TEST_AND_CLEAR_BIT test_and_clear_bit
|
||||
#define OSAL_MEMCMP memcmp
|
||||
|
@ -715,17 +715,6 @@ extern int qlnx_alloc_mem_sb(qlnx_host_t *ha, struct ecore_sb_info *sb_info,
|
||||
#define QLNX_IFM_25G_CR IFM_UNKNOWN
|
||||
#endif /* #if (defined IFM_25G_SR) */
|
||||
|
||||
#if __FreeBSD_version < 1100000
|
||||
|
||||
#define QLNX_INC_IERRORS(ifp) ifp->if_ierrors++
|
||||
#define QLNX_INC_IQDROPS(ifp) ifp->if_iqdrops++
|
||||
#define QLNX_INC_IPACKETS(ifp) ifp->if_ipackets++
|
||||
#define QLNX_INC_OPACKETS(ifp) ifp->if_opackets++
|
||||
#define QLNX_INC_OBYTES(ifp, len) ifp->if_obytes += len
|
||||
#define QLNX_INC_IBYTES(ifp, len) ifp->if_ibytes += len
|
||||
|
||||
#else
|
||||
|
||||
#define QLNX_INC_IERRORS(ifp) if_inc_counter(ifp, IFCOUNTER_IERRORS, 1)
|
||||
#define QLNX_INC_IQDROPS(ifp) if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1)
|
||||
#define QLNX_INC_IPACKETS(ifp) if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1)
|
||||
@ -736,8 +725,6 @@ extern int qlnx_alloc_mem_sb(qlnx_host_t *ha, struct ecore_sb_info *sb_info,
|
||||
#define QLNX_INC_IBYTES(ifp, len) \
|
||||
if_inc_counter(ha->ifp, IFCOUNTER_IBYTES, len)
|
||||
|
||||
#endif /* #if __FreeBSD_version < 1100000 */
|
||||
|
||||
#define CQE_L3_PACKET(flags) \
|
||||
((((flags) & PARSING_AND_ERR_FLAGS_L3TYPE_MASK) == e_l3_type_ipv4) || \
|
||||
(((flags) & PARSING_AND_ERR_FLAGS_L3TYPE_MASK) == e_l3_type_ipv6))
|
||||
|
@ -152,9 +152,7 @@ static int qlnx_alloc_tpa_mbuf(qlnx_host_t *ha, uint16_t rx_buf_size,
|
||||
struct qlnx_agg_info *tpa);
|
||||
static void qlnx_free_tpa_mbuf(qlnx_host_t *ha, struct qlnx_agg_info *tpa);
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
static uint64_t qlnx_get_counter(if_t ifp, ift_counter cnt);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Hooks to the Operating Systems
|
||||
@ -274,12 +272,6 @@ SYSCTL_NODE(_hw, OID_AUTO, qlnxe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
|
||||
/* Number of Queues: 0 (Auto) or 1 to 32 (fixed queue number) */
|
||||
static int qlnxe_queue_count = QLNX_DEFAULT_RSS;
|
||||
|
||||
#if __FreeBSD_version < 1100000
|
||||
|
||||
TUNABLE_INT("hw.qlnxe.queue_count", &qlnxe_queue_count);
|
||||
|
||||
#endif
|
||||
|
||||
SYSCTL_INT(_hw_qlnxe, OID_AUTO, queue_count, CTLFLAG_RDTUN,
|
||||
&qlnxe_queue_count, 0, "Multi-Queue queue count");
|
||||
|
||||
@ -304,20 +296,9 @@ SYSCTL_INT(_hw_qlnxe, OID_AUTO, queue_count, CTLFLAG_RDTUN,
|
||||
/* RDMA configuration; 64bit field allows setting for 16 physical functions*/
|
||||
static uint64_t qlnxe_rdma_configuration = 0x22222222;
|
||||
|
||||
#if __FreeBSD_version < 1100000
|
||||
|
||||
TUNABLE_QUAD("hw.qlnxe.rdma_configuration", &qlnxe_rdma_configuration);
|
||||
|
||||
SYSCTL_UQUAD(_hw_qlnxe, OID_AUTO, rdma_configuration, CTLFLAG_RDTUN,
|
||||
&qlnxe_rdma_configuration, 0, "RDMA Configuration");
|
||||
|
||||
#else
|
||||
|
||||
SYSCTL_U64(_hw_qlnxe, OID_AUTO, rdma_configuration, CTLFLAG_RDTUN,
|
||||
&qlnxe_rdma_configuration, 0, "RDMA Configuration");
|
||||
|
||||
#endif /* #if __FreeBSD_version < 1100000 */
|
||||
|
||||
int
|
||||
qlnx_vf_device(qlnx_host_t *ha)
|
||||
{
|
||||
@ -2333,8 +2314,6 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha)
|
||||
|
||||
device_id = pci_get_device(ha->pci_dev);
|
||||
|
||||
#if __FreeBSD_version >= 1000000
|
||||
|
||||
if (device_id == QLOGIC_PCI_DEVICE_ID_1634)
|
||||
ifp->if_baudrate = IF_Gbps(40);
|
||||
else if ((device_id == QLOGIC_PCI_DEVICE_ID_1656) ||
|
||||
@ -2346,11 +2325,6 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha)
|
||||
ifp->if_baudrate = IF_Gbps(100);
|
||||
|
||||
ifp->if_capabilities = IFCAP_LINKSTATE;
|
||||
#else
|
||||
ifp->if_mtu = ETHERMTU;
|
||||
ifp->if_baudrate = (1 * 1000 * 1000 *1000);
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1000000 */
|
||||
|
||||
ifp->if_init = qlnx_init;
|
||||
ifp->if_softc = ha;
|
||||
@ -2363,9 +2337,7 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha)
|
||||
ifp->if_snd.ifq_drv_maxlen = qlnx_get_ifq_snd_maxlen(ha);
|
||||
IFQ_SET_READY(&ifp->if_snd);
|
||||
|
||||
#if __FreeBSD_version >= 1100036
|
||||
if_setgetcounterfn(ifp, qlnx_get_counter);
|
||||
#endif
|
||||
|
||||
ha->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
|
||||
|
||||
@ -2789,8 +2761,6 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
VLAN_CAPABILITIES(ifp);
|
||||
break;
|
||||
|
||||
#if (__FreeBSD_version >= 1100101)
|
||||
|
||||
case SIOCGI2C:
|
||||
{
|
||||
struct ifi2creq i2c;
|
||||
@ -2838,7 +2808,6 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
i2c.data[4], i2c.data[5], i2c.data[6], i2c.data[7]);
|
||||
break;
|
||||
}
|
||||
#endif /* #if (__FreeBSD_version >= 1100101) */
|
||||
|
||||
default:
|
||||
QL_DPRINT4(ha, "default (0x%lx)\n", cmd);
|
||||
@ -3085,11 +3054,7 @@ qlnx_transmit(struct ifnet *ifp, struct mbuf *mp)
|
||||
|
||||
QL_DPRINT2(ha, "enter\n");
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
if (M_HASHTYPE_GET(mp) != M_HASHTYPE_NONE)
|
||||
#else
|
||||
if (mp->m_flags & M_FLOWID)
|
||||
#endif
|
||||
rss_id = (mp->m_pkthdr.flowid % ECORE_RSS_IND_TABLE_SIZE) %
|
||||
ha->num_rss;
|
||||
|
||||
@ -3971,9 +3936,7 @@ qlnx_tpa_start(qlnx_host_t *ha,
|
||||
bus_dmamap_t map;
|
||||
struct eth_rx_bd *rx_bd;
|
||||
int i;
|
||||
#if __FreeBSD_version >= 1100000
|
||||
uint8_t hash_type;
|
||||
#endif /* #if __FreeBSD_version >= 1100000 */
|
||||
|
||||
agg_index = cqe->tpa_agg_index;
|
||||
|
||||
@ -4225,8 +4188,6 @@ qlnx_tpa_start(qlnx_host_t *ha,
|
||||
//mp->m_pkthdr.flowid = fp->rss_id;
|
||||
mp->m_pkthdr.flowid = cqe->rss_hash;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
|
||||
hash_type = cqe->bitfields &
|
||||
(ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_MASK <<
|
||||
ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_SHIFT);
|
||||
@ -4253,10 +4214,6 @@ qlnx_tpa_start(qlnx_host_t *ha,
|
||||
break;
|
||||
}
|
||||
|
||||
#else
|
||||
mp->m_flags |= M_FLOWID;
|
||||
#endif
|
||||
|
||||
mp->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID |
|
||||
CSUM_DATA_VALID | CSUM_PSEUDO_HDR);
|
||||
|
||||
@ -4600,9 +4557,7 @@ qlnx_rx_int(qlnx_host_t *ha, struct qlnx_fastpath *fp, int budget,
|
||||
enum eth_rx_cqe_type cqe_type;
|
||||
uint16_t len, pad, len_on_first_bd;
|
||||
uint8_t *data;
|
||||
#if __FreeBSD_version >= 1100000
|
||||
uint8_t hash_type;
|
||||
#endif /* #if __FreeBSD_version >= 1100000 */
|
||||
|
||||
/* Get the CQE from the completion ring */
|
||||
cqe = (union eth_rx_cqe *)
|
||||
@ -4742,8 +4697,6 @@ qlnx_rx_int(qlnx_host_t *ha, struct qlnx_fastpath *fp, int budget,
|
||||
|
||||
mp->m_pkthdr.flowid = fp_cqe->rss_hash;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
|
||||
hash_type = fp_cqe->bitfields &
|
||||
(ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_MASK <<
|
||||
ETH_FAST_PATH_RX_REG_CQE_RSS_HASH_TYPE_SHIFT);
|
||||
@ -4770,10 +4723,6 @@ qlnx_rx_int(qlnx_host_t *ha, struct qlnx_fastpath *fp, int budget,
|
||||
break;
|
||||
}
|
||||
|
||||
#else
|
||||
mp->m_flags |= M_FLOWID;
|
||||
#endif
|
||||
|
||||
if (CQE_L3_PACKET(fp_cqe->pars_flags.flags)) {
|
||||
mp->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
|
||||
}
|
||||
@ -4797,22 +4746,10 @@ qlnx_rx_int(qlnx_host_t *ha, struct qlnx_fastpath *fp, int budget,
|
||||
QLNX_INC_IBYTES(ifp, len);
|
||||
|
||||
#ifdef QLNX_SOFT_LRO
|
||||
|
||||
if (lro_enable) {
|
||||
#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
|
||||
|
||||
if (lro_enable)
|
||||
tcp_lro_queue_mbuf(lro, mp);
|
||||
|
||||
#else
|
||||
|
||||
if (tcp_lro_rx(lro, mp, 0))
|
||||
(*ifp->if_input)(ifp, mp);
|
||||
|
||||
#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
|
||||
|
||||
} else {
|
||||
else
|
||||
(*ifp->if_input)(ifp, mp);
|
||||
}
|
||||
#else
|
||||
|
||||
(*ifp->if_input)(ifp, mp);
|
||||
@ -4932,7 +4869,6 @@ qlnx_fp_isr(void *arg)
|
||||
lro = &fp->rxq->lro;
|
||||
|
||||
if (lro_enable && total_rx_count) {
|
||||
#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
|
||||
|
||||
#ifdef QLNX_TRACE_LRO_CNT
|
||||
if (lro->lro_mbuf_count & ~1023)
|
||||
@ -4948,17 +4884,6 @@ qlnx_fp_isr(void *arg)
|
||||
#endif /* #ifdef QLNX_TRACE_LRO_CNT */
|
||||
|
||||
tcp_lro_flush_all(lro);
|
||||
|
||||
#else
|
||||
struct lro_entry *queued;
|
||||
|
||||
while ((!SLIST_EMPTY(&lro->lro_active))) {
|
||||
queued = SLIST_FIRST(&lro->lro_active);
|
||||
SLIST_REMOVE_HEAD(&lro->lro_active, \
|
||||
next);
|
||||
tcp_lro_flush(lro, queued);
|
||||
}
|
||||
#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
|
||||
}
|
||||
}
|
||||
#endif /* #ifdef QLNX_SOFT_LRO */
|
||||
@ -6287,19 +6212,11 @@ qlnx_alloc_mem_rxq(qlnx_host_t *ha, struct qlnx_rx_queue *rxq)
|
||||
|
||||
lro = &rxq->lro;
|
||||
|
||||
#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
|
||||
if (tcp_lro_init_args(lro, ifp, 0, rxq->num_rx_buffers)) {
|
||||
QL_DPRINT1(ha, "tcp_lro_init[%d] failed\n",
|
||||
rxq->rxq_id);
|
||||
goto err;
|
||||
}
|
||||
#else
|
||||
if (tcp_lro_init(lro)) {
|
||||
QL_DPRINT1(ha, "tcp_lro_init[%d] failed\n",
|
||||
rxq->rxq_id);
|
||||
goto err;
|
||||
}
|
||||
#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
|
||||
|
||||
lro->ifp = ha->ifp;
|
||||
}
|
||||
@ -7197,7 +7114,6 @@ qlnx_set_link(qlnx_host_t *ha, bool link_up)
|
||||
return (rc);
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
static uint64_t
|
||||
qlnx_get_counter(if_t ifp, ift_counter cnt)
|
||||
{
|
||||
@ -7262,7 +7178,6 @@ qlnx_get_counter(if_t ifp, ift_counter cnt)
|
||||
}
|
||||
return (count);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
qlnx_timer(void *arg)
|
||||
@ -7382,20 +7297,7 @@ qlnx_drain_soft_lro(qlnx_host_t *ha)
|
||||
|
||||
lro = &fp->rxq->lro;
|
||||
|
||||
#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
|
||||
|
||||
tcp_lro_flush_all(lro);
|
||||
|
||||
#else
|
||||
struct lro_entry *queued;
|
||||
|
||||
while ((!SLIST_EMPTY(&lro->lro_active))){
|
||||
queued = SLIST_FIRST(&lro->lro_active);
|
||||
SLIST_REMOVE_HEAD(&lro->lro_active, next);
|
||||
tcp_lro_flush(lro, queued);
|
||||
}
|
||||
|
||||
#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,10 +50,6 @@
|
||||
#include <machine/_inttypes.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
#if __FreeBSD_version < 1000000
|
||||
#error FreeBSD Version not supported - use version >= 1000000
|
||||
#endif
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_arp.h>
|
||||
|
@ -494,11 +494,9 @@ qlnxr_gsi_build_header(struct qlnxr_dev *dev,
|
||||
u16 vlan_id = 0;
|
||||
u16 ether_type;
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
int rc = 0;
|
||||
int ip_ver = 0;
|
||||
bool has_udp = false;
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
#if !DEFINE_IB_AH_ATTR_WITH_DMAC
|
||||
u8 mac[ETH_ALEN];
|
||||
@ -517,8 +515,6 @@ qlnxr_gsi_build_header(struct qlnxr_dev *dev,
|
||||
else
|
||||
sgid = dev->sgid_tbl[0];
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
rc = ib_ud_header_init(send_size, false /* LRH */, true /* ETH */,
|
||||
has_vlan, has_grh_ipv6, ip_ver, has_udp,
|
||||
0 /* immediate */, udh);
|
||||
@ -528,12 +524,6 @@ qlnxr_gsi_build_header(struct qlnxr_dev *dev,
|
||||
return rc;
|
||||
}
|
||||
|
||||
#else
|
||||
ib_ud_header_init(send_size, false /* LRH */, true /* ETH */,
|
||||
has_vlan, has_grh_ipv6, 0 /* immediate */, udh);
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
/* ENET + VLAN headers*/
|
||||
#if DEFINE_IB_AH_ATTR_WITH_DMAC
|
||||
memcpy(udh->eth.dmac_h, ah_attr->dmac, ETH_ALEN);
|
||||
@ -846,7 +836,6 @@ qlnxr_gsi_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
|
||||
wc[i].byte_len = qp->rqe_wr_id[qp->rq.cons].sg_list[0].length;
|
||||
wc[i].wc_flags |= IB_WC_GRH | IB_WC_IP_CSUM_OK;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
memcpy(&wc[i].smac, qp->rqe_wr_id[qp->rq.cons].smac, ETH_ALEN);
|
||||
wc[i].wc_flags |= IB_WC_WITH_SMAC;
|
||||
|
||||
@ -855,7 +844,6 @@ qlnxr_gsi_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
|
||||
wc[i].vlan_id = qp->rqe_wr_id[qp->rq.cons].vlan_id;
|
||||
}
|
||||
|
||||
#endif
|
||||
qlnxr_inc_sw_cons(&qp->rq);
|
||||
i++;
|
||||
}
|
||||
|
@ -42,20 +42,10 @@
|
||||
#define ETH_P_ROCE (0x8915)
|
||||
#define QLNXR_ROCE_V2_UDP_SPORT (0000)
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
#define rdma_wr(_wr) rdma_wr(_wr)
|
||||
#define ud_wr(_wr) ud_wr(_wr)
|
||||
#define atomic_wr(_wr) atomic_wr(_wr)
|
||||
|
||||
#else
|
||||
|
||||
#define rdma_wr(_wr) (&(_wr->wr.rdma))
|
||||
#define ud_wr(_wr) (&(_wr->wr.ud))
|
||||
#define atomic_wr(_wr) (&(_wr->wr.atomic))
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
static inline u32 qlnxr_get_ipv4_from_gid(u8 *gid)
|
||||
{
|
||||
return *(u32 *)(void *)&gid[12];
|
||||
|
@ -67,10 +67,6 @@
|
||||
#include <rdma/ib_sa.h>
|
||||
#include <rdma/uverbs_ioctl.h>
|
||||
|
||||
#if __FreeBSD_version < 1100000
|
||||
#undef MODULE_VERSION
|
||||
#endif
|
||||
|
||||
#include "qlnx_os.h"
|
||||
#include "bcm_osal.h"
|
||||
|
||||
@ -627,11 +623,7 @@ struct mr_info {
|
||||
u32 completed_handled;
|
||||
};
|
||||
|
||||
#if __FreeBSD_version < 1102000
|
||||
#define DEFINE_IB_FAST_REG
|
||||
#else
|
||||
#define DEFINE_ALLOC_MR
|
||||
#endif
|
||||
|
||||
#ifdef DEFINE_IB_FAST_REG
|
||||
struct qlnxr_fast_reg_page_list {
|
||||
@ -649,11 +641,7 @@ struct qlnxr_qp {
|
||||
|
||||
u32 max_inline_data;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
spinlock_t q_lock ____cacheline_aligned;
|
||||
#else
|
||||
spinlock_t q_lock;
|
||||
#endif
|
||||
|
||||
struct qlnxr_cq *sq_cq;
|
||||
struct qlnxr_cq *rq_cq;
|
||||
@ -899,12 +887,7 @@ extern int qlnx_rdma_ll2_set_mac_filter(void *rdma_ctx, uint8_t *old_mac_address
|
||||
#define QLNXR_ROCE_PKEY_TABLE_LEN 1
|
||||
#define QLNXR_ROCE_PKEY_DEFAULT 0xffff
|
||||
|
||||
#if __FreeBSD_version < 1100000
|
||||
#define DEFINE_IB_AH_ATTR_WITH_DMAC (0)
|
||||
#define DEFINE_IB_UMEM_WITH_CHUNK (1)
|
||||
#else
|
||||
#define DEFINE_IB_AH_ATTR_WITH_DMAC (1)
|
||||
#endif
|
||||
|
||||
#define QLNX_IS_IWARP(rdev) IS_IWARP(ECORE_LEADING_HWFN(rdev->cdev))
|
||||
#define QLNX_IS_ROCE(rdev) IS_ROCE(ECORE_LEADING_HWFN(rdev->cdev))
|
||||
|
@ -248,16 +248,9 @@ qlnxr_register_device(qlnxr_dev_t *dev)
|
||||
ibdev->dereg_mr = qlnxr_dereg_mr;
|
||||
ibdev->reg_user_mr = qlnxr_reg_user_mr;
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
ibdev->alloc_mr = qlnxr_alloc_mr;
|
||||
ibdev->map_mr_sg = qlnxr_map_mr_sg;
|
||||
ibdev->get_port_immutable = qlnxr_get_port_immutable;
|
||||
#else
|
||||
ibdev->reg_phys_mr = qlnxr_reg_kernel_mr;
|
||||
ibdev->alloc_fast_reg_mr = qlnxr_alloc_frmr;
|
||||
ibdev->alloc_fast_reg_page_list = qlnxr_alloc_frmr_page_list;
|
||||
ibdev->free_fast_reg_page_list = qlnxr_free_frmr_page_list;
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
ibdev->poll_cq = qlnxr_poll_cq;
|
||||
ibdev->post_send = qlnxr_post_send;
|
||||
@ -281,14 +274,9 @@ qlnxr_register_device(qlnxr_dev_t *dev)
|
||||
iwcm->accept = qlnxr_iw_accept;
|
||||
iwcm->reject = qlnxr_iw_reject;
|
||||
|
||||
#if (__FreeBSD_version >= 1004000) && (__FreeBSD_version < 1102000)
|
||||
|
||||
iwcm->create_listen_ep = qlnxr_iw_create_listen;
|
||||
iwcm->destroy_listen_ep = qlnxr_iw_destroy_listen;
|
||||
#else
|
||||
iwcm->create_listen = qlnxr_iw_create_listen;
|
||||
iwcm->destroy_listen = __qlnxr_iw_destroy_listen;
|
||||
#endif
|
||||
|
||||
iwcm->add_ref = qlnxr_iw_qp_add_ref;
|
||||
iwcm->rem_ref = qlnxr_iw_qp_rem_ref;
|
||||
iwcm->get_qp = qlnxr_iw_get_qp;
|
||||
@ -949,27 +937,6 @@ static bool qlnxr_del_sgid(struct qlnxr_dev *dev, union ib_gid *gid)
|
||||
return found;
|
||||
}
|
||||
|
||||
#if __FreeBSD_version < 1100000
|
||||
|
||||
static inline int
|
||||
is_vlan_dev(struct ifnet *ifp)
|
||||
{
|
||||
return (ifp->if_type == IFT_L2VLAN);
|
||||
}
|
||||
|
||||
static inline uint16_t
|
||||
vlan_dev_vlan_id(struct ifnet *ifp)
|
||||
{
|
||||
uint16_t vtag;
|
||||
|
||||
if (VLAN_TAG(ifp, &vtag) == 0)
|
||||
return (vtag);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#endif /* #if __FreeBSD_version < 1100000 */
|
||||
|
||||
static void
|
||||
qlnxr_add_sgids(struct qlnxr_dev *dev)
|
||||
{
|
||||
@ -1342,9 +1309,6 @@ static moduledata_t qlnxr_mod_info = {
|
||||
MODULE_VERSION(qlnxr, 1);
|
||||
MODULE_DEPEND(qlnxr, if_qlnxe, 1, 1, 1);
|
||||
MODULE_DEPEND(qlnxr, ibcore, 1, 1, 1);
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
MODULE_DEPEND(qlnxr, linuxkpi, 1, 1, 1);
|
||||
#endif /* #if __FreeBSD_version >= 1100000 */
|
||||
|
||||
DECLARE_MODULE(qlnxr, qlnxr_mod_info, SI_SUB_LAST, SI_ORDER_ANY);
|
||||
|
@ -469,13 +469,8 @@ qlnxr_post_srq_recv(struct ib_srq *ibsrq, const struct ib_recv_wr *wr,
|
||||
}
|
||||
|
||||
int
|
||||
#if __FreeBSD_version < 1102000
|
||||
qlnxr_query_device(struct ib_device *ibdev, struct ib_device_attr *attr)
|
||||
#else
|
||||
qlnxr_query_device(struct ib_device *ibdev, struct ib_device_attr *attr,
|
||||
struct ib_udata *udata)
|
||||
#endif /* #if __FreeBSD_version < 1102000 */
|
||||
|
||||
{
|
||||
struct qlnxr_dev *dev;
|
||||
struct ecore_rdma_device *qattr;
|
||||
@ -486,10 +481,8 @@ qlnxr_query_device(struct ib_device *ibdev, struct ib_device_attr *attr,
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
#if __FreeBSD_version > 1102000
|
||||
if (udata->inlen || udata->outlen)
|
||||
return -EINVAL;
|
||||
#endif /* #if __FreeBSD_version > 1102000 */
|
||||
|
||||
if (dev->rdma_ctx == NULL) {
|
||||
return -EINVAL;
|
||||
@ -820,16 +813,14 @@ qlnxr_get_vlan_id_qp(qlnx_host_t *ha, struct ib_qp_attr *attr, int attr_mask,
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
u16 tmp_vlan_id;
|
||||
|
||||
union ib_gid *dgid;
|
||||
|
||||
QL_DPRINT12(ha, "enter \n");
|
||||
|
||||
*vlan_id = 0;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
u16 tmp_vlan_id;
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
union ib_gid *dgid;
|
||||
|
||||
dgid = &attr->ah_attr.grh.dgid;
|
||||
tmp_vlan_id = (dgid->raw[11] << 8) | dgid->raw[12];
|
||||
|
||||
@ -837,20 +828,6 @@ qlnxr_get_vlan_id_qp(qlnx_host_t *ha, struct ib_qp_attr *attr, int attr_mask,
|
||||
*vlan_id = tmp_vlan_id;
|
||||
ret = true;
|
||||
}
|
||||
#else
|
||||
tmp_vlan_id = attr->vlan_id;
|
||||
|
||||
if ((attr_mask & IB_QP_VID) && (!(tmp_vlan_id & ~EVL_VLID_MASK))) {
|
||||
*vlan_id = tmp_vlan_id;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
#endif /* #if __FreeBSD_version > 1102000 */
|
||||
|
||||
#else
|
||||
ret = true;
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1100000 */
|
||||
|
||||
QL_DPRINT12(ha, "exit vlan_id = 0x%x ret = %d \n", *vlan_id, ret);
|
||||
|
||||
@ -1060,11 +1037,7 @@ qlnxr_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
|
||||
|
||||
ha = dev->ha;
|
||||
|
||||
#if __FreeBSD_version > 1102000
|
||||
unmapped_db = dev->db_phys_addr + (ucontext->dpi * ucontext->dpi_size);
|
||||
#else
|
||||
unmapped_db = dev->db_phys_addr;
|
||||
#endif /* #if __FreeBSD_version > 1102000 */
|
||||
|
||||
QL_DPRINT12(ha, "qedr_mmap enter vm_page=0x%lx"
|
||||
" vm_pgoff=0x%lx unmapped_db=0x%llx db_size=%x, len=%lx\n",
|
||||
@ -1087,8 +1060,6 @@ qlnxr_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
|
||||
|
||||
QL_DPRINT12(ha, "Mapping doorbell bar\n");
|
||||
|
||||
#if __FreeBSD_version > 1102000
|
||||
|
||||
if ((vm_page < unmapped_db) ||
|
||||
((vm_page + len) > (unmapped_db + ucontext->dpi_size))) {
|
||||
QL_DPRINT11(ha, "failed pages are outside of dpi;"
|
||||
@ -1106,24 +1077,6 @@ qlnxr_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
|
||||
rc = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, len,
|
||||
vma->vm_page_prot);
|
||||
|
||||
#else
|
||||
|
||||
if ((vm_page >= unmapped_db) && (vm_page <= (unmapped_db +
|
||||
dev->db_size))) {
|
||||
QL_DPRINT12(ha, "Mapping doorbell bar\n");
|
||||
|
||||
vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
|
||||
|
||||
rc = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
|
||||
PAGE_SIZE, vma->vm_page_prot);
|
||||
} else {
|
||||
QL_DPRINT12(ha, "Mapping chains\n");
|
||||
rc = io_remap_pfn_range(vma, vma->vm_start,
|
||||
vma->vm_pgoff, len, vma->vm_page_prot);
|
||||
}
|
||||
|
||||
#endif /* #if __FreeBSD_version > 1102000 */
|
||||
|
||||
QL_DPRINT12(ha, "exit [%d]\n", rc);
|
||||
return rc;
|
||||
}
|
||||
@ -1514,13 +1467,8 @@ qlnxr_init_mr_info(struct qlnxr_dev *dev, struct mr_info *info,
|
||||
}
|
||||
|
||||
struct ib_mr *
|
||||
#if __FreeBSD_version >= 1102000
|
||||
qlnxr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len,
|
||||
u64 usr_addr, int acc, struct ib_udata *udata)
|
||||
#else
|
||||
qlnxr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len,
|
||||
u64 usr_addr, int acc, struct ib_udata *udata, int mr_id)
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
{
|
||||
int rc = -ENOMEM;
|
||||
struct qlnxr_dev *dev = get_qlnxr_dev((ibpd->device));
|
||||
@ -1592,11 +1540,7 @@ qlnxr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len,
|
||||
mr->hw_mr.pbl_page_size_log = ilog2(mr->info.pbl_info.pbl_size);
|
||||
mr->hw_mr.page_size_log = ilog2(mr->umem->page_size); /* for the MR pages */
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
mr->hw_mr.fbo = ib_umem_offset(mr->umem);
|
||||
#else
|
||||
mr->hw_mr.fbo = mr->umem->offset;
|
||||
#endif
|
||||
mr->hw_mr.length = len;
|
||||
mr->hw_mr.vaddr = usr_addr;
|
||||
mr->hw_mr.zbva = false; /* TBD figure when this should be true */
|
||||
@ -1802,10 +1746,8 @@ qlnxr_create_cq(struct ib_cq *ibcq,
|
||||
struct ecore_rdma_create_cq_in_params params;
|
||||
struct qlnxr_create_cq_ureq ureq;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
int vector = attr->comp_vector;
|
||||
int entries = attr->cqe;
|
||||
#endif
|
||||
struct qlnxr_cq *cq = get_qlnxr_cq(ibcq);
|
||||
int chain_entries, rc, page_cnt;
|
||||
u64 pbl_ptr;
|
||||
@ -2030,10 +1972,6 @@ qlnxr_check_qp_attrs(struct ib_pd *ibpd,
|
||||
QL_DPRINT12(ha, "attrs->qp_type = %d\n", attrs->qp_type);
|
||||
QL_DPRINT12(ha, "attrs->create_flags = %d\n", attrs->create_flags);
|
||||
|
||||
#if __FreeBSD_version < 1102000
|
||||
QL_DPRINT12(ha, "attrs->qpg_type = %d\n", attrs->qpg_type);
|
||||
#endif
|
||||
|
||||
QL_DPRINT12(ha, "attrs->port_num = %d\n", attrs->port_num);
|
||||
QL_DPRINT12(ha, "attrs->cap.max_send_wr = 0x%x\n", attrs->cap.max_send_wr);
|
||||
QL_DPRINT12(ha, "attrs->cap.max_recv_wr = 0x%x\n", attrs->cap.max_recv_wr);
|
||||
@ -2042,11 +1980,6 @@ qlnxr_check_qp_attrs(struct ib_pd *ibpd,
|
||||
QL_DPRINT12(ha, "attrs->cap.max_inline_data = 0x%x\n",
|
||||
attrs->cap.max_inline_data);
|
||||
|
||||
#if __FreeBSD_version < 1102000
|
||||
QL_DPRINT12(ha, "attrs->cap.qpg_tss_mask_sz = 0x%x\n",
|
||||
attrs->cap.qpg_tss_mask_sz);
|
||||
#endif
|
||||
|
||||
QL_DPRINT12(ha, "\n\nqattr->vendor_id = 0x%x\n", qattr->vendor_id);
|
||||
QL_DPRINT12(ha, "qattr->vendor_part_id = 0x%x\n", qattr->vendor_part_id);
|
||||
QL_DPRINT12(ha, "qattr->hw_ver = 0x%x\n", qattr->hw_ver);
|
||||
@ -4225,8 +4158,6 @@ qlnx_handle_completed_mrs(struct qlnxr_dev *dev, struct mr_info *info)
|
||||
return;
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
static int qlnxr_prepare_reg(struct qlnxr_qp *qp,
|
||||
struct rdma_sq_fmr_wqe_1st *fwqe1,
|
||||
const struct ib_reg_wr *wr)
|
||||
@ -4265,163 +4196,6 @@ static int qlnxr_prepare_reg(struct qlnxr_qp *qp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void
|
||||
build_frmr_pbes(struct qlnxr_dev *dev, const struct ib_send_wr *wr,
|
||||
struct mr_info *info)
|
||||
{
|
||||
int i;
|
||||
u64 buf_addr = 0;
|
||||
int num_pbes, total_num_pbes = 0;
|
||||
struct regpair *pbe;
|
||||
struct qlnxr_pbl *pbl_tbl = info->pbl_table;
|
||||
struct qlnxr_pbl_info *pbl_info = &info->pbl_info;
|
||||
qlnx_host_t *ha;
|
||||
|
||||
ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
pbe = (struct regpair *)pbl_tbl->va;
|
||||
num_pbes = 0;
|
||||
|
||||
for (i = 0; i < wr->wr.fast_reg.page_list_len; i++) {
|
||||
buf_addr = wr->wr.fast_reg.page_list->page_list[i];
|
||||
pbe->lo = cpu_to_le32((u32)buf_addr);
|
||||
pbe->hi = cpu_to_le32((u32)upper_32_bits(buf_addr));
|
||||
|
||||
num_pbes += 1;
|
||||
pbe++;
|
||||
total_num_pbes++;
|
||||
|
||||
if (total_num_pbes == pbl_info->num_pbes)
|
||||
return;
|
||||
|
||||
/* if the given pbl is full storing the pbes,
|
||||
* move to next pbl.
|
||||
*/
|
||||
if (num_pbes ==
|
||||
(pbl_info->pbl_size / sizeof(u64))) {
|
||||
pbl_tbl++;
|
||||
pbe = (struct regpair *)pbl_tbl->va;
|
||||
num_pbes = 0;
|
||||
}
|
||||
}
|
||||
QL_DPRINT12(ha, "exit\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
qlnxr_prepare_safe_pbl(struct qlnxr_dev *dev, struct mr_info *info)
|
||||
{
|
||||
int rc = 0;
|
||||
qlnx_host_t *ha;
|
||||
|
||||
ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
if (info->completed == 0) {
|
||||
//DP_VERBOSE(dev, QLNXR_MSG_MR, "First FMR\n");
|
||||
/* first fmr */
|
||||
return 0;
|
||||
}
|
||||
|
||||
qlnx_handle_completed_mrs(dev, info);
|
||||
|
||||
list_add_tail(&info->pbl_table->list_entry, &info->inuse_pbl_list);
|
||||
|
||||
if (list_empty(&info->free_pbl_list)) {
|
||||
info->pbl_table = qlnxr_alloc_pbl_tbl(dev, &info->pbl_info,
|
||||
GFP_ATOMIC);
|
||||
} else {
|
||||
info->pbl_table = list_first_entry(&info->free_pbl_list,
|
||||
struct qlnxr_pbl,
|
||||
list_entry);
|
||||
list_del(&info->pbl_table->list_entry);
|
||||
}
|
||||
|
||||
if (!info->pbl_table)
|
||||
rc = -ENOMEM;
|
||||
|
||||
QL_DPRINT12(ha, "exit\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline int
|
||||
qlnxr_prepare_fmr(struct qlnxr_qp *qp,
|
||||
struct rdma_sq_fmr_wqe_1st *fwqe1,
|
||||
const struct ib_send_wr *wr)
|
||||
{
|
||||
struct qlnxr_dev *dev = qp->dev;
|
||||
u64 fbo;
|
||||
struct qlnxr_fast_reg_page_list *frmr_list =
|
||||
get_qlnxr_frmr_list(wr->wr.fast_reg.page_list);
|
||||
struct rdma_sq_fmr_wqe *fwqe2 =
|
||||
(struct rdma_sq_fmr_wqe *)ecore_chain_produce(&qp->sq.pbl);
|
||||
int rc = 0;
|
||||
qlnx_host_t *ha;
|
||||
|
||||
ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
if (wr->wr.fast_reg.page_list_len == 0)
|
||||
BUG();
|
||||
|
||||
rc = qlnxr_prepare_safe_pbl(dev, &frmr_list->info);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
fwqe1->addr.hi = upper_32_bits(wr->wr.fast_reg.iova_start);
|
||||
fwqe1->addr.lo = lower_32_bits(wr->wr.fast_reg.iova_start);
|
||||
fwqe1->l_key = wr->wr.fast_reg.rkey;
|
||||
|
||||
SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_REMOTE_READ,
|
||||
!!(wr->wr.fast_reg.access_flags & IB_ACCESS_REMOTE_READ));
|
||||
SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_REMOTE_WRITE,
|
||||
!!(wr->wr.fast_reg.access_flags & IB_ACCESS_REMOTE_WRITE));
|
||||
SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_ENABLE_ATOMIC,
|
||||
!!(wr->wr.fast_reg.access_flags & IB_ACCESS_REMOTE_ATOMIC));
|
||||
SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_LOCAL_READ, 1);
|
||||
SET_FIELD2(fwqe2->access_ctrl, RDMA_SQ_FMR_WQE_LOCAL_WRITE,
|
||||
!!(wr->wr.fast_reg.access_flags & IB_ACCESS_LOCAL_WRITE));
|
||||
|
||||
fwqe2->fmr_ctrl = 0;
|
||||
|
||||
SET_FIELD2(fwqe2->fmr_ctrl, RDMA_SQ_FMR_WQE_2ND_PAGE_SIZE_LOG,
|
||||
ilog2(1 << wr->wr.fast_reg.page_shift) - 12);
|
||||
SET_FIELD2(fwqe2->fmr_ctrl, RDMA_SQ_FMR_WQE_2ND_ZERO_BASED, 0);
|
||||
|
||||
fwqe2->length_hi = 0; /* Todo - figure this out... why length is only 32bit.. */
|
||||
fwqe2->length_lo = wr->wr.fast_reg.length;
|
||||
fwqe2->pbl_addr.hi = upper_32_bits(frmr_list->info.pbl_table->pa);
|
||||
fwqe2->pbl_addr.lo = lower_32_bits(frmr_list->info.pbl_table->pa);
|
||||
|
||||
/* produce another wqe for fwqe3 */
|
||||
ecore_chain_produce(&qp->sq.pbl);
|
||||
|
||||
fbo = wr->wr.fast_reg.iova_start -
|
||||
(wr->wr.fast_reg.page_list->page_list[0] & PAGE_MASK);
|
||||
|
||||
QL_DPRINT12(ha, "wr.fast_reg.iova_start = %p rkey=%x addr=%x:%x"
|
||||
" length = %x pbl_addr %x:%x\n",
|
||||
wr->wr.fast_reg.iova_start, wr->wr.fast_reg.rkey,
|
||||
fwqe1->addr.hi, fwqe1->addr.lo, fwqe2->length_lo,
|
||||
fwqe2->pbl_addr.hi, fwqe2->pbl_addr.lo);
|
||||
|
||||
build_frmr_pbes(dev, wr, &frmr_list->info);
|
||||
|
||||
qp->wqe_wr_id[qp->sq.prod].frmr = frmr_list;
|
||||
|
||||
QL_DPRINT12(ha, "exit\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
static enum ib_wc_opcode
|
||||
qlnxr_ib_to_wc_opcode(enum ib_wr_opcode opcode)
|
||||
{
|
||||
@ -4439,15 +4213,8 @@ qlnxr_ib_to_wc_opcode(enum ib_wr_opcode opcode)
|
||||
return IB_WC_COMP_SWAP;
|
||||
case IB_WR_ATOMIC_FETCH_AND_ADD:
|
||||
return IB_WC_FETCH_ADD;
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
case IB_WR_REG_MR:
|
||||
return IB_WC_REG_MR;
|
||||
#else
|
||||
case IB_WR_FAST_REG_MR:
|
||||
return IB_WC_FAST_REG_MR;
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
case IB_WR_LOCAL_INV:
|
||||
return IB_WC_LOCAL_INV;
|
||||
default:
|
||||
@ -4784,8 +4551,6 @@ qlnxr_post_send(struct ib_qp *ibqp,
|
||||
|
||||
break;
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
case IB_WR_REG_MR:
|
||||
|
||||
QL_DPRINT12(ha, "IB_WR_REG_MR\n");
|
||||
@ -4805,30 +4570,6 @@ qlnxr_post_send(struct ib_qp *ibqp,
|
||||
qp->prev_wqe_size = fwqe1->wqe_size;
|
||||
|
||||
break;
|
||||
#else
|
||||
case IB_WR_FAST_REG_MR:
|
||||
|
||||
QL_DPRINT12(ha, "FAST_MR (IB_WR_FAST_REG_MR)\n");
|
||||
|
||||
wqe->req_type = RDMA_SQ_REQ_TYPE_FAST_MR;
|
||||
fwqe1 = (struct rdma_sq_fmr_wqe_1st *)wqe;
|
||||
fwqe1->prev_wqe_size = 3;
|
||||
|
||||
rc = qlnxr_prepare_fmr(qp, fwqe1, wr);
|
||||
|
||||
if (rc) {
|
||||
QL_DPRINT12(ha,
|
||||
"FAST_MR (IB_WR_FAST_REG_MR) failed"
|
||||
" rc = %d\n", rc);
|
||||
*bad_wr = wr;
|
||||
break;
|
||||
}
|
||||
|
||||
qp->wqe_wr_id[qp->sq.prod].wqe_size = fwqe1->prev_wqe_size;
|
||||
qp->prev_wqe_size = fwqe1->prev_wqe_size;
|
||||
|
||||
break;
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
default:
|
||||
|
||||
@ -5037,15 +4778,9 @@ qlnxr_post_recv(struct ib_qp *ibqp,
|
||||
static inline void
|
||||
qlnxr_chk_if_fmr(struct qlnxr_qp *qp)
|
||||
{
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
if (qp->wqe_wr_id[qp->sq.cons].opcode == IB_WC_REG_MR)
|
||||
qp->wqe_wr_id[qp->sq.cons].mr->info.completed++;
|
||||
#else
|
||||
if (qp->wqe_wr_id[qp->sq.cons].opcode == IB_WC_FAST_REG_MR)
|
||||
qp->wqe_wr_id[qp->sq.cons].frmr->info.completed++;
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
}
|
||||
|
||||
static int
|
||||
@ -5096,15 +4831,9 @@ process_req(struct qlnxr_dev *dev,
|
||||
wc->byte_len = 8;
|
||||
break;
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
case IB_WC_REG_MR:
|
||||
qp->wqe_wr_id[qp->sq.cons].mr->info.completed++;
|
||||
break;
|
||||
#else
|
||||
case IB_WC_FAST_REG_MR:
|
||||
qp->wqe_wr_id[qp->sq.cons].frmr->info.completed++;
|
||||
break;
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
case IB_WC_RDMA_READ:
|
||||
case IB_WC_SEND:
|
||||
@ -5220,9 +4949,6 @@ __process_resp_one(struct qlnxr_dev *dev,
|
||||
u64 wr_id)
|
||||
{
|
||||
enum ib_wc_status wc_status = IB_WC_SUCCESS;
|
||||
#if __FreeBSD_version < 1102000
|
||||
u8 flags;
|
||||
#endif
|
||||
qlnx_host_t *ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter qp = %p resp->status = 0x%x\n",
|
||||
@ -5257,8 +4983,6 @@ __process_resp_one(struct qlnxr_dev *dev,
|
||||
break;
|
||||
|
||||
case RDMA_CQE_RESP_STS_OK:
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
if (resp->flags & QLNXR_RESP_IMM) {
|
||||
wc->ex.imm_data =
|
||||
le32_to_cpu(resp->imm_data_or_inv_r_Key);
|
||||
@ -5291,34 +5015,8 @@ __process_resp_one(struct qlnxr_dev *dev,
|
||||
"qp = %p qp->id = 0x%x cq = %p cq->icid = 0x%x\n",
|
||||
resp->flags, qp, qp->id, cq, cq->icid );
|
||||
}
|
||||
#else
|
||||
wc_status = IB_WC_SUCCESS;
|
||||
wc->byte_len = le32_to_cpu(resp->length);
|
||||
|
||||
flags = resp->flags & QLNXR_RESP_RDMA_IMM;
|
||||
|
||||
switch (flags) {
|
||||
case QLNXR_RESP_RDMA_IMM:
|
||||
/* update opcode */
|
||||
wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;
|
||||
/* fall to set imm data */
|
||||
case QLNXR_RESP_IMM:
|
||||
wc->ex.imm_data =
|
||||
le32_to_cpu(resp->imm_data_or_inv_r_Key);
|
||||
wc->wc_flags |= IB_WC_WITH_IMM;
|
||||
break;
|
||||
case QLNXR_RESP_RDMA:
|
||||
QL_DPRINT11(ha, "Invalid flags QLNXR_RESP_RDMA [0x%x]"
|
||||
"qp = %p qp->id = 0x%x cq = %p cq->icid = 0x%x\n",
|
||||
resp->flags, qp, qp->id, cq, cq->icid );
|
||||
break;
|
||||
default:
|
||||
/* valid configuration, but nothing todo here */
|
||||
;
|
||||
}
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
wc_status = IB_WC_GENERAL_ERR;
|
||||
}
|
||||
@ -5764,8 +5462,6 @@ __qlnxr_alloc_mr(struct ib_pd *ibpd, int max_page_list_len)
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
struct ib_mr *
|
||||
qlnxr_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type,
|
||||
u32 max_num_sg, struct ib_udata *udata)
|
||||
@ -5855,348 +5551,6 @@ qlnxr_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg,
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
struct ib_mr *
|
||||
qlnxr_alloc_frmr(struct ib_pd *ibpd, int max_page_list_len)
|
||||
{
|
||||
struct qlnxr_dev *dev;
|
||||
struct qlnxr_mr *mr;
|
||||
qlnx_host_t *ha;
|
||||
struct ib_mr *ibmr = NULL;
|
||||
|
||||
dev = get_qlnxr_dev((ibpd->device));
|
||||
ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
mr = __qlnxr_alloc_mr(ibpd, max_page_list_len);
|
||||
|
||||
if (IS_ERR(mr)) {
|
||||
ibmr = ERR_PTR(-EINVAL);
|
||||
} else {
|
||||
ibmr = &mr->ibmr;
|
||||
}
|
||||
|
||||
QL_DPRINT12(ha, "exit %p\n", ibmr);
|
||||
return (ibmr);
|
||||
}
|
||||
|
||||
void
|
||||
qlnxr_free_frmr_page_list(struct ib_fast_reg_page_list *page_list)
|
||||
{
|
||||
struct qlnxr_fast_reg_page_list *frmr_list;
|
||||
|
||||
frmr_list = get_qlnxr_frmr_list(page_list);
|
||||
|
||||
free_mr_info(frmr_list->dev, &frmr_list->info);
|
||||
|
||||
kfree(frmr_list->ibfrpl.page_list);
|
||||
kfree(frmr_list);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
struct ib_fast_reg_page_list *
|
||||
qlnxr_alloc_frmr_page_list(struct ib_device *ibdev, int page_list_len)
|
||||
{
|
||||
struct qlnxr_fast_reg_page_list *frmr_list = NULL;
|
||||
struct qlnxr_dev *dev;
|
||||
int size = page_list_len * sizeof(u64);
|
||||
int rc = -ENOMEM;
|
||||
qlnx_host_t *ha;
|
||||
|
||||
dev = get_qlnxr_dev(ibdev);
|
||||
ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
frmr_list = kzalloc(sizeof(*frmr_list), GFP_KERNEL);
|
||||
if (!frmr_list) {
|
||||
QL_DPRINT11(ha, "kzalloc(frmr_list) failed\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
frmr_list->dev = dev;
|
||||
frmr_list->ibfrpl.page_list = kzalloc(size, GFP_KERNEL);
|
||||
if (!frmr_list->ibfrpl.page_list) {
|
||||
QL_DPRINT11(ha, "frmr_list->ibfrpl.page_list = NULL failed\n");
|
||||
goto err0;
|
||||
}
|
||||
|
||||
rc = qlnxr_init_mr_info(dev, &frmr_list->info, page_list_len,
|
||||
1 /* allow dual layer pbl */);
|
||||
if (rc)
|
||||
goto err1;
|
||||
|
||||
QL_DPRINT12(ha, "exit %p\n", &frmr_list->ibfrpl);
|
||||
|
||||
return &frmr_list->ibfrpl;
|
||||
|
||||
err1:
|
||||
kfree(frmr_list->ibfrpl.page_list);
|
||||
err0:
|
||||
kfree(frmr_list);
|
||||
err:
|
||||
QL_DPRINT12(ha, "exit with error\n");
|
||||
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
static int
|
||||
qlnxr_validate_phys_buf_list(qlnx_host_t *ha, struct ib_phys_buf *buf_list,
|
||||
int buf_cnt, uint64_t *total_size)
|
||||
{
|
||||
u64 size = 0;
|
||||
|
||||
*total_size = 0;
|
||||
|
||||
if (!buf_cnt || buf_list == NULL) {
|
||||
QL_DPRINT11(ha,
|
||||
"failed buf_list = %p buf_cnt = %d\n", buf_list, buf_cnt);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
size = buf_list->size;
|
||||
|
||||
if (!size) {
|
||||
QL_DPRINT11(ha,
|
||||
"failed buf_list = %p buf_cnt = %d"
|
||||
" buf_list->size = 0\n", buf_list, buf_cnt);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
while (buf_cnt) {
|
||||
*total_size += buf_list->size;
|
||||
|
||||
if (buf_list->size != size) {
|
||||
QL_DPRINT11(ha,
|
||||
"failed buf_list = %p buf_cnt = %d"
|
||||
" all buffers should have same size\n",
|
||||
buf_list, buf_cnt);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
buf_list++;
|
||||
buf_cnt--;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static size_t
|
||||
qlnxr_get_num_pages(qlnx_host_t *ha, struct ib_phys_buf *buf_list,
|
||||
int buf_cnt)
|
||||
{
|
||||
int i;
|
||||
size_t num_pages = 0;
|
||||
u64 size;
|
||||
|
||||
for (i = 0; i < buf_cnt; i++) {
|
||||
size = 0;
|
||||
while (size < buf_list->size) {
|
||||
size += PAGE_SIZE;
|
||||
num_pages++;
|
||||
}
|
||||
buf_list++;
|
||||
}
|
||||
return (num_pages);
|
||||
}
|
||||
|
||||
static void
|
||||
qlnxr_populate_phys_mem_pbls(struct qlnxr_dev *dev,
|
||||
struct ib_phys_buf *buf_list, int buf_cnt,
|
||||
struct qlnxr_pbl *pbl, struct qlnxr_pbl_info *pbl_info)
|
||||
{
|
||||
struct regpair *pbe;
|
||||
struct qlnxr_pbl *pbl_tbl;
|
||||
int pg_cnt, pages, pbe_cnt, total_num_pbes = 0;
|
||||
qlnx_host_t *ha;
|
||||
int i;
|
||||
u64 pbe_addr;
|
||||
|
||||
ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
if (!pbl_info) {
|
||||
QL_DPRINT11(ha, "PBL_INFO not initialized\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pbl_info->num_pbes) {
|
||||
QL_DPRINT11(ha, "pbl_info->num_pbes == 0\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we have a two layered pbl, the first pbl points to the rest
|
||||
* of the pbls and the first entry lays on the second pbl in the table
|
||||
*/
|
||||
if (pbl_info->two_layered)
|
||||
pbl_tbl = &pbl[1];
|
||||
else
|
||||
pbl_tbl = pbl;
|
||||
|
||||
pbe = (struct regpair *)pbl_tbl->va;
|
||||
if (!pbe) {
|
||||
QL_DPRINT12(ha, "pbe is NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
pbe_cnt = 0;
|
||||
|
||||
for (i = 0; i < buf_cnt; i++) {
|
||||
pages = buf_list->size >> PAGE_SHIFT;
|
||||
|
||||
for (pg_cnt = 0; pg_cnt < pages; pg_cnt++) {
|
||||
/* store the page address in pbe */
|
||||
|
||||
pbe_addr = buf_list->addr + (PAGE_SIZE * pg_cnt);
|
||||
|
||||
pbe->lo = cpu_to_le32((u32)pbe_addr);
|
||||
pbe->hi = cpu_to_le32(((u32)(pbe_addr >> 32)));
|
||||
|
||||
QL_DPRINT12(ha, "Populate pbl table:"
|
||||
" pbe->addr=0x%x:0x%x "
|
||||
" pbe_cnt = %d total_num_pbes=%d"
|
||||
" pbe=%p\n", pbe->lo, pbe->hi, pbe_cnt,
|
||||
total_num_pbes, pbe);
|
||||
|
||||
pbe_cnt ++;
|
||||
total_num_pbes ++;
|
||||
pbe++;
|
||||
|
||||
if (total_num_pbes == pbl_info->num_pbes)
|
||||
return;
|
||||
|
||||
/* if the given pbl is full storing the pbes,
|
||||
* move to next pbl. */
|
||||
|
||||
if (pbe_cnt == (pbl_info->pbl_size / sizeof(u64))) {
|
||||
pbl_tbl++;
|
||||
pbe = (struct regpair *)pbl_tbl->va;
|
||||
pbe_cnt = 0;
|
||||
}
|
||||
}
|
||||
buf_list++;
|
||||
}
|
||||
QL_DPRINT12(ha, "exit\n");
|
||||
return;
|
||||
}
|
||||
|
||||
struct ib_mr *
|
||||
qlnxr_reg_kernel_mr(struct ib_pd *ibpd,
|
||||
struct ib_phys_buf *buf_list,
|
||||
int buf_cnt, int acc, u64 *iova_start)
|
||||
{
|
||||
int rc = -ENOMEM;
|
||||
struct qlnxr_dev *dev = get_qlnxr_dev((ibpd->device));
|
||||
struct qlnxr_mr *mr;
|
||||
struct qlnxr_pd *pd;
|
||||
qlnx_host_t *ha;
|
||||
size_t num_pages = 0;
|
||||
uint64_t length;
|
||||
|
||||
ha = dev->ha;
|
||||
|
||||
QL_DPRINT12(ha, "enter\n");
|
||||
|
||||
pd = get_qlnxr_pd(ibpd);
|
||||
|
||||
QL_DPRINT12(ha, "pd = %d buf_list = %p, buf_cnt = %d,"
|
||||
" iova_start = %p, acc = %d\n",
|
||||
pd->pd_id, buf_list, buf_cnt, iova_start, acc);
|
||||
|
||||
//if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) {
|
||||
// QL_DPRINT11(ha, "(acc & IB_ACCESS_REMOTE_WRITE &&"
|
||||
// " !(acc & IB_ACCESS_LOCAL_WRITE))\n");
|
||||
// return ERR_PTR(-EINVAL);
|
||||
//}
|
||||
|
||||
mr = kzalloc(sizeof(*mr), GFP_KERNEL);
|
||||
if (!mr) {
|
||||
QL_DPRINT11(ha, "kzalloc(mr) failed\n");
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
mr->type = QLNXR_MR_KERNEL;
|
||||
mr->iova_start = iova_start;
|
||||
|
||||
rc = qlnxr_validate_phys_buf_list(ha, buf_list, buf_cnt, &length);
|
||||
if (rc)
|
||||
goto err0;
|
||||
|
||||
num_pages = qlnxr_get_num_pages(ha, buf_list, buf_cnt);
|
||||
if (!num_pages)
|
||||
goto err0;
|
||||
|
||||
rc = qlnxr_init_mr_info(dev, &mr->info, num_pages, 1);
|
||||
if (rc) {
|
||||
QL_DPRINT11(ha,
|
||||
"qlnxr_init_mr_info failed [%d]\n", rc);
|
||||
goto err1;
|
||||
}
|
||||
|
||||
qlnxr_populate_phys_mem_pbls(dev, buf_list, buf_cnt, mr->info.pbl_table,
|
||||
&mr->info.pbl_info);
|
||||
|
||||
rc = ecore_rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid);
|
||||
|
||||
if (rc) {
|
||||
QL_DPRINT11(ha, "roce alloc tid returned an error %d\n", rc);
|
||||
goto err1;
|
||||
}
|
||||
|
||||
/* index only, 18 bit long, lkey = itid << 8 | key */
|
||||
mr->hw_mr.tid_type = ECORE_RDMA_TID_REGISTERED_MR;
|
||||
mr->hw_mr.key = 0;
|
||||
mr->hw_mr.pd = pd->pd_id;
|
||||
mr->hw_mr.local_read = 1;
|
||||
mr->hw_mr.local_write = (acc & IB_ACCESS_LOCAL_WRITE) ? 1 : 0;
|
||||
mr->hw_mr.remote_read = (acc & IB_ACCESS_REMOTE_READ) ? 1 : 0;
|
||||
mr->hw_mr.remote_write = (acc & IB_ACCESS_REMOTE_WRITE) ? 1 : 0;
|
||||
mr->hw_mr.remote_atomic = (acc & IB_ACCESS_REMOTE_ATOMIC) ? 1 : 0;
|
||||
mr->hw_mr.mw_bind = false; /* TBD MW BIND */
|
||||
mr->hw_mr.pbl_ptr = mr->info.pbl_table[0].pa;
|
||||
mr->hw_mr.pbl_two_level = mr->info.pbl_info.two_layered;
|
||||
mr->hw_mr.pbl_page_size_log = ilog2(mr->info.pbl_info.pbl_size);
|
||||
mr->hw_mr.page_size_log = ilog2(PAGE_SIZE); /* for the MR pages */
|
||||
|
||||
mr->hw_mr.fbo = 0;
|
||||
|
||||
mr->hw_mr.length = length;
|
||||
mr->hw_mr.vaddr = (uint64_t)iova_start;
|
||||
mr->hw_mr.zbva = false; /* TBD figure when this should be true */
|
||||
mr->hw_mr.phy_mr = false; /* Fast MR - True, Regular Register False */
|
||||
mr->hw_mr.dma_mr = false;
|
||||
|
||||
rc = ecore_rdma_register_tid(dev->rdma_ctx, &mr->hw_mr);
|
||||
if (rc) {
|
||||
QL_DPRINT11(ha, "roce register tid returned an error %d\n", rc);
|
||||
goto err2;
|
||||
}
|
||||
|
||||
mr->ibmr.lkey = mr->hw_mr.itid << 8 | mr->hw_mr.key;
|
||||
if (mr->hw_mr.remote_write || mr->hw_mr.remote_read ||
|
||||
mr->hw_mr.remote_atomic)
|
||||
mr->ibmr.rkey = mr->hw_mr.itid << 8 | mr->hw_mr.key;
|
||||
|
||||
QL_DPRINT12(ha, "lkey: %x\n", mr->ibmr.lkey);
|
||||
|
||||
return (&mr->ibmr);
|
||||
|
||||
err2:
|
||||
ecore_rdma_free_tid(dev->rdma_ctx, mr->hw_mr.itid);
|
||||
err1:
|
||||
qlnxr_free_pbl(dev, &mr->info.pbl_info, mr->info.pbl_table);
|
||||
err0:
|
||||
kfree(mr);
|
||||
|
||||
QL_DPRINT12(ha, "exit [%d]\n", rc);
|
||||
return (ERR_PTR(rc));
|
||||
}
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
int
|
||||
qlnxr_create_ah(struct ib_ah *ibah,
|
||||
struct ib_ah_attr *attr, u32 flags,
|
||||
@ -6245,7 +5599,6 @@ qlnxr_modify_ah(struct ib_ah *ibah, struct ib_ah_attr *attr)
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
int
|
||||
qlnxr_process_mad(struct ib_device *ibdev,
|
||||
int process_mad_flags,
|
||||
@ -6257,19 +5610,6 @@ qlnxr_process_mad(struct ib_device *ibdev,
|
||||
struct ib_mad_hdr *out_mad,
|
||||
size_t *out_mad_size,
|
||||
u16 *out_mad_pkey_index)
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
qlnxr_process_mad(struct ib_device *ibdev,
|
||||
int process_mad_flags,
|
||||
u8 port_num,
|
||||
struct ib_wc *in_wc,
|
||||
struct ib_grh *in_grh,
|
||||
struct ib_mad *in_mad,
|
||||
struct ib_mad *out_mad)
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
{
|
||||
struct qlnxr_dev *dev;
|
||||
qlnx_host_t *ha;
|
||||
@ -6288,7 +5628,6 @@ qlnxr_process_mad(struct ib_device *ibdev,
|
||||
// return IB_MAD_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
int
|
||||
qlnxr_get_port_immutable(struct ib_device *ibdev, u8 port_num,
|
||||
struct ib_port_immutable *immutable)
|
||||
@ -6322,7 +5661,6 @@ qlnxr_get_port_immutable(struct ib_device *ibdev, u8 port_num,
|
||||
QL_DPRINT12(ha, "exit\n");
|
||||
return 0;
|
||||
}
|
||||
#endif /* #if __FreeBSD_version > 1102000 */
|
||||
|
||||
/***** iWARP related functions *************/
|
||||
|
||||
@ -6379,10 +5717,8 @@ qlnxr_iw_mpa_request(void *context,
|
||||
event.private_data = (void *)params->cm_info->private_data;
|
||||
event.private_data_len = (u8)params->cm_info->private_data_len;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
event.ord = params->cm_info->ord;
|
||||
event.ird = params->cm_info->ird;
|
||||
#endif /* #if __FreeBSD_version >= 1100000 */
|
||||
|
||||
listener->cm_id->event_handler(listener->cm_id, &event);
|
||||
|
||||
@ -6411,12 +5747,10 @@ qlnxr_iw_issue_event(void *context,
|
||||
event.event = event_type;
|
||||
|
||||
if (params->cm_info != NULL) {
|
||||
#if __FreeBSD_version >= 1100000
|
||||
event.ird = params->cm_info->ird;
|
||||
event.ord = params->cm_info->ord;
|
||||
QL_DPRINT12(ha, "ord=[%d] \n", event.ord);
|
||||
QL_DPRINT12(ha, "ird=[%d] \n", event.ird);
|
||||
#endif /* #if __FreeBSD_version >= 1100000 */
|
||||
|
||||
event.private_data_len = params->cm_info->private_data_len;
|
||||
event.private_data = (void *)params->cm_info->private_data;
|
||||
@ -6467,8 +5801,6 @@ qlnxr_iw_close_event(void *context,
|
||||
return;
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
static void
|
||||
qlnxr_iw_passive_complete(void *context,
|
||||
struct ecore_iwarp_cm_event_params *params)
|
||||
@ -6579,8 +5911,6 @@ qlnxr_iw_disconnect_event(void *context,
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
static int
|
||||
qlnxr_iw_mpa_reply(void *context,
|
||||
struct ecore_iwarp_cm_event_params *params)
|
||||
@ -6660,18 +5990,8 @@ qlnxr_iw_event_handler(void *context,
|
||||
|
||||
/* Passive side established ( ack on mpa response ) */
|
||||
case ECORE_IWARP_EVENT_PASSIVE_COMPLETE:
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
ep->during_connect = 0;
|
||||
qlnxr_iw_passive_complete(context, params);
|
||||
|
||||
#else
|
||||
qlnxr_iw_issue_event(context,
|
||||
params,
|
||||
IW_CM_EVENT_ESTABLISHED,
|
||||
"IW_CM_EVENT_ESTABLISHED");
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
break;
|
||||
|
||||
/* Active side reply received */
|
||||
@ -6690,16 +6010,7 @@ qlnxr_iw_event_handler(void *context,
|
||||
break;
|
||||
|
||||
case ECORE_IWARP_EVENT_DISCONNECT:
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
qlnxr_iw_disconnect_event(context, params);
|
||||
#else
|
||||
qlnxr_iw_issue_event(context,
|
||||
params,
|
||||
IW_CM_EVENT_DISCONNECT,
|
||||
"IW_CM_EVENT_DISCONNECT");
|
||||
qlnxr_iw_close_event(context, params);
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
break;
|
||||
|
||||
case ECORE_IWARP_EVENT_CLOSE:
|
||||
@ -6771,15 +6082,8 @@ qlnxr_addr4_resolve(struct qlnxr_dev *dev,
|
||||
{
|
||||
int rc;
|
||||
|
||||
#if __FreeBSD_version >= 1100000
|
||||
rc = arpresolve(dev->ha->ifp, 0, NULL, (struct sockaddr *)dst_in,
|
||||
dst_mac, NULL, NULL);
|
||||
#else
|
||||
struct llentry *lle;
|
||||
|
||||
rc = arpresolve(dev->ha->ifp, NULL, NULL, (struct sockaddr *)dst_in,
|
||||
dst_mac, &lle);
|
||||
#endif
|
||||
|
||||
QL_DPRINT12(dev->ha, "rc = %d "
|
||||
"sa_len = 0x%x sa_family = 0x%x IP Address = %d.%d.%d.%d "
|
||||
@ -7045,8 +6349,6 @@ qlnxr_iw_accept(struct iw_cm_id *cm_id,
|
||||
int
|
||||
qlnxr_iw_reject(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
|
||||
{
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
struct qlnxr_iw_ep *ep = (struct qlnxr_iw_ep *)cm_id->provider_data;
|
||||
struct qlnxr_dev *dev = ep->dev;
|
||||
struct ecore_iwarp_reject_in params;
|
||||
@ -7061,13 +6363,6 @@ qlnxr_iw_reject(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
|
||||
rc = ecore_iwarp_reject(dev->rdma_ctx, ¶ms);
|
||||
|
||||
return rc;
|
||||
|
||||
#else
|
||||
|
||||
printf("iWARP reject_cr not implemented\n");
|
||||
return -EINVAL;
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -59,14 +59,10 @@ extern int qlnxr_post_srq_recv(struct ib_srq *,
|
||||
const struct ib_recv_wr *,
|
||||
const struct ib_recv_wr **bad_recv_wr);
|
||||
|
||||
#if __FreeBSD_version < 1102000
|
||||
extern int qlnxr_query_device(struct ib_device *, struct ib_device_attr *);
|
||||
#else
|
||||
extern int qlnxr_query_device(struct ib_device *, struct ib_device_attr *,
|
||||
struct ib_udata *);
|
||||
extern int qlnxr_get_port_immutable(struct ib_device *ibdev, u8 port_num,
|
||||
struct ib_port_immutable *immutable);
|
||||
#endif
|
||||
|
||||
extern int qlnxr_query_port(struct ib_device *,
|
||||
u8 port,
|
||||
@ -130,7 +126,6 @@ extern int qlnxr_query_ah(struct ib_ah *ibah,
|
||||
extern int qlnxr_modify_ah(struct ib_ah *ibah,
|
||||
struct ib_ah_attr *attr);
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
extern int qlnxr_process_mad(struct ib_device *ibdev,
|
||||
int process_mad_flags,
|
||||
u8 port_num,
|
||||
@ -141,15 +136,6 @@ extern int qlnxr_process_mad(struct ib_device *ibdev,
|
||||
struct ib_mad_hdr *out_mad,
|
||||
size_t *out_mad_size,
|
||||
u16 *out_mad_pkey_index);
|
||||
#else
|
||||
extern int qlnxr_process_mad(struct ib_device *ibdev,
|
||||
int process_mad_flags,
|
||||
u8 port_num,
|
||||
struct ib_wc *in_wc,
|
||||
struct ib_grh *in_grh,
|
||||
struct ib_mad *in_mad,
|
||||
struct ib_mad *out_mad);
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
extern int qlnxr_post_send(struct ib_qp *,
|
||||
const struct ib_send_wr *,
|
||||
@ -165,34 +151,14 @@ extern int qlnxr_arm_cq(struct ib_cq *,
|
||||
extern struct ib_mr *qlnxr_get_dma_mr(struct ib_pd *,
|
||||
int acc);
|
||||
|
||||
#if __FreeBSD_version < 1102000
|
||||
extern struct ib_mr *qlnxr_reg_kernel_mr(struct ib_pd *,
|
||||
struct ib_phys_buf *buffer_list,
|
||||
int num_phys_buf,
|
||||
int acc,
|
||||
u64 *iova_start);
|
||||
#endif /* #if __FreeBSD_version < 1102000 */
|
||||
|
||||
extern int qlnxr_dereg_mr(struct ib_mr *, struct ib_udata *);
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
extern struct ib_mr *qlnxr_reg_user_mr(struct ib_pd *,
|
||||
u64 start,
|
||||
u64 length,
|
||||
u64 virt,
|
||||
int acc,
|
||||
struct ib_udata *);
|
||||
#else
|
||||
extern struct ib_mr *qlnxr_reg_user_mr(struct ib_pd *,
|
||||
u64 start,
|
||||
u64 length,
|
||||
u64 virt,
|
||||
int acc,
|
||||
struct ib_udata *,
|
||||
int mr_id);
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
#if __FreeBSD_version >= 1102000
|
||||
|
||||
extern struct ib_mr *qlnxr_alloc_mr(struct ib_pd *pd,
|
||||
enum ib_mr_type mr_type, u32 max_num_sg,
|
||||
@ -200,18 +166,6 @@ extern struct ib_mr *qlnxr_alloc_mr(struct ib_pd *pd,
|
||||
|
||||
extern int qlnxr_map_mr_sg(struct ib_mr *mr, struct scatterlist *sg,
|
||||
int sg_nents, unsigned int *sg_offset);
|
||||
#else
|
||||
|
||||
extern struct ib_mr *qlnxr_alloc_frmr(struct ib_pd *pd,
|
||||
int max_page_list_len);
|
||||
|
||||
extern struct ib_fast_reg_page_list *qlnxr_alloc_frmr_page_list(
|
||||
struct ib_device *ibdev,
|
||||
int page_list_len);
|
||||
|
||||
extern void qlnxr_free_frmr_page_list(struct ib_fast_reg_page_list *page_list);
|
||||
|
||||
#endif /* #if __FreeBSD_version >= 1102000 */
|
||||
|
||||
extern int qlnxr_alloc_ucontext(struct ib_ucontext *uctx,
|
||||
struct ib_udata *udata);
|
||||
|
Loading…
Reference in New Issue
Block a user