Re: [PATCH mlx5-next 0/4] mlx5 next misc updates

2019-01-28 Thread Leon Romanovsky
On Mon, Jan 28, 2019 at 07:11:01PM +, Saeed Mahameed wrote: > On Sun, 2019-01-27 at 07:51 +, Leon Romanovsky wrote: > > On Fri, Jan 25, 2019 at 10:08:00AM -0800, Saeed Mahameed wrote: > > > On Thu, Jan 24, 2019 at 4:30 AM Leon Romanovsky < > > > leo...@mellanox.com> wrote: > > > > On Fri, J

Re: [PATCH 2/7] sh_eth: RX checksum offload support

2019-01-28 Thread Simon Horman
Hi Sergei, On Mon, Jan 28, 2019 at 06:45:26PM +0300, Sergei Shtylyov wrote: > Hello! > > On 01/28/2019 03:18 PM, Simon Horman wrote: > > >> Add support for the RX checksum offload. This is enabled by default and > >> may be disabled and re-enabled using 'ethtool': > >> > >> # ethtool -K eth0 rx

[PATCH] netfilter: nft_tunnel: Add NFTA_TUNNEL_MODE options

2019-01-28 Thread wenxu
From: wenxu nft "tunnel" expr match both the tun_info of RX and TX. This patch provide the NFTA_TUNNEL_MODE to individually match the tun_info of RX or TX. Signed-off-by: wenxu --- include/uapi/linux/netfilter/nf_tables.h | 9 + net/netfilter/nft_tunnel.c | 34 ++

Re: WoL broken in r8169.c since kernel 4.19

2019-01-28 Thread Marc Haber
On Mon, Jan 28, 2019 at 09:28:13PM +0100, Heiner Kallweit wrote: > Because we're interested in file r8169.c only, you could test r8169.c > from the oops-ing kernel on top of a working kernel version. That's a really nice idea, and so obvious once one thinks about it. According to bisect, the firs

Re: Kernel memory corruption in CIPSO labeled TCP packets processing.

2019-01-28 Thread Nazarov Sergey
29.01.2019, 01:18, "Paul Moore" : > If we don't pass a skb into ip_options_compile(), meaning both "skb" > and "rt" will be NULL, then I don't believe the option data will > change. Am I missing something? > > -- > paul moore > www.paul-moore.com I mean, in cipso_v4_error we copy option data from

Re: [PATCH net-next] liquidio: fix the validation of rx checksum status from NIC hardware

2019-01-28 Thread David Miller
From: Felix Manlunas Date: Mon, 28 Jan 2019 19:38:31 + > From: Veerasenareddy Burru > > Fixed the code that was incorrectly interpreting the rx checksum validation > status from hardware, and updating kernel that the packet arrived with > correct checksum though the packet arrived with inco

Re: TCP/IPv4 sending using MSG_ZEROCOPY and closing the socket

2019-01-28 Thread mathias_koehrer
>> Hi all, >> >> I have one question on the behavior of TCP/IPv4 sending using the >> MSG_ZEROCOPY flag, >> the kernel version is 4.19.18. >> >> What happens if I close the sending socket immediately after performing a >> socket >> send() or sendmsg() call (called with the MSG_ZEROCOPY flag)? >

Re: [PATCH net] net: apple: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles

2019-01-28 Thread David Miller
From: Yang Wei Date: Tue, 29 Jan 2019 07:39:13 +0800 > dev_consume_skb_irq() should be called in bmac_txdma_intr() when > xmit done. It makes drop profiles more friendly. > > Signed-off-by: Yang Wei Applied.

Re: [PATCH net] net: ti: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles

2019-01-28 Thread David Miller
From: Yang Wei Date: Tue, 29 Jan 2019 07:40:10 +0800 > dev_consume_skb_irq() should be called in cpmac_end_xmit() when > xmit done. It makes drop profiles more friendly. > > Signed-off-by: Yang Wei Applied.

Re: net: alteon: replace dev_kfree_skb_irq by dev_consume_skb_irq

2019-01-28 Thread David Miller
From: Yang Wei Date: Sun, 27 Jan 2019 23:56:34 +0800 > dev_consume_skb_irq() should be called in ace_tx_int() when xmit > done. It makes drop profiles more friendly. > > Signed-off-by: Yang Wei Applied.

Re: net: amd8111e: replace dev_kfree_skb_irq by dev_consume_skb_irq

2019-01-28 Thread David Miller
From: Yang Wei Date: Sun, 27 Jan 2019 23:58:25 +0800 > dev_consume_skb_irq() should be called in amd8111e_tx() when xmit > done. It makes drop profiles more friendly. > > Signed-off-by: Yang Wei Applied.

Re: [PATCH net] net: tls: Fix deadlock in free_resources tx

2019-01-28 Thread David Miller
From: Dave Watson Date: Sun, 27 Jan 2019 00:59:03 + > If there are outstanding async tx requests (when crypto returns EINPROGRESS), > there is a potential deadlock: the tx work acquires the lock, while we > cancel_delayed_work_sync() while holding the lock. Drop the lock while > waiting > f

Re: [PATCH] include/linux/bpf.h - fix missing prototype warnings...

