Skip to contentSkip to conversation

evl/genirq/test: fix irq test build issue

PATCH In review Junxiao Chang 2 participants 11 messages Jan 12 – Jan 14

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 evl/genirq/test: fix irq test build issue

raw lock in irq test case should be replaced with hybrid lock.

Fixes a4a5748406af ("genirq: irq_pipeline: add IRQ pipeline core")
---
 kernel/irq/irq_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irq_test.c +1 -1
index e2d31914b3c4..f13ea0f7cbdc 100644
@@ -145,7 +145,7 @@ static void irq_shutdown_depth_test(struct kunit *test)
 	disable_irq(virq);
 	KUNIT_EXPECT_EQ(test, desc->depth, 1);
 
-	scoped_guard(raw_spinlock_irqsave, &desc->lock)
+	scoped_guard(hybrid_spinlock_irqsave, &desc->lock)
 		irq_shutdown_and_deactivate(desc);
 
 	KUNIT_EXPECT_FALSE(test, irqd_is_activated(data));
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 evl/net: export sock_oob_bind symbol

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c +1 -0
index 4c61a1c1f6d0..b87f3fa9863d 100644
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);
 }
+EXPORT_SYMBOL(sock_oob_bind);
 
 /*
  * In-band call from the common network stack to shutdown the
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH evl 6.18 2/2] evl/net: export sock_oob_bind symbol

Quoted 3 lines · Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

The routine you are exporting is the implementation of a weak symbol called by the regular network stack in order to allow any real-time core which may be interested to extend the logic of a common networking operation, in this case socket binding as extended by evl. If you were to add some evl-managed protocol, then you would declare it to its network stack, so that sock_oob_bind() could automatically route any relevant request to some handler in your protocol implementation.

Therefore, I'm unsure to understand what could be the use case here, why would and evl-based module need to call this routine?

Quoted 19 lines
Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c +1 -0
index 4c61a1c1f6d0..b87f3fa9863d 100644
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);
 }
+EXPORT_SYMBOL(sock_oob_bind);
 
 /*
  * In-band call from the common network stack to shutdown the
Signature · 1 line
Philippe.
#3 lore raw

RE: [PATCH evl 6.18 2/2] evl/net: export sock_oob_bind symbol

Quoted 15 lines · Philippe Gerum
Quoted 3 lines · Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

The routine you are exporting is the implementation of a weak symbol called by the regular network stack in order to allow any real-time core which may be interested to extend the logic of a common networking operation, in this case socket binding as extended by evl. If you were to add some evl-managed protocol, then you would declare it to its network stack, so that sock_oob_bind() could automatically route any relevant request to some handler in your protocol implementation.

Quoted 2 lines

Therefore, I'm unsure to understand what could be the use case here, why would and evl-based module need to call this routine?

Thank you for reviewing it! It is a minor build issue. When we try "make allmodconfig && make -j48" to build EVL kernel, it returns below error:
ERROR: modpost: "sock_oob_bind" [net/packet/af_packet.ko] undefined!

af_packet.c is built as kernel module(CONFIG_PACKET=m), it calls sock_oob_bind API which is defined in kernel/evl/net/socket.c, this API should be exported.

Quoted 23 lines
Quoted 13 lines
Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c index renamed from kernel/evl/net/socket.c +0 -0

4c61a1c1f6d0..b87f3fa9863d 100644

kernel/evl/net/socket.c int sock_oob_bind(struct sock *sk, struct sockaddr · line 455

Quoted 7 lines
kernel/evl/net/socket.c +1 -0
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr
 *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);  }
+EXPORT_SYMBOL(sock_oob_bind);
 
 /*
  * In-band call from the common network stack to shutdown the

--
Philippe.

#4 lore raw

Re: [PATCH evl 6.18 2/2] evl/net: export sock_oob_bind symbol

Quoted 19 lines · Junxiao
Quoted 15 lines · Philippe Gerum
Quoted 3 lines · Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

The routine you are exporting is the implementation of a weak symbol called by the regular network stack in order to allow any real-time core which may be interested to extend the logic of a common networking operation, in this case socket binding as extended by evl. If you were to add some evl-managed protocol, then you would declare it to its network stack, so that sock_oob_bind() could automatically route any relevant request to some handler in your protocol implementation.

Quoted 2 lines

Therefore, I'm unsure to understand what could be the use case here, why would and evl-based module need to call this routine?

Quoted 7 lines

Thank you for reviewing it! It is a minor build issue. When we try "make allmodconfig && make -j48" to build EVL kernel, it returns below error:
ERROR: modpost: "sock_oob_bind" [net/packet/af_packet.ko] undefined!

af_packet.c is built as kernel module(CONFIG_PACKET=m), it calls sock_oob_bind API which is defined in kernel/evl/net/socket.c, this API should be exported.

Ok, you are building some standard protocol support as modules, makes sense then. In this case, please resubmit a patch using EXPORT_SYMBOL_GPL() instead.

Signature · 1 line
Philippe.
#5 lore raw

PATCH 1/1 evl/net: export sock_oob_bind symbol

In reply to Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c +1 -0
index 4c61a1c1f6d0..69593470d62b 100644
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);
 }
+EXPORT_SYMBOL_GPL(sock_oob_bind);
 
 /*
  * In-band call from the common network stack to shutdown the
Signature · 1 line
2.43.0
#6 lore raw

Re: [PATCH] evl/net: export sock_oob_bind symbol

Quoted 15 lines · Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c +0 -0
index 4c61a1c1f6d0..69593470d62b 100644

kernel/evl/net/socket.c int sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len) · line 455

Quoted 7 lines
kernel/evl/net/socket.c +1 -0
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);
 }
+EXPORT_SYMBOL_GPL(sock_oob_bind);
 
 /*
  * In-band call from the common network stack to shutdown the

Almost there, I just figured out that there is an even better option though, so that we can keep this hunk in the code which actually defines the interface. This patch would sit on the dovetail side (not evl):

net/socket.c +1 -0
index 1ecf67b656c51..ba00e99b042cf 100644
@@ -167,6 +167,7 @@ int __weak sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len)
 {
 	return 0;
 }
+EXPORT_SYMBOL_GPL(sock_oob_bind);
 
 int __weak sock_oob_shutdown(struct sock *sk, int how)
 {
Signature · 1 line
Philippe.
#7 lore raw

RE: [PATCH] evl/net: export sock_oob_bind symbol

Quoted 23 lines · Philippe Gerum
Quoted 20 lines · Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c index renamed from kernel/evl/net/socket.c +0 -0

4c61a1c1f6d0..69593470d62b 100644

kernel/evl/net/socket.c +1 -0
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr
 *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);  }
+EXPORT_SYMBOL_GPL(sock_oob_bind);
 
Quoted 6 lines

kernel/evl/net/socket.c int sock_oob_bind(struct sock *sk, struct sockaddr · line 455

Quoted 2 lines
kernel/evl/net/socket.c +0 -0
 /*
  * In-band call from the common network stack to shutdown the

Almost there, I just figured out that there is an even better option though, so that we can keep this hunk in the code which actually defines the interface. This patch would sit on the dovetail side (not evl):

Yes, below patch makes sense. For evl/dovetail, your suggestion is that we should submit below patch to below repo and branch? https://gitlab.com/Xenomai/linux-dovetail/-/tree/v6.18.y-dovetail-rebase

Quoted 14 lines
net/socket.c index 1ecf67b656c51..ba00e99b042cf renamed from net/socket.c +0 -0

100644

net/socket.c +1 -1
@@ -167,6 +167,7 @@ int __weak sock_oob_bind(struct sock *sk, struct
 sockaddr *addr, int len)  {
 	return 0;
 }
+EXPORT_SYMBOL_GPL(sock_oob_bind);
 
 int __weak sock_oob_shutdown(struct sock *sk, int how)  {
 
--

Philippe.

#8 lore raw

Re: [PATCH] evl/net: export sock_oob_bind symbol

Quoted 24 lines · Junxiao
Quoted 23 lines · Philippe Gerum
Quoted 20 lines · Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c index renamed from kernel/evl/net/socket.c +0 -0

4c61a1c1f6d0..69593470d62b 100644

kernel/evl/net/socket.c +1 -0
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr
 *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);  }
+EXPORT_SYMBOL_GPL(sock_oob_bind);
 
Quoted 9 lines
Quoted 6 lines

kernel/evl/net/socket.c int sock_oob_bind(struct sock *sk, struct sockaddr · line 455

Quoted 2 lines
kernel/evl/net/socket.c +0 -0
 /*
  * In-band call from the common network stack to shutdown the

Almost there, I just figured out that there is an even better option though, so that we can keep this hunk in the code which actually defines the interface. This patch would sit on the dovetail side (not evl):

Yes, below patch makes sense. For evl/dovetail, your suggestion is that we should submit below patch to below repo and branch? https://gitlab.com/Xenomai/linux-dovetail/-/tree/v6.18.y-dovetail-rebase

Yes please.

Signature · 1 line
Philippe.
#9 lore raw

Re: [PATCH] evl/net: export sock_oob_bind symbol

In reply to Junxiao Chang
Quoted 15 lines · Junxiao Chang

API sock_oob_bind symbol should be exported because it might be used in other kernel modules.

Fixes 9afaf877fa08 ("evl: add net core (EXPERIMENTAL)")
---
 kernel/evl/net/socket.c | 1 +
 1 file changed, 1 insertion(+)
kernel/evl/net/socket.c +0 -0
index 4c61a1c1f6d0..69593470d62b 100644

kernel/evl/net/socket.c int sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len) · line 455

Quoted 7 lines
kernel/evl/net/socket.c +1 -0
@@ -449,6 +449,7 @@ int sock_oob_bind(struct sock *sk, struct sockaddr *addr, int len)
 
 	return esk->proto->bind(esk, addr, len);
 }
+EXPORT_SYMBOL_GPL(sock_oob_bind);
 
 /*
  * In-band call from the common network stack to shutdown the

Merged, thanks.

Signature · 1 line
Philippe.
#10 lore raw
In reply to Junxiao Chang
Quoted 14 lines · Junxiao Chang

raw lock in irq test case should be replaced with hybrid lock.

Fixes a4a5748406af ("genirq: irq_pipeline: add IRQ pipeline core")
---
 kernel/irq/irq_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irq_test.c +0 -0
index e2d31914b3c4..f13ea0f7cbdc 100644

kernel/irq/irq_test.c static void irq_shutdown_depth_test(struct kunit *test) · line 151

Quoted 8 lines
kernel/irq/irq_test.c +1 -1
@@ -145,7 +145,7 @@ static void irq_shutdown_depth_test(struct kunit *test)
 	disable_irq(virq);
 	KUNIT_EXPECT_EQ(test, desc->depth, 1);
 
-	scoped_guard(raw_spinlock_irqsave, &desc->lock)
+	scoped_guard(hybrid_spinlock_irqsave, &desc->lock)
 		irq_shutdown_and_deactivate(desc);
 
 	KUNIT_EXPECT_FALSE(test, irqd_is_activated(data));

Merged (slightly fixing up the short log to align with the existing convention about prefixing), thanks.

Signature · 1 line
Philippe.