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

2020-08-23 Thread Ido Schimmel
On Sat, Aug 22, 2020 at 09:27:39AM -0700, Jakub Kicinski wrote: > On Fri, 21 Aug 2020 19:18:37 -0600 David Ahern wrote: > > On 8/21/20 6:37 PM, Jakub Kicinski wrote: > > >>> # cat /proc/net/tls_stat > > >> > > >> I do not agree with adding files under /proc/net for this. > > > > > > Yeah it

[PATCH] NFC: st95hf: Fix memleak in st95hf_in_send_cmd

2020-08-23 Thread Dinghao Liu
When down_killable() fails, skb_resp should be freed just like when st95hf_spi_send() fails. Signed-off-by: Dinghao Liu --- drivers/nfc/st95hf/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 9642971e89ce..4578

[PATCH] net: atheros: switch from 'pci_' to 'dma_' API

2020-08-23 Thread Christophe JAILLET
The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. When memory is allocated in 'atl1e_setup_ring_resources()' (atl1e_main.c), 'atl1

[PATCH net-next 5/7] selftests: forwarding: Fix mausezahn delay parameter in mirror_test()

2020-08-23 Thread Ido Schimmel
From: Danielle Ratson Currently, mausezahn delay parameter in mirror_test() is specified with 'ms' units. mausezahn versions before 0.6.5 interpret 'ms' as seconds and therefore the tests that use mirror_test() take a very long time to complete. Resolve this by specifying 'msec' units. Signed-

[PATCH net-next 2/7] selftests: mlxsw: Decrease required rate accuracy

2020-08-23 Thread Ido Schimmel
From: Ido Schimmel On Spectrum-{2,3} the required accuracy is +/-10%. Align the test to this requirement so that it can reliably pass on these platforms. Signed-off-by: Ido Schimmel --- .../selftests/drivers/net/mlxsw/devlink_trap_policer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH net-next 1/7] mlxsw: spectrum_trap: Adjust default policer burst size for Spectrum-{2, 3}

2020-08-23 Thread Ido Schimmel
From: Ido Schimmel On the Spectrum-{2,3} ASICs the minimum burst size of the packet trap policers needs to be 40% of the configured rate. Otherwise, intermittent drops are observed even when the incoming packet rate is slightly lower than the configured policer rate. Adjust the burst size of the

[PATCH net-next 4/7] selftests: mlxsw: Increase burst size for burst test

2020-08-23 Thread Ido Schimmel
From: Ido Schimmel The current combination of rate and burst size does not adhere to Spectrum-{2,3} limitation which states that the minimum burst size should be 40% of the rate. Increase the burst size in order to honor above mentioned limitation and avoid intermittent failures of this test cas

[PATCH net-next 0/7] mlxsw: Misc updates

2020-08-23 Thread Ido Schimmel
From: Ido Schimmel This patch set includes various updates for mlxsw. Patches #1-#4 adjust the default burst size of packet trap policers to conform to Spectrum-{2,3} requirements. The corresponding selftest is also adjusted so that it could reliably pass on these platforms. Patch #5 adjusts a

[PATCH net-next 7/7] mlxsw: spectrum_ethtool: Remove internal speeds from PTYS register

2020-08-23 Thread Ido Schimmel
From: Danielle Ratson The PTYS register is used to report and configure the port type and speed. Currently, internal bits in the register are used the same way other bits are used. Using the internal bits can cause bad parameter firmware errors. For example, trying to write to internal bit 25 re

[PATCH net-next 3/7] selftests: mlxsw: Increase burst size for rate test

2020-08-23 Thread Ido Schimmel
From: Ido Schimmel The current combination of rate and burst size does not adhere to Spectrum-{2,3} limitation which states that the minimum burst size should be 40% of the rate. Increase the burst size in order to honor above mentioned limitation and avoid intermittent failures of this test cas

[PATCH net-next 6/7] selftests: mlxsw: Reduce runtime of tc-police scale test

2020-08-23 Thread Ido Schimmel
From: Ido Schimmel Currently, the test takes about 626 seconds to complete because of an inefficient use of the device's TCAM. Reduce the runtime to 202 seconds by inserting all the flower filters with the same preference and mask, but with a different key. In particular, this reduces the deleti

[PATCH] net: usb: Fix uninit-was-stored issue in asix_read_cmd()

2020-08-23 Thread Himadri Pandya
Initialize the buffer before passing it to usb_read_cmd() function(s) to fix the uninit-was-stored issue in asix_read_cmd(). Fixes: KMSAN: kernel-infoleak in raw_ioctl Reported by: syzbot+a7e220df5a81d1ab4...@syzkaller.appspotmail.com Signed-off-by: Himadri Pandya --- drivers/net/usb/asix_commo

[PATCH] chelsio: switch from 'pci_' to 'dma_' API

