New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial kernel 4.19 support #1386

Closed
wants to merge 7 commits into
base: master
from

Conversation

Projects
None yet
@ratkaj
Contributor

ratkaj commented Sep 19, 2018

This is initial support for kernel 4.19, currently in RC stage, following the discussion here:
#1358

There are several points to be addressed:

1.) I had to split ./target/linux/generic/files into separate folders for each kernel. We simply cannot use the same folder for all kernels. Many files from the old files folder are already in kernel 4.19. I had to carefully check this and throw out outdated/duplicate stuff.

2.) nf_conntrack.ko dependencies changed with 4.19. There is no longer a separate module for ipv6. I had to add a version check in include/netfilter.mk to address this.

3.) ledtrig-netdev.ko file location changed with 4.19. Had to add kernel version check to solve this.

4.) Hash in include/kernel-version will have to be fixed once 4.19.0 is out. Note that OpenWrt has issues with -rc4 in the name and cannot download or check versions. For testing I repackaged 4.19-rc4, removed EXTRAVERSION and placed it in ./dl folder mimicking the actual release.

5.) mac80211 backports still needs fixing, even with updates from @blogic.
https://git.openwrt.org/?p=openwrt/staging/blogic.git;a=shortlog;h=refs/heads/mac80211
This prevents me from testing with all kmods.

Please comment and review and I will fix.
Tested and running with no issues on several boards.
I will continue working on this next week.

Signed-off-by: Marko Ratkaj marko.ratkaj@sartura.hr

@ratkaj ratkaj referenced this pull request Sep 19, 2018

Closed

kernel: add 4.18 support #1358

@dedeckeh dedeckeh added the kernel label Sep 19, 2018

@adrianschmutzler

This comment has been minimized.

Contributor

adrianschmutzler commented Sep 20, 2018

Hi, thanks for your work.

Maybe add a litte more verbose commit descriptions into the commits itself (like you did in the PR message). Particularly for the split commit I would consider an overview of what has been moved where very helpful.

@thagabe

This comment has been minimized.

Contributor

thagabe commented Sep 20, 2018

Patch won't apply cleanly to master atm

@luaraneda

This comment has been minimized.

Contributor

luaraneda commented Sep 22, 2018

Patch won't apply cleanly to master atm

That's probably because the latest kernel bump done by commits 0dbdb47 and 72e9b40.

@ratkaj: This PR requires a rebase to resolve the merge conflics

@diizzyy

This comment has been minimized.

Contributor

diizzyy commented Sep 22, 2018

Due to how OpenWrt handles kernel versions this is pretty much always going to conflict at least once or twice a week.

@hauke

This comment has been minimized.

Member

hauke commented Sep 22, 2018

I think it is not a big problem that it currently does not apply, people should be able to do this manually.
Please be more verbose in the commit messages.
if there is a files and a files- folder both are taken, so you can put the files which do not need to be split into the files folder and only put the file which need the split into the files- folders.

FILES:=$(LINUX_DIR)/drivers/leds/ledtrig-netdev.ko
else
FILES:=$(LINUX_DIR)/drivers/leds/trigger/ledtrig-netdev.ko
endif

This comment has been minimized.

@hauke

hauke Sep 22, 2018

Member

Please use

FILES:= \
$(LINUX_DIR)/drivers/leds/ledtrig-netdev.ko@lt4.19
$(LINUX_DIR)/drivers/leds/trigger/ledtrig-netdev.ko@ge4.19
@hauke

This comment has been minimized.

Member

hauke commented Sep 22, 2018

Which targets did you test this on?

@ratkaj

This comment has been minimized.

Contributor

ratkaj commented Sep 26, 2018

Back from vacation so continuing to work on this.

@hauke I tested this on ClearFog Base (mvebu target). Still cleaning up target related patches.

In rc3 there was a commit that broke ClearFog Base, had to make a patch for this, but should be merged before final release. Other than this no major issues so far.

https://lore.kernel.org/lkml/87zhwm4kl6.fsf@tkos.co.il/

@ratkaj ratkaj force-pushed the sartura:initial_kernel_4.19_support branch from 836dc2a to 008fb85 Sep 26, 2018

@ratkaj

This comment has been minimized.