2019-01-28 Thread Song Liu
On Mon, Jan 28, 2019 at 10:05 PM wrote: > > Compiling with W=1 generates warnings: > > CC kernel/bpf/core.o > kernel/bpf/core.c:721:12: warning: no previous prototype for > ?bpf_jit_alloc_exec_limit? [-Wmissing-prototypes] > 721 | u64 __weak bpf_jit_alloc_exec_limit(void) > |

Re: [PATCH] kernel/bpf/cgroup.c - clean up kerneldoc warnings

2019-01-28 Thread Song Liu
On Mon, Jan 28, 2019 at 10:48 PM wrote: > > Building with W=1 reveals some bitrot > > CC kernel/bpf/cgroup.o > kernel/bpf/cgroup.c:238: warning: Function parameter or member 'flags' not > described in '__cgroup_bpf_attach' > kernel/bpf/cgroup.c:367: warning: Function parameter or member 'u

Re: [PATCH net] net: tls: Save iv in tls_rec for async crypto requests

2019-01-28 Thread David Miller
From: Dave Watson Date: Sun, 27 Jan 2019 00:57:38 + > aead_request_set_crypt takes an iv pointer, and we change the iv > soon after setting it. Some async crypto algorithms don't save the iv, > so we need to save it in the tls_rec for async requests. > > Found by hardcoding x64 aesni to use

Re: [PATCH net-next] net: nci: remove set-but-not-used variable 'status'

2019-01-28 Thread David Miller
From: YueHaibing Date: Tue, 29 Jan 2019 14:40:28 +0800 > gcc warning this: > net/nfc/nci/hci.c:373:5: > warning: variable 'status' set but not used [-Wunused-but-set-variable] > > It not used since commit d8cd37ed2fc8 ("NFC: nci: Fix improper > management of HCI return code"), so can be removed

Re: [PATCH bpf] bpf: run bpf programs with preemption disabled

2019-01-28 Thread Song Liu
> On Jan 28, 2019, at 6:43 PM, Alexei Starovoitov wrote: > > Disabled preemption is necessary for proper access to per-cpu maps > from BPF programs. > > But the sender side of socket filters didn't have preemption disabled: > unix_dgram_sendmsg->sk_filter->sk_filter_trim_cap->bpf_prog_run_sav

Re: [PATCH bpf-next] bpf: check that BPF programs run with preemption disabled

2019-01-28 Thread Song Liu
> On Jan 28, 2019, at 5:21 PM, Alexei Starovoitov wrote: > > From: Peter Zijlstra > > Introduce cant_sleep() macro for annotation of functions that cannot sleep. > > Use it in BPF_PROG_RUN to catch execution of BPF programs > in preemptable context. > > Suggested-by: Jann Horn > Signed-of

[PATCH net-next] net: nci: remove set-but-not-used variable 'status'

2019-01-28 Thread YueHaibing
gcc warning this: net/nfc/nci/hci.c:373:5: warning: variable 'status' set but not used [-Wunused-but-set-variable] It not used since commit d8cd37ed2fc8 ("NFC: nci: Fix improper management of HCI return code"), so can be removed. Signed-off-by: YueHaibing --- net/nfc/nci/hci.c | 10 ++

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-28 Thread David Miller
From: Jason Wang Date: Mon, 28 Jan 2019 15:05:05 +0800 > After batched used ring updating was introduced in commit e2b3b35eb989 > ("vhost_net: batch used ring update in rx"). We tend to batch heads in > vq->heads for more than one packet. But the quota passed to > get_rx_bufs() was not correctly

[PATCH net] ipv6: sr: clear IP6CB(skb) on SRH ip4ip6 encapsulation

2019-01-28 Thread Yohei Kanemaru
skb->cb may contain data from previous layers (in an observed case IPv4 with L3 Master Device). In the observed scenario, the data in IPCB(skb)->frags was misinterpreted as IP6CB(skb)->frag_max_size, eventually caused an unexpected IPv6 fragmentation in ip6_fragment() through ip6_finish_output().

[PATCH] kernel/bpf/cgroup.c - clean up kerneldoc warnings

2019-01-28 Thread valdis . kletnieks
Building with W=1 reveals some bitrot CC kernel/bpf/cgroup.o kernel/bpf/cgroup.c:238: warning: Function parameter or member 'flags' not described in '__cgroup_bpf_attach' kernel/bpf/cgroup.c:367: warning: Function parameter or member 'unused_flags' not described in '__cgroup_bpf_detach'

Re: r8169 Driver - Poor Network Performance Since Kernel 4.19

2019-01-28 Thread Heiner Kallweit
Hi Peter, I think the vendor driver doesn't enable ASPM per default. So it's worth a try to disable ASPM in the BIOS or via sysfs. Few older systems seem to have issues with ASPM, what kind of system / mainboard are you using? The RTL8168 is the onboard network chip? Rgds, Heiner On 29.01.2019

Re: linux-next: build failure after merge of the net-next tree

2019-01-28 Thread David Miller
From: Stephen Rothwell Date: Tue, 29 Jan 2019 16:17:42 +1100 > I have added the following fix patch for today: > > From: Stephen Rothwell > Date: Tue, 29 Jan 2019 16:13:08 +1100 > Subject: [PATCH] enetc: include linux/vmalloc.h for vzalloc etc > > Fixes: d4fd0404c1c9 ("enetc: Introduce basic P

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-28 Thread Stefan Hajnoczi
On Mon, Jan 28, 2019 at 03:05:05PM +0800, Jason Wang wrote: > After batched used ring updating was introduced in commit e2b3b35eb989 > ("vhost_net: batch used ring update in rx"). We tend to batch heads in > vq->heads for more than one packet. But the quota passed to > get_rx_bufs() was not correct

[PATCH] selftests/netfilter: fix config fragment CONFIG_NF_TABLES_INET

2019-01-28 Thread Naresh Kamboju
In selftests the config fragment for netfilter was added as NF_TABLES_INET=y and this patch correct it as CONFIG_NF_TABLES_INET=y Signed-off-by: Naresh Kamboju --- tools/testing/selftests/netfilter/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests

Re: [PATCH net-next] net: udp Allow CHECKSUM_UNNECESSARY packets to do GRO.

2019-01-28 Thread Tom Herbert
On Mon, Jan 28, 2019 at 10:04 PM maowenan wrote: > > > > On 2019/1/29 12:01, Tom Herbert wrote: > > On Mon, Jan 28, 2019 at 7:00 PM maowenan wrote: > >> > >> Hi all, > >> Do you have any comments about this change? > >> > >> > >> On 2019/1/23 11:33, Mao Wenan wrote: > >>> When udp4_gro_receive()

Re: [PATCH] netfilter: nat: Update comment of get_unique_tuple

2019-01-28 Thread YueHaibing
Friendly ping... On 2019/1/10 21:06, YueHaibing wrote: > Replace outdated __ip_conntrack_confirm in comment. > > Signed-off-by: YueHaibing > --- > net/netfilter/nf_nat_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/

Re: r8169 Driver - Poor Network Performance Since Kernel 4.19

2019-01-28 Thread Peter Ceiley
Hi Heiner, Thanks, I'll do some more testing. It might not be the driver - I assumed it was due to the fact that using the r8168 driver 'resolves' the issue. I'll see if I can test the r8169.c on top of 4.19 - this is a good idea. Cheers, Peter. On Tue, 29 Jan 2019 at 17:16, Heiner Kallweit wr

[PATCH net v3] net: l2tp: fix reading optional fields of L2TPv3

2019-01-28 Thread Jacob Wen
Use pskb_may_pull() to make sure the optional fields are in skb linear parts, so we can safely read them in l2tp_recv_common. It's easy to reproduce the issue with a net driver that supports paged skb data. Just create a L2TPv3 over IP tunnel and then generates some network traffic. Once reproduce

Re: r8169 Driver - Poor Network Performance Since Kernel 4.19

2019-01-28 Thread Heiner Kallweit
Hi Peter, at a first glance it doesn't look like a typical driver issue. What you could do: - Test the r8169.c from 4.18 on top of 4.19. - Check whether disabling ASPM (/sys/module/pcie_aspm) has an effect. - Bisect between 4.18 and 4.19 to find the offending commit. Any specific reason why yo

[PATCH] include/linux/bpf.h - fix missing prototype warnings...

2019-01-28 Thread valdis . kletnieks
Compiling with W=1 generates warnings: CC kernel/bpf/core.o kernel/bpf/core.c:721:12: warning: no previous prototype for ?bpf_jit_alloc_exec_limit? [-Wmissing-prototypes] 721 | u64 __weak bpf_jit_alloc_exec_limit(void) |^~~~ kernel/bpf/core.c:757:14:

Re: [PATCH net-next] net: udp Allow CHECKSUM_UNNECESSARY packets to do GRO.

2019-01-28 Thread maowenan
On 2019/1/29 12:01, Tom Herbert wrote: > On Mon, Jan 28, 2019 at 7:00 PM maowenan wrote: >> >> Hi all, >> Do you have any comments about this change? >> >> >> On 2019/1/23 11:33, Mao Wenan wrote: >>> When udp4_gro_receive() get one packet that uh->check=0, >>> skb_gro_checksum_validate_zero_che

Re: [PATCH] rtlwifi: remove set but not used variable 'cmd_seq'

2019-01-28 Thread YueHaibing
+cc netdev@vger.kernel.org On 2019/1/29 13:57, YueHaibing wrote: > ping... > > On 2018/9/11 20:12, YueHaibing wrote: >> Fixes gcc '-Wunused-but-set-variable' warning: >> >> drivers/net/wireless/realtek/rtlwifi/base.c: In function >> 'rtl_c2h_content_parsing': >> drivers/net/wireless/realtek/rtlw

Re: [PATCH] ath10k: snoc: remove set but not used variable 'ar_snoc'

2019-01-28 Thread YueHaibing
ping... On 2018/9/6 10:29, YueHaibing wrote: > From: Yue Haibing > > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/net/wireless/ath/ath10k/snoc.c: In function > 'ath10k_snoc_tx_pipe_cleanup': > drivers/net/wireless/ath/ath10k/snoc.c:681:22: warning: > variable 'ar_snoc' set but n

Re: [PATCH 06/33] netfilter: nf_tables: Support RULE_ID reference in new rule

2019-01-28 Thread Cong Wang
On Mon, Jan 28, 2019 at 4:00 PM Pablo Neira Ayuso wrote: > > From: Phil Sutter > > To allow for a batch to contain rules in arbitrary ordering, introduce > NFTA_RULE_POSITION_ID attribute which works just like NFTA_RULE_POSITION > but contains the ID of another rule within the same batch. This he

linux-next: build failure after merge of the net-next tree

2019-01-28 Thread Stephen Rothwell
Hi all, After merging the net-next tree, today's linux-next build (powerpc allyesconfig) failed like this: drivers/net/ethernet/freescale/enetc/enetc.c: In function 'enetc_alloc_txbdr': drivers/net/ethernet/freescale/enetc/enetc.c:685:17: error: implicit declaration of function 'vzalloc'; did yo

[RFC net-next 2/4] net: Prepare EnOcean device drivers

2019-01-28 Thread Andreas Färber
Add net_device helpers for EnOcean. Signed-off-by: Andreas Färber --- drivers/net/enocean/Makefile | 2 + drivers/net/enocean/enocean.c | 124 ++ include/linux/enocean/dev.h | 23 3 files changed, 149 insertions(+) create mode 100644 driver

[RFC net-next 1/4] net: Reserve protocol identifiers for EnOcean

2019-01-28 Thread Andreas Färber
EnOcean wireless technology is based on ASK (ERP1) and FSK (ERP2) modulations for sub-GHz and on IEEE 802.15.4 for 2.4 GHz. ARPHRD_ENOCEAN ETH_P_ERP{1,2} Signed-off-by: Andreas Färber --- include/uapi/linux/if_arp.h | 1 + include/uapi/linux/if_ether.h | 2 ++ 2 files changed, 3 insertions(+)

[RFC net-next 4/4] net: enocean: Prepare ESP2 support

2019-01-28 Thread Andreas Färber
The EnOcean Serial Protocol 2 used subtelegram frames different from ESP3. It also uses ORG identifiers differing from RORG identifiers in ERP. Only checksumming has been tested. Signed-off-by: Andreas Färber --- drivers/net/enocean/Makefile | 1 + drivers/net/enocean/enocean_esp.c |

[RFC net-next 3/4] net: enocean: Add ESP3 driver

2019-01-28 Thread Andreas Färber
This implements the EnOcean Serial Protocol 3. Rudimentary sending is prepared. Error handling is lacking and reception handling is missing. Tested with EnOcean TCM310 gateway module. Signed-off-by: Andreas Färber --- drivers/net/enocean/Makefile | 4 + drivers/net/enocean/enocean_esp.c

[RFC net-next 0/4] net: EnOcean prototype driver

2019-01-28 Thread Andreas Färber
Hello, This series implements a serdev driver for the EnOcean Serial Protocol (ESP). It follows previous weekend's Z-Wave serdev driver [1], exploring various wireless technologies surrounding LoRa/FSK/OOK in quest of a solid PHY layer. The EnOcean Radio Protocol 1 (ERP1) is based on ASK; ERP2 o

[PATCH] kernel/bpf/core.c - fix bitrotted kerneldoc.

2019-01-28 Thread valdis . kletnieks
Over the years, the function signature has changed, the kerneldoc block hasn't. Signed-off-by: Valdis Kletnieks diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 2a81b8af3748..2728b6247091 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1216,8 +1216,9 @@ bool bpf_opcode_in_insn

Re: [PATCH bpf] bpf, doc: add reviewers to maintainers entry

2019-01-28 Thread Alexei Starovoitov
On Tue, Jan 29, 2019 at 03:08:54AM +, Song Liu wrote: > > > > On Jan 28, 2019, at 2:55 PM, Daniel Borkmann wrote: > > > > In order to better scale BPF development on netdev, we've adopted a > > reviewer rotation for all BPF patches among the five of us for some > > time now. Lets give credi

Re: [PATCH net-next] net: udp Allow CHECKSUM_UNNECESSARY packets to do GRO.

2019-01-28 Thread Tom Herbert
On Mon, Jan 28, 2019 at 7:00 PM maowenan wrote: > > Hi all, > Do you have any comments about this change? > > > On 2019/1/23 11:33, Mao Wenan wrote: > > When udp4_gro_receive() get one packet that uh->check=0, > > skb_gro_checksum_validate_zero_check() will set the > > skb->ip_summed = CHECKSUM_UN

Re: pull-request: bpf-next 2019-01-29

2019-01-28 Thread David Miller
From: Daniel Borkmann Date: Tue, 29 Jan 2019 02:46:27 +0100 > The following pull-request contains BPF updates for your *net-next* tree. > > The main changes are: ... > Please consider pulling these changes from: > > git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git Pulled, than

[PATCH net-next 7/7] ethtool: add compat for devlink info

2019-01-28 Thread Jakub Kicinski
If driver did not fill the fw_version field, try to call into the new devlink get_info op and collect the versions that way. We assume ethtool was always reporting running versions. Signed-off-by: Jakub Kicinski --- include/net/devlink.h | 7 ++ net/core/devlink.c| 52 ++

[PATCH net-next 2/7] devlink: add version reporting to devlink info API

2019-01-28 Thread Jakub Kicinski
ethtool -i has a few fixed-size fields which can be used to report firmware version and expansion ROM version. Unfortunately, modern hardware has more firmware components. There is usually some datapath microcode, management controller, PXE drivers, and a CPLD load. Running ethtool -i on modern

[PATCH net-next 3/7] nfp: devlink: report driver name and serial number

2019-01-28 Thread Jakub Kicinski
Report the basic info through new devlink info API. RFCv2: - add driver name; - align serial to core changes. Signed-off-by: Jakub Kicinski --- .../net/ethernet/netronome/nfp/nfp_devlink.c | 24 +++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/netronome

[PATCH net-next 1/7] devlink: add device information API

2019-01-28 Thread Jakub Kicinski
ethtool -i has served us well for a long time, but its showing its limitations more and more. The device information should also be reported per device not per-netdev. Lay foundation for a simple devlink-based way of reading device info. Add driver name and device serial number as initial pieces

[PATCH net-next 0/7] devlink: add device (driver) information API

2019-01-28 Thread Jakub Kicinski
Hi! fw_version field in ethtool -i does not suit modern needs with 31 characters being quite limiting on more complex systems. There is also no distinction between the running and flashed versions of the firmware. Since the driver information pertains to the entire device, rather than a particul

[PATCH net-next 4/7] nfp: devlink: report fixed versions

2019-01-28 Thread Jakub Kicinski
Report information about the hardware. RFCv2: - add defines for board IDs which are likely to be reusable for other drivers (Jiri). Signed-off-by: Jakub Kicinski --- .../net/ethernet/netronome/nfp/nfp_devlink.c | 37 ++- include/net/devlink.h | 5 ++

[PATCH net-next 5/7] nfp: nsp: add support for versions command

2019-01-28 Thread Jakub Kicinski
Retrieve the FW versions with the new command. Signed-off-by: Jakub Kicinski --- .../ethernet/netronome/nfp/nfpcore/nfp_nsp.c | 61 +++ .../ethernet/netronome/nfp/nfpcore/nfp_nsp.h | 20 ++ 2 files changed, 81 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/n

[PATCH net-next 6/7] nfp: devlink: report the running and flashed versions

2019-01-28 Thread Jakub Kicinski
Report versions of firmware components using the new NSP command. Signed-off-by: Jakub Kicinski --- .../net/ethernet/netronome/nfp/nfp_devlink.c | 86 +++ include/net/devlink.h | 11 +++ 2 files changed, 97 insertions(+) diff --git a/drivers/net/ethernet

Re: [PATCH net-next] mdio_bus: Fix PTR_ERR() usage after initialization to constant

2019-01-28 Thread YueHaibing
On 2019/1/28 22:36, Andrew Lunn wrote: > On Mon, Jan 28, 2019 at 09:24:09PM +0800, YueHaibing wrote: >> Fix coccinelle warning: >> >> ./drivers/net/phy/mdio_bus.c:51:5-12: ERROR: PTR_ERR applied after >> initialization to constant on line 44 >> ./drivers/net/phy/mdio_bus.c:52:5-12: ERROR: PTR_ER

[PATCH v2 2/2] iwlwifi: Use struct_size() in kzalloc

2019-01-28 Thread YueHaibing
Use struct_size() in kzalloc instead of the 'regd_to_copy' Signed-off-by: YueHaibing --- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireles

[PATCH v2 0/2] cleanup for iwlwifi

2019-01-28 Thread YueHaibing
v2: Use struct_size in regd allocation YueHaibing (2): iwlwifi: Use kmemdup instead of duplicating its function iwlwifi: Use struct_size() in kzalloc drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) -- 2.7.4