2020-08-23 Thread Christophe JAILLET
The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has been hand modified to replace GFP_ with a correct flag. It has been compile tested. When memory is allocated in 'free_rx_resources()' and 'alloc_tx_resources()' (sg

[PATCH bpf-next 3/3] samples: bpf: Refactor tracepoint tracing programs with libbpf

2020-08-23 Thread Daniel T. Lee
For the problem of increasing fragmentation of the bpf loader programs, instead of using bpf_loader.o, which is used in samples/bpf, this commit refactors the existing tracepoint tracing programs with libbbpf bpf loader. - Adding a tracepoint event and attaching a bpf program to it was done

[PATCH bpf-next 1/3] samples: bpf: cleanup bpf_load.o from Makefile

2020-08-23 Thread Daniel T. Lee
Since commit cc7f641d637b ("samples: bpf: Refactor BPF map performance test with libbpf") has ommited the removal of bpf_load.o from Makefile, this commit removes the bpf_load.o rule for targets where bpf_load.o is not used. Fixes: cc7f641d637b ("samples: bpf: Refactor BPF map performance test wit

[PATCH bpf-next 0/3] samples: bpf: Refactor tracing programs with libbpf

2020-08-23 Thread Daniel T. Lee
For the problem of increasing fragmentation of the bpf loader programs, instead of using bpf_loader.o, which is used in samples/bpf, this patch refactors the existing kprobe, tracepoint tracing programs with libbbpf bpf loader. - For kprobe events pointing to system calls, the SYSCALL() macro

[PATCH bpf-next 2/3] samples: bpf: Refactor kprobe tracing programs with libbpf

2020-08-23 Thread Daniel T. Lee
For the problem of increasing fragmentation of the bpf loader programs, instead of using bpf_loader.o, which is used in samples/bpf, this commit refactors the existing kprobe tracing programs with libbbpf bpf loader. - For kprobe events pointing to system calls, the SYSCALL() macro in trac

[no subject]

2020-08-23 Thread Celine Marchand
Hello Dearest, how are you? I am sorry for intruding your mailbox, but I need to talk to you. I got your email address in my dream and i wonder if it is correct because i emailed you earlier without any response. You should know that my contact to you is by the special grace of God. I am in u

[PATCH] net: arc_emac: Fix memleak in arc_mdio_probe

2020-08-23 Thread Dinghao Liu
When devm_gpiod_get_optional() fails, bus should be freed just like when of_mdiobus_register() fails. Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver") Signed-off-by: Dinghao Liu --- drivers/net/ethernet/arc/emac_mdio.c | 1 + 1 file changed, 1 insertion(+) diff --gi

Re: [PATCH] net: usb: Fix uninit-was-stored issue in asix_read_cmd()

2020-08-23 Thread Greg Kroah-Hartman
On Sun, Aug 23, 2020 at 11:26:27AM +0200, Dmitry Vyukov wrote: > On Sun, Aug 23, 2020 at 10:21 AM Himadri Pandya > wrote: > > > > Initialize the buffer before passing it to usb_read_cmd() function(s) to > > fix the uninit-was-stored issue in asix_read_cmd(). > > > > Fixes: KMSAN: kernel-infoleak i

Re: [PATCH] net: usb: Fix uninit-was-stored issue in asix_read_cmd()

2020-08-23 Thread Greg Kroah-Hartman
On Sun, Aug 23, 2020 at 12:31:03PM +0200, Dmitry Vyukov wrote: > On Sun, Aug 23, 2020 at 12:19 PM Greg Kroah-Hartman > > It's not always a failure, some devices have protocols that are "I could > > return up to a max X bytes but could be shorter" types of messages, so > > it's up to the caller to c

Re: [PATCH] net: usb: Fix uninit-was-stored issue in asix_read_cmd()

2020-08-23 Thread Greg Kroah-Hartman
On Sun, Aug 23, 2020 at 12:31:03PM +0200, Dmitry Vyukov wrote: > On Sun, Aug 23, 2020 at 12:19 PM Greg Kroah-Hartman > wrote: > > > > On Sun, Aug 23, 2020 at 11:26:27AM +0200, Dmitry Vyukov wrote: > > > On Sun, Aug 23, 2020 at 10:21 AM Himadri Pandya > > > wrote: > > > > > > > > Initialize the bu

Re: [EXT] Re: [PATCH v6 net-next 04/10] qed: implement devlink info request

2020-08-23 Thread Igor Russkikh
>> ~$ sudo ~/iproute2/devlink/devlink dev info >> pci/:01:00.1: >> driver qed >> board.serial_number REE1915E44552 >> versions: >> running: >> fw.app 8.42.2.0 >> stored: >> fw.mgmt 8.52.10.0 > > Are you not able to report the running version of the stored f

[PATCH v7 net-next 04/10] qed: implement devlink info request

2020-08-23 Thread Igor Russkikh
Here we return existing fw & mfw versions, we also fetch device's serial number: ~$ sudo ~/iproute2/devlink/devlink dev info pci/:01:00.1: driver qed board.serial_number REE1915E44552 versions: running: fw.app 8.42.2.0 stored: fw.mgmt 8.52.10.0 MFW and FW ar

[PATCH v7 net-next 05/10] qed: health reporter init deinit seq

2020-08-23 Thread Igor Russkikh
Here we declare health reporter ops (empty for now) and register these in qed probe and remove callbacks. This way we get devlink attached to all kind of qed* PCI device entities: networking or storage offload entity. Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed-off-by:

[PATCH v7 net-next 06/10] qed: use devlink logic to report errors

2020-08-23 Thread Igor Russkikh
Use devlink_health_report to push error indications. We implement this in qede via callback function to make it possible to reuse the same for other drivers sitting on top of qed in future. Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed-off-by: Michal Kalderon Acked-by: Ja

[PATCH v7 net-next 01/10] qed: move out devlink logic into a new file

2020-08-23 Thread Igor Russkikh
We are extending devlink infrastructure, thus move the existing stuff into a new file qed_devlink.c Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed-off-by: Michal Kalderon Reviewed-by: Jesse Brandeburg --- drivers/net/ethernet/qlogic/qed/Makefile | 1 + drivers/net

[PATCH v7 net-next 03/10] qed: fix kconfig help entries

2020-08-23 Thread Igor Russkikh
This patch replaces stubs in kconfig help entries with an actual description. Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed-off-by: Michal Kalderon --- drivers/net/ethernet/qlogic/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/ne

[PATCH v7 net-next 02/10] qed/qede: make devlink survive recovery

2020-08-23 Thread Igor Russkikh
Devlink instance lifecycle was linked to qed_dev object, that caused devlink to be recreated on each recovery. Changing it by making higher level driver (qede) responsible for its life. This way devlink now survives recoveries. qede now stores devlink structure pointer as a part of its device obj

[PATCH v7 net-next 00/10] qed: introduce devlink health support

2020-08-23 Thread Igor Russkikh
This is a followup implementation after series https://patchwork.ozlabs.org/project/netdev/cover/20200514095727.1361-1-irussk...@marvell.com/ This is an implementation of devlink health infrastructure. With this we are now able to report HW errors to devlink, and it'll take its own actions depen

[PATCH v7 net-next 09/10] qed: align adjacent indent

2020-08-23 Thread Igor Russkikh
Remove extra indent on some of adjacent declarations. Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed-off-by: Michal Kalderon --- include/linux/qed/qed_if.h | 69 ++ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/include

[PATCH v7 net-next 10/10] qede: make driver reliable on unload after failures

2020-08-23 Thread Igor Russkikh
In case recovery was not successful, netdev still should be present. But we should clear cdev if something bad happens on recovery. We also check cdev for null on dev close. That could be a case if recovery was not successful. Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed

[PATCH v7 net-next 08/10] qed: implement devlink dump

2020-08-23 Thread Igor Russkikh
Gather and push out full device dump to devlink. Device dump is the same as with `ethtool -d`, but now its generated exactly at the moment bad thing happens. Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed-off-by: Michal Kalderon --- drivers/net/ethernet/qlogic/qed/qed_dev

[PATCH v7 net-next 07/10] qed*: make use of devlink recovery infrastructure

2020-08-23 Thread Igor Russkikh
Remove forcible recovery trigger and put it as a normal devlink callback. This allows user to enable/disable it via devlink health set pci/:03:00.0 reporter fw_fatal auto_recover false Signed-off-by: Igor Russkikh Signed-off-by: Alexander Lobakin Signed-off-by: Michal Kalderon Acked-b

[PATCH] firestream: Fix memleak in fs_open

2020-08-23 Thread Dinghao Liu
When make_rate() fails, vcc should be freed just like other error paths in fs_open(). Signed-off-by: Dinghao Liu --- drivers/atm/firestream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 2ca9ec802734..510250cf5c87 100644 --- a/driv

[PATCH] dt-bindings: net: dsa: Fix typo

2020-08-23 Thread Kurt Kanzenbach
Fix spelling mistake documenation -> documentation. Fixes: 5a18bb14c0f7 ("dt-bindings: net: dsa: Let dsa.txt refer to dsa.yaml") Signed-off-by: Kurt Kanzenbach --- Documentation/devicetree/bindings/net/dsa/dsa.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Sorry, missed that earlier.

[PATCH] net: ocelot: Add of_node_put() before return statement

2020-08-23 Thread Sumera Priyadarsini
Every iteration of for_each_available_child_of_node() decrements the reference count of the previous node, however when control is transferred from the middle of the loop, as in the case of a return or break or goto, there is no decrement thus ultimately resulting in a memory leak. Fix a potential

[PATCH] net: dsa: Add of_node_put() before break statement

2020-08-23 Thread Sumera Priyadarsini
Every iteration of for_each_child_of_node() decrements the reference count of the previous node, however when control is transferred from the middle of the loop, as in the case of a return or break or goto, there is no decrement thus ultimately resulting in a memory leak. Fix a potential memory le

Re: [PATCH net-next 1/6] xdp: introduce mb in xdp_buff/xdp_frame

2020-08-23 Thread Shay Agroskin
Lorenzo Bianconi writes: Introduce multi-buffer bit (mb) in xdp_frame/xdp_buffer to specify if shared_info area has been properly initialized for non-linear xdp buffers Signed-off-by: Lorenzo Bianconi --- include/net/xdp.h | 8 ++-- net/core/xdp.c| 1 + 2 files changed, 7 insertio

[PATCH v1] brcmfmac: increase F2 watermark for BCM4329

2020-08-23 Thread Dmitry Osipenko
This patch fixes SDHCI CRC errors during of RX throughput testing on BCM4329 chip if SDIO BUS is clocked above 25MHz. In particular the checksum problem is observed on NVIDIA Tegra20 SoCs. The good watermark value is borrowed from downstream BCMDHD driver and it's the same as the value used for the

Re: [PATCH] dt-bindings: net: dsa: Fix typo

2020-08-23 Thread Andrew Lunn
On Sun, Aug 23, 2020 at 02:18:36PM +0200, Kurt Kanzenbach wrote: > Fix spelling mistake documenation -> documentation. > > Fixes: 5a18bb14c0f7 ("dt-bindings: net: dsa: Let dsa.txt refer to dsa.yaml") > Signed-off-by: Kurt Kanzenbach Reviewed-by: Andrew Lunn Andrew

Re: [PATCH] net: dsa: Add of_node_put() before break statement

2020-08-23 Thread Andrew Lunn
On Sun, Aug 23, 2020 at 07:31:16PM +0530, Sumera Priyadarsini wrote: > Every iteration of for_each_child_of_node() decrements > the reference count of the previous node, however when control > is transferred from the middle of the loop, as in the case of > a return or break or goto, there is no dec

Re: [PATCH] net: arc_emac: Fix memleak in arc_mdio_probe

2020-08-23 Thread Andrew Lunn
On Sun, Aug 23, 2020 at 04:56:47PM +0800, Dinghao Liu wrote: > When devm_gpiod_get_optional() fails, bus should be > freed just like when of_mdiobus_register() fails. > > Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver") > Signed-off-by: Dinghao Liu Reviewed-by: Andre

Regarding possible bug in net/wan/x25_asy.c

2020-08-23 Thread Madhuparna Bhowmik
Hello, I have the following doubt: sl->xhead is modified in both x25_asy_change_mtu() and x25_asy_write_wakeup(). However, sl->lock is not held in x25_asy_write_wakeup(). So, I am not sure if it is indeed possible to have a race between these two functions. If it is possible that these two functi

Re: [Bridge] [RFC PATCH net-next] bridge: Implement MLD Querier wake-up calls / Android bug workaround

2020-08-23 Thread Linus Lüssing
On Sun, Aug 16, 2020 at 03:08:13PM -0700, Stephen Hemminger wrote: > Rather than adding yet another feature to the bridge, could this hack be done > by > having a BPF hook? or netfilter module? Hi Stephen, Thanks for the constructive feedback and suggestions! The netfilter approach sounds tempt

Re: [PATCH ethtool v5] Add QSFP-DD support

2020-08-23 Thread Michal Kubecek
On Thu, Aug 13, 2020 at 06:08:26PM +0300, Adrian Pop wrote: > The Common Management Interface Specification (CMIS) for QSFP-DD shares > some similarities with other form factors such as QSFP or SFP, but due to > the fact that the module memory map is different, the current ethtool > version is not

Re: [PATCH ethtool 1/2] netlink: Fix the condition for displaying actual changes

2020-08-23 Thread Michal Kubecek
On Fri, Aug 14, 2020 at 04:17:44PM +0300, Maxim Mikityanskiy wrote: > This comment in the code: > > /* result is not exactly as requested, show differences */ > > implies that the "Actual changes" output should be displayed only if the > result is not as requested, which matches the legacy et

Re: [PATCH ethtool 2/2] netlink: Print and return an error when features weren't changed

2020-08-23 Thread Michal Kubecek
On Fri, Aug 14, 2020 at 04:17:45PM +0300, Maxim Mikityanskiy wrote: > The legacy ethtool prints an error message and returns 1 if no features > were changed as requested. Port this behavior to ethtool-netlink. > req_mask is compared to wanted_mask to detect if any feature was > changed. If these ma

Re: [PATCH ethtool] cable-test: TDR Amplitude is signed

2020-08-23 Thread Michal Kubecek
On Sun, Aug 16, 2020 at 05:25:08PM +0200, Andrew Lunn wrote: > Use the signed JSON helper for printing the TDR amplitude. Otherwise > negative values, i.e. cable shorts, become very large positive values. > > Signed-off-by: Andrew Lunn Applied, thank you. Michal > --- > netlink/cable_test.c |

Re: [Bridge] [RFC PATCH net-next] bridge: Implement MLD Querier wake-up calls / Android bug workaround

2020-08-23 Thread Stephen Hemminger
On Sun, 23 Aug 2020 17:42:39 +0200 Linus Lüssing wrote: > On Sun, Aug 16, 2020 at 03:08:13PM -0700, Stephen Hemminger wrote: > > Rather than adding yet another feature to the bridge, could this hack be > > done by > > having a BPF hook? or netfilter module? > > Hi Stephen, > > Thanks for the

[PATCH V2 2/5 nf] selftests: netfilter: exit on invalid parameters

2020-08-23 Thread Fabian Frederick
exit script with comments when parameters are wrong during address addition. No need for a message when trying to change MTU with lower values: output is self-explanatory. Use short testing sequence to avoid shellcheck warnings (suggested by Stefano Brivio). Signed-off-by: Fabian Frederick --- V2

[PATCH V2 1/5 nf] selftests: netfilter: fix header example

2020-08-23 Thread Fabian Frederick
nft_flowtable.sh is made for bash not sh. Also give values which not return "RTNETLINK answers: Invalid argument" Signed-off-by: Fabian Frederick --- V2 = V1 tools/testing/selftests/netfilter/nft_flowtable.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/self

[PATCH V2 3/5 nf] selftests: netfilter: remove unused variable in make_file()

2020-08-23 Thread Fabian Frederick
'who' variable was not used in make_file() Problem found using Shellcheck Signed-off-by: Fabian Frederick --- V2: new patch tools/testing/selftests/netfilter/nft_flowtable.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/netfilter/nft_flowtable

[PATCH V2 4/5 nf] selftests: netfilter: simplify command testing

2020-08-23 Thread Fabian Frederick
Fix some shellcheck SC2181 warnings: "Check exit code directly with e.g. 'if mycmd;', not indirectly with $?." as suggested by Stefano Brivio. Signed-off-by: Fabian Frederick --- V2: new patch .../selftests/netfilter/nft_flowtable.sh | 34 ++- 1 file changed, 11 insertions(

[PATCH V2 5/5 nf] selftests: netfilter: add command usage

2020-08-23 Thread Fabian Frederick
Avoid bad command arguments. Based on tools/power/cpupower/bench/cpufreq-bench_plot.sh Signed-off-by: Fabian Frederick --- V2: new patch tools/testing/selftests/netfilter/nft_flowtable.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/testing/selftests/netfilter/nft_flow

Re: [GIT] Networking

2020-08-23 Thread pr-tracker-bot
The pull request you sent on Sat, 22 Aug 2020 19:19:48 -0700 (PDT): > git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git refs/heads/master has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/9d045ed1ebe1a6115d3fa9930c5371defb31d95a Thank you! -- Deet-doot-dot,

[PATCH V2] net: dsa: Add of_node_put() before break statement

2020-08-23 Thread Sumera Priyadarsini
Every iteration of for_each_child_of_node() decrements the reference count of the previous node, however when control is transferred from the middle of the loop, as in the case of a return or break or goto, there is no decrement thus ultimately resulting in a memory leak. Fix a potential memory le

Re: Regarding possible bug in net/wan/x25_asy.c

2020-08-23 Thread Xie He
On Sun, Aug 23, 2020 at 8:28 AM Madhuparna Bhowmik wrote: > > sl->xhead is modified in both x25_asy_change_mtu() and > x25_asy_write_wakeup(). However, sl->lock is not held in > x25_asy_write_wakeup(). So, I am not sure if it is indeed possible to > have a race between these two functions. If it i

Re: [PATCH V2] net: dsa: Add of_node_put() before break statement

2020-08-23 Thread Andrew Lunn
> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c > index 8dcb8a49ab67..e81198a65c26 100644 > --- a/drivers/net/dsa/mt7530.c > +++ b/drivers/net/dsa/mt7530.c > @@ -1327,6 +1327,7 @@ mt7530_setup(struct dsa_switch *ds) > if (phy_node->parent == priv->dev->of_no

[PATCH V3] net: dsa: Add of_node_put() before break and return statements

2020-08-23 Thread Sumera Priyadarsini
Every iteration of for_each_child_of_node() decrements the reference count of the previous node, however when control is transferred from the middle of the loop, as in the case of a return or break or goto, there is no decrement thus ultimately resulting in a memory leak. Fix a potential memory le

[PATCH ethtool v2 3/9] ioctl: prevent argc underflow in do_perqueue()

2020-08-23 Thread Michal Kubecek
When first command line argument after "-Q" is "queue_mask", we parse the queue mask and following subcommand without checking if these arguments do actually exist. Add check if we have at least two arguments left after "queue_mask" in the corresponding branch. Fixes: 9ecd54248b1a ("ethtool: intro

[PATCH ethtool v2 2/9] ioctl: check presence of eeprom length argument properly

2020-08-23 Thread Michal Kubecek
In do_geeprom(), do_seprom() and do_getmodule(), check if user used "length" command line argument is done by setting the value to -1 before parsing and checking if it changed. This is quite ugly and also causes compiler warnings as the variable is u32. Use proper "seen" flag to let parser tell us

[PATCH ethtool v2 0/9] compiler warnings cleanup, part 2

2020-08-23 Thread Michal Kubecek
Two compiler warnings still appear when compiling current source: comparison between signed and unsigned values and missing struct member initializations. The former are mostly handled by declaring variables (loop iterators, mostly) as unsigned, only few required an explicit cast. The latter are h

[PATCH ethtool v2 4/9] ioctl: make argc counters unsigned

2020-08-23 Thread Michal Kubecek
Use unsigned int for cmd_context::argc and local variables used for command line argument count. These counters may never get negative and are often compared to unsigned expressions. Signed-off-by: Michal Kubecek --- ethtool.c | 24 internal.h | 2 +- 2 files changed,

[PATCH ethtool v2 6/9] get rid of signed/unsigned comparison warnings in register dump parsers

2020-08-23 Thread Michal Kubecek
All of these are avoided by declaring a variable (mostly loop iterators) holding only unsigned values as unsigned. Signed-off-by: Michal Kubecek Reviewed-by: Andrew Lunn --- dsa.c | 2 +- fec.c | 2 +- ibm_emac.c | 2 +- marvell.c | 2 +- natsemi.c | 2 +- rxclass.c | 8 +--- s

[PATCH ethtool v2 5/9] ioctl: get rid of signed/unsigned comparison warnings

2020-08-23 Thread Michal Kubecek
Comparison between signed and unsigned values is fragile and causes compiler warnings with recent compilers and stricter CFLAGS. Prevent such comparisons either by properly declaring variables (mostly loop iterators) as unsigned or by explicitly casting one side of the comparison. v2: rework argc

[PATCH ethtool v2 1/9] netlink: get rid of signed/unsigned comparison warnings

2020-08-23 Thread Michal Kubecek
Use unsigned types where appropriate to get rid of compiler warnings about comparison between signed and unsigned integer values in netlink code. v2: avoid casts in dump_features() Signed-off-by: Michal Kubecek --- netlink/features.c | 6 +++--- netlink/netlink.c | 4 ++-- netlink/netlink.h |

[PATCH ethtool v2 7/9] settings: simplify link_mode_info[] initializers

2020-08-23 Thread Michal Kubecek
Use macro helpers to make link_mode_info[] initializers easier to read and less prone to mistakes. As a bonus, this gets rid of "missing field initializer" warnings in netlink/settings.c This commit should have no effect on resulting code (checked with gcc-11 and -O2). Signed-off-by: Michal Kubec

[PATCH ethtool v2 9/9] build: add -Wextra to default CFLAGS

2020-08-23 Thread Michal Kubecek
As a result of previous commits, ethtool source now builds with gcc versions 7-11 without any compiler warning with "-Wall -Wextra". Add "-Wextra" to default cflags to make sure that any new warnings are caught as early as possible. Suggested-by: Andrew Lunn Signed-off-by: Michal Kubecek Reviewe

[PATCH ethtool v2 8/9] ioctl: convert cmdline_info arrays to named initializers

2020-08-23 Thread Michal Kubecek
To get rid of remaining "missing field initializer" compiler warnings, convert arrays of struct cmdline_info used for command line parser to named initializers. This also makes the initializers easier to read. This commit should have no effect on resulting code (checked with gcc-11 and -O2). Sign

Re: [Bridge] [RFC PATCH net-next] bridge: Implement MLD Querier wake-up calls / Android bug workaround

2020-08-23 Thread Felix Fietkau
On 2020-08-23 17:42, Linus Lüssing wrote: > On Sun, Aug 16, 2020 at 03:08:13PM -0700, Stephen Hemminger wrote: >> Rather than adding yet another feature to the bridge, could this hack be >> done by >> having a BPF hook? or netfilter module? > > Hi Stephen, > > Thanks for the constructive feedbac

Re: [PATCH ethtool v2 1/9] netlink: get rid of signed/unsigned comparison warnings

2020-08-23 Thread Andrew Lunn
On Sun, Aug 23, 2020 at 09:40:18PM +0200, Michal Kubecek wrote: > Use unsigned types where appropriate to get rid of compiler warnings about > comparison between signed and unsigned integer values in netlink code. > > v2: avoid casts in dump_features() > > Signed-off-by: Michal Kubecek Reviewed

Re: [PATCH ethtool v2 4/9] ioctl: make argc counters unsigned

2020-08-23 Thread Andrew Lunn
On Sun, Aug 23, 2020 at 09:40:27PM +0200, Michal Kubecek wrote: > Use unsigned int for cmd_context::argc and local variables used for > command line argument count. These counters may never get negative and are > often compared to unsigned expressions. > > Signed-off-by: Michal Kubecek Reviewed-

Re: ethtool 5.8 segfaults when changing settings on a device

2020-08-23 Thread Michal Kubecek
On Thu, Aug 13, 2020 at 12:25:22PM +, Hans-Christian Egtvedt (hegtvedt) wrote: > Hello, > > I am testing ethtool 5.8, and I noticed it segfaulted with the command >ethtool -s eth0 autoneg on > > Backtrace as follows: > (gdb) run -s eth0 autoneg on > Starting program: /tmp/ethtool-5.8 -s

Re: [PATCH] typhoon: switch from 'pci_' to 'dma_' API

2020-08-23 Thread David Dillow
On Sun, 2020-08-23 at 08:11 +0200, Christophe JAILLET wrote: > The wrappers in include/linux/pci-dma-compat.h should go away. > > The patch has been generated with the coccinelle script below and has > been > hand modified to replace GFP_ with a correct flag. > It has been compile tested. Looks g

[net-next PATCH 0/2] RTL8366 stabilization

2020-08-23 Thread Linus Walleij
This stabilizes the RTL8366 driver by checking validity of the passed VLANs and refactoring the member config (MC) code so we do not require strict call order and de-duplicate some code. Linus Walleij (2): net: dsa: rtl8366: Check validity of passed VLANs net: dsa: rtl8366: Refactor VLAN/PVID

[net-next PATCH 1/2] net: dsa: rtl8366: Check validity of passed VLANs

2020-08-23 Thread Linus Walleij
The rtl8366_set_vlan() and rtl8366_set_pvid() get invalid VLANs tossed at it, especially VLAN0, something the hardware and driver cannot handle. Check validity and bail out like we do in the other callbacks. Signed-off-by: Linus Walleij --- drivers/net/dsa/rtl8366.c | 6 ++ 1 file changed, 6

[net-next PATCH 2/2] net: dsa: rtl8366: Refactor VLAN/PVID init

2020-08-23 Thread Linus Walleij
The VLANs and PVIDs on the RTL8366 utilizes a "member configuration" (MC) which is largely unexplained in the code. This set-up requires a special ordering: rtl8366_set_pvid() must be called first, followed by rtl8366_set_vlan(), else the MC will not be properly allocated. Relax this by factoring

[PATCH net] net: dsa: change PHY error message again

2020-08-23 Thread Vladimir Oltean
slave_dev->name is only populated at this stage if it was specified through a label in the device tree. However that is not mandatory. When it isn't, the error message looks like this: [5.037057] fsl_enetc :00:00.2 eth2: error -19 setting up slave PHY for eth%d [5.044672] fsl_enetc 00

Re: [PATCH V2] net: dsa: Add of_node_put() before break statement

2020-08-23 Thread kernel test robot
Hi Sumera, Thank you for the patch! Yet something to improve: [auto build test ERROR on net-next/master] [also build test ERROR on net/master linus/master sparc-next/master v5.9-rc1 next-20200821] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch,

Re: [PATCH net] net: dsa: change PHY error message again

2020-08-23 Thread Andrew Lunn
On Mon, Aug 24, 2020 at 12:35:20AM +0300, Vladimir Oltean wrote: > slave_dev->name is only populated at this stage if it was specified > through a label in the device tree. However that is not mandatory. Hi Vladimir It is not mandatory, but it is normal. > When it isn't, the error message looks

Re: [PATCH v2 2/2] net: socket: implement SO_DESCRIPTION

2020-08-23 Thread Pascal Bouchareine
On Sat, Aug 22, 2020 at 2:01 PM David Miller wrote: > > About the pid part - > > On top of multiple pids to scan for a given socket, there's also the > > security provided by /proc - I'm not sure what inet_diag does for that > > So maybe users calling it will need to scan /proc for a long time any

Re: [PATCH V2] net: dsa: Add of_node_put() before break statement

2020-08-23 Thread kernel test robot
t-next.git d7223aa5867134b9923b42e1245801bd790a1d8c config: x86_64-randconfig-a012-20200823 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b587ca93be114d07ec3bf654add97d7872325281) reproduce (this is a W=1 build): wget https://raw.githubusercontent

linux-next: manual merge of the bpf-next tree with Linus' tree

2020-08-23 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the bpf-next tree got a conflict in: tools/lib/bpf/libbpf.c between commit: 1e891e513e16 ("libbpf: Fix map index used in error message") from Linus' tree and commit: 88a82120282b ("libbpf: Factor out common ELF operations and improve logging") from t

Re: [PATCH 2/2] genl: ctrl: support dumping netlink policy

2020-08-23 Thread David Ahern
On 8/19/20 4:29 AM, Johannes Berg wrote: > @@ -100,6 +102,30 @@ static int print_ctrl_grp(FILE *fp, struct rtattr *arg, > __u32 ctrl_ver) > > } > > +static const char *get_nla_type_str(unsigned int attr) > +{ > + switch (attr) { > +#define C(x) case NL_ATTR_TYPE_ ## x: return #x > + C

Re: [net-next PATCH 2/2] net: dsa: rtl8366: Refactor VLAN/PVID init

2020-08-23 Thread Florian Fainelli
On 8/23/2020 1:59 PM, Linus Walleij wrote: The VLANs and PVIDs on the RTL8366 utilizes a "member configuration" (MC) which is largely unexplained in the code. This set-up requires a special ordering: rtl8366_set_pvid() must be called first, followed by rtl8366_set_vlan(), else the MC will not

Re: [PATCH iproute2 net-next] iplink: add support for protodown reason

2020-08-23 Thread David Ahern
On 8/20/20 9:52 PM, Roopa Prabhu wrote: > +void protodown_reason_n2a(int id, char *buf, int len) > +{ > + if (id < 0 || id >= PROTODOWN_REASON_NUM_BITS || numeric) { since the reason is limited to 0-31, id > PROTODOWN_REASON_NUM_BITS should be an error. > + snprintf(buf, len, "%d"

Re: [PATCH] ipv4: fix the problem of ping failure in some cases

2020-08-23 Thread David Ahern
On 8/22/20 1:46 AM, guodeqing wrote: > ie., > $ ifconfig eth0 9.9.9.9 netmask 255.255.255.0 > > $ ping -I lo 9.9.9.9 > ping: Warning: source address might be selected on device other than lo. > PING 9.9.9.9 (9.9.9.9) from 9.9.9.9 lo: 56(84) bytes of data. > > 4 packets transmitted, 0 received, 10

Re: [PATCH] ipv4: fix the problem of ping failure in some cases

2020-08-23 Thread David Ahern
On 8/23/20 8:27 PM, David Ahern wrote: > On 8/22/20 1:46 AM, guodeqing wrote: >> ie., >> $ ifconfig eth0 9.9.9.9 netmask 255.255.255.0 >> >> $ ping -I lo 9.9.9.9 If that ever worked it was wrong; the address is scoped to eth0, not lo. >> ping: Warning: source address might be selected on device o

答复: [PATCH] ipv4: fix the problem of ping failure in some cases

2020-08-23 Thread Guodeqing (A)
> -邮件原件- > 发件人: David Ahern [mailto:dsah...@gmail.com] > 发送时间: Monday, August 24, 2020 10:34 > 收件人: Guodeqing (A) ; da...@davemloft.net > 抄送: k...@kernel.org; netdev@vger.kernel.org > 主题: Re: [PATCH] ipv4: fix the problem of ping failure in some cases > > On 8/23/20 8:27 PM, David Ahern

Re: [PATCH net] net: dsa: change PHY error message again

2020-08-23 Thread Florian Fainelli
On 8/23/2020 3:26 PM, Andrew Lunn wrote: On Mon, Aug 24, 2020 at 12:35:20AM +0300, Vladimir Oltean wrote: slave_dev->name is only populated at this stage if it was specified through a label in the device tree. However that is not mandatory. Hi Vladimir It is not mandatory, but it is normal

[PATCH] net: hns: Fix memleak in hns_nic_dev_probe

2020-08-23 Thread Dinghao Liu
hns_nic_dev_probe allocates ndev, but not free it on two error handling paths, which may lead to memleak. Fixes: 63434888aaf1b ("net: hns: net: hns: enet adds support of acpi") Signed-off-by: Dinghao Liu --- drivers/net/ethernet/hisilicon/hns/hns_enet.c | 9 ++--- 1 file changed, 6 insertion

[PATCH] net: systemport: Fix memleak in bcm_sysport_probe

2020-08-23 Thread Dinghao Liu
When devm_kcalloc() fails, dev should be freed just like what we've done in the subsequent error paths. Fixes: 7b78be48a8eb6 ("net: systemport: Dynamically allocate number of TX rings") Signed-off-by: Dinghao Liu --- drivers/net/ethernet/broadcom/bcmsysport.c | 6 -- 1 file changed, 4 inser

Re: [PATCH ipsec-next v3] xfrm: add /proc/sys/core/net/xfrm_redact_secret

2020-08-23 Thread Antony Antony
On Thu, Aug 20, 2020 at 15:42:22 -0700, David Miller wrote: > From: Antony Antony > Date: Thu, 20 Aug 2020 20:35:49 +0200 > > > Redacting secret is a FIPS 140-2 requirement. > > Why not control this via the kernel lockdown mode rather than making > an ad-hoc API for this? Let me try to use ker

Re: [PATCH v3 5/8] net: dsa: hellcreek: Add TAPRIO offloading support

2020-08-23 Thread Kurt Kanzenbach
On Sat Aug 22 2020, Vladimir Oltean wrote: > Hi Kurt, > > On Thu, Aug 20, 2020 at 10:11:15AM +0200, Kurt Kanzenbach wrote: >> The switch has support for the 802.1Qbv Time Aware Shaper (TAS). Traffic >> schedules may be configured individually on each front port. Each port has >> eight >> egress qu

Re: [PATCH 00/49] DRM driver for Hikey 970

2020-08-23 Thread Mauro Carvalho Chehab
Hi John, Em Wed, 19 Aug 2020 20:28:44 -0700 John Stultz escreveu: > That said even with the patches I've got on top of your series, I > still see a few issues: > 1) I'm seeing red-blue swap with your driver. I need to dig a bit to > see what the difference is, I know gralloc has a config optio

[PATCH] ioctl: only memset non-NULL link settings

2020-08-23 Thread Hans-Christian Noren Egtvedt
In commit bef780467fa ('ioctl: do not pass transceiver value back to kernel') a regression slipped. If we have a kernel that does not support the ETHTOOL_xLINKSETTINGS API, then the do_ioctl_glinksettings() function will return a NULL pointer. Hence before memset'ing the pointer to zero we must fi