Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp492480lqc; Fri, 8 Mar 2024 03:51:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVrquMUVnSuRItUgIoCqbsik0DqA8er1tzc1ZqsumtjXUjLpu9JHaESNxQ83Ez0pact8iUFd6V+B+BnGQparDz6Zr+iBWXSyCjtMZEE2Q== X-Google-Smtp-Source: AGHT+IEFX6VerCfvzrUbiSlJ5PkGcdEGQHrsO9Wow9UlXJZmj1F0lI9hiI+407t/hSAFhrT1ppNw X-Received: by 2002:a17:906:244d:b0:a45:7a66:618 with SMTP id a13-20020a170906244d00b00a457a660618mr8604042ejb.66.1709898716356; Fri, 08 Mar 2024 03:51:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709898716; cv=pass; d=google.com; s=arc-20160816; b=UAhIGQLjdU2BWVYdhKJ7DNeJSRoHQtEn3VNF8G1sofM7FNfONS0jD0qt9EDjx0qsrO fgHzWFQraDvkf6mcOlGe9PiIiPvAaGan6nDO3JiwU9qinSeigrWkVdQfgD+g1qlWrWBG ZvGryt57W1Q5wK+FclRW64t5uiA7CAXmF4KLi+vcxaD4seQEpgwfbaVAOp59VVfVy6fN 0xUj3nGXzWqcM8jhbszMg/ImMYq7yiZNJ5bhPj+dSqeL504bw1AirCUD6XpIpy1un0t8 KY5NB8q5ENSEYsSd1TE8bpJFHZhJwoCk4u395Fq340d0wh06WP6lUAWreIfj2fbyCtnh PfHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:from:date:dkim-signature; bh=964gVKcSuC5DAvgCgp/Gwi4YKzK2yMuQXH05ybowodM=; fh=EFC4R3wDZEYKnoR1U8s8X/QbI3AJSkJSg5H2SykSe/I=; b=NdT353gUPl+sOuU2L0KfsdrzN/ImS9Ua0bDSeEdX8m/9AS+JZMFzfDzem1G2mWcy+e MQxLVY25/eVAyPf4cVXKJ8meqoEWZ2bnCCfgAIc1kLv6om+7ADOdUUCM9RYs7c7NxLH9 Svr2bM5MSaEZQqfqZHTCzq5nAIi0noWqmFLLar099F+AobsHr/0Ki0I6FO2bKhpq47hp aakuZPwtm16hGHjFIFJ0QsvX9tnt6d4TrZ8RuQMAM4hf2g3k+jqEQz2kT7zpmy5JxGNP i+sGiVEMp2QIt06zsqtbCE+tGXGJlv6m7jARefhDBBN28L+PY+gikTgNtlYtUqexHKzo xrPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PIGjsZ1G; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-96947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96947-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t16-20020a170906269000b00a43bd1e910esi7711370ejc.585.2024.03.08.03.51.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:51:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PIGjsZ1G; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-96947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96947-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BF6B21F245D5 for ; Fri, 8 Mar 2024 11:43:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5D2156471; Fri, 8 Mar 2024 11:43:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PIGjsZ1G" Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F10A56456; Fri, 8 Mar 2024 11:43:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709898215; cv=none; b=VeWjlU27QlWYtX0gG6ytCiY9EoElEoDqytIC/i/n7/RFs6rfEtNq1JWPjxwbaEdTzdlFFrXFDQHg7gVT81IS1JsZ8J8yPUEGHebFy/vMvU454cDwqm1CxgU+lNPCq8YYqKKrLzxTDZD1d+CQ1viS3Z8W03ziTXZCqmkvFTYR/wo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709898215; c=relaxed/simple; bh=BLq4lE0ORuBLkjW/aMxstNNMbjhuSScW2T/odBK1an8=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=exfK3B6ArnlnQjk3zy84lhFXK1tpWJOFUU8LTy8bjRY5u/343VPoKmJPFpokLu44nzlxo6Rq0ngIpwMKx2CfjyekxIAcgkRvgR7080lARnZcTZqatsd313dAPAPtsa4Zgud5ovU6+j7+2cQ1zJppYP2dEAiCVe62K8n3wZ3IuKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PIGjsZ1G; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-78810ba2ff1so38570885a.3; Fri, 08 Mar 2024 03:43:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709898212; x=1710503012; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=964gVKcSuC5DAvgCgp/Gwi4YKzK2yMuQXH05ybowodM=; b=PIGjsZ1G3KL/USsCQYH09g7Iw2EFGlH2twvIs8X/qANiXOQHpyoWepXpc/6VifH2DO 3nmQdBoHiPR8tzgouFHHw05kW3BBQXGvDFGifhfsJ7jCZfcMISaPkphKpk9M5hFNaS2W 5lugZi5Cuq8My/zSE6WCslxbcKCy/hdiNP/9C68193AhrpTHVbjBnyvONtJjlaJH2ZRD 0AKdgo2zo73onRVIimpZP83nMyE0fnSGHKtuLx1/QbRWokyQN/tgfzuJER07Qma3gCan NxwHQzdNc14R2gPmTwn3hyhFn5zZHIxozU2hrQLE7r8q1u5c5Kw3bmCcdX3mlz1o1MVW cw3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709898212; x=1710503012; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=964gVKcSuC5DAvgCgp/Gwi4YKzK2yMuQXH05ybowodM=; b=nqJ62rG46ZzqbqktDmsolwzviHM44CVyokPjQ4n+7qpMEimMWMYPap8vmULmh/yOAr fxVinLVa5lRrlDcozVXbGabitDegP+y718w8Bt1x9Jc2dzhUijfjD/cnxItU45po2NKJ mgVw86jG8o8Ifi1f99F2gLaxKp/zXO/7r4HTRzLjjANCLVXmBVG8CQllRqD6Rm/HM0lq 3KL2ThTnDPNKAG+/dwoK+CupnyEcXOeJkJMyUnC2agB62KUA+xDNh0P2UiGXVoeLzOsX uL5CCehHk0hIxImGpXTC+BaFpoZbmTfN8Fvk78+/ecdia/AuPEWJpC+Ik1PtXCKxDNsJ RJQA== X-Forwarded-Encrypted: i=1; AJvYcCU/kXhKRaP4fibk9u15Zfdr4u2lhwH7iO2EByp0IZ6ImOeZJ7Hdrp9fz10tdplEWqK3S6XleMB3ubWU1jFrBZ0Iu17PNmNd8aDZe8uU X-Gm-Message-State: AOJu0Yw4OeVAWdrPlCL7VrOAimLxaE6b9ml30Z9+/ffbcraUOOv2YoE4 K3kfHwo+v98o0preOn8/4NXD/ZUXc7HYbq28qegj4beow6x15fFX X-Received: by 2002:a05:620a:95a:b0:788:3207:bc3 with SMTP id w26-20020a05620a095a00b0078832070bc3mr11364161qkw.8.1709898212290; Fri, 08 Mar 2024 03:43:32 -0800 (PST) Received: from localhost (55.87.194.35.bc.googleusercontent.com. [35.194.87.55]) by smtp.gmail.com with ESMTPSA id d4-20020a37c404000000b00788253714cbsm5494285qki.58.2024.03.08.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 03:43:31 -0800 (PST) Date: Fri, 08 Mar 2024 06:43:31 -0500 From: Willem de Bruijn To: Juntong Deng , willemdebruijn.kernel@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <65eaf9e336d07_133b25294db@willemb.c.googlers.com.notmuch> In-Reply-To: References: Subject: Re: [PATCH net-next] net/packet: Add getsockopt support for PACKET_COPY_THRESH Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Juntong Deng wrote: > 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 > --- > 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; This is probably a good opportunity to use READ_ONCE/WRITE_ONCE for this variable that can be modified and read concurrently. Alternatively I can fix up all three locations in a follow-on patch. No concerns with adding the getsockopt itself. > case PACKET_VERSION: > val = po->tp_version; > break; > -- > 2.39.2 >