27 May, 2020

1 commit


30 Apr, 2020

1 commit


29 Apr, 2020

5 commits

  • This reworks the broken locking of the TX queue from ground up. The
    locking was broken in many ways. It didn't protect the critical state
    in ivshm_net_queue consistently, leaving phases from cleanup was reading
    intermediate states while xmit was running. ivshm_net_tx_ok also has to
    be covered by the lock because it tests both num_free and tail against
    head. The new locking is reusing the TX queue lock of the device because
    this is already held across ivshm_net_xmit.

    Furthermore, there were many races between the sender and the receiver
    around enabling and evaluating TX interrupts. One was about turning on
    the TX completion interrupt only after signaling the submission of
    packets. That could potentially cause the peer to miss the need for
    signaling completion.

    The other race that led to stalled senders was around not properly
    re-checking for updates and not posting own updates while processing
    freed TX descriptors in ivshm_net_tx_clean. Doing so could cause the
    sender to miss that there are more free entries or cause the receiver to
    stop signaling further free ones after kicking the sender for the first.

    Acked-by: Ye Li
    Signed-off-by: Jan Kiszka

    Jan Kiszka
     
  • Just pass in the net_device, and the function and can retrieve the mtu
    itself.

    Acked-by: Ye Li
    Signed-off-by: Jan Kiszka

    Jan Kiszka
     
  • Analogously to vring_avail_event in ivshm_net_notify_tx.

    Acked-by: Ye Li
    Signed-off-by: Jan Kiszka

    Jan Kiszka
     
  • Use min/max_mtu to define the limits upfront. This also fixes changing
    the MTU because the default values of those two prevented it so far.

    Furthermore, all limits can be calculated during probe. Thus, there is
    no need to validate anything in ivshm_net_change_mtu, provided updates
    of a running device are rejected so that no queue can overrun.

    Acked-by: Ye Li
    Signed-off-by: Jan Kiszka

    Jan Kiszka
     
  • This contains the changes required to work with the new revision of
    ivshmem in Jailhouse, namely:

    - changed PCI vendor and device ID
    - vendor capability to communicate region location
    - new MMIO register layout
    - common interrupt control register
    - state table support, removal of rstate register
    - unidirectional shared memory regions
    - vector value has to be written to doorbell register
    - support for multiple vectors, used to split config from tx-rx

    Note: Specification work for the interface is ongoing, so details may
    still change.

    Acked-by: Ye Li
    Signed-off-by: Jan Kiszka

    Jan Kiszka
     

27 Apr, 2020

2 commits


20 Apr, 2020

1 commit

  • Add initial MxM (multi-chip-multi-interface) wifi driver.
    The driver target is to support 88w8987/88w8997/88w9098,
    currently it only supports 88w8987.

    The MxM wifi driver is merged from below repo and applied some
    patches for block and build issues.
    ssh://git@bitbucket.sw.nxp.com/wcswrel/
    rel-nxp-wifi-fp92-bt-fp85-linux-android-mxm4x17169-gpl.git

    Reviewed-by: tian yang
    Signed-off-by: Fugang Duan

    Fugang Duan
     

14 Apr, 2020

2 commits


01 Apr, 2020

1 commit


26 Mar, 2020

1 commit


18 Mar, 2020

1 commit


08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

06 Mar, 2020

1 commit


05 Mar, 2020

