Re: cma::addr_handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2019/6/6 15:14, Håkon Bugge wrote:

On 6 Jun 2019, at 08:24, Yanjun Zhu <yanjun.zhu@xxxxxxxxxx> wrote:

How to handle "status = 0 && id_priv->cma_dev !=NULL"?

"if (!status && !id_priv->cma_dev)"  is false.

"} else if (status) {" is also false.
Exactly, we do not want to print an error message (status != 0) when there is no error (status == 0).

status  cma_dev

0          NULL                           "if (!status && !id_priv->cma_dev)" is true

0          !NULL                          No print

!0         NULL                           "} else if (status) {" is true

!0         !NULL                          "} else if (status) {" is true

I think your change is good.:-(

Zhu Yanjun


Thxs, Håkon

Zhu Yanjun

On 2019/6/5 21:40, Håkon Bugge wrote:
Said function contains:


	if (!status && !id_priv->cma_dev) {
		status = cma_acquire_dev_by_src_ip(id_priv);
		if (status)
			pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to acquire device. status %d\n",
					     status);
	} else {
		pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to resolve IP. status %d\n", status);
	}

Now, assuming status == 0 and the device already has been acquired (id_priv->cma_dev != NULL), we get the "error" message:

RDMA CM: ADDR_ERROR: failed to resolve IP. status 0

Probably not intentional.

So, would we agree to have:

	} else if (status) {
		pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to resolve IP. status %d\n", status);
	}


instead?


Thxs, Håkon





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux