Re: [bpf-next PATCH 1/3] bpf: sk_msg add some generic helpers that may be useful from sk_msg

2020-05-13 Thread Yonghong Song
On 5/13/20 12:23 PM, John Fastabend wrote: Add these generic helpers that may be useful to use from sk_msg programs. The helpers do not depend on ctx so we can simply add them here, BPF_FUNC_perf_event_output BPF_FUNC_get_current_uid_gid BPF_FUNC_get_current_pid_tgid BPF_FUNC_get_curr

Re: [PATCH] net: stmmac: fix num_por initialization

2020-05-13 Thread Amit Kucheria
On Thu, May 14, 2020 at 11:59 AM Vinod Koul wrote: > > Driver missed initializing num_por which is por values that driver Nit: s/is/is one of the/ ? > configures to hardware. In order to get this values, add a new structure Nit: s/this/these > ethqos_emac_driver_data which holds por and num_po

[PATCH RESEND net-next] selftests: fix flower parent qdisc

2020-05-13 Thread Vlad Buslov
Flower tests used to create ingress filter with specified parent qdisc "parent :" but dump them on "ingress". With recent commit that fixed tcm_parent handling in dump those are not considered same parent anymore, which causes iproute2 tc to emit additional "parent :" in first line of filte

[PATCH net-next] hinic: update huawei ethernet driver maintainer

2020-05-13 Thread Luo bin
update huawei ethernet driver maintainer from aviad to Bin luo Signed-off-by: Luo bin --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index e581ae499057..8e51860e0204 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7811,7 +7811,7 @@ F:

[PATCH] net: stmmac: fix num_por initialization

2020-05-13 Thread Vinod Koul
Driver missed initializing num_por which is por values that driver configures to hardware. In order to get this values, add a new structure ethqos_emac_driver_data which holds por and num_por values and populate that in driver probe. Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqo

Re: [PATCH 27/33] sctp: export sctp_setsockopt_bindx

2020-05-13 Thread Christoph Hellwig
On Wed, May 13, 2020 at 03:00:58PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, May 13, 2020 at 08:26:42AM +0200, Christoph Hellwig wrote: > > And call it directly from dlm instead of going through kernel_setsockopt. > > The advantage on using kernel_setsockopt here is that sctp module will > o

Re: remove kernel_setsockopt and kernel_getsockopt

2020-05-13 Thread Christoph Hellwig
On Wed, May 13, 2020 at 10:38:59AM -0700, Joe Perches wrote: > It might be useful to show overall object size change. > > More EXPORT_SYMBOL uses increase object size a little. > > And not sure it matters much except it reduces overall object > size, but these patches remove (unnecessary) logging

Re: [PATCH 21/33] ipv4: add ip_sock_set_mtu_discover

2020-05-13 Thread Christoph Hellwig
On Wed, May 13, 2020 at 02:17:41PM +0100, David Howells wrote: > Christoph Hellwig wrote: > > > + ip_sock_set_mtu_discover(conn->params.local->socket->sk, > > + IP_PMTUDISC_DONT); > > Um... The socket in question could be an AF_INET6 socket, not an AF_INET4 >

Re: [PATCH] net: phy: realtek: clear interrupt during init for rtl8211f

2020-05-13 Thread Jisheng Zhang
On Wed, 13 May 2020 20:45:13 +0200 Heiner Kallweit wrote: > > On 13.05.2020 08:51, Jisheng Zhang wrote: > > Hi, > > > > On Tue, 12 May 2020 20:43:40 +0200 Heiner Kallweit wrote: > > > >> > >> > >> On 12.05.2020 12:46, Jisheng Zhang wrote: > >>> The PHY Register Accessible Interrupt is enabled

[PATCH net-next] hinic: add set_ringparam ethtool_ops support

2020-05-13 Thread Luo bin
support to change TX/RX queue depth with ethtool -G Signed-off-by: Luo bin --- drivers/net/ethernet/huawei/hinic/hinic_dev.h | 2 + .../net/ethernet/huawei/hinic/hinic_ethtool.c | 78 ++- .../net/ethernet/huawei/hinic/hinic_hw_dev.c | 11 ++- .../net/ethernet/huawei/hinic/hinic

Re: [PATCH bpf-next 0/6] BPF ring buffer

2020-05-13 Thread Andrii Nakryiko
On Wed, May 13, 2020 at 3:49 PM Jonathan Lemon wrote: > > On Wed, May 13, 2020 at 12:25:26PM -0700, Andrii Nakryiko wrote: > > Implement a new BPF ring buffer, as presented at BPF virtual conference > > ([0]). > > It presents an alternative to perf buffer, following its semantics closely, > > but

Re: [oss-drivers] [RFC v2] current devlink extension plan for NICs

2020-05-13 Thread Jiri Pirko
Wed, May 13, 2020 at 03:00:09PM CEST, simon.hor...@netronome.com wrote: >On Fri, May 01, 2020 at 11:14:49AM +0200, Jiri Pirko wrote: >> Hi all. >> >> First, I would like to apologize for very long email. But I think it >> would be beneficial to the see the whole picture, where we are going. >> >>

Re: [PATCH bpf-next 1/6] bpf: implement BPF ring buffer and verifier support for it

