Skip to content
  1. Jul 23, 2020
    • Tom Parkin's avatar
      l2tp: add identifier name in function pointer prototype · bef04d16
      Tom Parkin authored
      
      
      Reported by checkpatch:
      
              "WARNING: function definition argument 'struct sock *'
               should also have an identifier name"
      
      Add an identifier name to help document the prototype.
      
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bef04d16
    • Tom Parkin's avatar
      l2tp: cleanup suspect code indent · 0864e331
      Tom Parkin authored
      
      
      l2tp_core has conditionally compiled code in l2tp_xmit_skb for IPv6
      support.  The structure of this code triggered a checkpatch warning
      due to incorrect indentation.
      
      Fix up the indentation to address the checkpatch warning.
      
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0864e331
    • Tom Parkin's avatar
      l2tp: cleanup wonky alignment of line-broken function calls · 8ce9825a
      Tom Parkin authored
      
      
      Arguments should be aligned with the function call open parenthesis as
      per checkpatch.  Tweak some function calls which were not aligned
      correctly.
      
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ce9825a
    • Tom Parkin's avatar
      l2tp: cleanup difficult-to-read line breaks · 9f7da9a0
      Tom Parkin authored
      
      
      Some l2tp code had line breaks which made the code more difficult to
      read.  These were originally motivated by the 80-character line width
      coding guidelines, but were actually a negative from the perspective of
      trying to follow the code.
      
      Remove these linebreaks for clearer code, even if we do exceed 80
      characters in width in some places.
      
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f7da9a0
    • Tom Parkin's avatar
      l2tp: cleanup comments · 20dcb110
      Tom Parkin authored
      
      
      Modify some l2tp comments to better adhere to kernel coding style, as
      reported by checkpatch.pl.
      
      Add descriptive comments for the l2tp per-net spinlocks to document
      their use.
      
      Fix an incorrect comment in l2tp_recv_common:
      
      RFC2661 section 5.4 states that:
      
      "The LNS controls enabling and disabling of sequence numbers by sending a
      data message with or without sequence numbers present at any time during
      the life of a session."
      
      l2tp handles this correctly in l2tp_recv_common, but the comment around
      the code was incorrect and confusing.  Fix up the comment accordingly.
      
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20dcb110
    • Tom Parkin's avatar
      l2tp: cleanup whitespace use · b71a61cc
      Tom Parkin authored
      
      
      Fix up various whitespace issues as reported by checkpatch.pl:
      
       * remove spaces around operators where appropriate,
       * add missing blank lines following declarations,
       * remove multiple blank lines, or trailing blank lines at the end of
         functions.
      
      Signed-off-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b71a61cc
    • Parav Pandit's avatar
      devlink: Always use user_ptr[0] for devlink and simplify post_doit · 637989b5
      Parav Pandit authored
      
      
      Currently devlink instance is searched on all doit() operations.
      But it is optionally stored into user_ptr[0]. This requires
      rediscovering devlink again doing post_doit().
      
      Few devlink commands related to port shared buffers needs 3 pointers
      (devlink, devlink_port, and devlink_sb) while executing doit commands.
      Though devlink pointer can be derived from the devlink_port during
      post_doit() operation when doit() callback has acquired devlink
      instance lock, relying on such scheme to access devlik pointer makes
      code very fragile.
      
      Hence, to avoid ambiguity in post_doit() and to avoid searching
      devlink instance again, simplify code by always storing devlink
      instance in user_ptr[0] and derive devlink_sb pointer in their
      respective callback routines.
      
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      637989b5
    • Sriram Krishnan's avatar
      hv_netvsc: add support for vlans in AF_PACKET mode · fdd8fac4
      Sriram Krishnan authored
      
      
      Vlan tagged packets are getting dropped when used with DPDK that uses
      the AF_PACKET interface on a hyperV guest.
      
      The packet layer uses the tpacket interface to communicate the vlans
      information to the upper layers. On Rx path, these drivers can read the
      vlan info from the tpacket header but on the Tx path, this information
      is still within the packet frame and requires the paravirtual drivers to
      push this back into the NDIS header which is then used by the host OS to
      form the packet.
      
      This transition from the packet frame to NDIS header is currently missing
      hence causing the host OS to drop the all vlan tagged packets sent by
      the drivers that use AF_PACKET (ETH_P_ALL) such as DPDK.
      
      Here is an overview of the changes in the vlan header in the packet path:
      
      The RX path (userspace handles everything):
        1. RX VLAN packet is stripped by HOST OS and placed in NDIS header
        2. Guest Kernel RX hv_netvsc packets and moves VLAN info from NDIS
           header into kernel SKB
        3. Kernel shares packets with user space application with PACKET_MMAP.
           The SKB VLAN info is copied to tpacket layer and indication set
           TP_STATUS_VLAN_VALID.
        4. The user space application will re-insert the VLAN info into the frame
      
      The TX path:
        1. The user space application has the VLAN info in the frame.
        2. Guest kernel gets packets from the application with PACKET_MMAP.
        3. The kernel later sends the frame to the hv_netvsc driver. The only way
           to send VLANs is when the SKB is setup & the VLAN is stripped from the
           frame.
        4. TX VLAN is re-inserted by HOST OS based on the NDIS header. If it sees
           a VLAN in the frame the packet is dropped.
      
      Cc: xe-linux-external@cisco.com
      Cc: Sriram Krishnan <srirakr2@cisco.com>
      Signed-off-by: default avatarSriram Krishnan <srirakr2@cisco.com>
      Reviewed-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdd8fac4
    • Paolo Abeni's avatar
      mptcp: zero token hash at creation time. · 6ab301c9
      Paolo Abeni authored
      Otherwise the 'chain_len' filed will carry random values,
      some token creation calls will fail due to excessive chain
      length, causing unexpected fallback to TCP.
      
      Fixes: 2c5ebd00
      
       ("mptcp: refactor token container")
      Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Tested-by: default avatarChristoph Paasch <cpaasch@apple.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ab301c9
    • Colin Ian King's avatar
      lan743x: remove redundant initialization of variable current_head_index · bb809a04
      Colin Ian King authored
      
      
      The variable current_head_index is being initialized with a value that
      is never read and it is being updated later with a new value.  Replace
      the initialization of -1 with the latter assignment.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb809a04
    • Claudiu Manoil's avatar
      enetc: Remove the imdio bus on PF probe bailout · c6dd6488
      Claudiu Manoil authored
      enetc_imdio_remove() is missing from the enetc_pf_probe()
      bailout path. Not surprisingly because enetc_setup_serdes()
      is registering the imdio bus for internal purposes, and it's
      not obvious that enetc_imdio_remove() currently performs the
      teardown of enetc_setup_serdes().
      To fix this, define enetc_teardown_serdes() to wrap
      enetc_imdio_remove() (improve code maintenance) and call it
      on bailout and remove paths.
      
      Fixes: 975d183e
      
       ("net: enetc: Initialize SerDes for SGMII and USXGMII protocols")
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c6dd6488
    • Wang Hai's avatar
      net: qed: Remove unneeded cast from memory allocation · 7979a7d2
      Wang Hai authored
      
      
      Remove casting the values returned by memory allocation function.
      
      Coccinelle emits WARNING: casting value returned by memory allocation
      unction to (struct roce_destroy_qp_req_output_params *) is useless.
      
      This issue was detected by using the Coccinelle software.
      
      Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7979a7d2
    • Vladimir Oltean's avatar
      net: phy: fix check in get_phy_c45_ids · fb16d465
      Vladimir Oltean authored
      After the patch below, the iteration through the available MMDs is
      completely short-circuited, and devs_in_pkg remains set to the initial
      value of zero.
      
      Due to devs_in_pkg being zero, the rest of get_phy_c45_ids() is
      short-circuited too: the following loop never reaches below this point
      either (it executes "continue" for every device in package, failing to
      retrieve PHY ID for any of them):
      
      	/* Now probe Device Identifiers for each device present. */
      	for (i = 1; i < num_ids; i++) {
      		if (!(devs_in_pkg & (1 << i)))
      			continue;
      
      So c45_ids->device_ids remains populated with zeroes. This causes an
      Aquantia AQR412 PHY (same as any C45 PHY would, in fact) to be probed by
      the Generic PHY driver.
      
      The issue seems to be a case of submitting partially committed work (and
      therefore testing something other than was submitted).
      
      The intention of the patch was to delay exiting the loop until one more
      condition is reached (the devs_in_pkg read from hardware is either 0, OR
      mostly f's). So fix the patch to reflect that.
      
      Tested with traffic on a LS1028A-QDS, the PHY is now probed correctly
      using the Aquantia driver. The devs_in_pkg bit field is set to
      0xe000009a, and the MMDs that are present have the following IDs:
      
      [    5.600772] libphy: get_phy_c45_ids: device_ids[1]=0x3a1b662
      [    5.618781] libphy: get_phy_c45_ids: device_ids[3]=0x3a1b662
      [    5.630797] libphy: get_phy_c45_ids: device_ids[4]=0x3a1b662
      [    5.654535] libphy: get_phy_c45_ids: device_ids[7]=0x3a1b662
      [    5.791723] libphy: get_phy_c45_ids: device_ids[29]=0x3a1b662
      [    5.804050] libphy: get_phy_c45_ids: device_ids[30]=0x3a1b662
      [    5.816375] libphy: get_phy_c45_ids: device_ids[31]=0x0
      
      [    7.690237] mscc_felix 0000:00:00.5: PHY [0.5:00] driver [Aquantia AQR412] (irq=POLL)
      [    7.704739] mscc_felix 0000:00:00.5: PHY [0.5:01] driver [Aquantia AQR412] (irq=POLL)
      [    7.718918] mscc_felix 0000:00:00.5: PHY [0.5:02] driver [Aquantia AQR412] (irq=POLL)
      [    7.733044] mscc_felix 0000:00:00.5: PHY [0.5:03] driver [Aquantia AQR412] (irq=POLL)
      
      Fixes: bba238ed
      
       ("net: phy: continue searching for C45 MMDs even if first returned ffff:ffff")
      Reported-by: default avatarColin King <colin.king@canonical.com>
      Reported-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fb16d465
    • Richard Sailer's avatar
      net: dccp: Add SIOCOUTQ IOCTL support (send buffer fill) · 749c08f8
      Richard Sailer authored
      
      
      This adds support for the SIOCOUTQ IOCTL to get the send buffer fill
      of a DCCP socket, like UDP and TCP sockets already have.
      
      Regarding the used data field: DCCP uses per packet sequence numbers,
      not per byte, so sequence numbers can't be used like in TCP. sk_wmem_queued
      is not used by DCCP and always 0, even in test on highly congested paths.
      Therefore this uses sk_wmem_alloc like in UDP.
      
      Signed-off-by: default avatarRichard Sailer <richard_siegfried@systemli.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      749c08f8
    • David S. Miller's avatar
      Merge branch 'Add-DSA-yaml-binding' · 09a0d326
      David S. Miller authored
      
      
      Kurt Kanzenbach says:
      
      ====================
      Add DSA yaml binding
      
      as discussed [1] [2] it makes sense to add a DSA yaml binding. This is the
      second version and contains now two ways of specifying the switch ports: Either
      by "ports" or by "ethernet-ports". That is why the third patch also adjusts the
      DSA core for it.
      
      Tested in combination with the hellcreek.yaml file.
      
      Changes since v1:
      
       * Use select to not match unrelated switches
       * Allow ethernet-port(s)
       * List ethernet-controller properties
       * Include better description
       * Let dsa.txt refer to dsa.yaml
      
      Thanks,
      Kurt
      
      [1] - https://lkml.kernel.org/netdev/449f0a03-a91d-ae82-b31f-59dfd1457ec5@gmail.com/
      [2] - https://lkml.kernel.org/netdev/20200710090618.28945-1-kurt@linutronix.de/
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09a0d326
    • Kurt Kanzenbach's avatar
      net: dsa: of: Allow ethernet-ports as encapsulating node · 85e05d26
      Kurt Kanzenbach authored
      
      
      Due to unified Ethernet Switch Device Tree Bindings allow for ethernet-ports as
      encapsulating node as well.
      
      Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      85e05d26
    • Kurt Kanzenbach's avatar
      dt-bindings: net: dsa: Let dsa.txt refer to dsa.yaml · 5a18bb14
      Kurt Kanzenbach authored
      
      
      The DSA bindings have been converted to YAML. Therefore, the old text style
      documentation should refer to that one.
      
      The text file can be removed completely once all the existing DSA switch
      bindings have been converted as well.
      
      Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a18bb14
    • Kurt Kanzenbach's avatar
      dt-bindings: net: dsa: Add DSA yaml binding · bce58590
      Kurt Kanzenbach authored
      
      
      For future DSA drivers it makes sense to add a generic DSA yaml binding which
      can be used then. This was created using the properties from dsa.txt. It
      includes the ports and the dsa,member property.
      
      Suggested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bce58590
    • Vladimir Oltean's avatar
      net: mscc: ocelot: fix non-initialized CPU port on VSC7514 · 8bb849d6
      Vladimir Oltean authored
      The VSC7514 is marketed as a 10-port switch, however it has 11 physical
      ports (0->10) in the block diagram:
      https://www.microsemi.com/product-directory/ethernet-switches/3992-vsc7514
      (also in the device tree at arch/mips/boot/dts/mscc/ocelot.dtsi)
      
      Additionally, by architecture it has one more entry in the analyzer
      block, situated right after the physical ports, for the CPU port module.
      This is not a physical port, it only represents a channel for frame
      injection and extraction. That entry for the CPU port is at index 11 in
      the analyzer.
      
      When the register groups for QSYS_SWITCH_PORT_MODE, SYS_PORT_MODE and
      SYS_PAUSE_CFG are declared to be replicated 11 times, the 11th entry in
      the array of regfields is not initialized, so the CPU port module is not
      initialized either.
      
      The documentation of QSYS_SWITCH_PORT_MODE for VSC7514 also says that
      this register group is replicated 12 times, so this patch is simply
      reflecting that and not introducing any further inconsistency.
      
      Fixes: 886e1387 ("net: mscc: ocelot: convert QSYS_SWITCH_PORT_MODE and SYS_PORT_MODE to regfields")
      Fixes: 541132f0
      
       ("net: mscc: ocelot: convert SYS_PAUSE_CFG register access to regfield")
      Reported-by: default avatarBryan Whitehead <bryan.whitehead@microchip.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8bb849d6
    • Christoph Hellwig's avatar
      net: explicitly include <linux/compat.h> in net/core/sock.c · a6c0d093
      Christoph Hellwig authored
      The buildbot found a config where the header isn't already implicitly
      pulled in, so add an explicit include as well.
      
      Fixes: 8c918ffb
      
       ("net: remove compat_sock_common_{get,set}sockopt")
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a6c0d093
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · dee72f8a
      David S. Miller authored
      
      
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf-next 2020-07-21
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      We've added 46 non-merge commits during the last 6 day(s) which contain
      a total of 68 files changed, 4929 insertions(+), 526 deletions(-).
      
      The main changes are:
      
      1) Run BPF program on socket lookup, from Jakub.
      
      2) Introduce cpumap, from Lorenzo.
      
      3) s390 JIT fixes, from Ilya.
      
      4) teach riscv JIT to emit compressed insns, from Luke.
      
      5) use build time computed BTF ids in bpf iter, from Yonghong.
      ====================
      
      Purely independent overlapping changes in both filter.h and xdp.h
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dee72f8a
  2. Jul 22, 2020