lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 31 Dec 2019 09:04:18 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     gautamramk@...il.com
Cc:     netdev@...r.kernel.org,
        "Mohit P. Tahiliani" <tahiliani@...k.edu.in>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        "David S . Miller" <davem@...emloft.net>,
        Dave Taht <dave.taht@...il.com>,
        Toke Høiland-Jørgensen <toke@...hat.com>,
        Leslie Monis <lesliemonis@...il.com>,
        "Sachin D . Patil" <sdp.sachin@...il.com>,
        "V . Saicharan" <vsaicharan1998@...il.com>,
        Mohit Bhasi <mohitbhasi1998@...il.com>
Subject: Re: [PATCH net-next v2 1/2] net: sched: pie: refactor code

On Tue, 31 Dec 2019 16:53:15 +0530
gautamramk@...il.com wrote:

> From: "Mohit P. Tahiliani" <tahiliani@...k.edu.in>
> 
> This patch is a precursor for the addition of the Flow Queue Proportional
> Integral Controller Enhanced (FQ-PIE) qdisc. The patch removes functions
> and structures common to both PIE and FQ-PIE and moves it to the
> header file pie.h
> 
> Signed-off-by: Mohit P. Tahiliani <tahiliani@...k.edu.in>
> Signed-off-by: Sachin D. Patil <sdp.sachin@...il.com>
> Signed-off-by: V. Saicharan <vsaicharan1998@...il.com>
> Signed-off-by: Mohit Bhasi <mohitbhasi1998@...il.com>
> Signed-off-by: Leslie Monis <lesliemonis@...il.com>
> Signed-off-by: Gautam Ramakrishnan <gautamramk@...il.com>
> ---
>  include/net/pie.h   | 400 ++++++++++++++++++++++++++++++++++++++++++++
>  net/sched/sch_pie.c | 386 ++----------------------------------------
>  2 files changed, 415 insertions(+), 371 deletions(-)
>  create mode 100644 include/net/pie.h
> 
> diff --git a/include/net/pie.h b/include/net/pie.h


Adding lots of static functions in a header file is not the way
to get code reuse in Linux kernel. It looks like you just did
large copy/paste from existing sch_pie.c to new header file.

You can use reuse data structures and small 'static inline' functions in a header file.
But putting code like drop_early in a header file is not best
practice.

You need to create a real kernel API for this kind of thing
by making a helper module which is reused by multiple places.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