PlatformLab / HomaModule

A Linux kernel module that implements the Homa transport protocol.
175 stars 43 forks source link

Homa on newer kernel #6

Closed benner closed 2 years ago

benner commented 2 years ago

Is there any plans to port on newer kernel?

Tried to build on 5.17 without success. First issue solved by adding header:

+++ b/homa_offload.c
@@ -18,6 +18,7 @@
  */

 #include "homa_impl.h"
+#include <net/gro.h>

but did not found quick solution for following errors:

  CC [M]  /tmp/HomaModule/homa_peertab.o
/tmp/HomaModule/homa_peertab.c: In function ‘homa_peer_find’:
/tmp/HomaModule/homa_peertab.c:147:46: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  147 |         security_sk_classify_flow(&inet->sk, &peer->flow);
      |                                              ^~~~~~~~~~~
      |                                              |
      |                                              struct flowi *
In file included from ./include/net/scm.h:8,
                 from ./include/linux/netlink.h:9,
                 from ./include/uapi/linux/neighbour.h:6,
                 from ./include/linux/netdevice.h:45,
                 from ./include/linux/if_vlan.h:10,
                 from /tmp/HomaModule/homa_impl.h:27,
                 from /tmp/HomaModule/homa_peertab.c:20:
./include/linux/security.h:1401:70: note: expected ‘struct flowi_common *’ but argument is of type ‘struct flowi *’
 1401 | void security_sk_classify_flow(struct sock *sk, struct flowi_common *flic);
      |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~
/tmp/HomaModule/homa_peertab.c: In function ‘homa_dst_refresh’:
/tmp/HomaModule/homa_peertab.c:197:39: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  197 |         security_sk_classify_flow(sk, &peer->flow);
      |                                       ^~~~~~~~~~~
      |                                       |
      |                                       struct flowi *
In file included from ./include/net/scm.h:8,
                 from ./include/linux/netlink.h:9,
                 from ./include/uapi/linux/neighbour.h:6,
                 from ./include/linux/netdevice.h:45,
                 from ./include/linux/if_vlan.h:10,
                 from /tmp/HomaModule/homa_impl.h:27,
                 from /tmp/HomaModule/homa_peertab.c:20:
./include/linux/security.h:1401:70: note: expected ‘struct flowi_common *’ but argument is of type ‘struct flowi *’
 1401 | void security_sk_classify_flow(struct sock *sk, struct flowi_common *flic);
      |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:288: /tmp/HomaModule/homa_peertab.o] Error 1
make[1]: *** [Makefile:1837: /tmp/HomaModule] Error 2
johnousterhout commented 2 years ago

I haven't yet upgraded Homa to 5.17, but will try to do so in the next few weeks. In the meantime, I am attaching a patch file for 5.17 that I received from Michio Honda (cc'ed here); I haven't tested it myself but it seems to have worked for them.

-John-

On Fri, May 6, 2022 at 11:47 AM Nerijus Bendžiūnas @.***> wrote:

Is there any plans to port on newer kernel?

Tried to build on 5.17 without success. First issue solved by adding header:

+++ b/homa_offload.c

@@ -18,6 +18,7 @@

*/

include "homa_impl.h"

+#include <net/gro.h>

but did not found quick solution for following errors:

CC [M] /tmp/HomaModule/homa_peertab.o

/tmp/HomaModule/homa_peertab.c: In function ‘homa_peer_find’:

/tmp/HomaModule/homa_peertab.c:147:46: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]

147 | security_sk_classify_flow(&inet->sk, &peer->flow);

  |                                              ^~~~~~~~~~~

  |                                              |

  |                                              struct flowi *

In file included from ./include/net/scm.h:8,

             from ./include/linux/netlink.h:9,

             from ./include/uapi/linux/neighbour.h:6,

             from ./include/linux/netdevice.h:45,

             from ./include/linux/if_vlan.h:10,

             from /tmp/HomaModule/homa_impl.h:27,

             from /tmp/HomaModule/homa_peertab.c:20:

./include/linux/security.h:1401:70: note: expected ‘struct flowi_common ’ but argument is of type ‘struct flowi

1401 | void security_sk_classify_flow(struct sock sk, struct flowi_common flic);

  |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~

/tmp/HomaModule/homa_peertab.c: In function ‘homa_dst_refresh’:

/tmp/HomaModule/homa_peertab.c:197:39: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]

197 | security_sk_classify_flow(sk, &peer->flow);

  |                                       ^~~~~~~~~~~

  |                                       |

  |                                       struct flowi *

