* Re: [PATCH V2 5/6] rtlwifi: btcoexist: Add routines for RTL8812AE kernel socket communications
From: Marcel Holtmann @ 2015-01-30 9:57 UTC (permalink / raw)
To: Kalle Valo
Cc: Larry Finger, linux-wireless-u79uwXL29TY76Z2rM5mHXA, Troy Tan,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <87h9v8zkuh.fsf-HodKDYzPHsUD5k0oWYwrnHL1okKdlPRT@public.gmane.org>
Hi Kalle,
> I'm adding bluetooth list to the discussion. Full patch is available
> here:
>
> https://patchwork.kernel.org/patch/5712591/
>
> Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org> writes:
>
>> From: Troy Tan <troy_tan-kXabqFNEczNtrwSWzY7KCg@public.gmane.org>
>>
>> This patch adds the routines used to communicate between the RTL8812AE (wifi)
>> device and the RTL8761AU (bluetooth) device that are part of the same chip.
>> Unlike other similar dual-function devices, this chip does not contain special
>> hardware that lets the firmware pass coexistence info from one part to the
>> other. As a result, this driver implements such communication as a kernel
>> socket.
>>
>> Signed-off-by: Troy Tan <troy_tan-kXabqFNEczNtrwSWzY7KCg@public.gmane.org>
>> Signed-off-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
>> ---
>> V2 - Add comments explaining the routine that sends a message via the
>> socket.
>
> The commit log is not still explaining that much about the actual
> functionality, so I investigated on my own:
>
>> +static u8 rtl_btcoex_create_kernel_socket(struct rtl_priv *rtlpriv,
>> + u8 is_invite)
>> +{
>> + struct bt_coex_info *pcoex_info = &rtlpriv->coex_info;
>> + s8 kernel_socket_err;
>> +
>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>> + "%s CONNECT_PORT %d\n", __func__, CONNECT_PORT);
>> +
>> + if (!pcoex_info) {
>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL, "coex_info: NULL\n");
>> + return _FAIL;
>> + }
>> +
>> + kernel_socket_err = sock_create(PF_INET, SOCK_DGRAM, 0,
>> + &pcoex_info->udpsock);
>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>> + "binding socket, err = %d\n", kernel_socket_err);
>> +
>> + if (kernel_socket_err < 0) {
>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>> + "Error during creation of socket error:%d\n",
>> + kernel_socket_err);
>> + return _FAIL;
>> + }
>> + memset(&pcoex_info->sin, 0, sizeof(pcoex_info->sin));
>> + pcoex_info->sin.sin_family = AF_INET;
>> + pcoex_info->sin.sin_port = htons(CONNECT_PORT);
>> + pcoex_info->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
>> +
>> + memset(&pcoex_info->bt_addr, 0, sizeof(pcoex_info->bt_addr));
>> + pcoex_info->bt_addr.sin_family = AF_INET;
>> + pcoex_info->bt_addr.sin_port = htons(CONNECT_PORT_BT);
>> + pcoex_info->bt_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
>> +
>> + pcoex_info->sk_store = NULL;
>> +
>> + kernel_socket_err =
>> + pcoex_info->udpsock->ops->bind(pcoex_info->udpsock,
>> + (struct sockaddr *)&pcoex_info->sin,
>> + sizeof(pcoex_info->sin));
>> + if (kernel_socket_err == 0) {
>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>> + "binding socket success\n");
>> + pcoex_info->udpsock->sk->sk_data_ready =
>> + rtl_btcoex_recvmsg_int;
>> + pcoex_info->sock_open |= KERNEL_SOCKET_OK;
>> + pcoex_info->bt_attend = false;
>> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
>> + "WIFI sending attend_req\n");
>> + rtl_btcoex_sendmsgbysocket(rtlpriv, attend_req,
>> + sizeof(attend_req), true);
>> + return _SUCCESS;
>
> So the wireless driver communicates with the bluetooth driver (which is
> not in upstream) via a localhost UDP connection?
I think the first order of business should be to get the Bluetooth driver upstream. Until that has happened this is all kinda pointless discussion.
>> +#define CONNECT_PORT 30000
>> +#define CONNECT_PORT_BT 30001
>
> And these are the UDP ports used.
>
>> +struct hci_link_info {
>> + u16 connect_handle;
>> + u8 incoming_traffic_mode;
>> + u8 outgoing_traffic_mode;
>> + u8 bt_profile;
>> + u8 bt_corespec;
>> + s8 bt_RSSI;
>> + u8 traffic_profile;
>> + u8 link_role;
>> +};
>> +
>> +#define MAX_BT_ACL_LINK_NUM 8
>> +
>> +struct hci_ext_config {
>> + struct hci_link_info acl_link[MAX_BT_ACL_LINK_NUM];
>> + u8 bt_operation_code;
>> + u16 current_connect_handle;
>> + u8 current_incoming_traffic_mode;
>> + u8 current_outgoing_traffic_mode;
>> +
>> + u8 number_of_acl;
>> + u8 number_of_sco;
>> + u8 current_bt_status;
>> + u16 hci_ext_ver;
>> + bool enable_wifi_scan_notify;
>> +};
>
> [...]
>
>> +enum HCI_STATUS {
>> + /* Success */
>> + HCI_STATUS_SUCCESS = 0x00,
>> + /* Unknown HCI Command */
>> + HCI_STATUS_UNKNOW_HCI_CMD = 0x01,
>> + /* Unknown Connection Identifier */
>> + HCI_STATUS_UNKNOW_CONNECT_ID = 0X02,
>> + /* Hardware Failure */
>> + HCI_STATUS_HW_FAIL = 0X03,
>> + /* Page Timeout */
>> + HCI_STATUS_PAGE_TIMEOUT = 0X04,
>> + /* Authentication Failure */
>> + HCI_STATUS_AUTH_FAIL = 0X05,
>> + /* PIN or Key Missing */
>> + HCI_STATUS_PIN_OR_KEY_MISSING = 0X06,
>> + /* Memory Capacity Exceeded */
>> + HCI_STATUS_MEM_CAP_EXCEED = 0X07,
>> + /* Connection Timeout */
>> + HCI_STATUS_CONNECT_TIMEOUT = 0X08,
>> + /* Connection Limit Exceeded */
>
> And here's part of the information exchanged between the drivers.
>
> This is something which needs to be properly reviewed both in wireless
> and bluetooth lists, a wireless driver cannot just invent these on their
> own. And using UDP sockets for this is in my opinion just horrible.
>
> I know there's a general need for something similar like this, but it
> needs to properly discussed and designed.
This is just insane. Clear NAK.
Two kernel modules will not use UDP ports over the loopback interface to communicate with each other.
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 0/6 net-next] rhashtable fixes
From: Ying Xue @ 2015-01-30 9:56 UTC (permalink / raw)
To: Thomas Graf; +Cc: davem, netdev
In-Reply-To: <20150130092911.GA2313@casper.infradead.org>
On 01/30/2015 05:29 PM, Thomas Graf wrote:
> On 01/30/15 at 05:10pm, Ying Xue wrote:
>> Hi Thomas,
>>
>> I make sure that my local net-next tree is synchronized to the latest
>> version in which the commit fe6a043c535acfec8f8e554536c87923dcb45097
>> ("rhashtable: rhashtable_remove() must unlink in both tbl and
>> future_tbl") is already contained, and then I manually applied the whole
>> series patches. But when I repeatedly run the test case I originally
>> posted, soft lockup happens. Please see its relevant log:
>
> Right, I see the same soft lockup. Interestingly I cannot trigger it
> with the rht test code. I can only trigger it with your Netlink socket
> creation stress test. It is definitely related to the deferred worker,
> when I disable growing, then the bug disappears.
Yes, when I disable expansion, the soft lockup also disappears too.
I think that the
> expansion leaves a race open in which remove cannot find certain entries
> (I verified this by adding a BUG_ON() when rhashtable_remove() could not
> find a match). This then keeps an entry on the list which has already
> been freed.
>
> However, I think this was present before these fixes but hidden as the
> lockup requires a lot more iterations of your stress test on my
> machine.
>
If you need to some verification for your new patches or do some
experiments, please let me know, and I can help to do them.
Regards,
Ying
^ permalink raw reply
* Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Mugunthan V N @ 2015-01-30 9:56 UTC (permalink / raw)
To: Murali Karicheri, w-kwok2, davem, tony, prabhakar.csengg,
grygorii.strashko, lokeshvutla, mpa, lsorense, netdev,
linux-kernel, arnd
In-Reply-To: <54CB3E53.8050307@ti.com>
On Friday 30 January 2015 01:48 PM, Mugunthan V N wrote:
> On Friday 30 January 2015 04:45 AM, Murali Karicheri wrote:
>> NetCP on Keystone has cpsw ale function similar to other TI SoCs
>> and this driver is re-used. To allow both ti cpsw and keystone netcp
>> to re-use the driver, convert the cpsw ale to a module and configure
>> it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
>> linked to both TI CPSW and NetCP and this causes issues when the above
>> drivers are built as dynamic modules. This patch addresses this issue
>>
>> While at it, fix the Makefile and code to build both netcp_core and
>> netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
>> This also requires exporting of API calls provided by netcp_core so that
>> both the above can be dynamic modules.
>>
>> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
>
> Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
>
> Will try to test this today/Monday.
>
>
I have tested this on DRA7 platform and passed tested ping.
Tested-by: Mugunthan V N <mugunthanvnm@ti.com>
Regards
Mugunthan V N
^ permalink raw reply
* Re: [PATCH 0/6 net-next] rhashtable fixes
From: Thomas Graf @ 2015-01-30 9:29 UTC (permalink / raw)
To: Ying Xue; +Cc: davem, netdev
In-Reply-To: <54CB4A95.9060000@windriver.com>
On 01/30/15 at 05:10pm, Ying Xue wrote:
> Hi Thomas,
>
> I make sure that my local net-next tree is synchronized to the latest
> version in which the commit fe6a043c535acfec8f8e554536c87923dcb45097
> ("rhashtable: rhashtable_remove() must unlink in both tbl and
> future_tbl") is already contained, and then I manually applied the whole
> series patches. But when I repeatedly run the test case I originally
> posted, soft lockup happens. Please see its relevant log:
Right, I see the same soft lockup. Interestingly I cannot trigger it
with the rht test code. I can only trigger it with your Netlink socket
creation stress test. It is definitely related to the deferred worker,
when I disable growing, then the bug disappears. I think that the
expansion leaves a race open in which remove cannot find certain entries
(I verified this by adding a BUG_ON() when rhashtable_remove() could not
find a match). This then keeps an entry on the list which has already
been freed.
However, I think this was present before these fixes but hidden as the
lockup requires a lot more iterations of your stress test on my
machine.
^ permalink raw reply
* Re: [PATCH 9/9] netfilter: nf_tables: add support for dynamic set updates
From: Herbert Xu @ 2015-01-30 9:28 UTC (permalink / raw)
To: Patrick McHardy
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-10-git-send-email-kaber@trash.net>
On Fri, Jan 30, 2015 at 07:46:34AM +0000, Patrick McHardy wrote:
> Signed-off-by: Patrick McHardy <kaber@trash.net>
I presume this can't create any jumps/gotos, right?
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH V2 5/6] rtlwifi: btcoexist: Add routines for RTL8812AE kernel socket communications
From: Kalle Valo @ 2015-01-30 9:19 UTC (permalink / raw)
To: Larry Finger
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, Troy Tan,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1422304934-9239-6-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
Hi,
I'm adding bluetooth list to the discussion. Full patch is available
here:
https://patchwork.kernel.org/patch/5712591/
Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org> writes:
> From: Troy Tan <troy_tan-kXabqFNEczNtrwSWzY7KCg@public.gmane.org>
>
> This patch adds the routines used to communicate between the RTL8812AE (wifi)
> device and the RTL8761AU (bluetooth) device that are part of the same chip.
> Unlike other similar dual-function devices, this chip does not contain special
> hardware that lets the firmware pass coexistence info from one part to the
> other. As a result, this driver implements such communication as a kernel
> socket.
>
> Signed-off-by: Troy Tan <troy_tan-kXabqFNEczNtrwSWzY7KCg@public.gmane.org>
> Signed-off-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
> ---
> V2 - Add comments explaining the routine that sends a message via the
> socket.
The commit log is not still explaining that much about the actual
functionality, so I investigated on my own:
> +static u8 rtl_btcoex_create_kernel_socket(struct rtl_priv *rtlpriv,
> + u8 is_invite)
> +{
> + struct bt_coex_info *pcoex_info = &rtlpriv->coex_info;
> + s8 kernel_socket_err;
> +
> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
> + "%s CONNECT_PORT %d\n", __func__, CONNECT_PORT);
> +
> + if (!pcoex_info) {
> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL, "coex_info: NULL\n");
> + return _FAIL;
> + }
> +
> + kernel_socket_err = sock_create(PF_INET, SOCK_DGRAM, 0,
> + &pcoex_info->udpsock);
> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
> + "binding socket, err = %d\n", kernel_socket_err);
> +
> + if (kernel_socket_err < 0) {
> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
> + "Error during creation of socket error:%d\n",
> + kernel_socket_err);
> + return _FAIL;
> + }
> + memset(&pcoex_info->sin, 0, sizeof(pcoex_info->sin));
> + pcoex_info->sin.sin_family = AF_INET;
> + pcoex_info->sin.sin_port = htons(CONNECT_PORT);
> + pcoex_info->sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
> +
> + memset(&pcoex_info->bt_addr, 0, sizeof(pcoex_info->bt_addr));
> + pcoex_info->bt_addr.sin_family = AF_INET;
> + pcoex_info->bt_addr.sin_port = htons(CONNECT_PORT_BT);
> + pcoex_info->bt_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
> +
> + pcoex_info->sk_store = NULL;
> +
> + kernel_socket_err =
> + pcoex_info->udpsock->ops->bind(pcoex_info->udpsock,
> + (struct sockaddr *)&pcoex_info->sin,
> + sizeof(pcoex_info->sin));
> + if (kernel_socket_err == 0) {
> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
> + "binding socket success\n");
> + pcoex_info->udpsock->sk->sk_data_ready =
> + rtl_btcoex_recvmsg_int;
> + pcoex_info->sock_open |= KERNEL_SOCKET_OK;
> + pcoex_info->bt_attend = false;
> + BTC_PRINT(BTC_MSG_SOCKET, SOCKET_CRITICAL,
> + "WIFI sending attend_req\n");
> + rtl_btcoex_sendmsgbysocket(rtlpriv, attend_req,
> + sizeof(attend_req), true);
> + return _SUCCESS;
So the wireless driver communicates with the bluetooth driver (which is
not in upstream) via a localhost UDP connection?
> +#define CONNECT_PORT 30000
> +#define CONNECT_PORT_BT 30001
And these are the UDP ports used.
> +struct hci_link_info {
> + u16 connect_handle;
> + u8 incoming_traffic_mode;
> + u8 outgoing_traffic_mode;
> + u8 bt_profile;
> + u8 bt_corespec;
> + s8 bt_RSSI;
> + u8 traffic_profile;
> + u8 link_role;
> +};
> +
> +#define MAX_BT_ACL_LINK_NUM 8
> +
> +struct hci_ext_config {
> + struct hci_link_info acl_link[MAX_BT_ACL_LINK_NUM];
> + u8 bt_operation_code;
> + u16 current_connect_handle;
> + u8 current_incoming_traffic_mode;
> + u8 current_outgoing_traffic_mode;
> +
> + u8 number_of_acl;
> + u8 number_of_sco;
> + u8 current_bt_status;
> + u16 hci_ext_ver;
> + bool enable_wifi_scan_notify;
> +};
[...]
> +enum HCI_STATUS {
> + /* Success */
> + HCI_STATUS_SUCCESS = 0x00,
> + /* Unknown HCI Command */
> + HCI_STATUS_UNKNOW_HCI_CMD = 0x01,
> + /* Unknown Connection Identifier */
> + HCI_STATUS_UNKNOW_CONNECT_ID = 0X02,
> + /* Hardware Failure */
> + HCI_STATUS_HW_FAIL = 0X03,
> + /* Page Timeout */
> + HCI_STATUS_PAGE_TIMEOUT = 0X04,
> + /* Authentication Failure */
> + HCI_STATUS_AUTH_FAIL = 0X05,
> + /* PIN or Key Missing */
> + HCI_STATUS_PIN_OR_KEY_MISSING = 0X06,
> + /* Memory Capacity Exceeded */
> + HCI_STATUS_MEM_CAP_EXCEED = 0X07,
> + /* Connection Timeout */
> + HCI_STATUS_CONNECT_TIMEOUT = 0X08,
> + /* Connection Limit Exceeded */
And here's part of the information exchanged between the drivers.
This is something which needs to be properly reviewed both in wireless
and bluetooth lists, a wireless driver cannot just invent these on their
own. And using UDP sockets for this is in my opinion just horrible.
I know there's a general need for something similar like this, but it
needs to properly discussed and designed.
Comments?
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 0/6 net-next] rhashtable fixes
From: Ying Xue @ 2015-01-30 9:10 UTC (permalink / raw)
To: Thomas Graf, davem; +Cc: netdev
In-Reply-To: <cover.1422576760.git.tgraf@suug.ch>
Hi Thomas,
I make sure that my local net-next tree is synchronized to the latest
version in which the commit fe6a043c535acfec8f8e554536c87923dcb45097
("rhashtable: rhashtable_remove() must unlink in both tbl and
future_tbl") is already contained, and then I manually applied the whole
series patches. But when I repeatedly run the test case I originally
posted, soft lockup happens. Please see its relevant log:
root@localhost:/mnt# d[ 115.776178] ------------[ cut here ]------------
[ 115.776548] WARNING: CPU: 4 PID: 0 at net/sched/sch_generic.c:303
dev_watchdog+0x247/0x250()
[ 115.777106] NETDEV WATCHDOG: eth0 (e1000): transmit queue 0 timed out
[ 115.777533] Modules linked in: tipc
[ 115.777790] CPU: 4 PID: 0 Comm: swapper/4 Not tainted 3.19.0-rc6+ #182
[ 115.778221] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 115.778602] 000000000000012f ffff880017d03d08 ffffffff8175cd25
0000000000001052
[ 115.779133] ffff880017d03d58 ffff880017d03d48 ffffffff81059717
ffffffff00000000
[ 115.779661] ffff880015c26000 ffff880015c263e0 ffff880015f07000
0000000000000001
[ 115.780165] Call Trace:
[ 115.780165] <IRQ> [<ffffffff8175cd25>] dump_stack+0x4c/0x65
[ 115.780165] [<ffffffff81059717>] warn_slowpath_common+0x97/0xe0
[ 115.780165] [<ffffffff81059816>] warn_slowpath_fmt+0x46/0x50
[ 115.780165] [<ffffffff81654537>] dev_watchdog+0x247/0x250
[ 115.780165] [<ffffffff816542f0>] ? pfifo_fast_dequeue+0xe0/0xe0
[ 115.780165] [<ffffffff816542f0>] ? pfifo_fast_dequeue+0xe0/0xe0
[ 115.780165] [<ffffffff810c5ebc>] call_timer_fn+0x8c/0x1e0
[ 115.780165] [<ffffffff810c5e35>] ? call_timer_fn+0x5/0x1e0
[ 115.780165] [<ffffffff817663b0>] ? _raw_spin_unlock_irq+0x30/0x40
[ 115.780165] [<ffffffff816542f0>] ? pfifo_fast_dequeue+0xe0/0xe0
[ 115.780165] [<ffffffff810c7994>] run_timer_softirq+0x2d4/0x320
[ 115.780165] [<ffffffff810d6214>] ? clockevents_program_event+0x74/0x100
[ 115.780165] [<ffffffff8105d653>] __do_softirq+0x123/0x360
[ 115.780165] [<ffffffff8105db2e>] irq_exit+0x8e/0xb0
[ 115.780165] [<ffffffff8176952a>] smp_apic_timer_interrupt+0x4a/0x60
[ 115.780165] [<ffffffff817678af>] apic_timer_interrupt+0x6f/0x80
[ 115.780165] <EOI> [<ffffffff8100d174>] ? default_idle+0x24/0x100
[ 115.780165] [<ffffffff8100d172>] ? default_idle+0x22/0x100
[ 115.780165] [<ffffffff8100daaf>] arch_cpu_idle+0xf/0x20
[ 115.780165] [<ffffffff8109a509>] cpu_startup_entry+0x2c9/0x3c0
[ 115.780165] [<ffffffff810d5ea2>] ?
clockevents_register_device+0xe2/0x140
[ 115.780165] [<ffffffff810333c1>] start_secondary+0x141/0x150
[ 115.780165] ---[ end trace 62da3388fe54379b ]---
[ 115.780165] e1000 0000:00:03.0 eth0: Reset adapter
[ 116.724005] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 116.724005] Modules linked in: tipc
[ 116.724005] irq event stamp: 331179
[ 116.724005] hardirqs last enabled at (331178): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 116.724005] hardirqs last disabled at (331179): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 116.724005] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 116.724005] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 116.724005] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
3.19.0-rc6+ #182
[ 116.724005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 116.724005] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 116.724005] RIP: 0010:[<ffffffff8165d820>] [<ffffffff8165d820>]
netlink_compare+0x10/0x30
[ 116.724005] RSP: 0018:ffff8800105d3cf0 EFLAGS: 00000293
[ 116.724005] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 116.724005] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 116.724005] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 116.724005] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 116.724005] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 116.724005] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 116.724005] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 116.724005] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 116.724005] Stack:
[ 116.724005] ffffffff8139de4e ffffffff8139ddc0 000000028105d9c8
07ca27d400000000
[ 116.724005] ffff8800152d13c0 ffff8800105d3d48 ffff880016500000
ffff8800152d13c0
[ 116.724005] 0000000000000004 ffff8800152d13c0 ffff880010c07608
ffff8800105d3da8
[ 116.724005] Call Trace:
[ 116.724005] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 116.724005] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 116.724005] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 116.724005] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 116.724005] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 116.724005] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 116.724005] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 116.724005] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 116.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 116.724005] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 116.724005] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 116.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 116.724005] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 116.724005] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 116.724005] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 116.724005] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 116.724005] Code: f0 ff 83 98 01 00 00 48 83 c4 08 5b 5d c3 66 66 66
66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 c0 8b 56 08 39 97 68 04
00 00 <55> 48 89 e5 74 0a 5d c3 0f 1f 84 00 00 00 00 00 48 8b 47 30 48
[ 144.724006] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 144.724006] Modules linked in: tipc
[ 144.724006] irq event stamp: 345169
[ 144.724006] hardirqs last enabled at (345168): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 144.724006] hardirqs last disabled at (345169): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 144.724006] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 144.724006] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 144.724006] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 144.724006] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 144.724006] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 144.724006] RIP: 0010:[<ffffffff8165d826>] [<ffffffff8165d826>]
netlink_compare+0x16/0x30
[ 144.724006] RSP: 0018:ffff8800105d3ce8 EFLAGS: 00000293
[ 144.724006] RAX: 0000000000000000 RBX: ffff8800105d3c68 RCX:
00000000dbaee169
[ 144.724006] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 144.724006] RBP: ffff8800105d3ce8 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 144.724006] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d0000
[ 144.724006] R13: ffff880013970000 R14: 0000000000000000 R15:
0000000000000001
[ 144.724006] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 144.724006] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 144.724006] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 144.724006] Stack:
[ 144.724006] ffff8800105d3d48 ffffffff8139de4e ffffffff8139ddc0
000000028105d9c8
[ 144.724006] 07ca27d400000000 ffff8800152d13c0 ffff8800105d3d48
ffff880016500000
[ 144.724006] ffff8800152d13c0 0000000000000004 ffff8800152d13c0
ffff880010c07608
[ 144.724006] Call Trace:
[ 144.724006] [<ffffffff8139de4e>] rhashtable_lookup_compare+0x8e/0x120
[ 144.724006] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 144.724006] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 144.724006] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 144.724006] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 144.724006] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 144.724006] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 144.724006] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 144.724006] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 144.724006] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 144.724006] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 144.724006] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 144.724006] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 144.724006] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 144.724006] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 144.724006] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 144.724006] Code: 00 48 83 c4 08 5b 5d c3 66 66 66 66 2e 0f 1f 84 00
00 00 00 00 0f 1f 44 00 00 31 c0 8b 56 08 39 97 68 04 00 00 55 48 89 e5
74 0a <5d> c3 0f 1f 84 00 00 00 00 00 48 8b 47 30 48 39 06 5d 0f 94 c0
[ 150.732004] INFO: rcu_sched self-detected stall on CPU { 7} (t=15000
jiffies g=674 c=673 q=18)
[ 150.732004] Task dump for CPU 7:
[ 150.732004] bind_netlink R running task 0 631 561
0x20020008
[ 150.732004] 0000000000000231 ffff880017dc3d68 ffffffff81086c26
ffffffff81086b88
[ 150.732004] 00000000a5f9a5f8 0000000000000007 ffffffff81c53940
ffff880017dc3d88
[ 150.732004] ffffffff8108a57f ffffffff81c53940 ffffffff81c53940
ffff880017dc3db8
[ 150.732004] Call Trace:
[ 150.732004] <IRQ> [<ffffffff81086c26>] sched_show_task+0x106/0x170
[ 150.732004] [<ffffffff81086b88>] ? sched_show_task+0x68/0x170
[ 150.732004] [<ffffffff8108a57f>] dump_cpu_task+0x3f/0x50
[ 150.732004] [<ffffffff810bfa7b>] rcu_dump_cpu_stacks+0x8b/0xc0
[ 150.732004] [<ffffffff810c33d0>] rcu_check_callbacks+0x480/0x6d0
[ 150.732004] [<ffffffff810a133d>] ? trace_hardirqs_off+0xd/0x10
[ 150.732004] [<ffffffff810c8408>] update_process_times+0x38/0x70
[ 150.732004] [<ffffffff810d8623>] tick_sched_handle.isra.15+0x33/0x70
[ 150.732004] [<ffffffff810d88cb>] tick_sched_timer+0x4b/0x80
[ 150.732004] [<ffffffff810c8d8b>] __run_hrtimer+0x9b/0x290
[ 150.732004] [<ffffffff810d8880>] ? tick_sched_do_timer+0x40/0x40
[ 150.732004] [<ffffffff810c95e4>] ? hrtimer_interrupt+0x74/0x260
[ 150.732004] [<ffffffff810c9677>] hrtimer_interrupt+0x107/0x260
[ 150.732004] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 150.732004] [<ffffffff81034cb9>] local_apic_timer_interrupt+0x39/0x60
[ 150.732004] [<ffffffff81769525>] smp_apic_timer_interrupt+0x45/0x60
[ 150.732004] [<ffffffff817678af>] apic_timer_interrupt+0x6f/0x80
[ 150.732004] <EOI> [<ffffffff817675e0>] ? retint_restore_args+0xe/0xe
[ 150.732004] [<ffffffff8165d817>] ? netlink_compare+0x7/0x30
[ 150.732004] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 150.732004] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 150.732004] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 150.732004] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 150.732004] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 150.732004] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 150.732004] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 150.732004] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 150.732004] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 150.732004] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 150.732004] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 150.732004] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 150.732004] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 150.732004] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 150.732004] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 150.732004] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 176.724005] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 176.724005] Modules linked in: tipc
[ 176.724005] irq event stamp: 361143
[ 176.724005] hardirqs last enabled at (361142): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 176.724005] hardirqs last disabled at (361143): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 176.724005] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 176.724005] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 176.724005] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 176.724005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 176.724005] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 176.724005] RIP: 0010:[<ffffffff8139de55>] [<ffffffff8139de55>]
rhashtable_lookup_compare+0x95/0x120
[ 176.724005] RSP: 0018:ffff8800105d3cf8 EFLAGS: 00000246
[ 176.724005] RAX: 0000000000000000 RBX: 0000000000000003 RCX:
00000000dbaee169
[ 176.724005] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 176.724005] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 176.724005] R10: 0000000000000003 R11: 0000000000000001 R12:
ffffffff817675e0
[ 176.724005] R13: ffffffff810c2d18 R14: ffff8800105d3c58 R15:
0000000000000046
[ 176.724005] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 176.724005] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 176.724005] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 176.724005] Stack:
[ 176.724005] ffffffff8139ddc0 000000028105d9c8 07ca27d400000000
ffff8800152d13c0
[ 176.724005] ffff8800105d3d48 ffff880016500000 ffff8800152d13c0
0000000000000004
[ 176.724005] ffff8800152d13c0 ffff880010c07608 ffff8800105d3da8
ffffffff8139dfaf
[ 176.724005] Call Trace:
[ 176.724005] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 176.724005] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 176.724005] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 176.724005] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 176.724005] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 176.724005] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 176.724005] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 176.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 176.724005] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 176.724005] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 176.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 176.724005] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 176.724005] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 176.724005] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 176.724005] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 176.724005] Code: 8b 02 83 e8 01 23 45 c4 48 83 c0 02 4c 8b 74 c2 08
41 f6 c6 01 75 1a 4c 89 f7 48 2b 7b 30 4c 89 ee 41 ff d4 84 c0 75 46 4d
8b 36 <41> f6 c6 01 74 e6 4c 39 7d c8 75 6c 48 c7 c2 61 de 39 81 be 01
[ 204.724005] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 204.724005] Modules linked in: tipc
[ 204.724005] irq event stamp: 375131
[ 204.724005] hardirqs last enabled at (375130): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 204.724005] hardirqs last disabled at (375131): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 204.724005] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 204.724005] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 204.724005] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 204.724005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 204.724005] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 204.724005] RIP: 0010:[<ffffffff8139de4b>] [<ffffffff8139de4b>]
rhashtable_lookup_compare+0x8b/0x120
[ 204.724005] RSP: 0018:ffff8800105d3cf8 EFLAGS: 00000286
[ 204.724005] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 204.724005] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 204.724005] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 204.724005] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 204.724005] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 204.724005] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 204.724005] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 204.724005] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 204.724005] Stack:
[ 204.724005] ffffffff8139ddc0 000000028105d9c8 07ca27d400000000
ffff8800152d13c0
[ 204.724005] ffff8800105d3d48 ffff880016500000 ffff8800152d13c0
0000000000000004
[ 204.724005] ffff8800152d13c0 ffff880010c07608 ffff8800105d3da8
ffffffff8139dfaf
[ 204.724005] Call Trace:
[ 204.724005] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 204.724005] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 204.724005] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 204.724005] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 204.724005] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 204.724005] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 204.724005] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 204.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 204.724005] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 204.724005] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 204.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 204.724005] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 204.724005] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 204.724005] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 204.724005] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 204.724005] Code: e8 05 89 45 c4 48 8b 55 c8 48 8b 02 83 e8 01 23 45
c4 48 83 c0 02 4c 8b 74 c2 08 41 f6 c6 01 75 1a 4c 89 f7 48 2b 7b 30 4c
89 ee <41> ff d4 84 c0 75 46 4d 8b 36 41 f6 c6 01 74 e6 4c 39 7d c8 75
[ 232.724005] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 232.724005] Modules linked in: tipc
[ 232.724005] irq event stamp: 389119
[ 232.724005] hardirqs last enabled at (389118): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 232.724005] hardirqs last disabled at (389119): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 232.724005] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 232.724005] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 232.724005] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 232.724005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 232.724005] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 232.724005] RIP: 0010:[<ffffffff8165d820>] [<ffffffff8165d820>]
netlink_compare+0x10/0x30
[ 232.724005] RSP: 0018:ffff8800105d3cf0 EFLAGS: 00000293
[ 232.724005] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 232.724005] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 232.724005] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 232.724005] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 232.724005] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 232.724005] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 232.724005] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 232.724005] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 232.724005] Stack:
[ 232.724005] ffffffff8139de4e ffffffff8139ddc0 000000028105d9c8
07ca27d400000000
[ 232.724005] ffff8800152d13c0 ffff8800105d3d48 ffff880016500000
ffff8800152d13c0
[ 232.724005] 0000000000000004 ffff8800152d13c0 ffff880010c07608
ffff8800105d3da8
[ 232.724005] Call Trace:
[ 232.724005] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 232.724005] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 232.724005] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 232.724005] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 232.724005] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 232.724005] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 232.724005] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 232.724005] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 232.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 232.724005] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 232.724005] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 232.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 232.724005] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 232.724005] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 232.724005] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 232.724005] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 232.724005] Code: f0 ff 83 98 01 00 00 48 83 c4 08 5b 5d c3 66 66 66
66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 c0 8b 56 08 39 97 68 04
00 00 <55> 48 89 e5 74 0a 5d c3 0f 1f 84 00 00 00 00 00 48 8b 47 30 48
[ 240.772081] INFO: task kworker/7:1:70 blocked for more than 120 seconds.
[ 240.773035] Tainted: G W L 3.19.0-rc6+ #182
[ 240.773811] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
disables this message.
[ 240.774897] kworker/7:1 D ffff8800167c3af8 0 70 2
0x00000000
[ 240.775940] Workqueue: events rht_deferred_worker
[ 240.776676] ffff8800167c3af8 0000000000001ffb ffff8800167b8000
00000000000139c0
[ 240.777763] ffff8800167c3fd8 0000000000000000 00000000000139c0
ffff880013970000
[ 240.778845] ffff8800167b8000 0000000000000000 ffff8800167c3c58
7fffffffffffffff
[ 240.779928] Call Trace:
[ 240.780318] [<ffffffff81760879>] schedule+0x29/0x70
[ 240.781014] [<ffffffff81764de5>] schedule_timeout+0x1d5/0x230
[ 240.781826] [<ffffffff810a68fa>] ? mark_held_locks+0x6a/0x90
[ 240.782622] [<ffffffff817663b0>] ? _raw_spin_unlock_irq+0x30/0x40
[ 240.783459] [<ffffffff810a6a25>] ? trace_hardirqs_on_caller+0x105/0x1d0
[ 240.784483] [<ffffffff81761d1b>] wait_for_completion+0xbb/0x120
[ 240.785322] [<ffffffff81087910>] ? try_to_wake_up+0x3c0/0x3c0
[ 240.786179] [<ffffffff810c12f0>] ? __call_rcu.constprop.61+0x260/0x260
[ 240.787122] [<ffffffff810bea9d>] wait_rcu_gp+0x4d/0x60
[ 240.787906] [<ffffffff810beab0>] ? wait_rcu_gp+0x60/0x60
[ 240.788721] [<ffffffff810c1cfd>] synchronize_sched+0x5d/0x70
[ 240.789538] [<ffffffff8139e653>] rhashtable_shrink+0x113/0x150
[ 240.790385] [<ffffffff8139ea30>] rht_deferred_worker+0x80/0xa0
[ 240.791235] [<ffffffff81073449>] process_one_work+0x1b9/0x530
[ 240.792100] [<ffffffff810733d2>] ? process_one_work+0x142/0x530
[ 240.792960] [<ffffffff81073c5f>] worker_thread+0x11f/0x480
[ 240.793740] [<ffffffff81073b40>] ? rescuer_thread+0x340/0x340
[ 240.794552] [<ffffffff81079b4f>] kthread+0xef/0x110
[ 240.795268] [<ffffffff81079a60>] ? flush_kthread_worker+0xf0/0xf0
[ 240.796185] [<ffffffff817668ec>] ret_from_fork+0x7c/0xb0
[ 240.796938] [<ffffffff81079a60>] ? flush_kthread_worker+0xf0/0xf0
[ 240.797785] 3 locks held by kworker/7:1/70:
[ 240.798411] #0: ("events"){.+.+.+}, at: [<ffffffff810733d2>]
process_one_work+0x142/0x530
[ 240.799699] #1: ((&ht->run_work)){+.+.+.}, at: [<ffffffff810733d2>]
process_one_work+0x142/0x530
[ 240.801082] #2: (&ht->mutex){+.+.+.}, at: [<ffffffff8139e9dd>]
rht_deferred_worker+0x2d/0xa0
[ 260.724007] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 260.724007] Modules linked in: tipc
[ 260.724007] irq event stamp: 403107
[ 260.724007] hardirqs last enabled at (403106): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 260.724007] hardirqs last disabled at (403107): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 260.724007] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 260.724007] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 260.724007] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 260.724007] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 260.724007] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 260.724007] RIP: 0010:[<ffffffff8165d826>] [<ffffffff8165d826>]
netlink_compare+0x16/0x30
[ 260.724007] RSP: 0018:ffff8800105d3ce8 EFLAGS: 00000293
[ 260.724007] RAX: 0000000000000000 RBX: ffff8800105d3c68 RCX:
00000000dbaee169
[ 260.724007] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 260.724007] RBP: ffff8800105d3ce8 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 260.724007] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d0000
[ 260.724007] R13: ffff880013970000 R14: 0000000000000000 R15:
0000000000000001
[ 260.724007] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 260.724007] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 260.724007] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 260.724007] Stack:
[ 260.724007] ffff8800105d3d48 ffffffff8139de4e ffffffff8139ddc0
000000028105d9c8
[ 260.724007] 07ca27d400000000 ffff8800152d13c0 ffff8800105d3d48
ffff880016500000
[ 260.724007] ffff8800152d13c0 0000000000000004 ffff8800152d13c0
ffff880010c07608
[ 260.724007] Call Trace:
[ 260.724007] [<ffffffff8139de4e>] rhashtable_lookup_compare+0x8e/0x120
[ 260.724007] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 260.724007] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 260.724007] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 260.724007] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 260.724007] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 260.724007] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 260.724007] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 260.724007] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 260.724007] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 260.724007] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 260.724007] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 260.724007] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 260.724007] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 260.724007] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 260.724007] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 260.724007] Code: 00 48 83 c4 08 5b 5d c3 66 66 66 66 2e 0f 1f 84 00
00 00 00 00 0f 1f 44 00 00 31 c0 8b 56 08 39 97 68 04 00 00 55 48 89 e5
74 0a <5d> c3 0f 1f 84 00 00 00 00 00 48 8b 47 30 48 39 06 5d 0f 94 c0
[ 288.724004] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 288.724004] Modules linked in: tipc
[ 288.724004] irq event stamp: 417095
[ 288.724004] hardirqs last enabled at (417094): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 288.724004] hardirqs last disabled at (417095): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 288.724004] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 288.724004] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 288.724004] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 288.724004] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 288.724004] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 288.724004] RIP: 0010:[<ffffffff8139de4b>] [<ffffffff8139de4b>]
rhashtable_lookup_compare+0x8b/0x120
[ 288.724004] RSP: 0018:ffff8800105d3cf8 EFLAGS: 00000286
[ 288.724004] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 288.724004] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 288.724004] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 288.724004] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 288.724004] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 288.724004] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 288.724004] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 288.724004] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 288.724004] Stack:
[ 288.724004] ffffffff8139ddc0 000000028105d9c8 07ca27d400000000
ffff8800152d13c0
[ 288.724004] ffff8800105d3d48 ffff880016500000 ffff8800152d13c0
0000000000000004
[ 288.724004] ffff8800152d13c0 ffff880010c07608 ffff8800105d3da8
ffffffff8139dfaf
[ 288.724004] Call Trace:
[ 288.724004] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 288.724004] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 288.724004] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 288.724004] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 288.724004] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 288.724004] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 288.724004] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 288.724004] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 288.724004] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 288.724004] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 288.724004] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 288.724004] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 288.724004] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 288.724004] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 288.724004] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 288.724004] Code: e8 05 89 45 c4 48 8b 55 c8 48 8b 02 83 e8 01 23 45
c4 48 83 c0 02 4c 8b 74 c2 08 41 f6 c6 01 75 1a 4c 89 f7 48 2b 7b 30 4c
89 ee <41> ff d4 84 c0 75 46 4d 8b 36 41 f6 c6 01 74 e6 4c 39 7d c8 75
[ 316.724005] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 316.724005] Modules linked in: tipc
[ 316.724005] irq event stamp: 431083
[ 316.724005] hardirqs last enabled at (431082): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 316.724005] hardirqs last disabled at (431083): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 316.724005] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 316.724005] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 316.724005] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 316.724005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 316.724005] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 316.724005] RIP: 0010:[<ffffffff8139de4b>] [<ffffffff8139de4b>]
rhashtable_lookup_compare+0x8b/0x120
[ 316.724005] RSP: 0018:ffff8800105d3cf8 EFLAGS: 00000286
[ 316.724005] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 316.724005] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 316.724005] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 316.724005] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 316.724005] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 316.724005] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 316.724005] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 316.724005] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 316.724005] Stack:
[ 316.724005] ffffffff8139ddc0 000000028105d9c8 07ca27d400000000
ffff8800152d13c0
[ 316.724005] ffff8800105d3d48 ffff880016500000 ffff8800152d13c0
0000000000000004
[ 316.724005] ffff8800152d13c0 ffff880010c07608 ffff8800105d3da8
ffffffff8139dfaf
[ 316.724005] Call Trace:
[ 316.724005] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 316.724005] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 316.724005] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 316.724005] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 316.724005] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 316.724005] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 316.724005] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 316.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 316.724005] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 316.724005] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 316.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 316.724005] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 316.724005] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 316.724005] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 316.724005] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 316.724005] Code: e8 05 89 45 c4 48 8b 55 c8 48 8b 02 83 e8 01 23 45
c4 48 83 c0 02 4c 8b 74 c2 08 41 f6 c6 01 75 1a 4c 89 f7 48 2b 7b 30 4c
89 ee <41> ff d4 84 c0 75 46 4d 8b 36 41 f6 c6 01 74 e6 4c 39 7d c8 75
[ 330.748004] INFO: rcu_sched self-detected stall on CPU { 7} (t=60004
jiffies g=674 c=673 q=100)
[ 330.748004] Task dump for CPU 7:
[ 330.748004] bind_netlink R running task 0 631 561
0x20020008
[ 330.748004] 0000000000000231 ffff880017dc3d68 ffffffff81086c26
ffffffff81086b88
[ 330.748004] 00000000f75af759 0000000000000007 ffffffff81c53940
ffff880017dc3d88
[ 330.748004] ffffffff8108a57f ffffffff81c53940 ffffffff81c53940
ffff880017dc3db8
[ 330.748004] Call Trace:
[ 330.748004] <IRQ> [<ffffffff81086c26>] sched_show_task+0x106/0x170
[ 330.748004] [<ffffffff81086b88>] ? sched_show_task+0x68/0x170
[ 330.748004] [<ffffffff8108a57f>] dump_cpu_task+0x3f/0x50
[ 330.748004] [<ffffffff810bfa7b>] rcu_dump_cpu_stacks+0x8b/0xc0
[ 330.748004] [<ffffffff810c33d0>] rcu_check_callbacks+0x480/0x6d0
[ 330.748004] [<ffffffff810a133d>] ? trace_hardirqs_off+0xd/0x10
[ 330.748004] [<ffffffff810c8408>] update_process_times+0x38/0x70
[ 330.748004] [<ffffffff810d8623>] tick_sched_handle.isra.15+0x33/0x70
[ 330.748004] [<ffffffff810d88cb>] tick_sched_timer+0x4b/0x80
[ 330.748004] [<ffffffff810c8d8b>] __run_hrtimer+0x9b/0x290
[ 330.748004] [<ffffffff810d8880>] ? tick_sched_do_timer+0x40/0x40
[ 330.748004] [<ffffffff810c95e4>] ? hrtimer_interrupt+0x74/0x260
[ 330.748004] [<ffffffff810c9677>] hrtimer_interrupt+0x107/0x260
[ 330.748004] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 330.748004] [<ffffffff81034cb9>] local_apic_timer_interrupt+0x39/0x60
[ 330.748004] [<ffffffff81769525>] smp_apic_timer_interrupt+0x45/0x60
[ 330.748004] [<ffffffff817678af>] apic_timer_interrupt+0x6f/0x80
[ 330.748004] <EOI> [<ffffffff817675e0>] ? retint_restore_args+0xe/0xe
[ 330.748004] [<ffffffff8165d817>] ? netlink_compare+0x7/0x30
[ 330.748004] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 330.748004] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 330.748004] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 330.748004] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 330.748004] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 330.748004] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 330.748004] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 330.748004] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 330.748004] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 330.748004] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 330.748004] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 330.748004] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 330.748004] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 330.748004] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 330.748004] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 330.748004] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 330.771015] INFO: rcu_sched detected stalls on CPUs/tasks: { 7}
(detected by 1, t=60009 jiffies, g=674, c=673, q=100)
[ 330.772011] Task dump for CPU 7:
[ 330.772011] bind_netlink R running task 0 631 561
0x20020008
[ 330.772011] 0000000000000000 0000000000000000 ffff8800105d3f28
0000000000000002
[ 330.772011] 00000000ffdfca20 000000000000000c ffff8800105d3f28
ffffffff8161701e
[ 330.772011] ffff8800105d3f78 ffffffff81652318 0000000000000001
ffdfca38000013f3
[ 330.772011] Call Trace:
[ 330.772011] [<ffffffff8161701e>] ? SyS_bind+0xe/0x10
[ 330.772011] [<ffffffff81652318>] ? compat_SyS_socketcall+0xa8/0x200
[ 330.772011] [<ffffffff81768df3>] ? sysenter_dispatch+0x7/0x1f
[ 330.772011] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 356.724013] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 23s!
[bind_netlink:631]
[ 356.724013] Modules linked in: tipc
[ 356.724013] irq event stamp: 451061
[ 356.724013] hardirqs last enabled at (451060): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 356.724013] hardirqs last disabled at (451061): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 356.724013] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 356.724013] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 356.724013] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 356.724013] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 356.724013] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 356.724013] RIP: 0010:[<ffffffff8139de55>] [<ffffffff8139de55>]
rhashtable_lookup_compare+0x95/0x120
[ 356.724013] RSP: 0018:ffff8800105d3cf8 EFLAGS: 00000246
[ 356.724013] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 356.724013] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 356.724013] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 356.724013] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 356.724013] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 356.724013] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 356.724013] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 356.724013] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 356.724013] Stack:
[ 356.724013] ffffffff8139ddc0 000000028105d9c8 07ca27d400000000
ffff8800152d13c0
[ 356.724013] ffff8800105d3d48 ffff880016500000 ffff8800152d13c0
0000000000000004
[ 356.724013] ffff8800152d13c0 ffff880010c07608 ffff8800105d3da8
ffffffff8139dfaf
[ 356.724013] Call Trace:
[ 356.724013] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 356.724013] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 356.724013] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 356.724013] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 356.724013] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 356.724013] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 356.724013] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 356.724013] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 356.724013] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 356.724013] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 356.724013] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 356.724013] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 356.724013] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 356.724013] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 356.724013] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 356.724013] Code: 8b 02 83 e8 01 23 45 c4 48 83 c0 02 4c 8b 74 c2 08
41 f6 c6 01 75 1a 4c 89 f7 48 2b 7b 30 4c 89 ee 41 ff d4 84 c0 75 46 4d
8b 36 <41> f6 c6 01 74 e6 4c 39 7d c8 75 6c 48 c7 c2 61 de 39 81 be 01
[ 360.800040] INFO: task kworker/7:1:70 blocked for more than 120 seconds.
[ 360.800687] Tainted: G W L 3.19.0-rc6+ #182
[ 360.801176] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
disables this message.
[ 360.801858] kworker/7:1 D ffff8800167c3af8 0 70 2
0x00000000
[ 360.802495] Workqueue: events rht_deferred_worker
[ 360.802943] ffff8800167c3af8 0000000000001ffb ffff8800167b8000
00000000000139c0
[ 360.803624] ffff8800167c3fd8 0000000000000000 00000000000139c0
ffff880013970000
[ 360.804388] ffff8800167b8000 0000000000000000 ffff8800167c3c58
7fffffffffffffff
[ 360.805071] Call Trace:
[ 360.805295] [<ffffffff81760879>] schedule+0x29/0x70
[ 360.805751] [<ffffffff81764de5>] schedule_timeout+0x1d5/0x230
[ 360.806262] [<ffffffff810a68fa>] ? mark_held_locks+0x6a/0x90
[ 360.806764] [<ffffffff817663b0>] ? _raw_spin_unlock_irq+0x30/0x40
[ 360.807323] [<ffffffff810a6a25>] ? trace_hardirqs_on_caller+0x105/0x1d0
[ 360.808109] [<ffffffff81761d1b>] wait_for_completion+0xbb/0x120
[ 360.808653] [<ffffffff81087910>] ? try_to_wake_up+0x3c0/0x3c0
[ 360.809178] [<ffffffff810c12f0>] ? __call_rcu.constprop.61+0x260/0x260
[ 360.809772] [<ffffffff810bea9d>] wait_rcu_gp+0x4d/0x60
[ 360.810246] [<ffffffff810beab0>] ? wait_rcu_gp+0x60/0x60
[ 360.810733] [<ffffffff810c1cfd>] synchronize_sched+0x5d/0x70
[ 360.811358] [<ffffffff8139e653>] rhashtable_shrink+0x113/0x150
[ 360.811876] [<ffffffff8139ea30>] rht_deferred_worker+0x80/0xa0
[ 360.812424] [<ffffffff81073449>] process_one_work+0x1b9/0x530
[ 360.812957] [<ffffffff810733d2>] ? process_one_work+0x142/0x530
[ 360.813481] [<ffffffff81073c5f>] worker_thread+0x11f/0x480
[ 360.813969] [<ffffffff81073b40>] ? rescuer_thread+0x340/0x340
[ 360.814480] [<ffffffff81079b4f>] kthread+0xef/0x110
[ 360.814919] [<ffffffff81079a60>] ? flush_kthread_worker+0xf0/0xf0
[ 360.815459] [<ffffffff817668ec>] ret_from_fork+0x7c/0xb0
[ 360.815945] [<ffffffff81079a60>] ? flush_kthread_worker+0xf0/0xf0
[ 360.816523] 3 locks held by kworker/7:1/70:
[ 360.816893] #0: ("events"){.+.+.+}, at: [<ffffffff810733d2>]
process_one_work+0x142/0x530
[ 360.817696] #1: ((&ht->run_work)){+.+.+.}, at: [<ffffffff810733d2>]
process_one_work+0x142/0x530
[ 360.818527] #2: (&ht->mutex){+.+.+.}, at: [<ffffffff8139e9dd>]
rht_deferred_worker+0x2d/0xa0
[ 360.819349] INFO: task jbd2/sda-8:116 blocked for more than 120 seconds.
[ 360.819943] Tainted: G W L 3.19.0-rc6+ #182
[ 360.820472] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
disables this message.
[ 360.821157] jbd2/sda-8 D ffff8800159a3af8 0 116 2
0x00000000
[ 360.821832] ffff8800159a3af8 ffff8800159a3aa8 ffff8800159c2110
00000000000139c0
[ 360.822515] ffff8800159a3fd8 ffff8800159a3ab8 00000000000139c0
ffff880015a64220
[ 360.823222] ffff8800159c2110 ffffffff81118113 ffff880017d14330
ffff8800159c2110
[ 360.823907] Call Trace:
[ 360.824162] [<ffffffff81118113>] ? __delayacct_blkio_start+0x23/0x30
[ 360.824817] [<ffffffff81761250>] ? bit_wait_timeout+0x80/0x80
[ 360.825397] [<ffffffff81760879>] schedule+0x29/0x70
[ 360.825863] [<ffffffff8176094e>] io_schedule+0x8e/0xd0
[ 360.826406] [<ffffffff8176127c>] bit_wait_io+0x2c/0x50
[ 360.826966] [<ffffffff81760fe5>] __wait_on_bit+0x65/0x90
[ 360.827458] [<ffffffff811f83bc>] ? _submit_bh+0x11c/0x150
[ 360.827952] [<ffffffff81761250>] ? bit_wait_timeout+0x80/0x80
[ 360.828488] [<ffffffff8176113c>] out_of_line_wait_on_bit+0x7c/0x90
[ 360.829056] [<ffffffff81099f30>] ? wake_atomic_t_function+0x40/0x40
[ 360.829628] [<ffffffff811f64a9>] __wait_on_buffer+0x49/0x50
[ 360.830147] [<ffffffff812bce65>]
jbd2_journal_commit_transaction+0x16c5/0x1be0
[ 360.830806] [<ffffffff810a6afd>] ? trace_hardirqs_on+0xd/0x10
[ 360.831319] [<ffffffff810c6335>] ? del_timer_sync+0x5/0xd0
[ 360.831811] [<ffffffff812c0a21>] kjournald2+0xc1/0x280
[ 360.832331] [<ffffffff81099eb0>] ? prepare_to_wait_event+0x120/0x120
[ 360.832897] [<ffffffff812c0960>] ? commit_timeout+0x10/0x10
[ 360.833416] [<ffffffff81079b4f>] kthread+0xef/0x110
[ 360.833854] [<ffffffff81079a60>] ? flush_kthread_worker+0xf0/0xf0
[ 360.834398] [<ffffffff817668ec>] ret_from_fork+0x7c/0xb0
[ 360.834873] [<ffffffff81079a60>] ? flush_kthread_worker+0xf0/0xf0
[ 360.835413] no locks held by jbd2/sda-8/116.
[ 384.724008] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 23s!
[bind_netlink:631]
[ 384.724008] Modules linked in: tipc
[ 384.724008] irq event stamp: 465049
[ 384.724008] hardirqs last enabled at (465048): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 384.724008] hardirqs last disabled at (465049): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 384.724008] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 384.724008] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 384.724008] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 384.724008] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 384.724008] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 384.724008] RIP: 0010:[<ffffffff8165d810>] [<ffffffff8165d810>]
netlink_compare+0x0/0x30
[ 384.724008] RSP: 0018:ffff8800105d3cf0 EFLAGS: 00000286
[ 384.724008] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 384.724008] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 384.724008] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 384.724008] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 384.724008] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 384.724008] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 384.724008] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 384.724008] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 384.724008] Stack:
[ 384.724008] ffffffff8139de4e ffffffff8139ddc0 000000028105d9c8
07ca27d400000000
[ 384.724008] ffff8800152d13c0 ffff8800105d3d48 ffff880016500000
ffff8800152d13c0
[ 384.724008] 0000000000000004 ffff8800152d13c0 ffff880010c07608
ffff8800105d3da8
[ 384.724008] Call Trace:
[ 384.724008] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 384.724008] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 384.724008] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 384.724008] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 384.724008] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 384.724008] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 384.724008] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 384.724008] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 384.724008] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 384.724008] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 384.724008] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 384.724008] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 384.724008] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 384.724008] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 384.724008] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 384.724008] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 384.724008] Code: c7 87 30 03 00 00 69 00 00 00 ff 93 50 04 00 00 f0
ff 83 98 01 00 00 48 83 c4 08 5b 5d c3 66 66 66 66 2e 0f 1f 84 00 00 00
00 00 <0f> 1f 44 00 00 31 c0 8b 56 08 39 97 68 04 00 00 55 48 89 e5 74
[ 412.724006] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 412.724006] Modules linked in: tipc
[ 412.724006] irq event stamp: 479037
[ 412.724006] hardirqs last enabled at (479036): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 412.724006] hardirqs last disabled at (479037): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 412.724006] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 412.724006] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 412.724006] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 412.724006] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 412.724006] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 412.724006] RIP: 0010:[<ffffffff8165d820>] [<ffffffff8165d820>]
netlink_compare+0x10/0x30
[ 412.724006] RSP: 0018:ffff8800105d3cf0 EFLAGS: 00000293
[ 412.724006] RAX: 0000000000000000 RBX: 0000000000000003 RCX:
00000000dbaee169
[ 412.724006] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 412.724006] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 412.724006] R10: 0000000000000003 R11: 0000000000000001 R12:
ffffffff817675e0
[ 412.724006] R13: ffffffff810c2d18 R14: ffff8800105d3c58 R15:
0000000000000046
[ 412.724006] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 412.724006] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 412.724006] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 412.724006] Stack:
[ 412.724006] ffffffff8139de4e ffffffff8139ddc0 000000028105d9c8
07ca27d400000000
[ 412.724006] ffff8800152d13c0 ffff8800105d3d48 ffff880016500000
ffff8800152d13c0
[ 412.724006] 0000000000000004 ffff8800152d13c0 ffff880010c07608
ffff8800105d3da8
[ 412.724006] Call Trace:
[ 412.724006] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 412.724006] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 412.724006] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 412.724006] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 412.724006] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 412.724006] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 412.724006] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 412.724006] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 412.724006] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 412.724006] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 412.724006] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 412.724006] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 412.724006] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 412.724006] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 412.724006] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 412.724006] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 412.724006] Code: f0 ff 83 98 01 00 00 48 83 c4 08 5b 5d c3 66 66 66
66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 c0 8b 56 08 39 97 68 04
00 00 <55> 48 89 e5 74 0a 5d c3 0f 1f 84 00 00 00 00 00 48 8b 47 30 48
[ 440.724005] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 440.724005] Modules linked in: tipc
[ 440.724005] irq event stamp: 493025
[ 440.724005] hardirqs last enabled at (493024): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 440.724005] hardirqs last disabled at (493025): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 440.724005] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 440.724005] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 440.724005] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 440.724005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 440.724005] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 440.724005] RIP: 0010:[<ffffffff8165d820>] [<ffffffff8165d820>]
netlink_compare+0x10/0x30
[ 440.724005] RSP: 0018:ffff8800105d3cf0 EFLAGS: 00000293
[ 440.724005] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 440.724005] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 440.724005] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 440.724005] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 440.724005] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 440.724005] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 440.724005] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 440.724005] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 440.724005] Stack:
[ 440.724005] ffffffff8139de4e ffffffff8139ddc0 000000028105d9c8
07ca27d400000000
[ 440.724005] ffff8800152d13c0 ffff8800105d3d48 ffff880016500000
ffff8800152d13c0
[ 440.724005] 0000000000000004 ffff8800152d13c0 ffff880010c07608
ffff8800105d3da8
[ 440.724005] Call Trace:
[ 440.724005] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 440.724005] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 440.724005] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 440.724005] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 440.724005] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 440.724005] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 440.724005] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 440.724005] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 440.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 440.724005] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 440.724005] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 440.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 440.724005] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 440.724005] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 440.724005] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 440.724005] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 440.724005] Code: f0 ff 83 98 01 00 00 48 83 c4 08 5b 5d c3 66 66 66
66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 c0 8b 56 08 39 97 68 04
00 00 <55> 48 89 e5 74 0a 5d c3 0f 1f 84 00 00 00 00 00 48 8b 47 30 48
[ 468.724005] NMI watchdog: BUG: soft lockup - CPU#7 stuck for 22s!
[bind_netlink:631]
[ 468.724005] Modules linked in: tipc
[ 468.724005] irq event stamp: 507013
[ 468.724005] hardirqs last enabled at (507012): [<ffffffff817675e0>]
restore_args+0x0/0x30
[ 468.724005] hardirqs last disabled at (507013): [<ffffffff817678aa>]
apic_timer_interrupt+0x6a/0x80
[ 468.724005] softirqs last enabled at (318168): [<ffffffff8161897f>]
lock_sock_nested+0x4f/0xc0
[ 468.724005] softirqs last disabled at (318170): [<ffffffff8139d79a>]
lock_buckets+0x3a/0x80
[ 468.724005] CPU: 7 PID: 631 Comm: bind_netlink Tainted: G W
L 3.19.0-rc6+ #182
[ 468.724005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 468.724005] task: ffff880013970000 ti: ffff8800105d0000 task.ti:
ffff8800105d0000
[ 468.724005] RIP: 0010:[<ffffffff8165d820>] [<ffffffff8165d820>]
netlink_compare+0x10/0x30
[ 468.724005] RSP: 0018:ffff8800105d3cf0 EFLAGS: 00000293
[ 468.724005] RAX: 0000000000000000 RBX: ffffffff817675e0 RCX:
00000000dbaee169
[ 468.724005] RDX: 0000000000001668 RSI: ffff8800105d3db8 RDI:
ffff88001651b800
[ 468.724005] RBP: ffff8800105d3d48 R08: 00000000df2b8827 R09:
ffff880010c07468
[ 468.724005] R10: 0000000000000003 R11: 0000000000000001 R12:
ffff8800105d3c68
[ 468.724005] R13: 0000000000000046 R14: ffff8800105d0000 R15:
ffff880013970000
[ 468.724005] FS: 0000000000000000(0000) GS:ffff880017dc0000(0063)
knlGS:00000000f75ae900
[ 468.724005] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 468.724005] CR2: 0000000008760000 CR3: 0000000015121000 CR4:
00000000000006e0
[ 468.724005] Stack:
[ 468.724005] ffffffff8139de4e ffffffff8139ddc0 000000028105d9c8
07ca27d400000000
[ 468.724005] ffff8800152d13c0 ffff8800105d3d48 ffff880016500000
ffff8800152d13c0
[ 468.724005] 0000000000000004 ffff8800152d13c0 ffff880010c07608
ffff8800105d3da8
[ 468.724005] Call Trace:
[ 468.724005] [<ffffffff8139de4e>] ? rhashtable_lookup_compare+0x8e/0x120
[ 468.724005] [<ffffffff8139ddc0>] ? rhashtable_remove+0x200/0x200
[ 468.724005] [<ffffffff8139dfaf>]
rhashtable_lookup_compare_insert+0x9f/0x110
[ 468.724005] [<ffffffff8139df45>] ?
rhashtable_lookup_compare_insert+0x35/0x110
[ 468.724005] [<ffffffff8165d810>] ? netlink_overrun+0x50/0x50
[ 468.724005] [<ffffffff8165e0f3>] ? netlink_insert+0x43/0xf0
[ 468.724005] [<ffffffff8165e141>] netlink_insert+0x91/0xf0
[ 468.724005] [<ffffffff81660470>] netlink_bind+0x210/0x260
[ 468.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 468.724005] [<ffffffff810a5b10>] ? lock_release_non_nested+0xa0/0x340
[ 468.724005] [<ffffffff81616d24>] SYSC_bind+0xa4/0xc0
[ 468.724005] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 468.724005] [<ffffffff8161701e>] SyS_bind+0xe/0x10
[ 468.724005] [<ffffffff81652318>] compat_SyS_socketcall+0xa8/0x200
[ 468.724005] [<ffffffff81768df3>] sysenter_dispatch+0x7/0x1f
[ 468.724005] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 468.724005] Code: f0 ff 83 98 01 00 00 48 83 c4 08 5b 5d c3 66 66 66
66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 31 c0 8b 56 08 39 97 68 04
00 00 <55> 48 89 e5 74 0a 5d c3 0f 1f 84 00 00 00 00 00 48 8b 47 30 48
Regards,
Ying
On 01/30/2015 08:20 AM, Thomas Graf wrote:
> This is a series of fixes which have accumulated while tracking
> down the race condition reoprted by Ying Xue. The original
> DEBUG_PAGEALLOC splat is resolved.
>
> However, there is still a race (harder to trigger) remaining in
> which certain entries are unfindable when removing them from the
> table via netlink_remove() and thus they cause a use after free
> later on.
>
> Regardless, these fixes can go in now.
>
> Thomas Graf (6):
> rhashtable: key_hashfn() must return full hash value
> rhashtable: Use a single bucket lock for sibling buckets
> rhashtable: Wait for RCU readers after final unzip work
> rhashtable: Dump bucket tables on locking violation under
> PROVE_LOCKING
> rhashtable: Add more lock verification
> rhashtable: Avoid bucket cross reference after removal
>
> lib/rhashtable.c | 301 ++++++++++++++++++++++++++++++-------------------------
> 1 file changed, 166 insertions(+), 135 deletions(-)
>
^ permalink raw reply
* [patch -mainline] fm10k: drop upper bits of VLAN ID
From: Dan Carpenter @ 2015-01-30 8:41 UTC (permalink / raw)
To: Jeff Kirsher, Alexander Duyck
Cc: Jesse Brandeburg, Bruce Allan, Carolyn Wyborny, Don Skidmore,
Greg Rose, Matthew Vick, John Ronciak, Mitch Williams, Linux NICS,
e1000-devel, netdev, kernel-janitors
Static checkers complain that the shifts in "(vid << 4) >> 4" perfectly
cancel each other out and the code is a no-op. "vid" is a u16. The
comment says that the intention here is to drop the upper bits so I have
added a cast to "u16" to do that.
Fixes: 401b5383c6c9 ('fm10k: Add support for configuring PF interface')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static analysis. Not tested.
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
index 275423d..ee30d06 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c
@@ -335,7 +335,7 @@ static s32 fm10k_update_xc_addr_pf(struct fm10k_hw *hw, u16 glort,
return FM10K_ERR_PARAM;
/* drop upper 4 bits of VLAN ID */
- vid = (vid << 4) >> 4;
+ vid = (u16)(vid << 4) >> 4;
/* record fields */
mac_update.mac_lower = cpu_to_le32(((u32)mac[2] << 24) |
^ permalink raw reply related
* Re: [PATCH net-next] rhashtable: rhashtable_remove() must unlink in both tbl and future_tbl
From: Ying Xue @ 2015-01-30 8:37 UTC (permalink / raw)
To: Thomas Graf; +Cc: tipc-discussion, davem, Netdev
In-Reply-To: <20150121115607.GB12570@casper.infradead.org>
On 01/21/2015 07:56 PM, Thomas Graf wrote:
> On 01/21/15 at 04:39pm, Ying Xue wrote:
>> Your below changes are reasonable for me. But after I applied the patch,
>> my reported two issues still happened :( And failure logs are completely
>> same before.
>
> Correct. The patch fixes the panic that you reported as well:
>
Sorry, it sounds like the similar issue still exists even if I applied
the patch. Please see the following panic log:
[ 139.214445] BUG: unable to handle kernel paging request at
ffffffffffffff74
[ 139.215116] IP: [<ffffffff81390b3b>] memcmp+0xb/0x50
[ 139.215612] PGD 1c12067 PUD 1c14067 PMD 0
[ 139.216013] Oops: 0000 [#1] SMP
[ 139.216013] Modules linked in: tipc
[ 139.216013] CPU: 1 PID: 739 Comm: bind2 Not tainted 3.19.0-rc6+ #181
[ 139.216013] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 139.216013] task: ffff8800131e4220 ti: ffff880015fe0000 task.ti:
ffff880015fe0000
[ 139.216013] RIP: 0010:[<ffffffff81390b3b>] [<ffffffff81390b3b>]
memcmp+0xb/0x50
[ 139.216013] RSP: 0018:ffff880015fe3cd8 EFLAGS: 00010202
[ 139.216013] RAX: 0000000000000000 RBX: ffff880015209090 RCX:
0000000000000031
[ 139.216013] RDX: 0000000000000004 RSI: ffff88001333ae7c RDI:
ffffffffffffff74
[ 139.216013] RBP: ffff880015fe3cd8 R08: 00000000f2a43829 R09:
ffff88001333ae7c
[ 139.216013] R10: 0000000000000003 R11: 0000000000000001 R12:
ffffffff8139d6b0
[ 139.216013] R13: ffff880015fe3dd8 R14: 0000000000000000 R15:
ffff880014440000
[ 139.216013] FS: 0000000000000000(0000) GS:ffff880017c40000(0063)
knlGS:00000000f75e1900
[ 139.216013] CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b
[ 139.216013] CR2: ffffffffffffff74 CR3: 000000001521e000 CR4:
00000000000006e0
[ 139.216013] Stack:
[ 139.216013] ffff880015fe3ce8 ffffffff8139d6c8 ffff880015fe3d58
ffffffff8139d8ae
[ 139.216013] ffffffff8139d810 ffffc9000032bab8 0000000000000001
ffff880014440000
[ 139.216013] ffff880014440000 0000033110522000 ffff880015fe3d58
ffff880015209090
[ 139.216013] Call Trace:
[ 139.216013] [<ffffffff8139d6c8>] rhashtable_compare+0x18/0x20
[ 139.216013] [<ffffffff8139d8ae>] rhashtable_lookup_compare+0x9e/0x130
[ 139.216013] [<ffffffff8139d810>] ? lockdep_rht_mutex_is_held+0x30/0x30
[ 139.216013] [<ffffffff8139da5d>]
rhashtable_lookup_compare_insert+0xed/0x180
[ 139.216013] [<ffffffff8139d9a6>] ?
rhashtable_lookup_compare_insert+0x36/0x180
[ 139.216013] [<ffffffffa00162b2>] ? tipc_sk_create+0xa2/0x340 [tipc]
[ 139.216013] [<ffffffff8139d6b0>] ? rhashtable_destroy+0x70/0x70
[ 139.216013] [<ffffffff8139db22>] rhashtable_lookup_insert+0x32/0x40
[ 139.216013] [<ffffffffa00163fc>] tipc_sk_create+0x1ec/0x340 [tipc]
[ 139.216013] [<ffffffffa00162b2>] ? tipc_sk_create+0xa2/0x340 [tipc]
[ 139.216013] [<ffffffff81615cb0>] __sock_create+0x170/0x270
[ 139.216013] [<ffffffff81615bff>] ? __sock_create+0xbf/0x270
[ 139.216013] [<ffffffff81615e10>] sock_create+0x30/0x40
[ 139.216013] [<ffffffff81616b86>] SyS_socket+0x36/0xb0
[ 139.216013] [<ffffffff8118500f>] ? might_fault+0xaf/0xc0
[ 139.216013] [<ffffffff81184fc6>] ? might_fault+0x66/0xc0
[ 139.216013] [<ffffffff816520eb>] compat_SyS_socketcall+0x6b/0x200
[ 139.216013] [<ffffffff81768bf3>] sysenter_dispatch+0x7/0x1f
[ 139.216013] [<ffffffff8139660e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 139.216013] Code: 31 c0 c6 06 01 5d c3 66 0f 1f 84 00 00 00 00 00 31
c0 c6 06 00 5d c3 66 0f 1f 84 00 00 00 00 00 55 31 c0 48 85 d2 48 89 e5
74 2f <0f> b6 07 0f b6 0e 29 c8 75 25 48 83 ea 01 31 c9 eb 18 0f 1f 00
[ 139.216013] RIP [<ffffffff81390b3b>] memcmp+0xb/0x50
[ 139.216013] RSP <ffff880015fe3cd8>
[ 139.216013] CR2: ffffffffffffff74
[ 139.216013] ---[ end trace 09b553c3efa31348 ]---
[ 139.216013] Kernel panic - not syncing: Fatal exception in interrupt
[ 139.216013] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation
range: 0xffffffff80000000-0xffffffff9fffffff)
[ 139.216013] ---[ end Kernel panic - not syncing: Fatal exception in
interrupt
Regards,
Ying
> [ 17.033416] BUG: unable to handle kernel paging request at
> ffffffffffffff77
> [ 17.034009] IP: [<ffffffffa0019b8c>] jhash+0xec/0x160 [tipc]
> [...]
> [ 17.034009] Call Trace:
> [ 17.034009] [<ffffffff813b38e9>] head_hashfn+0x29/0x50
> [ 17.034009] [<ffffffff813b475b>] rhashtable_expand+0x37b/0x680
> [ 17.034009] [<ffffffff813b4b38>] rht_deferred_worker+0xd8/0xe0
> [ 17.034009] [<ffffffff81074d10>] process_one_work+0x200/0x800
> [ 17.034009] [<ffffffff81074c71>] ? process_one_work+0x161/0x800
> [ 17.034009] [<ffffffff81074c71>] ? process_one_work+0x161/0x800
> [ 17.034009] [<ffffffff8107533c>] process_scheduled_works+0x2c/0x40
> [ 17.034009] [<ffffffff810758d3>] worker_thread+0x253/0x4b0
> [ 17.034009] [<ffffffff81075680>] ? rescuer_thread+0x330/0x330
> [ 17.034009] [<ffffffff8107bb6f>] kthread+0xef/0x110
> [ 17.034009] [<ffffffff8107ba80>] ? flush_kthread_work+0x170/0x170
> [ 17.034009] [<ffffffff81a44a2c>] ret_from_fork+0x7c/0xb0
> [ 17.034009] [<ffffffff8107ba80>] ? flush_kthread_work+0x170/0x170
>
>
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
^ permalink raw reply
* Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Mugunthan V N @ 2015-01-30 8:18 UTC (permalink / raw)
To: Murali Karicheri, w-kwok2, davem, tony, prabhakar.csengg,
grygorii.strashko, lokeshvutla, mpa, lsorense, netdev,
linux-kernel, arnd
In-Reply-To: <1422573351-5603-2-git-send-email-m-karicheri2@ti.com>
On Friday 30 January 2015 04:45 AM, Murali Karicheri wrote:
> NetCP on Keystone has cpsw ale function similar to other TI SoCs
> and this driver is re-used. To allow both ti cpsw and keystone netcp
> to re-use the driver, convert the cpsw ale to a module and configure
> it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
> linked to both TI CPSW and NetCP and this causes issues when the above
> drivers are built as dynamic modules. This patch addresses this issue
>
> While at it, fix the Makefile and code to build both netcp_core and
> netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
> This also requires exporting of API calls provided by netcp_core so that
> both the above can be dynamic modules.
>
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Will try to test this today/Monday.
Regards
Mugunthan V N
^ permalink raw reply
* Re: [PATCH 1/2] rhashtable: Introduce rhashtable_walk_*
From: Patrick McHardy @ 2015-01-30 8:10 UTC (permalink / raw)
To: Herbert Xu
Cc: Thomas Graf, David Miller, David.Laight, ying.xue, paulmck,
netdev, netfilter-devel
In-Reply-To: <20150130055859.GA17149@gondor.apana.org.au>
On 30.01, Herbert Xu wrote:
> On Wed, Jan 28, 2015 at 07:07:16PM +0000, Patrick McHardy wrote:
> > On 28.01, Herbert Xu wrote:
> > > On Tue, Jan 27, 2015 at 01:09:50PM +0000, Patrick McHardy wrote:
> > > >
> > > > Actually I have a patchset queued that adds runtime additions and
> > > > removals, both active and timeout based. So netfilter won't have
> > > > pure synchronous behaviour anymore.
> > >
> > > Can you show us the patchset?
> >
> > Sure, will send it over tomorrow.
>
> So how are you handling the locking in these cases?
Insertion is handled using the rhashtable internal locks. GC happens
in work context and takes the rhashtable mutex, then walks the table
similar to nft_hash_walk and removes stale entries.
Still need to work out something to reduce RCU grace periods
(currently ignored) and make sure we don't race between ->get/->remove
in the netlink API and GC.
^ permalink raw reply
* Re: [PATCH net-next] drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone
From: Lad, Prabhakar @ 2015-01-30 8:03 UTC (permalink / raw)
To: Murali Karicheri
Cc: w-kwok2, David S. Miller, Mugunthan V N, Tony Lindgren,
Grygorii Strashko, lokeshvutla, mpa, lsorense, netdev, LKML,
Arnd Bergmann
In-Reply-To: <1422573351-5603-2-git-send-email-m-karicheri2@ti.com>
On Thu, Jan 29, 2015 at 11:15 PM, Murali Karicheri <m-karicheri2@ti.com> wrote:
> NetCP on Keystone has cpsw ale function similar to other TI SoCs
> and this driver is re-used. To allow both ti cpsw and keystone netcp
> to re-use the driver, convert the cpsw ale to a module and configure
> it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
> linked to both TI CPSW and NetCP and this causes issues when the above
> drivers are built as dynamic modules. This patch addresses this issue
>
> While at it, fix the Makefile and code to build both netcp_core and
> netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
> This also requires exporting of API calls provided by netcp_core so that
> both the above can be dynamic modules.
>
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Regards,
--Prabhakar Lad
> ---
> drivers/net/ethernet/ti/Kconfig | 19 +++++++++++++++++--
> drivers/net/ethernet/ti/Makefile | 8 +++++---
> drivers/net/ethernet/ti/cpsw_ale.c | 26 ++++++++++++++++++++++++--
> drivers/net/ethernet/ti/netcp_core.c | 8 ++++++++
> drivers/net/ethernet/ti/netcp_ethss.c | 5 +++++
> 5 files changed, 59 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
> index 4ea1663..3bc992c 100644
> --- a/drivers/net/ethernet/ti/Kconfig
> +++ b/drivers/net/ethernet/ti/Kconfig
> @@ -56,12 +56,18 @@ config TI_CPSW_PHY_SEL
> This driver supports configuring of the phy mode connected to
> the CPSW.
>
> +config TI_CPSW_ALE
> + tristate "TI CPSW ALE Support"
> + ---help---
> + This driver supports TI's CPSW ALE module.
> +
> config TI_CPSW
> tristate "TI CPSW Switch Support"
> depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
> select TI_DAVINCI_CPDMA
> select TI_DAVINCI_MDIO
> select TI_CPSW_PHY_SEL
> + select TI_CPSW_ALE
> select MFD_SYSCON
> select REGMAP
> ---help---
> @@ -80,15 +86,24 @@ config TI_CPTS
> and Layer 2 packets, and the driver offers a PTP Hardware Clock.
>
> config TI_KEYSTONE_NETCP
> - tristate "TI Keystone NETCP Ethernet subsystem Support"
> + tristate "TI Keystone NETCP Core Support"
> + select TI_CPSW_ALE
> depends on OF
> depends on KEYSTONE_NAVIGATOR_DMA && KEYSTONE_NAVIGATOR_QMSS
> ---help---
> - This driver supports TI's Keystone NETCP Ethernet subsystem.
> + This driver supports TI's Keystone NETCP Core.
>
> To compile this driver as a module, choose M here: the module
> will be called keystone_netcp.
>
> +config TI_KEYSTONE_NETCP_ETHSS
> + depends on TI_KEYSTONE_NETCP
> + tristate "TI Keystone NETCP Ethernet subsystem Support"
> + ---help---
> +
> + To compile this driver as a module, choose M here: the module
> + will be called keystone_netcp_ethss.
> +
> config TLAN
> tristate "TI ThunderLAN support"
> depends on (PCI || EISA)
> diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile
> index 0a9813b..02ddad5 100644
> --- a/drivers/net/ethernet/ti/Makefile
> +++ b/drivers/net/ethernet/ti/Makefile
> @@ -8,9 +8,11 @@ obj-$(CONFIG_TI_DAVINCI_EMAC) += davinci_emac.o
> obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
> obj-$(CONFIG_TI_DAVINCI_CPDMA) += davinci_cpdma.o
> obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
> +obj-$(CONFIG_TI_CPSW_ALE) += cpsw_ale.o
> obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
> -ti_cpsw-y := cpsw_ale.o cpsw.o cpts.o
> +ti_cpsw-y := cpsw.o cpts.o
>
> obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o
> -keystone_netcp-y := netcp_core.o netcp_ethss.o netcp_sgmii.o \
> - netcp_xgbepcsr.o cpsw_ale.o
> +keystone_netcp-y := netcp_core.o
> +obj-$(CONFIG_TI_KEYSTONE_NETCP_ETHSS) += keystone_netcp_ethss.o
> +keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o
> diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
> index 5246b3a..6e927b4 100644
> --- a/drivers/net/ethernet/ti/cpsw_ale.c
> +++ b/drivers/net/ethernet/ti/cpsw_ale.c
> @@ -13,6 +13,7 @@
> * GNU General Public License for more details.
> */
> #include <linux/kernel.h>
> +#include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/seq_file.h>
> #include <linux/slab.h>
> @@ -146,7 +147,7 @@ static int cpsw_ale_write(struct cpsw_ale *ale, int idx, u32 *ale_entry)
> return idx;
> }
>
> -int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
> +static int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
> {
> u32 ale_entry[ALE_ENTRY_WORDS];
> int type, idx;
> @@ -167,7 +168,7 @@ int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid)
> return -ENOENT;
> }
>
> -int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
> +static int cpsw_ale_match_vlan(struct cpsw_ale *ale, u16 vid)
> {
> u32 ale_entry[ALE_ENTRY_WORDS];
> int type, idx;
> @@ -265,6 +266,7 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
> }
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_flush_multicast);
>
> static void cpsw_ale_flush_ucast(struct cpsw_ale *ale, u32 *ale_entry,
> int port_mask)
> @@ -297,6 +299,7 @@ int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask)
> }
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_flush);
>
> static inline void cpsw_ale_set_vlan_entry_type(u32 *ale_entry,
> int flags, u16 vid)
> @@ -334,6 +337,7 @@ int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port,
> cpsw_ale_write(ale, idx, ale_entry);
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_add_ucast);
>
> int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,
> int flags, u16 vid)
> @@ -349,6 +353,7 @@ int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,
> cpsw_ale_write(ale, idx, ale_entry);
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_del_ucast);
>
> int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
> int flags, u16 vid, int mcast_state)
> @@ -380,6 +385,7 @@ int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
> cpsw_ale_write(ale, idx, ale_entry);
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_add_mcast);
>
> int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
> int flags, u16 vid)
> @@ -401,6 +407,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
> cpsw_ale_write(ale, idx, ale_entry);
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_del_mcast);
>
> int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag,
> int reg_mcast, int unreg_mcast)
> @@ -430,6 +437,7 @@ int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag,
> cpsw_ale_write(ale, idx, ale_entry);
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_add_vlan);
>
> int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
> {
> @@ -450,6 +458,7 @@ int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
> cpsw_ale_write(ale, idx, ale_entry);
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_del_vlan);
>
> void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti)
> {
> @@ -479,6 +488,7 @@ void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti)
> cpsw_ale_write(ale, idx, ale_entry);
> }
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_set_allmulti);
>
> struct ale_control_info {
> const char *name;
> @@ -704,6 +714,7 @@ int cpsw_ale_control_set(struct cpsw_ale *ale, int port, int control,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_control_set);
>
> int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control)
> {
> @@ -727,6 +738,7 @@ int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control)
> tmp = __raw_readl(ale->params.ale_regs + offset) >> shift;
> return tmp & BITMASK(info->bits);
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_control_get);
>
> static void cpsw_ale_timer(unsigned long arg)
> {
> @@ -750,6 +762,7 @@ int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout)
> }
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_set_ageout);
>
> void cpsw_ale_start(struct cpsw_ale *ale)
> {
> @@ -769,11 +782,13 @@ void cpsw_ale_start(struct cpsw_ale *ale)
> add_timer(&ale->timer);
> }
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_start);
>
> void cpsw_ale_stop(struct cpsw_ale *ale)
> {
> del_timer_sync(&ale->timer);
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_stop);
>
> struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
> {
> @@ -788,6 +803,7 @@ struct cpsw_ale *cpsw_ale_create(struct cpsw_ale_params *params)
>
> return ale;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_create);
>
> int cpsw_ale_destroy(struct cpsw_ale *ale)
> {
> @@ -797,6 +813,7 @@ int cpsw_ale_destroy(struct cpsw_ale *ale)
> kfree(ale);
> return 0;
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_destroy);
>
> void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
> {
> @@ -807,3 +824,8 @@ void cpsw_ale_dump(struct cpsw_ale *ale, u32 *data)
> data += ALE_ENTRY_WORDS;
> }
> }
> +EXPORT_SYMBOL_GPL(cpsw_ale_dump);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("TI CPSW ALE driver");
> +MODULE_AUTHOR("Texas Instruments");
> diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
> index ba3002e..a31a8c3 100644
> --- a/drivers/net/ethernet/ti/netcp_core.c
> +++ b/drivers/net/ethernet/ti/netcp_core.c
> @@ -354,6 +354,7 @@ fail:
> netcp_unregister_module(module);
> return ret;
> }
> +EXPORT_SYMBOL_GPL(netcp_register_module);
>
> static void netcp_release_module(struct netcp_device *netcp_device,
> struct netcp_module *module)
> @@ -414,6 +415,7 @@ void netcp_unregister_module(struct netcp_module *module)
>
> mutex_unlock(&netcp_modules_lock);
> }
> +EXPORT_SYMBOL_GPL(netcp_unregister_module);
>
> void *netcp_module_get_intf_data(struct netcp_module *module,
> struct netcp_intf *intf)
> @@ -425,6 +427,7 @@ void *netcp_module_get_intf_data(struct netcp_module *module,
> return intf_modpriv->module_priv;
> return NULL;
> }
> +EXPORT_SYMBOL_GPL(netcp_module_get_intf_data);
>
> /* Module TX and RX Hook management */
> struct netcp_hook_list {
> @@ -459,6 +462,7 @@ int netcp_register_txhook(struct netcp_intf *netcp_priv, int order,
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(netcp_register_txhook);
>
> int netcp_unregister_txhook(struct netcp_intf *netcp_priv, int order,
> netcp_hook_rtn *hook_rtn, void *hook_data)
> @@ -480,6 +484,7 @@ int netcp_unregister_txhook(struct netcp_intf *netcp_priv, int order,
> spin_unlock_irqrestore(&netcp_priv->lock, flags);
> return -ENOENT;
> }
> +EXPORT_SYMBOL_GPL(netcp_unregister_txhook);
>
> int netcp_register_rxhook(struct netcp_intf *netcp_priv, int order,
> netcp_hook_rtn *hook_rtn, void *hook_data)
> @@ -1226,6 +1231,7 @@ int netcp_txpipe_close(struct netcp_tx_pipe *tx_pipe)
> }
> return 0;
> }
> +EXPORT_SYMBOL_GPL(netcp_txpipe_close);
>
> int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe)
> {
> @@ -1267,6 +1273,7 @@ err:
> tx_pipe->dma_channel = NULL;
> return ret;
> }
> +EXPORT_SYMBOL_GPL(netcp_txpipe_open);
>
> int netcp_txpipe_init(struct netcp_tx_pipe *tx_pipe,
> struct netcp_device *netcp_device,
> @@ -1278,6 +1285,7 @@ int netcp_txpipe_init(struct netcp_tx_pipe *tx_pipe,
> tx_pipe->dma_queue_id = dma_queue_id;
> return 0;
> }
> +EXPORT_SYMBOL_GPL(netcp_txpipe_init);
>
> static struct netcp_addr *netcp_addr_find(struct netcp_intf *netcp,
> const u8 *addr,
> diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
> index fa1041a..345cd25 100644
> --- a/drivers/net/ethernet/ti/netcp_ethss.c
> +++ b/drivers/net/ethernet/ti/netcp_ethss.c
> @@ -19,6 +19,7 @@
> */
>
> #include <linux/io.h>
> +#include <linux/module.h>
> #include <linux/of_mdio.h>
> #include <linux/of_address.h>
> #include <linux/if_vlan.h>
> @@ -2154,3 +2155,7 @@ static void __exit keystone_gbe_exit(void)
> netcp_unregister_module(&xgbe_module);
> }
> module_exit(keystone_gbe_exit);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("TI NETCP ETHSS driver for Keystone SOCs");
> +MODULE_AUTHOR("Sandeep Nair <sandeep_n@ti.com");
> --
> 1.7.9.5
>
^ permalink raw reply
* [PATCH 9/9] netfilter: nf_tables: add support for dynamic set updates
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
include/net/netfilter/nf_tables.h | 4 +-
include/uapi/linux/netfilter/nf_tables.h | 21 ++++
net/netfilter/Kconfig | 7 ++
net/netfilter/Makefile | 1 +
net/netfilter/nf_tables_api.c | 2 +
net/netfilter/nft_hash.c | 20 +++-
net/netfilter/nft_set.c | 176 +++++++++++++++++++++++++++++++
7 files changed, 228 insertions(+), 3 deletions(-)
create mode 100644 net/netfilter/nft_set.c
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 735a59d..5bbde43 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -319,6 +319,8 @@ struct nft_set_ops {
bool (*lookup)(const struct nft_set *set,
const struct nft_data *key,
const struct nft_set_ext **ext);
+ bool (*update)(const struct nft_set *set,
+ void *elem);
int (*get)(const struct nft_set *set,
struct nft_set_elem *elem);
int (*insert)(const struct nft_set *set,
@@ -373,13 +375,13 @@ struct nft_set {
u32 dtype;
u32 size;
u32 nelems;
- u32 timeout;
u16 policy;
/* runtime data below here */
const struct nft_set_ops *ops ____cacheline_aligned;
u16 flags;
u8 klen;
u8 dlen;
+ u32 timeout;
unsigned char data[]
__attribute__((aligned(__alignof__(u64))));
};
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index 144d8fe..d8bad34 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -510,6 +510,27 @@ enum nft_lookup_attributes {
};
#define NFTA_LOOKUP_MAX (__NFTA_LOOKUP_MAX - 1)
+enum nft_set_ops_ {
+ NFT_SET_OP_ADD,
+ NFT_SET_OP_UPDATE,
+ NFT_SET_OP_DELETE,
+};
+
+/**
+ * enum nft_set_attributes - set expression attributes
+ *
+ */
+enum nft_set_attributes_ {
+ NFTA_SET_UNSPEC_,
+ NFTA_SET_SET_NAME,
+ NFTA_SET_SET_ID,
+ NFTA_SET_OP,
+ NFTA_SET_SREG_KEY,
+ NFTA_SET_SREG_DATA,
+ __NFTA_SET_MAX_,
+};
+#define NFTA_SET_MAX_ (__NFTA_SET_MAX_ - 1)
+
/**
* enum nft_payload_bases - nf_tables payload expression offset bases
*
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index b02660f..a6c5942 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -482,6 +482,13 @@ config NFT_HASH
This option adds the "hash" set type that is used to build one-way
mappings between matchings and actions.
+config NFT_SET
+ depends on NF_TABLES
+ tristate "Netfilter nf_tables set module"
+ help
+ This options adds support for dynamic set updates during the packet
+ classification process.
+
config NFT_COUNTER
depends on NF_TABLES
tristate "Netfilter nf_tables counter module"
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
index 89f73a9..0ff329f 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
@@ -86,6 +86,7 @@ obj-$(CONFIG_NFT_REJECT) += nft_reject.o
obj-$(CONFIG_NFT_REJECT_INET) += nft_reject_inet.o
obj-$(CONFIG_NFT_RBTREE) += nft_rbtree.o
obj-$(CONFIG_NFT_HASH) += nft_hash.o
+obj-$(CONFIG_NFT_SET) += nft_set.o
obj-$(CONFIG_NFT_COUNTER) += nft_counter.o
obj-$(CONFIG_NFT_LOG) += nft_log.o
obj-$(CONFIG_NFT_MASQ) += nft_masq.o
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 95234a3..7bdc626 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2246,6 +2246,7 @@ struct nft_set *nf_tables_set_lookup(const struct nft_table *table,
}
return ERR_PTR(-ENOENT);
}
+EXPORT_SYMBOL_GPL(nf_tables_set_lookup);
struct nft_set *nf_tables_set_lookup_byid(const struct net *net,
const struct nlattr *nla)
@@ -2260,6 +2261,7 @@ struct nft_set *nf_tables_set_lookup_byid(const struct net *net,
}
return ERR_PTR(-ENOENT);
}
+EXPORT_SYMBOL(nf_tables_set_lookup_byid);
static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set,
const char *name)
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
index e7cf886..cc6750e 100644
--- a/net/netfilter/nft_hash.c
+++ b/net/netfilter/nft_hash.c
@@ -71,6 +71,19 @@ static bool nft_hash_lookup(const struct nft_set *set,
return !!he;
}
+static bool nft_hash_update(const struct nft_set *set, void *elem)
+{
+ struct nft_hash *priv = nft_set_priv(set);
+ struct nft_hash_elem *he = elem;
+ struct nft_hash_compare_arg arg = {
+ .key = nft_set_ext_key(&he->ext),
+ .len = set->klen,
+ };
+
+ return rhashtable_lookup_compare_insert(&priv->ht, &he->node,
+ nft_hash_compare, &arg);
+}
+
static int nft_hash_insert(const struct nft_set *set,
const struct nft_set_elem *elem)
{
@@ -96,7 +109,8 @@ static void nft_hash_remove(const struct nft_set *set,
struct nft_hash *priv = nft_set_priv(set);
struct nft_hash_elem *he = elem->cookie;
- rhashtable_remove(&priv->ht, &he->node);
+ if (!rhashtable_remove(&priv->ht, &he->node))
+ return;
synchronize_rcu();
kfree(elem->cookie);
}
@@ -171,7 +185,8 @@ static void nft_hash_gc(struct work_struct *work)
if (time_before(jiffies, timeout))
continue;
- rhashtable_remove(&priv->ht, &he->node);
+ if (!rhashtable_remove(&priv->ht, &he->node))
+ continue;
nft_hash_elem_destroy(set, he);
}
}
@@ -277,6 +292,7 @@ static struct nft_set_ops nft_hash_ops __read_mostly = {
.insert = nft_hash_insert,
.remove = nft_hash_remove,
.lookup = nft_hash_lookup,
+ .update = nft_hash_update,
.walk = nft_hash_walk,
.features = NFT_SET_MAP | NFT_SET_TIMEOUT,
.owner = THIS_MODULE,
diff --git a/net/netfilter/nft_set.c b/net/netfilter/nft_set.c
new file mode 100644
index 0000000..e94048e
--- /dev/null
+++ b/net/netfilter/nft_set.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2015 Patrick McHardy <kaber@trash.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/netlink.h>
+#include <linux/netfilter.h>
+#include <linux/netfilter/nf_tables.h>
+#include <net/netfilter/nf_tables.h>
+#include <net/netfilter/nf_tables_core.h>
+
+struct nft_set_expr {
+ struct nft_set *set;
+ enum nft_registers sreg_key:8;
+ enum nft_registers sreg_data:8;
+ unsigned long timeout;
+};
+
+static void nft_set_eval(const struct nft_expr *expr,
+ struct nft_data data[NFT_REG_MAX + 1],
+ const struct nft_pktinfo *pkt)
+{
+ const struct nft_set_expr *priv = nft_expr_priv(expr);
+ const struct nft_set *set = priv->set;
+ struct nft_set_ext_tmpl tmpl;
+ struct nft_set_ext *ext;
+ unsigned long timeout;
+ void *elem;
+
+ nft_set_ext_prepare(&tmpl);
+ nft_set_ext_add(&tmpl, NFT_SET_EXT_KEY);
+
+ timeout = 0;
+ if (set->flags & NFT_SET_TIMEOUT) {
+ timeout = priv->timeout ? : set->timeout;
+ if (timeout > 0)
+ nft_set_ext_add(&tmpl, NFT_SET_EXT_TIMEOUT);
+ }
+ if (set->flags & NFT_SET_MAP)
+ nft_set_ext_add(&tmpl, NFT_SET_EXT_DATA);
+
+ elem = kzalloc(set->ops->elemsize + tmpl.len, GFP_ATOMIC);
+ if (elem == NULL)
+ return;
+ ext = elem + set->ops->elemsize;
+ nft_set_ext_init(ext, &tmpl);
+
+ nft_data_copy(nft_set_ext_key(ext), &data[priv->sreg_key]);
+ if (set->flags & NFT_SET_MAP)
+ nft_data_copy(nft_set_ext_data(ext), &data[priv->sreg_data]);
+ if (timeout > 0)
+ *nft_set_ext_timeout(ext) = jiffies + timeout;
+
+ if (!set->ops->update(set, elem))
+ kfree(elem);
+}
+
+static const struct nla_policy nft_set_policy[NFTA_SET_MAX + 1] = {
+ [NFTA_SET_SET_NAME] = { .type = NLA_STRING },
+ [NFTA_SET_SET_ID] = { .type = NLA_U32 },
+ [NFTA_SET_OP] = { .type = NLA_U32 },
+ [NFTA_SET_SREG_KEY] = { .type = NLA_U32 },
+ [NFTA_SET_SREG_DATA] = { .type = NLA_U32 },
+ [NFTA_SET_TIMEOUT] = { .type = NLA_U32 },
+};
+
+static int nft_set_init(const struct nft_ctx *ctx,
+ const struct nft_expr *expr,
+ const struct nlattr * const tb[])
+{
+ struct nft_set_expr *priv = nft_expr_priv(expr);
+ struct nft_set *set;
+ enum nft_set_ops_ op;
+ int err;
+
+ if (tb[NFTA_SET_SET_NAME] == NULL ||
+ tb[NFTA_SET_OP] == NULL ||
+ tb[NFTA_SET_SREG_KEY] == NULL)
+ return -EINVAL;
+
+ op = ntohl(nla_get_be32(tb[NFTA_SET_OP]));
+ switch (op) {
+ case NFT_SET_ADD:
+ case NFT_SET_UPDATE:
+ case NFT_SET_DELETE:
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ set = nf_tables_set_lookup(ctx->table, tb[NFTA_SET_SET_NAME]);
+ if (IS_ERR(set)) {
+ if (tb[NFTA_SET_SET_ID])
+ set = nf_tables_set_lookup_byid(ctx->net,
+ tb[NFTA_SET_SET_ID]);
+ if (IS_ERR(set))
+ return PTR_ERR(set);
+ }
+
+ priv->sreg_key = ntohl(nla_get_be32(tb[NFTA_SET_SREG_KEY]));
+ err = nft_validate_input_register(priv->sreg_key);
+ if (err < 0)
+ return err;
+
+ if (tb[NFTA_SET_SREG_DATA] != NULL) {
+ if (!(set->flags & NFT_SET_MAP))
+ return -EINVAL;
+
+ priv->sreg_data = ntohl(nla_get_be32(tb[NFTA_SET_SREG_DATA]));
+ err = nft_validate_input_register(priv->sreg_data);
+ if (err < 0)
+ return err;
+ } else if (set->flags & NFT_SET_MAP)
+ return -EINVAL;
+
+ // FIXME: bind
+ priv->set = set;
+ return 0;
+}
+
+static int nft_set_dump(struct sk_buff *skb, const struct nft_expr *expr)
+{
+ const struct nft_set_expr *priv = nft_expr_priv(expr);
+
+ if (nla_put_be32(skb, NFTA_SET_SREG_KEY, htonl(priv->sreg_key)))
+ goto nla_put_failure;
+ if (priv->set->flags & NFT_SET_MAP &&
+ nla_put_be32(skb, NFTA_SET_SREG_DATA, htonl(priv->sreg_data)))
+ goto nla_put_failure;
+ if (nla_put_be32(skb, NFTA_SET_OP, htonl(priv->op)))
+ goto nla_put_failure;
+ if (nla_put_string(skb, NFTA_SET_SET_NAME, priv->set->name))
+ goto nla_put_failure;
+ return 0;
+
+nla_put_failure:
+ return -1;
+}
+
+static struct nft_expr_type nft_set_type;
+static const struct nft_expr_ops nft_set_ops = {
+ .type = &nft_set_type,
+ .size = NFT_EXPR_SIZE(sizeof(struct nft_set_expr)),
+ .eval = nft_set_eval,
+ .init = nft_set_init,
+ .dump = nft_set_dump,
+};
+
+static struct nft_expr_type nft_set_type __read_mostly = {
+ .name = "set",
+ .ops = &nft_set_ops,
+ .policy = nft_set_policy,
+ .maxattr = NFTA_SET_MAX,
+ .owner = THIS_MODULE,
+};
+
+int __init nft_set_module_init(void)
+{
+ return nft_register_expr(&nft_set_type);
+}
+
+void nft_set_module_exit(void)
+{
+ nft_unregister_expr(&nft_set_type);
+}
+
+module_init(nft_set_module_init);
+module_exit(nft_set_module_exit);
+MODULE_LICENSE("GPL");
--
2.1.0
^ permalink raw reply related
* [PATCH 6/9] netfilter: nf_tables: add set timeout support
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
include/net/netfilter/nf_tables.h | 9 ++++++
include/uapi/linux/netfilter/nf_tables.h | 6 ++++
net/netfilter/nf_tables_api.c | 51 ++++++++++++++++++++++++++++++--
3 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 60846da..735a59d 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -125,12 +125,14 @@ int nft_validate_data_load(const struct nft_ctx *ctx, enum nft_registers reg,
* @NFT_SET_EXT_KEY: element key
* @NFT_SET_EXT_DATA: mapping data
* @NFT_SET_EXT_FLAGS: element flags
+ * @NFT_SET_EXT_TIMEOUT: element timeout
* @NFT_SET_EXT_NUM: number of extension types
*/
enum nft_set_extensions {
NFT_SET_EXT_KEY,
NFT_SET_EXT_DATA,
NFT_SET_EXT_FLAGS,
+ NFT_SET_EXT_TIMEOUT,
NFT_SET_EXT_NUM
};
@@ -228,6 +230,11 @@ static inline u8 *nft_set_ext_flags(const struct nft_set_ext *ext)
return nft_set_ext(ext, NFT_SET_EXT_FLAGS);
}
+static inline unsigned long *nft_set_ext_timeout(const struct nft_set_ext *ext)
+{
+ return nft_set_ext(ext, NFT_SET_EXT_TIMEOUT);
+}
+
/**
* struct nft_set_elem - generic representation of set elements
*
@@ -350,6 +357,7 @@ void nft_unregister_set(struct nft_set_ops *ops);
* @dtype: data type (verdict or numeric type defined by userspace)
* @size: maximum set size
* @nelems: number of elements
+ * @timeout: default timeout value
* @policy: set parameterization (see enum nft_set_policies)
* @ops: set ops
* @flags: set flags
@@ -365,6 +373,7 @@ struct nft_set {
u32 dtype;
u32 size;
u32 nelems;
+ u32 timeout;
u16 policy;
/* runtime data below here */
const struct nft_set_ops *ops ____cacheline_aligned;
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index 832bc46..144d8fe 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -207,12 +207,14 @@ enum nft_rule_compat_attributes {
* @NFT_SET_CONSTANT: set contents may not change while bound
* @NFT_SET_INTERVAL: set contains intervals
* @NFT_SET_MAP: set is used as a dictionary
+ * @NFT_SET_TIMEOUT: set uses timeouts
*/
enum nft_set_flags {
NFT_SET_ANONYMOUS = 0x1,
NFT_SET_CONSTANT = 0x2,
NFT_SET_INTERVAL = 0x4,
NFT_SET_MAP = 0x8,
+ NFT_SET_TIMEOUT = 0x16,
};
/**
@@ -251,6 +253,7 @@ enum nft_set_desc_attributes {
* @NFTA_SET_POLICY: selection policy (NLA_U32)
* @NFTA_SET_DESC: set description (NLA_NESTED)
* @NFTA_SET_ID: uniquely identifies a set in a transaction (NLA_U32)
+ * @NFTA_SET_TIMEOUT: timeout default value (NLA_U32)
*/
enum nft_set_attributes {
NFTA_SET_UNSPEC,
@@ -264,6 +267,7 @@ enum nft_set_attributes {
NFTA_SET_POLICY,
NFTA_SET_DESC,
NFTA_SET_ID,
+ NFTA_SET_TIMEOUT,
__NFTA_SET_MAX
};
#define NFTA_SET_MAX (__NFTA_SET_MAX - 1)
@@ -283,12 +287,14 @@ enum nft_set_elem_flags {
* @NFTA_SET_ELEM_KEY: key value (NLA_NESTED: nft_data)
* @NFTA_SET_ELEM_DATA: data value of mapping (NLA_NESTED: nft_data_attributes)
* @NFTA_SET_ELEM_FLAGS: bitmask of nft_set_elem_flags (NLA_U32)
+ * @NFTA_SET_ELEM_TIMEOUT: timeout value (NLA_U32)
*/
enum nft_set_elem_attributes {
NFTA_SET_ELEM_UNSPEC,
NFTA_SET_ELEM_KEY,
NFTA_SET_ELEM_DATA,
NFTA_SET_ELEM_FLAGS,
+ NFTA_SET_ELEM_TIMEOUT,
__NFTA_SET_ELEM_MAX
};
#define NFTA_SET_ELEM_MAX (__NFTA_SET_ELEM_MAX - 1)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index cad0184..95234a3 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2194,6 +2194,7 @@ static const struct nla_policy nft_set_policy[NFTA_SET_MAX + 1] = {
[NFTA_SET_POLICY] = { .type = NLA_U32 },
[NFTA_SET_DESC] = { .type = NLA_NESTED },
[NFTA_SET_ID] = { .type = NLA_U32 },
+ [NFTA_SET_TIMEOUT] = { .type = NLA_U32 },
};
static const struct nla_policy nft_set_desc_policy[NFTA_SET_DESC_MAX + 1] = {
@@ -2344,6 +2345,10 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx,
goto nla_put_failure;
}
+ if (set->timeout &&
+ nla_put_be32(skb, NFTA_SET_TIMEOUT, htonl(set->timeout / HZ)))
+ goto nla_put_failure;
+
if (set->policy != NFT_SET_POL_PERFORMANCE) {
if (nla_put_be32(skb, NFTA_SET_POLICY, htonl(set->policy)))
goto nla_put_failure;
@@ -2557,6 +2562,7 @@ static int nf_tables_newset(struct sock *nlsk, struct sk_buff *skb,
bool create;
u32 ktype, dtype, flags, policy;
struct nft_set_desc desc;
+ unsigned int timeout;
int err;
if (nla[NFTA_SET_TABLE] == NULL ||
@@ -2582,7 +2588,8 @@ static int nf_tables_newset(struct sock *nlsk, struct sk_buff *skb,
if (nla[NFTA_SET_FLAGS] != NULL) {
flags = ntohl(nla_get_be32(nla[NFTA_SET_FLAGS]));
if (flags & ~(NFT_SET_ANONYMOUS | NFT_SET_CONSTANT |
- NFT_SET_INTERVAL | NFT_SET_MAP))
+ NFT_SET_INTERVAL | NFT_SET_MAP |
+ NFT_SET_TIMEOUT))
return -EINVAL;
}
@@ -2608,6 +2615,13 @@ static int nf_tables_newset(struct sock *nlsk, struct sk_buff *skb,
} else if (flags & NFT_SET_MAP)
return -EINVAL;
+ timeout = 0;
+ if (nla[NFTA_SET_TIMEOUT] != NULL) {
+ if (!(flags & NFT_SET_TIMEOUT))
+ return -EINVAL;
+ timeout = ntohl(nla_get_be32(nla[NFTA_SET_TIMEOUT])) * HZ;
+ }
+
policy = NFT_SET_POL_PERFORMANCE;
if (nla[NFTA_SET_POLICY] != NULL)
policy = ntohl(nla_get_be32(nla[NFTA_SET_POLICY]));
@@ -2675,6 +2689,7 @@ static int nf_tables_newset(struct sock *nlsk, struct sk_buff *skb,
set->flags = flags;
set->size = desc.size;
set->policy = policy;
+ set->timeout = timeout;
err = ops->init(set, &desc, nla);
if (err < 0)
@@ -2813,6 +2828,10 @@ const struct nft_set_ext_type nft_set_ext_types[] = {
.len = sizeof(u8),
.align = __alignof__(u8),
},
+ [NFT_SET_EXT_TIMEOUT] = {
+ .len = sizeof(unsigned long),
+ .align = __alignof__(unsigned long),
+ },
};
EXPORT_SYMBOL_GPL(nft_set_ext_types);
@@ -2824,6 +2843,7 @@ static const struct nla_policy nft_set_elem_policy[NFTA_SET_ELEM_MAX + 1] = {
[NFTA_SET_ELEM_KEY] = { .type = NLA_NESTED },
[NFTA_SET_ELEM_DATA] = { .type = NLA_NESTED },
[NFTA_SET_ELEM_FLAGS] = { .type = NLA_U32 },
+ [NFTA_SET_ELEM_TIMEOUT] = { .type = NLA_U32 },
};
static const struct nla_policy nft_set_elem_list_policy[NFTA_SET_ELEM_LIST_MAX + 1] = {
@@ -2885,6 +2905,20 @@ static int nf_tables_fill_setelem(struct sk_buff *skb,
htonl(*nft_set_ext_flags(ext))))
goto nla_put_failure;
+ if (nft_set_ext_exists(ext, NFT_SET_EXT_TIMEOUT)) {
+ unsigned long timeout;
+
+ timeout = *nft_set_ext_timeout(ext);
+ if (timeout > jiffies)
+ timeout = (timeout - jiffies) / HZ;
+ else
+ timeout = 0;
+
+ if (timeout &&
+ nla_put_be32(skb, NFTA_SET_ELEM_TIMEOUT, htonl(timeout)))
+ goto nla_put_failure;
+ }
+
nla_nest_end(skb, nest);
return 0;
@@ -3115,7 +3149,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
struct nft_data data;
enum nft_registers dreg;
struct nft_trans *trans;
- u32 flags;
+ u32 flags, timeout;
int err;
if (set->size && set->nelems == set->size)
@@ -3155,6 +3189,15 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
return -EINVAL;
}
+ timeout = 0;
+ if (nla[NFTA_SET_ELEM_TIMEOUT] != NULL) {
+ if (!(set->flags & NFT_SET_TIMEOUT))
+ return -EINVAL;
+ timeout = nla_get_be32(nla[NFTA_SET_ELEM_TIMEOUT]) * HZ;
+ } else if (set->flags & NFT_SET_TIMEOUT) {
+ timeout = set->timeout;
+ }
+
err = nft_data_init(ctx, &elem.key, &d1, nla[NFTA_SET_ELEM_KEY]);
if (err < 0)
goto err1;
@@ -3167,6 +3210,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
goto err2;
nft_set_ext_add(&tmpl, NFT_SET_EXT_KEY);
+ if (timeout > 0)
+ nft_set_ext_add(&tmpl, NFT_SET_EXT_TIMEOUT);
if (nla[NFTA_SET_ELEM_DATA] != NULL) {
err = nft_data_init(ctx, &data, &d2, nla[NFTA_SET_ELEM_DATA]);
@@ -3204,6 +3249,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
nft_data_copy(nft_set_ext_key(ext), &elem.key);
if (flags != 0)
*nft_set_ext_flags(ext) = flags;
+ if (timeout > 0)
+ *nft_set_ext_timeout(ext) = jiffies + timeout;
if (nla[NFTA_SET_ELEM_DATA] != NULL)
nft_data_copy(nft_set_ext_data(ext), &data);
--
2.1.0
^ permalink raw reply related
* [PATCH 5/9] netfilter: nf_tables: convert hash and rbtree to set extensions
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
include/net/netfilter/nf_tables.h | 15 ++++---
net/netfilter/nf_tables_api.c | 83 ++++++++++++++++++++++++++++-----------
net/netfilter/nft_hash.c | 52 +++++++-----------------
net/netfilter/nft_lookup.c | 6 ++-
net/netfilter/nft_rbtree.c | 68 +++++++++++---------------------
5 files changed, 112 insertions(+), 112 deletions(-)
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 9f2d073..60846da 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -233,8 +233,7 @@ static inline u8 *nft_set_ext_flags(const struct nft_set_ext *ext)
*
* @cookie: implementation specific element cookie
* @key: element key
- * @data: element data (maps only)
- * @flags: element flags (end of interval)
+ * @priv: element private data and extensions
*
* The cookie can be used to store a handle to the element for subsequent
* removal.
@@ -242,8 +241,7 @@ static inline u8 *nft_set_ext_flags(const struct nft_set_ext *ext)
struct nft_set_elem {
void *cookie;
struct nft_data key;
- struct nft_data data;
- u32 flags;
+ void *priv;
};
struct nft_set;
@@ -307,12 +305,13 @@ struct nft_set_estimate {
* @destroy: destroy private data of set instance
* @list: nf_tables_set_ops list node
* @owner: module reference
+ * @elemsize: element private size
* @features: features supported by the implementation
*/
struct nft_set_ops {
bool (*lookup)(const struct nft_set *set,
const struct nft_data *key,
- struct nft_data *data);
+ const struct nft_set_ext **ext);
int (*get)(const struct nft_set *set,
struct nft_set_elem *elem);
int (*insert)(const struct nft_set *set,
@@ -334,6 +333,7 @@ struct nft_set_ops {
struct list_head list;
struct module *owner;
+ unsigned int elemsize;
u32 features;
};
@@ -380,6 +380,11 @@ static inline void *nft_set_priv(const struct nft_set *set)
return (void *)set->data;
}
+static inline struct nft_set_ext *nft_set_elem_ext(const struct nft_set *set, void *priv)
+{
+ return priv + set->ops->elemsize;
+}
+
struct nft_set *nf_tables_set_lookup(const struct nft_table *table,
const struct nlattr *nla);
struct nft_set *nf_tables_set_lookup_byid(const struct net *net,
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index fbc73a0..cad0184 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2743,10 +2743,11 @@ static int nf_tables_bind_check_setelem(const struct nft_ctx *ctx,
const struct nft_set_iter *iter,
const struct nft_set_elem *elem)
{
+ const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv);
enum nft_registers dreg;
dreg = nft_type_to_reg(set->dtype);
- return nft_validate_data_load(ctx, dreg, &elem->data,
+ return nft_validate_data_load(ctx, dreg, nft_set_ext_data(ext),
set->dtype == NFT_DATA_VERDICT ?
NFT_DATA_VERDICT : NFT_DATA_VALUE);
}
@@ -2861,6 +2862,7 @@ static int nf_tables_fill_setelem(struct sk_buff *skb,
const struct nft_set *set,
const struct nft_set_elem *elem)
{
+ const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv);
unsigned char *b = skb_tail_pointer(skb);
struct nlattr *nest;
@@ -2868,20 +2870,20 @@ static int nf_tables_fill_setelem(struct sk_buff *skb,
if (nest == NULL)
goto nla_put_failure;
- if (nft_data_dump(skb, NFTA_SET_ELEM_KEY, &elem->key, NFT_DATA_VALUE,
- set->klen) < 0)
+ if (nft_data_dump(skb, NFTA_SET_ELEM_KEY, nft_set_ext_key(ext),
+ NFT_DATA_VALUE, set->klen) < 0)
goto nla_put_failure;
- if (set->flags & NFT_SET_MAP &&
- !(elem->flags & NFT_SET_ELEM_INTERVAL_END) &&
- nft_data_dump(skb, NFTA_SET_ELEM_DATA, &elem->data,
+ if (nft_set_ext_exists(ext, NFT_SET_EXT_DATA) &&
+ nft_data_dump(skb, NFTA_SET_ELEM_DATA, nft_set_ext_data(ext),
set->dtype == NFT_DATA_VERDICT ? NFT_DATA_VERDICT : NFT_DATA_VALUE,
set->dlen) < 0)
goto nla_put_failure;
- if (elem->flags != 0)
- if (nla_put_be32(skb, NFTA_SET_ELEM_FLAGS, htonl(elem->flags)))
- goto nla_put_failure;
+ if (nft_set_ext_exists(ext, NFT_SET_EXT_FLAGS) &&
+ nla_put_be32(skb, NFTA_SET_ELEM_FLAGS,
+ htonl(*nft_set_ext_flags(ext))))
+ goto nla_put_failure;
nla_nest_end(skb, nest);
return 0;
@@ -3106,10 +3108,14 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
{
struct nlattr *nla[NFTA_SET_ELEM_MAX + 1];
struct nft_data_desc d1, d2;
+ struct nft_set_ext_tmpl tmpl;
+ struct nft_set_ext *ext;
struct nft_set_elem elem;
struct nft_set_binding *binding;
+ struct nft_data data;
enum nft_registers dreg;
struct nft_trans *trans;
+ u32 flags;
int err;
if (set->size && set->nelems == set->size)
@@ -3123,22 +3129,26 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
if (nla[NFTA_SET_ELEM_KEY] == NULL)
return -EINVAL;
- elem.flags = 0;
+ nft_set_ext_prepare(&tmpl);
+
+ flags = 0;
if (nla[NFTA_SET_ELEM_FLAGS] != NULL) {
- elem.flags = ntohl(nla_get_be32(nla[NFTA_SET_ELEM_FLAGS]));
- if (elem.flags & ~NFT_SET_ELEM_INTERVAL_END)
+ flags = ntohl(nla_get_be32(nla[NFTA_SET_ELEM_FLAGS]));
+ if (flags & ~NFT_SET_ELEM_INTERVAL_END)
return -EINVAL;
if (!(set->flags & NFT_SET_INTERVAL) &&
- elem.flags & NFT_SET_ELEM_INTERVAL_END)
+ flags & NFT_SET_ELEM_INTERVAL_END)
return -EINVAL;
+ if (flags != 0)
+ nft_set_ext_add(&tmpl, NFT_SET_EXT_FLAGS);
}
if (set->flags & NFT_SET_MAP) {
if (nla[NFTA_SET_ELEM_DATA] == NULL &&
- !(elem.flags & NFT_SET_ELEM_INTERVAL_END))
+ !(flags & NFT_SET_ELEM_INTERVAL_END))
return -EINVAL;
if (nla[NFTA_SET_ELEM_DATA] != NULL &&
- elem.flags & NFT_SET_ELEM_INTERVAL_END)
+ flags & NFT_SET_ELEM_INTERVAL_END)
return -EINVAL;
} else {
if (nla[NFTA_SET_ELEM_DATA] != NULL)
@@ -3156,8 +3166,10 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
if (set->ops->get(set, &elem) == 0)
goto err2;
+ nft_set_ext_add(&tmpl, NFT_SET_EXT_KEY);
+
if (nla[NFTA_SET_ELEM_DATA] != NULL) {
- err = nft_data_init(ctx, &elem.data, &d2, nla[NFTA_SET_ELEM_DATA]);
+ err = nft_data_init(ctx, &data, &d2, nla[NFTA_SET_ELEM_DATA]);
if (err < 0)
goto err2;
@@ -3174,29 +3186,46 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
};
err = nft_validate_data_load(&bind_ctx, dreg,
- &elem.data, d2.type);
+ &data, d2.type);
if (err < 0)
goto err3;
}
+
+ nft_set_ext_add(&tmpl, NFT_SET_EXT_DATA);
}
+ err = -ENOMEM;
+ elem.priv = kzalloc(set->ops->elemsize + tmpl.len, GFP_KERNEL);
+ if (elem.priv == NULL)
+ goto err3;
+ ext = elem.priv + set->ops->elemsize;
+
+ nft_set_ext_init(ext, &tmpl);
+ nft_data_copy(nft_set_ext_key(ext), &elem.key);
+ if (flags != 0)
+ *nft_set_ext_flags(ext) = flags;
+ if (nla[NFTA_SET_ELEM_DATA] != NULL)
+ nft_data_copy(nft_set_ext_data(ext), &data);
+
trans = nft_trans_elem_alloc(ctx, NFT_MSG_NEWSETELEM, set);
if (trans == NULL)
- goto err3;
+ goto err4;
err = set->ops->insert(set, &elem);
if (err < 0)
- goto err4;
+ goto err5;
nft_trans_elem(trans) = elem;
list_add_tail(&trans->list, &ctx->net->nft.commit_list);
return 0;
-err4:
+err5:
kfree(trans);
+err4:
+ kfree(elem.priv);
err3:
if (nla[NFTA_SET_ELEM_DATA] != NULL)
- nft_data_uninit(&elem.data, d2.type);
+ nft_data_uninit(&data, d2.type);
err2:
nft_data_uninit(&elem.key, d1.type);
err1:
@@ -3617,10 +3646,12 @@ static int nf_tables_commit(struct sk_buff *skb)
te->set->ops->get(te->set, &te->elem);
te->set->ops->remove(te->set, &te->elem);
nft_data_uninit(&te->elem.key, NFT_DATA_VALUE);
+#if 0
if (te->elem.flags & NFT_SET_MAP) {
nft_data_uninit(&te->elem.data,
te->set->dtype);
}
+#endif
nft_trans_destroy(trans);
break;
}
@@ -3785,13 +3816,17 @@ static int nf_tables_loop_check_setelem(const struct nft_ctx *ctx,
const struct nft_set_iter *iter,
const struct nft_set_elem *elem)
{
- if (elem->flags & NFT_SET_ELEM_INTERVAL_END)
+ const struct nft_set_ext *ext = nft_set_elem_ext(set, elem->priv);
+ const struct nft_data *data;
+
+ if (*nft_set_ext_flags(ext) & NFT_SET_ELEM_INTERVAL_END)
return 0;
- switch (elem->data.verdict) {
+ data = nft_set_ext_data(ext);
+ switch (data->verdict) {
case NFT_JUMP:
case NFT_GOTO:
- return nf_tables_check_loops(ctx, elem->data.chain);
+ return nf_tables_check_loops(ctx, data->chain);
default:
return 0;
}
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
index 75887d7..cba0ad2 100644
--- a/net/netfilter/nft_hash.c
+++ b/net/netfilter/nft_hash.c
@@ -25,20 +25,19 @@
struct nft_hash_elem {
struct rhash_head node;
- struct nft_data key;
- struct nft_data data[];
+ struct nft_set_ext ext;
};
static bool nft_hash_lookup(const struct nft_set *set,
const struct nft_data *key,
- struct nft_data *data)
+ const struct nft_set_ext **ext)
{
struct rhashtable *priv = nft_set_priv(set);
const struct nft_hash_elem *he;
he = rhashtable_lookup(priv, key);
- if (he && set->flags & NFT_SET_MAP)
- nft_data_copy(data, he->data);
+ if (he != NULL)
+ *ext = &he->ext;
return !!he;
}
@@ -47,35 +46,18 @@ static int nft_hash_insert(const struct nft_set *set,
const struct nft_set_elem *elem)
{
struct rhashtable *priv = nft_set_priv(set);
- struct nft_hash_elem *he;
- unsigned int size;
-
- if (elem->flags != 0)
- return -EINVAL;
-
- size = sizeof(*he);
- if (set->flags & NFT_SET_MAP)
- size += sizeof(he->data[0]);
-
- he = kzalloc(size, GFP_KERNEL);
- if (he == NULL)
- return -ENOMEM;
-
- nft_data_copy(&he->key, &elem->key);
- if (set->flags & NFT_SET_MAP)
- nft_data_copy(he->data, &elem->data);
+ struct nft_hash_elem *he = elem->priv;
rhashtable_insert(priv, &he->node);
-
return 0;
}
static void nft_hash_elem_destroy(const struct nft_set *set,
struct nft_hash_elem *he)
{
- nft_data_uninit(&he->key, NFT_DATA_VALUE);
+ nft_data_uninit(nft_set_ext_key(&he->ext), NFT_DATA_VALUE);
if (set->flags & NFT_SET_MAP)
- nft_data_uninit(he->data, set->dtype);
+ nft_data_uninit(nft_set_ext_data(&he->ext), set->dtype);
kfree(he);
}
@@ -99,12 +81,10 @@ static bool nft_hash_compare(void *ptr, void *arg)
struct nft_hash_elem *he = ptr;
struct nft_compare_arg *x = arg;
- if (!nft_data_cmp(&he->key, &x->elem->key, x->set->klen)) {
+ if (!nft_data_cmp(nft_set_ext_key(&he->ext), &x->elem->key,
+ x->set->klen)) {
x->elem->cookie = he;
- x->elem->flags = 0;
- if (x->set->flags & NFT_SET_MAP)
- nft_data_copy(&x->elem->data, he->data);
-
+ x->elem->priv = he;
return true;
}
@@ -131,7 +111,7 @@ static void nft_hash_walk(const struct nft_ctx *ctx, const struct nft_set *set,
{
struct rhashtable *priv = nft_set_priv(set);
const struct bucket_table *tbl;
- const struct nft_hash_elem *he;
+ struct nft_hash_elem *he;
struct nft_set_elem elem;
unsigned int i;
@@ -143,10 +123,7 @@ static void nft_hash_walk(const struct nft_ctx *ctx, const struct nft_set *set,
if (iter->count < iter->skip)
goto cont;
- memcpy(&elem.key, &he->key, sizeof(elem.key));
- if (set->flags & NFT_SET_MAP)
- memcpy(&elem.data, he->data, sizeof(elem.data));
- elem.flags = 0;
+ elem.priv = he;
iter->err = iter->fn(ctx, set, iter, &elem);
if (iter->err < 0)
@@ -170,7 +147,7 @@ static int nft_hash_init(const struct nft_set *set,
struct rhashtable_params params = {
.nelem_hint = desc->size ? : NFT_HASH_ELEMENT_HINT,
.head_offset = offsetof(struct nft_hash_elem, node),
- .key_offset = offsetof(struct nft_hash_elem, key),
+ .key_offset = offsetof(struct nft_hash_elem, ext) + 8,
.key_len = set->klen,
.hashfn = jhash,
.grow_decision = rht_grow_above_75,
@@ -209,7 +186,7 @@ static bool nft_hash_estimate(const struct nft_set_desc *desc, u32 features,
esize = sizeof(struct nft_hash_elem);
if (features & NFT_SET_MAP)
- esize += FIELD_SIZEOF(struct nft_hash_elem, data[0]);
+ esize += sizeof(struct nft_data);
if (desc->size) {
est->size = sizeof(struct rhashtable) +
@@ -232,6 +209,7 @@ static bool nft_hash_estimate(const struct nft_set_desc *desc, u32 features,
static struct nft_set_ops nft_hash_ops __read_mostly = {
.privsize = nft_hash_privsize,
+ .elemsize = offsetof(struct nft_hash_elem, ext),
.estimate = nft_hash_estimate,
.init = nft_hash_init,
.destroy = nft_hash_destroy,
diff --git a/net/netfilter/nft_lookup.c b/net/netfilter/nft_lookup.c
index 6404a72..cdbf050 100644
--- a/net/netfilter/nft_lookup.c
+++ b/net/netfilter/nft_lookup.c
@@ -31,9 +31,13 @@ static void nft_lookup_eval(const struct nft_expr *expr,
{
const struct nft_lookup *priv = nft_expr_priv(expr);
const struct nft_set *set = priv->set;
+ const struct nft_set_ext *ext;
- if (set->ops->lookup(set, &data[priv->sreg], &data[priv->dreg]))
+ if (set->ops->lookup(set, &data[priv->sreg], &ext)) {
+ if (set->flags & NFT_SET_MAP)
+ nft_data_copy(&data[priv->dreg], nft_set_ext_data(ext));
return;
+ }
data[NFT_REG_VERDICT].verdict = NFT_BREAK;
}
diff --git a/net/netfilter/nft_rbtree.c b/net/netfilter/nft_rbtree.c
index 417796f..e721744 100644
--- a/net/netfilter/nft_rbtree.c
+++ b/net/netfilter/nft_rbtree.c
@@ -26,14 +26,12 @@ struct nft_rbtree {
struct nft_rbtree_elem {
struct rb_node node;
- u16 flags;
- struct nft_data key;
- struct nft_data data[];
+ struct nft_set_ext ext;
};
static bool nft_rbtree_lookup(const struct nft_set *set,
const struct nft_data *key,
- struct nft_data *data)
+ const struct nft_set_ext **ext)
{
const struct nft_rbtree *priv = nft_set_priv(set);
const struct nft_rbtree_elem *rbe, *interval = NULL;
@@ -45,7 +43,7 @@ static bool nft_rbtree_lookup(const struct nft_set *set,
while (parent != NULL) {
rbe = rb_entry(parent, struct nft_rbtree_elem, node);
- d = nft_data_cmp(&rbe->key, key, set->klen);
+ d = nft_data_cmp(nft_set_ext_key(&rbe->ext), key, set->klen);
if (d < 0) {
parent = parent->rb_left;
interval = rbe;
@@ -53,12 +51,12 @@ static bool nft_rbtree_lookup(const struct nft_set *set,
parent = parent->rb_right;
else {
found:
- if (rbe->flags & NFT_SET_ELEM_INTERVAL_END)
+ if (*nft_set_ext_flags(&rbe->ext) &
+ NFT_SET_ELEM_INTERVAL_END)
goto out;
- if (set->flags & NFT_SET_MAP)
- nft_data_copy(data, rbe->data);
-
spin_unlock_bh(&nft_rbtree_lock);
+ // FIXME: valid?
+ *ext = &rbe->ext;
return true;
}
}
@@ -75,10 +73,10 @@ out:
static void nft_rbtree_elem_destroy(const struct nft_set *set,
struct nft_rbtree_elem *rbe)
{
- nft_data_uninit(&rbe->key, NFT_DATA_VALUE);
+ nft_data_uninit(nft_set_ext_key(&rbe->ext), NFT_DATA_VALUE);
if (set->flags & NFT_SET_MAP &&
- !(rbe->flags & NFT_SET_ELEM_INTERVAL_END))
- nft_data_uninit(rbe->data, set->dtype);
+ nft_set_ext_exists(&rbe->ext, NFT_SET_EXT_DATA))
+ nft_data_uninit(nft_set_ext_data(&rbe->ext), set->dtype);
kfree(rbe);
}
@@ -96,7 +94,9 @@ static int __nft_rbtree_insert(const struct nft_set *set,
while (*p != NULL) {
parent = *p;
rbe = rb_entry(parent, struct nft_rbtree_elem, node);
- d = nft_data_cmp(&rbe->key, &new->key, set->klen);
+ d = nft_data_cmp(nft_set_ext_key(&rbe->ext),
+ nft_set_ext_key(&new->ext),
+ set->klen);
if (d < 0)
p = &parent->rb_left;
else if (d > 0)
@@ -112,31 +112,13 @@ static int __nft_rbtree_insert(const struct nft_set *set,
static int nft_rbtree_insert(const struct nft_set *set,
const struct nft_set_elem *elem)
{
- struct nft_rbtree_elem *rbe;
- unsigned int size;
+ struct nft_rbtree_elem *rbe = elem->priv;
int err;
- size = sizeof(*rbe);
- if (set->flags & NFT_SET_MAP &&
- !(elem->flags & NFT_SET_ELEM_INTERVAL_END))
- size += sizeof(rbe->data[0]);
-
- rbe = kzalloc(size, GFP_KERNEL);
- if (rbe == NULL)
- return -ENOMEM;
-
- rbe->flags = elem->flags;
- nft_data_copy(&rbe->key, &elem->key);
- if (set->flags & NFT_SET_MAP &&
- !(rbe->flags & NFT_SET_ELEM_INTERVAL_END))
- nft_data_copy(rbe->data, &elem->data);
-
spin_lock_bh(&nft_rbtree_lock);
err = __nft_rbtree_insert(set, rbe);
- if (err < 0)
- kfree(rbe);
-
spin_unlock_bh(&nft_rbtree_lock);
+
return err;
}
@@ -162,17 +144,16 @@ static int nft_rbtree_get(const struct nft_set *set, struct nft_set_elem *elem)
while (parent != NULL) {
rbe = rb_entry(parent, struct nft_rbtree_elem, node);
- d = nft_data_cmp(&rbe->key, &elem->key, set->klen);
+ d = nft_data_cmp(nft_set_ext_key(&rbe->ext), &elem->key,
+ set->klen);
if (d < 0)
parent = parent->rb_left;
else if (d > 0)
parent = parent->rb_right;
else {
elem->cookie = rbe;
- if (set->flags & NFT_SET_MAP &&
- !(rbe->flags & NFT_SET_ELEM_INTERVAL_END))
- nft_data_copy(&elem->data, rbe->data);
- elem->flags = rbe->flags;
+ elem->priv = rbe;
+ spin_unlock_bh(&nft_rbtree_lock);
return 0;
}
}
@@ -184,7 +165,7 @@ static void nft_rbtree_walk(const struct nft_ctx *ctx,
struct nft_set_iter *iter)
{
const struct nft_rbtree *priv = nft_set_priv(set);
- const struct nft_rbtree_elem *rbe;
+ struct nft_rbtree_elem *rbe;
struct nft_set_elem elem;
struct rb_node *node;
@@ -193,11 +174,7 @@ static void nft_rbtree_walk(const struct nft_ctx *ctx,
goto cont;
rbe = rb_entry(node, struct nft_rbtree_elem, node);
- nft_data_copy(&elem.key, &rbe->key);
- if (set->flags & NFT_SET_MAP &&
- !(rbe->flags & NFT_SET_ELEM_INTERVAL_END))
- nft_data_copy(&elem.data, rbe->data);
- elem.flags = rbe->flags;
+ elem.priv = rbe;
iter->err = iter->fn(ctx, set, iter, &elem);
if (iter->err < 0)
@@ -242,7 +219,7 @@ static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features,
nsize = sizeof(struct nft_rbtree_elem);
if (features & NFT_SET_MAP)
- nsize += FIELD_SIZEOF(struct nft_rbtree_elem, data[0]);
+ nsize += sizeof(struct nft_data);
if (desc->size)
est->size = sizeof(struct nft_rbtree) + desc->size * nsize;
@@ -256,6 +233,7 @@ static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features,
static struct nft_set_ops nft_rbtree_ops __read_mostly = {
.privsize = nft_rbtree_privsize,
+ .elemsize = offsetof(struct nft_rbtree_elem, ext),
.estimate = nft_rbtree_estimate,
.init = nft_rbtree_init,
.destroy = nft_rbtree_destroy,
--
2.1.0
^ permalink raw reply related
* [PATCH 4/9] netfilter: nf_tables: add set extensions
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Add simple set extension infrastructure for maintaining variable sized
and optional per element data.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
include/net/netfilter/nf_tables.h | 109 ++++++++++++++++++++++++++++++++++++++
net/netfilter/nf_tables_api.c | 16 ++++++
2 files changed, 125 insertions(+)
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 3ae969e..9f2d073 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -120,6 +120,115 @@ int nft_validate_data_load(const struct nft_ctx *ctx, enum nft_registers reg,
enum nft_data_types type);
/**
+ * enum nft_set_extensions - set extension type IDs
+ *
+ * @NFT_SET_EXT_KEY: element key
+ * @NFT_SET_EXT_DATA: mapping data
+ * @NFT_SET_EXT_FLAGS: element flags
+ * @NFT_SET_EXT_NUM: number of extension types
+ */
+enum nft_set_extensions {
+ NFT_SET_EXT_KEY,
+ NFT_SET_EXT_DATA,
+ NFT_SET_EXT_FLAGS,
+ NFT_SET_EXT_NUM
+};
+
+/**
+ * struct nft_set_ext_type - set extension types
+ *
+ * @len: fixed part length of the extension
+ * @align: alignment requirements of the extension
+ */
+struct nft_set_ext_type {
+ u8 len;
+ u8 align;
+};
+
+extern const struct nft_set_ext_type nft_set_ext_types[];
+
+static inline u8 nft_set_ext_size(u8 id)
+{
+ return nft_set_ext_types[id].len;
+}
+
+static inline u8 nft_set_ext_offset(u8 size, u8 id)
+{
+ return ALIGN(size, nft_set_ext_types[id].align);
+}
+
+/**
+ * struct nft_set_ext_tmpl - set extension template
+ *
+ * @offset: offsets of individual extension types
+ * @len: length of extension area
+ */
+struct nft_set_ext_tmpl {
+ u8 offset[NFT_SET_EXT_NUM];
+ u8 len;
+};
+
+/**
+ * struct nft_set_ext - set extensions
+ *
+ * @offset: offsets of individual extension types
+ * @data: beginning of extension data
+ */
+struct nft_set_ext {
+ u8 offset[NFT_SET_EXT_NUM];
+ char data[0];
+};
+
+static inline void nft_set_ext_prepare(struct nft_set_ext_tmpl *tmpl)
+{
+ memset(tmpl, 0, sizeof(*tmpl));
+ tmpl->len = sizeof(struct nft_set_ext);
+}
+
+static inline void nft_set_ext_add(struct nft_set_ext_tmpl *tmpl, u8 id)
+{
+ tmpl->len = ALIGN(tmpl->len, nft_set_ext_types[id].align);
+ tmpl->offset[id] = tmpl->len;
+ tmpl->len += nft_set_ext_types[id].len;
+}
+
+static inline void nft_set_ext_init(struct nft_set_ext *ext,
+ const struct nft_set_ext_tmpl *tmpl)
+{
+ memcpy(ext->offset, tmpl->offset, sizeof(ext->offset));
+}
+
+static inline bool __nft_set_ext_exists(const struct nft_set_ext *ext, u8 id)
+{
+ return !!ext->offset[id];
+}
+
+static inline bool nft_set_ext_exists(const struct nft_set_ext *ext, u8 id)
+{
+ return ext && __nft_set_ext_exists(ext, id);
+}
+
+static inline void *nft_set_ext(const struct nft_set_ext *ext, u8 id)
+{
+ return (void *)ext + ext->offset[id];
+}
+
+static inline struct nft_data *nft_set_ext_key(const struct nft_set_ext *ext)
+{
+ return nft_set_ext(ext, NFT_SET_EXT_KEY);
+}
+
+static inline struct nft_data *nft_set_ext_data(const struct nft_set_ext *ext)
+{
+ return nft_set_ext(ext, NFT_SET_EXT_DATA);
+}
+
+static inline u8 *nft_set_ext_flags(const struct nft_set_ext *ext)
+{
+ return nft_set_ext(ext, NFT_SET_EXT_FLAGS);
+}
+
+/**
* struct nft_set_elem - generic representation of set elements
*
* @cookie: implementation specific element cookie
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 92ba4a0..fbc73a0 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2799,6 +2799,22 @@ void nf_tables_unbind_set(const struct nft_ctx *ctx, struct nft_set *set,
nf_tables_set_destroy(ctx, set);
}
+const struct nft_set_ext_type nft_set_ext_types[] = {
+ [NFT_SET_EXT_KEY] = {
+ .len = sizeof(struct nft_data),
+ .align = __alignof__(struct nft_data),
+ },
+ [NFT_SET_EXT_DATA] = {
+ .len = sizeof(struct nft_data),
+ .align = __alignof__(struct nft_data),
+ },
+ [NFT_SET_EXT_FLAGS] = {
+ .len = sizeof(u8),
+ .align = __alignof__(u8),
+ },
+};
+EXPORT_SYMBOL_GPL(nft_set_ext_types);
+
/*
* Set elements
*/
--
2.1.0
^ permalink raw reply related
* [PATCH 3/9] nftables: nft_rbtree: fix locking
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Fix a race condition and unnecessary locking:
* the root rb_node must only be accessed under the lock in nft_rbtree_lookup()
* the lock is not needed in lookup functions in netlink contexts
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
net/netfilter/nft_rbtree.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/net/netfilter/nft_rbtree.c b/net/netfilter/nft_rbtree.c
index 46214f2..417796f 100644
--- a/net/netfilter/nft_rbtree.c
+++ b/net/netfilter/nft_rbtree.c
@@ -37,10 +37,11 @@ static bool nft_rbtree_lookup(const struct nft_set *set,
{
const struct nft_rbtree *priv = nft_set_priv(set);
const struct nft_rbtree_elem *rbe, *interval = NULL;
- const struct rb_node *parent = priv->root.rb_node;
+ const struct rb_node *parent;
int d;
spin_lock_bh(&nft_rbtree_lock);
+ parent = priv->root.rb_node;
while (parent != NULL) {
rbe = rb_entry(parent, struct nft_rbtree_elem, node);
@@ -158,7 +159,6 @@ static int nft_rbtree_get(const struct nft_set *set, struct nft_set_elem *elem)
struct nft_rbtree_elem *rbe;
int d;
- spin_lock_bh(&nft_rbtree_lock);
while (parent != NULL) {
rbe = rb_entry(parent, struct nft_rbtree_elem, node);
@@ -173,11 +173,9 @@ static int nft_rbtree_get(const struct nft_set *set, struct nft_set_elem *elem)
!(rbe->flags & NFT_SET_ELEM_INTERVAL_END))
nft_data_copy(&elem->data, rbe->data);
elem->flags = rbe->flags;
- spin_unlock_bh(&nft_rbtree_lock);
return 0;
}
}
- spin_unlock_bh(&nft_rbtree_lock);
return -ENOENT;
}
@@ -190,7 +188,6 @@ static void nft_rbtree_walk(const struct nft_ctx *ctx,
struct nft_set_elem elem;
struct rb_node *node;
- spin_lock_bh(&nft_rbtree_lock);
for (node = rb_first(&priv->root); node != NULL; node = rb_next(node)) {
if (iter->count < iter->skip)
goto cont;
@@ -203,14 +200,11 @@ static void nft_rbtree_walk(const struct nft_ctx *ctx,
elem.flags = rbe->flags;
iter->err = iter->fn(ctx, set, iter, &elem);
- if (iter->err < 0) {
- spin_unlock_bh(&nft_rbtree_lock);
+ if (iter->err < 0)
return;
- }
cont:
iter->count++;
}
- spin_unlock_bh(&nft_rbtree_lock);
}
static unsigned int nft_rbtree_privsize(const struct nlattr * const nla[])
--
2.1.0
^ permalink raw reply related
* [PATCH 2/9] nftables: reject NFT_SET_ELEM_INTERVAL_END flag for non-interval sets
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
net/netfilter/nf_tables_api.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 129a8da..92ba4a0 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -3112,6 +3112,9 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
elem.flags = ntohl(nla_get_be32(nla[NFTA_SET_ELEM_FLAGS]));
if (elem.flags & ~NFT_SET_ELEM_INTERVAL_END)
return -EINVAL;
+ if (!(set->flags & NFT_SET_INTERVAL) &&
+ elem.flags & NFT_SET_ELEM_INTERVAL_END)
+ return -EINVAL;
}
if (set->flags & NFT_SET_MAP) {
--
2.1.0
^ permalink raw reply related
* [PATCH 1/9] rhashtable: simplify rhashtable_remove()
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Remove some duplicated code by moving the restart label up a few
lines. Also use rcu_access_pointer() for the pointer comparison
instead of rht_dereference_rcu().
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
lib/rhashtable.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index aca6998..5f079f7 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -588,12 +588,12 @@ bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *obj)
rcu_read_lock();
tbl = rht_dereference_rcu(ht->tbl, ht);
+restart:
hash = head_hashfn(ht, tbl, obj);
lock = bucket_lock(tbl, hash);
spin_lock_bh(lock);
-restart:
pprev = &tbl->buckets[hash];
rht_for_each(he, tbl, hash) {
if (he != obj) {
@@ -613,14 +613,10 @@ restart:
return true;
}
- if (tbl != rht_dereference_rcu(ht->future_tbl, ht)) {
+ if (tbl != rcu_access_pointer(ht->future_tbl)) {
spin_unlock_bh(lock);
tbl = rht_dereference_rcu(ht->future_tbl, ht);
- hash = head_hashfn(ht, tbl, obj);
-
- lock = bucket_lock(tbl, hash);
- spin_lock_bh(lock);
goto restart;
}
--
2.1.0
^ permalink raw reply related
* [PATCH 0/9 WIP] nf_tables: set extensions and dynamic updates
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
Hi Herbert,
following is the nftables patchset for dynamic set updates and timeouts.
Probably the only interesting part is in patch 7/9, which adds GC to
nft_hash. Nothing special, just walking the hash and zapping entries.
Please keep in mind that this is work in progress, there are some known
bugs and problems left.
Cheers,
Patrick
^ permalink raw reply
* [PATCH 8/9] netfilter: nft_lookup: add missing attribute validation for NFTA_LOOKUP_SET_ID
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
net/netfilter/nft_lookup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/netfilter/nft_lookup.c b/net/netfilter/nft_lookup.c
index cdbf050..a5f30b8 100644
--- a/net/netfilter/nft_lookup.c
+++ b/net/netfilter/nft_lookup.c
@@ -43,6 +43,7 @@ static void nft_lookup_eval(const struct nft_expr *expr,
static const struct nla_policy nft_lookup_policy[NFTA_LOOKUP_MAX + 1] = {
[NFTA_LOOKUP_SET] = { .type = NLA_STRING },
+ [NFTA_LOOKUP_SET_ID] = { .type = NLA_U32 },
[NFTA_LOOKUP_SREG] = { .type = NLA_U32 },
[NFTA_LOOKUP_DREG] = { .type = NLA_U32 },
};
--
2.1.0
^ permalink raw reply related
* [PATCH 7/9] netfilter: nft_hash: add support for timeouts
From: Patrick McHardy @ 2015-01-30 7:46 UTC (permalink / raw)
To: herbert
Cc: tgraf, davem, David.Laight, ying.xue, paulmck, netdev,
netfilter-devel
In-Reply-To: <1422603994-5836-1-git-send-email-kaber@trash.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
net/netfilter/nft_hash.c | 153 +++++++++++++++++++++++++++++++++--------------
1 file changed, 107 insertions(+), 46 deletions(-)
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
index cba0ad2..e7cf886 100644
--- a/net/netfilter/nft_hash.c
+++ b/net/netfilter/nft_hash.c
@@ -15,6 +15,7 @@
#include <linux/log2.h>
#include <linux/jhash.h>
#include <linux/netlink.h>
+#include <linux/workqueue.h>
#include <linux/rhashtable.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nf_tables.h>
@@ -23,19 +24,47 @@
/* We target a hash table size of 4, element hint is 75% of final size */
#define NFT_HASH_ELEMENT_HINT 3
+struct nft_hash {
+ struct rhashtable ht;
+ struct delayed_work gc_work;
+};
+
struct nft_hash_elem {
struct rhash_head node;
struct nft_set_ext ext;
};
+struct nft_hash_compare_arg {
+ const struct nft_data *key;
+ unsigned int len;
+};
+
+static bool nft_hash_compare(void *ptr, void *arg)
+{
+ const struct nft_hash_elem *he = ptr;
+ struct nft_hash_compare_arg *x = arg;
+
+ if (nft_data_cmp(nft_set_ext_key(&he->ext), x->key, x->len))
+ return false;
+ if (nft_set_ext_exists(&he->ext, NFT_SET_EXT_TIMEOUT) &&
+ time_after_eq(jiffies, *nft_set_ext_timeout(&he->ext)))
+ return false;
+
+ return true;
+}
+
static bool nft_hash_lookup(const struct nft_set *set,
const struct nft_data *key,
const struct nft_set_ext **ext)
{
- struct rhashtable *priv = nft_set_priv(set);
+ struct nft_hash *priv = nft_set_priv(set);
const struct nft_hash_elem *he;
+ struct nft_hash_compare_arg arg = {
+ .key = key,
+ .len = set->klen,
+ };
- he = rhashtable_lookup(priv, key);
+ he = rhashtable_lookup_compare(&priv->ht, key, nft_hash_compare, &arg);
if (he != NULL)
*ext = &he->ext;
@@ -45,10 +74,10 @@ static bool nft_hash_lookup(const struct nft_set *set,
static int nft_hash_insert(const struct nft_set *set,
const struct nft_set_elem *elem)
{
- struct rhashtable *priv = nft_set_priv(set);
+ struct nft_hash *priv = nft_set_priv(set);
struct nft_hash_elem *he = elem->priv;
- rhashtable_insert(priv, &he->node);
+ rhashtable_insert(&priv->ht, &he->node);
return 0;
}
@@ -64,58 +93,43 @@ static void nft_hash_elem_destroy(const struct nft_set *set,
static void nft_hash_remove(const struct nft_set *set,
const struct nft_set_elem *elem)
{
- struct rhashtable *priv = nft_set_priv(set);
+ struct nft_hash *priv = nft_set_priv(set);
+ struct nft_hash_elem *he = elem->cookie;
- rhashtable_remove(priv, elem->cookie);
+ rhashtable_remove(&priv->ht, &he->node);
synchronize_rcu();
kfree(elem->cookie);
}
-struct nft_compare_arg {
- const struct nft_set *set;
- struct nft_set_elem *elem;
-};
-
-static bool nft_hash_compare(void *ptr, void *arg)
-{
- struct nft_hash_elem *he = ptr;
- struct nft_compare_arg *x = arg;
-
- if (!nft_data_cmp(nft_set_ext_key(&he->ext), &x->elem->key,
- x->set->klen)) {
- x->elem->cookie = he;
- x->elem->priv = he;
- return true;
- }
-
- return false;
-}
-
static int nft_hash_get(const struct nft_set *set, struct nft_set_elem *elem)
{
- struct rhashtable *priv = nft_set_priv(set);
- struct nft_compare_arg arg = {
- .set = set,
- .elem = elem,
+ struct nft_hash *priv = nft_set_priv(set);
+ struct nft_hash_elem *he;
+ struct nft_hash_compare_arg arg = {
+ .key = &elem->key,
+ .len = set->klen,
};
- if (rhashtable_lookup_compare(priv, &elem->key,
- &nft_hash_compare, &arg))
+ he = rhashtable_lookup_compare(&priv->ht, &elem->key,
+ nft_hash_compare, &arg);
+ if (he != NULL) {
+ elem->cookie = he;
+ elem->priv = he;
return 0;
-
+ }
return -ENOENT;
}
static void nft_hash_walk(const struct nft_ctx *ctx, const struct nft_set *set,
struct nft_set_iter *iter)
{
- struct rhashtable *priv = nft_set_priv(set);
+ struct nft_hash *priv = nft_set_priv(set);
const struct bucket_table *tbl;
struct nft_hash_elem *he;
struct nft_set_elem elem;
unsigned int i;
- tbl = rht_dereference_rcu(priv->tbl, priv);
+ tbl = rht_dereference_rcu(priv->ht.tbl, &priv->ht);
for (i = 0; i < tbl->size; i++) {
struct rhash_head *pos;
@@ -134,16 +148,48 @@ cont:
}
}
+static void nft_hash_gc(struct work_struct *work)
+{
+ const struct nft_set *set;
+ const struct bucket_table *tbl;
+ struct rhash_head *pos, *next;
+ struct nft_hash_elem *he;
+ struct nft_hash *priv;
+ unsigned long timeout;
+ unsigned int i;
+
+ priv = container_of(work, struct nft_hash, gc_work.work);
+ set = (void *)priv - offsetof(struct nft_set, data);
+
+ mutex_lock(&priv->ht.mutex);
+ tbl = rht_dereference(priv->ht.tbl, &priv->ht);
+ for (i = 0; i < tbl->size; i++) {
+ rht_for_each_entry_safe(he, pos, next, tbl, i, node) {
+ if (!nft_set_ext_exists(&he->ext, NFT_SET_EXT_TIMEOUT))
+ continue;
+ timeout = *nft_set_ext_timeout(&he->ext);
+ if (time_before(jiffies, timeout))
+ continue;
+
+ rhashtable_remove(&priv->ht, &he->node);
+ nft_hash_elem_destroy(set, he);
+ }
+ }
+ mutex_unlock(&priv->ht.mutex);
+
+ queue_delayed_work(system_power_efficient_wq, &priv->gc_work, HZ);
+}
+
static unsigned int nft_hash_privsize(const struct nlattr * const nla[])
{
- return sizeof(struct rhashtable);
+ return sizeof(struct nft_hash);
}
static int nft_hash_init(const struct nft_set *set,
const struct nft_set_desc *desc,
const struct nlattr * const tb[])
{
- struct rhashtable *priv = nft_set_priv(set);
+ struct nft_hash *priv = nft_set_priv(set);
struct rhashtable_params params = {
.nelem_hint = desc->size ? : NFT_HASH_ELEMENT_HINT,
.head_offset = offsetof(struct nft_hash_elem, node),
@@ -153,30 +199,42 @@ static int nft_hash_init(const struct nft_set *set,
.grow_decision = rht_grow_above_75,
.shrink_decision = rht_shrink_below_30,
};
+ int err;
- return rhashtable_init(priv, ¶ms);
+ err = rhashtable_init(&priv->ht, ¶ms);
+ if (err < 0)
+ return err;
+
+ INIT_DEFERRABLE_WORK(&priv->gc_work, nft_hash_gc);
+ if (set->flags & NFT_SET_TIMEOUT)
+ queue_delayed_work(system_power_efficient_wq,
+ &priv->gc_work, HZ);
+
+ return 0;
}
static void nft_hash_destroy(const struct nft_set *set)
{
- struct rhashtable *priv = nft_set_priv(set);
+ struct nft_hash *priv = nft_set_priv(set);
const struct bucket_table *tbl;
struct nft_hash_elem *he;
struct rhash_head *pos, *next;
unsigned int i;
+ cancel_delayed_work_sync(&priv->gc_work);
+
/* Stop an eventual async resizing */
- priv->being_destroyed = true;
- mutex_lock(&priv->mutex);
+ priv->ht.being_destroyed = true;
+ mutex_lock(&priv->ht.mutex);
- tbl = rht_dereference(priv->tbl, priv);
+ tbl = rht_dereference(priv->ht.tbl, &priv->ht);
for (i = 0; i < tbl->size; i++) {
rht_for_each_entry_safe(he, pos, next, tbl, i, node)
nft_hash_elem_destroy(set, he);
}
- mutex_unlock(&priv->mutex);
+ mutex_unlock(&priv->ht.mutex);
- rhashtable_destroy(priv);
+ rhashtable_destroy(&priv->ht);
}
static bool nft_hash_estimate(const struct nft_set_desc *desc, u32 features,
@@ -187,9 +245,11 @@ static bool nft_hash_estimate(const struct nft_set_desc *desc, u32 features,
esize = sizeof(struct nft_hash_elem);
if (features & NFT_SET_MAP)
esize += sizeof(struct nft_data);
+ if (features & NFT_SET_TIMEOUT)
+ esize += sizeof(unsigned long);
if (desc->size) {
- est->size = sizeof(struct rhashtable) +
+ est->size = sizeof(struct nft_hash) +
roundup_pow_of_two(desc->size * 4 / 3) *
sizeof(struct nft_hash_elem *) +
desc->size * esize;
@@ -218,7 +278,7 @@ static struct nft_set_ops nft_hash_ops __read_mostly = {
.remove = nft_hash_remove,
.lookup = nft_hash_lookup,
.walk = nft_hash_walk,
- .features = NFT_SET_MAP,
+ .features = NFT_SET_MAP | NFT_SET_TIMEOUT,
.owner = THIS_MODULE,
};
@@ -238,3 +298,4 @@ module_exit(nft_hash_module_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
MODULE_ALIAS_NFT_SET();
+
--
2.1.0
^ permalink raw reply related
* [PATCH net-next v4 7/7] team: handle NETIF_F_HW_SWITCH_OFFLOAD flag and add ndo_bridge_setlink/dellink handlers
From: roopa @ 2015-01-30 6:40 UTC (permalink / raw)
To: jiri, sfeldma, jhs, bcrl, tgraf, john.fastabend, stephen,
vyasevic, ronen.arad
Cc: netdev, davem, shm, gospo
From: Roopa Prabhu <roopa@cumulusnetworks.com>
Currently ndo_bridge_setlink and ndo_bridge_dellink handlers point
to the default switchdev handlers
This follows my bonding driver changes.
I have only compile tested this patch. However similar
bonding code has been tested.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
drivers/net/team/team.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 4b2bfc5..0e62274 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -28,6 +28,7 @@
#include <net/genetlink.h>
#include <net/netlink.h>
#include <net/sch_generic.h>
+#include <net/switchdev.h>
#include <generated/utsrelease.h>
#include <linux/if_team.h>
@@ -1925,7 +1926,7 @@ static netdev_features_t team_fix_features(struct net_device *dev,
struct team *team = netdev_priv(dev);
netdev_features_t mask;
- mask = features;
+ mask = features | NETIF_F_HW_SWITCH_OFFLOAD;
features &= ~NETIF_F_ONE_FOR_ALL;
features |= NETIF_F_ALL_FOR_ALL;
@@ -1975,6 +1976,8 @@ static const struct net_device_ops team_netdev_ops = {
.ndo_del_slave = team_del_slave,
.ndo_fix_features = team_fix_features,
.ndo_change_carrier = team_change_carrier,
+ .ndo_bridge_setlink = ndo_dflt_netdev_switch_port_bridge_setlink,
+ .ndo_bridge_dellink = ndo_dflt_netdev_switch_port_bridge_dellink,
};
/***********************
--
1.7.10.4
^ permalink raw reply related
* [PATCH net-next v4 6/7] bonding: handle NETIF_F_HW_SWITCH_OFFLOAD flag and add ndo_bridge_setlink/dellink handlers
From: roopa @ 2015-01-30 6:40 UTC (permalink / raw)
To: jiri, sfeldma, jhs, bcrl, tgraf, john.fastabend, stephen,
vyasevic, ronen.arad
Cc: netdev, davem, shm, gospo
From: Roopa Prabhu <roopa@cumulusnetworks.com>
We want bond to pick up the offload flag if any of its slaves have it.
NETIF_F_HW_SWITCH_OFFLOAD flag is added to the mask, so that
netdev_increment_features does not ignore it.
This also adds ndo_bridge_setlink and ndo_bridge_dellink handlers.
These currently point to the default handlers provided by the
switchdev api.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
drivers/net/bonding/bond_main.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e229a86..c9e519c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -77,6 +77,7 @@
#include <net/pkt_sched.h>
#include <linux/rculist.h>
#include <net/flow_keys.h>
+#include <net/switchdev.h>
#include <net/bonding.h>
#include <net/bond_3ad.h>
#include <net/bond_alb.h>
@@ -979,7 +980,11 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
netdev_features_t mask;
struct slave *slave;
- mask = features;
+ /* If any slave has the offload feature flag set,
+ * set the offload flag on the bond.
+ */
+ mask = features | NETIF_F_HW_SWITCH_OFFLOAD;
+
features &= ~NETIF_F_ONE_FOR_ALL;
features |= NETIF_F_ALL_FOR_ALL;
@@ -3952,6 +3957,8 @@ static const struct net_device_ops bond_netdev_ops = {
.ndo_add_slave = bond_enslave,
.ndo_del_slave = bond_release,
.ndo_fix_features = bond_fix_features,
+ .ndo_bridge_setlink = ndo_dflt_netdev_switch_port_bridge_setlink,
+ .ndo_bridge_dellink = ndo_dflt_netdev_switch_port_bridge_dellink,
};
static const struct device_type bond_type = {
--
1.7.10.4
^ permalink raw reply related
* [PATCH net-next v4 5/7] rocker: set feature NETIF_F_HW_SWITCH_OFFLOAD
From: roopa @ 2015-01-30 6:40 UTC (permalink / raw)
To: jiri, sfeldma, jhs, bcrl, tgraf, john.fastabend, stephen,
vyasevic, ronen.arad
Cc: netdev, davem, shm, gospo
From: Roopa Prabhu <roopa@cumulusnetworks.com>
This patch sets the NETIF_F_HW_SWITCH_OFFLOAD feature flag on rocker ports
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
drivers/net/ethernet/rocker/rocker.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index f0d607c..3c17ef2 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4030,7 +4030,8 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
NAPI_POLL_WEIGHT);
rocker_carrier_init(rocker_port);
- dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
+ dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
+ NETIF_F_HW_SWITCH_OFFLOAD;
err = register_netdev(dev);
if (err) {
--
1.7.10.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox