Commit 10407ec9 authored by Potnuri Bharat Teja's avatar Potnuri Bharat Teja Committed by Sagi Grimberg

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: default avatarPotnuri Bharat Teja <bharat@chelsio.com>
Acked-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
parent 6be18260
...@@ -1018,14 +1018,15 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue) ...@@ -1018,14 +1018,15 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
static int nvme_tcp_try_recv(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; read_descriptor_t rd_desc;
int consumed; int consumed;
rd_desc.arg.data = queue; rd_desc.arg.data = queue;
rd_desc.count = 1; rd_desc.count = 1;
lock_sock(sk); 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); release_sock(sk);
return consumed; return consumed;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment