11 Dec, 2020

2 commits

  • …/linux/kernel/git/rostedt/linux-ktest") into android-mainline

    Steps on the way to 5.10-rc8/final

    Resolves conflicts with:
    net/xfrm/xfrm_state.c

    Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
    Change-Id: I06495103fc0f2531b241b3577820f4461ba83dd5

    Greg Kroah-Hartman
     
  • Alexei Starovoitov says:

    ====================
    pull-request: bpf 2020-12-10

    The following pull-request contains BPF updates for your *net* tree.

    We've added 21 non-merge commits during the last 12 day(s) which contain
    a total of 21 files changed, 163 insertions(+), 88 deletions(-).

    The main changes are:

    1) Fix propagation of 32-bit signed bounds from 64-bit bounds, from Alexei.

    2) Fix ring_buffer__poll() return value, from Andrii.

    3) Fix race in lwt_bpf, from Cong.

    4) Fix test_offload, from Toke.

    5) Various xsk fixes.

    Please consider pulling these changes from:

    git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git

    Thanks a lot!

    Also thanks to reporters, reviewers and testers of commits in this pull-request:

    Cong Wang, Hulk Robot, Jakub Kicinski, Jean-Philippe Brucker, John
    Fastabend, Magnus Karlsson, Maxim Mikityanskiy, Yonghong Song
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

10 Dec, 2020

