Netdev List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: netdev@vger.kernel.org
Cc: Sujith Sankar <ssujith@cisco.com>,
	Neel Patel <neepatel@cisco.com>,
	Govindarajulu Varadarajan <_govind@gmx.com>,
	"David S. Miller" <davem@davemloft.net>,
	Christian Benvenuti <benve@cisco.com>
Subject: [PATCH] enic: fix adaptive irq coalescing on 32-bit
Date: Fri, 23 May 2014 09:51:11 +0200	[thread overview]
Message-ID: <10713072.kCczZxGWdQ@wuerfel> (raw)

7c2ce6e60f703 "enic: Add support for adaptive interrupt coalescing"
introduced a 64-bit division that causes a link error on all 32-bit
machines:

drivers/built-in.o: In function `enic_poll_msix':
:(.text+0x54ff00): undefined reference to `__aeabi_uldivmod'

Since we are dividing another 32-bit value and are only interested
in the approximate range here, it should always be safe to limit
the delta to an u32 value.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
I haven't seen another report of this bug, just ignore this
mail if it was already fixed.

Also, there may be better ways to solve this.

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 0d8995c..ad2fac2 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1217,7 +1217,7 @@ static void enic_calc_int_moderation(struct enic *enic, struct vnic_rq *rq)
 	 */
 
 	traffic <<= 3;
-	traffic /= delta;
+	traffic /= min_t(u32, delta, UINT_MAX);
 
 	for (index = 0; index < ENIC_MAX_COALESCE_TIMERS; index++)
 		if (traffic < mod_table[index].rx_rate)

             reply	other threads:[~2014-05-23  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  7:51 Arnd Bergmann [this message]
2014-05-23  8:29 ` [PATCH] enic: fix adaptive irq coalescing on 32-bit David Laight
2014-05-23  9:29   ` Arnd Bergmann

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=10713072.kCczZxGWdQ@wuerfel \
    --to=arnd@arndb.de \
    --cc=_govind@gmx.com \
    --cc=benve@cisco.com \
    --cc=davem@davemloft.net \
    --cc=neepatel@cisco.com \
    --cc=netdev@vger.kernel.org \
    --cc=ssujith@cisco.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