Skip to content

Extended netfilter support - #118

Merged
KraPete merged 1 commit into
feature/add_l2tp_supportfrom
feature/nft
Dec 15, 2022
Merged

Extended netfilter support#118
KraPete merged 1 commit into
feature/add_l2tp_supportfrom
feature/nft

Conversation

@KraPete

@KraPete KraPete commented Dec 12, 2022

Copy link
Copy Markdown
Contributor

Добавил недостающие модули для netfilter, чтобы NAT работал

@KraPete
KraPete requested a review from vdromanov December 12, 2022 05:29
@sikmir

sikmir commented Dec 12, 2022

Copy link
Copy Markdown
Contributor

А что именно сейчас не работает? Просто я NAT использую и вроде все работает.

@vdromanov

Copy link
Copy Markdown
Contributor

А что именно сейчас не работает? Просто я NAT использую и вроде все работает.

до Петра
2022-12-15_16-10-47

после Петра
2022-12-15_16-21-29

@KraPete
KraPete merged commit 2a7d938 into feature/add_l2tp_support Dec 15, 2022
@KraPete
KraPete deleted the feature/nft branch December 15, 2022 14:19
vdromanov added a commit that referenced this pull request Dec 19, 2022
* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>
evgeny-boger pushed a commit that referenced this pull request Mar 26, 2024
…onfig

WB5, WB6 defconfigs: Remove CONFIG_SMP - kernel default is off.

WB6: Add CONFIG_GPIO_MXC, CONFIG_GPIO_GENERIC_PLATFORM.
CONFIG_GPIO_MXC changed from def_bool y to tristate "i.MX GPIO support".
Default value is now false. Change it to 'y' in imx6_wirenboard_defconfig.

Cleanup via savedefconfig.

arch/arm/configs: *defconfig: Enable CONFIG_PINCTRL_MCP23S08=m

arch/arm/configs: *defconfig: Enable CONFIG_MCP4728=m

TODO: Debug. WB5, WB6: Enable AD5064/LTC2637 and MCP4728 in-kernel.

На ядре 5.8.9 не выполняется автоматическая загрузка драйверов i2c, если они
разрешены как модули, причину надо найти.
Временное решение - разрешить их как часть ядра.
Помогает также ручной вызов modprobe, если он идет перед probe контроллера i2c.

CONFIG_AD5064=y
CONFIG_MCP4728=y

arch/arm/configs: WB5, WB6 defconfig: enable CONFIG_LEDS_TRIGGER_DEFAULT_OFF=y

add rtl8xxxu to defconfig file

(cherry picked from commit 192e6ef)
(cherry picked from commit b72550c)

arch/arm/configs: WB5, WB6 defconfig: Add CONFIG_OF_CONFIGFS=y

Enable configfs overlays.

wb6: enable full 1G/3G memory split for 1GB models

arch/arm/configs: WB5, WB6 defconfig: Enable CONFIG_RTL8723BU=m

CONFIG_NVMEM_IMX_OCOTP=y

LIRC and SC16IS7XX are included into wb6 defconfig

wb7: initial defconfig

ARM: config: wb7: disable graphics and unused drivers

wb7: add defconfig for initramfs