23 commits

  • commit 5a44c71ccda60a50073c5d7fe3f694cdfa3ab0c2 upstream.

    'alloc_etherdev_mqs()' expects first 'tx', then 'rx'. The semantic here
    looks reversed.

    Reorder the arguments passed to 'alloc_etherdev_mqs()' in order to keep
    the correct semantic.

    In fact, this is a no-op because both XGENE_NUM_[RT]X_RING are 8.

    Fixes: 107dec2749fe ("drivers: net: xgene: Add support for multiple queues")
    Signed-off-by: Christophe JAILLET
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Christophe JAILLET
     
  • commit 1c9f329b084b7b8ea6d60d91a202e884cdcf6aae upstream.

    Commit 7afb94da3cd8 ("mwifiex: update set_mac_address logic") fixed the
    only user of this function, partly because the author seems to have
    noticed that, as written, it's on the borderline between highly
    misleading and buggy.

    Anyway, no sense in keeping dead code around: let's drop it.

    Fixes: 7afb94da3cd8 ("mwifiex: update set_mac_address logic")
    Signed-off-by: Brian Norris
    Signed-off-by: Kalle Valo
    Signed-off-by: Greg Kroah-Hartman

    Brian Norris
     
  • commit 70e5b8f445fd27fde0c5583460e82539a7242424 upstream.

    Before commit 1e58252e334d ("mwifiex: Fix heap overflow in
    mmwifiex_process_tdls_action_frame()"),
    mwifiex_process_tdls_action_frame() already had too many magic numbers.
    But this commit just added a ton more, in the name of checking for
    buffer overflows. That seems like a really bad idea.

    Let's make these magic numbers a little less magic, by
    (a) factoring out 'pos[1]' as 'ie_len'
    (b) using 'sizeof' on the appropriate source or destination fields where
    possible, instead of bare numbers
    (c) dropping redundant checks, per below.

    Regarding redundant checks: the beginning of the loop has this:

    if (pos + 2 + pos[1] > end)
    break;

    but then individual 'case's include stuff like this:

    if (pos > end - 3)
    return;
    if (pos[1] != 1)
    return;

    Note that the second 'return' (validating the length, pos[1]) combined
    with the above condition (ensuring 'pos + 2 + length' doesn't exceed
    'end'), makes the first 'return' (whose 'if' can be reworded as 'pos >
    end - pos[1] - 2') redundant. Rather than unwind the magic numbers
    there, just drop those conditions.

    Fixes: 1e58252e334d ("mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()")
    Signed-off-by: Brian Norris
    Signed-off-by: Kalle Valo
    Signed-off-by: Greg Kroah-Hartman

    Brian Norris
     
  • commit 470793a78ce344bd53d31e0c2d537f71ba957547 upstream.

    As the name suggests ETH_RSS_HASH_NO_CHANGE is received upon changing
    the key or indirection table using ethtool while keeping the same hash
    function.

    Also add a function for retrieving the current hash function from
    the ena-com layer.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: Saeed Bshara
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arthur Kiyanovski
     
  • commit 5a292c89a84d49b598f8978f154bdda48b1072c0 upstream.

    fix static checker warning:
    drivers/net/ethernet/aquantia/atlantic/aq_filters.c:166 aq_check_approve_fvlan()
    error: passing untrusted data to 'test_bit()'

    Reported-by: Dan Carpenter
    Fixes: 7975d2aff5af: ("net: aquantia: add support of rx-vlan-filter offload")
    Signed-off-by: Dmitry Bogdanov
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Bogdanov
     
  • commit 380ec5b9af7f0d57dbf6ac067fd9f33cff2fef71 upstream.

    Code inspection found that in case of mapping error we do return current
    'ret' value. But beside error, it is used to count number of descriptors
    allocated for the packet. In that case map_skb function could return '1'.

    Changing it to return zero (number of mapped descriptors for skb)

    Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code")
    Signed-off-by: Pavel Belous
    Signed-off-by: Igor Russkikh
    Signed-off-by: Dmitry Bogdanov
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Pavel Belous
     
  • commit a4980919ad6a7be548d499bc5338015e1a9191c6 upstream.

    skb->len is used to calculate statistics after xmit invocation.

    Under a stress load it may happen that skb will be xmited,
    rx interrupt will come and skb will be freed, all before xmit function
    is even returned.

    Eventually, skb->len will access unallocated area.

    Moving stats calculation into tx_clean routine.

    Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code")
    Reported-by: Christophe Vu-Brugier
    Signed-off-by: Igor Russkikh
    Signed-off-by: Pavel Belous
    Signed-off-by: Dmitry Bogdanov
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Pavel Belous
     
  • commit f6f13c125e05603f68f5bf31f045b95e6d493598 upstream.

    When netvsc_attach() is called by operations like changing MTU, etc.,
    an extra wakeup may happen while netvsc_attach() calling
    rndis_filter_device_add() which sends rndis messages when queue is
    stopped in netvsc_detach(). The completion message will wake up queue 0.

    We can reproduce the issue by changing MTU etc., then the wake_queue
    counter from "ethtool -S" will increase beyond stop_queue counter:
    stop_queue: 0
    wake_queue: 1
    The issue causes queue wake up, and counter increment, no other ill
    effects in current code. So we didn't see any network problem for now.

    To fix this, initialize tx_disable to true, and set it to false when
    the NIC is ready to be attached or registered.

    Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic")
    Signed-off-by: Haiyang Zhang
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Haiyang Zhang
     
  • [ Upstream commit 47327c9315b2f3ae4ab659457977a26669631f20 ]

    The IPv6 address defined in struct in6_addr is specified as
    big endian, but there is no specified endian in struct
    hclge_fd_rule_tuples, so it will cause a problem if directly
    use memcpy() to copy ipv6 address between these two structures
    since this field in struct hclge_fd_rule_tuples is little endian.

    This patch fixes this problem by using be32_to_cpu() to convert
    endian of IPv6 address of struct in6_addr before copying.

    Fixes: d93ed94fbeaf ("net: hns3: add aRFS support for PF")
    Signed-off-by: Guangbin Huang
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Guangbin Huang
     
  • [ Upstream commit d0db7ed397517c8b2be24a0d1abfa15df776908e ]

    In the current process, the management table is missing after the
    IMP reset. This patch adds the management table to the reset process.

    Fixes: f5aac71c0327 ("net: hns3: add manager table initialization for hardware")
    Signed-off-by: Yufeng Mo
    Signed-off-by: Huazhong Tan
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Yufeng Mo
     
  • [ Upstream commit cf8fc2a0863f9ff27ebd2efcdb1f7d378b9fb8a6 ]

    After a reset the Unit Load Status bits in the GLNVM_ULD register to check
    for completion should be 0x7FF before continuing. Update the mask to check
    (minus the three reserved bits that are always set).

    Signed-off-by: Bruce Allan
    Signed-off-by: Tony Nguyen
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Sasha Levin

    Bruce Allan
     
  • [ Upstream commit c207979f5ae10ed70aff1bb13f39f0736973de99 ]

    comp_ctx can be NULL in a very rare case when an admin command is executed
    during the execution of ena_remove().

    The bug scenario is as follows:

    * ena_destroy_device() sets the comp_ctx to be NULL
    * An admin command is executed before executing unregister_netdev(),
    this can still happen because our device can still receive callbacks
    from the netdev infrastructure such as ethtool commands.
    * When attempting to access the comp_ctx, the bug occurs since it's set
    to NULL

    Fix:
    Added a check that comp_ctx is not NULL

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit 886d2089276e40d460731765083a741c5c762461 ]

    Up till kernel 4.11 there was no enum defined for crc32 hash in ethtool,
    thus the xor enum was used for supporting crc32.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Sameeh Jubran
     
  • [ Upstream commit e3f89f91e98ce07dc0f121a3b70d21aca749ba39 ]

    The function ena_com_ind_tbl_convert_from_device() has an overflow
    bug as explained below. Either way, this function is not needed at
    all since we don't retrieve the indirection table from the device
    at any point which means that this conversion is not needed.

    The bug:
    The for loop iterates over all io_sq_queues, when passing the actual
    number of used queues the io_sq_queues[i].idx equals 0 since they are
    uninitialized which results in the following code to be executed till
    the end of the loop:

    dev_idx_to_host_tbl[0] = i;

    This results dev_idx_to_host_tbl[0] in being equal to
    ENA_TOTAL_NUM_QUEUES - 1.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit 92569fd27f5cb0ccbdf7c7d70044b690e89a0277 ]

    The indirection table has the indices of the Rx queues. When we store it
    during set indirection operation, we convert the indices to our internal
    representation of the indices.

    Our internal representation of the indices is: even indices for Tx and
    uneven indices for Rx, where every Tx/Rx pair are in a consecutive order
    starting from 0. For example if the driver has 3 queues (3 for Tx and 3
    for Rx) then the indices are as follows:
    0 1 2 3 4 5
    Tx Rx Tx Rx Tx Rx

    The BUG:
    The issue is that when we satisfy a get request for the indirection
    table, we don't convert the indices back to the original representation.

    The FIX:
    Simply apply the inverse function for the indices of the indirection
    table after we set it.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit 4844470d472d660c26149ad764da2406adb13423 ]

    The device receives, stores and retrieves the hash function value as bits
    and not as their enum value.

    The bug:
    * In ena_com_set_hash_function() we set
    cmd.u.flow_hash_func.selected_func to the bit value of rss->hash_func.
    (1 << rss->hash_func)
    * In ena_com_get_hash_function() we retrieve the hash function and store
    it's bit value in rss->hash_func. (Now the bit value of rss->hash_func
    is stored in rss->hash_func instead of it's enum value)

    The fix:
    This commit fixes the issue by converting the retrieved hash function
    values from the device to the matching enum value of the set bit using
    ffs(). ffs() finds the first set bit's index in a word. Since the function
    returns 1 for the LSB's index, we need to subtract 1 from the returned
    value (note that BIT(0) is 1).

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit 0c8923c0a64fb5d14bebb9a9065d2dc25ac5e600 ]

    On old hardware, getting / setting the hash function is not supported while
    gettting / setting the indirection table is.

    This commit enables us to still show the indirection table on older
    hardwares by setting the hash function and key to NULL.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Sameeh Jubran
     
  • [ Upstream commit 6a4f7dc82d1e3abd3feb0c60b5041056fcd9880c ]

    Currently we allocate the key whether the device supports setting the
    key or not. This commit adds a check to the allocation function and
    handles the error accordingly.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Sameeh Jubran
     
  • [ Upstream commit 0d1c3de7b8c78a5e44b74b62ede4a63629f5d811 ]

    Bug description:
    When running "ethtool -x " the key shows up as all zeros.

    When we use "ethtool -X hfunc toeplitz hkey " to
    set the key and then try to retrieve it using "ethtool -x " then
    we return the correct key because we return the one we saved.

    Bug cause:
    We don't fetch the key from the device but instead return the key
    that we have saved internally which is by default set to zero upon
    allocation.

    Fix:
    This commit fixes the issue by initializing the key to a random value
    using netdev_rss_key_fill().

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit cf6d17fde93bdda23c9b02dd5906a12bf8c55209 ]

    Current implementation of the driver calls skb_tx_timestamp()to add a
    software tx timestamp to the skb, however the software-transmit capability
    is not reported in ethtool -T.

    This commit updates the ethtool structure to report the software-transmit
    capability in ethtool -T using the standard ethtool_op_get_ts_info().
    This function reports all software timestamping capabilities (tx and rx),
    as well as setting phc_index = -1. phc_index is the index of the PTP
    hardware clock device that will be used for hardware timestamps. Since we
    don't have such a device in ENA, using the default -1 value is the correct
    setting.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Ezequiel Lara Gomez
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit 2a6e5fa2f4c25b66c763428a3e65363214946931 ]

    >From the documentation of round_jiffies():
    "Rounds a time delta in the future (in jiffies) up or down to
    (approximately) full seconds. This is useful for timers for which
    the exact time they fire does not matter too much, as long as
    they fire approximately every X seconds.
    By rounding these timers to whole seconds, all such timers will fire
    at the same time, rather than at various times spread out. The goal
    of this is to have the CPU wake up less, which saves power."

    There are 2 parts to this patch:
    ================================
    Part 1:
    -------
    In our case we need timer_service to be called approximately every
    X=1 seconds, and the exact time does not matter, so using round_jiffies()
    is the right way to go.

    Therefore we add round_jiffies() to the mod_timer() in ena_timer_service().

    Part 2:
    -------
    round_jiffies() is used in check_for_missing_keep_alive() when
    getting the jiffies of the expiration of the keep_alive timeout. Here it
    is actually a mistake to use round_jiffies() because we want the exact
    time when keep_alive should expire and not an approximate rounded time,
    which can cause early, false positive, timeouts.

    Therefore we remove round_jiffies() in the calculation of
    keep_alive_expired() in check_for_missing_keep_alive().

    Fixes: 82ef30f13be0 ("net: ena: add hardware hints capability to the driver")
    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit 91a65b7d3ed8450f31ab717a65dcb5f9ceb5ab02 ]

    When ethtool -X is called without an hkey, ena_com_fill_hash_function()
    is called with key=NULL, which is passed to memcpy causing a crash.

    This commit fixes this issue by checking key is not NULL.

    Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
    Signed-off-by: Sameeh Jubran
    Signed-off-by: Arthur Kiyanovski
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Arthur Kiyanovski
     
  • [ Upstream commit f27f37a04a69890ac85d9155f03ee2d23b678d8f ]

    Commit d9d6a9aed3f6 ("i40e: Fix virtchnl_queue_select bitmap
    validation") introduced a necessary change for verifying how queue
    bitmaps from the iavf driver get validated. Unfortunately, the
    conditional was reversed. Fix this.

    Fixes: d9d6a9aed3f6 ("i40e: Fix virtchnl_queue_select bitmap validation")
    Signed-off-by: Brett Creeley
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Brett Creeley