25 Aug, 2016

2 commits

  • Make the function mlxsw_router_neigh_construct search the rif according
    to the neighbour dev other than the dev that was passed to the ndo, thus
    allowing creating neigbhours upon stacked devices.

    Fixes: 6cf3c971dc84 ("mlxsw: spectrum_router: Add private neigh table")
    Signed-off-by: Yotam Gigi
    Reviewed-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Yotam Gigi
     
  • In case we have a layer 3 interface on top of a bridge (VLAN / FID RIF),
    then we should flood the following packet types to the router:

    * Broadcast: If DIP is the broadcast address of the interface, then we
    need to be able to get it to CPU by trapping it following route lookup.

    * Reserved IP multicast (224.0.0.X): Some control packets (e.g. OSPF)
    use this range and are trapped in the router block.

    Fixes: 99f44bb3527b ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices")
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     

24 Aug, 2016

7 commits

  • Instead of using sock_tx_timestamp, use skb_tx_timestamp to record
    software transmit timestamp of a packet.

    sock_tx_timestamp resets and overrides the tx_flags of the skb.
    The function is intended to be called from within the protocol
    layer when creating the skb, not from a device driver. This is
    inconsistent with other drivers and will cause issues for TCP.

    In TCP, we intend to sample the timestamps for the last byte
    for each sendmsg/sendpage. For that reason, tcp_sendmsg calls
    tcp_tx_timestamp only with the last skb that it generates.
    For example, if a 128KB message is split into two 64KB packets
    we want to sample the SND timestamp of the last packet. The current
    code in the tun driver, however, will result in sampling the SND
    timestamp for both packets.

    Also, when the last packet is split into smaller packets for
    retranmission (see tcp_fragment), the tun driver will record
    timestamps for all of the retransmitted packets and not only the
    last packet.

    Fixes: eda297729171 (tun: Support software transmit time stamping.)
    Signed-off-by: Soheil Hassas Yeganeh
    Signed-off-by: Francis Yan
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Soheil Hassas Yeganeh
     
  • We currently enable interrupts before we enable NAPI. If an RX interrupt
    hits before we enabled NAPI then the NAPI callback is never called and
    we leave the hardware with RX interrupts disabled, which of course leads
    us to never handling received packets. Fix this by moving the interrupt
    enable to after we've enable NAPI and the reclaim tasklet.

    Fixes: cd5e41234729 ("dwc_eth_qos: do phy_start before resetting hardware")
    Signed-off-by: Rabin Vincent
    Signed-off-by: Lars Persson
    Signed-off-by: David S. Miller

    Rabin Vincent
     
  • clk_prepare_enable() may fail, so we should better check its return
    value and propagate it in the case of failure

    While at it, replace __lpc_eth_clock_enable() with a plain
    clk_prepare_enable/clk_disable_unprepare() call in order to
    simplify the code.

    Signed-off-by: Fabio Estevam
    Acked-by: Vladimir Zapolskiy
    Signed-off-by: David S. Miller

    Fabio Estevam
     
  • The PORT_RATE_CONTROL register works differently on 88e6095/6095f/6131
    in comparison to 6123/61/65, and 0x0 disables. The distinction was lost
    Linux 4.1 --> 4.2

    Signed-off-by: Jamie Lentin
    Reviewed-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Jamie Lentin
     
  • Like the ksz8081, the ksz9031 has the behavior where it will clear the
    interrupt enable bits when leaving power down. This takes advantage of the
    solution provided by f5aba91.

    Signed-off-by: Xander Huff
    Signed-off-by: Nathan Sullivan
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Xander Huff
     
  • The current scatter-gather logic in gianfar is flawed, since
    it does not consider the eTSEC's RxBD 'Data Length' field is
    context depening: for the last fragment it contains the full
    frame size, while fragments contain the fragment size, which
    equals the value written to register MRBLR.

    This causes data corruption as soon as the hardware starts
    to fragment receiving frames. As a result, the size of
    fragmented frames is increased by
    (nr_frags - 1) * MRBLR

    We first noticed this issue working with DSA, where an ICMP
    request sized 1472 bytes causes the scatter-gather logic to
    kick in. The full Ethernet frame (1518) gets increased by
    DSA (4), GMAC_FCB_LEN (8), and FSL_GIANFAR_DEV_HAS_TIMER
    (priv->padding=8) to a total of 1538 octets, which is
    fragmented by the hardware and reconstructed by the driver
    to a 3074 octet frame.

    This patch fixes the problem by adjusting the size of
    the last fragment.

    It was tested by setting MRBLR to different multiples of
    64, proving correct scatter-gather operation on frames
    with up to 9000 octets in size.

    Signed-off-by: Zefir Kurtisi
    Signed-off-by: David S. Miller

    Zefir Kurtisi
     
  • The eTSEC register MRBLR defines the maximum space in
    the RX buffers and is set to 1536 by gianfar. This
    reasonably covers the common use case where the MTU
    is kept at default 1500. In that case, the largest
    Ethernet frame size of 1518 plus an optional
    GMAC_FCB_LEN of 8, and an additional padding of 8
    to handle FSL_GIANFAR_DEV_HAS_TIMER totals to 1534
    and nicely fit within the chosen MRBLR.

    Alas, if the eTSEC is attached to a DSA enabled switch,
    the (E)DSA header extension (4 or 8 bytes) causes every
    maximum sized frame to be fragmented by the hardware.

    This patch increases the maximum RX buffer size by 8
    and rounds up to the next multiple of 64, which the
    hardware's defines as RX buffer granularity.

    Signed-off-by: Zefir Kurtisi
    Signed-off-by: David S. Miller

    Zefir Kurtisi
     

