From 3f1710ef1fa87ccf4df8af951462ef8105b760e2 Mon Sep 17 00:00:00 2001 From: Pradeep Gopanapalli Date: Thu, 11 Feb 2016 23:29:39 +0000 Subject: [PATCH] uvnic issues When there is Heartbeat loss because of Link event on EDR fabric, uvnic recovery fails(some times). This is due to the fact that XVE_OPER_UP state would have cleared and xve driver has to check this once multicast group membership is retained While running MAXq test we are running into soft crash around skb_try_coalesce .Since xve driver allocates PAGE_SIZE it has to use full PAGE_SIZE for truesize of skb. xve driver doesn't allocate enough tailroom in skbs, so IP/TCP stacks need to reallocate skb head to pull IP/TCP headers. this . xve allocates some resources which are not needed by uVnic functionality. Fix this by using cm_supported flag. Orabug: 22862488 Reported-by: ye jin Signed-off-by: Pradeep Gopanapalli Reviewed-by: sajid zia Signed-off-by: Qing Huang --- drivers/infiniband/ulp/xsigo/xscore/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xsvhba/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xsvnic/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xve/Makefile | 2 +- drivers/infiniband/ulp/xsigo/xve/xve.h | 44 +++------------ drivers/infiniband/ulp/xsigo/xve/xve_cm.c | 50 +++++++++++++++-- .../infiniband/ulp/xsigo/xve/xve_ethtool.c | 2 +- drivers/infiniband/ulp/xsigo/xve/xve_ib.c | 56 ++++++++++++++----- drivers/infiniband/ulp/xsigo/xve/xve_main.c | 26 +++------ .../infiniband/ulp/xsigo/xve/xve_multicast.c | 15 +++-- drivers/infiniband/ulp/xsigo/xve/xve_stats.c | 28 ++++++---- drivers/infiniband/ulp/xsigo/xve/xve_tables.c | 12 ++-- drivers/infiniband/ulp/xsigo/xve/xve_verbs.c | 7 ++- 13 files changed, 144 insertions(+), 104 deletions(-) diff --git a/drivers/infiniband/ulp/xsigo/xscore/Makefile b/drivers/infiniband/ulp/xsigo/xscore/Makefile index 2dfe848a30cd..765e555d7034 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.r8012\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8014\" 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 6ea65b0ad0bf..b91ea2da3720 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.r8008\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8014\" 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 a66e8aee60c7..983e7820bb4a 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.r8008\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8014\" 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 89d4f857dec7..f217d4feadb0 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.r8008\" +ccflags-y += -DXSIGO_LOCAL_VERSION=\"6.0.r8014\" 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 fd6ea4e3f595..f6339baad42e 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve.h +++ b/drivers/infiniband/ulp/xsigo/xve/xve.h @@ -151,7 +151,7 @@ enum xve_flush_level { }; enum { - XVE_UD_HEAD_SIZE = IB_GRH_BYTES + VLAN_ETH_HLEN + XVE_EOIB_LEN + 2048, + XVE_UD_HEAD_SIZE = IB_GRH_BYTES + VLAN_ETH_HLEN + XVE_EOIB_LEN, XVE_UD_RX_OVN_SG = 2, /* max buffer needed for 4K mtu */ XVE_UD_RX_EDR_SG = 3, /* max buffer needed for 10K mtu */ XVE_CM_MTU = 0x10000 - 0x20, /* padding to align header to 16 */ @@ -223,6 +223,7 @@ enum { XVE_STATE_MACHINE, XVE_STATE_MACHINE_UP, XVE_STATE_MACHINE_DOWN, + XVE_STATE_MACHINE_IBCLEAR, XVE_NAPI_POLL_COUNTER, XVE_SHORT_PKT_COUNTER, XVE_TX_COUNTER, @@ -279,9 +280,12 @@ enum { XVE_MAC_STILL_INUSE, XVE_MAC_MOVED_COUNTER, + XVE_MCAST_NOTREADY, XVE_MCAST_JOIN_TASK, XVE_MCAST_LEAVE_TASK, XVE_MCAST_CARRIER_TASK, + XVE_MCAST_ATTACH, + XVE_MCAST_DETACH, XVE_TX_UD_COUNTER, XVE_TX_RC_COUNTER, @@ -886,6 +890,8 @@ struct icmp6_ndp { printk(level "%s: " fmt, MODULE_NAME, ##arg) #define XSMP_ERROR(fmt, arg...) \ PRINT(KERN_ERR, "XSMP", fmt, ##arg) +#define DRV_PRINT(fmt, arg...) \ + PRINT(KERN_INFO, "DRV", fmt, ##arg) #define xve_printk(level, priv, format, arg...) \ printk(level "%s: " format, \ ((struct xve_dev_priv *) priv)->netdev->name, \ @@ -1091,42 +1097,6 @@ static inline void xve_put_ctx(struct xve_dev_priv *priv) atomic_dec(&priv->ref_cnt); } -/* Adjust length of skb with fragments to match received data */ -static inline void skb_put_frags(struct sk_buff *skb, unsigned int hdr_space, - unsigned int length, struct sk_buff *toskb) -{ - int i, num_frags; - unsigned int size; - - /* put header into skb */ - size = min(length, hdr_space); - skb->tail += size; - skb->len += size; - length -= size; - - num_frags = skb_shinfo(skb)->nr_frags; - for (i = 0; i < num_frags; i++) { - skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; - - if (length == 0) { - /* don't need this page */ - if (toskb) - skb_fill_page_desc(toskb, i, skb_frag_page(frag) - , 0, PAGE_SIZE); - else - __free_page(skb_shinfo(skb)->frags[i].page.p); - --skb_shinfo(skb)->nr_frags; - } else { - size = min_t(unsigned, length, (unsigned)PAGE_SIZE); - - frag->size = size; - skb->data_len += size; - skb->truesize += size; - skb->len += size; - length -= size; - } - } -} /* functions */ int xve_poll(struct napi_struct *napi, int budget); diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_cm.c b/drivers/infiniband/ulp/xsigo/xve/xve_cm.c index caf4e8aa53d6..b6a6d1c0e328 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_cm.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_cm.c @@ -448,6 +448,44 @@ static void xve_cm_free_rx_reap_list(struct net_device *dev) } } + +/* Adjust length of skb with fragments to match received data */ +static inline void skb_put_frags(struct sk_buff *skb, unsigned int hdr_space, + unsigned int length, struct sk_buff *toskb) +{ + int i, num_frags; + unsigned int size; + + /* put header into skb */ + size = min(length, hdr_space); + skb->tail += size; + skb->len += size; + length -= size; + + num_frags = skb_shinfo(skb)->nr_frags; + for (i = 0; i < num_frags; i++) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + + if (length == 0) { + /* don't need this page */ + if (toskb) + skb_fill_page_desc(toskb, i, skb_frag_page(frag) + , 0, PAGE_SIZE); + else + __free_page(skb_shinfo(skb)->frags[i].page.p); + --skb_shinfo(skb)->nr_frags; + } else { + size = min_t(unsigned, length, (unsigned)PAGE_SIZE); + + frag->size = size; + skb->data_len += size; + skb->truesize += size; + skb->len += size; + length -= size; + } + } +} + void xve_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) { struct xve_dev_priv *priv = netdev_priv(dev); @@ -982,7 +1020,7 @@ static int xve_cm_tx_init(struct xve_cm_ctx *p, struct ib_sa_path_rec *pathrec) int ret; p->tx_ring = vmalloc(priv->xve_sendq_size * sizeof(*p->tx_ring)); - if (!p->tx_ring) { + if (IS_ERR(p->tx_ring)) { xve_warn(priv, "failed to allocate tx ring\n"); ret = -ENOMEM; goto err_tx; @@ -1310,8 +1348,7 @@ static void xve_cm_create_srq(struct net_device *dev, int max_sge) priv->cm.srq = ib_create_srq(priv->pd, &srq_init_attr); if (IS_ERR(priv->cm.srq)) { - if (PTR_ERR(priv->cm.srq) != -ENOSYS) - pr_warn("%s: failed to allocate SRQ, error %ld\n", + pr_warn("%s: failed to allocate SRQ, error %ld\n", priv->ca->name, PTR_ERR(priv->cm.srq)); priv->cm.srq = NULL; return; @@ -1337,6 +1374,9 @@ int xve_cm_dev_init(struct net_device *dev) int i, ret; struct ib_device_attr attr; + if (!priv->cm_supported) + return 0; + INIT_LIST_HEAD(&priv->cm.passive_ids); INIT_LIST_HEAD(&priv->cm.reap_list); INIT_LIST_HEAD(&priv->cm.start_list); @@ -1351,8 +1391,6 @@ int xve_cm_dev_init(struct net_device *dev) return ret; } - priv->dev_attr = attr; - /* Based on the admin mtu from the chassis */ attr.max_srq_sge = min_t(int, @@ -1407,7 +1445,7 @@ void xve_cm_dev_cleanup(struct net_device *dev) struct xve_dev_priv *priv = netdev_priv(dev); int ret; - if (!priv->cm.srq) + if (!priv->cm_supported || !priv->cm.srq) return; xve_debug(DEBUG_CM_INFO, priv, "%s Cleanup xve CM\n", __func__); diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_ethtool.c b/drivers/infiniband/ulp/xsigo/xve/xve_ethtool.c index 236d27acc646..728c5d328426 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_ethtool.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_ethtool.c @@ -80,7 +80,7 @@ static int xve_set_coalesce(struct net_device *dev, ret = ib_modify_cq(priv->recv_cq, coal->rx_max_coalesced_frames, coal->rx_coalesce_usecs); - if (ret && ret != -ENOSYS) { + if (ret) { xve_warn(priv, "failed modifying CQ (%d)\n", ret); return ret; } diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_ib.c b/drivers/infiniband/ulp/xsigo/xve/xve_ib.c index 548f0c31d1db..04de9a1aa7b3 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_ib.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_ib.c @@ -87,6 +87,30 @@ static void xve_ud_dma_unmap_rx(struct xve_dev_priv *priv, } } + +static void xve_ud_skb_put_frags(struct xve_dev_priv *priv, + struct sk_buff *skb, + unsigned int length) +{ + if (xve_ud_need_sg(priv->max_ib_mtu)) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[0]; + unsigned int size; + /* + * There is only two buffers needed for max_payload = 4K, + * first buf size is XVE_UD_HEAD_SIZE + */ + skb->tail += XVE_UD_HEAD_SIZE; + skb->len += length; + + size = length - XVE_UD_HEAD_SIZE; + + skb_frag_size_set(frag, size); + skb->data_len += size; + skb->truesize += PAGE_SIZE; + } else + skb_put(skb, length); +} + static int xve_ib_post_receive(struct net_device *dev, int id) { struct xve_dev_priv *priv = netdev_priv(dev); @@ -114,11 +138,16 @@ static struct sk_buff *xve_alloc_rx_skb(struct net_device *dev, int id) struct sk_buff *skb; int buf_size, align; u64 *mapping; + int tailroom; - if (xve_ud_need_sg(priv->max_ib_mtu)) + if (xve_ud_need_sg(priv->max_ib_mtu)) { + /* reserve some tailroom for IP/TCP headers */ buf_size = XVE_UD_HEAD_SIZE; - else + tailroom = 128; + } else { buf_size = XVE_UD_BUF_SIZE(priv->max_ib_mtu); + tailroom = 0; + } /* * Eth header is 14 bytes, IB will leave a 40 byte gap for a GRH @@ -127,7 +156,7 @@ static struct sk_buff *xve_alloc_rx_skb(struct net_device *dev, int id) * 4-byte EoIB header. */ align = xve_is_ovn(priv) ? 10 : 6; - skb = xve_dev_alloc_skb(priv, buf_size + align); + skb = xve_dev_alloc_skb(priv, buf_size + tailroom + align); if (unlikely(!skb)) return NULL; @@ -207,7 +236,8 @@ void xve_process_link_state(struct xve_dev_priv *priv, set_bit(XVE_GW_STATE_UP, &priv->state); priv->hb_interval = 30*HZ; - if (!netif_carrier_ok(priv->netdev)) + if ((!netif_carrier_ok(priv->netdev)) || + (!test_bit(XVE_OPER_UP, &priv->flags))) xve_link_up(priv); } else { clear_bit(XVE_GW_STATE_UP, &priv->state); @@ -323,7 +353,7 @@ xve_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc) wc->byte_len, wc->slid); xve_ud_dma_unmap_rx(priv, mapping); - skb_put_frags(skb, XVE_UD_HEAD_SIZE, wc->byte_len, NULL); + xve_ud_skb_put_frags(priv, skb, wc->byte_len); grhhdr = (struct ib_packed_grh *)(skb->data); /* This will print packet when driver is in Debug Mode */ dumppkt(skb->data, skb->len, "UD Packet Dump"); @@ -507,18 +537,14 @@ int poll_tx(struct xve_dev_priv *priv) do { n = ib_poll_cq(priv->send_cq, MAX_SEND_CQE, priv->send_wc); /* handle multiple WC's in one call */ - if (likely(n > 0)) { - for (i = 0; i < n; ++i) - xve_ib_handle_tx_wc(priv->netdev, - priv->send_wc + i); - tot += n; - } else if (n == 0) { - break; - } else { + for (i = 0; i < n; ++i) + xve_ib_handle_tx_wc(priv->netdev, + priv->send_wc + i); + if (n < 0) { xve_warn(priv, "%s ib_poll_cq() failed, rc %d\n", - __func__, n); + __func__, n); } - + tot += n; } while (n == MAX_SEND_CQE); return tot; diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_main.c b/drivers/infiniband/ulp/xsigo/xve/xve_main.c index 91c29cee2b67..ff1af5d0fa65 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_main.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_main.c @@ -1077,14 +1077,14 @@ int xve_dev_init(struct net_device *dev, struct ib_device *ca, int port) priv->rx_ring = kcalloc(priv->xve_recvq_size, sizeof(*priv->rx_ring), GFP_KERNEL); if (!priv->rx_ring) { - pr_warn("%s: failed to allocate RX ring (%d entries)\n", + DRV_PRINT("%s:failed to allocate RX ring (%d entries)\n", ca->name, priv->xve_recvq_size); goto out; } priv->tx_ring = vmalloc(priv->xve_sendq_size * sizeof(*priv->tx_ring)); if (!priv->tx_ring) { - pr_warn("%s: failed to allocate TX ring (%d entries)\n", + DRV_PRINT("%s:failed to allocate TX ring (%d entries)\n", ca->name, priv->xve_sendq_size); goto out_rx_ring_cleanup; } @@ -1761,7 +1761,7 @@ xve_set_edr_features(struct xve_dev_priv *priv) int xve_set_dev_features(struct xve_dev_priv *priv, struct ib_device *hca) { - struct ib_device_attr *device_attr; + struct ib_device_attr device_attr; int result = -ENOMEM; priv->netdev->watchdog_timeo = 1000 * HZ; @@ -1796,23 +1796,15 @@ int xve_set_dev_features(struct xve_dev_priv *priv, struct ib_device *hca) xve_set_netdev(priv->netdev); - device_attr = kmalloc(sizeof(*device_attr), GFP_KERNEL); - - if (!device_attr) { - pr_warn("%s: allocation of %zu bytes failed\n", - hca->name, sizeof(*device_attr)); - return result; - } - - result = ib_query_device(hca, device_attr); + result = ib_query_device(hca, &device_attr); if (result) { pr_warn("%s: ib_query_device failed (ret = %d)\n", hca->name, result); - kfree(device_attr); return result; } - priv->hca_caps = device_attr->device_cap_flags; - kfree(device_attr); + + priv->dev_attr = device_attr; + priv->hca_caps = device_attr.device_cap_flags; xve_lro_setup(priv); if (xve_is_ovn(priv)) @@ -1969,8 +1961,8 @@ int xve_xsmp_send_oper_state(struct xve_dev_priv *priv, u64 vid, int state) int ret; char *str = state == XSMP_XVE_OPER_UP ? "UP" : "DOWN"; - pr_info("XVE: %s Sending OPER state [%d] to %s\n", - __func__, state, priv->xve_name); + pr_info("XVE: %s Sending OPER state [%d:%s] to %s\n", + __func__, state, str, priv->xve_name); if (state == XSMP_XVE_OPER_UP) { set_bit(XVE_OPER_REP_SENT, &priv->state); set_bit(XVE_PORT_LINK_UP, &priv->state); diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_multicast.c b/drivers/infiniband/ulp/xsigo/xve/xve_multicast.c index 314f7ff043ed..56d9aa105a46 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_multicast.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_multicast.c @@ -497,8 +497,10 @@ void xve_mcast_join_task(struct work_struct *work) struct net_device *dev = priv->netdev; struct ib_port_attr attr; - if (!test_bit(XVE_MCAST_RUN, &priv->flags)) + if (!test_bit(XVE_MCAST_RUN, &priv->flags)) { + priv->counters[XVE_MCAST_NOTREADY]++; return; + } if (!ib_query_port(priv->ca, priv->port, &attr)) priv->local_lid = attr.lid; @@ -595,8 +597,10 @@ int xve_mcast_start_thread(struct net_device *dev) || !test_bit(XVE_CHASSIS_ADMIN_UP, &priv->state)) return -ENOTCONN; - xve_dbg_mcast(priv, "%s Starting mcast thread for state[%ld ]\n", - __func__, priv->flags); + xve_dbg_mcast(priv, "%s Starting mcast thread for state[%ld:%d:%d]\n", + __func__, priv->flags, + test_bit(XVE_MCAST_RUN, &priv->flags), + test_bit(XVE_MCAST_RUN_GC, &priv->flags)); mutex_lock(&mcast_mutex); if (!test_and_set_bit(XVE_MCAST_RUN, &priv->flags)) @@ -640,12 +644,15 @@ static int xve_mcast_leave(struct net_device *dev, struct xve_mcast *mcast) /* Remove ourselves from the multicast group */ if (priv->qp) { - if (!test_bit(XVE_FLAG_DONT_DETACH_MCAST, &priv->flags)) + if (!test_bit(XVE_FLAG_DONT_DETACH_MCAST, + &priv->flags)) { ret = ib_detach_mcast(priv->qp, &mcast->mcmember.mgid, be16_to_cpu(mcast-> mcmember.mlid)); + priv->counters[XVE_MCAST_DETACH]++; + } } if (ret) xve_warn(priv, "ib_detach_mcast failed (result = %d)\n", diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_stats.c b/drivers/infiniband/ulp/xsigo/xve/xve_stats.c index 9a4413d61e41..7db8fe3812da 100755 --- a/drivers/infiniband/ulp/xsigo/xve/xve_stats.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_stats.c @@ -62,6 +62,7 @@ static char *counter_name[XVE_MAX_COUNTERS] = { "state_machine count:\t\t", "state_machine_up count:\t\t", "state_machine_down count:\t", + "state_machine_ibclear count:\t", "napi_poll_count:\t\t", "short_tx_pkt_count:\t\t", "tx_skb_count:\t\t\t", @@ -116,9 +117,12 @@ static char *counter_name[XVE_MAX_COUNTERS] = { "mac aged match not found:\t", "mac aged still in use:\t\t", "mac moved count:\t\t", + "mcast not ready count:\t\t", "mcast join task count:\t\t", "mcast leave task count:\t\t", "mcast carrier task count:\t", + "mcast attach count:\t\t", + "mcast detach count:\t\t", "tx ud count:\t\t\t", "tx rc count:\t\t\t", "tx mcast count:\t\t\t", @@ -143,7 +147,7 @@ static char *counter_name[XVE_MAX_COUNTERS] = { "ib pkey_change count:\t\t", "ib invalid count:\t\t", "uplink unicast:\t\t\t", - "Heartbeat Count:\t\t", + "Heartbeat Count(0x8919):\t\t", "Link State message count:\t", "RX frames without GRH\t\t", }; @@ -188,8 +192,8 @@ static char *misc_counter_name[XVE_MISC_MAX_COUNTERS] = { #define XS_RXBATCHING_ON "rbatch on" #define XS_RXBATCHING_OFF "rbatch off" -struct proc_dir_entry *proc_root_xve = NULL; -struct proc_dir_entry *proc_root_xve_dev = NULL; +struct proc_dir_entry *proc_root_xve; +struct proc_dir_entry *proc_root_xve_dev; static int xve_proc_open_device(struct inode *inode, struct file *file); static int xve_proc_read_device(struct seq_file *m, void *data); @@ -319,18 +323,16 @@ static int xve_proc_l2_read_device(struct seq_file *m, void *data) print_mgid_buf(tmp_buf, (char *)(fwt_entry->dgid.raw)); if (fwt_entry->path) { + u32 rx_rate = 0; + tx = xve_cmtx_get(fwt_entry->path); rx = xve_cmrx_get(fwt_entry->path); - if (tx) { - u32 rx_rate = 0; - - if (test_bit - (XVE_FLAG_OPER_UP, + if (test_bit(XVE_FLAG_OPER_UP, &tx->flags)) - cmstr = "Connected"; - if (rx) - rx_rate = - rx->stats.rx_rate; + cmstr = "Connected"; + if (rx) + rx_rate = rx->stats.rx_rate; + if (tx) { seq_printf(m, "%d\t%d\t%d\t%2x:%2x:%2x:%2x:%2x:%2x\t%s\t%s\t%x\t%s\t%d\t%d\n", j, fwt_entry->vlan, @@ -454,6 +456,8 @@ static int xve_proc_read_device(struct seq_file *m, void *data) seq_printf(m, "Admin mtu:\t\t\t%d\n", vp->admin_mtu); seq_printf(m, "MCAST mtu:\t\t\t%d\n", vp->mcast_mtu); seq_printf(m, "IB MAX MTU: \t\t\t%d\n", vp->max_ib_mtu); + seq_printf(m, "SG for UD:\t\t\t%d\n", xve_ud_need_sg(vp->max_ib_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); diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_tables.c b/drivers/infiniband/ulp/xsigo/xve/xve_tables.c index 71f7843607eb..ee0ce70678d7 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_tables.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_tables.c @@ -180,13 +180,12 @@ int xve_aging_task_machine(struct xve_dev_priv *priv) spin_lock_irqsave(&priv->lock, flags); xve_remove_fwt_entry(priv, fwt_entry); path = fwt_entry->path; - if (path) { + if (path) memcpy(dgid.raw, - path->pathrec.dgid.raw, - sizeof(dgid)); - if (list_empty(&path->fwt_list)) - is_list_empty = 1; - } + path->pathrec.dgid.raw, + sizeof(dgid)); + if (path && list_empty(&path->fwt_list)) + is_list_empty = 1; spin_unlock_irqrestore(&priv->lock, flags); if (xve_age_path && is_list_empty) @@ -401,7 +400,6 @@ void xve_prepare_skb(struct xve_dev_priv *priv, struct sk_buff *skb) skb_pkt_type(skb, PACKET_HOST); if (xve_is_ovn(priv) && test_bit(XVE_FLAG_CSUM, &priv->flags)) skb->ip_summed = CHECKSUM_UNNECESSARY; - skb->truesize = skb->len + sizeof(struct sk_buff); } void xve_tables_exit(void) diff --git a/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c b/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c index 168019b6bb7a..3cb7948bbe2f 100644 --- a/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c +++ b/drivers/infiniband/ulp/xsigo/xve/xve_verbs.c @@ -69,6 +69,8 @@ int xve_mcast_attach(struct net_device *dev, u16 mlid, union ib_gid *mgid, xve_warn(priv, "failed to attach to multicast group, ret = %d\n", ret); + else + priv->counters[XVE_MCAST_ATTACH]++; out: kfree(qp_attr); @@ -312,7 +314,10 @@ void xve_event(struct ib_event_handler *handler, struct ib_event *record) break; case IB_EVENT_CLIENT_REREGISTER: priv->counters[XVE_CLIENT_REREGISTER_COUNTER]++; - set_bit(XVE_FLAG_DONT_DETACH_MCAST, &priv->flags); + /* As EDR uvnic needs a Heart beat restart Multicast*/ + if (!priv->vnic_type) + set_bit(XVE_FLAG_DONT_DETACH_MCAST, + &priv->flags); xve_queue_work(priv, XVE_WQ_START_FLUSHLIGHT); break; case IB_EVENT_PORT_ERR: -- 2.50.1