Re: [PATCH 1/1] IB: mlx4: move the variable into the function

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

 




On 2019/3/19 21:21, Leon Romanovsky wrote:
On Tue, Mar 19, 2019 at 05:44:26PM +0800, Yanjun Zhu wrote:
@@ -683,6 +682,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
      u32 g_mlpath_rqpn;
      u16 wqe_ctr;
      unsigned tail = 0;
+    static struct mlx4_ib_qp *cur_qp = NULL;

Thanks a lot.

If a static is added, now can it get the same effect and make the source
code compact?
It will break consecutive calls to mlx4_ib_poll_cq(), because cur_qp
will have "old" value from previous call.

Yeah. I agree with you. I have also realized this problem. Thanks. Please ignore this patch.

Zhu Yanjun



  repoll:
      cqe = next_cqe_sw(cq);
@@ -720,8 +720,9 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,

On 2019/3/19 17:18, Leon Romanovsky wrote:
The commit message and patch are incorrect. cur_qp is used here as
"global variable" which is preserved during for loop.

Thanks. Probably a static should fix this. If you agree, I will send V2.
No, it won't fix.


Thanks



[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