Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp96008ybl; Thu, 30 Jan 2020 17:46:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwqUH65YrrxEAwMgN6P6Wb/hiU2YOFxGJkcnu8abid9DQmvoS0V/OdZaysATpmrbn4k0bQe X-Received: by 2002:aca:514e:: with SMTP id f75mr5087973oib.103.1580435171453; Thu, 30 Jan 2020 17:46:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580435171; cv=none; d=google.com; s=arc-20160816; b=AxTTGV/DjnjzM0/83MQVk3sZRN4bbl9mZ/mJ3ooWBWiCM3JnVM3j504t88gaAAscru ZCBF54P4d05SUJMYuejaZ4ksRS+2vcB1MWIOmSIeMGULMjPAIqTTzRwp1qNelOjMxCqR dkXBIUfL31mnZ17Y5qfmzYfOcs1RqtCJ0vI6KWvjwjeKVoTtKKs9LbACmpgxKxT32vaX kGdViJzuFq8mG1ADOUBO3N7ir27fnH8yzuwNEGLHD6BT12dgbV7g4QB1oZ/sO++XZG1Z RW79pTwajo1xn1OmTDVgN8rXoSlFjdrvx7mRUtu6l85/q97BL/s57At6Nr90beafScTx VSgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=LtAoMN0VBwXoKpVeeYOrYi+7EuC0KOMgH0ErjjmGKiw=; b=epMN+qtIDQc35YfafJQBmDynPTflPm379/imgmtHPI+sZNnz8ioCaqiJ5hqEClsROE cChGKS5+V/r4WuZm67zBNSp0HYDh7nw+lHLZKnvAD4PxiDWUBa1EZBwvKyCPSmuVB5sg nOthCQRjwjbtoOjm1+F7DNOHrnbzIBS7eKu5h4EyoaGL1KUx5rqoPmNR2dEV77/w0aTY /+EdeVN2/qKdC5WnRP5zZhk83j+4O24po95d2GQavG4h366pauJvMVs1eCNoCx/rOD9J Btx5O1L1xfp9E0XRAY0IdZc7Ip5eT6V5or9m/bI+Vb4BFTCr63ZBa4mOqNZTqFUmXqfh 2LPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Dpv57oX/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u130si3577957oif.94.2020.01.30.17.45.44; Thu, 30 Jan 2020 17:46:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="Dpv57oX/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbgAaBoA (ORCPT + 99 others); Thu, 30 Jan 2020 20:44:00 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:49302 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727656AbgAaBoA (ORCPT ); Thu, 30 Jan 2020 20:44:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LtAoMN0VBwXoKpVeeYOrYi+7EuC0KOMgH0ErjjmGKiw=; b=Dpv57oX/23OdSKI3pU0tqnCCt Gdlsv70lnTp+a6bzlSTKz1QzWQru5zyIWU3ILPWU2YE/9YLj8TkBlNaMxaNtgibFY1s76DZixCRUw 9CMMaC4tjcr5Q8RoB0P0BKq8md5xUN4cghjTfVduyuLQMF5TnjHud3aH1+a1pgpMfq20D8q9Yz7Zd qlir6hpZxQLNILbmJZuKUtJeqsaZS9j744Yvdp+CETNF5upYGcNHRIv4d0DXFw37OHkae8l9Bppxv xUnFk1FSpDW8pByOGeq7ykqa+gSW0w4xOl3u+1+PSgRRIZfOWoogMzAIwWvQD3rjRiM2sOF5y0L+K eSknBhGDw==; Received: from [2601:1c0:6280:3f0:897c:6038:c71d:ecac] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixLLh-0008DI-Ou; Fri, 31 Jan 2020 01:43:57 +0000 Subject: Re: [PATCH] mlxsw: spectrum_qdisc: Fix 64-bit division error in mlxsw_sp_qdisc_tbf_rate_kbps To: Nathan Chancellor , Jiri Pirko , Ido Schimmel , "David S. Miller" Cc: Petr Machata , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200130232641.51095-1-natechancellor@gmail.com> From: Randy Dunlap Message-ID: <31537c12-8f17-660d-256d-e702d1121367@infradead.org> Date: Thu, 30 Jan 2020 17:43:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200130232641.51095-1-natechancellor@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/30/20 3:26 PM, Nathan Chancellor wrote: > When building arm32 allmodconfig: > > ERROR: "__aeabi_uldivmod" > [drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko] undefined! > > rate_bytes_ps has type u64, we need to use a 64-bit division helper to > avoid a build error. > > Fixes: a44f58c41bfb ("mlxsw: spectrum_qdisc: Support offloading of TBF Qdisc") > Signed-off-by: Nathan Chancellor > --- > drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c > index 79a2801d59f6..65e681ef01e8 100644 > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c > @@ -614,7 +614,7 @@ mlxsw_sp_qdisc_tbf_rate_kbps(struct tc_tbf_qopt_offload_replace_params *p) > /* TBF interface is in bytes/s, whereas Spectrum ASIC is configured in > * Kbits/s. > */ > - return p->rate.rate_bytes_ps / 1000 * 8; > + return div_u64(p->rate.rate_bytes_ps, 1000 * 8); not quite right AFAICT. try either return div_u64(p->rate.rate_bytes_ps * 8, 1000); or return div_u64(p->rate.rate_bytes_ps, 1000) * 8; > } > > static int > -- ~Randy