[PATCH 25/28] dma-mapping: remove dma_cache_sync

2020-08-18 Thread Christoph Hellwig
All users are gone now, remove the API. Signed-off-by: Christoph Hellwig --- arch/mips/Kconfig | 1 - arch/mips/jazz/jazzdma.c| 1 - arch/mips/mm/dma-noncoherent.c | 6 -- arch/parisc/Kconfig | 1 - arch/parisc/kernel/pci-dma.c| 6 -- include/l

[PATCH 27/28] nvme-pci: fix PRP pool size

2020-08-18 Thread Christoph Hellwig
All operations are based on the controller, not the host page size. Switch the dma pool to use the controller page size as well to avoid massive overallocations on large page size systems. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

[PATCH 24/28] 53c700: convert from dma_cache_sync to dma_sync_single_for_device

2020-08-18 Thread Christoph Hellwig
Use the proper modern API to transfer cache ownership for incoherent DMA. Signed-off-by: Christoph Hellwig --- drivers/scsi/53c700.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 521950d0731e4a..57a08c42d00325

[PATCH 23/28] lib82596: convert from dma_cache_sync to dma_sync_single_for_device

2020-08-18 Thread Christoph Hellwig
Use the proper modern API to transfer cache ownership for incoherent DMA. Note that this moves the DMA helpers to the main lib82596.c file, so that they can use virt_to_dma. Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/i825xx/lasi_82596.c | 11 +-- drivers/net/ethernet/i825xx/lib82

[PATCH 28/28] nvme-pci: use dma_alloc_pages backed dmapools

2020-08-18 Thread Christoph Hellwig
Switch from coherent DMA pools to those backed by dma_alloc_pages. This helps device with non-coherent DMA to avoid host accesses to uncached memory for every submission of a larger than single entry I/O. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/pci.c | 80

[PATCH 17/28] dma-mapping: move dma_common_{mmap,get_sgtable} out of mapping.c

2020-08-18 Thread Christoph Hellwig
Add a new file that contains helpera for misc DMA ops, which is only built when CONFIG_DMA_OPS is set. Signed-off-by: Christoph Hellwig --- kernel/dma/Makefile | 1 + kernel/dma/mapping.c | 47 +--- kernel/dma/ops_helpers.c | 51 +

[PATCH 06/28] lib82596: move DMA allocation into the callers of i82596_probe

2020-08-18 Thread Christoph Hellwig
This allows us to get rid of the LIB82596_DMA_ATTR defined and prepare for untangling the coherent vs non-coherent DMA allocation API. Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/i825xx/lasi_82596.c | 24 ++-- drivers/net/ethernet/i825xx/lib82596.c | 36 --

[PATCH 18/28] dma-mapping: move the dma_declare_coherent_memory documentation

2020-08-18 Thread Christoph Hellwig
dma_declare_coherent_memory should not be in a DMA API guide aimed at driver writers (that is consumers of the API). Move it to a comment near the function instead. Signed-off-by: Christoph Hellwig --- Documentation/core-api/dma-api.rst | 24 kernel/dma/coherent.c

[PATCH 26/28] dmapool: add dma_alloc_pages support

2020-08-18 Thread Christoph Hellwig
Add an new variant of a dmapool that uses non-coherent memory from dma_alloc_pages. Unlike the existing mempool_create this one initialized a pool allocated by the caller to avoid a pointless extra allocation. At some point it might be worth to also switch the coherent allocation over to a simila

[PATCH 12/28] dma-direct: remove dma_direct_{alloc,free}_pages

2020-08-18 Thread Christoph Hellwig
Just merge these helpers into the main dma_direct_{alloc,free} routines, as the additional checks are always false for the two callers. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/amd_gart_64.c | 6 +++--- include/linux/dma-direct.h| 4 kernel/dma/direct.c | 39

[PATCH 09/28] MIPS/jazzdma: remove the unused vdma_remap function

2020-08-18 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/mips/include/asm/jazzdma.h | 2 - arch/mips/jazz/jazzdma.c| 70 - 2 files changed, 72 deletions(-) diff --git a/arch/mips/include/asm/jazzdma.h b/arch/mips/include/asm/jazzdma.h index d13f940022d5f9..c831da7fa8980

a saner API for allocating DMA addressable pages

2020-08-18 Thread Christoph Hellwig
Hi all, this series replaced the DMA_ATTR_NON_CONSISTENT flag to dma_alloc_attrs with a separate new dma_alloc_pages API, which is available on all platforms. In addition to cleaning up the convoluted code path, this ensures that other drivers that have asked for better support for non-coherent D

INFO: task can't die in tls_sk_proto_close

2020-08-18 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:4993e4fe Add linux-next specific files for 20200814 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=107ad7d690 kernel config: https://syzkaller.appspot.com/x/.config?x=2055bd0d83d5ee16 dashboard

Re: [PATCH bpf] bpf: verifier: check for packet data access based on target prog

2020-08-18 Thread Yonghong Song
On 8/18/20 6:12 PM, Udip Pant wrote: While using dynamic program extension (of type BPF_PROG_TYPE_EXT), we need to check the program type of the target program to grant the read / write access to the packet data. The BPF_PROG_TYPE_EXT type can be used to extend types such as XDP, SKB and othe