wb6, wb7: added rtc-rv8803 driver to defconfig (#84)

* wb6, wb7: added rtc-rv8803 driver to defconfig as a module

wb6: fix bootlet configuration and MMC pinctrl config (#89)

This commit fixes USB bootlet kernel:

    - fix kernel panic on g_mass_storage module removing
    by making configfs included (not as module);
    - fix LEDs by enabling PWM driver for i.MX6

Also it adds missing eMMC lanes pinctrls. Looks like it worked earlier
because Boot ROM initialized these pins (didn't work on USB boot though).

wb7: add missing drivers similar to wb6 (#90)

fec: use ethFECX interface names to reorder them in userspace (#97)

Interface name swapping (eth0<->eth1) is broken in Debian bullseye
because of the missing systemd patch from Debian maintainers
(which was available in stretch).

Ethernet interfaces enumeration is performed in the order they are
defined in the device tree. For imx6ul, FEC2 goes before FEC1.

Instead of changing the order in the device tree (in common file for
many device trees), we decided to change the interface name template in
FEC driver from ethX to ethFECX.

This feature can be disabled in the kernel config.

wb7: enable SYSVIPC config option (#98)

This config option enables System V IPC functions
(like shared memory access, semaphores, message queues and so on).
As it turned out, these functions are used by some of our customers.

wb: add AF_KCM option to enable Docker on Debian 11

add bunch of config options for Docker

as suggested by ./check-config.sh

also enable wireguard and bonding core network drivers

wb: Kconfig: add modules for ipsec support (#117)

* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>

wb7-initramfs: remove all unused USB gadget features (#123)

wb6_defconfig: add nft nat support (#126)

wb: adddefconfig for SoM testing

defconfig: wb7 mdio bitbang

defconfig: wb7: enable exfat support (module) in defconfig

defconfig: add wb7min defconfig

minimum configuration w/o Wi-Fi and with everything compiled in kernel.

wb6: initramfs: add missing GPIO driver to defconfig + actualize

defconfig: wb7: add wbec drivers

ARM: config: wb7: add wbec and SD3078 drivers, remove AXP pwrkey driver

defconfig: wb7: enable rtl8733bu

fix defconfig: add wb7min defconfig
taraant pushed a commit that referenced this pull request May 16, 2025
* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>
taraant pushed a commit that referenced this pull request May 19, 2025
* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>
taraant pushed a commit that referenced this pull request Jun 9, 2025
* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>
taraant pushed a commit that referenced this pull request Jul 24, 2025
commit a05dd8a upstream.

Following softlockup can be easily reproduced on my test machine with:

echo always > /sys/kernel/mm/transparent_hugepage/hugepages-64kB/enabled
swapon /dev/zram0 # zram0 is a 48G swap device
mkdir -p /sys/fs/cgroup/memory/test
echo 1G > /sys/fs/cgroup/test/memory.max
echo $BASHPID > /sys/fs/cgroup/test/cgroup.procs
while true; do
    dd if=/dev/zero of=/tmp/test.img bs=1M count=5120
    cat /tmp/test.img > /dev/null
    rm /tmp/test.img
done

Then after a while:
watchdog: BUG: soft lockup - CPU#0 stuck for 763s! [cat:5787]
Modules linked in: zram virtiofs
CPU: 0 UID: 0 PID: 5787 Comm: cat Kdump: loaded Tainted: G             L      6.15.0.orig-gf3021d9246bc-dirty #118 PREEMPT(voluntary)·
Tainted: [L]=SOFTLOCKUP
Hardware name: Red Hat KVM/RHEL-AV, BIOS 0.0.0 02/06/2015
RIP: 0010:mpol_shared_policy_lookup+0xd/0x70
Code: e9 b8 b4 ff ff 31 c0 c3 cc cc cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 0f 1f 44 00 00 41 54 55 53 <48> 8b 1f 48 85 db 74 41 4c 8d 67 08 48 89 fb 48 89 f5 4c 89 e7 e8
RSP: 0018:ffffc90002b1fc28 EFLAGS: 00000202
RAX: 00000000001c20ca RBX: 0000000000724e1e RCX: 0000000000000001
RDX: ffff888118e214c8 RSI: 0000000000057d42 RDI: ffff888118e21518
RBP: 000000000002bec8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000bf4 R11: 0000000000000000 R12: 0000000000000001
R13: 00000000001c20ca R14: 00000000001c20ca R15: 0000000000000000
FS:  00007f03f995c740(0000) GS:ffff88a07ad9a000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f03f98f1000 CR3: 0000000144626004 CR4: 0000000000770eb0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
 <TASK>
 shmem_alloc_folio+0x31/0xc0
 shmem_swapin_folio+0x309/0xcf0
 ? filemap_get_entry+0x117/0x1e0
 ? xas_load+0xd/0xb0
 ? filemap_get_entry+0x101/0x1e0
 shmem_get_folio_gfp+0x2ed/0x5b0
 shmem_file_read_iter+0x7f/0x2e0
 vfs_read+0x252/0x330
 ksys_read+0x68/0xf0
 do_syscall_64+0x4c/0x1c0
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f03f9a46991
Code: 00 48 8b 15 81 14 10 00 f7 d8 64 89 02 b8 ff ff ff ff eb bd e8 20 ad 01 00 f3 0f 1e fa 80 3d 35 97 10 00 00 74 13 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 4f c3 66 0f 1f 44 00 00 55 48 89 e5 48 83 ec
RSP: 002b:00007fff3c52bd28 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000040000 RCX: 00007f03f9a46991
RDX: 0000000000040000 RSI: 00007f03f98ba000 RDI: 0000000000000003
RBP: 00007fff3c52bd50 R08: 0000000000000000 R09: 00007f03f9b9a380
R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000040000
R13: 00007f03f98ba000 R14: 0000000000000003 R15: 0000000000000000
 </TASK>

The reason is simple, readahead brought some order 0 folio in swap cache,
and the swapin mTHP folio being allocated is in conflict with it, so
swapcache_prepare fails and causes shmem_swap_alloc_folio to return
-EEXIST, and shmem simply retries again and again causing this loop.

Fix it by applying a similar fix for anon mTHP swapin.

The performance change is very slight, time of swapin 10g zero folios
with shmem (test for 12 times):
Before:  2.47s
After:   2.48s

[kasong@tencent.com: add comment]
  Link: https://lkml.kernel.org/r/20250610181645.45922-1-ryncsn@gmail.com
Link: https://lkml.kernel.org/r/20250610181645.45922-1-ryncsn@gmail.com
Link: https://lkml.kernel.org/r/20250609171751.36305-1-ryncsn@gmail.com
Fixes: 1dd44c0 ("mm: shmem: skip swapcache for swapin of synchronous swap device")
Signed-off-by: Kairui Song <kasong@tencent.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
taraant pushed a commit that referenced this pull request Jul 29, 2025
commit a05dd8a upstream.

Following softlockup can be easily reproduced on my test machine with:

echo always > /sys/kernel/mm/transparent_hugepage/hugepages-64kB/enabled
swapon /dev/zram0 # zram0 is a 48G swap device
mkdir -p /sys/fs/cgroup/memory/test
echo 1G > /sys/fs/cgroup/test/memory.max
echo $BASHPID > /sys/fs/cgroup/test/cgroup.procs
while true; do
    dd if=/dev/zero of=/tmp/test.img bs=1M count=5120
    cat /tmp/test.img > /dev/null
    rm /tmp/test.img
done

Then after a while:
watchdog: BUG: soft lockup - CPU#0 stuck for 763s! [cat:5787]
Modules linked in: zram virtiofs
CPU: 0 UID: 0 PID: 5787 Comm: cat Kdump: loaded Tainted: G             L      6.15.0.orig-gf3021d9246bc-dirty #118 PREEMPT(voluntary)·
Tainted: [L]=SOFTLOCKUP
Hardware name: Red Hat KVM/RHEL-AV, BIOS 0.0.0 02/06/2015
RIP: 0010:mpol_shared_policy_lookup+0xd/0x70
Code: e9 b8 b4 ff ff 31 c0 c3 cc cc cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f 00 0f 1f 44 00 00 41 54 55 53 <48> 8b 1f 48 85 db 74 41 4c 8d 67 08 48 89 fb 48 89 f5 4c 89 e7 e8
RSP: 0018:ffffc90002b1fc28 EFLAGS: 00000202
RAX: 00000000001c20ca RBX: 0000000000724e1e RCX: 0000000000000001
RDX: ffff888118e214c8 RSI: 0000000000057d42 RDI: ffff888118e21518
RBP: 000000000002bec8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000bf4 R11: 0000000000000000 R12: 0000000000000001
R13: 00000000001c20ca R14: 00000000001c20ca R15: 0000000000000000
FS:  00007f03f995c740(0000) GS:ffff88a07ad9a000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f03f98f1000 CR3: 0000000144626004 CR4: 0000000000770eb0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
 <TASK>
 shmem_alloc_folio+0x31/0xc0
 shmem_swapin_folio+0x309/0xcf0
 ? filemap_get_entry+0x117/0x1e0
 ? xas_load+0xd/0xb0
 ? filemap_get_entry+0x101/0x1e0
 shmem_get_folio_gfp+0x2ed/0x5b0
 shmem_file_read_iter+0x7f/0x2e0
 vfs_read+0x252/0x330
 ksys_read+0x68/0xf0
 do_syscall_64+0x4c/0x1c0
 entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7f03f9a46991
Code: 00 48 8b 15 81 14 10 00 f7 d8 64 89 02 b8 ff ff ff ff eb bd e8 20 ad 01 00 f3 0f 1e fa 80 3d 35 97 10 00 00 74 13 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 4f c3 66 0f 1f 44 00 00 55 48 89 e5 48 83 ec
RSP: 002b:00007fff3c52bd28 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 0000000000040000 RCX: 00007f03f9a46991
RDX: 0000000000040000 RSI: 00007f03f98ba000 RDI: 0000000000000003
RBP: 00007fff3c52bd50 R08: 0000000000000000 R09: 00007f03f9b9a380
R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000040000
R13: 00007f03f98ba000 R14: 0000000000000003 R15: 0000000000000000
 </TASK>

The reason is simple, readahead brought some order 0 folio in swap cache,
and the swapin mTHP folio being allocated is in conflict with it, so
swapcache_prepare fails and causes shmem_swap_alloc_folio to return
-EEXIST, and shmem simply retries again and again causing this loop.

Fix it by applying a similar fix for anon mTHP swapin.

The performance change is very slight, time of swapin 10g zero folios
with shmem (test for 12 times):
Before:  2.47s
After:   2.48s

[kasong@tencent.com: add comment]
  Link: https://lkml.kernel.org/r/20250610181645.45922-1-ryncsn@gmail.com
Link: https://lkml.kernel.org/r/20250610181645.45922-1-ryncsn@gmail.com
Link: https://lkml.kernel.org/r/20250609171751.36305-1-ryncsn@gmail.com
Fixes: 1dd44c0 ("mm: shmem: skip swapcache for swapin of synchronous swap device")
Signed-off-by: Kairui Song <kasong@tencent.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
taraant pushed a commit that referenced this pull request Jul 29, 2025
* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>
taraant pushed a commit that referenced this pull request Oct 31, 2025
* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>
taraant pushed a commit that referenced this pull request Apr 14, 2026
* wb: Kconfig: add modules for ipsec support

* Extended netfilter support (#118)

* add nftables to changelog

Co-authored-by: KraPete <86825564+KraPete@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants