idpf: fix LAN memory regions command on some NVMs
Subsystems (3)
PATCH 1/1 idpf: fix LAN memory regions command on some NVMs
IPU SDK versions 1.9 through 2.0.5 require send buffer to contain a single empty memory region. Set number of regions to 1 and use appropriate send buffer size to satisfy this requirement.
--- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +5 -0
@@ -1016,6 +1016,9 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)struct idpf_vc_xn_params xn_params = { .vc_op =VIRTCHNL2_OP_GET_LAN_MEMORY_REGIONS , .recv_buf.iov_len =IDPF_CTLQ_MAX_BUF_LEN , + .send_buf.iov_len = +sizeof (struct virtchnl2_get_lan_memory_regions ) + +sizeof (struct virtchnl2_mem_region ), .timeout_ms =IDPF_VC_XN_DEFAULT_TIMEOUT_MSEC , };int num_regions, size;
@@ -1028,6 +1031,8 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)return -ENOMEM ; xn_params.recv_buf.iov_base = rcvd_regions; + rcvd_regions->num_memory_regions =cpu_to_le16 (1 ); + xn_params.send_buf.iov_base = rcvd_regions; reply_sz =idpf_vc_xn_exec (adapter, &xn_params);if (reply_sz <0 )return reply_sz;
Signature · 1 line
2.47.0
Dear Larysa,
Am 07.10.25 um 13:46 schrieb Larysa Zaremba:
Quoted 3 lines
IPU SDK versions 1.9 through 2.0.5 require send buffer to contain a single empty memory region. Set number of regions to 1 and use appropriate send buffer size to satisfy this requirement.
Where are the SDK requirements documented?
What are the current SDK versions?
Do you have a reproducer?
Quoted 22 lines
Suggested-by Michal Swiatkowski <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>--- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +3
-0@@ -1016,6 +1016,9 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)struct idpf_vc_xn_params xn_params = { .vc_op =VIRTCHNL2_OP_GET_LAN_MEMORY_REGIONS , .recv_buf.iov_len =IDPF_CTLQ_MAX_BUF_LEN , + .send_buf.iov_len = +sizeof (struct virtchnl2_get_lan_memory_regions ) + +sizeof (struct virtchnl2_mem_region ), .timeout_ms =IDPF_VC_XN_DEFAULT_TIMEOUT_MSEC , };int num_regions, size;
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter) · line 1038
Quoted 8 lines
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +2
-0@@ -1028,6 +1031,8 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)return -ENOMEM ; xn_params.recv_buf.iov_base = rcvd_regions; + rcvd_regions->num_memory_regions =cpu_to_le16 (1 ); + xn_params.send_buf.iov_base = rcvd_regions; reply_sz =idpf_vc_xn_exec (adapter, &xn_params);if (reply_sz <0 )return reply_sz;
Kind regards,
Paul
Quoted 10 lines · Paul Menzel
Dear Larysa,
Am 07.10.25 um 13:46 schrieb Larysa Zaremba:
Quoted 3 lines
IPU SDK versions 1.9 through 2.0.5 require send buffer to contain a single empty memory region. Set number of regions to 1 and use appropriate send buffer size to satisfy this requirement.
Where are the SDK requirements documented?
IPU SDK is a fancy name for the FW. AFAIK, aside idpf specification intel did not publish any additional resources for it.
idpf specification [1] is unclear on the exact get command contents. What I am fixing is the reality of the implementation of the NVMs that support CPFs too (supported by ixd [0]).
Quoted 1 line
What are the current SDK versions?
2.1, I tested with 2.0.5 that was the latest when this patch was first implemented in August.
Quoted 2 lines
Do you have a reproducer?
I can reliably reproduce this on my machine with intel IPU SDK 2.0.5, the command fails every time without this patch, causing the probe to fail. Also, other developers such as Michal S reported such problem. It is most probably present on older NVMs too, its just that the command was not used before the RDMA patchset.
I have checked that the patch does not cause regression on the platforms that use another idpf-only NVMs, used by most intel IPUs.
[0]
https://lore.kernel.org/netdev/[email protected]/
[1]
https://github.com/oasis-tcs/idpf-specification/blob/main/idpf_specification.pdf
Quoted 35 lines
Quoted 23 lines
Suggested-by Michal Swiatkowski <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>--- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +3
-0@@ -1016,6 +1016,9 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)struct idpf_vc_xn_params xn_params = { .vc_op =VIRTCHNL2_OP_GET_LAN_MEMORY_REGIONS , .recv_buf.iov_len =IDPF_CTLQ_MAX_BUF_LEN , + .send_buf.iov_len = +sizeof (struct virtchnl2_get_lan_memory_regions ) + +sizeof (struct virtchnl2_mem_region ), .timeout_ms =IDPF_VC_XN_DEFAULT_TIMEOUT_MSEC , };int num_regions, size;drivers/net/ethernet/intel/idpf/idpf_virtchnl.c static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter) · line 1037
Quoted 7 lines
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +2
-0@@ -1028,6 +1031,8 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)return -ENOMEM ; xn_params.recv_buf.iov_base = rcvd_regions; + rcvd_regions->num_memory_regions =cpu_to_le16 (1 ); + xn_params.send_buf.iov_base = rcvd_regions; reply_sz =idpf_vc_xn_exec (adapter, &xn_params);if (reply_sz <0 )return reply_sz;Kind regards,
Paul
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c static int
Quoted 36 lines
-----Original Message-----
From: Larysa Zaremba <[email protected]>
Sent: Tuesday, October 7, 2025 4:46 AM
To: [email protected]; Nguyen, Anthony L <[email protected]>
Cc: Zaremba, Larysa <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Hay, Joshua A <[email protected]>; Chittim, Madhu <[email protected]>; [email protected]; linux- [email protected]; Tantilov, Emil S <[email protected]>; Michal Swiatkowski <[email protected]>; Loktionov, Aleksandr <[email protected]>
Subject: [PATCH iwl-net] idpf: fix LAN memory regions command on some NVMsIPU SDK versions 1.9 through 2.0.5 require send buffer to contain a single empty memory region. Set number of regions to 1 and use appropriate send buffer size to satisfy this requirement.
Suggested-by Michal Swiatkowski <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Signed-off-by Larysa Zaremba <[email protected]>--- drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +0
-0@@ -1016,6 +1016,9 @@ static int