Contributor

ratkaj commented Sep 26, 2018

Changelog:
*Bumped to rc5 and rebased so it can be applied
*Fixed leds.mk according to input from hauke
*Added some comments

I did not change generic/files* any further, looking at older kernels i found the following strangeness:

We use the same generic/files for kernels 3.18, 4.9 and 4.14. If we look at the contents there is a files/drivers/net/phy/b53/ folder adding support for the DSA switch. This is missing in kernel 3.18 but for the later kernels this is added in ./drivers/net/dsa/b53. This works because we add it to a different location with it's own Kconfig (options under different names) and Makefile but on 4.x kernels these files are outdated and I believe should not be used.

Not sure what is the logic there, this seems very broken and needs cleanup or my logic is wrong ?
Should we separate those files to a files-3.18 and remove them from original files folder? Note that 3.18 is EOL.

@xback

This comment has been minimized.

Contributor

xback commented Sep 26, 2018

On the mailinglist in reply to Hauke's explanation on planning for 19.01, I opted the suggestion to remove 3.18 targets completely.

Let's wait a little bit what comes out of this

Some targets are still on (EOL) kernel 3.18 today.
This kernel also still exists by the grace of Greg K-H but could be dropped any moment.

I've bumped it a few times (untested) just for the sake of security updates.
But afaict, nobody attempted/requested to update these to a newer kernel version.

These targets were also dropped in 18.06 branch.
Maybe we should also consider dropping support for these targets in master?

adm5120
xburst
mcs814x
au1000
ppc40x
adm8668
ppc44x

@hauke

This comment has been minimized.

Member

hauke commented Sep 29, 2018

if kernel 3.18 causes problems we can also remove the parts from kernel 3.18 or remove it completely as it is not really supported anyway any more.

files/drivers/net/phy/b53/ contains the swconfig driver for the Broadcom switches, the mainline kernel ships with the dsa based b53 driver which is based on the OpenWrt swconfig b53 driver. ;-)

We are still missing a good migration path for the old swocnfig configuration to the dsa configuration.

@lucize

This comment has been minimized.

Contributor

lucize commented Sep 29, 2018

is this really needed ?

diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk
index 6d05d6f..5ed697e 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -470,7 +470,9 @@ define KernelPackage/r8169
   KCONFIG:=CONFIG_R8169 \
     CONFIG_R8169_NAPI=y \
     CONFIG_R8169_VLAN=n
-  FILES:=$(LINUX_DIR)/drivers/net/ethernet/realtek/r8169.ko
+  FILES:= \
+  $(LINUX_DIR)/drivers/net/ethernet/realtek/r8169.ko \
+  $(LINUX_DIR)/drivers/net/phy/libphy.ko@ge4.19
   AUTOLOAD:=$(call AutoProbe,r8169)
 endef

tried it on x84_64 with default config-4.14 copied to config-4.19 and accepting all defaults, else it will complain about missing libphy.ko

but

net/vmw_vsock/diag.o: In function `sk_diag_fill':
openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19-rc5/net/vmw_vsock/diag.c:51: undefined reference to `sock_diag_save_cookie'
net/vmw_vsock/diag.o: In function `vsock_diag_exit':
openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19-rc5/net/vmw_vsock/diag.c:179: undefined reference to `sock_diag_unregister'
net/vmw_vsock/diag.o: In function `vsock_diag_init':
openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-4.19-rc5/net/vmw_vsock/diag.c:174: undefined reference to `sock_diag_register'

similar problems https://dev.archive.openwrt.org/changeset/46997.html

@lucize

This comment has been minimized.

Contributor

lucize commented Sep 30, 2018

I guess that VSOCKETS_DIAG needs to be disabled or patched for openwrt, it seems that realtek nic needs the libphy driver
[ 117.999825] Generic PHY r8169-800:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=r8169-800:00, irq=IGNORE)
edit
rt2800usb wifi is working fine

@robimarko

This comment has been minimized.

Contributor

robimarko commented Oct 5, 2018

Anybody got 4.19-rc5 compiled?
I have been stuck at a weird mac80211 error even rebased on current master and even when I disable mac80211.

I already rebased ipq40xx to test the new SPI NAND driver but cant get mac80211 compiled

@lucize

This comment has been minimized.

Contributor

lucize commented Oct 5, 2018

Anybody got 4.19-rc5 compiled?

rt2800usb wifi is working fine

https://pastebin.com/WiMgv4gR

@robimarko

This comment has been minimized.

Contributor

robimarko commented Oct 5, 2018

@lucize I am still hitting this weird error about ath9k_platform.h:
https://gist.github.com/robimarko/3e2ea915539fd715ac724fc69f1cae32

@lucize

This comment has been minimized.

Contributor

lucize commented Oct 5, 2018

Just delete that patch, I think I did it too

Edit :
Sorry, I've missread it, I've built it on centos 6

@lucize

This comment has been minimized.

Contributor

lucize commented Oct 5, 2018

I've talked with someone privately and on Ubuntu 16 is failing for him, I'll test there too, but centos 6 is not working by default so I think it's strange.. 4.19-rc6 is working for me too

@robimarko

This comment has been minimized.

Contributor

robimarko commented Oct 5, 2018

@lucize

This comment has been minimized.

Contributor

lucize commented Oct 5, 2018

I've edited the post, I misread your log

@robimarko

This comment has been minimized.

Contributor

robimarko commented Oct 6, 2018

Ok, finally got it to compile mac80211.
Had to copy over the ath9k_platform.h from backports to the build_dir of kernel.

Now its failling essedma for ipq40xx because of init_timer being removed in 4.15

@lucize

This comment has been minimized.

Contributor

lucize commented Oct 7, 2018

I think backports needs to be adjusted too, xtables-addons patches needs to be adjusted and conntrack-extra needs additional nf module

tested on 4.19-rc7

@rmilecki

This comment has been minimized.

Contributor

rmilecki commented Oct 8, 2018

Version isn't correct as 4.19.0 doesn't exist yet:
LINUX_VERSION-4.19 = .0
right now rc7 is the latest.

I tried 4.19-rc7 and patch from this Pull Request doesn't apply:

Applying /home/zajec/openwrt/openwrt-master-bcm53xx/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch using plaintext: 
patching file include/net/ip6_tunnel.h
patching file include/uapi/linux/if_tunnel.h
patching file net/ipv6/ip6_tunnel.c
Hunk #10 FAILED at 1447.
Hunk #11 succeeded at 1519 (offset 9 lines).
Hunk #12 succeeded at 1659 (offset 9 lines).
Hunk #13 succeeded at 1705 (offset 9 lines).
Hunk #14 succeeded at 2092 (offset 9 lines).
Hunk #15 succeeded at 2138 (offset 9 lines).
Hunk #16 succeeded at 2293 (offset 9 lines).
Hunk #17 succeeded at 2328 (offset 9 lines).
Hunk #18 succeeded at 2353 (offset 9 lines).
Hunk #19 succeeded at 2365 (offset 9 lines).
Hunk #20 succeeded at 2425 (offset 9 lines).
1 out of 20 hunks FAILED -- saving rejects to file net/ipv6/ip6_tunnel.c.rej
@lucize

This comment has been minimized.

Contributor

lucize commented Oct 8, 2018

anyhow you need to download the tar.gz and make it tar.xz, that patch I ignored, I tried to build on sunxi and is hangs at starting the kernel, x86_64 and x86 are working fine

and b53 driver also is not working

@rmilecki

This comment has been minimized.

Contributor

rmilecki commented Oct 8, 2018

anyhow you need to download the tar.gz and make it tar.xz

Please just fix it instead of requiring such workarounds.

@lucize

This comment has been minimized.

Contributor

lucize commented Oct 8, 2018

:) I think openwrt maintainers should allow multiple extensions searches on mirrors, I'm not the pr opener and there are not xz releases for rc on kernel.org

I just report things that I tried so anyone can prepare for what's to come if they try this

@rmilecki

This comment has been minimized.

Contributor

rmilecki commented Oct 8, 2018

files/drivers/net/phy/b53/ contains the swconfig driver for the Broadcom switches, the mainline kernel ships with the dsa based b53 driver which is based on the OpenWrt swconfig b53 driver. ;-)

We are still missing a good migration path for the old swocnfig configuration to the dsa configuration.

