From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Po Liu <po.liu@nxp.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"vinicius.gomes@intel.com" <vinicius.gomes@intel.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Alexandru Marginean <alexandru.marginean@nxp.com>,
Xiaoliang Yang <xiaoliang.yang_1@nxp.com>,
Roy Zang <roy.zang@nxp.com>, Mingkai Hu <mingkai.hu@nxp.com>,
Jerry Huang <jerry.huang@nxp.com>, Leo Li <leoyang.li@nxp.com>
Subject: Re: [net-next] enetc: add support Credit Based Shaper(CBS) for hardware offload
Date: Sun, 24 Nov 2019 15:34:58 -0800 [thread overview]
Message-ID: <20191124153458.14015cb2@cakuba.netronome.com> (raw)
In-Reply-To: <20191123190209.5ad772fc@cakuba.netronome.com>
On Sat, 23 Nov 2019 19:02:09 -0800, Jakub Kicinski wrote:
> On Fri, 22 Nov 2019 07:17:18 +0000, Po Liu wrote:
> > + if (tc == prio_top) {
> > + max_interference_size = port_frame_max_size * 8;
> > + } else {
> > + u32 m0, ma, r0, ra;
> > +
> > + m0 = port_frame_max_size * 8;
> > + ma = enetc_port_rd(&si->hw, ENETC_PTCMSDUR(prio_top)) * 8;
> > + ra = enetc_get_cbs_bw(&si->hw, prio_top) *
> > + port_transmit_rate * 10000ULL;
> > + r0 = port_transmit_rate * 1000000ULL;
> > + max_interference_size = m0 + ma + (u64)ra * m0 / (r0 - ra);
> > + }
> > +
> > + /* hiCredit bits calculate by:
> > + *
> > + * maxSizedFrame * (idleSlope/portTxRate)
> > + */
> > + hi_credit_bit = max_interference_size * bw / 100;
> > +
> > + /* hiCredit bits to hiCredit register need to calculated as:
> > + *
> > + * (enetClockFrequency / portTransmitRate) * 100
> > + */
> > + hi_credit_reg = (ENETC_CLK * 100ULL) * hi_credit_bit
> > + / (port_transmit_rate * 1000000ULL);
>
> Hi! The patch looks good to me, but I'm concerned about those 64bit
> divisions here. Don't these need to be div_u64() & co.? Otherwise
> we may see one of the:
>
> ERROR: "__udivdi3" [drivers/net/ethernet/freescale/enetc/fsl-enetc.ko] undefined!
>
> messages from the build bot..
>
> I could be wrong, I haven't actually tested..
Yup:
drivers/net/ethernet/freescale/enetc/enetc_qos.o: In function `enetc_setup_tc_cbs':
enetc_qos.c:(.text+0x5b4): undefined reference to `__udivdi3'
enetc_qos.c:(.text+0x608): undefined reference to `__udivdi3'
/home/jkicinski/devel/linux/Makefile:1077: recipe for target 'vmlinux' failed
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory '/home/jkicinski/devel/linux/build_tmp2'
Makefile:179: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
Please fix and repost.
next prev parent reply other threads:[~2019-11-24 23:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 7:17 Po Liu
2019-11-24 3:02 ` Jakub Kicinski
2019-11-24 23:34 ` Jakub Kicinski [this message]
2019-11-25 3:03 ` [EXT] " Po Liu
2019-11-25 5:56 ` [v2,net-next] " Po Liu
2019-11-25 18:53 ` David Miller
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=20191124153458.14015cb2@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=alexandru.marginean@nxp.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=jerry.huang@nxp.com \
--cc=leoyang.li@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingkai.hu@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=po.liu@nxp.com \
--cc=roy.zang@nxp.com \
--cc=vinicius.gomes@intel.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiaoliang.yang_1@nxp.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
Powered by JetHome