From owner-svn-src-projects@FreeBSD.ORG Wed Oct 27 23:24:38 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B0F210656B3; Wed, 27 Oct 2010 23:24:38 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC5478FC17; Wed, 27 Oct 2010 23:24:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9RNObZT044154; Wed, 27 Oct 2010 23:24:37 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9RNObUj044150; Wed, 27 Oct 2010 23:24:37 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201010272324.o9RNObUj044150@svn.freebsd.org> From: Jeff Roberson Date: Wed, 27 Oct 2010 23:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214439 - projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 23:24:38 -0000 Author: jeff Date: Wed Oct 27 23:24:37 2010 New Revision: 214439 URL: http://svn.freebsd.org/changeset/base/214439 Log: - Correct the ipoib gid debug prints. - Fix the length supplied to ipoib_multicast_addr_valid. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Wed Oct 27 23:23:17 2010 (r214438) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Wed Oct 27 23:24:37 2010 (r214439) @@ -468,6 +468,7 @@ void ipoib_mcast_carrier_on_task(struct void ipoib_mcast_send(struct ifnet *dev, void *mgid, struct mbuf *mb); void ipoib_mcast_restart_task(struct work_struct *work); +void ipoib_mcast_restart(struct ipoib_dev_priv *); int ipoib_mcast_start_thread(struct ifnet *dev); int ipoib_mcast_stop_thread(struct ifnet *dev, int flush); Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Wed Oct 27 23:23:17 2010 (r214438) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Wed Oct 27 23:24:37 2010 (r214439) @@ -428,9 +428,9 @@ ipoib_mark_paths_invalid(struct ifnet *d spin_lock_irq(&priv->lock); list_for_each_entry_safe(path, tp, &priv->path_list, list) { - ipoib_dbg(priv, "mark path LID 0x%04x GID %pI6 invalid\n", + ipoib_dbg(priv, "mark path LID 0x%04x GID %16D invalid\n", be16_to_cpu(path->pathrec.dlid), - path->pathrec.dgid.raw); + path->pathrec.dgid.raw, ":"); path->valid = 0; } @@ -477,11 +477,11 @@ path_rec_completion(int status, struct i unsigned long flags; if (!status) - ipoib_dbg(priv, "PathRec LID 0x%04x for GID %pI6\n", - be16_to_cpu(pathrec->dlid), pathrec->dgid.raw); + ipoib_dbg(priv, "PathRec LID 0x%04x for GID %16D\n", + be16_to_cpu(pathrec->dlid), pathrec->dgid.raw, ":"); else - ipoib_dbg(priv, "PathRec status %d for GID %pI6\n", - status, path->pathrec.dgid.raw); + ipoib_dbg(priv, "PathRec status %d for GID %16D\n", + status, path->pathrec.dgid.raw, ":"); bzero(&mbqueue, sizeof(mbqueue)); @@ -596,8 +596,8 @@ path_rec_start(struct ifnet *dev, struct p_rec.mtu_selector = 0; } - ipoib_dbg(priv, "Start path record lookup for %pI6 MTU > %d\n", - p_rec.dgid.raw, + ipoib_dbg(priv, "Start path record lookup for %16D MTU > %d\n", + p_rec.dgid.raw, ":", comp_mask ? ib_mtu_enum_to_int(p_rec.mtu) : 0); init_completion(&path->done); Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Wed Oct 27 23:23:17 2010 (r214438) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Wed Oct 27 23:24:37 2010 (r214439) @@ -61,8 +61,8 @@ static void ipoib_mcast_free(struct ipoi struct ifnet *dev = mcast->dev; int tx_dropped = 0; - ipoib_dbg_mcast(dev->if_softc, "deleting multicast group %pI6\n", - mcast->mcmember.mgid.raw); + ipoib_dbg_mcast(dev->if_softc, "deleting multicast group %16D\n", + mcast->mcmember.mgid.raw, ":"); if (mcast->ah) ipoib_put_ah(mcast->ah); @@ -173,8 +173,8 @@ static int ipoib_mcast_join_finish(struc if (!test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) { if (test_and_set_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) { - ipoib_warn(priv, "multicast group %pI6 already attached\n", - mcast->mcmember.mgid.raw); + ipoib_warn(priv, "multicast group %16D already attached\n", + mcast->mcmember.mgid.raw, ":"); return 0; } @@ -182,8 +182,8 @@ static int ipoib_mcast_join_finish(struc ret = ipoib_mcast_attach(dev, be16_to_cpu(mcast->mcmember.mlid), &mcast->mcmember.mgid, set_qkey); if (ret < 0) { - ipoib_warn(priv, "couldn't attach QP to multicast group %pI6\n", - mcast->mcmember.mgid.raw); + ipoib_warn(priv, "couldn't attach QP to multicast group %16D\n", + mcast->mcmember.mgid.raw, ":"); clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags); return ret; @@ -214,8 +214,8 @@ static int ipoib_mcast_join_finish(struc mcast->ah = ah; spin_unlock_irq(&priv->lock); - ipoib_dbg_mcast(priv, "MGID %pI6 AV %p, LID 0x%04x, SL %d\n", - mcast->mcmember.mgid.raw, + ipoib_dbg_mcast(priv, "MGID %16D AV %p, LID 0x%04x, SL %d\n", + mcast->mcmember.mgid.raw, ":", mcast->ah->ah, be16_to_cpu(mcast->mcmember.mlid), mcast->mcmember.sl); @@ -252,8 +252,8 @@ ipoib_mcast_sendonly_join_complete(int s if (status) { if (mcast->logcount++ < 20) - ipoib_dbg_mcast(dev->if_softc, "multicast join failed for %pI6, status %d\n", - mcast->mcmember.mgid.raw, status); + ipoib_dbg_mcast(dev->if_softc, "multicast join failed for %16D, status %d\n", + mcast->mcmember.mgid.raw, ":", status); /* Flush out any queued packets */ dev->if_oerrors += mcast->pkt_queue.ifq_len; @@ -308,8 +308,8 @@ static int ipoib_mcast_sendonly_join(str ipoib_warn(priv, "ib_sa_join_multicast failed (ret = %d)\n", ret); } else { - ipoib_dbg_mcast(priv, "no multicast record for %pI6, starting join\n", - mcast->mcmember.mgid.raw); + ipoib_dbg_mcast(priv, "no multicast record for %16D, starting join\n", + mcast->mcmember.mgid.raw, ":"); } return ret; @@ -340,8 +340,8 @@ static int ipoib_mcast_join_complete(int struct ifnet *dev = mcast->dev; struct ipoib_dev_priv *priv = dev->if_softc; - ipoib_dbg_mcast(priv, "join completion for %pI6 (status %d)\n", - mcast->mcmember.mgid.raw, status); + ipoib_dbg_mcast(priv, "join completion for %16D (status %d)\n", + mcast->mcmember.mgid.raw, ":", status); /* We trap for port events ourselves. */ if (status == -ENETRESET) @@ -370,11 +370,11 @@ static int ipoib_mcast_join_complete(int if (mcast->logcount++ < 20) { if (status == -ETIMEDOUT || status == -EAGAIN) { - ipoib_dbg_mcast(priv, "multicast join failed for %pI6, status %d\n", - mcast->mcmember.mgid.raw, status); + ipoib_dbg_mcast(priv, "multicast join failed for %16D, status %d\n", + mcast->mcmember.mgid.raw, ":", status); } else { - ipoib_warn(priv, "multicast join failed for %pI6, status %d\n", - mcast->mcmember.mgid.raw, status); + ipoib_warn(priv, "multicast join failed for %16D, status %d\n", + mcast->mcmember.mgid.raw, ":", status); } } @@ -406,7 +406,8 @@ static void ipoib_mcast_join(struct ifne ib_sa_comp_mask comp_mask; int ret = 0; - ipoib_dbg_mcast(priv, "joining MGID %pI6\n", mcast->mcmember.mgid.raw); + ipoib_dbg_mcast(priv, "joining MGID %16D\n", + mcast->mcmember.mgid.raw, ":"); rec.mgid = mcast->mcmember.mgid; rec.port_gid = priv->local_gid; @@ -605,8 +606,8 @@ static int ipoib_mcast_leave(struct ifne ib_sa_free_multicast(mcast->mc); if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) { - ipoib_dbg_mcast(priv, "leaving MGID %pI6\n", - mcast->mcmember.mgid.raw); + ipoib_dbg_mcast(priv, "leaving MGID %16D\n", + mcast->mcmember.mgid.raw, ":"); /* Remove ourselves from the multicast group */ ret = ib_detach_mcast(priv->qp, &mcast->mcmember.mgid, @@ -635,8 +636,8 @@ ipoib_mcast_send(struct ifnet *dev, void mcast = __ipoib_mcast_find(dev, mgid); if (!mcast) { /* Let's create a new send only group now */ - ipoib_dbg_mcast(priv, "setting up send only multicast group for %pI6\n", - mgid); + ipoib_dbg_mcast(priv, "setting up send only multicast group for %16D\n", + mgid, ":"); mcast = ipoib_mcast_alloc(dev, 0); if (!mcast) { @@ -728,11 +729,17 @@ void ipoib_mcast_restart_task(struct wor { struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv, restart_task); + ipoib_mcast_restart(priv); +} + +void ipoib_mcast_restart(struct ipoib_dev_priv *priv) +{ struct ifnet *dev = priv->dev; struct ifmultiaddr *ifma;; struct ipoib_mcast *mcast, *tmcast; LIST_HEAD(remove_list); struct ib_sa_mcmember_rec rec; + int addrlen; ipoib_dbg_mcast(priv, "restarting multicast task flags 0x%lX\n", priv->flags); @@ -762,8 +769,8 @@ void ipoib_mcast_restart_task(struct wor if (ifma->ifma_addr->sa_family != AF_LINK) continue; addr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); - if (!ipoib_mcast_addr_is_valid(addr, - ifma->ifma_addr->sa_len, + addrlen = ((struct sockaddr_dl *)ifma->ifma_addr)->sdl_alen; + if (!ipoib_mcast_addr_is_valid(addr, addrlen, dev->if_broadcastaddr)) continue; @@ -776,14 +783,14 @@ void ipoib_mcast_restart_task(struct wor /* ignore group which is directly joined by userspace */ if (test_bit(IPOIB_FLAG_UMCAST, &priv->flags) && !ib_sa_get_mcmember_rec(priv->ca, priv->port, &mgid, &rec)) { - ipoib_dbg_mcast(priv, "ignoring multicast entry for mgid %pI6\n", - mgid.raw); + ipoib_dbg_mcast(priv, "ignoring multicast entry for mgid %16D\n", + mgid.raw, ":"); continue; } /* Not found or send-only group, let's add a new entry */ - ipoib_dbg_mcast(priv, "adding multicast entry for mgid %pI6\n", - mgid.raw); + ipoib_dbg_mcast(priv, "adding multicast entry for mgid %16D\n", + mgid.raw, ":"); nmcast = ipoib_mcast_alloc(dev, 0); if (!nmcast) { @@ -816,8 +823,8 @@ void ipoib_mcast_restart_task(struct wor list_for_each_entry_safe(mcast, tmcast, &priv->multicast_list, list) { if (!test_bit(IPOIB_MCAST_FLAG_FOUND, &mcast->flags) && !test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) { - ipoib_dbg_mcast(priv, "deleting multicast group %pI6\n", - mcast->mcmember.mgid.raw); + ipoib_dbg_mcast(priv, "deleting multicast group %16D\n", + mcast->mcmember.mgid.raw, ":"); rb_erase(&mcast->rb_node, &priv->multicast_tree);