drivers/net/ethernet/intel/libie/controlq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Virtchnl failures can be hard to debug without logs. Logging the details
of virtchnl transactions can be useful for debugging virtchnl-related
issues.
Tested: Built & booted on a test machine and synthetically produced a
virtual failure to produce the following log:
idpf 0000:01:00.0: Non-zero virtchnl ret val (msg op: 1, ret val: 6,
data_len: 8); xn id: 0, cookie: 0
idpf 0000:01:00.0: Transaction failed (op 1, xn state:
3, id: 0, cookie: 0, size: 8)
Signed-off-by: Li Li <boolli@google.com>
---
v3:
- Use dev_err_ratelimited in both logs.
- Move log placement to after virtchnl field validation.
- Remove redundant op/cookie fields since they were validated.
v2:
- Use dev_warn_ratelimited instead of dev_notice_ratelimited based on
reviewer feedback.
drivers/net/ethernet/intel/libie/controlq.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/intel/libie/controlq.c b/drivers/net/ethernet/intel/libie/controlq.c
index ebc05355e39d..ceca8a076d79 100644
--- a/drivers/net/ethernet/intel/libie/controlq.c
+++ b/drivers/net/ethernet/intel/libie/controlq.c
@@ -766,6 +766,14 @@ libie_ctlq_xn_process_recv(struct libie_ctlq_xn_recv_params *params,
msg_cookie != xn->cookie)
return false;
+ if (ctlq_msg->chnl_retval) {
+ dev_err_ratelimited(
+ params->ctlq->dev,
+ "Non-zero virtchnl ret val (msg op: %u, ret val: %u, data_len: %u); xn id: %u, cookie: %u\n",
+ ctlq_msg->chnl_opcode, ctlq_msg->chnl_retval,
+ ctlq_msg->data_len, xn->index, xn->cookie);
+ }
+
spin_lock(&xn->xn_lock);
if (xn->state != LIBIE_CTLQ_XN_ASYNC &&
xn->state != LIBIE_CTLQ_XN_WAITING) {
@@ -1011,6 +1019,11 @@ int libie_ctlq_xn_send(struct libie_ctlq_xn_send_params *params)
params->recv_mem = xn->recv_mem;
break;
default:
+ dev_err_ratelimited(
+ params->ctlq->dev,
+ "Transaction failed (op %u, xn state: %d, id: %u, cookie: %u, size: %zu)\n",
+ params->chnl_opcode, xn->state, xn->index, xn->cookie,
+ xn->recv_mem.iov_len);
ret = -EBADMSG;
break;
}
--
2.54.0.545.g6539524ca2-goog
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Li Li via Intel-wired-lan
> Sent: Wednesday, April 29, 2026 10:41 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@intel.com>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Eric Dumazet
> <edumazet@google.com>; intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; David
> Decotigny <decot@google.com>; Singhai, Anjali
> <anjali.singhai@intel.com>; Samudrala, Sridhar
> <sridhar.samudrala@intel.com>; Brian Vazquez <brianvv@google.com>; Li
> Li <boolli@google.com>; Tantilov, Emil S <emil.s.tantilov@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v3] libie: log more info
> when virtchnl fails
>
> Virtchnl failures can be hard to debug without logs. Logging the
> details of virtchnl transactions can be useful for debugging virtchnl-
> related issues.
>
> Tested: Built & booted on a test machine and synthetically produced a
> virtual failure to produce the following log:
>
> idpf 0000:01:00.0: Non-zero virtchnl ret val (msg op: 1, ret val: 6,
> data_len: 8); xn id: 0, cookie: 0
> idpf 0000:01:00.0: Transaction failed (op 1, xn state:
> 3, id: 0, cookie: 0, size: 8)
>
> Signed-off-by: Li Li <boolli@google.com>
> ---
> v3:
> - Use dev_err_ratelimited in both logs.
> - Move log placement to after virtchnl field validation.
> - Remove redundant op/cookie fields since they were validated.
> v2:
> - Use dev_warn_ratelimited instead of dev_notice_ratelimited based on
> reviewer feedback.
>
> drivers/net/ethernet/intel/libie/controlq.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/libie/controlq.c
> b/drivers/net/ethernet/intel/libie/controlq.c
> index ebc05355e39d..ceca8a076d79 100644
> --- a/drivers/net/ethernet/intel/libie/controlq.c
> +++ b/drivers/net/ethernet/intel/libie/controlq.c
> @@ -766,6 +766,14 @@ libie_ctlq_xn_process_recv(struct
> libie_ctlq_xn_recv_params *params,
> msg_cookie != xn->cookie)
> return false;
>
> + if (ctlq_msg->chnl_retval) {
> + dev_err_ratelimited(
> + params->ctlq->dev,
> + "Non-zero virtchnl ret val (msg op: %u, ret val:
> %u, data_len: %u); xn id: %u, cookie: %u\n",
> + ctlq_msg->chnl_opcode, ctlq_msg->chnl_retval,
> + ctlq_msg->data_len, xn->index, xn->cookie);
'virtchnl ret val' 'ret val:' looks like a duplication in dmesg.
> + }
> +
> spin_lock(&xn->xn_lock);
> if (xn->state != LIBIE_CTLQ_XN_ASYNC &&
> xn->state != LIBIE_CTLQ_XN_WAITING) { @@ -1011,6 +1019,11
> @@ int libie_ctlq_xn_send(struct libie_ctlq_xn_send_params *params)
> params->recv_mem = xn->recv_mem;
> break;
> default:
> + dev_err_ratelimited(
> + params->ctlq->dev,
> + "Transaction failed (op %u, xn state: %d, id: %u,
> cookie: %u, size: %zu)\n",
> + params->chnl_opcode, xn->state, xn->index, xn-
> >cookie,
> + xn->recv_mem.iov_len);
Probably %u fits better for enums than %d, what do you think?
> ret = -EBADMSG;
> break;
> }
> --
> 2.54.0.545.g6539524ca2-goog
On Thu, Apr 30, 2026 at 1:36 AM Loktionov, Aleksandr
<aleksandr.loktionov@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> > Of Li Li via Intel-wired-lan
> > Sent: Wednesday, April 29, 2026 10:41 PM
> > To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> > Przemyslaw <przemyslaw.kitszel@intel.com>; David S. Miller
> > <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Eric Dumazet
> > <edumazet@google.com>; intel-wired-lan@lists.osuosl.org
> > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; David
> > Decotigny <decot@google.com>; Singhai, Anjali
> > <anjali.singhai@intel.com>; Samudrala, Sridhar
> > <sridhar.samudrala@intel.com>; Brian Vazquez <brianvv@google.com>; Li
> > Li <boolli@google.com>; Tantilov, Emil S <emil.s.tantilov@intel.com>
> > Subject: [Intel-wired-lan] [PATCH iwl-next v3] libie: log more info
> > when virtchnl fails
> >
> > Virtchnl failures can be hard to debug without logs. Logging the
> > details of virtchnl transactions can be useful for debugging virtchnl-
> > related issues.
> >
> > Tested: Built & booted on a test machine and synthetically produced a
> > virtual failure to produce the following log:
> >
> > idpf 0000:01:00.0: Non-zero virtchnl ret val (msg op: 1, ret val: 6,
> > data_len: 8); xn id: 0, cookie: 0
> > idpf 0000:01:00.0: Transaction failed (op 1, xn state:
> > 3, id: 0, cookie: 0, size: 8)
> >
> > Signed-off-by: Li Li <boolli@google.com>
> > ---
> > v3:
> > - Use dev_err_ratelimited in both logs.
> > - Move log placement to after virtchnl field validation.
> > - Remove redundant op/cookie fields since they were validated.
> > v2:
> > - Use dev_warn_ratelimited instead of dev_notice_ratelimited based on
> > reviewer feedback.
> >
> > drivers/net/ethernet/intel/libie/controlq.c | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/intel/libie/controlq.c
> > b/drivers/net/ethernet/intel/libie/controlq.c
> > index ebc05355e39d..ceca8a076d79 100644
> > --- a/drivers/net/ethernet/intel/libie/controlq.c
> > +++ b/drivers/net/ethernet/intel/libie/controlq.c
> > @@ -766,6 +766,14 @@ libie_ctlq_xn_process_recv(struct
> > libie_ctlq_xn_recv_params *params,
> > msg_cookie != xn->cookie)
> > return false;
> >
> > + if (ctlq_msg->chnl_retval) {
> > + dev_err_ratelimited(
> > + params->ctlq->dev,
> > + "Non-zero virtchnl ret val (msg op: %u, ret val:
> > %u, data_len: %u); xn id: %u, cookie: %u\n",
> > + ctlq_msg->chnl_opcode, ctlq_msg->chnl_retval,
> > + ctlq_msg->data_len, xn->index, xn->cookie);
> 'virtchnl ret val' 'ret val:' looks like a duplication in dmesg.
Let me send out v4 to simplify it.
>
>
> > + }
> > +
> > spin_lock(&xn->xn_lock);
> > if (xn->state != LIBIE_CTLQ_XN_ASYNC &&
> > xn->state != LIBIE_CTLQ_XN_WAITING) { @@ -1011,6 +1019,11
> > @@ int libie_ctlq_xn_send(struct libie_ctlq_xn_send_params *params)
> > params->recv_mem = xn->recv_mem;
> > break;
> > default:
> > + dev_err_ratelimited(
> > + params->ctlq->dev,
> > + "Transaction failed (op %u, xn state: %d, id: %u,
> > cookie: %u, size: %zu)\n",
> > + params->chnl_opcode, xn->state, xn->index, xn-
> > >cookie,
> > + xn->recv_mem.iov_len);
> Probably %u fits better for enums than %d, what do you think?
Sure, let me use %u in v4.
>
> > ret = -EBADMSG;
> > break;
> > }
> > --
> > 2.54.0.545.g6539524ca2-goog
>
© 2016 - 2026 Red Hat, Inc.