cxgb4: fix 64-bit division on i386
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fri, 8 Nov 2019 14:35:22 +0000 (20:05 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Nov 2019 19:40:57 +0000 (11:40 -0800)
Fix following compile error on i386 architecture.

ERROR: "__udivdi3" [drivers/net/ethernet/chelsio/cxgb4/cxgb4.ko] undefined!

Fixes: 0e395b3cb1fb ("cxgb4: add FLOWC based QoS offload")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c

index fb28bce..143cb1f 100644 (file)
@@ -307,8 +307,8 @@ static int cxgb4_mqprio_alloc_tc(struct net_device *dev,
        p.u.params.channel = pi->tx_chan;
        for (i = 0; i < mqprio->qopt.num_tc; i++) {
                /* Convert from bytes per second to Kbps */
-               p.u.params.minrate = mqprio->min_rate[i] * 8 / 1000;
-               p.u.params.maxrate = mqprio->max_rate[i] * 8 / 1000;
+               p.u.params.minrate = div_u64(mqprio->min_rate[i] * 8, 1000);
+               p.u.params.maxrate = div_u64(mqprio->max_rate[i] * 8, 1000);
 
                e = cxgb4_sched_class_alloc(dev, &p);
                if (!e) {