]> git.openfabrics.org - compat-rdma/compat-rdma.git/commitdiff
Added RHEL7.5 support for cxgb3 and iw_cxgb3
authorArjun Vynipadath <arjun@chelsio.com>
Wed, 11 Jul 2018 06:23:03 +0000 (11:53 +0530)
committerArjun Vynipadath <arjun@chelsio.com>
Wed, 11 Jul 2018 06:54:42 +0000 (12:24 +0530)
patches/0008-BACKPORT-RHEL7_5-iw_cxgb3.patch [new file with mode: 0644]
patches/0009-BACKPORT-RHEL7_5_cxgb3.patch [new file with mode: 0644]

diff --git a/patches/0008-BACKPORT-RHEL7_5-iw_cxgb3.patch b/patches/0008-BACKPORT-RHEL7_5-iw_cxgb3.patch
new file mode 100644 (file)
index 0000000..e2ebd06
--- /dev/null
@@ -0,0 +1,123 @@
+From 54739868a21019a1b8a61d5abd636accf396b6f2 Mon Sep 17 00:00:00 2001
+From: root <root@sukna.blr.asicdesigners.com>
+Date: Thu, 21 Jun 2018 14:58:01 +0530
+Subject: [PATCH] iw_cxgb3: Compilation checks for RHEL7.5
+
+ - Check for new timer settings API, else use the old timer API
+ - Fix Makefile include paths
+---
+ drivers/infiniband/hw/cxgb3/Makefile        |  2 +-
+ drivers/infiniband/hw/cxgb3/iwch_cm.c       | 22 ++++++++++++++++++++++
+ drivers/infiniband/hw/cxgb3/iwch_provider.c |  3 +++
+ drivers/infiniband/hw/cxgb3/iwch_provider.h |  3 +++
+ 4 files changed, 29 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/infiniband/hw/cxgb3/Makefile b/drivers/infiniband/hw/cxgb3/Makefile
+index 66fe091..a470db1 100644
+--- a/drivers/infiniband/hw/cxgb3/Makefile
++++ b/drivers/infiniband/hw/cxgb3/Makefile
+@@ -1,5 +1,5 @@
+ # SPDX-License-Identifier: GPL-2.0
+-ccflags-y := -Idrivers/net/ethernet/chelsio/cxgb3
++ccflags-y := -I$(CWD)/drivers/net/ethernet/chelsio/cxgb3
+ obj-$(CONFIG_INFINIBAND_CXGB3) += iw_cxgb3.o
+diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
+index 1c90c86..0489b1f 100644
+--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
++++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
+@@ -107,7 +107,11 @@ static struct workqueue_struct *workq;
+ static struct sk_buff_head rxq;
+ static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp);
++#ifdef HAVE_TIMER_SETUP
+ static void ep_timeout(struct timer_list *t);
++#else
++static void ep_timeout(unsigned long arg);
++#endif
+ static void connect_reply_upcall(struct iwch_ep *ep, int status);
+ static void start_ep_timer(struct iwch_ep *ep)
+@@ -119,6 +123,10 @@ static void start_ep_timer(struct iwch_ep *ep)
+       } else
+               get_ep(&ep->com);
+       ep->timer.expires = jiffies + ep_timeout_secs * HZ;
++#ifndef HAVE_TIMER_SETUP
++      ep->timer.data = (unsigned long)ep;
++      ep->timer.function = ep_timeout;
++#endif
+       add_timer(&ep->timer);
+ }
+@@ -1397,7 +1405,11 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
+       child_ep->l2t = l2t;
+       child_ep->dst = dst;
+       child_ep->hwtid = hwtid;
++#ifdef HAVE_TIMER_SETUP
+       timer_setup(&child_ep->timer, ep_timeout, 0);
++#else
++      init_timer(&child_ep->timer);
++#endif
+       cxgb3_insert_tid(tdev, &t3c_client, child_ep, hwtid);
+       accept_cr(child_ep, req->peer_ip, skb);
+       goto out;
+@@ -1717,9 +1729,15 @@ static int ec_status(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
+       return CPL_RET_BUF_DONE;
+ }
++#ifdef HAVE_TIMER_SETUP
+ static void ep_timeout(struct timer_list *t)
+ {
+       struct iwch_ep *ep = from_timer(ep, t, timer);
++#else
++static void ep_timeout(unsigned long arg)
++{
++      struct iwch_ep *ep = (struct iwch_ep *)arg;
++#endif
+       struct iwch_qp_attributes attrs;
+       unsigned long flags;
+       int abort = 1;
+@@ -1897,7 +1915,11 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
+               err = -ENOMEM;
+               goto out;
+       }
++#ifdef HAVE_TIMER_SETUP
+       timer_setup(&ep->timer, ep_timeout, 0);
++#else
++      init_timer(&ep->timer);
++#endif
+       ep->plen = conn_param->private_data_len;
+       if (ep->plen)
+               memcpy(ep->mpa_pkt + sizeof(struct mpa_message),
+diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
+index be097c6..aeed2a3 100644
+--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
++++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
+@@ -971,6 +971,9 @@ static struct ib_qp *iwch_create_qp(struct ib_pd *pd,
+               insert_mmap(ucontext, mm2);
+       }
+       qhp->ibqp.qp_num = qhp->wq.qpid;
++#ifndef HAVE_TIMER_SETUP
++      init_timer(&(qhp->timer));
++#endif
+       pr_debug("%s sq_num_entries %d, rq_num_entries %d qpid 0x%0x qhp %p dma_addr 0x%llx size %d rq_addr 0x%x\n",
+                __func__, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries,
+                qhp->wq.qpid, qhp, (unsigned long long)qhp->wq.dma_addr,
+diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.h b/drivers/infiniband/hw/cxgb3/iwch_provider.h
+index 2e38dde..5ac00d6 100644
+--- a/drivers/infiniband/hw/cxgb3/iwch_provider.h
++++ b/drivers/infiniband/hw/cxgb3/iwch_provider.h
+@@ -168,6 +168,9 @@ struct iwch_qp {
+       atomic_t refcnt;
+       wait_queue_head_t wait;
+       enum IWCH_QP_FLAGS flags;
++#ifndef HAVE_TIMER_SETUP
++      struct timer_list timer;
++#endif
+ };
+ static inline int qp_quiesced(struct iwch_qp *qhp)
+-- 
+1.8.3.1
+
diff --git a/patches/0009-BACKPORT-RHEL7_5_cxgb3.patch b/patches/0009-BACKPORT-RHEL7_5_cxgb3.patch
new file mode 100644 (file)
index 0000000..b443056
--- /dev/null
@@ -0,0 +1,125 @@
+From 5f5fe868e81b214ce63bfae53e7a2c0a262e29ba Mon Sep 17 00:00:00 2001
+From: Arjun Vynipadath <arjun@chelsio.com>
+Date: Mon, 25 Jun 2018 09:59:11 +0530
+Subject: [PATCH] cxgb3: Compilation checks for RHEL7.5
+
+ - Check for new timer settings API, else use the old timer API
+ - Check for new extended MTU API, else revert back to the old ndo_change_mtu
+ - Handle pr_fmt  redefintion warnings
+---
+ drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c    | 13 +++++++++++++
+ drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c |  4 ++++
+ drivers/net/ethernet/chelsio/cxgb3/sge.c           | 19 ++++++++++++++++++-
+ 3 files changed, 35 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+index 2edfdbd..a875795 100644
+--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
++++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+@@ -30,6 +30,10 @@
+  * SOFTWARE.
+  */
++#ifdef pr_fmt
++#undef pr_fmt
++#endif
++
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/module.h>
+@@ -3162,7 +3166,11 @@ static const struct net_device_ops cxgb_netdev_ops = {
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_rx_mode        = cxgb_set_rxmode,
+       .ndo_do_ioctl           = cxgb_ioctl,
++#ifdef HAVE_NDO_CHANGE_MTU_EXTENDED
++      .extended.ndo_change_mtu = cxgb_change_mtu,
++#else
+       .ndo_change_mtu         = cxgb_change_mtu,
++#endif
+       .ndo_set_mac_address    = cxgb_set_mac_addr,
+       .ndo_fix_features       = cxgb_fix_features,
+       .ndo_set_features       = cxgb_set_features,
+@@ -3302,8 +3310,13 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+               netdev->netdev_ops = &cxgb_netdev_ops;
+               netdev->ethtool_ops = &cxgb_ethtool_ops;
++#ifdef HAVE_NDO_CHANGE_MTU_EXTENDED
++              netdev->extended->min_mtu = 81;
++              netdev->extended->max_mtu = ETH_MAX_MTU;
++#else
+               netdev->min_mtu = 81;
+               netdev->max_mtu = ETH_MAX_MTU;
++#endif
+               netdev->dev_port = pi->port_id;
+       }
+diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
+index 50cd660..d4945d2 100644
+--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
++++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
+@@ -30,6 +30,10 @@
+  * SOFTWARE.
+  */
++#ifdef pr_fmt
++#undef pr_fmt
++#endif
++
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ #include <linux/list.h>
+diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c
+index e988caa..be5ba39 100644
+--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
++++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
+@@ -2919,9 +2919,15 @@ void t3_sge_err_intr_handler(struct adapter *adapter)
+  *    bother cleaning them up here.
+  *
+  */
++#ifdef HAVE_TIMER_SETUP
+ static void sge_timer_tx(struct timer_list *t)
+ {
+       struct sge_qset *qs = from_timer(qs, t, tx_reclaim_timer);
++#else
++static void sge_timer_tx(unsigned long data)
++{
++      struct sge_qset *qs = (struct sge_qset *)data;
++#endif
+       struct port_info *pi = netdev_priv(qs->netdev);
+       struct adapter *adap = pi->adapter;
+       unsigned int tbd[SGE_TXQ_PER_SET] = {0, 0};
+@@ -2959,10 +2965,16 @@ static void sge_timer_tx(struct timer_list *t)
+  *    starved.
+  *
+  */
++#ifdef HAVE_TIMER_SETUP
+ static void sge_timer_rx(struct timer_list *t)
+ {
+-      spinlock_t *lock;
+       struct sge_qset *qs = from_timer(qs, t, rx_reclaim_timer);
++#else
++static void sge_timer_rx(unsigned long data)
++{
++      struct sge_qset *qs = (struct sge_qset *)data;
++#endif
++      spinlock_t *lock;
+       struct port_info *pi = netdev_priv(qs->netdev);
+       struct adapter *adap = pi->adapter;
+       u32 status;
+@@ -3042,8 +3054,13 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,
+       struct sge_qset *q = &adapter->sge.qs[id];
+       init_qset_cntxt(q, id);
++#ifdef HAVE_TIMER_SETUP
+       timer_setup(&q->tx_reclaim_timer, sge_timer_tx, 0);
+       timer_setup(&q->rx_reclaim_timer, sge_timer_rx, 0);
++#else
++      setup_timer(&q->tx_reclaim_timer, sge_timer_tx, (unsigned long)q);
++      setup_timer(&q->rx_reclaim_timer, sge_timer_rx, (unsigned long)q);
++#endif
+       q->fl[0].desc = alloc_ring(adapter->pdev, p->fl_size,
+                                  sizeof(struct rx_desc),
+-- 
+1.8.3.1
+