From patchwork Mon Mar 25 16:17:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 1064502 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44SfYW2vKhz9sRj for ; Tue, 26 Mar 2019 03:17:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729571AbfCYQRe (ORCPT ); Mon, 25 Mar 2019 12:17:34 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38116 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbfCYQRc (ORCPT ); Mon, 25 Mar 2019 12:17:32 -0400 Received: by mail-pl1-f193.google.com with SMTP id g37so178117plb.5 for ; Mon, 25 Mar 2019 09:17:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EQ8VUpmBBubbNPUolCACetJhg4NroR2iGHFPPm9YxTY=; b=ZWJA1Zn8KI4XiAW0q4F5ENwRd4DIQNXHWGMDGvO5q5YFn6qCNpL/S0HA40c+by1Zrq d4Snmf7fGsU7U/+6/IzC/jeVN3MyYfNq5lGPoecPldhgeXVmk1Dtc8HTyuIYuiNJqk1t 1FmhEuCm3tqgrNGz6UQ3N+xiB6DpJoQFBaT9+M1jvS6p5yl68hR6YSD9vHYoylo12fBI obJw3ln8+UIK4XiEpxxItLxQ3gPG3B6BbU8IZ0i2Ozcw8qqbQX4UR7zPgyRv1qbbj8XT 2EBCszY1QzJYBFiMHQ2bUS51rQm3L+IwtJUevemZh7VRGhaCx0BdbE9XWzP5QgUgeB1w nIpw== X-Gm-Message-State: APjAAAWI2AYlh6c43X8Cn4MPbglrNAiCHNooRPkeLyBdPVjw1RfKI/PE WHuXiTCMC03S+Kt8TOexcTPLIKwd5Rc= X-Google-Smtp-Source: APXvYqxQDe7a+zLPCLV5bgVwv9BdGSMjRGiogH2w6ArIxvsqy128opC65B3Kw8MZvmVYPl0A3MII2g== X-Received: by 2002:a17:902:9a88:: with SMTP id w8mr26371093plp.8.1553530652108; Mon, 25 Mar 2019 09:17:32 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id 4sm8931854pgx.68.2019.03.25.09.17.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 09:17:31 -0700 (PDT) From: Bart Van Assche To: David Miller Cc: netdev@vger.kernel.org, Bart Van Assche , Martin KaFai Lau Subject: [PATCH v2 1/5] net/core: Document reuseport_add_sock() bind_inany argument Date: Mon, 25 Mar 2019 09:17:19 -0700 Message-Id: <20190325161723.144556-2-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190325161723.144556-1-bvanassche@acm.org> References: <20190325161723.144556-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch avoids that the following warning is reported when building with W=1: warning: Function parameter or member 'bind_inany' not described in 'reuseport_add_sock' Cc: Martin KaFai Lau Fixes: 2dbb9b9e6df6 ("bpf: Introduce BPF_PROG_TYPE_SK_REUSEPORT") # v4.19. Signed-off-by: Bart Van Assche --- net/core/sock_reuseport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c index d8fe3e549373..dc4aefdf2a08 100644 --- a/net/core/sock_reuseport.c +++ b/net/core/sock_reuseport.c @@ -144,6 +144,8 @@ static void reuseport_free_rcu(struct rcu_head *head) * reuseport_add_sock - Add a socket to the reuseport group of another. * @sk: New socket to add to the group. * @sk2: Socket belonging to the existing reuseport group. + * @bind_inany: Whether or not the group is bound to a local INANY address. + * * May return ENOMEM and not add socket to group under memory pressure. */ int reuseport_add_sock(struct sock *sk, struct sock *sk2, bool bind_inany) From patchwork Mon Mar 25 16:17:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 1064506 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44SfYg0jjPz9sRj for ; Tue, 26 Mar 2019 03:17:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729593AbfCYQRf (ORCPT ); Mon, 25 Mar 2019 12:17:35 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40917 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729514AbfCYQRe (ORCPT ); Mon, 25 Mar 2019 12:17:34 -0400 Received: by mail-pl1-f196.google.com with SMTP id b11so176479plr.7 for ; Mon, 25 Mar 2019 09:17:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mhR59C0bZkFAZVgYiFLX1iW2ufR5rsO3ckbomej8kCA=; b=oTbcAahsF/HTTsiBHMJISe1T8yQqySwr3OG0aHPo7OGjcmpDxaKY5SO1dDvDYKHpTt pwqDh2D3xdrox99zQRo+LYbjp8Wcj5nGT4PlXf/vsYTKwK20WVReXfBMXMqXy4T2vnq+ aAN9oW1RHfIm8AvVPuzkYnTjM6Z2BkVW1Fe7Ax+748d59dDKhvy14u8uhYxnV8adCbst OkQxI4gw/hzwdmdyo9xMRKekWv+O6eTvWgLbt3lTnXQ8IvKxPQ5RWtKpJijahOpzneTP JO6SoMDennfiZxpHuKRPaeyAq2rRB6Fe0MWa64gPuRl9C2yoGkNFarI3NoAydE9Xsw8d OGfw== X-Gm-Message-State: APjAAAWpA/0IO7c4elWH1DJpq2urV8VADSP4gDz/oF2U+rrGV5mstswI GhW7HO4C+0w1fUtXgL76LdI= X-Google-Smtp-Source: APXvYqwPWl612MVfzNUgaHY00lcMSxOt1FhEg42w/IV+A8pE1nV0ssDG5h49VycgIN1FSOM3r0ugtw== X-Received: by 2002:a17:902:584:: with SMTP id f4mr26647343plf.330.1553530653408; Mon, 25 Mar 2019 09:17:33 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id 4sm8931854pgx.68.2019.03.25.09.17.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 09:17:32 -0700 (PDT) From: Bart Van Assche To: David Miller Cc: netdev@vger.kernel.org, Bart Van Assche , Al Viro Subject: [PATCH v2 2/5] net/core: Document all dev_ioctl() arguments Date: Mon, 25 Mar 2019 09:17:20 -0700 Message-Id: <20190325161723.144556-3-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190325161723.144556-1-bvanassche@acm.org> References: <20190325161723.144556-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch avoids that the following warnings are reported when building with W=1: net/core/dev_ioctl.c:378: warning: Function parameter or member 'ifr' not described in 'dev_ioctl' net/core/dev_ioctl.c:378: warning: Function parameter or member 'need_copyout' not described in 'dev_ioctl' net/core/dev_ioctl.c:378: warning: Excess function parameter 'arg' description in 'dev_ioctl' Cc: Al Viro Fixes: 44c02a2c3dc5 ("dev_ioctl(): move copyin/copyout to callers") # v4.16. Signed-off-by: Bart Van Assche --- net/core/dev_ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c index 31380fd5a4e2..5163d900bb4f 100644 --- a/net/core/dev_ioctl.c +++ b/net/core/dev_ioctl.c @@ -366,7 +366,8 @@ EXPORT_SYMBOL(dev_load); * dev_ioctl - network device ioctl * @net: the applicable net namespace * @cmd: command to issue - * @arg: pointer to a struct ifreq in user space + * @ifr: pointer to a struct ifreq in user space + * @need_copyout: whether or not copy_to_user() should be called * * Issue ioctl functions to devices. This is normally called by the * user space syscall interfaces but can sometimes be useful for From patchwork Mon Mar 25 16:17:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 1064503 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44SfYY2n1Vz9sRj for ; Tue, 26 Mar 2019 03:17:37 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729606AbfCYQRg (ORCPT ); Mon, 25 Mar 2019 12:17:36 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:32775 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729582AbfCYQRf (ORCPT ); Mon, 25 Mar 2019 12:17:35 -0400 Received: by mail-pf1-f193.google.com with SMTP id i19so6687505pfd.0 for ; Mon, 25 Mar 2019 09:17:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OVR1nATDVdlt69boRyZg3P5dE1CjPHDE/D1UvNmGOJI=; b=Miuu4Xz7EzK0nSw6p7HzsmIR8UZ0X4jj3DpozRATqq1c97oTgnr9et89tV1x6neP/6 D8mZTtKdUwmYj6BURzzY/0j0/5Q2gB2bV9O1oFLgY4qPO3mt4HvvIAAFxfhKInKMcv4v lKPi5VOiS/IDLiKy55RQ1W8WhN+OtrunvYRZR2M0ncO4Cb6Ay7sWnH1wkOVqNMqj7gzd cPNefiIayxSj/8nMc+W26W1c3Zzqjhe84y+l5Rb0f5FSO5mXmoSSitjR2N6fs37/388F gMF9/WeDGNZ7m736PkFDgeuA0oR9ErJ3GmKiXgEb2JKRVcCGOonicvKaMfzqBAOe3f9Q XBwA== X-Gm-Message-State: APjAAAWVdGjURThJRtxyKotpyu/vjRDg9XBcvrBedyfJVSZfHpGS1FL3 M2Wpuek8xMPvXJcxPp+E9v4= X-Google-Smtp-Source: APXvYqz7fOBmdXv9ZmCDZVr1SkrAIPUfEjQDpETJge3NxXHbsZsMCOeVHzsM8y7pEpKvP/dOgpNEDw== X-Received: by 2002:a63:1410:: with SMTP id u16mr22680219pgl.420.1553530654353; Mon, 25 Mar 2019 09:17:34 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id 4sm8931854pgx.68.2019.03.25.09.17.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 09:17:33 -0700 (PDT) From: Bart Van Assche To: David Miller Cc: netdev@vger.kernel.org, Bart Van Assche , Tom Herbert Subject: [PATCH v2 3/5] net/core: Document __skb_flow_dissect() flags argument Date: Mon, 25 Mar 2019 09:17:21 -0700 Message-Id: <20190325161723.144556-4-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190325161723.144556-1-bvanassche@acm.org> References: <20190325161723.144556-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch avoids that the following warning is reported when building with W=1: warning: Function parameter or member 'flags' not described in '__skb_flow_dissect' Cc: Tom Herbert Fixes: cd79a2382aa5 ("flow_dissector: Add flags argument to skb_flow_dissector functions") # v4.3. Signed-off-by: Bart Van Assche --- net/core/flow_dissector.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index bb1a54747d64..b4d581134ef2 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -732,6 +732,8 @@ bool __skb_flow_bpf_dissect(struct bpf_prog *prog, * @proto: protocol for which to get the flow, if @data is NULL use skb->protocol * @nhoff: network header offset, if @data is NULL use skb_network_offset(skb) * @hlen: packet header length, if @data is NULL use skb_headlen(skb) + * @flags: flags that control the dissection process, e.g. + * FLOW_DISSECTOR_F_STOP_AT_L3. * * The function will try to retrieve individual keys into target specified * by flow_dissector from either the skbuff or a raw buffer specified by the From patchwork Mon Mar 25 16:17:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 1064505 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44SfYd3SvBz9sSH for ; Tue, 26 Mar 2019 03:17:41 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729631AbfCYQRi (ORCPT ); Mon, 25 Mar 2019 12:17:38 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34490 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729514AbfCYQRg (ORCPT ); Mon, 25 Mar 2019 12:17:36 -0400 Received: by mail-pf1-f194.google.com with SMTP id b3so5301466pfd.1 for ; Mon, 25 Mar 2019 09:17:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TZUqASSsl7ngFlM/I/1OiGc9OZ5XqYrBrWsBp6R7HPc=; b=NhHQuknnXO/FRwPkWuKoqFicSf5hMIAemlQdMJ0ypnBdpy06Td4ey2G+cLdiXeSA+G +EdbnRpTvydKqBRjn4HBSvzYIjomSRsOgoj/6kV4QlOr9to3XgNQI0wF+IEzmw3szIXS LxcszJ/RKdjHCz9cA4WsjMkVyFja64oGEjEXw3OylTuEiy+8zXt+nX873lqSQnbJ4695 PXuYypcmu5YWRGccLd11UqY+yNfx1dhKLHY5N44jfEX5iLSOrGvGcIB7ueHs/f3sfjTL ALmCt0lhRrMINLJ8AwxY/WbzON4kLoEDp/eDYqlDfEENRiD/qvuX2FryBmB8scyUNVi9 xHjA== X-Gm-Message-State: APjAAAXTbwMyDikTtVdWFgCosvkk4YlRF21FNoAHDxo7ytCCx4eCG7hV 1u6R7MX6Afy7mDHNbvAsycU= X-Google-Smtp-Source: APXvYqzqnu6rU/OS+VAMv8VZmUty5Em6PU4DG706yj4IveNCJ7x8TWv5Cq21yiE4nn7FyQ/4NDhNuA== X-Received: by 2002:a63:2208:: with SMTP id i8mr8903977pgi.223.1553530655550; Mon, 25 Mar 2019 09:17:35 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id 4sm8931854pgx.68.2019.03.25.09.17.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 09:17:34 -0700 (PDT) From: Bart Van Assche To: David Miller Cc: netdev@vger.kernel.org, Bart Van Assche , Hubert Sokolowski Subject: [PATCH v2 4/5] net/core: Fix rtnetlink kernel-doc headers Date: Mon, 25 Mar 2019 09:17:22 -0700 Message-Id: <20190325161723.144556-5-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190325161723.144556-1-bvanassche@acm.org> References: <20190325161723.144556-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch avoids that the following warnings are reported when building with W=1: net/core/rtnetlink.c:3580: warning: Function parameter or member 'ndm' not described in 'ndo_dflt_fdb_add' net/core/rtnetlink.c:3580: warning: Function parameter or member 'tb' not described in 'ndo_dflt_fdb_add' net/core/rtnetlink.c:3580: warning: Function parameter or member 'dev' not described in 'ndo_dflt_fdb_add' net/core/rtnetlink.c:3580: warning: Function parameter or member 'addr' not described in 'ndo_dflt_fdb_add' net/core/rtnetlink.c:3580: warning: Function parameter or member 'vid' not described in 'ndo_dflt_fdb_add' net/core/rtnetlink.c:3580: warning: Function parameter or member 'flags' not described in 'ndo_dflt_fdb_add' net/core/rtnetlink.c:3718: warning: Function parameter or member 'ndm' not described in 'ndo_dflt_fdb_del' net/core/rtnetlink.c:3718: warning: Function parameter or member 'tb' not described in 'ndo_dflt_fdb_del' net/core/rtnetlink.c:3718: warning: Function parameter or member 'dev' not described in 'ndo_dflt_fdb_del' net/core/rtnetlink.c:3718: warning: Function parameter or member 'addr' not described in 'ndo_dflt_fdb_del' net/core/rtnetlink.c:3718: warning: Function parameter or member 'vid' not described in 'ndo_dflt_fdb_del' net/core/rtnetlink.c:3861: warning: Function parameter or member 'skb' not described in 'ndo_dflt_fdb_dump' net/core/rtnetlink.c:3861: warning: Function parameter or member 'cb' not described in 'ndo_dflt_fdb_dump' net/core/rtnetlink.c:3861: warning: Function parameter or member 'filter_dev' not described in 'ndo_dflt_fdb_dump' net/core/rtnetlink.c:3861: warning: Function parameter or member 'idx' not described in 'ndo_dflt_fdb_dump' net/core/rtnetlink.c:3861: warning: Excess function parameter 'nlh' description in 'ndo_dflt_fdb_dump' Cc: Hubert Sokolowski Signed-off-by: Bart Van Assche --- net/core/rtnetlink.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a51cab95ba64..f9b964fd4e4d 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3569,7 +3569,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type, rtnl_set_sk_err(net, RTNLGRP_NEIGH, err); } -/** +/* * ndo_dflt_fdb_add - default netdevice operation to add an FDB entry */ int ndo_dflt_fdb_add(struct ndmsg *ndm, @@ -3708,7 +3708,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, return err; } -/** +/* * ndo_dflt_fdb_del - default netdevice operation to delete an FDB entry */ int ndo_dflt_fdb_del(struct ndmsg *ndm, @@ -3847,8 +3847,11 @@ static int nlmsg_populate_fdb(struct sk_buff *skb, /** * ndo_dflt_fdb_dump - default netdevice operation to dump an FDB table. - * @nlh: netlink message header + * @skb: socket buffer to store message in + * @cb: netlink callback * @dev: netdevice + * @filter_dev: ignored + * @idx: the number of FDB table entries dumped is added to *@idx * * Default netdevice operation to dump the existing unicast address list. * Returns number of addresses from list put in skb. From patchwork Mon Mar 25 16:17:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 1064504 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44SfYc2C5Gz9sRj for ; Tue, 26 Mar 2019 03:17:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729634AbfCYQRj (ORCPT ); Mon, 25 Mar 2019 12:17:39 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41356 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfCYQRh (ORCPT ); Mon, 25 Mar 2019 12:17:37 -0400 Received: by mail-pf1-f193.google.com with SMTP id 188so1228672pfd.8 for ; Mon, 25 Mar 2019 09:17:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hZZeCgCohgn+l7iBWIzV1fxz8KC+DP5Dq0IPvYX1kL4=; b=HuA3rhG0yj0zC4LB4RW9P+PPwPPEnFyCA3jAm17ep5a2EfRUnFfpWlI+CASmr4XjKw 28eelFnfDymA+qHKQFmabFFne5epUXaqf1flFe8EBR5M00QQH1H+wffoOrkIhUbUvmn0 Nc+lIGuGYdzavy4HZUSKlevfjAjX5xWJm+i8nd26KyrJ0ds9NulFHTtrjdZ4b+z+JZ0l GdGW+ZimCiC5v2n3pqm2SvdC/bPnwx+Z7I9He2xF+Rr+D7U6LFbutJiXf2CLzrhmNS00 /Be4KvXS4DDeHBQYqQuMSBEmvd/F4Y8LafHM7glPILmLTMSMpT0FKhF2RtS6RXFREmLn ypCw== X-Gm-Message-State: APjAAAWDMl1Q1LJHM2A/xeT2ZnNs8DCO1q3xIsKPKkpfcHISxX1dUGjU LcMsveOq6uoKpoqkOwPB0ow= X-Google-Smtp-Source: APXvYqyWdVpyw7CVBZNTIVY/H39jZbXYC6YRhW3CXaxF5aig99bag6UocsNofOoMYOeSCqbn49SoWQ== X-Received: by 2002:a63:bd42:: with SMTP id d2mr7417305pgp.319.1553530656742; Mon, 25 Mar 2019 09:17:36 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id 4sm8931854pgx.68.2019.03.25.09.17.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 09:17:35 -0700 (PDT) From: Bart Van Assche To: David Miller Cc: netdev@vger.kernel.org, Bart Van Assche , Willem de Bruijn Subject: [PATCH v2 5/5] net/core: Allow the compiler to verify declaration and definition consistency Date: Mon, 25 Mar 2019 09:17:23 -0700 Message-Id: <20190325161723.144556-6-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190325161723.144556-1-bvanassche@acm.org> References: <20190325161723.144556-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Instead of declaring a function in a .c file, declare it in a header file and include that header file from the source files that define and that use the function. That allows the compiler to verify consistency of declaration and definition. See also commit 52267790ef52 ("sock: add MSG_ZEROCOPY") # v4.14. Cc: Willem de Bruijn Signed-off-by: Bart Van Assche --- net/core/datagram.c | 2 ++ net/core/datagram.h | 15 +++++++++++++++ net/core/skbuff.c | 5 ++--- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 net/core/datagram.h diff --git a/net/core/datagram.c b/net/core/datagram.c index ed8accb17418..0dafec5cada0 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -61,6 +61,8 @@ #include #include +#include "datagram.h" + /* * Is a socket 'connection oriented' ? */ diff --git a/net/core/datagram.h b/net/core/datagram.h new file mode 100644 index 000000000000..bcfb75bfa3b2 --- /dev/null +++ b/net/core/datagram.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _NET_CORE_DATAGRAM_H_ +#define _NET_CORE_DATAGRAM_H_ + +#include + +struct sock; +struct sk_buff; +struct iov_iter; + +int __zerocopy_sg_from_iter(struct sock *sk, struct sk_buff *skb, + struct iov_iter *from, size_t length); + +#endif /* _NET_CORE_DATAGRAM_H_ */ diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 2415d9cb9b89..4782f9354dd1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -77,6 +77,8 @@ #include #include +#include "datagram.h" + struct kmem_cache *skbuff_head_cache __ro_after_init; static struct kmem_cache *skbuff_fclone_cache __ro_after_init; #ifdef CONFIG_SKB_EXTENSIONS @@ -1105,9 +1107,6 @@ void sock_zerocopy_put_abort(struct ubuf_info *uarg, bool have_uref) } EXPORT_SYMBOL_GPL(sock_zerocopy_put_abort); -extern int __zerocopy_sg_from_iter(struct sock *sk, struct sk_buff *skb, - struct iov_iter *from, size_t length); - int skb_zerocopy_iter_dgram(struct sk_buff *skb, struct msghdr *msg, int len) { return __zerocopy_sg_from_iter(skb->sk, skb, &msg->msg_iter, len);