Re: [PATCH v4 3/9] net: dsa: mv88e6xxx: Use generic helper function

2020-08-18 Thread Kurt Kanzenbach
On Tue Aug 18 2020, Russell King - ARM Linux admin wrote: > On Tue, Aug 18, 2020 at 12:32:45PM +0200, Kurt Kanzenbach wrote: >> -static int is_pdelay_resp(u8 *msgtype) >> +static int is_pdelay_resp(const struct ptp_header *hdr) >> { >> -return (*msgtype & 0xf) == 3; >> +return (hdr->tsmt &

Re: [PATCH v4 2/9] ptp: Add generic ptp message type function

2020-08-18 Thread Kurt Kanzenbach
On Tue Aug 18 2020, Russell King wrote: > On Tue, Aug 18, 2020 at 12:32:44PM +0200, Kurt Kanzenbach wrote: >> The message type is located at different offsets within the ptp header >> depending >> on the ptp version (v1 or v2). Therefore, drivers which also deal with ptp v1 >> have some code for i

Re: [PATCH iproute2-next] iproute2: ss: add support to expose various inet sockopts

2020-08-18 Thread Stephen Hemminger
On Tue, 18 Aug 2020 16:17:19 -0700 Wei Wang wrote: > + if (!oneline) > + out("\n\tinet-sockopt: ("); > + else > + out(" inet-sockopt: ("); > + out("recverr: %d, ", sockopt->recverr)

Re: [PATCH bpf-next 1/7] libbpf: disable -Wswitch-enum compiler warning

2020-08-18 Thread Yonghong Song
On 8/18/20 6:39 PM, Andrii Nakryiko wrote: On Tue, Aug 18, 2020 at 6:23 PM Yonghong Song wrote: On 8/18/20 2:33 PM, Andrii Nakryiko wrote: That compilation warning is more annoying, than helpful. Curious which compiler and which version caused this issue? I did not hit with gcc 8.2 or

[PATCH net-next 3/5] ibmvnic: improve ibmvnic_init and ibmvnic_reset_init

2020-08-18 Thread Lijun Pan
When H_SEND_CRQ command returns with H_CLOSED, it means the server's CRQ is not ready yet. Instead of resetting immediately, we wait for the server to launch passive init. ibmvnic_init() and ibmvnic_reset_init() should also return the error code from ibmvnic_send_crq_init() call. Signed-off-by: Li

[PATCH net-next 0/5] refactoring of ibmvnic code

2020-08-18 Thread Lijun Pan
This patch series refactor reset_init and init functions, improve the debugging messages, and make some other cosmetic changes to make the code easier to read and debug. Lijun Pan (5): ibmvnic: print caller in several error messages ibmvnic: compare adapter->init_done_rc with more readable

[PATCH net-next 5/5] ibmvnic: merge ibmvnic_reset_init and ibmvnic_init

2020-08-18 Thread Lijun Pan
These two functions share the majority of the code, hence merge them together. In the meanwhile, add a reset pass-in parameter to differentiate them. Thus, the code is easier to read and to tell the difference between reset_init and regular init. Signed-off-by: Lijun Pan --- drivers/net/ethernet

[PATCH net-next 1/5] ibmvnic: print caller in several error messages

2020-08-18 Thread Lijun Pan
The error messages in the changed functions are exactly the same. In order to differentiate them and make debugging easier, we print the function names in the error messages. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 14 +++--- 1 file changed, 7 insertions(+), 7 d

[PATCH net-next 4/5] ibmvnic: remove never executed if statement

2020-08-18 Thread Lijun Pan
At the beginning of the function, from_passive_init is set false by "adapter->from_passive_init = false;", hence the if statement will never run. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/net/ethernet/

[PATCH net-next 2/5] ibmvnic: compare adapter->init_done_rc with more readable ibmvnic_rc_codes

2020-08-18 Thread Lijun Pan
Instead of comparing (adapter->init_done_rc == 1), let it be (adapter->init_done_rc == PARTIALSUCCESS). Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/i

Re: [PATCH bpf-next 0/9] Add support for type-based and enum value-based CO-RE relocations

2020-08-18 Thread Andrii Nakryiko
On Tue, Aug 18, 2020 at 6:37 PM Alexei Starovoitov wrote: > > On Tue, Aug 18, 2020 at 06:31:51PM -0700, Andrii Nakryiko wrote: > > On Tue, Aug 18, 2020 at 6:21 PM Alexei Starovoitov > > wrote: > > > > > > On Tue, Aug 18, 2020 at 03:39:12PM -0700, Andrii Nakryiko wrote: > > > > This patch set adds

[PATCH v2 bpf-next 3/5] selftests/bpf: add CO-RE relo test for TYPE_ID_LOCAL/TYPE_ID_TARGET

2020-08-18 Thread Andrii Nakryiko
Add tests for BTF type ID relocations. To allow testing this, enhance core_relo.c test runner to allow dynamic initialization of test inputs. If __builtin_btf_type_id() is not supported by Clang, skip tests. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/core_reloc.c | 168 +

[PATCH v2 bpf-next 0/5] Add support for type-based and enum value-based CO-RE relocations

2020-08-18 Thread Andrii Nakryiko
This patch set adds libbpf support for two new classes of CO-RE relocations: type-based (TYPE_EXISTS/TYPE_SIZE/TYPE_ID_LOCAL/TYPE_ID_TARGET) and enum value-vased (ENUMVAL_EXISTS/ENUMVAL_VALUE): - TYPE_EXISTS allows to detect presence in kernel BTF of a locally-recorded BTF type. Useful for fe

[PATCH v2 bpf-next 5/5] selftests/bpf: add tests for ENUMVAL_EXISTS/ENUMVAL_VALUE relocations

2020-08-18 Thread Andrii Nakryiko
Add tests validating existence and value relocations for enum value-based relocations. If __builtin_preserve_enum_value() built-in is not supported, skip tests. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/core_reloc.c | 56 + .../bpf/progs/btf__core_reloc_enum

[PATCH v2 bpf-next 4/5] libbpf: implement enum value-based CO-RE relocations

2020-08-18 Thread Andrii Nakryiko
Implement two relocations of a new enumerator value-based CO-RE relocation kind: ENUMVAL_EXISTS and ENUMVAL_VALUE. First, ENUMVAL_EXISTS, allows to detect the presence of a named enumerator value in the target (kernel) BTF. This is useful to do BPF helper/map/program type support detection from BP

[PATCH v2 bpf-next 1/5] libbpf: implement type-based CO-RE relocations support

2020-08-18 Thread Andrii Nakryiko
Implement support for TYPE_EXISTS/TYPE_SIZE/TYPE_ID_LOCAL/TYPE_ID_REMOTE relocations. These are examples of type-based relocations, as opposed to field-based relocations supported already. The difference is that they are calculating relocation values based on the type itself, not a field within a s

[PATCH v2 bpf-next 2/5] selftests/bpf: test TYPE_EXISTS and TYPE_SIZE CO-RE relocations

2020-08-18 Thread Andrii Nakryiko
Add selftests for TYPE_EXISTS and TYPE_SIZE relocations, testing correctness of relocations and handling of type compatiblity/incompatibility. If __builtin_preserve_type_info() is not supported by compiler, skip tests. Signed-off-by: Andrii Nakryiko --- .../selftests/bpf/prog_tests/core_reloc.c

[PATCH] net: bypass ->sendpage for slab pages

2020-08-18 Thread Christoph Hellwig
Sending Slab or tail pages into ->sendpage will cause really strange delayed oops. Prevent it right in the networking code instead of requiring drivers to guess the exact conditions where sendpage works. Based on a patch from Coly Li . Signed-off-by: Christoph Hellwig --- net/socket.c | 6

[PATCH net-next v2 1/2] net: dsa: loop: Configure VLANs while not filtering

2020-08-18 Thread Florian Fainelli
Since this is a mock-up driver with no real data path for now, but we will have one at some point, enable VLANs while not filtering. Signed-off-by: Florian Fainelli --- drivers/net/dsa/dsa_loop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa

[PATCH net-next v2 0/2] net: dsa: loop: Expose VLAN table through devlink

2020-08-18 Thread Florian Fainelli
Changes in v2: - set the DSA configure_vlan_while_not_filtering boolean - return the actual occupancy Florian Fainelli (2): net: dsa: loop: Configure VLANs while not filtering net: dsa: loop: Return VLAN table size through devlink drivers/net/dsa/dsa_loop.c | 56

[PATCH net-next v2 2/2] net: dsa: loop: Return VLAN table size through devlink

2020-08-18 Thread Florian Fainelli
We return the VLAN table size through devlink as a simple parameter, we do not support altering it at runtime: devlink resource show mdio_bus/fixed-0:1f mdio_bus/fixed-0:1f: name VTU size 4096 occ 0 unit entry dpipe_tables none and after configure a bridge with VLAN filtering: devlink resource

Re: [RFC PATCH net-next 0/6] devlink: Add device metric support

2020-08-18 Thread Florian Fainelli
On 8/18/2020 8:35 PM, Jakub Kicinski wrote: On Tue, 18 Aug 2020 20:43:11 -0600 David Ahern wrote: On 8/18/20 6:24 PM, Jakub Kicinski wrote: On Mon, 17 Aug 2020 15:50:53 +0300 Ido Schimmel wrote: From: Ido Schimmel This patch set extends devlink to allow device drivers to expose device met

[PATCH v6 bpf-next 4/4] selftests/bpf: Add bpffs preload test.

2020-08-18 Thread Alexei Starovoitov
From: Alexei Starovoitov Add a test that mounts two bpffs instances and checks progs.debug and maps.debug for sanity data. Signed-off-by: Alexei Starovoitov --- .../selftests/bpf/prog_tests/test_bpffs.c | 94 +++ 1 file changed, 94 insertions(+) create mode 100644 tools/te

[PATCH v6 bpf-next 0/4] bpf: Populate bpffs with map and prog iterators

2020-08-18 Thread Alexei Starovoitov
From: Alexei Starovoitov v5->v6: - refactored Makefiles with Andrii's help - switched to explicit $(MAKE) style - switched to userldlibs instead of userldflags - fixed build issue with libbpf Makefile due to invocation from kbuild - fixed menuconfig order as spotted by Daniel - introduced C

[PATCH v6 bpf-next 1/4] bpf: Factor out bpf_link_by_id() helper.

2020-08-18 Thread Alexei Starovoitov
From: Alexei Starovoitov Refactor the code a bit to extract bpf_link_by_id() helper. It's similar to existing bpf_prog_by_id(). Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Song Liu --- include/linux/bpf.h | 1 + kernel/bpf/syscall.c | 46 ++

[PATCH v6 bpf-next 3/4] bpf: Add kernel module with user mode driver that populates bpffs.

2020-08-18 Thread Alexei Starovoitov
From: Alexei Starovoitov Add kernel module with user mode driver that populates bpffs with BPF iterators. $ mount bpffs /my/bpffs/ -t bpf $ ls -la /my/bpffs/ total 4 drwxrwxrwt 2 root root0 Jul 2 00:27 . drwxr-xr-x 19 root root 4096 Jul 2 00:09 .. -rw--- 1 root root0 Jul 2 00:27

[PATCH v6 bpf-next 2/4] bpf: Add BPF program and map iterators as built-in BPF programs.

2020-08-18 Thread Alexei Starovoitov
From: Alexei Starovoitov The program and map iterators work similar to seq_file-s. Once the program is pinned in bpffs it can be read with "cat" tool to print human readable output. In this case about BPF programs and maps. For example: $ cat /sys/fs/bpf/progs.debug id nameattached

Re: [PATCH v7 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Coly Li
On 2020/8/19 03:49, Christoph Hellwig wrote: > On Wed, Aug 19, 2020 at 12:33:37AM +0800, Coly Li wrote: >> On 2020/8/19 00:24, Christoph Hellwig wrote: >>> I think we should go for something simple like this instead: >> >> This idea is fine to me. Should a warning message be through here? IMHO >> t

Re: [PATCH bpf-next] libbpf: simplify the return expression of build_map_pin_path()

2020-08-18 Thread Yonghong Song
On 8/18/20 7:53 PM, Xu Wang wrote: Simplify the return expression. Signed-off-by: Xu Wang Acked-by: Yonghong Song

Re: [net-next v3 3/4] devlink: introduce flash update overwrite mask

2020-08-18 Thread Jakub Kicinski
On Tue, 18 Aug 2020 17:28:17 -0700 Jacob Keller wrote: > +The ``devlink-flash`` command allows optionally specifying a mask indicating > +the how the device should handle subsections of flash components when remove one 'the'? > +updating. This mask indicates the set of sections which are allowed

Re: [PATCH net-next v2 0/7] net-next: dsa: mt7530: add support for MT7531

2020-08-18 Thread DENG Qingfang
Hi, Is port mirroring working? Port mirroring registers on MT7531 have moved, according to bpi's MT7531 reference manual. Please fix that as well.

Re: [net-next v3 1/4] devlink: check flash_update parameter support in net core

2020-08-18 Thread Jakub Kicinski
On Tue, 18 Aug 2020 17:28:15 -0700 Jacob Keller wrote: > struct devlink_ops { > + /** > + * @supported_flash_update_params: > + * mask of parameters supported by the driver's .flash_update > + * implemementation. > + */ > + u32 supported_flash_update_params; To be sure

Re: [PATCH net-next 18/18] gve: Bump version to 1.1.0.

2020-08-18 Thread Jakub Kicinski
On Tue, 18 Aug 2020 12:44:17 -0700 David Awogbemila wrote: > Update the driver version reported to the device and ethtool. > > Signed-off-by: David Awogbemila Please remove the driver version, we're working on getting rid of it in all networking drivers.

Re: [PATCH net-next 07/18] gve: Use link status register to report link status

2020-08-18 Thread Jakub Kicinski
On Tue, 18 Aug 2020 12:44:06 -0700 David Awogbemila wrote: > + if (link_status) { > + netif_carrier_on(priv->dev); > + } else { > + dev_info(&priv->pdev->dev, "Device link is down.\n"); Down message but no Up message? > + netif_carrier_off(priv->dev);

Re: [RFC PATCH net-next 0/6] devlink: Add device metric support

2020-08-18 Thread Jakub Kicinski
On Tue, 18 Aug 2020 20:43:11 -0600 David Ahern wrote: > On 8/18/20 6:24 PM, Jakub Kicinski wrote: > > On Mon, 17 Aug 2020 15:50:53 +0300 Ido Schimmel wrote: > >> From: Ido Schimmel > >> > >> This patch set extends devlink to allow device drivers to expose device > >> metrics to user space in a s

Re: [PATCH net-next 05/18] gve: Add Gvnic stats AQ command and ethtool show/set-priv-flags.

2020-08-18 Thread Jakub Kicinski
On Tue, 18 Aug 2020 12:44:04 -0700 David Awogbemila wrote: > From: Kuo Zhao > > Changes: > - Add a new flag in service_task_flags. Check both this flag and > ethtool flag when handle report stats. Update the stats when user turns > ethtool flag on. > > - In order to expose the NIC stats to the g

[PATCH bpf-next] libbpf: simplify the return expression of build_map_pin_path()

2020-08-18 Thread Xu Wang
Simplify the return expression. Signed-off-by: Xu Wang --- tools/lib/bpf/libbpf.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 5d20b2da4427..cd59e237ca96 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/l

Re: [PATCH -next] vdpa: Remove duplicate include

2020-08-18 Thread Jason Wang
On 2020/8/18 下午7:49, YueHaibing wrote: Remove duplicate include file Signed-off-by: YueHaibing --- drivers/vhost/vdpa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 3fab94f88894..95e2b8307a2a 100644 --- a/drivers/vhost/vdpa.c +++ b/dr

[PATCH net-next] SUNRPC: remove duplicate include

2020-08-18 Thread Wang Hai
Remove linux/sunrpc/auth_gss.h which is included more than once Reported-by: Hulk Robot Signed-off-by: Wang Hai --- net/sunrpc/auth_gss/trace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/sunrpc/auth_gss/trace.c b/net/sunrpc/auth_gss/trace.c index d26036a57443..76685abba60f 100644 --

[PATCH net-next] net: ipa: remove duplicate include

2020-08-18 Thread Wang Hai
Remove linux/notifier.h which is included more than once Reported-by: Hulk Robot Signed-off-by: Wang Hai --- drivers/net/ipa/ipa.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h index 55115cfb2972..407fee841a9a 100644 --- a/drivers/net/ipa/ipa.h

Re: [PATCH v1 0/2] To support the HFP WBS, a chip vendor may choose a particular

2020-08-18 Thread Shyh-In Hwang
Dear maintainers: These two patches are to expose the WBS sco packet length to the user space. Since different vendors may choose different USB alternate settings which result in different packet lengths, we need the kernel to expose the lengths to the user space to handle the packets properly. T

Re: [RFC PATCH net-next 0/6] devlink: Add device metric support

2020-08-18 Thread David Ahern
On 8/18/20 6:24 PM, Jakub Kicinski wrote: > On Mon, 17 Aug 2020 15:50:53 +0300 Ido Schimmel wrote: >> From: Ido Schimmel >> >> This patch set extends devlink to allow device drivers to expose device >> metrics to user space in a standard and extensible fashion, as opposed >> to the driver-specific

Re: [PATCH net] net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe()

2020-08-18 Thread wanghai (M)
在 2020/8/19 3:54, David Miller 写道: From: Wang Hai Date: Tue, 18 Aug 2020 21:44:04 +0800 Fix the missing free_netdev() before return from gemini_ethernet_port_probe() in the error handling case. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Reported-by: Hulk

[PATCH net v2] net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe()

2020-08-18 Thread Wang Hai
Replace alloc_etherdev_mq with devm_alloc_etherdev_mqs. In this way, when probe fails, netdev can be freed automatically. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Reported-by: Hulk Robot Signed-off-by: Wang Hai --- v1->v2: Make use of devm_alloc_etherdev_mq

[PATCH bpf-next] net-veth: add type safety to veth_xdp_to_ptr() and veth_ptr_to_xdp()

2020-08-18 Thread Maciej Żenczykowski
From: Maciej Żenczykowski This reduces likelihood of incorrect use. Test: builds Signed-off-by: Maciej Żenczykowski --- drivers/net/veth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/veth.c b/drivers/net/veth.c index e56cd562a664..b80cbffeb88e 100644 -

Re: [PATCH net-next v3 3/3] smsc95xx: add phylib support

2020-08-18 Thread Andrew Lunn
> @@ -553,32 +554,21 @@ static int smsc95xx_phy_update_flowcontrol(struct > usbnet *dev, u8 duplex, > static int smsc95xx_link_reset(struct usbnet *dev) > { > struct smsc95xx_priv *pdata = dev->driver_priv; > - struct mii_if_info *mii = &dev->mii; > - struct ethtool_cmd ecmd = { .c

[PATCH] gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPY

2020-08-18 Thread Mark Tomlinson
When receiving an IPv4 packet inside an IPv6 GRE packet, and the IP6_TNL_F_RCV_DSCP_COPY flag is set on the tunnel, the IPv4 header would get corrupted. This is due to the common ip6_tnl_rcv() function assuming that the inner header is always IPv6. This patch checks the tunnel protocol for IPv4 inn

Re: [PATCH net-next v3 3/3] smsc95xx: add phylib support

2020-08-18 Thread Andrew Lunn
On Tue, Aug 18, 2020 at 01:11:27PM +0200, Andre Edich wrote: > Generally, each PHY has their own configuration and it can be done > through an external PHY driver. The smsc95xx driver uses only the > hard-coded internal PHY configuration. > > This patch adds phylib support to probe external PHY d

Re: [PATCH] net: Avoid strcmp current->comm with warncomm when warned >= 5

2020-08-18 Thread linmiaohe
David Miller wrote: >From: Miaohe Lin >Date: Tue, 18 Aug 2020 07:41:32 -0400 > >> @@ -417,7 +417,7 @@ static void sock_warn_obsolete_bsdism(const char >> *name) { >> static int warned; >> static char warncomm[TASK_COMM_LEN]; >> -if (strcmp(warncomm, current->comm) && warned < 5) {

Re: [PATCH] net: Relax the npages test against MAX_SKB_FRAGS

2020-08-18 Thread linmiaohe
Eric Dumazet wrote: >On Tue, Aug 18, 2020 at 4:58 AM Miaohe Lin wrote: >> >> The npages test against MAX_SKB_FRAGS can be relaxed if we succeed to >> allocate high order pages as the note in comment said. >> > > >We do not want this change. > >This interface is used by datagram providers, we do

Re: [PATCH v3 bpf-next 0/4] libbpf: minimize feature detection (reallocarray, libelf-mmap)

2020-08-18 Thread Alexei Starovoitov
On 8/18/20 6:36 PM, Andrii Nakryiko wrote: Get rid of two feature detectors: reallocarray and libelf-mmap. Optional feature detections complicate libbpf Makefile and cause more troubles for various applications that want to integrate libbpf as part of their build. Patch #1 replaces all reallocar

Re: [PATCH bpf-next 4/7] libbpf: sanitize BPF program code for bpf_probe_read_{kernel,user}[_str]

2020-08-18 Thread Yonghong Song
On 8/18/20 2:33 PM, Andrii Nakryiko wrote: Add BPF program code sanitization pass, replacing calls to BPF bpf_probe_read_{kernel,user}[_str]() helpers with bpf_probe_read[_str](), if libbpf detects that kernel doesn't support new variants. I know this has been merged. The whole patch set loo

Re: [PATCH bpf-next 1/7] libbpf: disable -Wswitch-enum compiler warning

2020-08-18 Thread Andrii Nakryiko
On Tue, Aug 18, 2020 at 6:23 PM Yonghong Song wrote: > > > > On 8/18/20 2:33 PM, Andrii Nakryiko wrote: > > That compilation warning is more annoying, than helpful. > > Curious which compiler and which version caused this issue? > I did not hit with gcc 8.2 or latest clang in my environment. > St

答复: [Intel-wired-lan] [PATCH 0/2] intel/xdp fixes for fliping rx buffer

2020-08-18 Thread Li,Rongqing
> -邮件原件- > 发件人: Björn Töpel [mailto:bjorn.to...@gmail.com] > 发送时间: 2020年8月18日 22:05 > 收件人: Li,Rongqing > 抄送: Netdev ; intel-wired-lan > ; Karlsson, Magnus > ; Björn Töpel ; bpf > ; Maciej Fijalkowski ; > Piotr ; Maciej > 主题: Re: [Intel-wired-lan] [PATCH 0/2] intel/xdp fixes for fliping

Re: [PATCH bpf-next 0/9] Add support for type-based and enum value-based CO-RE relocations

2020-08-18 Thread Alexei Starovoitov
On Tue, Aug 18, 2020 at 06:31:51PM -0700, Andrii Nakryiko wrote: > On Tue, Aug 18, 2020 at 6:21 PM Alexei Starovoitov > wrote: > > > > On Tue, Aug 18, 2020 at 03:39:12PM -0700, Andrii Nakryiko wrote: > > > This patch set adds libbpf support to two new classes of CO-RE > > > relocations: > > > typ

[PATCH v3 bpf-next 0/4] libbpf: minimize feature detection (reallocarray, libelf-mmap)

2020-08-18 Thread Andrii Nakryiko
Get rid of two feature detectors: reallocarray and libelf-mmap. Optional feature detections complicate libbpf Makefile and cause more troubles for various applications that want to integrate libbpf as part of their build. Patch #1 replaces all reallocarray() uses into libbpf-internal reallocarray(

[PATCH v3 bpf-next 1/4] libbpf: remove any use of reallocarray() in libbpf

2020-08-18 Thread Andrii Nakryiko
Re-implement glibc's reallocarray() for libbpf internal-only use. reallocarray(), unfortunately, is not available in all versions of glibc, so requires extra feature detection and using reallocarray() stub from and COMPAT_NEED_REALLOCARRAY. All this complicates build of libbpf unnecessarily and is

[PATCH v3 bpf-next 3/4] libbpf: centralize poisoning and poison reallocarray()

2020-08-18 Thread Andrii Nakryiko
Most of libbpf source files already include libbpf_internal.h, so it's a good place to centralize identifier poisoning. So move kernel integer type poisoning there. And also add reallocarray to a poison list to prevent accidental use of it. libbpf_reallocarray() should be used universally instead.

[PATCH v3 bpf-next 2/4] tools/bpftool: remove libbpf_internal.h usage in bpftool

2020-08-18 Thread Andrii Nakryiko
Most netlink-related functions were unique to bpftool usage, so I moved them into net.c. Few functions are still used by both bpftool and libbpf itself internally, so I've copy-pasted them (libbpf_nl_get_link, libbpf_netlink_open). It's a bit of duplication of code, but better separation of libbpf

[PATCH v3 bpf-next 4/4] tools: remove feature-libelf-mmap feature detection

2020-08-18 Thread Andrii Nakryiko
It's trivial to handle missing ELF_C_MMAP_READ support in libelf the way that objtool has solved it in ("774bec3fddcc objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ"). So instead of having an entire feature detector for that, just do what objtool does for perf and libbpf. And keep their

Re: [PATCH v2 bpf-next 0/4] libbpf: minimize feature detection (reallocarray, libelf-mmap)

2020-08-18 Thread Andrii Nakryiko
On Tue, Aug 18, 2020 at 6:25 PM Alexei Starovoitov wrote: > > On Tue, Aug 18, 2020 at 6:24 PM Andrii Nakryiko wrote: > > > > Get rid of two feature detectors: reallocarray and libelf-mmap. Optional > > feature detections complicate libbpf Makefile and cause more troubles for > > various applicati

Re: [PATCH bpf-next 0/9] Add support for type-based and enum value-based CO-RE relocations

2020-08-18 Thread Andrii Nakryiko
On Tue, Aug 18, 2020 at 6:21 PM Alexei Starovoitov wrote: > > On Tue, Aug 18, 2020 at 03:39:12PM -0700, Andrii Nakryiko wrote: > > This patch set adds libbpf support to two new classes of CO-RE relocations: > > type-based (TYPE_EXISTS/TYPE_SIZE/TYPE_ID_LOCAL/TYPE_ID_TARGET) and enum > > value-vase

Re: [PATCH v2 bpf-next 0/4] libbpf: minimize feature detection (reallocarray, libelf-mmap)

2020-08-18 Thread Alexei Starovoitov
On Tue, Aug 18, 2020 at 6:24 PM Andrii Nakryiko wrote: > > Get rid of two feature detectors: reallocarray and libelf-mmap. Optional > feature detections complicate libbpf Makefile and cause more troubles for > various applications that want to integrate libbpf as part of their build. > > Patch #1

Re: [PATCH bpf-next 1/7] libbpf: disable -Wswitch-enum compiler warning

2020-08-18 Thread Yonghong Song
On 8/18/20 2:33 PM, Andrii Nakryiko wrote: That compilation warning is more annoying, than helpful. Curious which compiler and which version caused this issue? I did not hit with gcc 8.2 or latest clang in my environment. Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/Makefile | 2 +-

[PATCH v2 bpf-next 1/4] libbpf: remove any use of reallocarray() in libbpf

2020-08-18 Thread Andrii Nakryiko
Re-implement glibc's reallocarray() for libbpf internal-only use. reallocarray(), unfortunately, is not available in all versions of glibc, so requires extra feature detection and using reallocarray() stub from and COMPAT_NEED_REALLOCARRAY. All this complicates build of libbpf unnecessarily and is

Re: [PATCH bpf-next 0/9] Add support for type-based and enum value-based CO-RE relocations

2020-08-18 Thread Alexei Starovoitov
On Tue, Aug 18, 2020 at 03:39:12PM -0700, Andrii Nakryiko wrote: > This patch set adds libbpf support to two new classes of CO-RE relocations: > type-based (TYPE_EXISTS/TYPE_SIZE/TYPE_ID_LOCAL/TYPE_ID_TARGET) and enum > value-vased (ENUMVAL_EXISTS/ENUMVAL_VALUE): > > LLVM patches adding these relo

[PATCH v2 bpf-next 3/4] libbpf: centralize poisoning and poison reallocarray()

2020-08-18 Thread Andrii Nakryiko
Most of libbpf source files already include libbpf_internal.h, so it's a good place to centralize identifier poisoning. So move kernel integer type poisoning there. And also add reallocarray to a poison list to prevent accidental use of it. libbpf_reallocarray() should be used universally instead.

[PATCH v2 bpf-next 2/4] tools/bpftool: remove libbpf_internal.h usage in bpftool

2020-08-18 Thread Andrii Nakryiko
Most netlink-related functions were unique to bpftool usage, so I moved them into net.c. Few functions are still used by both bpftool and libbpf itself internally, so I've copy-pasted them (libbpf_nl_get_link, libbpf_netlink_open). It's a bit of duplication of code, but better separation of libbpf

[PATCH v2 bpf-next 0/4] libbpf: minimize feature detection (reallocarray, libelf-mmap)

2020-08-18 Thread Andrii Nakryiko
Get rid of two feature detectors: reallocarray and libelf-mmap. Optional feature detections complicate libbpf Makefile and cause more troubles for various applications that want to integrate libbpf as part of their build. Patch #1 replaces all reallocarray() uses into libbpf-internal reallocarray(

[PATCH v2 bpf-next 4/4] tools: remove feature-libelf-mmap feature detection

2020-08-18 Thread Andrii Nakryiko
It's trivial to handle missing ELF_C_MMAP_READ support in libelf the way that objtool has solved it in ("774bec3fddcc objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ"). So instead of having an entire feature detector for that, just do what objtool does for perf and libbpf. And keep their

Re: [PATCH bpf-next 4/4] tools: remove feature-libelf-mmap feature detection

2020-08-18 Thread Andrii Nakryiko
On Tue, Aug 18, 2020 at 6:08 PM Alexei Starovoitov wrote: > > On Tue, Aug 18, 2020 at 02:59:08PM -0700, Andrii Nakryiko wrote: > > It's trivial to handle missing ELF_C_MMAP_READ support in libelf the way > > that > > objtool has solved it in > > ("774bec3fddcc objtool: Add fallback from ELF_C_REA

[PATCH bpf] bpf: verifier: check for packet data access based on target prog

2020-08-18 Thread Udip Pant
While using dynamic program extension (of type BPF_PROG_TYPE_EXT), we need to check the program type of the target program to grant the read / write access to the packet data. The BPF_PROG_TYPE_EXT type can be used to extend types such as XDP, SKB and others. Since the BPF_PROG_TYPE_EXT program ty

linux-next: manual merge of the net-next tree with the kspp-gustavo tree

2020-08-18 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the net-next tree got a conflict in: lib/nlattr.c between commit: 58e813cceabd ("treewide: Use fallthrough pseudo-keyword") from the kspp-gustavo tree and commit: 8aa26c575fb3 ("netlink: make NLA_BINARY validation more flexible") from the net-next tr

Re: [PATCH bpf-next 4/4] tools: remove feature-libelf-mmap feature detection

2020-08-18 Thread Alexei Starovoitov
On Tue, Aug 18, 2020 at 02:59:08PM -0700, Andrii Nakryiko wrote: > It's trivial to handle missing ELF_C_MMAP_READ support in libelf the way that > objtool has solved it in > ("774bec3fddcc objtool: Add fallback from ELF_C_READ_MMAP to ELF_C_READ"). > > So instead of having an entire feature detect

[PATCH bpf-next 2/2] net-tun: eliminate two tun/xdp related function calls from vhost-net

2020-08-18 Thread Maciej Żenczykowski
From: Maciej Żenczykowski This provides a minor performance boost by virtue of inlining instead of cross module function calls. Test: builds Signed-off-by: Maciej Żenczykowski --- drivers/net/tun.c | 18 -- include/linux/if_tun.h | 15 --- 2 files changed, 12 i

[PATCH bpf-next 1/2] net-tun: add type safety to tun_xdp_to_ptr() and tun_ptr_to_xdp()

2020-08-18 Thread Maciej Żenczykowski
From: Maciej Żenczykowski This reduces likelihood of incorrect use. Test: builds Signed-off-by: Maciej Żenczykowski --- drivers/net/tun.c | 6 +++--- include/linux/if_tun.h | 8 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c i

Re: [PATCH bpf v2 1/3] bpf: fix a rcu_sched stall issue with bpf task/task_file iterator

2020-08-18 Thread Alexei Starovoitov
On Tue, Aug 18, 2020 at 05:30:37PM -0700, Yonghong Song wrote: > > > On 8/18/20 5:05 PM, Alexei Starovoitov wrote: > > On Tue, Aug 18, 2020 at 03:23:09PM -0700, Yonghong Song wrote: > > > > > > We did not use cond_resched() since for some iterators, e.g., > > > netlink iterator, where rcu read_l

Re: [PATCH v5] bpf/selftests: fold test_current_pid_tgid_new_ns into test_progs.

2020-08-18 Thread Andrii Nakryiko
On Tue, Aug 18, 2020 at 1:44 PM Carlos Neira wrote: > > Currently tests for bpf_get_ns_current_pid_tgid() are outside test_progs. > This change folds a test case into test_progs. > > Changes from V4: > - Added accidentally removed blank space in Makefile. > - Added () around bit-shift operations

[net-next v3 2/4] devlink: convert flash_update to use params structure

2020-08-18 Thread Jacob Keller
The devlink core recently gained support for checking whether the driver supports a flash_update parameter, via `supported_flash_update_params`. However, parameters are specified as function arguments. Adding a new parameter still requires modifying the signature of the .flash_update callback in al

Re: [PATCH bpf v2 1/3] bpf: fix a rcu_sched stall issue with bpf task/task_file iterator

2020-08-18 Thread Yonghong Song
On 8/18/20 5:05 PM, Alexei Starovoitov wrote: On Tue, Aug 18, 2020 at 03:23:09PM -0700, Yonghong Song wrote: We did not use cond_resched() since for some iterators, e.g., netlink iterator, where rcu read_lock critical section spans between consecutive seq_ops->next(), which makes impossible

[iproute2-next v3 1/2] Update devlink header for overwrite mask attribute

2020-08-18 Thread Jacob Keller
Signed-off-by: Jacob Keller --- include/uapi/linux/devlink.h | 24 1 file changed, 24 insertions(+) diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index b7f23faae901..bc63bd0b60c1 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linu

[iproute2-next v3 0/2] devlink flash update overwrite mask

2020-08-18 Thread Jacob Keller
This series introduces support for the new attribute to devlink flash update, DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK. This attribute is a bitfield which allows userspace to specify what set of subfields to overwrite when performing a flash update for a device. The intention is to support the ab

[iproute2-next v3 2/2] devlink: support setting the overwrite mask

2020-08-18 Thread Jacob Keller
Add support for specifying the overwrite sections to allow in the flash update command. This is done by adding a new "overwrite" option which can take either "settings" or "identifiers" passing the overwrite mode multiple times will combine the fields using bitwise-OR. Signed-off-by: Jacob Keller

[net-next v3 0/4] devlink flash update overwrite mask

2020-08-18 Thread Jacob Keller
This series introduces support for a new attribute to the flash update command: DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK. This attribute is a bitfield which allows userspace to specify what set of subfields to overwrite when performing a flash update for a device. The intention is to support the

ethernet/sfc/ warnings with 32-bit dma_addr_t

2020-08-18 Thread Randy Dunlap
Hi, Does the drivers/net/ethernet/sfc/sfc driver require (expect) dma_addr_t to be 64 bits (as opposed to 32 bits)? I see that several #defines in ef100_regs.h are 64... When used with DMA_BIT_MASK(64), does the value just need to be truncated to 32 bits? Will that work? When I build this dri

[net-next v3 4/4] ice: add support for flash update overwrite mask

2020-08-18 Thread Jacob Keller
Support the recently added DEVLINK_ATTR_FLASH_UPDATE_OVERWRITE_MASK parameter in the ice flash update handler. Convert the overwrite mask bitfield into the appropriate preservation level used by the firmware when updating. Because there is no equivalent preservation level for overwriting only iden

  1   2   3   4   >