Skip to contentSkip to conversation

nvme-tcp: Use protocol specific operations while reading socket

RFC In review Potnuri Bharat Teja 2 participants 3 messages Jul 4, 2019 – Jul 8, 2019 NVMe

lore
Share & tools
lore
#0 lore raw

RFC 1/1 nvme-tcp: Use protocol specific operations while reading socket

Using socket specific read_sock() calls instead of directly calling tcp_read_sock() helps lld module registered handlers if any, to be called from nvme-tcp host.
This patch therefore replaces the tcp_read_sock() with socket specific prot_ops.

Signed-off-by Potnuri Bharat Teja <bharat at chelsio.com>
---
 drivers/nvme/host/tcp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/tcp.c +3 -2
index 08a2501b9357..6ba667e62b75 100644
@@ -1016,14 +1016,15 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
 
 static int nvme_tcp_try_recv(struct nvme_tcp_queue *queue)
 {
-	struct sock *sk = queue->sock->sk;
+	struct socket *sock = queue->sock;
+	struct sock *sk = sock->sk;
 	read_descriptor_t rd_desc;
 	int consumed;
 
 	rd_desc.arg.data = queue;
 	rd_desc.count = 1;
 	lock_sock(sk);
-	consumed = tcp_read_sock(sk, &rd_desc, nvme_tcp_recv_skb);
+	consumed = sock->ops->read_sock(sk, &rd_desc, nvme_tcp_recv_skb);
 	release_sock(sk);
 	return consumed;
 }
Signature · 1 line
2.18.0.232.gb7bd9486b055
maintainer Acked-by on v1 1/1
#1 lore raw

Potnuri, this seems fine to me,

Acked-by Sagi Grimberg <sagi at grimberg.me>
#2 lore raw
Quoted 3 lines · Sagi Grimberg

Potnuri, this seems fine to me,

Acked-by Sagi Grimberg <sagi at grimberg.me>

Thanks Sagi.
Shall send it out as Patch.