Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp100499ybl; Thu, 30 Jan 2020 17:52:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyiq7Hdq/+s/wsI921eCwcvpzczycWoLrwGFSIucEca4zV+1LePlAavVy4akZd+gR9+Dr0Q X-Received: by 2002:a9d:5e9:: with SMTP id 96mr504174otd.307.1580435555553; Thu, 30 Jan 2020 17:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580435555; cv=none; d=google.com; s=arc-20160816; b=abMseMHq02gswhSoyXEtVvzIIcQHuC7GcCBUgskj8HY8Z+rGE3i6J3gBt7sAlcK7KA NC+7S6SaQbeDZ7XEWtUaLVoYZHEk6P+eZ6sXNO1OSS9rM9cnVYJoPWYNKL5IOQvZzcC0 KDliQAYvNfh4cb4gTIwF9JmKk6L8VXbkt0iynee+LoHP7RHDmV7CLRfBjk8lvwJM/Xiu qLlE5JsuRnE3dnpdijRoHV2aye6D+kh87T1PGovyBJktFwMGzg9g+RAcUcfAuGbacncV FyBbkuBzdfYInD5DTMGMwAztFwpMgJtq8zI+A3vNimIn/QBdd9Wf5qGiPEB6WPddWPFs bTZQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fl3y9i/hsTxIwnZSASPstfQUlkaJEnvewj9PCAZ8wpg=; b=pI7esmBNMnNbT3G3bdfcUpf9nLzKkKo1/p8+SgyQAeDk5R3jxIgGuSgge1p3oh0RgR a7MUc+FzIXFheHwSVoQkyRZkzP1sXYO6b4ZX+6/vUXAHabSFRGLQfv9AGIXVnWpAdFkF EHhuBBCuGB99Bkwro0ETi9uV2dM0PR26WZoDyWDRyddI1dxerNkU0mF0tMrH5JzuG50w hRjdag+hoJ9ykXgLLHzrQFEQ3ZN6Y41qfstZ5vxSTJpzEIrajheJvHgKHiZub2Zr8EwY 8d31U1oKUD3zvDgawM0u367uqrBxkvCpFCtqxMkA9Q/9n21n/Z19iw7P43sE23352vQO CVRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AVjQIxK+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w131si3398743oie.47.2020.01.30.17.52.22; Thu, 30 Jan 2020 17:52:35 -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=pass header.i=@gmail.com header.s=20161025 header.b=AVjQIxK+; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727793AbgAaBv1 (ORCPT + 99 others); Thu, 30 Jan 2020 20:51:27 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:39665 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727656AbgAaBv0 (ORCPT ); Thu, 30 Jan 2020 20:51:26 -0500 Received: by mail-oi1-f193.google.com with SMTP id z2so5746173oih.6; Thu, 30 Jan 2020 17:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fl3y9i/hsTxIwnZSASPstfQUlkaJEnvewj9PCAZ8wpg=; b=AVjQIxK+cWHt1fRrYYSTlgDBe0w+hAAuz5j7Po22kbEioXSkYQ9WTbufUNmIDHoir3 KQ5upmyQPcfxi+FZSAnNWRQBvknNdVDosAxuTJAXmABYXLPJ7LTydw7i/lJM98XdPzhs SgJlBd2sAiig+eSd6H+q0tVW/1axJckHjiVEOTHVqfeSXdM8J2oLNK5C/9wTRF/+xRTP 1bTUsRl+nsJnPW1vSsIpAB/OyrX71fXUWP+uWZTEl0tpwfwg3uttcwrdCBw9uHzGtNay p8GgqEalyPrhNMfkPwqtTJQaAbimuehrdKbOF+e7ZPsE5poDyPg50Lw5ePiPUDrmsZZE +Lqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fl3y9i/hsTxIwnZSASPstfQUlkaJEnvewj9PCAZ8wpg=; b=gVUmaopafuY7m3zR8v2eVl4cO32DOMofKgOOv+FVxoxAvUWtPD+SlqAJy1eBlTKeLc pCGcz2Ca1E0jDUbj/6OwHLWoT0qV95v+nE3c01R3FsEocqAfx3w6SFNdmfoAVDAcrzp9 l5T27VbPPcB5XadVkniV2cJNfa0CCFKpJZkqpXF5pEjtJQNPZ0ibB0iWMLSIHpdRUTtx DvxIuNxn6sLckbJM/mPmcFeaK84+UUlM+1PGtTU5w0L3jaxA2hTrTfir9ArLznspSIdb ioJPjBhrv1U3FnqRpHRjaSWKBAyJ8EabwPm4oVARcjDvthCGaXKn1HFw9Af9onbxzR1R kUtA== X-Gm-Message-State: APjAAAVhQWlBNsdRrE96JgxsLno0ajlzrxrA/6+DqZqbx0nI9XRG2jzD w3XhTI6c0Zb6iXcIIyeFWmo= X-Received: by 2002:aca:fd4c:: with SMTP id b73mr5083041oii.33.1580435485997; Thu, 30 Jan 2020 17:51:25 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id p83sm2240185oia.51.2020.01.30.17.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 17:51:25 -0800 (PST) From: Nathan Chancellor To: Jiri Pirko , Ido Schimmel , "David S. Miller" Cc: Petr Machata , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Randy Dunlap , Nathan Chancellor Subject: [PATCH v2] mlxsw: spectrum_qdisc: Fix 64-bit division error in mlxsw_sp_qdisc_tbf_rate_kbps Date: Thu, 30 Jan 2020 18:51:23 -0700 Message-Id: <20200131015123.55400-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130232641.51095-1-natechancellor@gmail.com> References: <20200130232641.51095-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v1 -> v2: * Fix incorrect math as pointed out by Randy Dunlap 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..02526c53d4f5 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; } static int -- 2.25.0