[PATCH v2 1/2] iwlwifi: Use kmemdup instead of duplicating its function

2019-01-28 Thread YueHaibing
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing --- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwl

Re: [PATCH 2/2] iwlwifi: Use struct_size() in kzalloc

2019-01-28 Thread YueHaibing
On 2019/1/29 5:57, Joe Perches wrote: > On Mon, 2019-01-28 at 14:44 +0800, YueHaibing wrote: >> Use struct_size() in kzalloc instead of the 'regd_to_copy' > > There is also the use above that in the same function > that could also be converted. > > /* build a regdomain rule for every vali

Re: [PATCH] bpf/core.c - silence warning messages

2019-01-28 Thread Song Liu
On Mon, Jan 28, 2019 at 3:35 PM wrote: > > On Mon, 28 Jan 2019 09:18:45 -0800, Song Liu said: > > On Sun, Jan 27, 2019 at 8:43 PM wrote: > > > > The attached patch silences the warnings, because we *know* we're > > > overwriting > > > the default initializer. That leaves bpf/core.c with only 6 o

Re: [PATCH bpf] bpf, doc: add reviewers to maintainers entry

2019-01-28 Thread Song Liu
> On Jan 28, 2019, at 2:55 PM, Daniel Borkmann wrote: > > In order to better scale BPF development on netdev, we've adopted a > reviewer rotation for all BPF patches among the five of us for some > time now. Lets give credit where credit is due, and add Martin, Song > and Yonghong as official

Re: [PATCH bpf] bpf, doc: add reviewers to maintainers entry

2019-01-28 Thread Yonghong Song
On 1/28/19 2:55 PM, Daniel Borkmann wrote: > In order to better scale BPF development on netdev, we've adopted a > reviewer rotation for all BPF patches among the five of us for some > time now. Lets give credit where credit is due, and add Martin, Song > and Yonghong as official BPF reviewers to

Re: [PATCH net-next] net: udp Allow CHECKSUM_UNNECESSARY packets to do GRO.

2019-01-28 Thread maowenan
Hi all, Do you have any comments about this change? On 2019/1/23 11:33, Mao Wenan wrote: > When udp4_gro_receive() get one packet that uh->check=0, > skb_gro_checksum_validate_zero_check() will set the > skb->ip_summed = CHECKSUM_UNNECESSARY; > skb->csum_level = 0; > Then udp_gro_receive() will f

Re: [PATCH v2 net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-28 Thread Jason Wang
On 2019/1/29 上午10:35, Toshiaki Makita wrote: On 2019/01/29 11:23, Jason Wang wrote: On 2019/1/29 上午8:45, Toshiaki Makita wrote: ... @@ -2666,10 +2696,10 @@ static void free_unused_bufs(struct virtnet_info *vi)   for (i = 0; i < vi->max_queue_pairs; i++) {   struct virtqueue *vq

[PATCH bpf] bpf: run bpf programs with preemption disabled

2019-01-28 Thread Alexei Starovoitov
Disabled preemption is necessary for proper access to per-cpu maps from BPF programs. But the sender side of socket filters didn't have preemption disabled: unix_dgram_sendmsg->sk_filter->sk_filter_trim_cap->bpf_prog_run_save_cb->BPF_PROG_RUN and a combination of af_packet with tun device didn't

Re: [RFC PATCH 1/3] riscv: set HAVE_EFFICIENT_UNALIGNED_ACCESS

2019-01-28 Thread Palmer Dabbelt
On Fri, 25 Jan 2019 17:33:50 PST (-0800), Jim Wilson wrote: On Fri, Jan 25, 2019 at 12:21 PM Palmer Dabbelt wrote: Jim, would you be opposed to something like this? This looks OK to me. OK, thanks. I'll send some patches around :) +builtin_define_with_int_value ("__riscv_tune_m

Re: [PATCH v2 net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-28 Thread Toshiaki Makita
On 2019/01/29 11:23, Jason Wang wrote: > On 2019/1/29 上午8:45, Toshiaki Makita wrote: ... >> @@ -2666,10 +2696,10 @@ static void free_unused_bufs(struct >> virtnet_info *vi) >>   for (i = 0; i < vi->max_queue_pairs; i++) { >>   struct virtqueue *vq = vi->sq[i].vq; >>   while ((bu

Re: [PATCH net-next V4 0/5] vhost: accelerate metadata access through vmap()

2019-01-28 Thread Jason Wang
On 2019/1/27 上午8:31, Michael S. Tsirkin wrote: On Sat, Jan 26, 2019 at 02:37:08PM -0800, David Miller wrote: From: Jason Wang Date: Wed, 23 Jan 2019 17:55:52 +0800 This series tries to access virtqueue metadata through kernel virtual address instead of copy_user() friends since they had too

Re: [PATCH v2 net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-28 Thread Jason Wang
On 2019/1/29 上午8:45, Toshiaki Makita wrote: We do not reset or free up unused buffers when enabling/disabling XDP, so it can happen that xdp_frames are freed after disabling XDP or sk_buffs are freed after enabling XDP on xdp tx queues. Thus we need to handle both forms (xdp_frames and sk_buffs

Re: [PATCH v2 net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-28 Thread Jason Wang
On 2019/1/29 上午8:45, Toshiaki Makita wrote: Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not ready for XDP") tried to avoid access to unexpected sq while XDP is disabled, but was not complete. There was a small window which causes out of bounds sq access in virtnet_xdp_

Re: [PATCH net 1/1] bonding: fix PACKET_ORIGDEV regression on bonding masters

2019-01-28 Thread Michal Soltys
On 19/01/18 07:58, Maciej Żenczykowski wrote: I'm not sure there's a truly good answer. Also note, that there's subtle differences between af_packet sockets tied to ALL protocols vs tied to specific protocols (vs none/0 of course). However ETH_P_ALL protocol raw sockets need to be avoided if at

pull-request: bpf-next 2019-01-29

2019-01-28 Thread Daniel Borkmann
Hi David, The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Teach verifier dead code removal, this also allows for optimizing / removing conditional branches around dead code and to shrink the resulting image. Code store constrained architec

Re: [PATCH 00/33] Netfilter/IPVS updates for net-next

2019-01-28 Thread David Miller
From: Pablo Neira Ayuso Date: Tue, 29 Jan 2019 00:57:17 +0100 > The following patchset contains Netfilter/IPVS updates for your net-next tree: ... > You can pull these changes from: > > git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git Pulled, thanks Pablo.

Re: [PATCH bpf] bpf, doc: add reviewers to maintainers entry

2019-01-28 Thread Martin Lau
On Mon, Jan 28, 2019 at 11:55:26PM +0100, Daniel Borkmann wrote: > In order to better scale BPF development on netdev, we've adopted a > reviewer rotation for all BPF patches among the five of us for some > time now. Lets give credit where credit is due, and add Martin, Song > and Yonghong as offic

[PATCH bpf-next] bpf: check that BPF programs run with preemption disabled

2019-01-28 Thread Alexei Starovoitov
From: Peter Zijlstra Introduce cant_sleep() macro for annotation of functions that cannot sleep. Use it in BPF_PROG_RUN to catch execution of BPF programs in preemptable context. Suggested-by: Jann Horn Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Alexei Starovoitov --- include/linu

[PATCH bpf-next v3 4/4] selftests: bpf: add test_lwt_ip_encap selftest

2019-01-28 Thread Peter Oskolkov
This patch adds a bpf self-test to cover BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap. Covered: - encapping in LWT_IN and LWT_XMIT - IPv4 and IPv6 Signed-off-by: Peter Oskolkov --- tools/testing/selftests/bpf/Makefile | 5 +- .../testing/selftests/bpf/test_lwt_ip_encap.c | 84 +

[PATCH bpf-next v3 2/4] bpf: implement BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap

2019-01-28 Thread Peter Oskolkov
This patch implements BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap BPF helper. It enables BPF programs (specifically, BPF_PROG_TYPE_LWT_IN and BPF_PROG_TYPE_LWT_XMIT prog types) to add IP encapsulation headers to packets (e.g. IP/GRE, GUE, IPIP). This is useful when thousands of different short-liv

[PATCH bpf-next v3 1/4] bpf: add plumbing for BPF_LWT_ENCAP_IP in bpf_lwt_push_encap

2019-01-28 Thread Peter Oskolkov
This patch adds all needed plumbing in preparation to allowing bpf programs to do IP encapping via bpf_lwt_push_encap. Actual implementation is added in the next patch in the patchset. Of note: - bpf_lwt_push_encap can now be called from BPF_PROG_TYPE_LWT_XMIT prog types in addition to BPF_PROG_

[PATCH bpf-next v3 3/4] bpf: sync //bpf.h with tools//bpf.h

2019-01-28 Thread Peter Oskolkov
This patch copies changes in bpf.h done by a previous patch in this patchset from the kernel uapi include dir into tools uapi include dir. Signed-off-by: Peter Oskolkov --- tools/include/uapi/linux/bpf.h | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a

[PATCH bpf-next v3 0/4] bpf: add BPF_LWT_ENCAP_IP option to bpf_lwt_push_encap

2019-01-28 Thread Peter Oskolkov
This patchset implements BPF_LWT_ENCAP_IP mode in bpf_lwt_push_encap BPF helper. It enables BPF programs (specifically, BPF_PROG_TYPE_LWT_IN and BPF_PROG_TYPE_LWT_XMIT prog types) to add IP encapsulation headers to packets (e.g. IP/GRE, GUE, IPIP). This is useful when thousands of different short-

[PATCH v2 net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-28 Thread Toshiaki Makita
Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not ready for XDP") tried to avoid access to unexpected sq while XDP is disabled, but was not complete. There was a small window which causes out of bounds sq access in virtnet_xdp_xmit() while disabling XDP. An example case of

[PATCH v2 net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-28 Thread Toshiaki Makita
We do not reset or free up unused buffers when enabling/disabling XDP, so it can happen that xdp_frames are freed after disabling XDP or sk_buffs are freed after enabling XDP on xdp tx queues. Thus we need to handle both forms (xdp_frames and sk_buffs) regardless of XDP setting. One way to trigger

[PATCH v2 net 6/7] virtio_net: Use xdp_return_frame to free xdp_frames on destroying vqs

2019-01-28 Thread Toshiaki Makita
put_page() can work as a fallback for freeing xdp_frames, but the appropriate way is to use xdp_return_frame(). Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and xdp_return_frame API") Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Acked-by: Jesper Dangaard Brouer Ack

[PATCH v2 net 2/7] virtio_net: Don't call free_old_xmit_skbs for xdp_frames

2019-01-28 Thread Toshiaki Makita
When napi_tx is enabled, virtnet_poll_cleantx() called free_old_xmit_skbs() even for xdp send queue. This is bogus since the queue has xdp_frames, not sk_buffs, thus mangled device tx bytes counters because skb->len is meaningless value, and even triggered oops due to general protection fault on fr

[PATCH v2 net 1/7] virtio_net: Don't enable NAPI when interface is down

2019-01-28 Thread Toshiaki Makita
Commit 4e09ff536284 ("virtio-net: disable NAPI only when enabled during XDP set") tried to fix inappropriate NAPI enabling/disabling when !netif_running(), but was not complete. On error path virtio_net could enable NAPI even when !netif_running(). This can cause enabling NAPI twice on virtnet_ope

[PATCH v2 net 4/7] virtio_net: Fix out of bounds access of sq

2019-01-28 Thread Toshiaki Makita
When XDP is disabled, curr_queue_pairs + smp_processor_id() can be larger than max_queue_pairs. There is no guarantee that we have enough XDP send queues dedicated for each cpu when XDP is disabled, so do not count drops on sq in that case. Fixes: 5b8f3c8d30a6 ("virtio_net: Add XDP related stats")

[PATCH v2 net 0/7] virtio_net: Fix problems around XDP tx and napi_tx

2019-01-28 Thread Toshiaki Makita
While I'm looking into how to account standard tx counters on XDP tx processing, I found several bugs around XDP tx and napi_tx. Patch1: Fix oops on error path. Patch2 depends on this. Patch2: Fix memory corruption on freeing xdp_frames with napi_tx enabled. Patch3: Minor fix patch5 depends on. Pa

[PATCH v2 net 3/7] virtio_net: Fix not restoring real_num_rx_queues

2019-01-28 Thread Toshiaki Makita
When _virtnet_set_queues() failed we did not restore real_num_rx_queues. Fix this by placing the change of real_num_rx_queues after _virtnet_set_queues(). This order is also in line with virtnet_set_channels(). Fixes: 4941d472bf95 ("virtio-net: do not reset during XDP set") Signed-off-by: Toshiaki

Re: Packets being dropped somewhere in the kernel, between iptables and packet capture layers

2019-01-28 Thread Niklas Hambüchen
Some DNS requests on my machine take 5 seconds when a specific network interface is used. My big apologies for the confusion. I have found the reason. There was a scripted tc qdisc add dev enp3s0 root netem loss 5% in effect that I wasn't aware of while investigating. This dropped 5% of

Re: [PATCH bpf-next v3 0/3] support flow dissector in BPF_PROG_TEST_RUN

2019-01-28 Thread Daniel Borkmann
On 01/28/2019 05:53 PM, Stanislav Fomichev wrote: > This patch series adds support for testing flow dissector BPF programs by > extending already existing BPF_PROG_TEST_RUN. The goal is to have a > packet as an input and `struct bpf_flow_key' as an output. That way > we can easily test flow dissect

Re: [PATCH] bpf/core.c - silence warning messages

2019-01-28 Thread valdis . kletnieks
On Mon, 28 Jan 2019 09:18:45 -0800, Song Liu said: > On Sun, Jan 27, 2019 at 8:43 PM wrote: > > The attached patch silences the warnings, because we *know* we're > > overwriting > > the default initializer. That leaves bpf/core.c with only 6 other warnings, > > which become more visible in compa

Re: [PATCH 0/3] gcc-plugins: Introduce stackinit plugin

2019-01-28 Thread Alexander Popov
On 23.01.2019 14:03, Kees Cook wrote: > This adds a new plugin "stackinit" that attempts to perform unconditional > initialization of all stack variables Hello Kees! Hello everyone! I was curious about the performance impact of the initialization of all stack variables. So I did a very brief test

[PATCH 05/33] netfilter: physdev: relax br_netfilter dependency

2019-01-28 Thread Pablo Neira Ayuso
From: Florian Westphal Following command: iptables -D FORWARD -m physdev ... causes connectivity loss in some setups. Reason is that iptables userspace will probe kernel for the module revision of the physdev patch, and physdev has an artificial dependency on br_netfilter (xt_physdev use makes

[PATCH 02/33] netfilter: nf_tables: handle nft_object lookups via rhltable

2019-01-28 Thread Pablo Neira Ayuso
From: Florian Westphal Instead of linear search, use rhlist interface to look up the objects. This fixes rulesets with thousands of named objects (quota, counters and the like). We only use a single table for this and consider the address of the table we're doing the lookup in as a part of the k

[PATCH 06/33] netfilter: nf_tables: Support RULE_ID reference in new rule

2019-01-28 Thread Pablo Neira Ayuso
From: Phil Sutter To allow for a batch to contain rules in arbitrary ordering, introduce NFTA_RULE_POSITION_ID attribute which works just like NFTA_RULE_POSITION but contains the ID of another rule within the same batch. This helps iptables-nft-restore handling dumps with mixed insert/append comm

[PATCH 04/33] netfilter: conntrack: remove helper hook again

2019-01-28 Thread Pablo Neira Ayuso
From: Florian Westphal place them into the confirm one. Old: hook (300): ipv4/6_help() first call helper, then seqadj. hook (INT_MAX): confirm Now: hook (INT_MAX): confirm, first call helper, then seqadj, then confirm Not having the extra call is noticeable in bechmarks. Signed-off-by: Flo

[PATCH 20/33] netfilter: conntrack: remove l4proto init and get_net callbacks

2019-01-28 Thread Pablo Neira Ayuso
From: Florian Westphal Those were needed we still had modular trackers. As we don't have those anymore, prefer direct calls and remove all the (un)register infrastructure associated with this. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- include/net/netfilter/nf_conntr

[PATCH 11/33] netfilter: conntrack: remove net_id

2019-01-28 Thread Pablo Neira Ayuso
From: Florian Westphal No users anymore. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- include/net/netfilter/nf_conntrack_l4proto.h | 2 +- net/netfilter/nf_conntrack_proto.c | 8 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/

[PATCH 09/33] netfilter: conntrack: gre: convert rwlock to rcu

2019-01-28 Thread Pablo Neira Ayuso
From: Florian Westphal We can use gre. Lock is only needed when a new expectation is added. In case a single spinlock proves to be problematic we can either add one per netns or use an array of locks combined with net_hash_mix() or similar to pick the 'correct' one. But given this is only need

[PATCH 28/33] netfilter: conntrack: fix bogus port values for other l4 protocols

2019-01-28 Thread Pablo Neira Ayuso
From: Florian Westphal We must only extract l4 proto information if we can track the layer 4 protocol. Before removal of pkt_to_tuple callback, the code to extract port information was only reached for TCP/UDP/LITE/DCCP/SCTP. The other protocols were handled by the indirect call, and the 'gener

  1   2   3   4   5   >