From: Stephen Hemminger <stephen@networkplumber.org>
To: gautamramk@gmail.com
Cc: netdev@vger.kernel.org,
"Mohit P. Tahiliani" <tahiliani@nitk.edu.in>,
"Jamal Hadi Salim" <jhs@mojatatu.com>,
"David S . Miller" <davem@davemloft.net>,
"Dave Taht" <dave.taht@gmail.com>,
"Toke Høiland-Jørgensen" <toke@redhat.com>,
"Leslie Monis" <lesliemonis@gmail.com>,
"Sachin D . Patil" <sdp.sachin@gmail.com>,
"V . Saicharan" <vsaicharan1998@gmail.com>,
"Mohit Bhasi" <mohitbhasi1998@gmail.com>
Subject: Re: [PATCH net-next v2 1/2] net: sched: pie: refactor code
Date: Tue, 31 Dec 2019 09:04:18 -0800 [thread overview]
Message-ID: <20191231090418.56adedc1@hermes.lan> (raw)
In-Reply-To: <20191231112316.2788-2-gautamramk@gmail.com>
On Tue, 31 Dec 2019 16:53:15 +0530
gautamramk@gmail.com wrote:
> From: "Mohit P. Tahiliani" <tahiliani@nitk.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@nitk.edu.in>
> Signed-off-by: Sachin D. Patil <sdp.sachin@gmail.com>
> Signed-off-by: V. Saicharan <vsaicharan1998@gmail.com>
> Signed-off-by: Mohit Bhasi <mohitbhasi1998@gmail.com>
> Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
> Signed-off-by: Gautam Ramakrishnan <gautamramk@gmail.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.
next prev parent reply other threads:[~2019-12-31 17:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-31 11:23 [PATCH net-next v2 0/2] net: sched: add Flow Queue PIE packet scheduler gautamramk
2019-12-31 11:23 ` [PATCH net-next v2 1/2] net: sched: pie: refactor code gautamramk
2019-12-31 17:04 ` Stephen Hemminger [this message]
2020-01-01 6:35 ` Leslie Monis
2019-12-31 11:23 ` [PATCH net-next v2 2/2] net: sched: add Flow Queue PIE packet scheduler gautamramk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191231090418.56adedc1@hermes.lan \
--to=stephen@networkplumber.org \
--cc=dave.taht@gmail.com \
--cc=davem@davemloft.net \
--cc=gautamramk@gmail.com \
--cc=jhs@mojatatu.com \
--cc=lesliemonis@gmail.com \
--cc=mohitbhasi1998@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=sdp.sachin@gmail.com \
--cc=tahiliani@nitk.edu.in \
--cc=toke@redhat.com \
--cc=vsaicharan1998@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).