2020-05-13 Thread Andrii Nakryiko
On Wed, May 13, 2020 at 2:59 PM Alan Maguire wrote: > > On Wed, 13 May 2020, Andrii Nakryiko wrote: > > > This commits adds a new MPSC ring buffer implementation into BPF ecosystem, > > which allows multiple CPUs to submit data to a single shared ring buffer. On > > the consumption side, only sing

[PATCH v2 bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Andrii Nakryiko
task_seq_get_next might stop prematurely if get_pid_task() fails to get task_struct. Failure to do so doesn't mean that there are no more tasks with higher pids. Procfs's iteration algorithm (see next_tgid in fs/proc/base.c) does a retry in such case. After this fix, instead of stopping prematurely

Re: [PATCH bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Andrii Nakryiko
On Wed, May 13, 2020 at 3:42 PM Alexei Starovoitov wrote: > > On Wed, May 13, 2020 at 2:23 PM Andrii Nakryiko wrote: > > > > task_seq_get_next might stop prematurely if get_pid_task() fails to get > > task_struct. Failure to do so doesn't mean that there are no more tasks with > > higher pids. Pr

[PATCH] drivers: ipa: use devm_kzalloc for simplicity

2020-05-13 Thread Wang Wenhu
Make a substitution of kzalloc with devm_kzalloc to simplify the ipa_probe() process. Signed-off-by: Wang Wenhu Cc: Alex Elder --- drivers/net/ipa/ipa_clock.c | 7 ++- drivers/net/ipa/ipa_main.c | 7 ++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ipa/ip

Re: [PATCH iproute2-next v2 1/3] ss: introduce cgroup2 cache and helper functions

2020-05-13 Thread David Ahern
On 5/13/20 1:27 AM, Дмитрий Якунин wrote: > > > 13.05.2020, 05:03, "David Ahern" : >> On 5/9/20 10:52 AM, Dmitry Yakunin wrote: >>>  This patch prepares infrastructure for matching sockets by cgroups. >>>  Two helper functions are added for transformation between cgroup v2 ID >>>  and pathname. C

Re: [PATCH net-next] net: phy: broadcom: fix BCM54XX_SHD_SCR3_TRDDAPD value for BCM54810

2020-05-13 Thread Kevin Lo
On Wed, May 13, 2020 at 06:31:29PM -0700, Florian Fainelli wrote: > > > > On 5/13/2020 5:57 PM, Kevin Lo wrote: > > Set the correct bit when checking for PHY_BRCM_DIS_TXCRXC_NOENRGY on the > > BCM54810 PHY. > > Indeed, good catch! > > > > Signed-off-by: Kevin Lo > > Reviewed-by: Florian Fai

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Linus Torvalds
On Wed, May 13, 2020 at 6:00 PM Masami Hiramatsu wrote: > > > But we should likely at least disallow it entirely on platforms where > > we really can't - or pick one hardcoded choice. On sparc, you really > > _have_ to specify one or the other. > > OK. BTW, is there any way to detect the kernel/us

Re: [PATCH V5 18/19] net: ks8851: Implement Parallel bus operations

2020-05-13 Thread Marek Vasut
On 5/14/20 3:57 AM, Andrew Lunn wrote: >> diff --git a/drivers/net/ethernet/micrel/ks8851_par.c >> b/drivers/net/ethernet/micrel/ks8851_par.c >> new file mode 100644 >> index ..90fffacb1695 >> --- /dev/null >> +++ b/drivers/net/ethernet/micrel/ks8851_par.c >> @@ -0,0 +1,348 @@ >> +// S

Re: [PATCH V5 10/19] net: ks8851: Factor out bus lock handling

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 03:37:49AM +0200, Marek Vasut wrote: > On 5/14/20 3:19 AM, Andrew Lunn wrote: > > On Thu, May 14, 2020 at 02:07:38AM +0200, Marek Vasut wrote: > >> Pull out bus access locking code into separate functions, this is done > >> in preparation for unifying the driver with the par

Re: [PATCH V5 18/19] net: ks8851: Implement Parallel bus operations

2020-05-13 Thread Andrew Lunn
> diff --git a/drivers/net/ethernet/micrel/ks8851_par.c > b/drivers/net/ethernet/micrel/ks8851_par.c > new file mode 100644 > index ..90fffacb1695 > --- /dev/null > +++ b/drivers/net/ethernet/micrel/ks8851_par.c > @@ -0,0 +1,348 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* driv

Re: [PATCH V5 13/19] net: ks8851: Split out SPI specific code from probe() and remove()

2020-05-13 Thread Marek Vasut
On 5/14/20 3:31 AM, Andrew Lunn wrote: > On Thu, May 14, 2020 at 02:07:41AM +0200, Marek Vasut wrote: >> Factor out common code into ks8851_probe_common() and >> ks8851_remove_common() to permit both SPI and parallel >> bus driver variants to use the common code path for >> both probing and removal

Re: [PATCH V5 10/19] net: ks8851: Factor out bus lock handling

2020-05-13 Thread Marek Vasut
On 5/14/20 3:19 AM, Andrew Lunn wrote: > On Thu, May 14, 2020 at 02:07:38AM +0200, Marek Vasut wrote: >> Pull out bus access locking code into separate functions, this is done >> in preparation for unifying the driver with the parallel bus one. The >> parallel bus driver does not need heavy mutex l

Re: [PATCH V5 00/19] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-13 Thread Jakub Kicinski
On Thu, 14 May 2020 02:07:28 +0200 Marek Vasut wrote: > The KS8851SNL/SNLI and KS8851-16MLL/MLLI/MLLU are very much the same pieces > of silicon, except the former has an SPI interface, while the later has a > parallel bus interface. Thus far, Linux has two separate drivers for each > and they are

Re: [PATCH V5 16/19] net: ks8851: Implement register, FIFO, lock accessor callbacks

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:44AM +0200, Marek Vasut wrote: > The register and FIFO accessors are bus specific, so is locking. > Implement callbacks so that each variant of the KS8851 can implement > matching accessors and locking, and use the rest of the common code. > > Signed-off-by: Marek Vas

Re: [PATCH V5 15/19] net: ks8851: Permit overridding interrupt enable register

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:43AM +0200, Marek Vasut wrote: > The parallel bus variant does not need to use the TX interrupt at all > as it writes the TX FIFO directly with in .ndo_start_xmit, permit the > drivers to configure the interrupt enable bits. > > Signed-off-by: Marek Vasut Reviewed-b

Re: [PATCH net-next] net: phy: realtek: add loopback support for RTL8211F

2020-05-13 Thread tanhuazhong
On 2020/5/13 21:12, Andrew Lunn wrote: On Wed, May 13, 2020 at 04:25:44PM +0800, Huazhong Tan wrote: From: Yufeng Mo PHY loopback is already supported by genphy driver. This patch adds the set_loopback interface to RTL8211F PHY driver, so the PHY selftest can run properly on it. Signed-off

Re: [PATCH V5 14/19] net: ks8851: Factor out TX work flush function

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:42AM +0200, Marek Vasut wrote: > While the SPI version of the KS8851 requires a TX worker thread to pump > data via SPI, the parallel bus version can write data into the TX FIFO > directly in .ndo_start_xmit, as the parallel bus access is much faster > and does not sle

Re: [PATCH net-next] net: phy: broadcom: fix BCM54XX_SHD_SCR3_TRDDAPD value for BCM54810

2020-05-13 Thread Florian Fainelli
On 5/13/2020 5:57 PM, Kevin Lo wrote: > Set the correct bit when checking for PHY_BRCM_DIS_TXCRXC_NOENRGY on the > BCM54810 PHY. Indeed, good catch! > > Signed-off-by: Kevin Lo Reviewed-by: Florian Fainelli Is the following commit when it started to break? Fixes: 0ececcfc9267 ("net: phy:

Re: [PATCH V5 13/19] net: ks8851: Split out SPI specific code from probe() and remove()

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:41AM +0200, Marek Vasut wrote: > Factor out common code into ks8851_probe_common() and > ks8851_remove_common() to permit both SPI and parallel > bus driver variants to use the common code path for > both probing and removal. > > There should be no functional change.

Re: [PATCH V5 12/19] net: ks8851: Split out SPI specific entries in struct ks8851_net

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:40AM +0200, Marek Vasut wrote: > Add a new struct ks8851_net_spi, which embeds the original > struct ks8851_net and contains the entries specific only to > the SPI variant of KS8851. > > There should be no functional change. > > Signed-off-by: Marek Vasut > Cc: Davi

[PATCH -next] sfc: Make siena_check_caps static

2020-05-13 Thread ChenTao
Fix the following warning: drivers/net/ethernet/sfc/siena.c:951:14: warning: symbol 'siena_check_caps' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: ChenTao --- drivers/net/ethernet/sfc/siena.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --gi

Re: [PATCH V5 10/19] net: ks8851: Factor out bus lock handling

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:38AM +0200, Marek Vasut wrote: > Pull out bus access locking code into separate functions, this is done > in preparation for unifying the driver with the parallel bus one. The > parallel bus driver does not need heavy mutex locking of the bus and > works better with sp

Re: [PATCH 10/18] maccess: unify the probe kernel arch hooks

2020-05-13 Thread Masami Hiramatsu
Hi Christoph, On Wed, 13 May 2020 18:00:30 +0200 Christoph Hellwig wrote: > @@ -36,14 +50,20 @@ long __weak probe_kernel_read(void *dst, const void *src, > size_t size) > * probe_kernel_read() suitable for use within regions where the caller > * already holds mmap_sem, or other locks which

[PATCH net-next] net: phy: broadcom: fix BCM54XX_SHD_SCR3_TRDDAPD value for BCM54810

2020-05-13 Thread Kevin Lo
Set the correct bit when checking for PHY_BRCM_DIS_TXCRXC_NOENRGY on the BCM54810 PHY. Signed-off-by: Kevin Lo --- diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 97201d5cf007..45d0aefb964c 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -22

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Masami Hiramatsu
On Wed, 13 May 2020 16:59:40 -0700 Linus Torvalds wrote: > On Wed, May 13, 2020 at 4:21 PM Masami Hiramatsu wrote: > > > > > > For trace_kprobe.c current order (kernel -> user fallback) is preferred > > because it has another function dedicated for user memory. > > Well, then it should just use

Re: [PATCH V5 08/19] net: ks8851: Use 16-bit writes to program MAC address

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:36AM +0200, Marek Vasut wrote: > On the SPI variant of KS8851, the MAC address can be programmed with > either 8/16/32-bit writes. To make it easier to support the 16-bit > parallel option of KS8851 too, switch both the MAC address programming > and readout to 16-bit o

Re: [PATCH V5 06/19] net: ks8851: Use dev_{get,set}_drvdata()

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:34AM +0200, Marek Vasut wrote: > Replace spi_{get,set}_drvdata() with dev_{get,set}_drvdata(), which > works for both SPI and platform drivers. This is done in preparation > for unifying the KS8851 SPI and parallel bus drivers. > > There should be no functional change

Re: [PATCH v2 bpf-next 6/7] bpf: add support for %pT format specifier for bpf_trace_printk() helper

2020-05-13 Thread Yonghong Song
On 5/11/20 10:56 PM, Alan Maguire wrote: Allow %pT[cNx0] format specifier for BTF-based display of data associated with pointer. Signed-off-by: Alan Maguire --- include/uapi/linux/bpf.h | 27 ++- kernel/trace/bpf_trace.c | 21 ++--- too

Re: [PATCH V5 04/19] net: ks8851: Pass device node into ks8851_init_mac()

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:32AM +0200, Marek Vasut wrote: > Since the driver probe function already has a struct device *dev pointer > and can easily derive of_node pointer from it, pass the of_node pointer as > a parameter to ks8851_init_mac() to avoid fishing it out from ks->spidev. > This is

Re: [PATCH V5 02/19] net: ks8851: Rename ndev to netdev in probe

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:30AM +0200, Marek Vasut wrote: > Rename ndev variable to netdev for the sake of consistency. > > No functional change. > > Signed-off-by: Marek Vasut > Cc: David S. Miller > Cc: Lukas Wunner > Cc: Petr Stetiar > Cc: YueHaibing Reviewed-by: Andrew Lunn And

Re: [PATCH V5 01/19] net: ks8851: Factor out spi->dev in probe()/remove()

2020-05-13 Thread Andrew Lunn
On Thu, May 14, 2020 at 02:07:29AM +0200, Marek Vasut wrote: > Pull out the spi->dev into one common place in the function instead of > having it repeated over and over again. This is done in preparation for > unifying ks8851 and ks8851-mll drivers. No functional change. > > Signed-off-by: Marek V

Re: [PATCH iproute2-next] tc: mqprio: reject queues count/offset pair count higher than num_tc

2020-05-13 Thread Stephen Hemminger
On Wed, 13 May 2020 21:47:17 +0200 Maciej Fijalkowski wrote: > Provide a sanity check that will make sure whether queues count/offset > pair count will not exceed the actual number of TCs being created. > > Example command that is invalid because there are 4 count/offset pairs > whereas num_tc i

Re: [PATCH v2 bpf-next 4/7] printk: add type-printing %pT format specifier which uses BTF

2020-05-13 Thread Yonghong Song
On 5/11/20 10:56 PM, Alan Maguire wrote: printk supports multiple pointer object type specifiers (printing netdev features etc). Extend this support using BTF to cover arbitrary types. "%pT" specifies the typed format, and the pointer argument is a "struct btf_ptr *" where struct btf_ptr is

[PATCH V5 19/19] net: ks8851: Remove ks8851_mll.c

2020-05-13 Thread Marek Vasut
The ks8851_mll.c is replaced by ks8851_par.c, which is using common code from ks8851.c, just like ks8851_spi.c . Remove this old ad-hoc driver. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: No change V3: No change V4: No change V5: No

[PATCH V5 05/19] net: ks8851: Use devm_alloc_etherdev()

2020-05-13 Thread Marek Vasut
Use device managed version of alloc_etherdev() to simplify the code. No functional change intended. Reviewed-by: Andrew Lunn Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: Add RB from Andrew V3: No change V4: No change V5: No change --

[PATCH V5 17/19] net: ks8851: Separate SPI operations into separate file

2020-05-13 Thread Marek Vasut
Pull all the SPI bus specific code into a separate file, so that it is not mixed with the common code. Rename ks8851.c to ks8851_common.c. The ks8851_common.c is linked with ks8851_spi.c now, so it can call the accessors in the ks8851_spi.c without any pointer indirection. Signed-off-by: Marek Vas

[PATCH V5 10/19] net: ks8851: Factor out bus lock handling

2020-05-13 Thread Marek Vasut
Pull out bus access locking code into separate functions, this is done in preparation for unifying the driver with the parallel bus one. The parallel bus driver does not need heavy mutex locking of the bus and works better with spinlocks, hence prepare these locking functions to be overridden then.

[PATCH V5 18/19] net: ks8851: Implement Parallel bus operations

2020-05-13 Thread Marek Vasut
Implement accessors for KS8851-16MLL/MLLI/MLLU parallel bus variant of the KS8851. This is based off the ks8851_mll.c , which is a driver for exactly the same hardware, however the ks8851.c code is much higher quality. Hence, this patch pulls out the relevant information from the ks8851_mll.c on ho

[PATCH V5 01/19] net: ks8851: Factor out spi->dev in probe()/remove()

2020-05-13 Thread Marek Vasut
Pull out the spi->dev into one common place in the function instead of having it repeated over and over again. This is done in preparation for unifying ks8851 and ks8851-mll drivers. No functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueH

[PATCH V5 09/19] net: ks8851: Use 16-bit read of RXFC register

2020-05-13 Thread Marek Vasut
The RXFC register is the only one being read using 8-bit accessors. To make it easier to support the 16-bit accesses used by the parallel bus variant of KS8851, use 16-bit accessor to read RXFC register as well as neighboring RXFCTR register. Remove ks8851_rdreg8() as it is not used anywhere anymo

[PATCH V5 14/19] net: ks8851: Factor out TX work flush function

2020-05-13 Thread Marek Vasut
While the SPI version of the KS8851 requires a TX worker thread to pump data via SPI, the parallel bus version can write data into the TX FIFO directly in .ndo_start_xmit, as the parallel bus access is much faster and does not sleep. Factor out this TX work flush part, so it can be overridden by th

[PATCH V5 13/19] net: ks8851: Split out SPI specific code from probe() and remove()

2020-05-13 Thread Marek Vasut
Factor out common code into ks8851_probe_common() and ks8851_remove_common() to permit both SPI and parallel bus driver variants to use the common code path for both probing and removal. There should be no functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: P

[PATCH V5 08/19] net: ks8851: Use 16-bit writes to program MAC address

2020-05-13 Thread Marek Vasut
On the SPI variant of KS8851, the MAC address can be programmed with either 8/16/32-bit writes. To make it easier to support the 16-bit parallel option of KS8851 too, switch both the MAC address programming and readout to 16-bit operations. Remove ks8851_wrreg8() as it is not used anywhere anymore

[PATCH V5 16/19] net: ks8851: Implement register, FIFO, lock accessor callbacks

2020-05-13 Thread Marek Vasut
The register and FIFO accessors are bus specific, so is locking. Implement callbacks so that each variant of the KS8851 can implement matching accessors and locking, and use the rest of the common code. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHai

[PATCH V5 11/19] net: ks8851: Factor out SKB receive function

2020-05-13 Thread Marek Vasut
Factor out this netif_rx_ni(), so it could be overridden by the parallel bus variant of the KS8851 driver. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V3: New patch V4: No change V5: No change --- drivers/net/ethernet/micrel/ks8851.c |

[PATCH V5 12/19] net: ks8851: Split out SPI specific entries in struct ks8851_net

2020-05-13 Thread Marek Vasut
Add a new struct ks8851_net_spi, which embeds the original struct ks8851_net and contains the entries specific only to the SPI variant of KS8851. There should be no functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: - Dr

[PATCH V5 07/19] net: ks8851: Remove ks8851_rdreg32()

2020-05-13 Thread Marek Vasut
The ks8851_rdreg32() is used only in one place, to read two registers using a single read. To make it easier to support 16-bit accesses via parallel bus later on, replace this single read with two 16-bit reads from each of the registers and drop the ks8851_rdreg32() altogether. If this has noticea

[PATCH V5 15/19] net: ks8851: Permit overridding interrupt enable register

2020-05-13 Thread Marek Vasut
The parallel bus variant does not need to use the TX interrupt at all as it writes the TX FIFO directly with in .ndo_start_xmit, permit the drivers to configure the interrupt enable bits. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V3: N

[PATCH V5 06/19] net: ks8851: Use dev_{get,set}_drvdata()

2020-05-13 Thread Marek Vasut
Replace spi_{get,set}_drvdata() with dev_{get,set}_drvdata(), which works for both SPI and platform drivers. This is done in preparation for unifying the KS8851 SPI and parallel bus drivers. There should be no functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner C

[PATCH V5 02/19] net: ks8851: Rename ndev to netdev in probe

2020-05-13 Thread Marek Vasut
Rename ndev variable to netdev for the sake of consistency. No functional change. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Lukas Wunner Cc: Petr Stetiar Cc: YueHaibing --- V2: New patch V3: No change V4: No change V5: No change --- drivers/net/ethernet/micrel/ks8851.c | 30 +++

[PATCH V5 04/19] net: ks8851: Pass device node into ks8851_init_mac()

2020-05-13 Thread Marek Vasut
Since the driver probe function already has a struct device *dev pointer and can easily derive of_node pointer from it, pass the of_node pointer as a parameter to ks8851_init_mac() to avoid fishing it out from ks->spidev. This is the only reference to spidev in the function, so get rid of it. This

[PATCH V5 00/19] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-13 Thread Marek Vasut
The KS8851SNL/SNLI and KS8851-16MLL/MLLI/MLLU are very much the same pieces of silicon, except the former has an SPI interface, while the later has a parallel bus interface. Thus far, Linux has two separate drivers for each and they are diverging considerably. This series unifies them into a singl

[PATCH V5 03/19] net: ks8851: Replace dev_err() with netdev_err() in IRQ handler

2020-05-13 Thread Marek Vasut
Use netdev_err() instead of dev_err() to avoid accessing the spidev->dev in the interrupt handler. This is the only place which uses the spidev in this function, so replace it with netdev_err() to get rid of it. This is done in preparation for unifying the KS8851 SPI and parallel drivers. Reviewed

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Daniel Borkmann
On 5/14/20 1:28 AM, Al Viro wrote: On Thu, May 14, 2020 at 12:36:28AM +0200, Daniel Borkmann wrote: So on say s390 TASK_SIZE_USUALLy is (-PAGE_SIZE), which means we'd alway try the user copy first, which seems odd. I'd really like to here from the bpf folks what the expected use case is here,

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Linus Torvalds
On Wed, May 13, 2020 at 4:21 PM Masami Hiramatsu wrote: > > > For trace_kprobe.c current order (kernel -> user fallback) is preferred > because it has another function dedicated for user memory. Well, then it should just use the "strict" kernel-only one for the non-user memory. But yes, if there

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Al Viro
On Thu, May 14, 2020 at 12:36:28AM +0200, Daniel Borkmann wrote: > > So on say s390 TASK_SIZE_USUALLy is (-PAGE_SIZE), which means we'd alway > > try the user copy first, which seems odd. > > > > I'd really like to here from the bpf folks what the expected use case > > is here, and if the typical

Re: [PATCH v2 bpf-next 0/7] bpf, printk: add BTF-based type printing

2020-05-13 Thread Joe Perches
On Wed, 2020-05-13 at 15:50 -0700, Alexei Starovoitov wrote: > On Wed, May 13, 2020 at 3:48 PM Joe Perches wrote: > > On Wed, 2020-05-13 at 15:24 -0700, Alexei Starovoitov wrote: > > > On Tue, May 12, 2020 at 06:56:38AM +0100, Alan Maguire wrote: > > > > The printk family of functions support prin

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Daniel Borkmann
On 5/14/20 1:03 AM, Linus Torvalds wrote: On Wed, May 13, 2020 at 3:36 PM Daniel Borkmann wrote: It's used for both. Daniel, BPF real;ly needs to make up its mind about that. You *cannot* use ti for both. Yes, it happens to work on x86 and some other architectures. But on other architectu

Re: clean up and streamline probe_kernel_* and friends v2

2020-05-13 Thread Linus Torvalds
On Wed, May 13, 2020 at 4:04 PM Daniel Borkmann wrote: > > Aside from comments on list, the series looks reasonable to me. For BPF > the bpf_probe_read() helper would be slightly penalized for probing user > memory given we now test on copy_from_kernel_nofault() first and if that > fails only then

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Masami Hiramatsu
On Thu, 14 May 2020 00:36:28 +0200 Daniel Borkmann wrote: > On 5/13/20 9:28 PM, Christoph Hellwig wrote: > > On Wed, May 13, 2020 at 12:11:27PM -0700, Linus Torvalds wrote: > >> On Wed, May 13, 2020 at 9:01 AM Christoph Hellwig wrote: > >>> > >>> +static void bpf_strncpy(char *buf, long unsafe_a

Re: [PATCH v2 bpf-next 4/7] printk: add type-printing %pT format specifier which uses BTF

2020-05-13 Thread Joe Perches
On Wed, 2020-05-13 at 16:07 -0700, Alexei Starovoitov wrote: > On Wed, May 13, 2020 at 4:05 PM Joe Perches wrote: > > On Tue, 2020-05-12 at 06:56 +0100, Alan Maguire wrote: > > > printk supports multiple pointer object type specifiers (printing > > > netdev features etc). Extend this support usin

Re: net/sonic: Software evolution around the application of coding standards

2020-05-13 Thread Finn Thain
On Wed, 13 May 2020, Markus Elfring wrote: > some developers care to improve the compliance with the current > standard at various source code places, don't they? > This thread appears to be circular. Before I abandon it as folly, perhaps you would answer one more question. Out of all of the s

Re: [PATCH v2 bpf-next 4/7] printk: add type-printing %pT format specifier which uses BTF

2020-05-13 Thread Alexei Starovoitov
On Wed, May 13, 2020 at 4:05 PM Joe Perches wrote: > > On Tue, 2020-05-12 at 06:56 +0100, Alan Maguire wrote: > > printk supports multiple pointer object type specifiers (printing > > netdev features etc). Extend this support using BTF to cover > > arbitrary types. "%pT" specifies the typed form

Re: [PATCH v2 bpf-next 4/7] printk: add type-printing %pT format specifier which uses BTF

2020-05-13 Thread Joe Perches
On Tue, 2020-05-12 at 06:56 +0100, Alan Maguire wrote: > printk supports multiple pointer object type specifiers (printing > netdev features etc). Extend this support using BTF to cover > arbitrary types. "%pT" specifies the typed format, and the pointer > argument is a "struct btf_ptr *" where s

Re: [PATCH v2 bpf-next 2/7] bpf: move to generic BTF show support, apply it to seq files/strings

2020-05-13 Thread Yonghong Song
On 5/11/20 10:56 PM, Alan Maguire wrote: generalize the "seq_show" seq file support in btf.c to support a generic show callback of which we support two instances; the current seq file show, and a show with snprintf() behaviour which instead writes the type data to a supplied string. Both clas

Re: clean up and streamline probe_kernel_* and friends v2

2020-05-13 Thread Daniel Borkmann
On 5/13/20 6:00 PM, Christoph Hellwig wrote: Hi all, this series start cleaning up the safe kernel and user memory probing helpers in mm/maccess.c, and then allows architectures to implement the kernel probing without overriding the address space limit and temporarily allowing access to user mem

[PATCH v7 bpf-next 3/3] selftests/bpf: use CAP_BPF and CAP_PERFMON in tests

2020-05-13 Thread Alexei Starovoitov
From: Alexei Starovoitov Make all test_verifier test exercise CAP_BPF and CAP_PERFMON Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/test_verifier.c | 44 +++ tools/testing/selftests/bpf/verifier/calls.c | 16 +++ .../selftests/bpf/verifier/dead_code.c

[PATCH v7 bpf-next 1/3] bpf, capability: Introduce CAP_BPF

2020-05-13 Thread Alexei Starovoitov
From: Alexei Starovoitov Split BPF operations that are allowed under CAP_SYS_ADMIN into combination of CAP_BPF, CAP_PERFMON, CAP_NET_ADMIN. For backward compatibility include them in CAP_SYS_ADMIN as well. The end result provides simple safety model for applications that use BPF: - to load traci

[PATCH v7 bpf-next 0/3] Introduce CAP_BPF

2020-05-13 Thread Alexei Starovoitov
From: Alexei Starovoitov v6->v7: - permit SK_REUSEPORT program type under CAP_BPF as suggested by Marek Majkowski. It's equivalent to SOCKET_FILTER which is unpriv. v5->v6: - split allow_ptr_leaks into four flags. - retain bpf_jit_limit under cap_sys_admin. - fixed few other issues spotted by

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Linus Torvalds
On Wed, May 13, 2020 at 3:36 PM Daniel Borkmann wrote: > > It's used for both. Daniel, BPF real;ly needs to make up its mind about that. You *cannot* use ti for both. Yes, it happens to work on x86 and some other architectures. But on other architectures, the exact same pointer value can be a

Re: [PATCH bpf-next 0/6] BPF ring buffer

2020-05-13 Thread Jonathan Lemon
On Wed, May 13, 2020 at 12:25:26PM -0700, Andrii Nakryiko wrote: > Implement a new BPF ring buffer, as presented at BPF virtual conference ([0]). > It presents an alternative to perf buffer, following its semantics closely, > but allowing sharing same instance of ring buffer across multiple CPUs >

Re: [PATCH v2 bpf-next 0/7] bpf, printk: add BTF-based type printing

2020-05-13 Thread Alexei Starovoitov
On Wed, May 13, 2020 at 3:48 PM Joe Perches wrote: > > On Wed, 2020-05-13 at 15:24 -0700, Alexei Starovoitov wrote: > > On Tue, May 12, 2020 at 06:56:38AM +0100, Alan Maguire wrote: > > > The printk family of functions support printing specific pointer types > > > using %p format specifiers (MAC a

Re: [PATCH v2 bpf-next 0/7] bpf, printk: add BTF-based type printing

2020-05-13 Thread Joe Perches
On Wed, 2020-05-13 at 15:24 -0700, Alexei Starovoitov wrote: > On Tue, May 12, 2020 at 06:56:38AM +0100, Alan Maguire wrote: > > The printk family of functions support printing specific pointer types > > using %p format specifiers (MAC addresses, IP addresses, etc). For > > full details see Docume

Re: [PATCH bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Alexei Starovoitov
On Wed, May 13, 2020 at 2:23 PM Andrii Nakryiko wrote: > > task_seq_get_next might stop prematurely if get_pid_task() fails to get > task_struct. Failure to do so doesn't mean that there are no more tasks with > higher pids. Procfs's iteration algorithm (see next_tgid in fs/proc/base.c) > does a r

Re: [PATCH 11/18] maccess: remove strncpy_from_unsafe

2020-05-13 Thread Daniel Borkmann
On 5/13/20 9:28 PM, Christoph Hellwig wrote: On Wed, May 13, 2020 at 12:11:27PM -0700, Linus Torvalds wrote: On Wed, May 13, 2020 at 9:01 AM Christoph Hellwig wrote: +static void bpf_strncpy(char *buf, long unsafe_addr) +{ + buf[0] = 0; + if (strncpy_from_kernel_nofault(buf, (void

Re: [PATCH net-next] net: dsa: mt7530: set CPU port to fallback mode

2020-05-13 Thread David Miller
From: DENG Qingfang Date: Wed, 13 May 2020 23:37:17 +0800 > Currently, setting a bridge's self PVID to other value and deleting > the default VID 1 renders untagged ports of that VLAN unable to talk to > the CPU port: > > bridge vlan add dev br0 vid 2 pvid untagged self > bridge vlan

Re: [PATCH v2 bpf-next 0/7] bpf, printk: add BTF-based type printing

2020-05-13 Thread Alexei Starovoitov
On Tue, May 12, 2020 at 06:56:38AM +0100, Alan Maguire wrote: > The printk family of functions support printing specific pointer types > using %p format specifiers (MAC addresses, IP addresses, etc). For > full details see Documentation/core-api/printk-formats.rst. > > This patchset proposes intr

Re: [PATCH net] net: phy: fix aneg restart in phy_ethtool_set_eee

2020-05-13 Thread David Miller
From: Heiner Kallweit Date: Tue, 12 May 2020 21:45:53 +0200 > phy_restart_aneg() enables aneg in the PHY. That's not what we want > if phydev->autoneg is disabled. In this case still update EEE > advertisement register, but don't enable aneg and don't trigger an > aneg restart. > > Fixes: f75abe

Re: [PATCH] net: mvneta: speed down the PHY, if WoL used, to save energy

2020-05-13 Thread David Miller
From: Daniel González Cabanelas Date: Tue, 12 May 2020 19:59:48 +0200 > Some PHYs connected to this ethernet hardware support the WoL feature. > But when WoL is enabled and the machine is powered off, the PHY remains > waiting for a magic packet at max speed (i.e. 1Gbps), which is a waste of > en

Re: [PATCH][next] sfc: fix dereference of table before it is null checked

2020-05-13 Thread David Miller
From: Colin King Date: Tue, 12 May 2020 18:13:55 +0100 > From: Colin Ian King > > Currently pointer table is being dereferenced on a null check of > table->must_restore_filters before it is being null checked, leading > to a potential null pointer dereference issue. Fix this by null > checking

Re: [PATCH bpf-next 1/6] bpf: implement BPF ring buffer and verifier support for it

2020-05-13 Thread kbuild test robot
Hi Andrii, I love your patch! Perhaps something to improve: [auto build test WARNING on bpf-next/master] [also build test WARNING on next-20200512] [cannot apply to bpf/master rcu/dev v5.7-rc5] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW,

Re: [PATCH bpf-next] bpf: fix bpf_iter's task iterator logic

2020-05-13 Thread Yonghong Song
On 5/13/20 2:20 PM, Andrii Nakryiko wrote: task_seq_get_next might stop prematurely if get_pid_task() fails to get task_struct. Failure to do so doesn't mean that there are no more tasks with higher pids. Procfs's iteration algorithm (see next_tgid in fs/proc/base.c) does a retry in such case.

Re: [PATCH net-next 1/4] net: ethernet: validate pause autoneg setting

2020-05-13 Thread Doug Berger
On 5/13/2020 6:49 AM, Andrew Lunn wrote: >> So, I think consistency of implementation is more important than fixing >> this; the current behaviour has been established for many years now. > > Hi Russell, Doug > > With netlink ethtool we have the possibility of adding a new API to > control this.

Re: [PATCH bpf-next 1/6] bpf: implement BPF ring buffer and verifier support for it

2020-05-13 Thread Alan Maguire
On Wed, 13 May 2020, Andrii Nakryiko wrote: > This commits adds a new MPSC ring buffer implementation into BPF ecosystem, > which allows multiple CPUs to submit data to a single shared ring buffer. On > the consumption side, only single consumer is assumed. > > Motivation > -- > There are

Re: [PATCH net-next 4/4] net: bcmgenet: add support for ethtool flow control

2020-05-13 Thread Doug Berger
On 5/13/2020 2:52 AM, Russell King - ARM Linux admin wrote: > On Mon, May 11, 2020 at 05:24:10PM -0700, Doug Berger wrote: >> diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c >> b/drivers/net/ethernet/broadcom/genet/bcmmii.c >> index 511d553a4d11..788da1ecea0c 100644 >> --- a/drivers/net/

Re: [PATCH net-next 3/4] net: ethernet: introduce phy_set_pause

2020-05-13 Thread Doug Berger
On 5/13/2020 2:42 AM, Russell King - ARM Linux admin wrote: > On Mon, May 11, 2020 at 05:24:09PM -0700, Doug Berger wrote: >> This commit introduces the phy_set_pause function to the phylib as >> a helper to support the set_pauseparam ethtool method. >> >> It is hoped that the new behavior introduc

Re: [PATCH] sctp: check assoc before SCTP_ADDR_{MADE_PRIM,ADDED} event

2020-05-13 Thread Marcelo Ricardo Leitner
On Wed, May 13, 2020 at 10:11:05PM +0200, Jonas Falkevik wrote: > On Wed, May 13, 2020 at 6:01 PM Marcelo Ricardo Leitner > wrote: > > > > On Wed, May 13, 2020 at 04:52:16PM +0200, Jonas Falkevik wrote: > > > Do not generate SCTP_ADDR_{MADE_PRIM,ADDED} events for SCTP_FUTURE_ASSOC > > > assocs. >

Re: [PATCH net-next 1/4] net: ethernet: validate pause autoneg setting

2020-05-13 Thread Doug Berger
On 5/13/2020 2:20 AM, Russell King - ARM Linux admin wrote: > On Wed, May 13, 2020 at 06:34:05AM +0100, Russell King - ARM Linux admin > wrote: >> On Tue, May 12, 2020 at 08:48:22PM -0700, Doug Berger wrote: >>> On 5/12/2020 11:55 AM, Russell King - ARM Linux admin wrote: On Tue, May 12, 2020

  1   2   3   4   >