nvmet-tcp: set MSG_MORE only if we actually have more to send
authorSagi Grimberg <sagi@grimberg.me>
Thu, 12 Mar 2020 23:06:38 +0000 (16:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2020 07:25:59 +0000 (08:25 +0100)
commitc965a0299c6123d259ef0d4841f9fa3e1dee3e58
tree7b88fbb16291bba1e4766a81adb6eed3913ec25d
parentd3eb4daa333f84d175f290116a47592cb133537e
nvmet-tcp: set MSG_MORE only if we actually have more to send

commit 98fd5c723730f560e5bea919a64ac5b83d45eb72 upstream.

When we send PDU data, we want to optimize the tcp stack
operation if we have more data to send. So when we set MSG_MORE
when:
- We have more fragments coming in the batch, or
- We have a more data to send in this PDU
- We don't have a data digest trailer
- We optimize with the SUCCESS flag and omit the NVMe completion
  (used if sq_head pointer update is disabled)

This addresses a regression in QD=1 with SUCCESS flag optimization
as we unconditionally set MSG_MORE when we didn't actually have
more data to send.

Fixes: 70583295388a ("nvmet-tcp: implement C2HData SUCCESS optimization")
Reported-by: Mark Wunderlich <mark.wunderlich@intel.com>
Tested-by: Mark Wunderlich <mark.wunderlich@intel.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/target/tcp.c