libie: log more info when virtchnl fails
PATCH v4 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 6 (msg op: 1, 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)
---
v4:
- Simplify logging to reduce redundant "ret val"s.
- Use %u for xn->state.
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 %u (msg op: %u, data_len: %u); xn id: %u, cookie: %u\n" , + ctlq_msg->chnl_retval, ctlq_msg->chnl_opcode, + 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: %u, 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
Friendly ping on this patch.
Please let me know if you have any questions regarding this patch, thank you!
Li
Quoted 62 lines · Li Li
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 6 (msg op: 1,
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]>---
v4:
- Simplify logging to reduce redundant "ret val"s.
- Use %u forxn->state.
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 +13
-1@@ -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 %u (msg op: %u, data_len: %u); xn id: %u, cookie: %u\n" , + ctlq_msg->chnl_retval, ctlq_msg->chnl_opcode, + 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: %u, 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
Loktionov, Aleksandr
Reviewed-byQuoted 87 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Li Li via Intel-wired-lan
Sent: Saturday, May 9, 2026 1:07 AM
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]>; Tantilov, Emil S <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v4] libie: log more info when virtchnl failsFriendly ping on this patch.
Please let me know if you have any questions regarding this patch, thank you!
Li
Quoted 6 lines · Li Li
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
Quoted 8 lines
virtual failure to produce the following log:
idpf 0000:01:00.0: Non-zero virtchnl ret val 6 (msg op: 1,
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]>Quoted 10 lines
---
v4:
- Simplify logging to reduce redundant "ret val"s.
- Use %u forxn->state.
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_ratelimitedbasedon
drivers/net/ethernet/intel/libie/controlq.c libie_ctlq_xn_process_recv(struct
Quoted 10 lines
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 libie_ctlq_xn_recv_params *params,
Quoted 7 lines
drivers/net/ethernet/intel/libie/controlq.c +4
-0msg_cookie != xn->cookie)return false; +if (ctlq_msg->chnl_retval) { + dev_err_ratelimited( + params->ctlq->dev, + "Non-zero virtchnl ret val %u (msg op: %u,
data_len: %u); xn id: %u, cookie: %u\n",Quoted 8 lines
drivers/net/ethernet/intel/libie/controlq.c +4
-0+ ctlq_msg->chnl_retval, ctlq_msg- chnl_opcode, + 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
drivers/net/ethernet/intel/libie/controlq.c libie_ctlq_xn_process_recv(struct libie_ctlq_xn_recv_params *params,
Quoted 7 lines
@@ 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: %u,
Quoted 10 lines
id: %u, cookie: %u, size: %zu)\n",
Quoted 1 line
+
params->chnl_opcode,xn->state,xn->index,
xn->cookie,Quoted 7 lines
+ xn->recv_mem.iov_len); ret = -EBADMSG; break; }--
2.54.0.545.g6539524ca2-goog
Salin, Samuel
Tested-byQuoted 116 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Loktionov, Aleksandr
Sent: Monday, May 11, 2026 3:10 AM
To: Li Li <[email protected]>; 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]>; Tantilov, Emil S <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v4] libie: log more info when virtchnl failsQuoted 85 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Li Li via Intel-wired-lan
Sent: Saturday, May 9, 2026 1:07 AM
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]>; Tantilov, Emil S <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v4] libie: log more info when virtchnl failsFriendly ping on this patch.
Please let me know if you have any questions regarding this patch, thank you!
Li
Quoted 6 lines · Li Li
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
Quoted 8 lines
virtual failure to produce the following log:
idpf 0000:01:00.0: Non-zero virtchnl ret val 6 (msg op: 1,
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]>Quoted 10 lines
---
v4:
- Simplify logging to reduce redundant "ret val"s.
- Use %u forxn->state.
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_ratelimitedbasedon
drivers/net/ethernet/intel/libie/controlq.c libie_ctlq_xn_process_recv(struct
Quoted 10 lines
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 libie_ctlq_xn_recv_params *params,
Quoted 7 lines
drivers/net/ethernet/intel/libie/controlq.c +4
-0msg_cookie != xn->cookie)return false; +if (ctlq_msg->chnl_retval) { + dev_err_ratelimited( + params->ctlq->dev, + "Non-zero virtchnl ret val %u (msg op: %u,
data_len: %u); xn id: %u, cookie: %u\n",Quoted 8 lines
drivers/net/ethernet/intel/libie/controlq.c +4
-0+ ctlq_msg->chnl_retval, ctlq_msg- chnl_opcode, + 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
drivers/net/ethernet/intel/libie/controlq.c libie_ctlq_xn_process_recv(struct libie_ctlq_xn_recv_params *params,
Quoted 7 lines
@@ 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: %u,Quoted 10 lines
id: %u, cookie: %u, size: %zu)\n",
Quoted 1 line
+
params->chnl_opcode,xn->state,xn->index,
xn->cookie,Quoted 7 lines
+ xn->recv_mem.iov_len); ret = -EBADMSG; break; }--
2.54.0.545.g6539524ca2-goog
Quoted 1 line
Reviewed-by Aleksandr Loktionov <[email protected]>