In file included from ./include/net/scm.h:8,

             from ./include/linux/netlink.h:9,

             from ./include/uapi/linux/neighbour.h:6,

             from ./include/linux/netdevice.h:45,

             from ./include/linux/if_vlan.h:10,

             from /tmp/HomaModule/homa_impl.h:27,

             from /tmp/HomaModule/homa_peertab.c:20:

./include/linux/security.h:1401:70: note: expected ‘struct flowi_common ’ but argument is of type ‘struct flowi

1401 | void security_sk_classify_flow(struct sock sk, struct flowi_common flic);

  |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~

cc1: some warnings being treated as errors

make[2]: *** [scripts/Makefile.build:288: /tmp/HomaModule/homa_peertab.o] Error 1

make[1]: *** [Makefile:1837: /tmp/HomaModule] Error 2

— Reply to this email directly, view it on GitHub https://github.com/PlatformLab/HomaModule/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOOUCRF573W372TO6GAGI3VIVSNZANCNFSM5VI6ZCJQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

johnousterhout commented 2 years ago

I haven't yet upgraded Homa to 5.17, but will try to do so in the next few weeks. In the meantime, I am attaching a patch file for 5.17 that I received from Michio Honda (cc'ed here); I haven't tested it myself but it seems to have worked for him.

-John-

On Fri, May 6, 2022 at 11:47 AM Nerijus Bendžiūnas @.***> wrote:

Is there any plans to port on newer kernel?

Tried to build on 5.17 without success. First issue solved by adding header:

+++ b/homa_offload.c

@@ -18,6 +18,7 @@

*/

include "homa_impl.h"

+#include <net/gro.h>

but did not found quick solution for following errors:

CC [M] /tmp/HomaModule/homa_peertab.o

/tmp/HomaModule/homa_peertab.c: In function ‘homa_peer_find’:

/tmp/HomaModule/homa_peertab.c:147:46: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]

147 | security_sk_classify_flow(&inet->sk, &peer->flow);

  |                                              ^~~~~~~~~~~

  |                                              |

  |                                              struct flowi *

In file included from ./include/net/scm.h:8,

             from ./include/linux/netlink.h:9,

             from ./include/uapi/linux/neighbour.h:6,

             from ./include/linux/netdevice.h:45,

             from ./include/linux/if_vlan.h:10,

             from /tmp/HomaModule/homa_impl.h:27,

             from /tmp/HomaModule/homa_peertab.c:20:

./include/linux/security.h:1401:70: note: expected ‘struct flowi_common ’ but argument is of type ‘struct flowi

1401 | void security_sk_classify_flow(struct sock sk, struct flowi_common flic);

  |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~

/tmp/HomaModule/homa_peertab.c: In function ‘homa_dst_refresh’:

/tmp/HomaModule/homa_peertab.c:197:39: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]

197 | security_sk_classify_flow(sk, &peer->flow);

  |                                       ^~~~~~~~~~~

  |                                       |

  |                                       struct flowi *

In file included from ./include/net/scm.h:8,

             from ./include/linux/netlink.h:9,

             from ./include/uapi/linux/neighbour.h:6,

             from ./include/linux/netdevice.h:45,

             from ./include/linux/if_vlan.h:10,

             from /tmp/HomaModule/homa_impl.h:27,

             from /tmp/HomaModule/homa_peertab.c:20:

./include/linux/security.h:1401:70: note: expected ‘struct flowi_common ’ but argument is of type ‘struct flowi

1401 | void security_sk_classify_flow(struct sock sk, struct flowi_common flic);

  |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~

cc1: some warnings being treated as errors

make[2]: *** [scripts/Makefile.build:288: /tmp/HomaModule/homa_peertab.o] Error 1

make[1]: *** [Makefile:1837: /tmp/HomaModule] Error 2

— Reply to this email directly, view it on GitHub https://github.com/PlatformLab/HomaModule/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOOUCRF573W372TO6GAGI3VIVSNZANCNFSM5VI6ZCJQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

johnousterhout commented 2 years ago

I also haven't tested enough but I'm going to do so also in the next week!

Cheers,


From: John Ousterhout @.***> Sent: 07 May 2022 01:23 To: PlatformLab/HomaModule Cc: Michio HONDA Subject: Re: [PlatformLab/HomaModule] Home on newer kernel (Issue #6)

I haven't yet upgraded Homa to 5.17, but will try to do so in the next few weeks. In the meantime, I am attaching a patch file for 5.17 that I received from Michio Honda (cc'ed here); I haven't tested it myself but it seems to have worked for them.

-John-

On Fri, May 6, 2022 at 11:47 AM Nerijus Bendžiūnas @.**@.>> wrote:

Is there any plans to port on newer kernel?

Tried to build on 5.17 without success. First issue solved by adding header:

+++ b/homa_offload.c

@@ -18,6 +18,7 @@

*/

include "homa_impl.h"

+#include <net/gro.h>

but did not found quick solution for following errors:

CC [M] /tmp/HomaModule/homa_peertab.o

/tmp/HomaModule/homa_peertab.c: In function ‘homa_peer_find’:

/tmp/HomaModule/homa_peertab.c:147:46: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]

147 | security_sk_classify_flow(&inet->sk, &peer->flow);

  |                                              ^~~~~~~~~~~

  |                                              |

  |                                              struct flowi *

In file included from ./include/net/scm.h:8,

             from ./include/linux/netlink.h:9,

             from ./include/uapi/linux/neighbour.h:6,

             from ./include/linux/netdevice.h:45,

             from ./include/linux/if_vlan.h:10,

             from /tmp/HomaModule/homa_impl.h:27,

             from /tmp/HomaModule/homa_peertab.c:20:

./include/linux/security.h:1401:70: note: expected ‘struct flowi_common ’ but argument is of type ‘struct flowi

1401 | void security_sk_classify_flow(struct sock sk, struct flowi_common flic);

  |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~

/tmp/HomaModule/homa_peertab.c: In function ‘homa_dst_refresh’:

/tmp/HomaModule/homa_peertab.c:197:39: error: passing argument 2 of ‘security_sk_classify_flow’ from incompatible pointer type [-Werror=incompatible-pointer-types]

197 | security_sk_classify_flow(sk, &peer->flow);

  |                                       ^~~~~~~~~~~

  |                                       |

  |                                       struct flowi *

In file included from ./include/net/scm.h:8,

             from ./include/linux/netlink.h:9,

             from ./include/uapi/linux/neighbour.h:6,

             from ./include/linux/netdevice.h:45,

             from ./include/linux/if_vlan.h:10,

             from /tmp/HomaModule/homa_impl.h:27,

             from /tmp/HomaModule/homa_peertab.c:20:

./include/linux/security.h:1401:70: note: expected ‘struct flowi_common ’ but argument is of type ‘struct flowi

1401 | void security_sk_classify_flow(struct sock sk, struct flowi_common flic);

  |                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~

cc1: some warnings being treated as errors

make[2]: *** [scripts/Makefile.build:288: /tmp/HomaModule/homa_peertab.o] Error 1

make[1]: *** [Makefile:1837: /tmp/HomaModule] Error 2

— Reply to this email directly, view it on GitHubhttps://github.com/PlatformLab/HomaModule/issues/6, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACOOUCRF573W372TO6GAGI3VIVSNZANCNFSM5VI6ZCJQ. You are receiving this because you are subscribed to this thread.Message ID: @.***> The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.

benner commented 2 years ago

I can test it. Waiting for patch

johnousterhout commented 2 years ago

Oops, looks like I forgot to include the patch. Trying again...

-John-

On Fri, May 6, 2022 at 10:10 PM Nerijus Bendžiūnas @.***> wrote:

I can test it. Waiting for patch

— Reply to this email directly, view it on GitHub https://github.com/PlatformLab/HomaModule/issues/6#issuecomment-1120136144, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOOUCQTWRHH2MT4Y7WLZRTVIX3MTANCNFSM5VI6ZCJQ . You are receiving this because you commented.Message ID: @.***>

larseggert commented 2 years ago

CC @micchie

johnousterhout commented 2 years ago

It appears that GitHub has been silently stripping the patches from my emails (it doesn't seem to allow .patch files?). Trying again with a .zip file containing the patch.

-John-

0001-Linux-5.17-support (1).zip

benner commented 2 years ago

Tested. Works. Also, with small modification (s/kthread_complete_and_exit/complete_and_exit/) I was able to compile on 5.15.

micchie commented 2 years ago

Thanks, I created a pull request. Yes, that change enables compilation in Linux 5.15, but it is obsolete in newer versions.

johnousterhout commented 2 years ago

I finally got around to merging Michio's pull request today. I had to make a few other changes in order to get tests running, and in the process of testing this I found a couple of other bugs, which are also fixed. Sorry this took so long.

Thanks Michio for the PR; that made things a lot easier for me.

-John-