Re: [rtnetlink] Potential bug in Linux (rt)netlink code

2018-10-14 Thread Henning Rogge
Am 12.10.2018 um 20:51 schrieb Stephen Hemminger: On Fri, 12 Oct 2018 09:30:40 +0200 Henning Rogge wrote: Hi, I am working on a self-written routing agent (https://github.com/OLSR/OONF) and am stuck on a problem with netlink that I cannot explain with an userspace error. I am using a

[PATCH net,stable 1/1] net: fec: don't dump RX FIFO register when not available

2018-10-14 Thread Andy Duan
From: Fugang Duan Commit db65f35f50e0 ("net: fec: add support of ethtool get_regs") introduce ethool "--register-dump" interface to dump all FEC registers. But not all silicon implementations of the Freescale FEC hardware module have the FRBR (FIFO Receive Bound Register) and FRSR (FIFO Receive

[PATCH -next] fore200e: fix missing unlock on error in bsq_audit()

2018-10-14 Thread Wei Yongjun
Add the missing unlock before return from function bsq_audit() in the error handling case. Fixes: 1d9d8be91788 ("fore200e: check for dma mapping failures") Signed-off-by: Wei Yongjun --- drivers/atm/fore200e.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/atm/fore200e.c

Re: Bug in MACSec - stops passing traffic after approx 5TB

2018-10-14 Thread Josh Coombs
On Sun, Oct 14, 2018 at 4:24 PM Sabrina Dubroca wrote: > > 2018-10-14, 10:59:31 -0400, Josh Coombs wrote: > > I initially mistook this for a traffic control issue, but after > > stripping the test beds down to just the MACSec component, I can still > > replicate the issue. After approximately

Re: Bug in MACSec - stops passing traffic after approx 5TB

2018-10-14 Thread Sabrina Dubroca
2018-10-14, 10:59:31 -0400, Josh Coombs wrote: > I initially mistook this for a traffic control issue, but after > stripping the test beds down to just the MACSec component, I can still > replicate the issue. After approximately 5TB of transfer / 4 billion > packets over a MACSec link it stops

Bug in MACSec - stops passing traffic after approx 5TB

2018-10-14 Thread Josh Coombs
I initially mistook this for a traffic control issue, but after stripping the test beds down to just the MACSec component, I can still replicate the issue. After approximately 5TB of transfer / 4 billion packets over a MACSec link it stops passing traffic. I have replicated this now on both

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-14 Thread Davide Caratti
On Sun, 2018-10-14 at 09:46 -0400, Jamal Hadi Salim wrote: > On 2018-10-13 11:23 a.m., Davide Caratti wrote: > > > > A (legal?) trick is to let tcf_action store the fallback action when it > > contains a 'goto chain' command, I just posted a proposal for gact. If you > > think it's ok, I will

Re: [PATCH net] net/sched: properly init chain in case of multiple control actions

2018-10-14 Thread Jamal Hadi Salim
On 2018-10-13 11:23 a.m., Davide Caratti wrote: On Fri, 2018-10-12 at 13:57 -0700, Cong Wang wrote: Why not just validate the fallback action in each action init()? For example, checking tcfg_paction in tcf_gact_init(). I don't see the need of making it generic. hello Cong, once again thanks

[PATCH net-next 22/23] bnxt_en: Add new NAPI poll function for 57500 chips.

2018-10-14 Thread Michael Chan
Add a new poll function that polls for NQ events. If the NQ event is a CQ notification, we locate the CP ring from the cq_handle and call __bnxt_poll_work() to handle RX/TX events on the CP ring. Add a new has_more_work field in struct bnxt_cp_ring_info to indicate budget has been reached.

[PATCH net-next 20/23] bnxt_en: Add coalescing setup for 57500 chips.

2018-10-14 Thread Michael Chan
On legacy chips, the CP ring may be shared between RX and TX and so only setup the RX coalescing parameters in such a case. On 57500 chips, we always have a dedicated CP ring for TX so we can always set up the TX coalescing parameters in bnxt_hwrm_set_coal(). Also, the min_timer coalescing

[PATCH net-next 17/23] bnxt_en: Increase RSS context array count and skip ring groups on 57500 chips.

2018-10-14 Thread Michael Chan
On the new 57500 chips, we need to allocate one RSS context for every 64 RX rings. In previous chips, only one RSS context per vnic is required regardless of the number of RX rings. So increase the max RSS context array count to 8. Hardware ring groups are not used on the new chips. Note that

[PATCH net-next 23/23] bnxt_en: Add PCI ID for BCM57508 device.

2018-10-14 Thread Michael Chan
Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index f518119..de987cc 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c

[PATCH net-next 21/23] bnxt_en: Refactor bnxt_poll_work().

2018-10-14 Thread Michael Chan
Separate the CP ring polling logic in bnxt_poll_work() into 2 separate functions __bnxt_poll_work() and __bnxt_poll_work_done(). Since the logic is separated, we need to add tx_pkts and events fields to struct bnxt_napi to keep track of the events to handle between the 2 functions. We also add

[PATCH net-next 16/23] bnxt_en: Allocate/Free CP rings for 57500 series chips.

2018-10-14 Thread Michael Chan
On the new 57500 chips, we allocate/free one CP ring for each RX ring or TX ring separately. Using separate CP rings for RX/TX is an improvement as TX events will no longer be stuck behind RX events. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 71

[PATCH net-next 03/23] bnxt_en: Add maximum extended request length fw message support.

2018-10-14 Thread Michael Chan
Support the max_ext_req_len field from the HWRM_VER_GET_RESPONSE. If this field is valid and greater than the mailbox size, use the short command format to send firmware messages greater than the mailbox size. Newer devices use this method to send larger messages to the firmware. Signed-off-by:

[PATCH net-next 04/23] bnxt_en: Update interrupt coalescing logic.

2018-10-14 Thread Michael Chan
New firmware spec. allows interrupt coalescing parameters, such as maximums, timer units, supported features to be queried. Update the driver to make use of the new call to query these parameters and provide the legacy defaults if the call is not available. Replace the hard-coded values with

[PATCH net-next 01/23] bnxt_en: Update firmware interface spec. to 1.10.0.3.

2018-10-14 Thread Michael Chan
Among the new changes are trusted VF support, 200Gbps support, and new API to dump ring information on the new chips. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 +- drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 310 ++ 2 files

[PATCH net-next 19/23] bnxt_en: Use bnxt_cp_ring_info struct pointer as parameter for RX path.

2018-10-14 Thread Michael Chan
In the RX code path, we current use the bnxt_napi struct pointer to identify the associated RX/CP rings. Change it to use the struct bnxt_cp_ring_info pointer instead since there are now up to 2 CP rings per MSIX. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c

[PATCH net-next 09/23] bnxt_en: Add 57500 new chip ID and basic structures.

2018-10-14 Thread Michael Chan
57500 series is a new chip class (P5) that requires some driver changes in the next several patches. This adds basic chip ID, doorbells, and the notification queue (NQ) structures. Each MSIX is associated with an NQ instead of a CP ring in legacy chips. Each NQ has up to 2 associated CP rings

[PATCH net-next 13/23] bnxt_en: Allocate completion ring structures for 57500 series chips.

2018-10-14 Thread Michael Chan
On 57500 chips, the original bnxt_cp_ring_info struct now refers to the NQ. bp->cp_nr_rings refer to the number of NQs on 57500 chips. There are now 2 pointers for the CP rings associated with RX and TX rings. Modify bnxt_alloc_cp_rings() and bnxt_free_cp_rings() accordingly. With multiple CP

[PATCH net-next 14/23] bnxt_en: Add helper functions to get firmware CP ring ID.

2018-10-14 Thread Michael Chan
On the new 57500 chips, getting the associated CP ring ID associated with an RX ring or TX ring is different than before. On the legacy chips, we find the associated ring group and look up the CP ring ID. On the 57500 chips, each RX ring and TX ring has a dedicated CP ring even if they share the

[PATCH net-next 02/23] bnxt_en: Add additional extended port statistics.

2018-10-14 Thread Michael Chan
Latest firmware spec. has some additional rx extended port stats and new tx extended port stats added. We now need to check the size of the returned rx and tx extended stats and determine how many counters are valid. New counters added include CoS byte and packet counts for rx and tx.

[PATCH net-next 05/23] bnxt_en: Refactor bnxt_ring_struct.

2018-10-14 Thread Michael Chan
Move the DMA page table and vmem fields in bnxt_ring_struct to a new bnxt_ring_mem_info struct. This will allow context memory management for a new device to re-use some of the existing infrastructure. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 138

[PATCH net-next 18/23] bnxt_en: Add RSS support for 57500 chips.

2018-10-14 Thread Michael Chan
RSS context allocation and RSS indirection table setup are very different on the new chip. Refactor bnxt_setup_vnic() to call 2 different functions to set up RSS for the vnic based on chip type. On the new chip, the number of RSS contexts and the indirection table size depends on the number of

[PATCH net-next 07/23] bnxt_en: Check context memory requirements from firmware.

2018-10-14 Thread Michael Chan
New device requires host context memory as a backing store. Call firmware to check for context memory requirements and store the parameters. Allocate host pages accordingly. We also need to move the call bnxt_hwrm_queue_qportcfg() earlier so that all the supported hardware queues and the IDs

[PATCH net-next 08/23] bnxt_en: Configure context memory on new devices.

2018-10-14 Thread Michael Chan
Call firmware to configure the DMA addresses of all context memory pages on new devices requiring context memory. Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 123 +- 1 file changed, 120 insertions(+), 3 deletions(-) diff --git

[PATCH net-next 00/23] bnxt_en: Add support for new 57500 chips.

2018-10-14 Thread Michael Chan
This patch-set is larger than normal because I wanted a complete series to add basic support for the new 57500 chips. The new chips have the following main differences compared to legacy chips: 1. Requires the PF driver to allocate DMA context memory as a backing store. 2. New NQ (notification

[PATCH net-next 15/23] bnxt_en: Modify bnxt_ring_alloc_send_msg() to support 57500 chips.

2018-10-14 Thread Michael Chan
Firmware ring allocation semantics are slightly different for most ring types on 57500 chips. Allocation/deallocation for NQ rings are also added for the new chips. A CP ring handle is also added so that from the NQ interrupt event, we can locate the CP ring. Signed-off-by: Michael Chan ---

[PATCH net-next 10/23] bnxt_en: Re-structure doorbells.

2018-10-14 Thread Michael Chan
The 57500 series chips have a new 64-bit doorbell format. Use a new bnxt_db_info structure to unify the new and the old 32-bit doorbells. Add a new bnxt_set_db() function to set up the doorbell addreses and doorbell keys ahead of time. Modify and introduce new doorbell helpers to help abstract

[PATCH net-next 12/23] bnxt_en: Modify the ring reservation functions for 57500 series chips.

2018-10-14 Thread Michael Chan
The ring reservation functions have to be modified for P5 chips in the following ways: - bnxt_cp_ring_info structs map to internal NQs as well as CP rings. - Ring groups are not used. - 1 CP ring must be available for each RX or TX ring. - number of RSS contexts to reserve is multiples of 64 RX

[PATCH net-next 11/23] bnxt_en: Adjust MSIX and ring groups for 57500 series chips.

2018-10-14 Thread Michael Chan
Store the maximum MSIX capability in PCIe config. space earlier. When we call firmware to query capability, we need to compare the PCIe MSIX max count with the firmware count and use the smaller one as the MSIX count for 57500 (P5) chips. The new chips don't use ring groups. But previous chips

[PATCH net-next 06/23] bnxt_en: Add new flags to setup new page table PTE bits on newer devices.

2018-10-14 Thread Michael Chan
Newer chips require the PTU_PTE_VALID bit to be set for every page table entry for context memory and rings. Additional bits are also required for page table entries for all rings. Add a flags field to bnxt_ring_mem_info struct to specify these additional bits to be used when setting up the

pull-request: bpf 2018-10-14

2018-10-14 Thread Daniel Borkmann
Hi David, The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix xsk map update and delete operation to not call synchronize_net() but to piggy back on SOCK_RCU_FREE for sockets instead as we are not allowed to sleep under RCU, from Björn. 2) Do

Re: [PATCH bpf-next] bpf: Fix dev pointer dereference from sk_skb

2018-10-14 Thread Alexei Starovoitov
On Fri, Oct 12, 2018 at 02:50:53PM -0700, Joe Stringer wrote: > Dan Carpenter reports: > > The patch 6acc9b432e67: "bpf: Add helper to retrieve socket in BPF" > from Oct 2, 2018, leads to the following Smatch complaint: > > net/core/filter.c:4893 bpf_sk_lookup() > error: we previously