Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1843229rwb; Tue, 29 Nov 2022 21:10:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf4UWJuPWHD56R1F/w+7VpHaCwi3VQR2luE/e5WXm2EwJ9lPBFbvOGRyKFfIVWKfw8Z1UQYZ X-Received: by 2002:a17:90a:bb18:b0:219:6a07:c6cb with SMTP id u24-20020a17090abb1800b002196a07c6cbmr24964pjr.145.1669785040208; Tue, 29 Nov 2022 21:10:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669785040; cv=none; d=google.com; s=arc-20160816; b=pHqxklP6YencgMAORMbd+sDmfdgbQ6NJa3bfrwj9uqMOxTcIyeOeiDGn7Dq6s9HUCv StpA2gJTiBmQvUHE2sOhZ4/Lkj+vxJcYURjsZGSXkrhPOURDrtAeKWmIg+eia2Ue6pOC VVJbHEyM9Ycv0fmt0z4dfumYHdWC2ML51vH1e4nplSkWTQrII+j5ARo835/S5nESHtun ktJb+Ag30tKKU59wadLHyt5sYj30gRu3BdLr8swqtH7yphOV+rUkr846knKtYb3sW/JM dV+xXvgcALBeohkkCqE6A/UsSUmUDifZ1e/bF/6/EfJksGt4804d5ZqjdTDpI+vNXRdf CA7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=P8ZBK5j8pA02gbTTgYpiSLa7pcQnXY+7dvTfL9G4HnE=; b=Nw6YoEvHhpqUwrxBUhovtuLptLNxFxMvlknnX719k/x27XewYKsSW5Z55wNWDsdUXY mWaDaS/v3m0idlakDy2jkSmRPN0hYAIJ2XbDqIqlF7cud6u6jJADRl7LujBV98iqC6fU RD9b83OrYq5WUpGqyXQ+yHo7d6akzF+FtCMwCxwW5bhBy0hoVaefBSZvWeegFKJYl0dV 2VJN3b/M9+KrnX0vmUlzQ1kztk9zFAYblmFnZnchsYfhUA6iYg8GnX+ed4iRlmX8niBE HtfNjpBseplOZ6v0QrAnYZU9NrMBoObRn/O/DeoVAz5tIr0UVz6Mm4VHJN3rxiB+oFPq Gzcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fV8Mok3G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u32-20020a056a0009a000b005668645daebsi774676pfg.111.2022.11.29.21.10.29; Tue, 29 Nov 2022 21:10:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fV8Mok3G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbiK3EsZ (ORCPT + 84 others); Tue, 29 Nov 2022 23:48:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbiK3EsV (ORCPT ); Tue, 29 Nov 2022 23:48:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C79DF64556; Tue, 29 Nov 2022 20:48:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5F73661A01; Wed, 30 Nov 2022 04:48:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E1A1C433D7; Wed, 30 Nov 2022 04:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669783699; bh=FcnFgEt9daWUg1bE7GqdiCvcyu5jFWhYlabzDjVQ+GE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fV8Mok3GzjYqRgeg/stgUH0bdwVMv3WEzbbANKJPw4HktVwaKQ9GKO458J8gtwYt8 GcQ+hwgXcUGAALlcUekOJuSbbPIIVde/w5zaHHjKvqZY+x/izyKBpsz4h1aHMkayVR qiNvkAmChWcYYwObYAicHiZXQYO0uSV7TIYes4MFp/gqJ45XmUyXaut+v0nqyF5xDR /JIxScQlnKi3+6fFvInNsLszfNL1UNj8zHzLBhusGuUp6FNYthsdi/BBVs+PSmYiIu 2oYvGoqC6MSOqLWE6nnKrxDmksWHNh0jSGfP5nJQo0VU8KIc8xIWKrMRsg3tPdueU5 W7uCmK4rhgKcQ== Date: Tue, 29 Nov 2022 20:48:18 -0800 From: Jakub Kicinski To: Firo Yang Cc: marcelo.leitner@gmail.com, vyasevich@gmail.com, nhorman@tuxdriver.com, mkubecek@suse.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, firogm@gmail.com Subject: Re: [PATCH v2 1/1] sctp: sysctl: make extra pointers netns aware Message-ID: <20221129204818.7d8204b4@kernel.org> In-Reply-To: <20221125121127.40815-1-firo.yang@suse.com> References: <20221125121127.40815-1-firo.yang@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Nov 2022 20:11:27 +0800 Firo Yang wrote: > +#define SCTP_RTO_MIN_IDX 1 > +#define SCTP_RTO_MAX_IDX 2 > +#define SCTP_PF_RETRANS_IDX 3 > +#define SCTP_PS_RETRANS_IDX 4 Use these to index the entries, please, like this: struct bla table[] = { [MY_INDEX_ONE] = { .whatever = 1, }, [MY_INDEX_TWO] = { .fields = 2, }, { .there = 3, }, { .are = 4, }, }; I think that works even without all entries in the table having the index.. ? > static struct ctl_table sctp_net_table[] = { > { > .procname = "rto_initial", > @@ -112,6 +122,24 @@ static struct ctl_table sctp_net_table[] = { > .extra1 = &init_net.sctp.rto_min, > .extra2 = &timer_max > }, > + { > + .procname = "pf_retrans", > + .data = &init_net.sctp.pf_retrans, > + .maxlen = sizeof(int), > + .mode = 0644, > + .proc_handler = proc_dointvec_minmax, > + .extra1 = SYSCTL_ZERO, > + .extra2 = &init_net.sctp.ps_retrans, > + }, > + { > + .procname = "ps_retrans", > + .data = &init_net.sctp.ps_retrans, > + .maxlen = sizeof(int), > + .mode = 0644, > + .proc_handler = proc_dointvec_minmax, > + .extra1 = &init_net.sctp.pf_retrans, > + .extra2 = &ps_retrans_max, > + },