14 commits

  • Tony Nguyen says:

    ====================
    Intel Wired LAN Driver Updates 2020-12-09

    This series contains updates to igb, ixgbe, i40e, and ice drivers.

    Sven Auhagen fixes issues with igb XDP: return correct error value in XDP
    xmit back, increase header padding to include space for double VLAN, add
    an extack error when Rx buffer is too small for frame size, set metasize if
    it is set in xdp, change xdp_do_flush_map to xdp_do_flush, and update
    trans_start to avoid possible Tx timeout.

    Björn fixes an issue where an Rx buffer can be reused prematurely with
    XDP redirect for ixgbe, i40e, and ice drivers.

    The following are changes since commit 323a391a220c4a234cb1e678689d7f4c3b73f863:
    can: isotp: isotp_setsockopt(): block setsockopt on bound sockets
    and are available in the git repository at:
    git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 1GbE
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • In case error CQE was found while polling TX CQ, the QP is in error
    state and all posted WQEs will generate error CQEs without any data
    transmitted. Fix it by reopening the channels, via same method used for
    TX timeout handling.

    In addition add some more info on error CQE and WQE for debug.

    Fixes: bd2f631d7c60 ("net/mlx4_en: Notify user when TX ring in error state")
    Signed-off-by: Moshe Shemesh
    Signed-off-by: Tariq Toukan
    Signed-off-by: David S. Miller

    Moshe Shemesh
     
  • Add restarting state flag to avoid scheduling another restart task while
    such task is already running. Change task name from watchdog_task to
    restart_task to better fit the task role.

    Fixes: 1e338db56e5a ("mlx4_en: Fix a race at restart task")
    Signed-off-by: Moshe Shemesh
    Signed-off-by: Tariq Toukan
    Signed-off-by: David S. Miller

    Moshe Shemesh
     
  • Changed a configuration in the flows to align with
    architecture requirements to achieve S0i3.2 substate.

    This helps both i219V and i219LM configurations.

    Also fixed a typo in the previous commit 632fbd5eb5b0
    ("e1000e: fix S0ix flows for cable connected case").

    Fixes: 632fbd5eb5b0 ("e1000e: fix S0ix flows for cable connected case").
    Signed-off-by: Vitaly Lifshits
    Tested-by: Aaron Brown
    Signed-off-by: Tony Nguyen
    Reviewed-by: Alexander Duyck
    Signed-off-by: Mario Limonciello
    Link: https://lore.kernel.org/r/20201208185632.151052-1-mario.limonciello@dell.com
    Signed-off-by: Jakub Kicinski

    Vitaly Lifshits
     
  • The page recycle code, incorrectly, relied on that a page fragment
    could not be freed inside xdp_do_redirect(). This assumption leads to
    that page fragments that are used by the stack/XDP redirect can be
    reused and overwritten.

    To avoid this, store the page count prior invoking xdp_do_redirect().

    Fixes: efc2214b6047 ("ice: Add support for XDP")
    Reported-and-analyzed-by: Li RongQing
    Signed-off-by: Björn Töpel
    Tested-by: George Kuruvinakunnel
    Signed-off-by: Tony Nguyen

    Björn Töpel
     
  • The page recycle code, incorrectly, relied on that a page fragment
    could not be freed inside xdp_do_redirect(). This assumption leads to
    that page fragments that are used by the stack/XDP redirect can be
    reused and overwritten.

    To avoid this, store the page count prior invoking xdp_do_redirect().

    Fixes: 6453073987ba ("ixgbe: add initial support for xdp redirect")
    Reported-and-analyzed-by: Li RongQing
    Signed-off-by: Björn Töpel
    Tested-by: Sandeep Penigalapati
    Signed-off-by: Tony Nguyen

    Björn Töpel
     
  • The page recycle code, incorrectly, relied on that a page fragment
    could not be freed inside xdp_do_redirect(). This assumption leads to
    that page fragments that are used by the stack/XDP redirect can be
    reused and overwritten.

    To avoid this, store the page count prior invoking xdp_do_redirect().

    Longer explanation:

    Intel NICs have a recycle mechanism. The main idea is that a page is
    split into two parts. One part is owned by the driver, one part might
    be owned by someone else, such as the stack.

    t0: Page is allocated, and put on the Rx ring
    +---------------
    used by NIC ->| upper buffer
    (rx_buffer) +---------------
    | lower buffer
    +---------------
    page count == USHRT_MAX
    rx_buffer->pagecnt_bias == USHRT_MAX

    t1: Buffer is received, and passed to the stack (e.g.)
    +---------------
    | upper buff (skb)
    +---------------
    used by NIC ->| lower buffer
    (rx_buffer) +---------------
    page count == USHRT_MAX
    rx_buffer->pagecnt_bias == USHRT_MAX - 1

    t2: Buffer is received, and redirected
    +---------------
    | upper buff (skb)
    +---------------
    used by NIC ->| lower buffer
    (rx_buffer) +---------------

    Now, prior calling xdp_do_redirect():
    page count == USHRT_MAX
    rx_buffer->pagecnt_bias == USHRT_MAX - 2

    This means that buffer *cannot* be flipped/reused, because the skb is
    still using it.

    The problem arises when xdp_do_redirect() actually frees the
    segment. Then we get:
    page count == USHRT_MAX - 1
    rx_buffer->pagecnt_bias == USHRT_MAX - 2

    From a recycle perspective, the buffer can be flipped and reused,
    which means that the skb data area is passed to the Rx HW ring!

    To work around this, the page count is stored prior calling
    xdp_do_redirect().

    Note that this is not optimal, since the NIC could actually reuse the
    "lower buffer" again. However, then we need to track whether
    XDP_REDIRECT consumed the buffer or not.

    Fixes: d9314c474d4f ("i40e: add support for XDP_REDIRECT")
    Reported-and-analyzed-by: Li RongQing
    Signed-off-by: Björn Töpel
    Tested-by: George Kuruvinakunnel
    Signed-off-by: Tony Nguyen

    Björn Töpel
     
  • Since we share the transmit queue with the network stack,
    it is possible that we run into a transmit queue timeout.
    This will reset the queue.
    This happens under high load when XDP is using the
    transmit queue pretty much exclusively.

    netdev_start_xmit() sets the trans_start variable of the
    transmit queue to jiffies which is later utilized by dev_watchdog(),
    so to avoid timeout, let stack know that XDP xmit happened by
    bumping the trans_start within XDP Tx routines to jiffies.

    Fixes: 9cbc948b5a20 ("igb: add XDP support")
    Acked-by: Maciej Fijalkowski
    Signed-off-by: Sven Auhagen
    Tested-by: Sandeep Penigalapati
    Signed-off-by: Tony Nguyen

    Sven Auhagen
     
  • Since it is a new XDP implementation change xdp_do_flush_map
    to xdp_do_flush.

    Fixes: 9cbc948b5a20 ("igb: add XDP support")
    Suggested-by: Maciej Fijalkowski
    Reviewed-by: Maciej Fijalkowski
    Acked-by: Maciej Fijalkowski
    Signed-off-by: Sven Auhagen
    Tested-by: Sandeep Penigalapati
    Signed-off-by: Tony Nguyen

    Sven Auhagen
     
  • add metasize if it is set in xdp

    Fixes: 9cbc948b5a20 ("igb: add XDP support")
    Suggested-by: Maciej Fijalkowski
    Reviewed-by: Maciej Fijalkowski
    Acked-by: Maciej Fijalkowski
    Signed-off-by: Sven Auhagen
    Tested-by: Sandeep Penigalapati
    Signed-off-by: Tony Nguyen

    Sven Auhagen
     
  • Add an extack error message when the RX buffer size is too small
    for the frame size.

    Fixes: 9cbc948b5a20 ("igb: add XDP support")
    Suggested-by: Maciej Fijalkowski
    Reviewed-by: Maciej Fijalkowski
    Acked-by: Maciej Fijalkowski
    Signed-off-by: Sven Auhagen
    Tested-by: Sandeep Penigalapati
    Signed-off-by: Tony Nguyen

    Sven Auhagen
     
  • Increase the packet header padding to include double VLAN tagging.
    This patch uses a macro for this.

    Fixes: 9cbc948b5a20 ("igb: add XDP support")
    Suggested-by: Maciej Fijalkowski
    Reviewed-by: Maciej Fijalkowski
    Acked-by: Maciej Fijalkowski
    Signed-off-by: Sven Auhagen
    Tested-by: Sandeep Penigalapati
    Signed-off-by: Tony Nguyen

    Sven Auhagen
     
  • The igb XDP xmit back function should only return
    defined error codes.

    Fixes: 9cbc948b5a20 ("igb: add XDP support")
    Reported-by: Dan Carpenter
    Acked-by: Maciej Fijalkowski
    Signed-off-by: Sven Auhagen
    Tested-by: Sandeep Penigalapati
    Signed-off-by: Tony Nguyen

    Sven Auhagen
     
  • This reverts commit 4179b00c04d1 ("geneve: pull IP header before ECN decapsulation").

    Eric says: "network header should have been pulled already before
    hitting geneve_rx()". Let's revert the syzbot fix since it's causing
    more harm than good, and revisit.

    Suggested-by: Eric Dumazet
    Reported-by: Jianlin Shi
    Fixes: 4179b00c04d1 ("geneve: pull IP header before ECN decapsulation")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=210569
    Link: https://lore.kernel.org/netdev/CANn89iJVWfb=2i7oU1=D55rOyQnBbbikf+Mc6XHMkY7YX-yGEw@mail.gmail.com/
    Signed-off-by: Jakub Kicinski

    Jakub Kicinski
     

09 Dec, 2020

10 commits

  • This adds a new debugfs toggle ('bpf_bind_verifier_accept') that can be
    used to make netdevsim reject BPF programs from being accepted by the
    verifier. If this toggle (which defaults to true) is set to false,
    nsim_bpf_verify_insn() will return EOPNOTSUPP on the last
    instruction (after outputting the 'Hello from netdevsim' verifier message).

    This makes it possible to check the verification callback in the driver
    from test_offload.py in selftests, since the verifier now clears the
    verifier log on a successful load, hiding the message from the driver.

    Fixes: 6f8a57ccf851 ("bpf: Make verifier log more relevant by default")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/160752225964.110217.12584017165318065332.stgit@toke.dk

    Toke Høiland-Jørgensen
     
  • Since commit 7f0a838254bd ("bpf, xdp: Maintain info on attached XDP BPF
    programs in net_device"), the XDP program attachment info is now maintained
    in the core code. This interacts badly with the xdp_attachment_flags_ok()
    check that prevents unloading an XDP program with different load flags than
    it was loaded with. In practice, two kinds of failures are seen:

    - An XDP program loaded without specifying a mode (and which then ends up
    in driver mode) cannot be unloaded if the program mode is specified on
    unload.

    - The dev_xdp_uninstall() hook always calls the driver callback with the
    mode set to the type of the program but an empty flags argument, which
    means the flags_ok() check prevents the program from being removed,
    leading to bpf prog reference leaks.

    The original reason this check was added was to avoid ambiguity when
    multiple programs were loaded. With the way the checks are done in the core
    now, this is quite simple to enforce in the core code, so let's add a check
    there and get rid of the xdp_attachment_flags_ok() callback entirely.

    Fixes: 7f0a838254bd ("bpf, xdp: Maintain info on attached XDP BPF programs in net_device")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/160752225751.110217.10267659521308669050.stgit@toke.dk

    Toke Høiland-Jørgensen
     
  • Linux 5.10-rc7

    Signed-off-by: Greg Kroah-Hartman
    Change-Id: Ie61b3510311a825ee57bee12610e25bc1500b350

    Greg Kroah-Hartman
     
  • platform_get_resource() may fail and in this case a NULL dereference
    will occur.

    Fix it to use devm_platform_ioremap_resource() instead of calling
    platform_get_resource() and devm_ioremap().

    This is detected by Coccinelle semantic patch.

    @@
    expression pdev, res, n, t, e, e1, e2;
    @@

    res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t, n);
    + if (!res)
    + return -EINVAL;
    ... when != res == NULL
    e = devm_ioremap(e1, res->start, e2);

    Fixes: 8425c41d1ef7 ("net: ll_temac: Extend support to non-device-tree platforms")
    Signed-off-by: Zhang Changzhong
    Acked-by: Esben Haabendal
    Signed-off-by: David S. Miller

    Zhang Changzhong
     
  • The current IP register MAC_HW_Feature1[ADDR64] only defines
    32/40/64 bit width, but some SOCs support others like i.MX8MP
    support 34 bits but it maps to 40 bits width in MAC_HW_Feature1[ADDR64].
    So overwrite dma_cap.addr64 according to HW real design.

    Fixes: 94abdad6974a ("net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip")
    Signed-off-by: Fugang Duan
    Signed-off-by: Joakim Zhang
    Signed-off-by: David S. Miller

    Fugang Duan
     
  • There have chance to re-enable the eee_ctrl_timer and fire the timer
    in napi callback after delete the timer in .stmmac_release(), which
    introduces to access eee registers in the timer function after clocks
    are disabled then causes system hang. Found this issue when do
    suspend/resume and reboot stress test.

    It is safe to delete the timer after napi disabled and disable lpi mode.

    Fixes: d765955d2ae0b ("stmmac: add the Energy Efficient Ethernet support")
    Signed-off-by: Fugang Duan
    Signed-off-by: Joakim Zhang
    Signed-off-by: David S. Miller

    Fugang Duan
     
  • When do suspend/resume test, there have WARN_ON() log dump from
    stmmac_xmit() funciton, the code logic:
    entry = tx_q->cur_tx;
    first_entry = entry;
    WARN_ON(tx_q->tx_skbuff[first_entry]);

    In normal case, tx_q->tx_skbuff[txq->cur_tx] should be NULL because
    the skb should be handled and freed in stmmac_tx_clean().

    But stmmac_resume() reset queue parameters like below, skb buffers
    may not be freed.
    tx_q->cur_tx = 0;
    tx_q->dirty_tx = 0;

    So free tx skb buffer in stmmac_resume() to avoid warning and
    memory leak.

    log:
    [ 46.139824] ------------[ cut here ]------------
    [ 46.144453] WARNING: CPU: 0 PID: 0 at drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3235 stmmac_xmit+0x7a0/0x9d0
    [ 46.154969] Modules linked in: crct10dif_ce vvcam(O) flexcan can_dev
    [ 46.161328] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O 5.4.24-2.1.0+g2ad925d15481 #1
    [ 46.170369] Hardware name: NXP i.MX8MPlus EVK board (DT)
    [ 46.175677] pstate: 80000005 (Nzcv daif -PAN -UAO)
    [ 46.180465] pc : stmmac_xmit+0x7a0/0x9d0
    [ 46.184387] lr : dev_hard_start_xmit+0x94/0x158
    [ 46.188913] sp : ffff800010003cc0
    [ 46.192224] x29: ffff800010003cc0 x28: ffff000177e2a100
    [ 46.197533] x27: ffff000176ef0840 x26: ffff000176ef0090
    [ 46.202842] x25: 0000000000000000 x24: 0000000000000000
    [ 46.208151] x23: 0000000000000003 x22: ffff8000119ddd30
    [ 46.213460] x21: ffff00017636f000 x20: ffff000176ef0cc0
    [ 46.218769] x19: 0000000000000003 x18: 0000000000000000
    [ 46.224078] x17: 0000000000000000 x16: 0000000000000000
    [ 46.229386] x15: 0000000000000079 x14: 0000000000000000
    [ 46.234695] x13: 0000000000000003 x12: 0000000000000003
    [ 46.240003] x11: 0000000000000010 x10: 0000000000000010
    [ 46.245312] x9 : ffff00017002b140 x8 : 0000000000000000
    [ 46.250621] x7 : ffff00017636f000 x6 : 0000000000000010
    [ 46.255930] x5 : 0000000000000001 x4 : ffff000176ef0000
    [ 46.261238] x3 : 0000000000000003 x2 : 00000000ffffffff
    [ 46.266547] x1 : ffff000177e2a000 x0 : 0000000000000000
    [ 46.271856] Call trace:
    [ 46.274302] stmmac_xmit+0x7a0/0x9d0
    [ 46.277874] dev_hard_start_xmit+0x94/0x158
    [ 46.282056] sch_direct_xmit+0x11c/0x338
    [ 46.285976] __qdisc_run+0x118/0x5f0
    [ 46.289549] net_tx_action+0x110/0x198
    [ 46.293297] __do_softirq+0x120/0x23c
    [ 46.296958] irq_exit+0xb8/0xd8
    [ 46.300098] __handle_domain_irq+0x64/0xb8
    [ 46.304191] gic_handle_irq+0x5c/0x148
    [ 46.307936] el1_irq+0xb8/0x180
    [ 46.311076] cpuidle_enter_state+0x84/0x360
    [ 46.315256] cpuidle_enter+0x34/0x48
    [ 46.318829] call_cpuidle+0x18/0x38
    [ 46.322314] do_idle+0x1e0/0x280
    [ 46.325539] cpu_startup_entry+0x24/0x40
    [ 46.329460] rest_init+0xd4/0xe0
    [ 46.332687] arch_call_rest_init+0xc/0x14
    [ 46.336695] start_kernel+0x420/0x44c
    [ 46.340353] ---[ end trace bc1ee695123cbacd ]---

    Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
    Signed-off-by: Fugang Duan
    Signed-off-by: Joakim Zhang
    Signed-off-by: David S. Miller

    Fugang Duan
     
  • Start phylink instance and resume back the PHY to supply
    RX clock to MAC before MAC layer initialization by calling
    .stmmac_hw_setup(), since DMA reset depends on the RX clock,
    otherwise DMA reset cost maximum timeout value then finally
    timeout.

    Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
    Signed-off-by: Fugang Duan
    Signed-off-by: Joakim Zhang
    Signed-off-by: David S. Miller

    Fugang Duan
     
  • Current timeout value is not enough for gmac5 dma reset
    on imx8mp platform, increase the timeout range.

    Signed-off-by: Fugang Duan
    Signed-off-by: Joakim Zhang
    Signed-off-by: David S. Miller

    Fugang Duan
     
  • Don't try to adjust XFRM support flags if the bond device isn't yet
    registered. Bad things can currently happen when netdev_change_features()
    is called without having wanted_features fully filled in yet. This code
    runs both on post-module-load mode changes, as well as at module init
    time, and when run at module init time, it is before register_netdevice()
    has been called and filled in wanted_features. The empty wanted_features
    led to features also getting emptied out, which was definitely not the
    intended behavior, so prevent that from happening.

    Originally, I'd hoped to stop adjusting wanted_features at all in the
    bonding driver, as it's documented as being something only the network
    core should touch, but we actually do need to do this to properly update
    both the features and wanted_features fields when changing the bond type,
    or we get to a situation where ethtool sees:

    esp-hw-offload: off [requested on]

    I do think we should be using netdev_update_features instead of
    netdev_change_features here though, so we only send notifiers when the
    features actually changed.

    Fixes: a3b658cfb664 ("bonding: allow xfrm offload setup post-module-load")
    Reported-by: Ivan Vecera
    Suggested-by: Ivan Vecera
    Cc: Jay Vosburgh
    Cc: Veaceslav Falico
    Cc: Andy Gospodarek
    Signed-off-by: Jarod Wilson
    Link: https://lore.kernel.org/r/20201205172229.576587-1-jarod@redhat.com
    Signed-off-by: Jakub Kicinski

    Jarod Wilson
     

08 Dec, 2020

3 commits

  • The m250_sel mux clock uses bit 4 in the PRG_ETH0 register. Fix this by
    shifting the PRG_ETH0_CLK_M250_SEL_MASK accordingly as the "mask" in
    struct clk_mux expects the mask relative to the "shift" field in the
    same struct.

    While here, get rid of the PRG_ETH0_CLK_M250_SEL_SHIFT macro and use
    __ffs() to determine it from the existing PRG_ETH0_CLK_M250_SEL_MASK
    macro.

    Fixes: 566e8251625304 ("net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC")
    Signed-off-by: Martin Blumenstingl
    Reviewed-by: Jerome Brunet
    Link: https://lore.kernel.org/r/20201205213207.519341-1-martin.blumenstingl@googlemail.com
    Signed-off-by: Jakub Kicinski

    Martin Blumenstingl
     
  • Add an 'of_node_put()' call when a tested device node is not available.

    Fixes: 94ae899b2096 ("dpaa2-mac: add PCS support through the Lynx module")
    Signed-off-by: Christophe JAILLET
    Reviewed-by: Ioana Ciornei
    Link: https://lore.kernel.org/r/20201206151339.44306-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Jakub Kicinski

    Christophe JAILLET
     
  • Noticed some inconsistencies in packet statistics reporting.
    This patch adds the missing Tx packet counter registers to
    ethtool reporting and fixes the information strings for a
    few of them.

    Fixes: 16eb4c85c964 ("enetc: Add ethtool statistics")
    Signed-off-by: Claudiu Manoil
    Link: https://lore.kernel.org/r/20201204171505.21389-1-claudiu.manoil@nxp.com
    Signed-off-by: Jakub Kicinski

    Claudiu Manoil
     

07 Dec, 2020

1 commit

  • hclge_dbg_reg_info[] is defined as an array of packed structure
    accidentally. However, this array contains pointers, which are
    no longer aligned naturally, and cannot be relocated on PPC64.
    Hence, when compile-testing this driver on PPC64 with
    CONFIG_RELOCATABLE=y (e.g. PowerPC allyesconfig), there will be
    some warnings.

    Since each field in structure hclge_qos_pri_map_cmd and
    hclge_dbg_bitmap_cmd is type u8, the pragma packed is unnecessary
    for these two structures as well, so remove the pragma packed in
    hclge_debugfs.h to fix this issue, and this increases
    hclge_dbg_reg_info[] by 4 bytes per entry.

    Fixes: a582b78dfc33 ("net: hns3: code optimization for debugfs related to "dump reg"")
    Reported-by: Stephen Rothwell
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller

    Huazhong Tan
     

06 Dec, 2020

5 commits

  • The current assumption is that the felix DSA driver has flooding knobs
    per traffic class, while ocelot switchdev has a single flooding knob.
    This was correct for felix VSC9959 and ocelot VSC7514, but with the
    introduction of seville VSC9953, we see a switch driven by felix.c which
    has a single flooding knob.

    So it is clear that we must do what should have been done from the
    beginning, which is not to overwrite the configuration done by ocelot.c
    in felix, but instead to teach the common ocelot library about the
    differences in our switches, and set up the flooding PGIDs centrally.

    The effect that the bogus iteration through FELIX_NUM_TC has upon
    seville is quite dramatic. ANA_FLOODING is located at 0x00b548, and
    ANA_FLOODING_IPMC is located at 0x00b54c. So the bogus iteration will
    actually overwrite ANA_FLOODING_IPMC when attempting to write
    ANA_FLOODING[1]. There is no ANA_FLOODING[1] in sevile, just ANA_FLOODING.

    And when ANA_FLOODING_IPMC is overwritten with a bogus value, the effect
    is that ANA_FLOODING_IPMC gets the value of 0x0003CF7D:
    MC6_DATA = 61,
    MC6_CTRL = 61,
    MC4_DATA = 60,
    MC4_CTRL = 0.
    Because MC4_CTRL is zero, this means that IPv4 multicast control packets
    are not flooded, but dropped. An invalid configuration, and this is how
    the issue was actually spotted.

    Reported-by: Eldar Gasanov
    Reported-by: Maxim Kochetkov
    Tested-by: Eldar Gasanov
    Fixes: 84705fc16552 ("net: dsa: felix: introduce support for Seville VSC9953 switch")
    Fixes: 3c7b51bd39b2 ("net: dsa: felix: allow flooding for all traffic classes")
    Signed-off-by: Vladimir Oltean
    Reviewed-by: Alexandre Belloni
    Link: https://lore.kernel.org/r/20201204175416.1445937-1-vladimir.oltean@nxp.com
    Signed-off-by: Jakub Kicinski

    Vladimir Oltean
     
  • Fix to return a negative error code from the error handling
    case instead of 0, as done elsewhere in this function.

    Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices")
    Reported-by: Hulk Robot
    Signed-off-by: Zhang Changzhong
    Link: https://lore.kernel.org/r/1607071782-34006-1-git-send-email-zhangchangzhong@huawei.com
    Signed-off-by: Jakub Kicinski

    Zhang Changzhong
     
  • Depending on the order of the routes to fe80::/64 are installed on the
    VRF table, the NS for the source link-local address of the originator
    might be sent to the wrong interface.

    This patch ensures that packets with link-local addr source is doing a
    lookup with the orig_iif when the destination addr indicates that it
    is strict.

    Add the reproducer as a use case in self test script fcnal-test.sh.

    Fixes: b4869aa2f881 ("net: vrf: ipv6 support for local traffic to local addresses")
    Signed-off-by: Stephen Suryaputra
    Reviewed-by: David Ahern
    Link: https://lore.kernel.org/r/20201204030604.18828-1-ssuryaextr@gmail.com
    Signed-off-by: Jakub Kicinski

    Stephen Suryaputra
     
  • If softing_netdev_open() fails, we should call close_candev() to avoid
    reference leak.

    Fixes: 03fd3cf5a179d ("can: add driver for Softing card")
    Signed-off-by: Zhang Qilong
    Acked-by: Kurt Van Dijck
    Link: https://lore.kernel.org/r/20201202151632.1343786-1-zhangqilong3@huawei.com
    Signed-off-by: Marc Kleine-Budde
    Link: https://lore.kernel.org/r/20201204133508.742120-2-mkl@pengutronix.de
    Signed-off-by: Jakub Kicinski

    Zhang Qilong
     
  • When CONFIG_IPV6 is disabled, clang complains that a variable
    is uninitialized for non-IPv4 data:

    drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c:1046:6: error: variable 'cntrl1' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    if (tx_info->ip_family == AF_INET) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c:1059:2: note: uninitialized use occurs here
    cntrl1 |= T6_TXPKT_ETHHDR_LEN_V(maclen - ETH_HLEN) |
    ^~~~~~

    Replace the preprocessor conditional with the corresponding C version,
    and make the ipv4 case unconditional in this configuration to improve
    readability and avoid the warning.

    Fixes: 86716b51d14f ("ch_ktls: Update cheksum information")
    Signed-off-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20201203222641.964234-1-arnd@kernel.org
    Signed-off-by: Jakub Kicinski

    Arnd Bergmann
     

05 Dec, 2020

2 commits

  • A number of ethernet drivers require crc32 functionality to be
    avaialable in the kernel, causing a link error otherwise:

    arm-linux-gnueabi-ld: drivers/net/ethernet/agere/et131x.o: in function `et1310_setup_device_for_multicast':
    et131x.c:(.text+0x5918): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/cadence/macb_main.o: in function `macb_start_xmit':
    macb_main.c:(.text+0x4b88): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/faraday/ftgmac100.o: in function `ftgmac100_set_rx_mode':
    ftgmac100.c:(.text+0x2b38): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/freescale/fec_main.o: in function `set_multicast_list':
    fec_main.c:(.text+0x6120): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/freescale/fman/fman_dtsec.o: in function `dtsec_add_hash_mac_address':
    fman_dtsec.c:(.text+0x830): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/freescale/fman/fman_dtsec.o:fman_dtsec.c:(.text+0xb68): more undefined references to `crc32_le' follow
    arm-linux-gnueabi-ld: drivers/net/ethernet/netronome/nfp/nfpcore/nfp_hwinfo.o: in function `nfp_hwinfo_read':
    nfp_hwinfo.c:(.text+0x250): undefined reference to `crc32_be'
    arm-linux-gnueabi-ld: nfp_hwinfo.c:(.text+0x288): undefined reference to `crc32_be'
    arm-linux-gnueabi-ld: drivers/net/ethernet/netronome/nfp/nfpcore/nfp_resource.o: in function `nfp_resource_acquire':
    nfp_resource.c:(.text+0x144): undefined reference to `crc32_be'
    arm-linux-gnueabi-ld: nfp_resource.c:(.text+0x158): undefined reference to `crc32_be'
    arm-linux-gnueabi-ld: drivers/net/ethernet/nxp/lpc_eth.o: in function `lpc_eth_set_multicast_list':
    lpc_eth.c:(.text+0x1934): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/rocker/rocker_ofdpa.o: in function `ofdpa_flow_tbl_do':
    rocker_ofdpa.c:(.text+0x2e08): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/rocker/rocker_ofdpa.o: in function `ofdpa_flow_tbl_del':
    rocker_ofdpa.c:(.text+0x3074): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/rocker/rocker_ofdpa.o: in function `ofdpa_port_fdb':
    arm-linux-gnueabi-ld: drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.o: in function `mlx5dr_ste_calc_hash_index':
    dr_ste.c:(.text+0x354): undefined reference to `crc32_le'
    arm-linux-gnueabi-ld: drivers/net/ethernet/microchip/lan743x_main.o: in function `lan743x_netdev_set_multicast':
    lan743x_main.c:(.text+0x5dc4): undefined reference to `crc32_le'

    Add the missing 'select CRC32' entries in Kconfig for each of them.

    Signed-off-by: Arnd Bergmann
    Acked-by: Nicolas Ferre
    Acked-by: Madalin Bucur
    Acked-by: Mark Einon
    Acked-by: Simon Horman
    Link: https://lore.kernel.org/r/20201203232114.1485603-1-arnd@kernel.org
    Signed-off-by: Jakub Kicinski

    Arnd Bergmann
     
  • When the coherent memory is freed in gsi_trans_pool_exit_dma(), we
    are mistakenly passing the size of a single element in the pool
    rather than the actual allocated size. Fix this bug.

    Fixes: 9dd441e4ed575 ("soc: qcom: ipa: GSI transactions")
    Reported-by: Stephen Boyd
    Tested-by: Sujit Kautkar
    Signed-off-by: Alex Elder
    Reviewed-by: Bjorn Andersson
    Link: https://lore.kernel.org/r/20201203215106.17450-1-elder@linaro.org
    Signed-off-by: Jakub Kicinski

    Alex Elder
     

