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]
Message-ID: <VE1PR04MB6496B0088B6D6558CD714A76924A0@VE1PR04MB6496.eurprd04.prod.outlook.com>
Date:   Mon, 25 Nov 2019 03:03:39 +0000
From:   Po Liu <po.liu@....com>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
CC:     "davem@...emloft.net" <davem@...emloft.net>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "vinicius.gomes@...el.com" <vinicius.gomes@...el.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        Vladimir Oltean <vladimir.oltean@....com>,
        Alexandru Marginean <alexandru.marginean@....com>,
        Xiaoliang Yang <xiaoliang.yang_1@....com>,
        Roy Zang <roy.zang@....com>, Mingkai Hu <mingkai.hu@....com>,
        Jerry Huang <jerry.huang@....com>, Leo Li <leoyang.li@....com>
Subject: RE: [EXT] Re: [net-next] enetc: add support Credit Based Shaper(CBS)
 for hardware offload

Hi Jakub,

Thanks!


Br,
Po Liu

> -----Original Message-----
> From: Jakub Kicinski <jakub.kicinski@...ronome.com>
> Sent: 2019年11月25日 7:35
> To: Po Liu <po.liu@....com>
> Cc: davem@...emloft.net; linux-kernel@...r.kernel.org;
> netdev@...r.kernel.org; vinicius.gomes@...el.com; Claudiu Manoil
> <claudiu.manoil@....com>; Vladimir Oltean <vladimir.oltean@....com>;
> Alexandru Marginean <alexandru.marginean@....com>; Xiaoliang Yang
> <xiaoliang.yang_1@....com>; Roy Zang <roy.zang@....com>; Mingkai Hu
> <mingkai.hu@....com>; Jerry Huang <jerry.huang@....com>; Leo Li
> <leoyang.li@....com>
> Subject: [EXT] Re: [net-next] enetc: add support Credit Based Shaper(CBS) for
> hardware offload
> 
> Caution: EXT Email
> 
> 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.

Will update to div_u64().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