Skip to contentSkip to conversation

nvme-tcp: Remove access to sk->sk_ll_usec

PATCH In review Sebastian Andrzej Siewior 4 participants 11 messages Oct 10, 2019 – Oct 14, 2019 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-tcp: Remove access to sk->sk_ll_usec

The access to sk->sk_ll_usec should be hidden behind CONFIG_NET_RX_BUSY_POLL.
This shouldn't be required because this can also be set via

	setsockopt(,, SO_BUSY_POLL, &one, )

Remove access to sk_ll_usec behind CONFIG_NET_RX_BUSY_POLL.

Fixes 1a9460cef5711 ("nvme-tcp: support simple polling")
---
 drivers/nvme/host/tcp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/nvme/host/tcp.c +0 -1
index 385a5212c10f1..dbad6327e84bc 100644
@@ -1386,7 +1386,6 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
 	queue->sock->sk->sk_data_ready = nvme_tcp_data_ready;
 	queue->sock->sk->sk_state_change = nvme_tcp_state_change;
 	queue->sock->sk->sk_write_space = nvme_tcp_write_space;
-	queue->sock->sk->sk_ll_usec = 1;
 	write_unlock_bh(&queue->sock->sk->sk_callback_lock);
 
 	return 0;
Signature · 7 lines
2.23.0


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#1 lore raw
Quoted 6 lines · Sebastian Andrzej Siewior

The access to sk->sk_ll_usec should be hidden behind CONFIG_NET_RX_BUSY_POLL.
This shouldn't be required because this can also be set via

	setsockopt(,, SO_BUSY_POLL, &one, )

Remove access to sk_ll_usec behind CONFIG_NET_RX_BUSY_POLL.

The changelog doesn't match the patch, which just removes the assignment unconditionally.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#2 lore raw
Quoted 2 lines · Christoph Hellwig

The changelog doesn't match the patch, which just removes the assignment unconditionally.

I said that it has to be behind CONFIG_.* _but_ shouldn't be needed due to the setsockopt() thingy. Isn't this working? If not I can put it behind the ifdef. Be aware that the setsockopt() returns an error if this polling is not available.

Sebastian

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#3 lore raw
Quoted 8 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Christoph Hellwig

The changelog doesn't match the patch, which just removes the assignment unconditionally.

I said that it has to be behind CONFIG_.* _but_ shouldn't be needed due to the setsockopt() thingy. Isn't this working? If not I can put it behind the ifdef. Be aware that the setsockopt() returns an error if this polling is not available.

I didn't really understand that comment, or how it applies to the nvme code, given that it never calls setsockopt with SO_BUSY_POLL.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#5 lore raw
Quoted 5 lines · Sebastian Andrzej Siewior
Quoted 2 lines · Christoph Hellwig

I didn't really understand that comment, or how it applies to the nvme code, given that it never calls setsockopt with SO_BUSY_POLL.

So that part of the code is never accessed from userland?

No, the code uses sockets from kernel space.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#6 lore raw

PATCH v2 1/1 nvme-tcp: Initialize sk->sk_ll_usec only with NET_RX_BUSY_POLL

The access to sk->sk_ll_usec should be hidden behind CONFIG_NET_RX_BUSY_POLL like the definition of sk_ll_usec.

Put access to ->sk_ll_usec behind CONFIG_NET_RX_BUSY_POLL.

Fixes 1a9460cef5711 ("nvme-tcp: support simple polling")

---
v1…v2: Hide it behind CONFIG_NET_RX_BUSY_POLL instead removing it.

 drivers/nvme/host/tcp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/tcp.c +2 -0
index 385a5212c10f1..72059561b7f2a 100644
@@ -1386,7 +1386,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
 	queue->sock->sk->sk_data_ready = nvme_tcp_data_ready;
 	queue->sock->sk->sk_state_change = nvme_tcp_state_change;
 	queue->sock->sk->sk_write_space = nvme_tcp_write_space;
+#ifdef CONFIG_NET_RX_BUSY_POLL
 	queue->sock->sk->sk_ll_usec = 1;
