libie: log more info when virtchnl fails
PATCH v3 1/1 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)
---
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(+)
drivers/net/ethernet/intel/libie/controlq.c +13 -0
@@ -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 ; }
Signature · 1 line
2.54.0.545.g6539524ca2-goog
Quoted 50 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Li Li via Intel-wired-lan
Sent: Wednesday, April 29, 2026 10:41 PM
To: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; David S. Miller <[email protected]>; Jakub Kicinski <[email protected]>; Eric Dumazet <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; David Decotigny <[email protected]>; Singhai, Anjali <[email protected]>; Samudrala, Sridhar <[email protected]>; Brian Vazquez <[email protected]>; Li Li <[email protected]>; Tantilov, Emil S <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v3] libie: log more info when virtchnl failsVirtchnl 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 <[email protected]>---
v3:
- Usedev_err_ratelimitedin both logs.
- Move log placement to after virtchnl field validation.
- Remove redundant op/cookie fields since they were validated.
v2:
- Usedev_warn_ratelimitedinstead ofdev_notice_ratelimitedbased on reviewer feedback.drivers/net/ethernet/intel/libie/controlq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/net/ethernet/intel/libie/controlq.c +0
-0@@ -766,6 +766,14 @@ libie_ctlq_xn_process_recv(struct libie_ctlq_xn_recv_params *params,
drivers/net/ethernet/intel/libie/controlq.c libie_ctlq_xn_process_recv(struct · line 776
Quoted 10 lines
drivers/net/ethernet/intel/libie/controlq.c +6
-0msg_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.
Quoted 15 lines
drivers/net/ethernet/intel/libie/controlq.c +2
-0+ } +spin_lock (&xn->xn_lock);drivers/net/ethernet/intel/libie/controlq.c +0
-0if (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)drivers/net/ethernet/intel/libie/controlq.c +3
-0params->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",
drivers/net/ethernet/intel/libie/controlq.c +1
-0+ params->chnl_opcode, xn->state, xn->index, xn-Quoted 1 line
cookie,
drivers/net/ethernet/intel/libie/controlq.c int libie_ctlq_xn_send(struct libie_ctlq_xn_send_params *params) · line 1026
Quoted 1 line
drivers/net/ethernet/intel/libie/controlq.c +1
-0+ xn->recv_mem.iov_len);
Probably %u fits better for enums than %d, what do you think?
Quoted 5 lines
drivers/net/ethernet/intel/libie/controlq.c +0
-1ret = -EBADMSG ;break ; } --2.54.0.545.g6539524ca2-goog
Quoted 54 lines · Aleksandr
Quoted 54 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Li Li via Intel-wired-lan
Sent: Wednesday, April 29, 2026 10:41 PM
To: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; David S. Miller <[email protected]>; Jakub Kicinski <[email protected]>; Eric Dumazet <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; David Decotigny <[email protected]>; Singhai, Anjali <[email protected]>; Samudrala, Sridhar <[email protected]>; Brian Vazquez <[email protected]>; Li Li <[email protected]>; Tantilov, Emil S <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v3] libie: log more info when virtchnl failsVirtchnl 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 <[email protected]>---
v3:
- Usedev_err_ratelimitedin both logs.
- Move log placement to after virtchnl field validation.
- Remove redundant op/cookie fields since they were validated.
v2:
- Usedev_warn_ratelimitedinstead ofdev_notice_ratelimitedbased on reviewer feedback.drivers/net/ethernet/intel/libie/controlq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/net/ethernet/intel/libie/controlq.c +0
-0@@ -766,6 +766,14 @@ libie_ctlq_xn_process_recv(struct libie_ctlq_xn_recv_params *params, msg_cookie != xn->cookie)return false;
Quoted 8 lines
drivers/net/ethernet/intel/libie/controlq.c libie_ctlq_xn_process_recv(struct libie_ctlq_xn_recv_params *params, · line 774
Quoted 7 lines
drivers/net/ethernet/intel/libie/controlq.c +6
-0+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.
Quoted 16 lines
Quoted 16 lines
drivers/net/ethernet/intel/libie/controlq.c +2
-0+ } +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:drivers/net/ethernet/intel/libie/controlq.c +3
-0+ 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-
Quoted 3 lines
Quoted 2 lines
Quoted 1 line
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.
Quoted 7 lines
Quoted 6 lines
ret = -EBADMSG; break; }--
2.54.0.545.g6539524ca2-goog