nvme-tcp: question on poll return value

Daniel Wagner dwagner at suse.de
Sun Jan 28 23:38:49 PST 2024


On Sun, Jan 28, 2024 at 01:05:10PM +0200, Sagi Grimberg wrote:
> > Does this make any sense?
> 
> Not sure I understand your logic. nr_cqe is cleared when try_recv starts and
> incremented
> in every completion, and nvme_tcp_poll is returning this value as these are
> the number
> of cqes collected during the try_recv triggered by nvme_tcp_poll.
> 
> It is true that if between try_recv triggered by nvme_tcp_poll and another
> try_recv called
> from the RX io_work path, nr_cqe may be cleared again. That is something we
> can address
> by passing nr_cqe by reference as an in+out parameter to try_recv. But I
> don't see how
> nr_cqe is going to always be 0.

I was a bit confused when a looked at the code and didn't realize that
after setting nr_cqe to 0, that nvme_tcp_recv_data will be executed via
the read_sock callback. It's obvious now. Thanks for explaining.

Thanks,
Daniel



More information about the Linux-nvme mailing list