Skip to content

Commit

Permalink
nvme-tcp: don't check blk_mq_tag_to_rq when receiving pdu data
Browse files Browse the repository at this point in the history
We already validate it when receiving the c2hdata pdu header
and this is not changing so this is a redundant check.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
sagigrimberg authored and Christoph Hellwig committed Aug 16, 2021
1 parent 27453b4 commit 3b01a9d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions drivers/nvme/host/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,17 +702,9 @@ static int nvme_tcp_recv_data(struct nvme_tcp_queue *queue, struct sk_buff *skb,
unsigned int *offset, size_t *len)
{
struct nvme_tcp_data_pdu *pdu = (void *)queue->pdu;
struct nvme_tcp_request *req;
struct request *rq;

rq = blk_mq_tag_to_rq(nvme_tcp_tagset(queue), pdu->command_id);
if (!rq) {
dev_err(queue->ctrl->ctrl.device,
"queue %d tag %#x not found\n",
nvme_tcp_queue_id(queue), pdu->command_id);
return -ENOENT;
}
req = blk_mq_rq_to_pdu(rq);
struct request *rq =
blk_mq_tag_to_rq(nvme_tcp_tagset(queue), pdu->command_id);
struct nvme_tcp_request *req = blk_mq_rq_to_pdu(rq);

while (true) {
int recv_len, ret;
Expand Down

0 comments on commit 3b01a9d

Please sign in to comment.