Correct. For now we have to keep swconfig based b53.

@rmilecki

This comment has been minimized.

Contributor

rmilecki commented Oct 8, 2018

:) I think openwrt maintainers should allow multiple extensions searches on mirrors, I'm not the pr opener and there are not xz releases for rc on kernel.org

I'm commenting on this Pull Request in general. Everyone is free to submit a fix and I believe it should be fixed before merging it.

@rmilecki

This comment has been minimized.

Contributor

rmilecki commented Oct 11, 2018

generic: split files according to kernel versions

Why do we need that? It's a rather big change, introduces code duplication and you didn't care to describe it at all.

@wigyori

This comment has been minimized.

Contributor

wigyori commented Oct 16, 2018

For the additional kmod changes (i.e. with CONFIG_ALL_KMODS), you can take a look at these:

https://git.openwrt.org/?p=openwrt/staging/wigyori.git;a=commit;h=5b0f7189182dacc2d46f8d04518c60f9b771e767
https://git.openwrt.org/?p=openwrt/staging/wigyori.git;a=commit;h=fd1a9de60e80f1a0335f329dbb9d267cdb6e129a
https://git.openwrt.org/?p=openwrt/staging/wigyori.git;a=commit;h=3738d2e3a2e0e7705f43e14bdb764b5f815e4253

Does not cover all kmods (I intentionally touched video.mk just barely, as that's a mess), but will help when collating all 4.19-related changes.

-w-

@sduponch

This comment has been minimized.

sduponch commented Oct 17, 2018

Some kmod dependency :
nf-nathelper-extra now need: asn1_decoder.ko
ipt-tproxy now need : nf_socket_ipv4.ko nf_tproxy_ipv4.ko nf_socket_ipv6.ko nf_tproxy_ipv6.ko

Dirty work around

diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk
index 109d1fd37b..88f17d07bc 100644
--- a/package/kernel/linux/modules/netfilter.mk
+++ b/package/kernel/linux/modules/netfilter.mk
@@ -539,7 +539,7 @@ define KernelPackage/nf-nathelper-extra
   KCONFIG:=$(KCONFIG_NF_NATHELPER_EXTRA)
   FILES:=$(foreach mod,$(NF_NATHELPER_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
   AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_NATHELPER_EXTRA-m)))
-  DEPENDS:=+kmod-nf-nat +kmod-lib-textsearch
+  DEPENDS:=+kmod-nf-nat +kmod-lib-textsearch +kmod-crypto-rsa
 endef
 
 define KernelPackage/nf-nathelper-extra/description
@@ -649,7 +649,11 @@ define KernelPackage/ipt-tproxy
        CONFIG_NETFILTER_XT_MATCH_SOCKET \
        CONFIG_NETFILTER_XT_TARGET_TPROXY
   FILES:= \
-       $(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko)
+       $(foreach mod,$(IPT_TPROXY-m),$(LINUX_DIR)/net/$(mod).ko) \
+       $(LINUX_DIR)/net/ipv4/netfilter/nf_socket_ipv4.ko \
+       $(LINUX_DIR)/net/ipv4/netfilter/nf_tproxy_ipv4.ko \
+       $(LINUX_DIR)/net/ipv6/netfilter/nf_socket_ipv6.ko \
+       $(LINUX_DIR)/net/ipv6/netfilter/nf_tproxy_ipv6.ko
   AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_TPROXY-m)))
   $(call AddDepends/ipt)
 endef
@sduponch

This comment has been minimized.

sduponch commented Oct 22, 2018

Looks like the 4.19 leave the rc stage, one small change in 666-Add-support-for-MAP-E-FMRs-mesh-mode.patch :