+#endif
 	write_unlock_bh(&queue->sock->sk->sk_callback_lock);
 
 	return 0;
Signature · 7 lines
2.23.0


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#7 lore raw

RE: [PATCH v2] nvme-tcp: Initialize sk->sk_ll_usec only with NET_RX_BUSY_POLL

Should there also be a check here to honor any non-zero value of sk_ll_usec ( via sysctl_net_busy_read ), before setting here to hard coded default of 1? Or maybe best to have this as a separate patch to consider?

+#ifdef CONFIG_NET_RX_BUSY_POLL

	If (!queue->sock->sk->sk_ll_usec)

queue->sock->sk->sk_ll_usec = 1;
+#endif

-----Original Message-----
From: Linux-nvme <[email protected]> On Behalf Of Sebastian Andrzej Siewior
Sent: Thursday, October 10, 2019 8:34 AM
To: Christoph Hellwig <[email protected]>
Cc: Keith Busch <[email protected]>; Jens Axboe <[email protected]>; [email protected]; Sagi Grimberg <[email protected]>; [email protected]
Subject: [PATCH v2] nvme-tcp: Initialize sk->sk_ll_usec only with NET_RX_BUSY_POLL

The access to sk->sk_ll_usec should be hidden behind CONFIG_NET_RX_BUSY_POLL like the definition of sk_ll_usec.

Put access to ->sk_ll_usec behind CONFIG_NET_RX_BUSY_POLL.

Fixes 1a9460cef5711 ("nvme-tcp: support simple polling")

---
v1…v2: Hide it behind CONFIG_NET_RX_BUSY_POLL instead removing it.

 drivers/nvme/host/tcp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/nvme/host/tcp.c +2 -0
@@ -1386,7 +1386,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
 	queue->sock->sk->sk_data_ready = nvme_tcp_data_ready;
 	queue->sock->sk->sk_state_change = nvme_tcp_state_change;
 	queue->sock->sk->sk_write_space = nvme_tcp_write_space;
+#ifdef CONFIG_NET_RX_BUSY_POLL
 	queue->sock->sk->sk_ll_usec = 1;
+#endif
 	write_unlock_bh(&queue->sock->sk->sk_callback_lock);
 
 	return 0;

--
2.23.0

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#8 lore raw

Re: [PATCH v2] nvme-tcp: Initialize sk->sk_ll_usec only with NET_RX_BUSY_POLL

Quoted 2 lines · Mark

Should there also be a check here to honor any non-zero value of sk_ll_usec ( via sysctl_net_busy_read ), before setting here to hard coded default of 1? Or maybe best to have this as a separate patch to consider?

Let's keep that separate. If you want to enhance that area, we probably shouldn't build nvme_tcp_poll at all without CONFIG_NET_RX_BUSY_POLL as well.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer Reviewed-by on v2 1/1
#9 lore raw

Re: [PATCH v2] nvme-tcp: Initialize sk->sk_ll_usec only with NET_RX_BUSY_POLL

In reply to Sebastian Andrzej Siewior
Quoted 7 lines · Sebastian Andrzej Siewior

The access to sk->sk_ll_usec should be hidden behind CONFIG_NET_RX_BUSY_POLL like the definition of sk_ll_usec.

Put access to ->sk_ll_usec behind CONFIG_NET_RX_BUSY_POLL.

Fixes 1a9460cef5711 ("nvme-tcp: support simple polling")

Looks good,

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer Applied
#10 lore raw

Re: [PATCH v2] nvme-tcp: Initialize sk->sk_ll_usec only with NET_RX_BUSY_POLL

Quoted 4 lines · Christoph Hellwig
Quoted 3 lines · Sebastian Andrzej Siewior

The access to sk->sk_ll_usec should be hidden behind CONFIG_NET_RX_BUSY_POLL like the definition of sk_ll_usec.

Quoted 8 lines
Quoted 4 lines

Put access to ->sk_ll_usec behind CONFIG_NET_RX_BUSY_POLL.

Fixes 1a9460cef5711 ("nvme-tcp: support simple polling")

Looks good,

Thanks, applied to nvme-5.4.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme