From: Antoine Tenart <antoine.tenart@bootlin.com>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Antoine Tenart <antoine.tenart@bootlin.com>,
davem@davemloft.net, Stefan Chulski <stefanc@marvell.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
maxime.chevallier@bootlin.com, gregory.clement@bootlin.com,
miquel.raynal@bootlin.com, nadavh@marvell.com,
ymarkman@marvell.com, mw@semihalf.com
Subject: Re: [PATCH net-next 1/5] net: mvpp2: use the same buffer pool for all ports
Date: Mon, 5 Mar 2018 13:56:04 +0100 [thread overview]
Message-ID: <20180305125604.GJ1156@kwain> (raw)
In-Reply-To: <20180305134148.3bbba514@windsurf.home>
Hi Thomas,
On Mon, Mar 05, 2018 at 01:41:48PM +0100, Thomas Petazzoni wrote:
> On Mon, 5 Mar 2018 11:48:13 +0100, Antoine Tenart wrote:
>
> > > > +static void mvpp2_setup_bm_pool(void)
> > > > +{
> > > > + /* Short pool */
> > > > + mvpp2_pools[MVPP2_BM_SHORT].buf_num = MVPP2_BM_SHORT_BUF_NUM;
> > > > + mvpp2_pools[MVPP2_BM_SHORT].pkt_size = MVPP2_BM_SHORT_PKT_SIZE;
> > > > +
> > > > + /* Long pool */
> > > > + mvpp2_pools[MVPP2_BM_LONG].buf_num = MVPP2_BM_LONG_BUF_NUM;
> > > > + mvpp2_pools[MVPP2_BM_LONG].pkt_size = MVPP2_BM_LONG_PKT_SIZE;
> > > > +}
> > >
> > > ?
> >
> > I wanted to do this, but it's no possible as MVPP2_BM_SHORT_PKT_SIZE and
> > MVPP2_BM_LONG_PKT_SIZE use a core definition which expands at some point
> > to __max(...) which has to be called from within a function.
>
> Hum, weird:
>
> #define MVPP2_BM_LONG_PKT_SIZE MVPP2_RX_MAX_PKT_SIZE(MVPP2_BM_LONG_FRAME_SIZE)
> #define MVPP2_BM_LONG_FRAME_SIZE 2048
>
> #define MVPP2_RX_MAX_PKT_SIZE(total_size) \
> ((total_size) - NET_SKB_PAD - MVPP2_SKB_SHINFO_SIZE)
>
> #define MVPP2_SKB_SHINFO_SIZE \
> SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
>
> #define SKB_DATA_ALIGN(X) ALIGN(X, SMP_CACHE_BYTES)
>
> I don't really see a __max(...) call.
NET_SKB_PAD expends to __max(...).
> And if this value really expands depending on other values, then it
> isn't really a constant, and should be considered as a constant, no?
Well, the padding isn't truly a constant for some reasons, you can see
an explanation here:
https://elixir.bootlin.com/linux/latest/source/include/linux/skbuff.h#L2446
But this value can only change at compile time, so it really depends on
what is the definition of a constant is :)
Antoine
--
Antoine Ténart, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-03-05 12:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-02 15:40 [PATCH net-next 0/5] net: mvpp2: jumbo frames support Antoine Tenart
2018-03-02 15:40 ` [PATCH net-next 1/5] net: mvpp2: use the same buffer pool for all ports Antoine Tenart
2018-03-02 16:01 ` Thomas Petazzoni
2018-03-04 6:59 ` Stefan Chulski
2018-03-05 10:48 ` Antoine Tenart
2018-03-05 12:41 ` Thomas Petazzoni
2018-03-05 12:56 ` Antoine Tenart [this message]
2018-03-02 15:40 ` [PATCH net-next 2/5] net: mvpp2: update the BM buffer free/destroy logic Antoine Tenart
2018-03-02 15:40 ` [PATCH net-next 3/5] net: mvpp2: use a data size of 10kB for Tx FIFO on port 0 Antoine Tenart
2018-03-02 16:11 ` Thomas Petazzoni
2018-03-04 6:29 ` Stefan Chulski
2018-03-04 9:25 ` Thomas Petazzoni
2018-03-04 9:33 ` Stefan Chulski
2018-03-02 15:40 ` [PATCH net-next 4/5] net: mvpp2: enable UDP/TCP checksum over IPv6 Antoine Tenart
2018-03-02 15:40 ` [PATCH net-next 5/5] net: mvpp2: jumbo frames support Antoine Tenart
2018-03-02 16:17 ` Thomas Petazzoni
2018-03-04 6:56 ` Stefan Chulski
2018-03-04 9:28 ` Thomas Petazzoni
2018-03-04 9:42 ` Stefan Chulski
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=20180305125604.GJ1156@kwain \
--to=antoine.tenart@bootlin.com \
--cc=davem@davemloft.net \
--cc=gregory.clement@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=miquel.raynal@bootlin.com \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=stefanc@marvell.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=ymarkman@marvell.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