diff --git a/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index 646bcfa6bb..fecbaf2216 100644
--- a/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -303,7 +303,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
 @@ -1307,6 +1447,7 @@
  {
  	struct ip6_tnl *t = netdev_priv(dev);
- 	struct ipv6hdr *ipv6h = ipv6_hdr(skb);
+ 	struct ipv6hdr *ipv6h;
 +	struct __ip6_tnl_fmr *fmr;
  	int encap_limit = -1;
  	__u16 offset;
@thagabe

This comment has been minimized.

Contributor

thagabe commented Oct 22, 2018

Kernel 4.19 is now live!

luaraneda added a commit to luaraneda/openwrt that referenced this pull request Nov 3, 2018

packages: add fixes for netfilter from openwrt#1386
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>

ratkaj added some commits Sep 18, 2018

generic: split files according to kernel versions
Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
generic: add kernel 4.19 support
This will add support for kernel 4.19 based on patches for kernel 4.14.

Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
kernel-version.mk: add kernel 4.19 support
Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
mvebu: add kernel 4.19 support
Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
include: netfilter: prepare for kernel 4.19
With kernel 4.19 kernel module nf_conntrack_ipv6 no longer exists.
Instead, nf_conntrack module handles both IPv4 and IPv6 and it now
depends on nf_defrag_ipv6. This patch adds a version check to properly
handle this.

Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
modules: leds: prepare for kernel 4.19
Location of ledtrig-netdev.ko module changed from ./drivers/leds/ to
./drivers/leds/trigger/ with kernel 4.19. With this patch we preserve
compatibility with older kernels.

Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
mvebu: switch to kernel 4.19 by default
Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>

@ratkaj ratkaj force-pushed the sartura:initial_kernel_4.19_support branch from 008fb85 to 7ab133a Nov 6, 2018

@ratkaj

This comment has been minimized.

Contributor

ratkaj commented Nov 6, 2018

Sry for the long absence, work was killing me with the summit and everything else

I updated the pull request. Changelog:
1.) Fixed for kernel 4.19.1, no more need for manual tarball magic
2.) Added my mvebu target patches for 4.19, testing on ClearFog Base

That being said, this still seems to be far from good.

If we keep the swconfig based b53 than splitting target/linux/generic files might not have been necessary which is great. But, some files like these below should not be added to 4.19 as they are already present in the kernel (more up to date versions)

drivers/leds/ledtrig-netdev.c
drivers/net/phy/rtl8366rb.c

Adding them breaks things. Not sure how to handle this in a better way than splitting target/linux/generic/files.

Many kmods are still broken... I'll start fixing them and adding changes by @wigyori
I know it's a mess but i hope this work will help someone out and speed things up. My schedule opened up so ill be on this more from now.

@luaraneda

This comment has been minimized.

Contributor

luaraneda commented Nov 6, 2018

@hauke is working on 4.19 support on his staging tree branch kernel-4.19
From what I can see, he started with your patches but made major modifications.

I'm working on ipq40xx and zynq patches in the meantime.

@robimarko

This comment has been minimized.

Contributor

robimarko commented Nov 6, 2018

@luaraneda I did some work on ipq40xx, mainly removing upstreamed patches and updating patches to match the stuff upstreamed in 4.20.
Also, I switched the common W25N01GV SPI NAND to use the new SPI NAND framework.
The only thing that was not working was ethernet as timers had incompatible changes in 4.15.

So if its any help you can find it here:
https://github.com/robimarko/openwrt/tree/initial_kernel_4.19_support

@luaraneda

This comment has been minimized.

Contributor

luaraneda commented Nov 7, 2018

@robimarko Thanks for the link. I already have the patches categorized and removed the upstreamed ones, but your work will be useful anyway :)
With this PR, and without doing the SPI NAND work that you did, I was able to reproduce the Ethernet driver you mention. With @hauke 's branch, which is still WIP, I'm having other compilation problems (nf_conntrack).

More information about the Ethernet driver:

  • patch: 710-net-add-qualcomm-essedma-ethernet-driver.patch
  • init_timer() was removed by kernel 4.15 (commit 7eeb6b893bd28c68b6d664de1d3120e49b855cdb)
  • Improving the kernel timers API: https://lwn.net/Articles/735887/

I think the conversion to the new timer API should not be that hard. I'll give it a try if/when I have some time.

If your interested, my work is at:
https://github.com/luaraneda/openwrt/tree/k4.19-ipq40xx

@sduponch

This comment has been minimized.

sduponch commented Nov 7, 2018

For @hauke's branch, to solve nf_contrack probleme :

