[PATCH] net: use unlikely for dql_avail case

2019-08-21 Thread xiaolinkui
This is an unlikely case, use unlikely() on it seems logical. Signed-off-by: xiaolinkui --- include/linux/netdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 88292953aa6f..005f3da1b13d 100644 --- a/include/li

Re: [PATCH net-next 0/7] mlxsw: Add devlink-trap support

2019-08-21 Thread Ido Schimmel
On Wed, Aug 21, 2019 at 12:59:10PM -0700, David Miller wrote: > Series applied, although that rate should really be configurable somehow. > 10Kpps seems quite arbitrary... Yes, agreed. We plan to extend the devlink-trap API to expose these trap policers and make them configurable. Thanks for the

[PATCH net-next] cirrus: cs89x0: remove set but not used variable 'lp'

2019-08-21 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/cirrus/cs89x0.c: In function 'cs89x0_platform_probe': drivers/net/ethernet/cirrus/cs89x0.c:1847:20: warning: variable 'lp' set but not used [-Wunused-but-set-variable] It is not used since commit 6751edeb8700 ("cirrus: cs89x0: U

[PATCH][net-next] net: drop_monitor: change the stats variable to u64 in net_dm_stats_put

2019-08-21 Thread Li RongQing
only the element drop of struct net_dm_stats is used, so simplify it to u64 Signed-off-by: Li RongQing --- net/core/drop_monitor.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index bfc024024aa3..ed10a40cf629 100

Re: [PATCH v3] tun: fix use-after-free when register netdev failed

2019-08-21 Thread Yang Yingliang
On 2019/8/22 10:13, Jason Wang wrote: On 2019/8/20 上午10:28, Jason Wang wrote: On 2019/8/20 上午9:25, David Miller wrote: From: Yang Yingliang Date: Mon, 19 Aug 2019 21:31:19 +0800 Call tun_attach() after register_netdevice() to make sure tfile->tun is not published until the netdevice is

Re: [PATCH bpf] flow_dissector: Fix potential use-after-free on BPF_PROG_DETACH

2019-08-21 Thread Petar Penkov
This makes sense, thanks! Acked-by: Petar Penkov On Wed, Aug 21, 2019 at 5:19 AM Jakub Sitnicki wrote: > > Call to bpf_prog_put(), with help of call_rcu(), queues an RCU-callback to > free the program once a grace period has elapsed. The callback can run > together with new RCU readers that sta

Re: Unable to create htb tc classes more than 64K

2019-08-21 Thread Akshat Kakkar
On Thu, Aug 22, 2019 at 3:37 AM Cong Wang wrote: > > I am using ipset + iptables to classify and not filters. Besides, if > > tc is allowing me to define qdisc -> classes -> qdsic -> classes > > (1,2,3 ...) sort of structure (ie like the one shown in ascii tree) > > then how can those lowest chil

RE: [PATCH v1] ocfs2/dlm: Move BITS_TO_BYTES() to bitops.h for wider use

2019-08-21 Thread Sudarsana Reddy Kalluru
> -Original Message- > From: netdev-ow...@vger.kernel.org On > Behalf Of Andy Shevchenko > Sent: Wednesday, August 21, 2019 2:56 PM > To: Joseph Qi > Cc: Mark Fasheh ; Joel Becker ; > ocfs2-de...@oss.oracle.com; Ariel Elior ; Sudarsana > Reddy Kalluru ; GR-everest-linux-l2 linux...@mar

Re: [PATCH net-next v2] net: openvswitch: Set OvS recirc_id from tc chain index

2019-08-21 Thread David Miller
From: Paul Blakey Date: Tue, 20 Aug 2019 15:30:51 +0300 > @@ -4050,6 +4060,9 @@ enum skb_ext_id { > #ifdef CONFIG_XFRM > SKB_EXT_SEC_PATH, > #endif > +#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT) > + TC_SKB_EXT, > +#endif > SKB_EXT_NUM, /* must be last */ > }; Sorry, no. The SKB ext

Re: New skb extension for use by LSMs (skb "security blob")?

2019-08-21 Thread David Miller
From: Paul Moore Date: Wed, 21 Aug 2019 23:27:03 -0400 > On Wed, Aug 21, 2019 at 6:50 PM David Miller wrote: >> From: Paul Moore >> Date: Wed, 21 Aug 2019 18:00:09 -0400 >> >> > I was just made aware of the skb extension work, and it looks very >> > appealing from a LSM perspective. As some of

Re: [PATCH v2 net] gve: Copy and paste bug in gve_get_stats()

2019-08-21 Thread David Miller
From: Dan Carpenter Date: Tue, 20 Aug 2019 12:11:44 +0300 > There is a copy and paste error so we have "rx" where "tx" was intended > in the priv->tx[] array. > > Fixes: f5cedc84a30d ("gve: Add transmit and receive support") > Signed-off-by: Dan Carpenter > --- > v2: fix a typo in the subject:

Re: [PATCH] net: fix icmp_socket_deliver argument 2 input

2019-08-21 Thread David Miller
From: Li RongQing Date: Tue, 20 Aug 2019 10:46:00 +0800 > it expects a unsigned int, but got a __be32 > > Signed-off-by: Li RongQing > Signed-off-by: Zhang Yu Applied, but this causes no functional problems because all of the per-protocol handlers ignore the info argument for redirects.

Re: [PATCHv2 net] ipv6/addrconf: allow adding multicast addr if IFA_F_MCAUTOJOIN is set

2019-08-21 Thread David Miller
From: Hangbin Liu Date: Tue, 20 Aug 2019 10:19:47 +0800 > In commit 93a714d6b53d ("multicast: Extend ip address command to enable > multicast group join/leave on") we added a new flag IFA_F_MCAUTOJOIN > to make user able to add multicast address on ethernet interface. > > This works for IPv4, bu

Re: [PATCH net-next 01/10] net: dsa: mv88e6xxx: support 2500base-x in SGMII IRQ handler

2019-08-21 Thread Marek Behún
On Wed, 21 Aug 2019 20:25:42 -0700 (PDT) David Miller wrote: > From: Marek Behún > Date: Thu, 22 Aug 2019 01:27:15 +0200 > > > int port, int lane) { > > struct dsa_switch *ds = chip->ds; > > + u8 cmode = chip->ports[port].cmode; > > int duplex = DUPLEX_UNKNOWN; > > int speed = SPE

Re: New skb extension for use by LSMs (skb "security blob")?

2019-08-21 Thread Paul Moore
On Wed, Aug 21, 2019 at 6:50 PM David Miller wrote: > From: Paul Moore > Date: Wed, 21 Aug 2019 18:00:09 -0400 > > > I was just made aware of the skb extension work, and it looks very > > appealing from a LSM perspective. As some of you probably remember, > > we (the LSM folks) have wanted a pro

Re: [PATCH net-next 08/10] net: dsa: mv88e6xxx: simplify SERDES code for Topaz and Peridot

2019-08-21 Thread David Miller
From: Marek Behún Date: Thu, 22 Aug 2019 01:27:22 +0200 > int mv88e6390_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on) > { > int lane; > + u8 cmode = chip->ports[port].cmode; Reverse christmas tree please.

Re: [PATCH net-next 01/10] net: dsa: mv88e6xxx: support 2500base-x in SGMII IRQ handler

2019-08-21 Thread David Miller
From: Marek Behún Date: Thu, 22 Aug 2019 01:27:15 +0200 > diff --git a/drivers/net/dsa/mv88e6xxx/serdes.c > b/drivers/net/dsa/mv88e6xxx/serdes.c > index 20c526c2a9ee..0f3d7cbb696b 100644 > --- a/drivers/net/dsa/mv88e6xxx/serdes.c > +++ b/drivers/net/dsa/mv88e6xxx/serdes.c > @@ -506,9 +506,11 @@

Re: [pull request][net-next 00/11] Mellanox, mlx5 tc flow handling for concurrent execution (Part 3/3)

2019-08-21 Thread David Miller
From: Saeed Mahameed Date: Wed, 21 Aug 2019 23:28:31 + > This series, mostly from Vlad, is the 3rd and last part of 3 part series > to improve mlx5 tc flow handling by removing dependency on rtnl_lock and > providing a more fine-grained locking and rcu safe data structures to > allow tc flow

[PATCH net-next] net/rds: Fix info leak in rds6_inc_info_copy()

2019-08-21 Thread Ka-Cheong Poon
The rds6_inc_info_copy() function has a couple struct members which are leaking stack information. The ->tos field should hold actual information and the ->flags field needs to be zeroed out. Fixes: 3eb450367d08 ("rds: add type of service(tos) infrastructure") Fixes: b7ff8b1036f0 ("rds: Extend RD

Re: [PATCH v3] tun: fix use-after-free when register netdev failed

2019-08-21 Thread Jason Wang
On 2019/8/20 上午10:28, Jason Wang wrote: On 2019/8/20 上午9:25, David Miller wrote: From: Yang Yingliang Date: Mon, 19 Aug 2019 21:31:19 +0800 Call tun_attach() after register_netdevice() to make sure tfile->tun is not published until the netdevice is registered. So the read/write thread can

[PATCH net] openvswitch: Fix log message in ovs conntrack

2019-08-21 Thread Yi-Hung Wei
Fixes: 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action") Signed-off-by: Yi-Hung Wei --- net/openvswitch/conntrack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index 45498fcf540d..0d5ab4957ec0 100644 --

[PATCH net] openvswitch: Fix conntrack cache with timeout

2019-08-21 Thread Yi-Hung Wei
This patch addresses a conntrack cache issue with timeout policy. Currently, we do not check if the timeout extension is set properly in the cached conntrack entry. Thus, after packet recirculate from conntrack action, the timeout policy is not applied properly. This patch fixes the aforementione

[PATCH bpf-next v3 3/4] selftests/bpf: test_progs: remove asserts from subtests

2019-08-21 Thread Stanislav Fomichev
Otherwise they can bring the whole process down. Cc: Andrii Nakryiko Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/prog_tests/bpf_obj_id.c | 19 ++--- .../selftests/bpf/prog_tests/map_lock.c | 21 --- .../selftests/bpf/prog_tests/spinlock.c

[PATCH bpf-next v3 4/4] selftests/bpf: test_progs: remove unused ret

2019-08-21 Thread Stanislav Fomichev
send_signal test returns static codes from the subtests which nobody looks at, let's rely on the CHECK macros instead. Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/prog_tests/send_signal.c| 42 +-- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/too

[PATCH bpf-next v3 0/4] selftests/bpf: test_progs: misc fixes

2019-08-21 Thread Stanislav Fomichev
* add test__skip to indicate skipped tests * remove global success/error counts (use environment) * remove asserts from the tests * remove unused ret from send_signal test v3: * QCHECK -> CHECK_FAIL (Daniel Borkmann) v2: * drop patch that changes output to keep consistent with test_verifier (Al

[PATCH bpf-next v3 2/4] selftests/bpf: test_progs: remove global fail/success counts

2019-08-21 Thread Stanislav Fomichev
Now that we have a global per-test/per-environment state, there is no longer need to have global fail/success counters (and there is no need to save/get the diff before/after the test). Introduce CHECK_FAIL macro (suggested by Andrii) and covert existing tests to it. CHECK_FAIL uses new test__fail

[PATCH bpf-next v3 1/4] selftests/bpf: test_progs: test__skip

2019-08-21 Thread Stanislav Fomichev
Export test__skip() to indicate skipped tests and use it in test_send_signal_nmi(). Cc: Andrii Nakryiko Signed-off-by: Stanislav Fomichev --- .../selftests/bpf/prog_tests/send_signal.c| 1 + tools/testing/selftests/bpf/test_progs.c | 20 +-- tools/testing/selftests/bpf

[net-next 11/11] net/mlx5e: Add trace point for neigh update

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov Allow tracing neigh state during neigh update task that is executed on workqueue and is scheduled by neigh state change event. Usage example: ># cd /sys/kernel/debug/tracing ># echo mlx5:mlx5e_rep_neigh_update >> set_event ># cat trace ... kworker/u48:7-2221 [009] .

[net-next 02/11] net/mlx5e: Always take reference to neigh entry

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov Neigh entry has reference counter, however it is only used when scheduling neigh update event. In all other cases reference to neigh entry is not taken while working with it. Neigh code relies on synchronization provided by rtnl lock and uses encap list size as implicit referenc

[net-next 01/11] net/mlx5e: Extract code that queues neigh update work into function

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov As a preparation for following refactoring that removes rtnl lock dependency from neigh hash entry handlers, extract code that enqueues neigh update work into standalone function. This commit doesn't change functionality. Signed-off-by: Vlad Buslov Reviewed-by: Jianbo Liu Rev

[net-next 06/11] net/mlx5e: Refactor neigh used value update for concurrent execution

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov In order to remove dependency on rtnl lock and allow neigh used value update workqueue task to execute concurrently with tc, refactor mlx5e_tc_update_neigh_used_value() for concurrent execution: - Lock encap table when accessing encap entry to prevent concurrent changes. - S

[net-next 08/11] net/mlx5e: Only access fully initialized flows in neigh update

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov To remove dependency on rtnl lock and prevent neigh update code from accessing uninitialized flows when executing concurrently with tc, extend mlx5e_tc_flow with 'init_done' completion. Modify helper mlx5e_take_all_encap_flows() to wait for flow completion after obtaining refere

[net-next 04/11] net/mlx5e: Refactor mlx5e_neigh_update_table->encap_lock

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov To remove dependency on rtnl lock, always take neigh update encap lock when modifying neigh update hash table and list. Originally, this lock was only used to synchronize with netevent handler function, which is called from bh context and cannot use rtnl lock for synchronization

[net-next 05/11] net/mlx5e: Protect neigh hash encap list with spinlock and rcu

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov Rcu-ify mlx5e_neigh_hash_entry->encap_list by changing operations on encap list to their rcu counterparts and extending encap structure with rcu_head to free the encap instances after rcu grace period. Use rcu read lock when traversing encap list. Implement helper mlx5e_get_next

[net-next 09/11] net/mlx5e: Add tc flower tracepoints

2019-08-21 Thread Saeed Mahameed
From: Dmytro Linkin Implemented following tracepoints: 1. Configure flower (mlx5e_configure_flower) 2. Delete flower (mlx5e_delete_flower) 3. Stats flower (mlx5e_stats_flower) Usage example: ># cd /sys/kernel/debug/tracing ># echo mlx5:mlx5e_configure_flower >> set_event ># cat trace ...

[net-next 10/11] net/mlx5e: Add trace point for neigh used value update

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov Allow tracing result of neigh used value update task that is executed periodically on workqueue. Usage example: ># cd /sys/kernel/debug/tracing ># echo mlx5:mlx5e_tc_update_neigh_used_value >> set_event ># cat trace ... kworker/u48:4-8806 [009] ...1 55117.882428: m

[net-next 07/11] net/mlx5e: Refactor neigh update for concurrent execution

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov In order to remove dependency on rtnl lock and allow neigh update workqueue task to execute concurrently with tc, refactor mlx5e_rep_neigh_update() for concurrent execution: - Lock encap table when accessing encap entry to prevent concurrent changes. To do this properly, the

[net-next 03/11] net/mlx5e: Extend neigh hash entry with rcu

2019-08-21 Thread Saeed Mahameed
From: Vlad Buslov To remove dependency on rtnl lock and to allow unlocked iteration over list of neigh hash entries, extend nhe with rcu. Change operations on neigh list to their rcu counterparts and free neigh hash entry with rcu timeout. Introduce mlx5e_get_next_nhe() helper that is used to it

[pull request][net-next 00/11] Mellanox, mlx5 tc flow handling for concurrent execution (Part 3/3)

2019-08-21 Thread Saeed Mahameed
Hi Dave, This series, mostly from Vlad, is the 3rd and last part of 3 part series to improve mlx5 tc flow handling by removing dependency on rtnl_lock and providing a more fine-grained locking and rcu safe data structures to allow tc flow handling for concurrent execution. 2) In this part Vlad ha

[PATCH net-next 05/10] net: dsa: mv88e6xxx: create chip->info->ops->serdes_get_lane method

2019-08-21 Thread Marek Behún
Create a serdes_get_lane() method in the mv88e6xxx operations structure. Use it instead of calling the different implementations. Signed-off-by: Marek Behún --- drivers/net/dsa/mv88e6xxx/chip.c | 6 ++ drivers/net/dsa/mv88e6xxx/chip.h | 3 +++ drivers/net/dsa/mv88e6xxx/port.c | 4 ++

[PATCH net-next 04/10] net: dsa: mv88e6xxx: prefix hidden register macro names with MV88E6XXX_

2019-08-21 Thread Marek Behún
In order to be uniform with the rest of the driver, prepend hidden register macro names with the MV88E6XXX_ prefix. Signed-off-by: Marek Behún --- drivers/net/dsa/mv88e6xxx/hidden.c | 36 -- drivers/net/dsa/mv88e6xxx/hidden.h | 16 ++--- 2 files changed, 27 in

[PATCH net-next 02/10] net: dsa: mv88e6xxx: remove extra newline

2019-08-21 Thread Marek Behún
There are two newlines separating mv88e6390_hidden_wait and mv88e6390_hidden_read. Remove one. Signed-off-by: Marek Behún --- drivers/net/dsa/mv88e6xxx/chip.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index d0bf98c10b2b

[PATCH net-next 00/10] net: dsa: mv88e6xxx: Peridot/Topaz SERDES changes

2019-08-21 Thread Marek Behún
Hello, I am sending some changes for the Topaz/Peridot family of switches. These patches apply on net-next/master. Summary: - patch 1 adds support for 2500base-x mode in the SERDES IRQ handler - patches 2, 4 and 7 are cosmetic patches - patch 3 moves the code that manipulates hidden registers i

[PATCH net-next 06/10] net: dsa: mv88e6xxx: add serdes_get_lane method for Topaz family

2019-08-21 Thread Marek Behún
The Topaz family has only one SERDES, on port 5, with address 0x15. Currently we have MV88E6341_ADDR_SERDES macro used in the mv88e6341_serdes_power method. Rename the macro to MV88E6341_PORT5_LANE and use the new mv88e6xxx_serdes_get_lane method in mv88e6341_serdes_power. Signed-off-by: Marek Beh

[PATCH net-next 10/10] net: dsa: mv88e6xxx: fully support SERDES on Topaz family

2019-08-21 Thread Marek Behún
Currently we support SERDES on the Topaz family in a limited way: no IRQs and the cmode is not writable, thus the mode is determined by strapping pins. Marvell's examples though show how to make cmode writable on port 5 and support SGMII autonegotiation. It is done by writing hidden registers, for

[PATCH net-next 03/10] net: dsa: mv88e6xxx: move hidden registers operations in own file

2019-08-21 Thread Marek Behún
This patch moves the functions operating on the hidden debug registers into it's own file, hidden.c. Signed-off-by: Marek Behún --- drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/chip.c | 54 +--- drivers/net/dsa/mv88e6xxx/hidden.c | 67 +++

[PATCH net-next 07/10] net: dsa: mv88e6xxx: rename port cmode macro

2019-08-21 Thread Marek Behún
This is a cosmetic update. We are removing the last underscore from macros MV88E6XXX_PORT_STS_CMODE_100BASE_X and MV88E6XXX_PORT_STS_CMODE_1000BASE_X. The 2500base-x version does not have that underscore. Also PHY_INTERFACE_MODE_ macros do not have it there. Signed-off-by: Marek Behún --- driver

[PATCH net-next 09/10] net: dsa: mv88e6xxx: support Block Address setting in hidden registers

2019-08-21 Thread Marek Behún
Add support for setting the Block Address parameter when reading/writing hidden registers. Marvell's mdio examples for SERDES settings on Topaz use Block Address 0x7 when reading/writing hidden registers, although the specification says that block must be set to 0xf. Signed-off-by: Marek Behún --

[PATCH net-next 01/10] net: dsa: mv88e6xxx: support 2500base-x in SGMII IRQ handler

2019-08-21 Thread Marek Behún
The mv88e6390_serdes_irq_link_sgmii IRQ handler reads the SERDES PHY status register to determine speed, among other things. If cmode of the port is set to 2500base-x, though, the PHY still reports 1000 Mbps (the PHY register itself does not differentiate between 1000 Mbps and 2500 Mbps - it thinks

[PATCH net-next 08/10] net: dsa: mv88e6xxx: simplify SERDES code for Topaz and Peridot

2019-08-21 Thread Marek Behún
Now that we have correct serdes_get_lane() for Topaz and Peridot families, we can merge the implementations of their other SERDES functions. We can skip checking port number, since the serdes_get_lane() method return -ENODEV if a given port does not have a lane or does not support given cmode. Sig

Re: [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2019-08-21

2019-08-21 Thread David Miller
From: Jakub Kicinski Date: Wed, 21 Aug 2019 14:31:06 -0700 > On Wed, 21 Aug 2019 13:16:08 -0700, Jeff Kirsher wrote: >> This series contains updates to i40e driver only. > > Patch 12 should really be squashed into 13, 7 and 9 could also be > combined. But not a big deal, I guess. Agreed, public

Re: various TLS bug fixes...

2019-08-21 Thread Jakub Kicinski
On Wed, 21 Aug 2019 11:03:46 -0700, Jakub Kicinski wrote: > On Tue, 20 Aug 2019 23:51:12 -0700, Jakub Kicinski wrote: > > > If you have more details I can also spend some cycles looking into it. > > > > Awesome, I'll let you know what the details are as soon as I get them. > > Just a quick

Re: New skb extension for use by LSMs (skb "security blob")?

2019-08-21 Thread David Miller
From: Paul Moore Date: Wed, 21 Aug 2019 18:00:09 -0400 > I was just made aware of the skb extension work, and it looks very > appealing from a LSM perspective. As some of you probably remember, > we (the LSM folks) have wanted a proper security blob in the skb for > quite some time, but netdev h

Re: Unable to create htb tc classes more than 64K

2019-08-21 Thread Cong Wang
On Sat, Aug 17, 2019 at 12:04 PM Akshat Kakkar wrote: > I am using ipset + iptables to classify and not filters. Besides, if > tc is allowing me to define qdisc -> classes -> qdsic -> classes > (1,2,3 ...) sort of structure (ie like the one shown in ascii tree) > then how can those lowest child c

New skb extension for use by LSMs (skb "security blob")?

2019-08-21 Thread Paul Moore
Hello netdev, I was just made aware of the skb extension work, and it looks very appealing from a LSM perspective. As some of you probably remember, we (the LSM folks) have wanted a proper security blob in the skb for quite some time, but netdev has been resistant to this idea thus far. If I wer

[PATCH ipsec-next 7/7] xfrm: add espintcp (RFC 8229)

2019-08-21 Thread Sabrina Dubroca
TCP encapsulation of IKE and IPsec messages (RFC 8229) is implemented as a TCP ULP, overriding in particular the sendmsg and recvmsg operations. A Stream Parser is used to extract messages out of the TCP stream using the first 2 bytes as length marker. Received IKE messages are put on "ike_queue",

[PATCH ipsec-next 5/7] esp4: prepare esp_input_done2 for non-UDP encapsulation

2019-08-21 Thread Sabrina Dubroca
For espintcp encapsulation, we will need to get the source port from the TCP header instead of UDP. Introduce a variable to hold the port. Co-developed-by: Herbert Xu Signed-off-by: Herbert Xu Signed-off-by: Sabrina Dubroca --- net/ipv4/esp4.c | 16 ++-- 1 file changed, 14 insertio

[PATCH ipsec-next 6/7] esp4: split esp_output_udp_encap and introduce esp_output_encap

2019-08-21 Thread Sabrina Dubroca
Co-developed-by: Herbert Xu Signed-off-by: Herbert Xu Signed-off-by: Sabrina Dubroca --- net/ipv4/esp4.c | 57 - 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index c5d826642229..033c61d27148 100

[PATCH ipsec-next 0/7] ipsec: add TCP encapsulation support (RFC 8229)

2019-08-21 Thread Sabrina Dubroca
This patchset introduces support for TCP encapsulation of IKE and ESP messages, as defined by RFC 8229 [0]. It is an evolution of what Herbert Xu proposed in January 2018 [1] that addresses the main criticism against it, by not interfering with the TCP implementation at all. The networking stack no

[PATCH ipsec-next 4/7] xfrm: add route lookup to xfrm4_rcv_encap

2019-08-21 Thread Sabrina Dubroca
At this point, with TCP encapsulation, the dst may be gone, but xfrm_input needs one. Signed-off-by: Sabrina Dubroca --- net/ipv4/xfrm4_protocol.c | 9 + 1 file changed, 9 insertions(+) diff --git a/net/ipv4/xfrm4_protocol.c b/net/ipv4/xfrm4_protocol.c index bcab48944c15..1665e1a05ec5 1

[PATCH ipsec-next 1/7] net: add queue argument to __skb_wait_for_more_packets and __skb_{,try_}recv_datagram

2019-08-21 Thread Sabrina Dubroca
This will be used by ESP over TCP to handle the queue of IKE messages. Signed-off-by: Sabrina Dubroca --- include/linux/skbuff.h | 11 --- net/core/datagram.c| 26 -- net/ipv4/udp.c | 3 ++- net/unix/af_unix.c | 7 --- 4 files changed, 30 ins

[PATCH ipsec-next 2/7] skbuff: Avoid sleeping in skb_send_sock_locked

2019-08-21 Thread Sabrina Dubroca
From: Herbert Xu For a function that needs to be called with the socket spinlock held, sleeping would seem to be a bad idea. This function does in fact avoid sleeping when calling kernel_sendpage_locked on the page part of the skb. However, it doesn't do that when sending the linear part. Resu

[PATCH ipsec-next 3/7] xfrm: introduce xfrm_trans_queue_net

2019-08-21 Thread Sabrina Dubroca
This will be used by TCP encapsulation to write packets to the encap socket without holding the user socket's lock. Without this reinjection, we're already holding the lock of the user socket, and then try to lock the encap socket as well when we enqueue the encrypted packet. While at it, add a BU

Re: [PATCH 24/38] cls_u32: Convert tc_u_common->handle_idr to XArray

2019-08-21 Thread Jakub Kicinski
On Wed, 21 Aug 2019 14:25:42 -0700, Matthew Wilcox wrote: > On Wed, Aug 21, 2019 at 02:13:08PM -0700, Jakub Kicinski wrote: > > On Tue, 20 Aug 2019 15:32:45 -0700, Matthew Wilcox wrote: > > > @@ -305,8 +306,12 @@ static void *u32_get(struct tcf_proto *tp, u32 > > > handle) > > > /* Protected by

Re: [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2019-08-21

2019-08-21 Thread Jakub Kicinski
On Wed, 21 Aug 2019 13:16:08 -0700, Jeff Kirsher wrote: > This series contains updates to i40e driver only. Patch 12 should really be squashed into 13, 7 and 9 could also be combined. But not a big deal, I guess.

Re: [PATCH 24/38] cls_u32: Convert tc_u_common->handle_idr to XArray

2019-08-21 Thread Matthew Wilcox
On Wed, Aug 21, 2019 at 02:13:08PM -0700, Jakub Kicinski wrote: > On Tue, 20 Aug 2019 15:32:45 -0700, Matthew Wilcox wrote: > > @@ -305,8 +306,12 @@ static void *u32_get(struct tcf_proto *tp, u32 handle) > > /* Protected by rtnl lock */ > > static u32 gen_new_htid(struct tc_u_common *tp_c, struct

[PATCH] net/ncsi: Fix the payload copying for the request coming from Netlink

2019-08-21 Thread Justin.Lee1
The request coming from Netlink should use the OEM generic handler. The standard command handler expects payload in bytes/words/dwords but the actual payload is stored in data if the request is coming from Netlink. Signed-off-by: Justin Lee --- net/ncsi/ncsi-cmd.c | 11 +-- 1 file chan

Re: [PATCH 24/38] cls_u32: Convert tc_u_common->handle_idr to XArray

2019-08-21 Thread Jakub Kicinski
On Tue, 20 Aug 2019 15:32:45 -0700, Matthew Wilcox wrote: > @@ -305,8 +306,12 @@ static void *u32_get(struct tcf_proto *tp, u32 handle) > /* Protected by rtnl lock */ > static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr) > { > - int id = idr_alloc_cyclic(&tp_c->handle_i

Re: [RFC bpf-next 0/5] Convert iproute2 to use libbpf (WIP)

2019-08-21 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Tue, Aug 20, 2019 at 4:47 AM Toke Høiland-Jørgensen > wrote: >> >> iproute2 uses its own bpf loader to load eBPF programs, which has >> evolved separately from libbpf. Since we are now standardising on >> libbpf, this becomes a problem as iproute2 is slowly accumula

[PATCH bpf] bpf: fix precision tracking in presence of bpf2bpf calls

2019-08-21 Thread Alexei Starovoitov
While adding extra tests for precision tracking and extra infra to adjust verifier heuristics the existing test "calls: cross frame pruning - liveness propagation" started to fail. The root cause is the same as described in verifer.c comment: * Also if parent's curframe > frame where backtracking

Re: [PATCH net-next v2 0/3] net: dsa: mt7530: Convert to PHYLINK and add support for port 5

2019-08-21 Thread Andrew Lunn
On Wed, Aug 21, 2019 at 04:45:44PM +0200, René van Dorst wrote: > 1. net: dsa: mt7530: Convert to PHYLINK API >This patch converts mt7530 to PHYLINK API. > 2. dt-bindings: net: dsa: mt7530: Add support for port 5 > 3. net: dsa: mt7530: Add support for port 5 >These 2 patches adding support

Re: [RFC bpf-next 0/5] Convert iproute2 to use libbpf (WIP)

2019-08-21 Thread Toke Høiland-Jørgensen
Alexei Starovoitov writes: > On Tue, Aug 20, 2019 at 01:47:01PM +0200, Toke Høiland-Jørgensen wrote: >> iproute2 uses its own bpf loader to load eBPF programs, which has >> evolved separately from libbpf. Since we are now standardising on >> libbpf, this becomes a problem as iproute2 is slowly ac

Re: [PATCH 33/38] act_api: Convert action_idr to XArray

2019-08-21 Thread Matthew Wilcox
On Wed, Aug 21, 2019 at 07:41:19PM +, Vlad Buslov wrote: > > @@ -301,18 +292,18 @@ static int tcf_del_walker(struct tcf_idrinfo > > *idrinfo, struct sk_buff *skb, > > if (nla_put_string(skb, TCA_KIND, ops->kind)) > > goto nla_put_failure; > > > > - mutex_lock(&idrinfo->lock

Re: [RFC bpf-next 0/5] Convert iproute2 to use libbpf (WIP)

2019-08-21 Thread Andrii Nakryiko
On Tue, Aug 20, 2019 at 4:47 AM Toke Høiland-Jørgensen wrote: > > iproute2 uses its own bpf loader to load eBPF programs, which has > evolved separately from libbpf. Since we are now standardising on > libbpf, this becomes a problem as iproute2 is slowly accumulating > feature incompatibilities wi

Re: VRF notes when using ipv6 and flushing tables.

2019-08-21 Thread Ben Greear
On 08/20/2019 08:02 PM, David Ahern wrote: On 8/20/19 2:27 PM, Ben Greear wrote: I recently spend a few days debugging what in the end was user error on my part. Here are my notes in hope they help someone else. First, 'ip -6 route show vrf vrfX' will not show some of the routes (like local ro

Re: [PATCH spi for-5.4 0/5] Deterministic SPI latency with NXP DSPI driver

2019-08-21 Thread Vladimir Oltean
Hi Richard, On Wed, 21 Aug 2019 at 17:08, Richard Cochran wrote: > > On Tue, Aug 20, 2019 at 09:38:45PM -0700, Richard Cochran wrote: > > Overall, the PTP switch use case is well supported by Linux. The > > synchronization of the management CPU to the PTP, while nice to have, > > is not required

[net-next 13/15] i40e: allow reset in recovery mode

2019-08-21 Thread Jeff Kirsher
From: Piotr Kwapulinski Driver waits after issuing a reset. When a reset takes too long a driver gives up. Implemented by invoking PF reset in a loop. After defined number of unsuccessful PF reset trials it returns error. Without this patch PF reset fails when NIC is in recovery mode. Signed-off

[net-next 14/15] i40e: Persistent LLDP support

2019-08-21 Thread Jeff Kirsher
From: Sylwia Wnuczko This patch adds a function to read NVM module data and uses it to read current LLDP agent configuration from NVM API version 1.8. Signed-off-by: Sylwia Wnuczko Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_dcb.c| 18 ++

[net-next 06/15] i40e: check_recovery_mode had wrong if statement

2019-08-21 Thread Jeff Kirsher
From: Adrian Podlawski Function check_recovery_mode had wrong if statement. Now we check proper FWS1B register values, which are responsible for the recovery mode. Recovery mode has 4 values for x710 and 2 for x722. That's why we need 6 different flags which are defined in the code. Now in the if

[net-next 08/15] i40e: reset veb.tc_stats when resetting veb.stats

2019-08-21 Thread Jeff Kirsher
From: Jacob Keller The stats structure for the VEB switch statistics is reset periodically, but the tc_stats are not reset at the same time. Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_main.c | 4 1 file chang

[net-next 15/15] i40e: fix retrying in i40e_aq_get_phy_capabilities

2019-08-21 Thread Jeff Kirsher
From: Marcin Formela Fixed a bug where driver was breaking out of the loop and reporting an error without retrying first. Signed-off-by: Marcin Formela Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_common.c | 17 ++--- 1 file change

[net-next 10/15] i40e: Fix crash caused by stress setting of VF MAC addresses

2019-08-21 Thread Jeff Kirsher
From: Slawomir Laba Add update to the VSI pointer passed to the i40e_set_vf_mac function. If VF is in reset state the driver waits in i40e_set_vf_mac function for the reset to be complete, yet after reset the vsi pointer that was passed into this function is no longer valid. The patch updates lo

[net-next 05/15] i40e: Add drop mode parameter to set mac config

2019-08-21 Thread Jeff Kirsher
From: Sylwia Wnuczko This patch adds "drop mode" parameter to set mac config AQ command. This bit controls the behavior when a no-drop packet is blocking a TC queue. 0 – The PF driver is notified. 1 – The blocking packet is dropped and then the PF driver is notified. Signed-off-by: Sylwia Wnuczk

[net-next 11/15] i40e: Remove function i40e_update_dcb_config()

2019-08-21 Thread Jeff Kirsher
From: Grzegorz Siwik This patch removes function i40e_update_dcb_config(). Instead of i40e_update_dcb_config() we use i40e_init_dcb(), which implements the correct NVM read. Signed-off-by: Grzegorz Siwik Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e

[net-next 01/15] i40e: reduce stack usage in i40e_set_fc

2019-08-21 Thread Jeff Kirsher
From: Arnd Bergmann The functions i40e_aq_get_phy_abilities_resp() and i40e_set_fc() both have giant structure on the stack, which makes each one use stack frames larger than 500 bytes. As clang decides one function into the other, we get a warning for exceeding the frame size limit on 32-bit ar

[net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2019-08-21

2019-08-21 Thread Jeff Kirsher
This series contains updates to i40e driver only. Arnd Bergmann reduces the stack usage which was causing warnings on 32-bit architectures due to large structure sizes for 2 functions getting inlined, so use noinline_for_stack to prevent the compilers from combining the 2 functions. Mauro S. M. R

[net-next 07/15] i40e: Update x710 FW API version to 1.9

2019-08-21 Thread Jeff Kirsher
From: Piotr Azarewicz Upcoming x710 FW increment API version to 1.9 due to Extend PHY access AQ command support. SW is ready for that support as well. Signed-off-by: Piotr Azarewicz Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2

[net-next 12/15] i40e: make i40e_set_mac_type() public

2019-08-21 Thread Jeff Kirsher
From: Piotr Kwapulinski Make i40e_set_mac_type() public. i40e driver requires i40e_set_mac_type() to be public. It is required for recovery mode handling. Without this patch recovery mode could not be detected in i40e_probe(). Signed-off-by: Piotr Kwapulinski Tested-by: Andrew Bowers Signed-of

[net-next 02/15] i40e: Check if transceiver implements DDM before access

2019-08-21 Thread Jeff Kirsher
From: "Mauro S. M. Rodrigues" Similar to the ixgbe issue fixed in: 655c91414579 ("ixgbe: Check DDM existence in transceiver before access) i40e has the same issue when reading eeprom from SFP's module that comply with SFF-8472 but not implement the Digital Diagnostic Monitoring (DDM) interface d

[net-next 04/15] i40e: fix shifts of signed values

2019-08-21 Thread Jeff Kirsher
From: Beilei Xing This patch fixes following error reported by cppcheck: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour Signed-off-by: Beilei Xing Signed-off-by: Ferruh Yigit Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- .../net/ethernet/intel/i40e/i40e_re

[net-next 09/15] i40e: Update x722 FW API version to 1.9

2019-08-21 Thread Jeff Kirsher
From: Piotr Azarewicz Upcoming x722 FW increment API version to 1.9, so we must bump up version number as well. x722 will support PHY access AQ command as x710 does. Signed-off-by: Piotr Azarewicz Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_a

[net-next 03/15] i40e: add check on i40e_configure_tx_ring() return value

2019-08-21 Thread Jeff Kirsher
From: huhai When i40e_configure_tx_ring(vsi->tx_rings[i]) returns an error, we should exit from i40e_vsi_configure_tx and return the error, instead of continuing to check whether xdp is enable, and configure the xdp transmit ring. Signed-off-by: huhai Tested-by: Andrew Bowers Signed-off-by: Je

Re: [PATCH] trivial: netns: fix typo in 'struct net.passive' description

2019-08-21 Thread David Miller
From: Mike Rapoport Date: Wed, 21 Aug 2019 14:29:29 +0300 > Replace 'decided' with 'decide' so that comment would be > > /* To decide when the network namespace should be freed. */ > > Signed-off-by: Mike Rapoport Applied.

Re: [PATCH net-next 0/7] mlxsw: Add devlink-trap support

2019-08-21 Thread David Miller
From: Ido Schimmel Date: Wed, 21 Aug 2019 10:19:30 +0300 > From: Ido Schimmel > > This patchset adds devlink-trap support in mlxsw. > > Patches #1-#4 add the necessary APIs and defines in mlxsw. > > Patch #5 implements devlink-trap support for layer 2 drops. More drops > will be added in the

RE: net: micrel: confusion about phyids used in driver

2019-08-21 Thread Woojung.Huh
Hi Allan & Florian, > > > So we're in need of someone who can get their hands on some more > > > detailed documentation than publicly available to allow to make the > > > driver handle the KSZ8051MLL correctly without breaking other stuff. > > > > > > I assume you are in a different department of

Re: [PATCH 33/38] act_api: Convert action_idr to XArray

2019-08-21 Thread Vlad Buslov
On Wed 21 Aug 2019 at 01:32, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Replace the mutex protecting the IDR with the XArray spinlock. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > include/net/act_api.h | 6 +- > net/sched/act_api.c | 127 +---

Re: [RFC bpf-next 0/5] Convert iproute2 to use libbpf (WIP)

2019-08-21 Thread Alexei Starovoitov
On Tue, Aug 20, 2019 at 01:47:01PM +0200, Toke Høiland-Jørgensen wrote: > iproute2 uses its own bpf loader to load eBPF programs, which has > evolved separately from libbpf. Since we are now standardising on > libbpf, this becomes a problem as iproute2 is slowly accumulating > feature incompatibili

Re: [PATCH bpf-next 0/2] tools: bpftool: work with frozen maps

2019-08-21 Thread Daniel Borkmann
On 8/21/19 10:52 AM, Quentin Monnet wrote: Hi, This is a simple set to add support for BPF map freezing to bpftool. First patch makes bpftool indicate if a map is frozen when listing BPF maps. Second patch adds a command to freeze a map loaded on the system. Quentin Monnet (2): tools: bpftool

Re: [PATCH 31/38] cls_flower: Use XArray marks instead of separate list

2019-08-21 Thread Vlad Buslov
On Wed 21 Aug 2019 at 01:32, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > Remove the hw_filter list in favour of using one of the XArray mark > bits which lets us iterate more efficiently than walking a linked list. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > net/sched/c

Re: net: micrel: confusion about phyids used in driver

2019-08-21 Thread allan.niel...@microchip.com
The 08/21/2019 10:24, Florian Fainelli wrote: > +Allan, > > On 8/20/19 1:25 PM, Uwe Kleine-König wrote: > > Hello Nicolas, > > > > there are some open questions regarding details about some PHYs > > supported in the drivers/net/phy/micrel.c driver. > > > > On Thu, Aug 08, 2019 at 10:36:37AM +020

  1   2   >