1. 27 Jun, 2019 26 commits
  2. 26 Jun, 2019 14 commits
    • David S. Miller's avatar
      Merge branch 'macb-build-fixes' · 8b89d8da
      David S. Miller authored
      Palmer Dabbelt says:
      
      ====================
      net: macb: Fix compilation on systems without COMMON_CLK, v2
      
      Our patch to add support for the FU540-C000 broke compilation on at
      least powerpc allyesconfig, which was found as part of the linux-next
      build regression tests.  This must have somehow slipped through the
      cracks, as the patch has been reverted in linux-next for a while now.
      This patch applies on top of the offending commit, which is the only one
      I've even tried it on as I'm not sure how this subsystem makes it to
      Linus.
      
      This patch set fixes the issue by adding a dependency of COMMON_CLK to
      the MACB Kconfig entry, which avoids the build failure by disabling MACB
      on systems where it wouldn't compile.  All known users of MACB have
      COMMON_CLK, so this shouldn't cause any issues.  This is a significantly
      simpler approach than disabling just the FU540-C000 support.
      
      I've also included a second patch to indicate this is a driver for a
      Cadence device that was originally written by an engineer at Atmel.  The
      only relation is that I stumbled across it when writing the first patch.
      
      Changes since v1 <20190624061603.1704-1-palmer@sifive.com>:
      
      * Disable MACB on systems without COMMON_CLK, instead of just disabling
        the FU540-C000 support on these systems.
      * Update the commit message to reflect the driver was written by Atmel.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b89d8da
    • Palmer Dabbelt's avatar
      net: macb: Kconfig: Rename Atmel to Cadence · 302a7cad
      Palmer Dabbelt authored
      The help text makes it look like NET_VENDOR_CADENCE enables support for
      Atmel devices, when in reality it's a driver written by Atmel that
      supports Cadence devices.  This may confuse users that have this device
      on a non-Atmel SoC.
      
      The fix is just s/Atmel/Cadence/, but I did go and re-wrap the Kconfig
      help text as that change caused it to go over 80 characters.
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      302a7cad
    • Palmer Dabbelt's avatar
      net: macb: Kconfig: Make MACB depend on COMMON_CLK · c536a9aa
      Palmer Dabbelt authored
      commit c218ad55 ("macb: Add support for SiFive FU540-C000") added a
      dependency on the common clock framework to the macb driver, but didn't
      express that dependency in Kconfig.  As a result macb now fails to
      compile on systems without COMMON_CLK, which specifically causes a build
      failure on powerpc allyesconfig.
      
      This patch adds the dependency, which results in the macb driver no
      longer being selectable on systems without the common clock framework.
      All known systems that have this device already support the common clock
      framework, so this should not cause trouble for any uses.  Supporting
      both the FU540-C000 and systems without COMMON_CLK is quite ugly.
      
      I've build tested this on powerpc allyesconfig and RISC-V defconfig
      (which selects MACB), but I have not even booted the resulting kernels.
      
      Fixes: c218ad55 ("macb: Add support for SiFive FU540-C000")
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c536a9aa
    • Dave Taht's avatar
      Allow 0.0.0.0/8 as a valid address range · 96125bf9
      Dave Taht authored
      The longstanding prohibition against using 0.0.0.0/8 dates back
      to two issues with the early internet.
      
      There was an interoperability problem with BSD 4.2 in 1984, fixed in
      BSD 4.3 in 1986. BSD 4.2 has long since been retired.
      
      Secondly, addresses of the form 0.x.y.z were initially defined only as
      a source address in an ICMP datagram, indicating "node number x.y.z on
      this IPv4 network", by nodes that know their address on their local
      network, but do not yet know their network prefix, in RFC0792 (page
      19).  This usage of 0.x.y.z was later repealed in RFC1122 (section
      3.2.2.7), because the original ICMP-based mechanism for learning the
      network prefix was unworkable on many networks such as Ethernet (which
      have longer addresses that would not fit into the 24 "node number"
      bits).  Modern networks use reverse ARP (RFC0903) or BOOTP (RFC0951)
      or DHCP (RFC2131) to find their full 32-bit address and CIDR netmask
      (and other parameters such as default gateways). 0.x.y.z has had
      16,777,215 addresses in 0.0.0.0/8 space left unused and reserved for
      future use, since 1989.
      
      This patch allows for these 16m new IPv4 addresses to appear within
      a box or on the wire. Layer 2 switches don't care.
      
      0.0.0.0/32 is still prohibited, of course.
      Signed-off-by: default avatarDave Taht <dave.taht@gmail.com>
      Signed-off-by: default avatarJohn Gilmore <gnu@toad.com>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96125bf9
    • David Ahern's avatar
      rtnetlink: skip metrics loop for dst_default_metrics · c22a133a
      David Ahern authored
      dst_default_metrics has all of the metrics initialized to 0, so nothing
      will be added to the skb in rtnetlink_put_metrics. Avoid the loop if
      metrics is from dst_default_metrics.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c22a133a
    • David S. Miller's avatar
      Merge branch 'skfp-cleanups' · 4191faa2
      David S. Miller authored
      Puranjay Mohan says:
      
      ====================
      net: fddi: skfp: Use PCI generic definitions instead of private duplicates
      
      This patch series removes the private duplicates of PCI definitions in
      favour of generic definitions defined in pci_regs.h.
      
      This driver only uses some of the generic PCI definitons,
      which are included from pci_regs.h and thier private versions
      are removed from skfbi.h with all other private defines.
      
      The skfbi.h defines PCI_REV_ID and other private defines with different
      names, these are renamed to Generic PCI names to make them
      compatible with defines in pci_regs.h.
      
      All unused defines are removed from skfbi.h.
      
      Changes in v5:
      Removed unused PCI definitions which were left in v4
      
      Changes in v4:
      Removed unused PCI definitions which were left in v3
      
      Changes in v3:
      Renamed all local PCI definitions to Generic names.
      Corrected coding style mistakes.
      
      Changes in v2:
      Converted individual patches to a series.
      Made sure that individual patches build correctly
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4191faa2
    • Puranjay Mohan's avatar
      net: fddi: skfp: Remove unused private PCI definitions · 3ce7ee2c
      Puranjay Mohan authored
      Remove unused private PCI definitions from skfbi.h because generic PCI
      symbols are already included from pci_regs.h.
      Signed-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ce7ee2c
    • Puranjay Mohan's avatar
      net: fddi: skfp: Include generic PCI definitions · a08f1c43
      Puranjay Mohan authored
      Include the uapi/linux/pci_regs.h header file which contains the generic
      PCI defines.
      Signed-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a08f1c43
    • Puranjay Mohan's avatar
      net: fddi: skfp: Rename local PCI defines to match generic PCI defines · f8da5dac
      Puranjay Mohan authored
      Rename the PCI_REV_ID and other local defines to Generic PCI define names
      in skfbi.h and drvfbi.c to make it compatible with the pci_regs.h.
      Signed-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f8da5dac
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-next-for-davem-2019-06-26' of... · a8b79105
      David S. Miller authored
      Merge tag 'wireless-drivers-next-for-davem-2019-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valu says:
      
      ====================
      wireless-drivers-next patches for 5.3
      
      First set of patches for 5.3, but not that many patches this time.
      
      This pull request fails to compile with the tip tree due to
      ktime_get_boot_ns() API changes there. It should be easy for Linus to
      fix it in p54 driver once he pulls this, an example resolution here:
      
      https://lkml.kernel.org/r/20190625160432.533aa140@canb.auug.org.au
      
      Major changes:
      
      airo
      
      * switch to use skcipher interface
      
      p54
      
      * support boottime in scan results
      
      rtw88
      
      * add fast xmit support
      
      * add random mac address on scan support
      
      rt2x00
      
      * add software watchdog to detect hangs, it's disabled by default
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8b79105
    • Gustavo A. R. Silva's avatar
      i40e/i40e_virtchnl_pf: Use struct_size() in kzalloc() · fae6cad1
      Gustavo A. R. Silva authored
      One of the more common cases of allocation size calculations is finding
      the size of a structure that has a zero-sized array at the end, along
      with memory for some number of elements for that array. For example:
      
      struct virtchnl_iwarp_qvlist_info {
      	...
              struct virtchnl_iwarp_qv_info qv_info[1];
      };
      
      size = sizeof(struct virtchnl_iwarp_qvlist_info) + (sizeof(struct virtchnl_iwarp_qv_info) * count;
      instance = kzalloc(size, GFP_KERNEL);
      
      and
      
      struct virtchnl_vf_resource {
      	...
              struct virtchnl_vsi_resource vsi_res[1];
      };
      
      size = sizeof(struct virtchnl_vf_resource) + sizeof(struct virtchnl_vsi_resource) * count;
      instance = kzalloc(size, GFP_KERNEL);
      
      Instead of leaving these open-coded and prone to type mistakes, we can
      now use the new struct_size() helper:
      
      instance = kzalloc(struct_size(instance, qv_info, count), GFP_KERNEL);
      
      and
      
      instance = kzalloc(struct_size(instance, vsi_res, count), GFP_KERNEL);
      
      Notice that, in the first case above, variable size is not necessary, hence it
      is removed.
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: default avatar"Gustavo A. R. Silva" <gustavo@embeddedor.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      fae6cad1
    • Alice Michael's avatar
      i40e: update copyright string · 559ac25c
      Alice Michael authored
      It was found that the string that prints our copyright was
      not up to date.  Updating to reflect our copyright.
      Signed-off-by: default avatarAlice Michael <alice.michael@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      559ac25c
    • Maciej Fijalkowski's avatar
      i40e: Fix descriptor count manipulation · 15369ac3
      Maciej Fijalkowski authored
      Changing descriptor count via 'ethtool -G' is not persistent across resets.
      When PF reset occurs, we roll back to the default value of vsi->num_desc,
      which is used then in i40e_alloc_rings to set descriptor count. XDP does a
      PF reset so when user has changed the descriptor count and load XDP
      program, the default count will be back there.
      
      To fix this:
        * introduce new VSI members - num_tx_desc and num_rx_desc in favour of
          num_desc
        * set them in i40e_set_ringparam to user's values
        * set them to default values in i40e_set_num_rings_in_vsi only when they
          don't have previous values
      Signed-off-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      15369ac3
    • Aleksandr Loktionov's avatar
      i40e: missing priorities for any QoS traffic · ee02865e
      Aleksandr Loktionov authored
      This patch fixes reading f/w LLDP agent status at DCB init time.
      It's done by removing direct NVM reading in i40e_update_dcb_config()
      and checking whether f/w LLDP agent is disabled via
      I40E_FLAG_DISABLE_FW_LLDP flag in i40e_init_pf_dcb(). The function
      i40e_update_dcb_config() in i40e_main.c is a temporary solution which
      will be later renamed to i40e_init_dcb() in the i40e_dcb module. Also
      logging was extended to make visible if f/w LLDP agent is running or not
      and always log a message when DCB was not initialized. Without this
      patch for new f/w versions f/w LLDP agent status was always read
      from NVM as disabled and DCB initialization failed without
      clear reason in logs.
      Signed-off-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ee02865e