diff --git a/include/netfilter.mk b/include/netfilter.mk
index a265c93f3e..7d85bdf569 100644
--- a/include/netfilter.mk
+++ b/include/netfilter.mk
@@ -70,6 +70,7 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_CONNTRACK, $(P_XT)nf
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_CONNTRACK_RTCACHE, $(P_XT)nf_conntrack_rtcache),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_DEFRAG_IPV4, $(P_V4)nf_defrag_ipv4),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_CONNTRACK_IPV4, $(P_V4)nf_conntrack_ipv4),))
+$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6),))
 
 $(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_MATCH_STATE, $(P_XT)xt_state))
 $(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_TARGET_CT, $(P_XT)xt_CT))
@@ -157,7 +158,6 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NF_REJECT6,CONFIG_NF_REJECT_IPV6, $(P_V6)nf
 
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_IPT6,CONFIG_IP6_NF_IPTABLES, $(P_V6)ip6_tables),))
 
-$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_DEFRAG_IPV6, $(P_V6)nf_defrag_ipv6),))
 $(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNTRACK6,CONFIG_NF_CONNTRACK_IPV6, $(P_V6)nf_conntrack_ipv6),))
 
 $(eval $(if $(NF_KMOD),$(call nf_add,IPT_IPV6,CONFIG_IP6_NF_FILTER, $(P_V6)ip6table_filter),))
@clementperon

This comment has been minimized.

clementperon commented Nov 15, 2018

for ipq40xx essedma a Patch like this :

Moved the edma_stats_timer into the edma_cinfo struct
And use new timer API, I'm not confortable with the container_of some maybe this is wrong no?

+	struct edma_rfs_flow_table *table = from_timer(table, t, expire_rfs);
+	struct edma_adapter *adapter =
+		container_of(table, typeof(*adapter), rfs);

Full patch

---
 drivers/net/ethernet/qualcomm/essedma/edma.c   | 10 +++++-----
 drivers/net/ethernet/qualcomm/essedma/edma.h   |  3 ++-
 .../net/ethernet/qualcomm/essedma/edma_axi.c   | 18 +++++++-----------
 3 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/essedma/edma.c b/drivers/net/ethernet/qualcomm/essedma/edma.c
index 6d7731d1d018..9c2bc306bbda 100644
--- a/drivers/net/ethernet/qualcomm/essedma/edma.c
+++ b/drivers/net/ethernet/qualcomm/essedma/edma.c
@@ -844,9 +844,7 @@ static void edma_initialise_rfs_flow_table(struct edma_adapter *adapter)
 	adapter->rfs.hashtoclean = 0;
 
 	/* Add timer to get periodic RFS updates from OS */
-	init_timer(&adapter->rfs.expire_rfs);
-	adapter->rfs.expire_rfs.function = edma_flow_may_expire;
-	adapter->rfs.expire_rfs.data = (unsigned long)adapter;
+	timer_setup(&adapter->rfs.expire_rfs, edma_flow_may_expire, 0);
 	mod_timer(&adapter->rfs.expire_rfs, jiffies + HZ / 4);
 }
 
@@ -1422,9 +1420,11 @@ netdev_tx_t edma_xmit(struct sk_buff *skb,
  * edma_flow_may_expire()
  * 	Timer function called periodically to delete the node
  */
-void edma_flow_may_expire(unsigned long data)
+void edma_flow_may_expire(struct timer_list *t)
 {
-	struct edma_adapter *adapter = (struct edma_adapter *)data;
+	struct edma_rfs_flow_table *table = from_timer(table, t, expire_rfs);
+	struct edma_adapter *adapter =
+		container_of(table, typeof(*adapter), rfs);
 	int j;
 
 	spin_lock_bh(&adapter->rfs.rfs_ftab_lock);
diff --git a/drivers/net/ethernet/qualcomm/essedma/edma.h b/drivers/net/ethernet/qualcomm/essedma/edma.h
index 6406e3279e89..ddfa6b8dfc4c 100644
--- a/drivers/net/ethernet/qualcomm/essedma/edma.h
+++ b/drivers/net/ethernet/qualcomm/essedma/edma.h
@@ -331,6 +331,7 @@ struct edma_common_info {
 	struct edma_hw hw; /* edma hw specific structure */
 	struct edma_per_cpu_queues_info edma_percpu_info[CONFIG_NR_CPUS]; /* per cpu information */
 	spinlock_t stats_lock; /* protect edma stats area for updation */
+	struct timer_list edma_stats_timer;
 };
 
 /* transimit packet descriptor (tpd) ring */
@@ -431,7 +432,7 @@ int edma_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
 		u16 rxq, u32 flow_id);
 int edma_register_rfs_filter(struct net_device *netdev,
 		set_rfs_filter_callback_t set_filter);
-void edma_flow_may_expire(unsigned long data);
+void edma_flow_may_expire(struct timer_list *t);
 void edma_set_ethtool_ops(struct net_device *netdev);
 void edma_set_stp_rstp(bool tag);
 void edma_assign_ath_hdr_type(int tag);
diff --git a/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
index c97aa6ab8c69..a6a98238d621 100644
--- a/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
+++ b/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
@@ -32,8 +32,6 @@ static const u32 default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
 
 static u32 edma_hw_addr;
 
-struct timer_list edma_stats_timer;
-
 char edma_tx_irq[16][64];
 char edma_rx_irq[8][64];
 struct net_device *edma_netdev[EDMA_MAX_PORTID_SUPPORTED];
@@ -159,13 +157,14 @@ void edma_read_append_stats(struct edma_common_info *edma_cinfo)
 	spin_unlock(&edma_cinfo->stats_lock);
 }
 
-static void edma_statistics_timer(unsigned long data)
+static void edma_statistics_timer(struct timer_list *t)
 {
-	struct edma_common_info *edma_cinfo = (struct edma_common_info *)data;
+	struct edma_common_info *edma_cinfo =
+		from_timer(edma_cinfo, t, edma_stats_timer);
 
 	edma_read_append_stats(edma_cinfo);
 
-	mod_timer(&edma_stats_timer, jiffies + 1*HZ);
+	mod_timer(&edma_cinfo->edma_stats_timer, jiffies + 1*HZ);
 }
 
 static int edma_enable_stp_rstp(struct ctl_table *table, int write,
@@ -1098,11 +1097,8 @@ static int edma_axi_probe(struct platform_device *pdev)
 
 	spin_lock_init(&edma_cinfo->stats_lock);
 
-	init_timer(&edma_stats_timer);
-	edma_stats_timer.expires = jiffies + 1*HZ;
-	edma_stats_timer.data = (unsigned long)edma_cinfo;
-	edma_stats_timer.function = edma_statistics_timer; /* timer handler */
-	add_timer(&edma_stats_timer);
+	timer_setup(&edma_cinfo->edma_stats_timer, edma_statistics_timer, 0);
+	mod_timer(&edma_cinfo->edma_stats_timer, jiffies + 1*HZ);
 
 	return 0;
 
@@ -1182,7 +1178,7 @@ static int edma_axi_remove(struct platform_device *pdev)
 			phy_disconnect(adapter->phydev);
 	}
 
-	del_timer_sync(&edma_stats_timer);
+	del_timer_sync(&edma_cinfo->edma_stats_timer);
 	edma_free_irqs(adapter);
 	unregister_net_sysctl_table(edma_cinfo->edma_ctl_table_hdr);
 	edma_free_tx_resources(edma_cinfo);
-- 


@mirlang

This comment has been minimized.

mirlang commented Nov 19, 2018

additionally xt_connlimit.ko (from kmod-ipt-conntrack-extra) depends now on nf_conncount.ko

add-nf_conncount-as-dependency-for-ipt-conntrack-extra.txt

@sduponch

This comment has been minimized.

sduponch commented Nov 20, 2018

Hi @hauke,

The patch "backport-4.19/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch" is breaking the 4.19 build, a new version of the patch can be found here :
https://patchwork.ozlabs.org/patch/994525/

In addition, i have remove "mtd" patches: 161,400,402,403,404,411,412 to fulfill the kernel build.

Best regards,
DUPONCHEEL Sébastien.

@robimarko

This comment has been minimized.

Contributor

robimarko commented Nov 30, 2018

@clementperon I can confirm that your patch works under 4.19.5
Thanks

@diizzyy

This comment has been minimized.

@hauke

This comment has been minimized.

Member

hauke commented Dec 15, 2018

Support for kernel 4.19 was merged today , please create a new pull request to add kernel 4.19 support to mvebu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment