linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/packet: Add getsockopt support for PACKET_COPY_THRESH
@ 2024-03-08 11:23 Juntong Deng
  2024-03-08 11:43 ` Willem de Bruijn
  0 siblings, 1 reply; 5+ messages in thread
From: Juntong Deng @ 2024-03-08 11:23 UTC (permalink / raw)
  To: willemdebruijn.kernel, davem, edumazet, kuba, pabeni; +Cc: netdev, linux-kernel

Currently getsockopt does not support PACKET_COPY_THRESH,
and we are unable to get the value of PACKET_COPY_THRESH
socket option through getsockopt.

This patch adds getsockopt support for PACKET_COPY_THRESH.

Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
---
 net/packet/af_packet.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 0db31ca4982d..65042edd1a97 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4090,6 +4090,9 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
 	case PACKET_VNET_HDR_SZ:
 		val = READ_ONCE(po->vnet_hdr_sz);
 		break;
+	case PACKET_COPY_THRESH:
+		val = pkt_sk(sk)->copy_thresh;
+		break;
 	case PACKET_VERSION:
 		val = po->tp_version;
 		break;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-08 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 11:23 [PATCH net-next] net/packet: Add getsockopt support for PACKET_COPY_THRESH Juntong Deng
2024-03-08 11:43 ` Willem de Bruijn
2024-03-08 12:08   ` Juntong Deng
2024-03-08 12:24     ` Willem de Bruijn
2024-03-08 13:06   ` Jason Xing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).