nvme-tcp: Remove access to sk->sk_ll_usec
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.
--- drivers/nvme/host/tcp.c | 1 - 1 file changed, 1 deletion(-)
drivers/nvme/host/tcp.c +0 -1
@@ -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
Christoph Hellwig
maintainerQuoted 6 lines · Sebastian Andrzej Siewior
The access to
sk->sk_ll_usecshould be hidden behindCONFIG_NET_RX_BUSY_POLL.
This shouldn't be required because this can also be set viasetsockopt(,, SO_BUSY_POLL, &one, )Remove access to
sk_ll_usecbehindCONFIG_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
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
Christoph Hellwig
maintainerQuoted 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 thesetsockopt()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
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?
Sebastian
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Christoph Hellwig
maintainerQuoted 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
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.
---
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 ;
Signature · 7 lines
2.23.0 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
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.
---
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
Christoph Hellwig
maintainerRe: [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( viasysctl_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
Re: [PATCH v2] nvme-tcp: Initialize sk->sk_ll_usec only with NET_RX_BUSY_POLL
In reply to Sebastian Andrzej SiewiorQuoted 7 lines · Sebastian Andrzej Siewior
The access to
sk->sk_ll_usecshould be hidden behindCONFIG_NET_RX_BUSY_POLLlike the definition ofsk_ll_usec.Put access to ->sk_ll_usec behind
CONFIG_NET_RX_BUSY_POLL.Fixes 1a9460cef5711 ("nvme-tcp: support simple polling")Signed-off-by Sebastian Andrzej Siewior <[email protected]>
Looks good,
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
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_usecshould be hidden behindCONFIG_NET_RX_BUSY_POLLlike the definition ofsk_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")Signed-off-by Sebastian Andrzej Siewior <[email protected]>Looks good,
Reviewed-by Christoph Hellwig <[email protected]>
Thanks, applied to nvme-5.4.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme