diff mbox

[rdma-next,7/9] IB/ipoib: Use debug prints instead of warnings in RNR WC status

Message ID 20161227133911.14340-8-leon@kernel.org (mailing list archive)
State Superseded
Headers show

Commit Message

Leon Romanovsky Dec. 27, 2016, 1:39 p.m. UTC
From: Feras Daoud <ferasda@mellanox.com>

If a receive request has not been posted to the work queue, the incoming
message is rejected and the peer will receive a receiver-not-ready (RNR)
error. In IPoIB, IB_WC_RNR_RETRY_EXC_ERR error is part of the life cycle
therefore ipoib_cm_handle_tx_wc function will print to debug instead
of warnings.

Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Yuval Shaia Dec. 28, 2016, 12:15 p.m. UTC | #1
On Tue, Dec 27, 2016 at 03:39:09PM +0200, Leon Romanovsky wrote:
> From: Feras Daoud <ferasda@mellanox.com>
> 
> If a receive request has not been posted to the work queue, the incoming
> message is rejected and the peer will receive a receiver-not-ready (RNR)
> error. In IPoIB, IB_WC_RNR_RETRY_EXC_ERR error is part of the life cycle
> therefore ipoib_cm_handle_tx_wc function will print to debug instead
> of warnings.
> 
> Signed-off-by: Feras Daoud <ferasda@mellanox.com>
> Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
> Signed-off-by: Leon Romanovsky <leon@kernel.org>
> ---
>  drivers/infiniband/ulp/ipoib/ipoib_cm.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> index a720d2d..b6444b2 100644
> --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> @@ -820,9 +820,12 @@ void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
>  	    wc->status != IB_WC_WR_FLUSH_ERR) {
>  		struct ipoib_neigh *neigh;
>  
> -		ipoib_dbg(priv, "failed cm send event "
> -			   "(status=%d, wrid=%d vend_err %x)\n",
> -			   wc->status, wr_id, wc->vendor_err);
> +		if (wc->status != IB_WC_RNR_RETRY_EXC_ERR)
> +			ipoib_warn(priv, "%s: failed cm send event (status=%d, wrid=%d vend_err %x)\n",
> +				   __func__, wc->status, wr_id, wc->vendor_err);

Do we really need function-name to be printed here?

> +		else
> +			ipoib_dbg(priv, "%s: failed cm send event (status=%d, wrid=%d vend_err %x)\n",
> +				  __func__, wc->status, wr_id, wc->vendor_err);
>  
>  		spin_lock_irqsave(&priv->lock, flags);
>  		neigh = tx->neigh;
> -- 
> 2.10.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky Dec. 28, 2016, 12:22 p.m. UTC | #2
On Wed, Dec 28, 2016 at 02:15:29PM +0200, Yuval Shaia wrote:
> On Tue, Dec 27, 2016 at 03:39:09PM +0200, Leon Romanovsky wrote:
> > From: Feras Daoud <ferasda@mellanox.com>
> >
> > If a receive request has not been posted to the work queue, the incoming
> > message is rejected and the peer will receive a receiver-not-ready (RNR)
> > error. In IPoIB, IB_WC_RNR_RETRY_EXC_ERR error is part of the life cycle
> > therefore ipoib_cm_handle_tx_wc function will print to debug instead
> > of warnings.
> >
> > Signed-off-by: Feras Daoud <ferasda@mellanox.com>
> > Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leon@kernel.org>
> > ---
> >  drivers/infiniband/ulp/ipoib/ipoib_cm.c | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > index a720d2d..b6444b2 100644
> > --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
> > @@ -820,9 +820,12 @@ void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
> >  	    wc->status != IB_WC_WR_FLUSH_ERR) {
> >  		struct ipoib_neigh *neigh;
> >
> > -		ipoib_dbg(priv, "failed cm send event "
> > -			   "(status=%d, wrid=%d vend_err %x)\n",
> > -			   wc->status, wr_id, wc->vendor_err);
> > +		if (wc->status != IB_WC_RNR_RETRY_EXC_ERR)
> > +			ipoib_warn(priv, "%s: failed cm send event (status=%d, wrid=%d vend_err %x)\n",
> > +				   __func__, wc->status, wr_id, wc->vendor_err);
>
> Do we really need function-name to be printed here?

You are right,
Sorry, I missed it in review and will respin without __func__.

>
> > +		else
> > +			ipoib_dbg(priv, "%s: failed cm send event (status=%d, wrid=%d vend_err %x)\n",
> > +				  __func__, wc->status, wr_id, wc->vendor_err);
> >
> >  		spin_lock_irqsave(&priv->lock, flags);
> >  		neigh = tx->neigh;
> > --
> > 2.10.2
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index a720d2d..b6444b2 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -820,9 +820,12 @@  void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
 	    wc->status != IB_WC_WR_FLUSH_ERR) {
 		struct ipoib_neigh *neigh;
 
-		ipoib_dbg(priv, "failed cm send event "
-			   "(status=%d, wrid=%d vend_err %x)\n",
-			   wc->status, wr_id, wc->vendor_err);
+		if (wc->status != IB_WC_RNR_RETRY_EXC_ERR)
+			ipoib_warn(priv, "%s: failed cm send event (status=%d, wrid=%d vend_err %x)\n",
+				   __func__, wc->status, wr_id, wc->vendor_err);
+		else
+			ipoib_dbg(priv, "%s: failed cm send event (status=%d, wrid=%d vend_err %x)\n",
+				  __func__, wc->status, wr_id, wc->vendor_err);
 
 		spin_lock_irqsave(&priv->lock, flags);
 		neigh = tx->neigh;