Re: [PATCH] can: isotp: upgrade 5.15 LTS to latest 6.6 mainline code base

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Greg,

On 30.10.23 12:38, Greg KH wrote:
On Mon, Oct 30, 2023 at 12:31:10PM +0100, Oliver Hartkopp wrote:
The backport of commit 9c5df2f14ee3 ("can: isotp: isotp_ops: fix poll() to
not report false EPOLLOUT events") introduced a new regression where the
fix could potentially introduce new side effects.

To reduce the risk of other unmet dependencies and missing fixes and checks
the latest mainline code base is ported back to the 5.15 LTS tree.

To meet the former Linux 5.15 API these commits have been reverted:
f4b41f062c42 ("net: remove noblock parameter from skb_recv_datagram()")
96a7457a14d9 ("can: skb: unify skb CAN frame identification helpers")
dc97391e6610 ("sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES)")
0145462fc802 ("can: isotp: isotp_recvmsg(): use sock_recv_cmsgs() to get SOCK_RXQ_OVFL infos")

New features and communication stability measures:
9f39d36530e5 ("can: isotp: add support for transmission without flow control")
96d1c81e6a04 ("can: isotp: add module parameter for maximum pdu size")
4b7fe92c0690 ("can: isotp: add local echo tx processing for consecutive frames")
530e0d46c613 ("can: isotp: set default value for N_As to 50 micro seconds")

Please send these as individual patches, reverts and then the new ones
added, not as one huge commit that we can't review properly at all.

That would be around 20 patches including fixes and fixes of fixes of fixes. For that reason I simply copied the 6.6 code and made the code work in 5.x by adapting it to the old 5.x kernel APIs.

E.g. the diff from the new 5.15 and the 6.6 code is just this:

$ diff -U 2 isotp.c-5.15-new isotp.c-6.6
--- isotp.c-5.15-new	2023-10-29 15:41:39.770567182 +0100
+++ isotp.c-6.6	2023-10-28 22:07:21.293444651 +0200
@@ -695,5 +695,5 @@
 			isotp_rcv_sf(sk, cf, SF_PCI_SZ4 + ae, skb, sf_dl);
 		} else {
-			if (skb->len == CANFD_MTU) {
+			if (can_is_canfd_skb(skb)) {
 				/* We have a CAN FD frame and CAN_DL is greater than 8:
 				 * Only frames with the SF_DL == 0 ESC value are valid.
@@ -1130,5 +1130,4 @@
 	struct sk_buff *skb;
 	struct isotp_sock *so = isotp_sk(sk);
-	int noblock = flags & MSG_DONTWAIT;
 	int ret = 0;

@@ -1139,6 +1138,5 @@
 		return -EADDRNOTAVAIL;

-	flags &= ~MSG_DONTWAIT;
-	skb = skb_recv_datagram(sk, flags, noblock, &ret);
+	skb = skb_recv_datagram(sk, flags, &ret);
 	if (!skb)
 		return ret;
@@ -1153,5 +1151,5 @@
 		goto out_err;

-	sock_recv_timestamp(msg, sk, skb);
+	sock_recv_cmsgs(msg, sk, skb);

 	if (msg->msg_name) {
@@ -1692,5 +1690,4 @@
 	.recvmsg = isotp_recvmsg,
 	.mmap = sock_no_mmap,
-	.sendpage = sock_no_sendpage,
 };


Of course I could split all the fixes and improvements into new patches that omit the API changes. But is it worth the effort when we end up with the 6.6 code using the old API?

But why just 5.15?  What about 6.1.y and 6.5.y?

I have posted 5.10 and 5.15 for now.
6.1 would be only this patch
96d1c81e6a04 ("can: isotp: add module parameter for maximum pdu size")
I can also provide.

6.5 is up to date with the latest 6.6

Best regards,
Oliver



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux