if (ib_sa_rate_enum_to_int(mcast->mcmember.rate) > 0) av.static_rate = (2 * priv->local_rate - ib_sa_rate_enum_to_int(mcast->mcmember.rate) - 1) / (priv->local_rate ? priv->local_rate : 1); 
if (path_rate > 0 && priv->local_rate > path_rate) av.static_rate = (priv->local_rate - 1) / path_rate; 
static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,				   struct ib_sa_mcmember_rec *mcmember){	struct net_device *dev = mcast->dev;	struct ipoib_dev_priv *priv = netdev_priv(dev);	int ret;	mcast->mcmember = *mcmember;	/* Set the cached Q_Key before we attach if it's the broadcast group */	if (!memcmp(mcast->mcmember.mgid.raw, priv->dev->broadcast + 4,		    sizeof (union ib_gid))) {		priv->qkey = be32_to_cpu(priv->broadcast->mcmember.qkey);		priv->tx_wr.wr.ud.remote_qkey = priv->qkey;	}	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 " IPOIB_GID_FMT				   " already attached\n",				   IPOIB_GID_ARG(mcast->mcmember.mgid));			return 0;		}		ret = ipoib_mcast_attach(dev, be16_to_cpu(mcast->mcmember.mlid),					 &mcast->mcmember.mgid);		if (ret < 0) {			ipoib_warn(priv, "couldn't attach QP to multicast group "				   IPOIB_GID_FMT "\n",				   IPOIB_GID_ARG(mcast->mcmember.mgid));			clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags);			return ret;		}	}	{		struct ib_ah_attr av = {			.dlid	       = be16_to_cpu(mcast->mcmember.mlid),			.port_num      = priv->port,			.sl	       = mcast->mcmember.sl,			.ah_flags      = IB_AH_GRH,			.grh	       = {				.flow_label    = be32_to_cpu(mcast->mcmember.flow_label),				.hop_limit     = mcast->mcmember.hop_limit,				.sgid_index    = 0,				.traffic_class = mcast->mcmember.traffic_class			}		};		av.grh.dgid = mcast->mcmember.mgid;		if (ib_sa_rate_enum_to_int(mcast->mcmember.rate) > 0)			av.static_rate = (2 * priv->local_rate -					  ib_sa_rate_enum_to_int(mcast->mcmember.rate) - 1) /				(priv->local_rate ? priv->local_rate : 1);		ipoib_dbg_mcast(priv, "static_rate %d for local port %dX, mcmember %dX\n",				av.static_rate, priv->local_rate,				ib_sa_rate_enum_to_int(mcast->mcmember.rate));		mcast->ah = ipoib_create_ah(dev, priv->pd, &av);		if (!mcast->ah) {			ipoib_warn(priv, "ib_address_create failed\n");		} else {			ipoib_dbg_mcast(priv, "MGID " IPOIB_GID_FMT					" AV %p, LID 0x%04x, SL %d\n",					IPOIB_GID_ARG(mcast->mcmember.mgid),					mcast->ah->ah,					be16_to_cpu(mcast->mcmember.mlid),					mcast->mcmember.sl);		}	}	/* actually send any queued packets */	while (!skb_queue_empty(&mcast->pkt_queue)) {		struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);		skb->dev = dev;		if (!skb->dst || !skb->dst->neighbour) {			/* put pseudoheader back on for next time */			skb_push(skb, sizeof (struct ipoib_pseudoheader));		}		if (dev_queue_xmit(skb))			ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n");	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/e6ded99cbbbfef2cef537d717ad61d2f77f4dfd6/ipoib_multicast.c/buggy/drivers/infiniband/ulp/ipoib/ipoib_multicast.c