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

2019-08-25 Thread Eric Dumazet
On 8/25/19 7:52 PM, Cong Wang wrote: > On Wed, Aug 21, 2019 at 11:00 PM Akshat Kakkar wrote: >> >> On Thu, Aug 22, 2019 at 3:37 AM Cong Wang wrote: I am using ipset + iptables to classify and not filters. Besides, if tc is allowing me to define qdisc -> classes -> qdsic -> classes >

Re: [PATCH net-next 05/14] bnxt_en: Discover firmware error recovery capabilities.

2019-08-25 Thread Michael Chan
On Sun, Aug 25, 2019 at 10:49 PM David Miller wrote: > > From: Michael Chan > Date: Sun, 25 Aug 2019 23:54:56 -0400 > > > +static int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp) > > +{ > > + struct hwrm_error_recovery_qcfg_output *resp = bp->hwrm_cmd_resp_addr; > > + struct bnxt_fw_hea

Re: [PATCH net-next 01/14] bnxt_en: Suppress all error messages in hwrm_do_send_msg() in silent mode.

2019-08-25 Thread Michael Chan
On Sun, Aug 25, 2019 at 10:15 PM David Miller wrote: > > From: Michael Chan > Date: Sun, 25 Aug 2019 23:54:52 -0400 > > > If the silent parameter is set, suppress all messages when there is > > no response from firmware. When polling for firmware to come out of > > reset, no response may be norm

[PATCH bpf-next v2 2/4] xsk: add proper barriers and {READ, WRITE}_ONCE-correctness for state

2019-08-25 Thread Björn Töpel
From: Björn Töpel The state variable was read, and written outside the control mutex (struct xdp_sock, mutex), without proper barriers and {READ, WRITE}_ONCE correctness. In this commit this issue is addressed, and the state member is now used a point of synchronization whether the socket is set

[PATCH bpf-next v2 4/4] xsk: lock the control mutex in sock_diag interface

2019-08-25 Thread Björn Töpel
From: Björn Töpel When accessing the members of an XDP socket, the control mutex should be held. This commit fixes that. Acked-by: Jonathan Lemon Fixes: a36b38aa2af6 ("xsk: add sock_diag interface for AF_XDP") Signed-off-by: Björn Töpel --- net/xdp/xsk_diag.c | 3 +++ 1 file changed, 3 insert

[PATCH bpf-next v2 1/4] xsk: avoid store-tearing when assigning queues

2019-08-25 Thread Björn Töpel
From: Björn Töpel Use WRITE_ONCE when doing the store of tx, rx, fq, and cq, to avoid potential store-tearing. These members are read outside of the control mutex in the mmap implementation. Acked-by: Jonathan Lemon Fixes: 37b076933a8e ("xsk: add missing write- and data-dependency barrier") Sig

[PATCH bpf-next v2 0/4] xsk: various CPU barrier and {READ, WRITE}_ONCE fixes

2019-08-25 Thread Björn Töpel
This is a four patch series of various barrier, {READ, WRITE}_ONCE cleanups in the AF_XDP socket code. More details can be found in the corresponding commit message. For an AF_XDP socket, most control plane operations are done under the control mutex (struct xdp_sock, mutex), but there are some pl

[PATCH bpf-next v2 3/4] xsk: avoid store-tearing when assigning umem

2019-08-25 Thread Björn Töpel
From: Björn Töpel The umem member of struct xdp_sock is read outside of the control mutex, in the mmap implementation, and needs a WRITE_ONCE to avoid potentional store-tearing. Acked-by: Jonathan Lemon Fixes: 423f38329d26 ("xsk: add umem fill queue support and mmap") Signed-off-by: Björn Töpel

Re: [PATCH net-next 03/14] bnxt_en: Refactor bnxt_sriov_enable().

2019-08-25 Thread Michael Chan
On Sun, Aug 25, 2019 at 10:36 PM David Miller wrote: > > From: Michael Chan > Date: Sun, 25 Aug 2019 23:54:54 -0400 > > > @@ -687,6 +687,32 @@ static int bnxt_func_cfg(struct bnxt *bp, int num_vfs) > > return bnxt_hwrm_func_cfg(bp, num_vfs); > > } > > > > +int bnxt_cfg_hw_sriov(str

Re: [PATCH net-next 03/14] bnxt_en: Refactor bnxt_sriov_enable().

2019-08-25 Thread Leon Romanovsky
On Sun, Aug 25, 2019 at 11:54:54PM -0400, Michael Chan wrote: > Refactor the hardware/firmware configuration portion in > bnxt_sriov_enable() into a new function bnxt_cfg_hw_sriov(). This > new function can be called after a firmware reset to reconfigure the > VFs previously enabled. I wonder wha

Re: [PATCH net-next 08/14] bnxt_en: Add BNXT_STATE_IN_FW_RESET state and pf->registered_vfs.

2019-08-25 Thread David Miller
From: Michael Chan Date: Sun, 25 Aug 2019 23:54:59 -0400 > @@ -9234,6 +9243,13 @@ int bnxt_close_nic(struct bnxt *bp, bool irq_re_init, > bool link_re_init) > { > int rc = 0; > > + while (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) { > + netdev_info(bp->dev, "FW reset

Re: [PATCH net-next 05/14] bnxt_en: Discover firmware error recovery capabilities.

2019-08-25 Thread David Miller
From: Michael Chan Date: Sun, 25 Aug 2019 23:54:56 -0400 > +static int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp) > +{ > + struct hwrm_error_recovery_qcfg_output *resp = bp->hwrm_cmd_resp_addr; > + struct bnxt_fw_health *fw_health = bp->fw_health; > + struct hwrm_error_recovery_qc

Re: [PATCH net-next 04/14] bnxt_en: Handle firmware reset status during IF_UP.

2019-08-25 Thread David Miller
From: Michael Chan Date: Sun, 25 Aug 2019 23:54:55 -0400 > @@ -7005,7 +7005,9 @@ static int __bnxt_hwrm_ver_get(struct bnxt *bp, bool > silent) > > rc = bnxt_hwrm_do_send_msg(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT, > silent); > - return rc; > + i

Re: [PATCH bpf] nfp: bpf: fix latency bug when updating stack index register

2019-08-25 Thread Song Liu
On Fri, Aug 23, 2019 at 7:04 PM Jakub Kicinski wrote: > > From: Jiong Wang > > NFP is using Local Memory to model stack. LM_addr could be used as base of > a 16 32-bit word region of Local Memory. Then, if the stack offset is > beyond the current region, the local index needs to be updated. The u

Re: [PATCH net-next 03/14] bnxt_en: Refactor bnxt_sriov_enable().

2019-08-25 Thread David Miller
From: Michael Chan Date: Sun, 25 Aug 2019 23:54:54 -0400 > @@ -687,6 +687,32 @@ static int bnxt_func_cfg(struct bnxt *bp, int num_vfs) > return bnxt_hwrm_func_cfg(bp, num_vfs); > } > > +int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs) > +{ > + int rc; > + > + /* Regis

Re: [PATCH bpf-next 4/4] selftests/bpf: add precision tracking test

2019-08-25 Thread Song Liu
On Fri, Aug 23, 2019 at 3:00 AM Alexei Starovoitov wrote: > > Copy-paste of existing test > "calls: cross frame pruning - liveness propagation" > but ran with different parentage chain heuristic > which stresses different path in precision tracking logic. > > Signed-off-by: Alexei Starovoitov Ac

Re: [PATCH bpf-next 3/4] selftests/bpf: verifier precise tests

2019-08-25 Thread Song Liu
On Fri, Aug 23, 2019 at 2:59 AM Alexei Starovoitov wrote: > > Use BPF_F_TEST_STATE_FREQ flag to check that precision > tracking works as expected by comparing every step it takes. > > Signed-off-by: Alexei Starovoitov > --- > tools/testing/selftests/bpf/test_verifier.c | 68 -- > .../

Re: [PATCH net-next 01/14] bnxt_en: Suppress all error messages in hwrm_do_send_msg() in silent mode.

2019-08-25 Thread David Miller
From: Michael Chan Date: Sun, 25 Aug 2019 23:54:52 -0400 > If the silent parameter is set, suppress all messages when there is > no response from firmware. When polling for firmware to come out of > reset, no response may be normal and we want to suppress the error > messages. Also, don't poll

Re: [PATCH bpf-next 1/4] bpf: introduce verifier internal test flag

2019-08-25 Thread Song Liu
On Fri, Aug 23, 2019 at 2:59 AM Alexei Starovoitov wrote: > > Introduce BPF_F_TEST_STATE_FREQ flag to stress test parentage chain > and state pruning. > > Signed-off-by: Alexei Starovoitov Acked-by: Song Liu > --- > include/linux/bpf_verifier.h | 1 + > include/uapi/linux/bpf.h | 3 +++ >

Re: [PATCH bpf-next 2/4] tools/bpf: sync bpf.h

2019-08-25 Thread Song Liu
On Fri, Aug 23, 2019 at 2:59 AM Alexei Starovoitov wrote: > > sync bpf.h from kernel/ to tools/ > > Signed-off-by: Alexei Starovoitov Acked-by: Song Liu

[PATCH net-next 08/14] bnxt_en: Add BNXT_STATE_IN_FW_RESET state and pf->registered_vfs.

2019-08-25 Thread Michael Chan
The new flag will be set in subsequent patches when firmware is going through reset. Delay close and SRIOV disable operations until the flag is cleared. Store the registered_vfs value from the firmware. This value will be polled in subsequent patches to determine if SR-IOV is in quiescent state.

[PATCH net-next 04/14] bnxt_en: Handle firmware reset status during IF_UP.

2019-08-25 Thread Michael Chan
During IF_UP, newer firmware has a new status flag that indicates that firmware has reset. Add new function bnxt_fw_init_one() to re-probe the firmware and re-setup VF resources on the PF if necessary. If the re-probe fails, set a flag to prevent bnxt_open() from proceeding again. Signed-off-by:

[PATCH net-next 06/14] bnxt_en: Pre-map the firmware health monitoring registers.

2019-08-25 Thread Michael Chan
Pre-map the GRC registers for periodic firmware health monitoring. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 29 + drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 ++ 2 files changed, 35 insertions(

[PATCH net-next 10/14] bnxt_en: Handle RESET_NOTIFY async event from firmware.

2019-08-25 Thread Michael Chan
This event from firmware signals a coordinated reset initiated by the firmware. It may be triggered by some error conditions encountered in the firmware or other orderly reset conditions. Add devlink health reporter for this event. The driver will perform an orderly shutdown and will unregister

[PATCH net-next 01/14] bnxt_en: Suppress all error messages in hwrm_do_send_msg() in silent mode.

2019-08-25 Thread Michael Chan
If the silent parameter is set, suppress all messages when there is no response from firmware. When polling for firmware to come out of reset, no response may be normal and we want to suppress the error messages. Also, don't poll for the firmware DMA response if Bus Master is disabled. This is i

[PATCH net-next 12/14] bnxt_en: Do not send firmware messages if firmware is in error state.

2019-08-25 Thread Michael Chan
Add a flag to mark that the firmware has encountered fatal condition. The driver will not send any more firmware messages and will return error to the caller. Fix up some clean up functions to continue and not abort when the firmware message function returns error. This is preparation work to ful

[PATCH net-next 07/14] bnxt_en: Enable health monitoring.

2019-08-25 Thread Michael Chan
Handle the async event from the firmware that enables firmware health monitoring. Store initial health metrics. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 66 ++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 9 + 2 files changed,

[PATCH net-next 09/14] bnxt_en: Add new FW devlink_health_reporter

2019-08-25 Thread Michael Chan
From: Vasundhara Volam Create new FW devlink_health_reporter, to know the current health status of FW. Command example and output: $ devlink health show pci/:af:00.0 reporter fw pci/:af:00.0: name fw state healthy error 0 recover 0 FW status: Healthy; Reset count: 1 Signed-off-

[PATCH net-next 14/14] bnxt_en: Add FW fatal devlink_health_reporter

2019-08-25 Thread Michael Chan
From: Vasundhara Volam Health show command example and output: $ devlink health show pci/:af:00.0 reporter fw_fatal pci/:af:00.0: name fw_fatal state healthy error 1 recover 1 grace_period 0 auto_recover true Fatal events from firmware or missing periodic heartbeats will be repor

[PATCH net-next 11/14] bnxt_en: Retain user settings on a VF after RESET_NOTIFY event.

2019-08-25 Thread Michael Chan
From: Vasundhara Volam Retain the VF MAC address, default VLAN, TX rate control, trust settings of VFs after firmware reset. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c

[PATCH net-next 13/14] bnxt_en: Add RESET_FW state logic to bnxt_fw_reset_task().

2019-08-25 Thread Michael Chan
This state handles driver initiated chip reset during error recovery. Only the master function will perform this step during error recovery. The next patch will add code to initiate this reset from the master function. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6

[PATCH net-next 05/14] bnxt_en: Discover firmware error recovery capabilities.

2019-08-25 Thread Michael Chan
Call the new firmware API HWRM_ERROR_RECOVERY_QCFG if it is supported to discover the firmware health and recovery capabilities and settings. This feature allows the driver to reset the chip if firmware crashes and becomes unresponsive. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadc

[PATCH net-next 00/14] bnxt_en: health and error recovery.

2019-08-25 Thread Michael Chan
This patchset implements adapter health and error recovery. The status is reported through several devlink reporters and the driver will initiate and complete the coordinated recovery process. Michael Chan (11): bnxt_en: Suppress all error messages in hwrm_do_send_msg() in silent mode. bn

[PATCH net-next 02/14] bnxt_en: Prepare bnxt_init_one() to be called multiple times.

2019-08-25 Thread Michael Chan
In preparation for the new firmware reset feature, some of the logic in bnxt_init_one() will be called again after firmware has reset. Reset some of the flags and capabilities so that everything that can change can be re-initialized. Refactor some functions to probe firmware versions and capabilit

[PATCH net-next 03/14] bnxt_en: Refactor bnxt_sriov_enable().

2019-08-25 Thread Michael Chan
Refactor the hardware/firmware configuration portion in bnxt_sriov_enable() into a new function bnxt_cfg_hw_sriov(). This new function can be called after a firmware reset to reconfigure the VFs previously enabled. When VFs need to be reconfigured dynamically after firmwware reset, the configurat

Re: [PATCH] r8152: Set memory to all 0xFFs on failed reg reads

2019-08-25 Thread David Miller
From: Prashant Malani Date: Sat, 24 Aug 2019 01:36:19 -0700 > get_registers() blindly copies the memory written to by the > usb_control_msg() call even if the underlying urb failed. > > This could lead to junk register values being read by the driver, since > some indirect callers of get_registe

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

2019-08-25 Thread David Miller
From: YueHaibing Date: Mon, 26 Aug 2019 02:49:15 + > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/net/ethernet/cirrus/cs89x0.c: In function 'cs89x0_platform_probe': > drivers/net/ethernet/cirrus/cs89x0.c:1847:20: warning: > variable 'lp' set but not used [-Wunused-but-set-vari

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

2019-08-25 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/cirrus/cs89x0.c: In function 'cs89x0_platform_probe': drivers/net/ethernet/cirrus/cs89x0.c:1847:20: warning: variable 'lp' set but not used [-Wunused-but-set-variable] Reported-by: Hulk Robot Fixes: 6751edeb8700 ("cirrus: cs89x

RE: [PATCH] r8152: Set memory to all 0xFFs on failed reg reads

2019-08-25 Thread Hayes Wang
Prashant Malani [mailto:pmal...@chromium.org] > Sent: Saturday, August 24, 2019 4:36 PM [...] > get_registers() blindly copies the memory written to by the > usb_control_msg() call even if the underlying urb failed. > > This could lead to junk register values being read by the driver, since > some

Re: [PATCH net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments.

2019-08-25 Thread David Miller
From: Pravin Shelar Date: Sun, 25 Aug 2019 13:40:58 -0700 > On Sun, Aug 25, 2019 at 9:54 AM Pravin Shelar wrote: >> >> On Sat, Aug 24, 2019 at 9:58 AM Justin Pettit wrote: >> > >> > When IP fragments are reassembled before being sent to conntrack, the >> > key from the last fragment is used. U

Re: [PATCH net v2] openvswitch: Fix conntrack cache with timeout

2019-08-25 Thread David Miller
From: Yi-Hung Wei Date: Thu, 22 Aug 2019 13:17:50 -0700 > This patch addresses a conntrack cache issue with timeout policy. > Currently, we do not check if the timeout extension is set properly in the > cached conntrack entry. Thus, after packet recirculate from conntrack > action, the timeout p

Re: [PATCH net] net: dsa: tag_8021q: Future-proof the reserved fields in the custom VID

2019-08-25 Thread Florian Fainelli
Le 8/25/19 à 11:32 AM, Vladimir Oltean a écrit : > After witnessing the discussion in https://lkml.org/lkml/2019/8/14/151 > w.r.t. ioctl extensibility, it became clear that such an issue might > prevent that the 3 RSV bits inside the DSA 802.1Q tag might also suffer > the same fate and be useless f

Re: [PATCH net] ipv4: mpls: fix mpls_xmit for iptunnel

2019-08-25 Thread David Miller
From: Alexey Kodanev Date: Fri, 23 Aug 2019 20:51:43 +0300 > When using mpls over gre/gre6 setup, rt->rt_gw4 address is not set, the > same for rt->rt_gw_family. Therefore, when rt->rt_gw_family is checked > in mpls_xmit(), neigh_xmit() call is skipped. As a result, such setup > doesn't work any

Re: [PATCH net] nexthop: Fix nexthop_num_path for blackhole nexthops

2019-08-25 Thread David Miller
From: David Ahern Date: Sun, 25 Aug 2019 07:47:30 -0700 > From: David Ahern > > Donald reported this sequence: > ip next add id 1 blackhole > ip next add id 2 blackhole > ip ro add 1.1.1.1/32 nhid 1 > ip ro add 1.1.1.2/32 nhid 2 > > would cause a crash. Backtrace is: ... > fib_dump_in

Re: [PATCH net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments.

2019-08-25 Thread Pravin Shelar
On Sun, Aug 25, 2019 at 9:54 AM Pravin Shelar wrote: > > On Sat, Aug 24, 2019 at 9:58 AM Justin Pettit wrote: > > > > When IP fragments are reassembled before being sent to conntrack, the > > key from the last fragment is used. Unless there are reordering > > issues, the last fragment received w

[PATCH net-next 2/2] net: dsa: sja1105: Clear VLAN filtering offload netdev feature

2019-08-25 Thread Vladimir Oltean
The switch barely supports traffic I/O, and it does that by repurposing VLANs when there is no bridge that is taking control of them. Letting DSA declare this netdev feature as supported (see dsa_slave_create) would mean that VLAN sub-interfaces created on sja1105 switch ports will be hardware off

[PATCH net-next 1/2] net: dsa: Advertise the VLAN offload netdev ability only if switch supports it

2019-08-25 Thread Vladimir Oltean
When adding a VLAN sub-interface on a DSA slave port, the 8021q core checks NETIF_F_HW_VLAN_CTAG_FILTER and, if the netdev is capable of filtering, calls .ndo_vlan_rx_add_vid or .ndo_vlan_rx_kill_vid to configure the VLAN offloading. DSA sets this up counter-intuitively: it always advertises this

[PATCH net-next 0/2] Simplify DSA handling of VLAN subinterface offload

2019-08-25 Thread Vladimir Oltean
Depends on Vivien Didelot's patchset: https://patchwork.ozlabs.org/project/netdev/list/?series=127197&state=* This patchset removes a few strange-looking guards for -EOPNOTSUPP in dsa_slave_vlan_rx_add_vid and dsa_slave_vlan_rx_kill_vid, making that code path no longer possible. It also disables

Re: [PATCH v2 net-next 2/2] net: dsa: tag_8021q: Restore bridge VLANs when enabling vlan_filtering

2019-08-25 Thread Vladimir Oltean
On Sun, 25 Aug 2019 at 21:46, Vladimir Oltean wrote: > > The bridge core assumes that enabling/disabling vlan_filtering will > translate into the simple toggling of a flag for switchdev drivers. > > That is clearly not the case for sja1105, which alters the VLAN table > and the pvids in order to o

[PATCH v2 net-next 1/2] net: bridge: Populate the pvid flag in br_vlan_get_info

2019-08-25 Thread Vladimir Oltean
Currently this simplified code snippet fails: br_vlan_get_pvid(netdev, &pvid); br_vlan_get_info(netdev, pvid, &vinfo); ASSERT(!(vinfo.flags & BRIDGE_VLAN_INFO_PVID)); It is intuitive that the pvid of a netdevice should have the BRIDGE_VLAN_INFO_PVID flag set. However I ca

[PATCH v2 net-next 2/2] net: dsa: tag_8021q: Restore bridge VLANs when enabling vlan_filtering

2019-08-25 Thread Vladimir Oltean
The bridge core assumes that enabling/disabling vlan_filtering will translate into the simple toggling of a flag for switchdev drivers. That is clearly not the case for sja1105, which alters the VLAN table and the pvids in order to obtain port separation in standalone mode. There are 2 parts to t

[PATCH v2 net-next 0/2] Dynamic toggling of vlan_filtering for SJA1105 DSA

2019-08-25 Thread Vladimir Oltean
This patchset addresses a limitation in dsa_8021q where this sequence of commands was causing the switch to stop forwarding traffic: ip link add name br0 type bridge vlan_filtering 0 ip link set dev swp2 master br0 echo 1 > /sys/class/net/br0/bridge/vlan_filtering echo 0 > /sys/class/net/b

[PATCH net] net: dsa: tag_8021q: Future-proof the reserved fields in the custom VID

2019-08-25 Thread Vladimir Oltean
After witnessing the discussion in https://lkml.org/lkml/2019/8/14/151 w.r.t. ioctl extensibility, it became clear that such an issue might prevent that the 3 RSV bits inside the DSA 802.1Q tag might also suffer the same fate and be useless for further extension. So clearly specify that the reserv

Re: [PATCH 29/38] cls_flower: Convert handle_idr to XArray

2019-08-25 Thread Cong Wang
On Wed, Aug 21, 2019 at 11:27 AM Vlad Buslov wrote: > At first I was confused why you bring up rtnl lock in commit message > (flower classifier has 'unlocked' flag set and can't rely on it anymore) > but looking at the code I see that we lost rcu read lock here in commit > d39d714969cd ("idr: intr

Re: [PATCH net-next v2 0/6] net: dsa: explicit programmation of VLAN on CPU ports

2019-08-25 Thread Vladimir Oltean
On Sun, 25 Aug 2019 at 20:25, Vivien Didelot wrote: > > When a VLAN is programmed on a user port, every switch of the fabric also > program the CPU ports and the DSA links as part of the VLAN. To do that, > DSA makes use of bitmaps to prepare all members of a VLAN. > > While this is expected for D

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

2019-08-25 Thread Cong Wang
On Wed, Aug 21, 2019 at 11:00 PM Akshat Kakkar wrote: > > On Thu, Aug 22, 2019 at 3:37 AM Cong Wang wrote: > > > I am using ipset + iptables to classify and not filters. Besides, if > > > tc is allowing me to define qdisc -> classes -> qdsic -> classes > > > (1,2,3 ...) sort of structure (ie lik

[PATCH net-next v4 0/3] net: ethernet: mediatek: convert to PHYLINK

2019-08-25 Thread René van Dorst
These patches converts mediatek driver to PHYLINK API. v3->v4: * Phylink improvements and clean-ups after review v2->v3: * Phylink improvements and clean-ups after review v1->v2: * Rebase for mt76x8 changes * Phylink improvements and clean-ups after review * SGMII port doesn't support 2.5Gbit in S

[PATCH net-next v4 2/3] net: ethernet: mediatek: Re-add support SGMII

2019-08-25 Thread René van Dorst
* Re-add SGMII support but now with PHYLINK API support So the SGMII changes are more clear * Move SGMII block setup from mtk_gmac_sgmii_path_setup() to mtk_mac_config() * Merge mtk_setup_hw_path() into mtk_mac_config() * Remove mediatek,physpeed property, fixed-link supports now any speed so

[PATCH net-next v4 1/3] net: ethernet: mediatek: Add basic PHYLINK support

2019-08-25 Thread René van Dorst
This convert the basics to PHYLINK API. SGMII support is not in this patch. Signed-off-by: René van Dorst -- v3->v4: * In link_down() a ~ was missing before the (, RX and TX bits have to be cleared. Spotted by Russell King v2->v3: * Make link_down() similar as link_up() suggested by Russell Kin

[PATCH net-next v4 3/3] dt-bindings: net: ethernet: Update mt7622 docs and dts to reflect the new phylink API

2019-08-25 Thread René van Dorst
This patch the removes the recently added mediatek,physpeed property. Use the fixed-link property speed = <2500> to set the phy in 2.5Gbit. See mt7622-bananapi-bpi-r64.dts for a working example. Signed-off-by: René van Dorst -- v3->v4: * no change v2->v3: * no change v1->v2: * SGMII port only sup

Re: [PATCH net-next 6/6] net: dsa: clear VLAN flags for CPU port

2019-08-25 Thread Vivien Didelot
On Sat, 24 Aug 2019 22:53:08 +0300, Vladimir Oltean wrote: > Vivien, can't you just unset the PVID flag? Keeping the same > tagged/untagged setting on ingress as on egress does make more sense. Why not. I've sent a v2 with this single change. Thanks, Vivien

[PATCH net-next v2 5/6] net: dsa: program VLAN on CPU port from slave

2019-08-25 Thread Vivien Didelot
DSA currently programs a VLAN on the CPU port implicitly after the related notifier is received by a switch. While we still need to do this transparent programmation of the DSA links in the fabric, programming the CPU port this way may cause problems in some corners such as the tag_8021q driver.

[PATCH net-next v2 2/6] net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add

2019-08-25 Thread Vivien Didelot
Currently dsa_port_vid_add returns 0 if the switch returns -EOPNOTSUPP. This function is used in the tag_8021q.c code to offload the PVID of ports, which would simply not work if .port_vlan_add is not supported by the underlying switch. Do not skip -EOPNOTSUPP in dsa_port_vid_add but only when ne

[PATCH net-next v2 4/6] net: dsa: check bridge VLAN in slave operations

2019-08-25 Thread Vivien Didelot
The bridge VLANs are not offloaded by dsa_port_vlan_* if the port is not bridged or if its bridge is not VLAN aware. This is a good thing but other corners of DSA, such as the tag_8021q driver, may need to program VLANs regardless the bridge state. And also because bridge_dev is specific to user

[PATCH net-next v2 1/6] net: dsa: remove bitmap operations

2019-08-25 Thread Vivien Didelot
The bitmap operations were introduced to simplify the switch drivers in the future, since most of them could implement the common VLAN and MDB operations (add, del, dump) with simple functions taking all target ports at once, and thus limiting the number of hardware accesses. Programming an MDB or

[PATCH net-next v2 6/6] net: dsa: clear VLAN PVID flag for CPU port

2019-08-25 Thread Vivien Didelot
When the bridge offloads a VLAN on a slave port, we also need to program its dedicated CPU port as a member of the VLAN. Drivers may handle the CPU port's membership as they want. For example, Marvell as a special "Unmodified" mode to pass frames as is through such ports. Even though DSA expects

[PATCH net-next v2 3/6] net: dsa: add slave VLAN helpers

2019-08-25 Thread Vivien Didelot
Add dsa_slave_vlan_add and dsa_slave_vlan_del helpers to handle SWITCHDEV_OBJ_ID_PORT_VLAN switchdev objects. Also copy the switchdev_obj_port_vlan structure on add since we will modify it in future patches. Signed-off-by: Vivien Didelot --- net/dsa/slave.c | 40 +

[PATCH net-next v2 0/6] net: dsa: explicit programmation of VLAN on CPU ports

2019-08-25 Thread Vivien Didelot
When a VLAN is programmed on a user port, every switch of the fabric also program the CPU ports and the DSA links as part of the VLAN. To do that, DSA makes use of bitmaps to prepare all members of a VLAN. While this is expected for DSA links which are used as conduit between interconnected switch

Re: [PATCH bpf-next 2/4] xsk: add proper barriers and {READ, WRITE}_ONCE-correctness for state

2019-08-25 Thread Björn Töpel
On Fri, 23 Aug 2019 at 18:46, Jonathan Lemon wrote: > > > > On 22 Aug 2019, at 2:13, Björn Töpel wrote: > > > From: Björn Töpel > > > > The state variable was read, and written outside the control mutex > > (struct xdp_sock, mutex), without proper barriers and {READ, > > WRITE}_ONCE correctness.

[Patch net] net_sched: fix a NULL pointer deref in ipt action

2019-08-25 Thread Cong Wang
The net pointer in struct xt_tgdtor_param is not explicitly initialized therefore is still NULL when dereferencing it. So we have to find a way to pass the correct net pointer to ipt_destroy_target(). The best way I find is just saving the net pointer inside the per netns struct tcf_idrinfo, which

Re: [PATCH net 2/2] openvswitch: Clear the L4 portion of the key for "later" fragments.

2019-08-25 Thread Pravin Shelar
On Sat, Aug 24, 2019 at 9:58 AM Justin Pettit wrote: > > Only the first fragment in a datagram contains the L4 headers. When the > Open vSwitch module parses a packet, it always sets the IP protocol > field in the key, but can only set the L4 fields on the first fragment. > The original behavior

Re: [PATCH net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments.

2019-08-25 Thread Pravin Shelar
On Sat, Aug 24, 2019 at 9:58 AM Justin Pettit wrote: > > When IP fragments are reassembled before being sent to conntrack, the > key from the last fragment is used. Unless there are reordering > issues, the last fragment received will not contain the L4 ports, so the > key for the reassembled dat

Re: [PATCH net v2] openvswitch: Fix conntrack cache with timeout

2019-08-25 Thread Pravin Shelar
On Fri, Aug 23, 2019 at 9:40 AM Yi-Hung Wei wrote: > > On Thu, Aug 22, 2019 at 11:51 PM Pravin Shelar wrote: > > > > On Thu, Aug 22, 2019 at 1:28 PM Yi-Hung Wei wrote: > > > > > > This patch addresses a conntrack cache issue with timeout policy. > > > Currently, we do not check if the timeout ex

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

2019-08-25 Thread Pravin Shelar
On Wed, Aug 21, 2019 at 5:27 PM Yi-Hung Wei wrote: > > Fixes: 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action") > Signed-off-by: Yi-Hung Wei > --- > net/openvswitch/conntrack.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/openvswitch/conntrack.c b/net

Re: [PATCH net-next v3 4/6] net: dsa: mv88e6xxx: simplify SERDES code for Topaz and Peridot

2019-08-25 Thread Marek Behun
On Sun, 25 Aug 2019 12:02:32 -0400 Vivien Didelot wrote: > Aren't you relying on -ENODEV as well? Vivien, I am not relying o -ENODEV. I changed the serdes_get_lane semantics: - previously: - if port has a lane for current cmode, return given lane number - otherwise return -ENODEV - if

Re: [PATCH net] ipv4: mpls: fix mpls_xmit for iptunnel

2019-08-25 Thread David Ahern
On 8/23/19 11:51 AM, Alexey Kodanev wrote: > When using mpls over gre/gre6 setup, rt->rt_gw4 address is not set, the > same for rt->rt_gw_family. Therefore, when rt->rt_gw_family is checked > in mpls_xmit(), neigh_xmit() call is skipped. As a result, such setup > doesn't work anymore. > > This is

Re: [PATCH net-next v3 3/6] net: dsa: mv88e6xxx: create serdes_get_lane chip operation

2019-08-25 Thread Vivien Didelot
On Sun, 25 Aug 2019 05:59:12 +0200, Marek Behún wrote: > int mv88e6390_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on) > { > - int lane; > - > - lane = mv88e6390_serdes_get_lane(chip, port); > - if (lane == -ENODEV) > - return 0; > + s8 lane; > + int

Re: [PATCH net-next v3 4/6] net: dsa: mv88e6xxx: simplify SERDES code for Topaz and Peridot

2019-08-25 Thread Vivien Didelot
Hi Marek, On Sun, 25 Aug 2019 05:59:13 +0200, Marek Behún wrote: > +int mv88e6341_serdes_get_lane(struct mv88e6xxx_chip *chip, int port, s8 > *lane) > +{ > + u8 cmode = chip->ports[port].cmode; > + > + *lane = -1; > + > + if (port != 5) > + return 0; Aren't you relying o

Re: [PATCH net-next v3 3/6] net: dsa: mv88e6xxx: create serdes_get_lane chip operation

2019-08-25 Thread Vivien Didelot
Hi Marek, On Sun, 25 Aug 2019 05:59:12 +0200, Marek Behún wrote: > void mv88e6390x_serdes_irq_free(struct mv88e6xxx_chip *chip, int port) > { > - int lane = mv88e6390x_serdes_get_lane(chip, port); > + int err; > + s8 lane; > > - if (lane == -ENODEV) > + err = mv88e6xxx_ser

Re: [PATCH net-next v3 2/6] net: dsa: mv88e6xxx: update code operating on hidden registers

2019-08-25 Thread Vivien Didelot
Hi Marek, On Sun, 25 Aug 2019 05:59:11 +0200, Marek Behún wrote: > This patch moves the functions operating on the hidden debug registers > into it's own file, port_hidden.c. The functions prefix is renamed from > mv88e6390_hidden_ to mv88e6xxx_port_hidden_, to be consistent with the > rest of th

Re: [PATCH RFC net-next 0/3] Multi-CPU DSA support

2019-08-25 Thread Florian Fainelli
On 8/25/2019 12:13 AM, Marek Behun wrote: > On Sat, 24 Aug 2019 13:04:04 -0700 > Florian Fainelli wrote: > >> Now, the 4.9 kernel behavior actually works just fine because eth1 is >> not a special interface, so no tagging is expected, and "wifi", although >> it supports DSA tagging, represents

[PATCH net] nexthop: Fix nexthop_num_path for blackhole nexthops

2019-08-25 Thread David Ahern
From: David Ahern Donald reported this sequence: ip next add id 1 blackhole ip next add id 2 blackhole ip ro add 1.1.1.1/32 nhid 1 ip ro add 1.1.1.2/32 nhid 2 would cause a crash. Backtrace is: [ 151.302790] general protection fault: [#1] SMP DEBUG_PAGEALLOC KASAN PTI [ 151.30404

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

2019-08-25 Thread Paul Blakey
On 8/22/2019 6:57 AM, David Miller wrote: > From: Paul Blakey > Date: Tue, 20 Aug 2019 15:30:51 +0300 > >> @@ -4050,6 +4060,9 @@ enum skb_ext_id { >> #ifdef CONFIG_XFRM >> SKB_EXT_SEC_PATH, >> #endif >> +#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT) >> +TC_SKB_EXT, >> +#endif >> SKB_EXT

Re: [PATCHv2 1/1] net: rds: add service level support in rds-info

2019-08-25 Thread Zhu Yanjun
On 2019/8/25 7:58, David Miller wrote: From: Zhu Yanjun Date: Fri, 23 Aug 2019 21:04:16 -0400 diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h index fd6b5f6..cba368e 100644 --- a/include/uapi/linux/rds.h +++ b/include/uapi/linux/rds.h @@ -250,6 +250,7 @@ struct rds_info_rdma_

tx_fixup cdc_ether to mimic cdc_ncm tx behavior

2019-08-25 Thread Roee Kashi
Hi, I ported from Intel based modem chipset (cdc_ncm) to a Qualcomm's one (cdc_ether), and encountered a major difference between the two. cdc_ncm had a nice "feature" (which probably wasn't the original purpose): when trying to transmit more than the module's capacity, tx_fixup would return NULL

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

2019-08-25 Thread René van Dorst
Hi Russell, Quoting Russell King - ARM Linux admin : On Wed, Aug 21, 2019 at 04:45:44PM +0200, René van Dorst wrote: 1. net: dsa: mt7530: Convert to PHYLINK API This patch converts mt7530 to PHYLINK API. 2. dt-bindings: net: dsa: mt7530: Add support for port 5 3. net: dsa: mt7530: Add suppo

Re: [PATCH net-next v2 3/3] net: dsa: mt7530: Add support for port 5

2019-08-25 Thread René van Dorst
Hi David, Quoting David Miller : From: René van Dorst Date: Wed, 21 Aug 2019 16:45:47 +0200 + dev_info(ds->dev, "Setup P5, HWTRAP=0x%x, intf_sel=%s, phy-mode=%s\n", +val, p5_intf_modes(priv->p5_intf_sel), phy_modes(interface)); This is debugging, at best. Please make

Re: [PATCH net-next v3 2/3] net: ethernet: mediatek: Re-add support SGMII

2019-08-25 Thread René van Dorst
Hi Russell, Quoting Russell King - ARM Linux admin : Hi René, On Sat, Aug 24, 2019 at 01:11:17PM +, René van Dorst wrote: Hi Russell, Mediatek calls it Turbo RGMII. It is a overclock version of RGMII mode. It is used between first GMAC and port 6 of the mt7530 switch. Can be used with an

Re: Regresion with dsa_port_disable

2019-08-25 Thread Marek Behun
On Sat, 24 Aug 2019 20:53:49 -0400 Vivien Didelot wrote: > OK I think you meant info->ops->serdes_irq_free and > info->ops->serdes_irq_setup, otherwise it's confusing. > > I think I know what's going on, I'll look into it soon. Either dsa_port_setup is calling dsa_port_disable for DSA_PORT_TYPE

Re: [PATCH net-next] MAINTAINERS: Add phylink keyword to SFF/SFP/SFP+ MODULE SUPPORT

2019-08-25 Thread Sergei Shtylyov
Hello! On 25.08.2019 1:34, Andrew Lunn wrote: Russell king King, with capital K. :-) maintains phylink, as part of the SFP module support. However, much of the review work is about drivers swapping from phylib to phylink. Such changes don't make changes to the phylink core, and so the F:

Re: [PATCH RFC net-next 0/3] Multi-CPU DSA support

2019-08-25 Thread Marek Behun
On Sat, 24 Aug 2019 13:04:04 -0700 Florian Fainelli wrote: > Now, the 4.9 kernel behavior actually works just fine because eth1 is > not a special interface, so no tagging is expected, and "wifi", although > it supports DSA tagging, represents another side of the CPU/host network > stack, so you