Date: Mon, 30 Jul 2012 04:07:18 GMT From: Rich Lowe <richlowe@richlowe.net> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/170267: IXGBE_LE32_TO_CPUS is probably an unintentional no-op Message-ID: <201207300407.q6U47ICo028314@red.freebsd.org> Resent-Message-ID: <201207300410.q6U4AAe5029382@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 170267
>Category: kern
>Synopsis: IXGBE_LE32_TO_CPUS is probably an unintentional no-op
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Jul 30 04:10:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Rich Lowe
>Release: CURRENT
>Organization:
>Environment:
>Description:
Fixing a bug in another system, using an ixgbe driver derived from yours, I've happened upon the fact that IXGBE_LE32_TO_CPUS appears to be a no-op.
On FreeBSD, it's defined to be le32dec(), which is a pure function, however the uses in ixgbe_common.c are as if it were side-effecting its argument:
3964 /* Pull in the rest of the buffer (bi is where we left off)*/
3965 for (; bi <= dword_len; bi++) {
3966 buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
3967 IXGBE_LE32_TO_CPUS(&buffer[bi]);
3968 }
>How-To-Repeat:
Read through ixgbe_common.c and ixgbe_osdep.h. I'm unsure if this causes practical problems (I don't have a big-endian system with this board).
>Fix:
Guessing suggests that:
buffer[bi] = IXGBE_LE32_TO_CPUS(buffer[bi]);
(there are two instances).
Is what was intended.
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207300407.q6U47ICo028314>
