From: Pradeep Gopanapalli Date: Tue, 12 Jul 2016 20:17:29 +0000 (-0700) Subject: xsigo: SKB Frag cleanup X-Git-Tag: v4.1.12-92~108^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4a1bdef405c647c4b777ec6e67855a7ecd16ba92;p=users%2Fjedix%2Flinux-maple.git xsigo: SKB Frag cleanup Orabug: 23514725 Fixed pre-allocating transmit scatter gather lists by using max_sge variable instead of MAX_SKB_FRAGS some changes to prints Signed-off-by: Pradeep Gopanapalli Reviewed-by: sajid zia Reviewed-by: Yuval Shaia --- diff --git a/drivers/infiniband/ulp/xsigo/xscore/Makefile b/drivers/infiniband/ulp/xsigo/xscore/Makefile index 00721312de46..8f1555fbc2ed 100644 --- a/drivers/infiniband/ulp/xsigo/xscore/Makefile +++ b/drivers/infiniband/ulp/xsigo/xscore/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_INFINIBAND_XSCORE) := xscore.o xscore-y := xscore_impl.o xs_ud.o xscore_api.o xsmp.o \ xscore_stats.o xscore_uadm.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8016\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8020\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xsvhba/Makefile b/drivers/infiniband/ulp/xsigo/xsvhba/Makefile index a97d7a15e761..d6f358fb99ed 100644 --- a/drivers/infiniband/ulp/xsigo/xsvhba/Makefile +++ b/drivers/infiniband/ulp/xsigo/xsvhba/Makefile @@ -3,7 +3,7 @@ xsvhba-y := vhba_main.o vhba_xsmp.o vhba_create.o vhba_init.o vhba_delete.o \ vhba_attr.o vhba_wq.o vhba_proc.o vhba_stats.o vhba_ib.o \ vhba_scsi_intf.o vhba_align.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8016\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8020\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xsvnic/Makefile b/drivers/infiniband/ulp/xsigo/xsvnic/Makefile index 5f853927ff30..abfb935168cb 100644 --- a/drivers/infiniband/ulp/xsigo/xsvnic/Makefile +++ b/drivers/infiniband/ulp/xsigo/xsvnic/Makefile @@ -1,7 +1,7 @@ obj-$(CONFIG_INFINIBAND_XSVNIC) := xsvnic.o xsvnic-y := xsvnic_main.o xsvnic_stats.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8016\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8020\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xve/Makefile b/drivers/infiniband/ulp/xsigo/xve/Makefile index be33126eff94..ead4db3c496b 100644 --- a/drivers/infiniband/ulp/xsigo/xve/Makefile +++ b/drivers/infiniband/ulp/xsigo/xve/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_INFINIBAND_XVE) := xve.o xve-y := xve_main.o xve_verbs.o xve_multicast.o xve_ib.o xve_tables.o \ xve_ethtool.o xve_cm.o xve_stats.o -ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8016\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8020\" ccflags-y += -DRDMA_PORT_LINK_LAYER_CHANGES -DHAS_SKB_ACCESS_FUNCTIONS ccflags-y += -DSCSI_STRUCT_CHANGES -DSCSI_TIMEOUT_CHANGES -DLLE ccflags-y += -DXG_FRAG_SIZE_PRESENT -DXG_FRAG_PAGE_PRESENT diff --git a/drivers/infiniband/ulp/xsigo/xve/xve.h b/drivers/infiniband/ulp/xsigo/xve/xve.h index c30038d1df2e..f2b0f8273dec 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve.h +++ b/drivers/infiniband/ulp/xsigo/xve/xve.h @@ -173,6 +173,7 @@ enum { XVE_MAX_LRO_DESCRIPTORS = 8, XVE_LRO_MAX_AGGR = 64, MAX_SEND_CQE = 32, + SENDQ_LOW_WMARK = 32, XVE_CM_COPYBREAK = 256, }; diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_cm.c b/drivers/infiniband/ulp/xsigo/xve/xve_cm.c index 5d2cc4d689f2..b6a6d1c0e328 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_cm.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_cm.c @@ -541,7 +541,7 @@ void xve_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) if (!test_bit(XVE_DELETING, &priv->state)) { pr_err("%s: cm recv error", priv->xve_name); pr_err("(status=%d, wrid=%d", wc->status, wr_id); - pr_err("vend_err 0x%x)\n", wc->vendor_err); + pr_err("vend_err %x)\n", wc->vendor_err); } INC_RX_DROP_STATS(priv, dev); goto repost; @@ -754,7 +754,7 @@ void xve_cm_handle_tx_wc(struct net_device *dev, if (wc->status != IB_WC_SUCCESS && wc->status != IB_WC_WR_FLUSH_ERR) { pr_err("%s: failed cm send event ", priv->xve_name); - pr_err("(status=%d, wrid=%d vend_err 0x%x)\n", + pr_err("(status=%d, wrid=%d vend_err %x)\n", wc->status, wr_id, wc->vendor_err); xve_cm_destroy_tx_deferred(tx); } diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_ib.c b/drivers/infiniband/ulp/xsigo/xve/xve_ib.c index 1266e752db2f..f1e1403b1a39 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_ib.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_ib.c @@ -831,7 +831,7 @@ int xve_send(struct net_device *dev, struct sk_buff *skb, ++priv->tx_head; priv->send_hbeat_flag = 0; - if (unlikely(priv->tx_outstanding > MAX_SEND_CQE)) + if (unlikely(priv->tx_outstanding > SENDQ_LOW_WMARK)) poll_tx(priv); return ret; } diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_main.c b/drivers/infiniband/ulp/xsigo/xve/xve_main.c index 3f390e1b9810..5f69a2098770 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_main.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_main.c @@ -1625,7 +1625,7 @@ static int xve_state_machine(struct xve_dev_priv *priv) if (priv->send_hbeat_flag) { unsigned long flags = 0; - if (unlikely(priv->tx_outstanding > MAX_SEND_CQE)) { + if (unlikely(priv->tx_outstanding > SENDQ_LOW_WMARK)) { netif_tx_lock(priv->netdev); spin_lock_irqsave(&priv->lock, flags); poll_tx(priv); @@ -1735,9 +1735,8 @@ xve_set_ovn_features(struct xve_dev_priv *priv) if (priv->lro_mode && lro) { priv->netdev->features |= NETIF_F_LRO; xve_lro_setup(priv); - } else { + } else priv->lro_mode = 0; - } } void @@ -1762,9 +1761,8 @@ xve_set_edr_features(struct xve_dev_priv *priv) if (priv->lro_mode && lro) { priv->netdev->features |= NETIF_F_LRO; xve_lro_setup(priv); - } else { + } else priv->lro_mode = 0; - } /* Reserve extra space for EoIB header */ priv->netdev->hard_header_len += sizeof(struct xve_eoib_hdr); diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_stats.c b/drivers/infiniband/ulp/xsigo/xve/xve_stats.c index 1401762c9c76..f449ebe6c9ce 100755 --- a/drivers/infiniband/ulp/xsigo/xve/xve_stats.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_stats.c @@ -460,8 +460,8 @@ static int xve_proc_read_device(struct seq_file *m, void *data) seq_printf(m, "SG UD Mode:\t\t\t%d\n", xve_ud_need_sg(vp->admin_mtu)); seq_printf(m, "Max SG supported(HCA):\t\t%d\n", vp->dev_attr.max_sge); - seq_printf(m, "Receive Queue size: \t\t%d\n", xve_recvq_size); - seq_printf(m, "Transmit Queue size: \t\t%d\n", xve_sendq_size); + seq_printf(m, "Receive Queue size: \t\t%d\n", vp->xve_recvq_size); + seq_printf(m, "Transmit Queue size: \t\t%d\n", vp->xve_sendq_size); if (vp->cm_supported) { seq_printf(m, "Num of cm frags: \t\t%d\n", vp->cm.num_frags); diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c b/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c index 9cfbfc76223c..a78e65f6b8eb 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c @@ -142,7 +142,7 @@ int xve_transport_dev_init(struct net_device *dev, struct ib_device *ca) .qp_type = IB_QPT_UD }; struct ethtool_coalesce *coal; - int ret, size, max_sge; + int ret, size, max_sge = MAX_SKB_FRAGS + 1; int i; priv->pd = ib_alloc_pd(priv->ca); @@ -223,7 +223,7 @@ int xve_transport_dev_init(struct net_device *dev, struct ib_device *ca) goto out_free_send_cq; } - for (i = 0; i < MAX_SKB_FRAGS + 1; ++i) + for (i = 0; i < max_sge; ++i) priv->tx_sge[i].lkey = priv->mr->lkey; priv->tx_wr.opcode = IB_WR_SEND;