23 Aug, 2016

1 commit

  • Driver never bothered marking the VF's vport with the VF's sw_fid.
    As a result, FLR flows are not going to clean those vports.

    If the vport was active when FLRed, re-activating it would lead
    to a FW assertion.

    Fixes: dacd88d6f6851 ("qed: IOV l2 functionality")
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     

22 Aug, 2016

1 commit


21 Aug, 2016

1 commit


20 Aug, 2016

13 commits

  • 'Commit 3c8b3efc061a ("vmxnet3: allow variable length transmit data ring
    buffer")' changed the size of the buffers in the tx data ring from a
    fixed size of 128 bytes to a variable size.

    However, while copying data to the data ring, vmxnet3_copy_hdr continues
    to carry the old code that assumes fixed buffer size of 128. This patch
    fixes it by adding correct offset based on the actual data ring buffer
    size.

    Signed-off-by: Guolin Yang
    Signed-off-by: Shrikrishna Khare
    Signed-off-by: David S. Miller

    Shrikrishna Khare
     
  • The RAR entry for the SAN MAC address was being cleared when we were
    clearing the VMDq pool bits. In order to prevent this we need to add
    an extra check to protect the SAN MAC from being cleared.

    Fixes: 6e982aeae ("ixgbe: Clear stale pool mappings")
    Signed-off-by: Alexander Duyck
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher
    Signed-off-by: David S. Miller

    Alexander Duyck
     
  • Pool index has to be converted by get_pool helper to work correctly for
    egress pool. In mlxsw the egress pool index starts from 0.

    Fixes: 0f433fa0ecc ("mlxsw: spectrum_buffers: Implement shared buffer configuration")
    Signed-off-by: Jiri Pirko
    Reviewed-by: Ido Schimmel
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • When we are in the switchdev/offloads mode, HW matching is done as
    dictated by the offloaded rules and hence we don't need to enable
    the ACLs mechanism used by the legacy mode.

    Signed-off-by: Or Gerlitz
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Or Gerlitz
     
  • While adding actual offloading support to the new switchdev mode, we didn't
    change the setup of the send-to-vport rules to put them in the slow path
    table, fix that.

    Fixes: 1033665e63b6 ('net/mlx5: E-Switch, Use two priorities for SRIOV offloads mode')
    Signed-off-by: Or Gerlitz
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Or Gerlitz
     
  • Since mlx5 has also the NONE e-switch mode, we must translate from mlx5
    mode to devlink mode on the devlink eswitch mode get call, do that.

    While here, remove the mlx5_ prefix from the static function helpers
    that deal with the mode to comply with the rest of the code.

    Fixes: c930a3ad7453 ('net/mlx5e: Add devlink based SRIOV mode change')
    Signed-off-by: Or Gerlitz
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Or Gerlitz
     
  • Avoid firmware command execution each time the switchdev HW ID attr get
    call is made. We do that by reading the ID (PF NIC MAC) only once at
    load time and store it on the representor structure.

    Signed-off-by: Hadar Hen Zion
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Hadar Hen Zion
     
  • The wrong key is used when extracting the address type field set by
    the flower offload code. We have to use the control key and not the
    basic key, fix that.

    Fixes: e3a2b7ed018e ('net/mlx5e: Support offload cls_flower with drop action')
    Signed-off-by: Hadar Hen Zion
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Hadar Hen Zion
     
  • Set lastuse statistic, when number of packets is changed compared to
    last query. This was wrongly dropped when bulk counter reading was added.

    Fixes: a351a1b03bf1 ('net/mlx5: Introduce bulk reading of flow counters')
    Signed-off-by: Amir Vadai
    Reported-by: Paul Blakey
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Amir Vadai
     
  • Set and verify signature calculates the signature for each of the
    mailbox nodes, even for those that are unused (from cache). Added
    a missing length check to set and verify only those which are used.

    While here, also moved the setting of msg's nodes token to where we
    already go over them. This saves a pass because checksum is disabled,
    and the only useful thing remaining that set signature does is setting
    the token.

    Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB
    adapters')
    Signed-off-by: Paul Blakey

    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Paul Blakey
     
  • When PCI error is detected we should save the state of the pci prior to
    disabling it.

    Also when receiving pci slot reset call we need to verify that the
    device is responsive.

    Fixes: 89d44f0a6c73 ('net/mlx5_core: Add pci error handlers to mlx5_core
    driver')
    Signed-off-by: Mohamad Haj Yahia

    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Mohamad Haj Yahia
     
  • Avoid unnecessary interface down/up operations upon an MTU change
    when it does not affect the rings configuration.

    Fixes: 461017cb006a ("net/mlx5e: Support RX multi-packet WQE (Striding RQ)")
    Signed-off-by: Tariq Toukan
    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Tariq Toukan
     
  • Port mtu shouldn't be written to hardware on every single interface
    open.
    Here we set it only when needed, on change_mtu and netdevice creation.

    Signed-off-by: Saeed Mahameed
    Signed-off-by: David S. Miller

    Saeed Mahameed
     

19 Aug, 2016

6 commits

  • Just return an error upon failure.

    Signed-off-by: Oliver Neukum
    Signed-off-by: David S. Miller

    Oliver Neukum
     
  • This fixes the oops discovered by the Umap2 project and Alan Stern.
    The intf member needs to be set before the firmware is downloaded.

    Signed-off-by: Oliver Neukum
    Signed-off-by: David S. Miller

    Oliver Neukum
     
  • It was failing on successful registration returning meaningless errors.

    Signed-off-by: Rafał Miłecki
    Fixes: 55954f3bfdac ("net: ethernet: bgmac: move BCMA MDIO Phy code into a separate file")
    Signed-off-by: David S. Miller

    Rafał Miłecki
     
  • At present the code to check in kdump kernel was not disabling
    allocation of resources when CONFIG_CHELSIO_T4_DCB is defined, move the
    code outside #defines so that it gets disabled irrespective of #define,
    when in kdump kernel.

    Signed-off-by: Hariprasad Shenai
    Signed-off-by: David S. Miller

    Hariprasad Shenai
     
  • The ethtool_ops .get_regs function attempts to read the nonexistent
    register NIC_QSET_SQ_0_7_CNM_CHG, which produces a "bus error" type
    OOPs.

    Fix by not attempting to read, and removing the definition of,
    NIC_QSET_SQ_0_7_CNM_CHG. A zero is written into the register dump to
    keep the layout unchanged.

    Signed-off-by: David Daney
    Cc: # 4.4.x-
    Signed-off-by: David S. Miller

    David Daney
     
  • Driver uses netif_tx_queue_stopped() to make sure the xmit_more
    indication will be honored, but that only checks for DRV_XOFF.

    At the same time, it's possible that during transmission the DQL will
    close the transmission queue with STACK_XOFF indication.
    In re-configuration flows, when the threshold is relatively low, it's
    possible that the device has no pending tranmissions, and during
    tranmission the driver would miss doorbelling the HW.
    Since there are no pending transmission, there will never be a Tx
    completion [and thus the DQL would not remove the STACK_XOFF indication],
    eventually causing the Tx queue to timeout.

    While we're at it - also doorbell in case driver has to close the
    transmission queue on its own [although this one is less important -
    if the ring is full, we're bound to receive completion eventually,
    which means the doorbell would only be postponed and not indefinetly
    blocked].

    Fixes: 312e06761c99 ("qede: Utilize xmit_more")
    Signed-off-by: Yuval Mintz
    Signed-off-by: David S. Miller

    Yuval Mintz
     

18 Aug, 2016

9 commits

  • Pull networking fixes from David Miller:

    1) Buffers powersave frame test is reversed in cfg80211, fix from Felix
    Fietkau.

    2) Remove bogus WARN_ON in openvswitch, from Jarno Rajahalme.

    3) Fix some tg3 ethtool logic bugs, and one that would cause no
    interrupts to be generated when rx-coalescing is set to 0. From
    Satish Baddipadige and Siva Reddy Kallam.

    4) QLCNIC mailbox corruption and napi budget handling fix from Manish
    Chopra.

    5) Fix fib_trie logic when walking the trie during /proc/net/route
    output than can access a stale node pointer. From David Forster.

    6) Several sctp_diag fixes from Phil Sutter.

    7) PAUSE frame handling fixes in mlxsw driver from Ido Schimmel.

    8) Checksum fixup fixes in bpf from Daniel Borkmann.

    9) Memork leaks in nfnetlink, from Liping Zhang.

    10) Use after free in rxrpc, from David Howells.

    11) Use after free in new skb_array code of macvtap driver, from Jason
    Wang.

    12) Calipso resource leak, from Colin Ian King.

    13) mediatek bug fixes (missing stats sync init, etc.) from Sean Wang.

    14) Fix bpf non-linear packet write helpers, from Daniel Borkmann.

    15) Fix lockdep splats in macsec, from Sabrina Dubroca.

    16) hv_netvsc bug fixes from Vitaly Kuznetsov, mostly to do with VF
    handling.

    17) Various tc-action bug fixes, from CONG Wang.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (116 commits)
    net_sched: allow flushing tc police actions
    net_sched: unify the init logic for act_police
    net_sched: convert tcf_exts from list to pointer array
    net_sched: move tc offload macros to pkt_cls.h
    net_sched: fix a typo in tc_for_each_action()
    net_sched: remove an unnecessary list_del()
    net_sched: remove the leftover cleanup_a()
    mlxsw: spectrum: Allow packets to be trapped from any PG
    mlxsw: spectrum: Unmap 802.1Q FID before destroying it
    mlxsw: spectrum: Add missing rollbacks in error path
    mlxsw: reg: Fix missing op field fill-up
    mlxsw: spectrum: Trap loop-backed packets
    mlxsw: spectrum: Add missing packet traps
    mlxsw: spectrum: Mark port as active before registering it
    mlxsw: spectrum: Create PVID vPort before registering netdevice
    mlxsw: spectrum: Remove redundant errors from the code
    mlxsw: spectrum: Don't return upon error in removal path
    i40e: check for and deal with non-contiguous TCs
    ixgbe: Re-enable ability to toggle VLAN filtering
    ixgbe: Force VLNCTRL.VFE to be set in all VMDq paths
    ...

    Linus Torvalds
     
  • As pointed out by Jamal, an action could be shared by
    multiple filters, so we can't use list to chain them
    any more after we get rid of the original tc_action.
    Instead, we could just save pointers to these actions
    in tcf_exts, since they are refcount'ed, so convert
    the list to an array of pointers.

    The "ugly" part is the action API still accepts list
    as a parameter, I just introduce a helper function to
    convert the array of pointers to a list, instead of
    relying on the C99 feature to iterate the array.

    Fixes: a85a970af265 ("net_sched: move tc_action into tcf_common")
    Reported-by: Jamal Hadi Salim
    Cc: Jamal Hadi Salim
    Signed-off-by: Cong Wang
    Acked-by: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    WANG Cong
     
  • Jeff Kirsher says:

    ====================
    Intel Wired LAN Driver Updates 2016-08-16

    This series contains fixes to e1000e, igb, ixgbe and i40e.

    Kshitiz Gupta provides a fix for igb to resolve the PHY delay compensation
    math in several functions.

    Jarod Wilson provides a fix for e1000e which had to broken up into 2
    patches, first is prepares the driver for expanding the list of NICs
    that have occasional ~10 hour clock jumps when being used for PTP.
    Second patch actually fixes i218 silicon which has been experiencing
    the clock jumps while using PTP.

    Alex provides 2 patches for ixgbe now that he is back at Intel. First
    fixes setting VLNCTRL.VFE bit, which was left unchanged in earlier patches
    which resulted in disabling VLAN filtering for all the VFs. Second
    corrects the support for disabling the VLAN tag filtering via the
    feature bit.

    Lastly, David fixes i40e which was causing a kernel panic when
    non-contiguous traffic classes or traffic classes not starting with TC0,
    were configured on a link partner switch. To fix this, changed the
    logic when determining the total number of TCs enabled.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • When packets enter the device they are classified to a priority group
    (PG) buffer based on their PCP value. After their egress port and
    traffic class are determined they are moved to the switch's shared
    buffer and await transmission, if:

    (Ingress{Port}.Usage < Thres && Ingress{Port,PG}.Usage < Thres &&
    Egress{Port}.Usage < Thres && Egress{Port,TC}.Usage < Thres)
    ||
    (Ingress{Port}.Usage < Min || Ingress{Port,PG} < Min ||
    Egress{Port}.Usage < Min || Egress{Port,TC}.Usage < Min)

    Packets scheduled to transmission through CPU port (trapped to CPU) use
    traffic class 7, which has a zero maximum and minimum quotas. However,
    when such packets arrive from PG 0 they are admitted to the shared
    buffer as PG 0 has a non-zero minimum quota.

    Allow all packets to be trapped to the CPU - regardless of the PG they
    were classified to - by assigning a 10KB minimum quota for CPU port and
    TC7.

    Fixes: 8e8dfe9fdf06 ("mlxsw: spectrum: Add IEEE 802.1Qaz ETS support")
    Reported-by: Tamir Winetroub
    Tested-by: Tamir Winetroub
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Before destroying the 802.1Q FID we should first remove the VID-to-FID
    mapping. This makes mlxsw_sp_fid_destroy() symmetric with regards to
    mlxsw_sp_fid_create().

    Fixes: 14d39461b3f4 ("mlxsw: spectrum: Use per-FID struct for the VLAN-aware bridge")
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • While going over the code I noticed we are missing two rollbacks in the
    port's creation error path. Add them and adjust the place of one of them
    in the port's removal sequence so that both are symmetric.

    Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Ralue pack function needs to set op, otherwise it is 0 for add always.

    Fixes: d5a1c749d22 ("mlxsw: reg: Add Router Algorithmic LPM Unicast Entry Register definition")
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • One of the conditions to generate an ICMP Redirect Message is that "the
    packet is being forwarded out the same physical interface that it was
    received from" (RFC 1812).

    Therefore, we need to be able to trap such packets and let the kernel
    decide what to do with them.

    For each RIF, enable the loop-back filter, which will raise the LBERROR
    trap whenever the ingress RIF equals the egress RIF.

    Fixes: 99724c18fc66 ("mlxsw: spectrum: Introduce support for router interfaces")
    Reported-by: Ilan Tayari
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Ido Schimmel
     
  • Add the following traps:

    1) MTU Error: Trap packets whose size is bigger than the egress RIF's
    MTU. If DF bit isn't set, traffic will continue to be routed in slow
    path.

    2) TTL Error: Trap packets whose TTL expired. This allows traceroute to
    work properly.

    3) OSPF packets.

    Fixes: 7b27ce7bb9cd ("mlxsw: spectrum: Add traps needed for router implementation")
    Signed-off-by: Elad Raz
    Signed-off-by: Ido Schimmel
    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Elad Raz