public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: jacob.e.keller@intel.com
Cc: Jakub Kicinski <kuba@kernel.org>,
	przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	aleksander.lobakin@intel.com, horms@kernel.org,
	michal.swiatkowski@linux.intel.com, jedrzej.jagielski@intel.com,
	aleksandr.loktionov@intel.com, grzegorz.nitka@intel.com,
	ivecera@redhat.com, arkadiusz.kubalewski@intel.com,
	anthony.l.nguyen@intel.com, stefan.wegrzyn@intel.com,
	piotr.kwapulinski@intel.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, pmenzel@molgen.mpg.de,
	sunithax.d.mekala@intel.com
Subject: Re: [PATCH net-next 07/15] ixgbe: E610: add ACI dynamic debug
Date: Sat,  2 May 2026 19:06:36 -0700	[thread overview]
Message-ID: <20260503020636.4114758-1-kuba@kernel.org> (raw)
In-Reply-To: <20260430-jk-iwl-net-next-2026-04-30-v1-7-6f27ae1cd073@intel.com>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
ixgbe: E610: add ACI dynamic debug

This commit enables dynamic debugging of the Admin Command Interface (ACI)
for the e610 adapter, allowing ACI commands and descriptor details to be
printed into the kernel log.

> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c

[ ... ]

> @@ -106,8 +185,12 @@ static int ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw,
>  		if (desc->flags & cpu_to_le16(LIBIE_AQ_FLAG_RD)) {
>  			for (i = 0; i < buf_size / 4; i++)
>  				IXGBE_WRITE_REG(hw, IXGBE_PF_HIBA(i), ((u32 *)buf)[i]);
> -			if (buf_tail_size)
> +			ixgbe_aci_debug(hw, desc, buf, buf_size);
> +			if (buf_tail_size) {
>  				IXGBE_WRITE_REG(hw, IXGBE_PF_HIBA(i), buf_tail);
> +				ixgbe_aci_debug(hw, desc, &buf_tail,
> +						buf_tail_size);
> +			}
>  		}
>  	}

Does this result in redundant output being printed to the kernel log?

When buf_tail_size is non-zero, ixgbe_aci_debug() is called twice: once for
the full buffer, and a second time for just the tail. Since ixgbe_aci_debug()
prints the full CQ CMD descriptor details each time, this appears to print the
descriptor headers twice and fragment the buffer output.

[ ... ]

> @@ -183,10 +278,13 @@ static int ixgbe_aci_send_cmd_execute(struct ixgbe_hw *hw,
>  	if (valid_buf) {
>  		for (i = 0; i < buf_size / 4; i++)
>  			((u32 *)buf)[i] = IXGBE_READ_REG(hw, IXGBE_PF_HIBA(i));
> +		ixgbe_aci_debug(hw, raw_desc, buf, buf_size);
>  		if (buf_tail_size) {
>  			buf_tail = IXGBE_READ_REG(hw, IXGBE_PF_HIBA(i));
>  			memcpy(buf + buf_size - buf_tail_size, &buf_tail,
>  			       buf_tail_size);
> +			ixgbe_aci_debug(hw, raw_desc, &buf_tail,
> +					buf_tail_size);
>  		}
>  	}

Can this read uninitialized memory from the buffer?

At the point ixgbe_aci_debug(..., buf, buf_size) is called, the loop has only
populated the 4-byte aligned chunks of the buffer. The trailing bytes at the
end of the buffer are not populated until the memcpy() occurs later in the
block. Because ixgbe_aci_debug() consumes buf_size bytes, it looks like it
will read and log uninitialized trailing memory (potentially from the kernel
stack).

Also, similar to the transmit path, this calls ixgbe_aci_debug() a second
time on &buf_tail, which will print the descriptor headers again.

Could we move a single ixgbe_aci_debug(..., buf, buf_size) call to the end of
the block, after the entire buffer including the tail has been fully written?

  reply	other threads:[~2026-05-03  2:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01  6:37 [PATCH net-next 00/15] Intel Wired LAN Updates 2024-04-30 (ixgbe, i40e, ice) Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 01/15] ixgbe: E610: add discovering EEE capability Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 02/15] ixgbe: E610: update EEE supported speeds Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 03/15] ixgbe: E610: use new version of 0x601 ACI command buffer Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 04/15] ixgbe: E610: update ACI command structs with EEE fields Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 05/15] ixgbe: move EEE config validation out of ixgbe_set_eee() Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 06/15] ixgbe: E610: add EEE support Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 07/15] ixgbe: E610: add ACI dynamic debug Jacob Keller
2026-05-03  2:06   ` Jakub Kicinski [this message]
2026-05-04 22:33     ` Jacob Keller
2026-05-05  6:11       ` Kwapulinski, Piotr
2026-05-01  6:37 ` [PATCH net-next 08/15] ixgbe: E610: remove redundant assignment Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 09/15] ixgbe: fix unaligned u32 access in ixgbe_update_flash_X550() Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 10/15] i40e: only timestamp PTP event packets Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 11/15] ice: mention fw_activate action along with devlink reload Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 12/15] ice: access @pp through netmem_desc instead of page Jacob Keller
2026-05-04  9:48   ` Loktionov, Aleksandr
2026-05-01  6:37 ` [PATCH net-next 13/15] ice: dpll: Fix compilation warning Jacob Keller
2026-05-01  6:37 ` [PATCH net-next 14/15] ice: dpll: fix rclk pin state get and misplaced header macros Jacob Keller
2026-05-03  2:09   ` Jakub Kicinski
2026-05-04 18:38     ` Keller, Jacob E
2026-05-05  8:33       ` Ivan Vecera
2026-05-04 22:39   ` Jacob Keller
2026-05-05  8:35     ` Ivan Vecera
2026-05-01  6:37 ` [PATCH net-next 15/15] ice: add support for unmanaged DPLL on E830 NIC Jacob Keller
2026-05-03  2:09   ` Jakub Kicinski
2026-05-03  2:20 ` [PATCH net-next 00/15] Intel Wired LAN Updates 2024-04-30 (ixgbe, i40e, ice) patchwork-bot+netdevbpf

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=20260503020636.4114758-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=grzegorz.nitka@intel.com \
    --cc=horms@kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jedrzej.jagielski@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=piotr.kwapulinski@intel.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=stefan.wegrzyn@intel.com \
    --cc=sunithax.d.mekala@intel.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