Skip to contentSkip to conversation

vsock/vmci: log once the failed queue pair allocation

PATCH In review Stefano Garzarella 1 participant 2 messages Apr 16, 2021 – Apr 19, 2021 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

Stefano Garzarella

author maintainer
#0 lore raw

PATCH 1/1 vsock/vmci: log once the failed queue pair allocation

VMCI feature is not supported in conjunction with the vSphere Fault Tolerance (FT) feature.

VMware Tools can repeatedly try to create a vsock connection. If FT is enabled the kernel logs is flooded with the following messages:

qp_alloc_hypercall result = -20
Could not attach to queue pair with -20

"qp_alloc_hypercall result = -20" was hidden by commit e8266c4c3307 ("VMCI: Stop log spew when qp allocation isn't possible"), but "Could not attach to queue pair with -20" is still there flooding the log.

Since the error message can be useful in some cases, print it only once.

Fixes d021c344051a ("VSOCK: Introduce VM Sockets")
---
 net/vmw_vsock/vmci_transport.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/vmw_vsock/vmci_transport.c +1 -2
index 8b65323207db..1c9ecb18b8e6 100644
@@ -568,8 +568,7 @@ vmci_transport_queue_pair_alloc(struct vmci_qp **qpair,
 			       peer, flags, VMCI_NO_PRIVILEGE_FLAGS);
 out:
 	if (err < 0) {
-		pr_err("Could not attach to queue pair with %d\n",
-		       err);
+		pr_err_once("Could not attach to queue pair with %d\n", err);
 		err = vmci_transport_error_to_vsock_error(err);
 	}
 
Signature · 1 line
2.30.2

A message that is not in the archive (sent off-list or not yet received): [email protected]

author maintainer Reviewed-by Jorgen Hansen
#2 lore raw
Quoted 39 lines · Jorgen Hansen

On 16 Apr 2021, at 12:44, Stefano Garzarella <[email protected]<mailto:[email protected]>> wrote:

VMCI feature is not supported in conjunction with the vSphere Fault Tolerance (FT) feature.

VMware Tools can repeatedly try to create a vsock connection. If FT is enabled the kernel logs is flooded with the following messages:

qp_alloc_hypercall result = -20
Could not attach to queue pair with -20

"qp_alloc_hypercall result = -20" was hidden by commit e8266c4c3307 ("VMCI: Stop log spew when qp allocation isn't possible"), but "Could not attach to queue pair with -20" is still there flooding the log.

Since the error message can be useful in some cases, print it only once.

Fixes d021c344051a ("VSOCK: Introduce VM Sockets")

---
net/vmw_vsock/vmci_transport.c | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)
net/vmw_vsock/vmci_transport.c +0 -0
index 8b65323207db..1c9ecb18b8e6 100644
@@ -568,8 +568,7 @@ vmci_transport_queue_pair_alloc(struct vmci_qp **qpair,
     peer, flags, VMCI_NO_PRIVILEGE_FLAGS);

out:
if (err < 0) {
- pr_err("Could not attach to queue pair with %d\n",
- err);
+ pr_err_once("Could not attach to queue pair with %d\n", err); err = vmci_transport_error_to_vsock_error(err);
}

Quoted 5 lines

—
2.30.2

Thanks a lot for fixing this.

You're welcome!

Quoted 3 lines

Thanks for the review!
Patchwork didn't like it, I think there was some problem with your email client putting <mailto:...> links.

I think it had to be:

Thanks,
Stefano