04 Dec, 2020

3 commits

  • STEs format for Connect-X5 and Connect-X6DX different. Currently, on
    Connext-X6DX the SW steering would break at some point when building STEs
    w/o giving a proper error message. Fix this by checking the STE format of
    the current device when initializing domain: add mlx5_ifc definitions for
    Connect-X6DX SW steering, read FW capability to get the current format
    version, and check this version when domain is being created.

    Fixes: 26d688e33f88 ("net/mlx5: DR, Add Steering entry (STE) utilities")
    Signed-off-by: Yevgeny Kliteynik
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Jakub Kicinski

    Yevgeny Kliteynik
     
  • Checksum calculation cannot be done in SW for TX kTLS HW offloaded
    packets.
    Offload it to the device, disregard the declared state of the TX
    csum offload feature.

    Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support")
    Signed-off-by: Tariq Toukan
    Reviewed-by: Maxim Mikityanskiy
    Reviewed-by: Boris Pismenny
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Jakub Kicinski

    Tariq Toukan
     
  • Fix build when CONFIG_IPV6 is not enabled by making a function
    be built conditionally.

    Fixes these build errors and warnings:

    ../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c: In function 'accel_fs_tcp_set_ipv6_flow':
    ../include/net/sock.h:380:34: error: 'struct sock_common' has no member named 'skc_v6_daddr'; did you mean 'skc_daddr'?
    380 | #define sk_v6_daddr __sk_common.skc_v6_daddr
    | ^~~~~~~~~~~~
    ../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:55:14: note: in expansion of macro 'sk_v6_daddr'
    55 | &sk->sk_v6_daddr, 16);
    | ^~~~~~~~~~~
    At top level:
    ../drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c:47:13: warning: 'accel_fs_tcp_set_ipv6_flow' defined but not used [-Wunused-function]
    47 | static void accel_fs_tcp_set_ipv6_flow(struct mlx5_flow_spec *spec, struct sock *sk)

    Fixes: 5229a96e59ec ("net/mlx5e: Accel, Expose flow steering API for rules add/del")
    Signed-off-by: Randy Dunlap
    Reported-by: kernel test robot
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Jakub Kicinski

    Randy Dunlap