From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42EC2C43381 for ; Tue, 26 Mar 2019 23:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 121F82075E for ; Tue, 26 Mar 2019 23:50:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731824AbfCZXun (ORCPT ); Tue, 26 Mar 2019 19:50:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34250 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbfCZXun (ORCPT ); Tue, 26 Mar 2019 19:50:43 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E703620268; Tue, 26 Mar 2019 23:50:42 +0000 (UTC) Received: from bistromath.localdomain (unknown [10.40.205.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 847FB5C28D; Tue, 26 Mar 2019 23:50:41 +0000 (UTC) Date: Wed, 27 Mar 2019 00:50:39 +0100 From: Sabrina Dubroca To: Bart Van Assche Cc: David Miller , netdev@vger.kernel.org, Willem de Bruijn Subject: Re: [PATCH v2 5/5] net/core: Allow the compiler to verify declaration and definition consistency Message-ID: <20190326235039.GA16554@bistromath.localdomain> References: <20190325161723.144556-1-bvanassche@acm.org> <20190325161723.144556-6-bvanassche@acm.org> <20190325182642.GA14636@bistromath.localdomain> <1553620294.118779.64.camel@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1553620294.118779.64.camel@acm.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 26 Mar 2019 23:50:43 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 2019-03-26, 10:11:34 -0700, Bart Van Assche wrote: > On Mon, 2019-03-25 at 19:26 +0100, Sabrina Dubroca wrote: > > 2019-03-25, 09:17:23 -0700, Bart Van Assche wrote: > > > 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_ */ > > > > That's rather ugly. Could it just be moved to an appropriate file in > > include/? > > Hi Sabrina, > > I think the convention in the Linux kernel is to keep header files with local > declarations in the source code directory and only to declare functions that > are used by other kernel components under include/. I didn't realize it was a common practice. > Do you think that the function __zerocopy_sg_from_iter() will be > needed by other kernel components? No idea. It has a couple of wrappers, so maybe not. The patch looks ok, sorry for the noise. -- Sabrina