Skip to content
  1. Jun 02, 2018
  2. Jun 01, 2018
    • Maxime Chevallier's avatar
      net: mvpp2: Split the PPv2 driver to a dedicated directory · db9d7d36
      Maxime Chevallier authored
      
      
      As the mvpp2 driver is growing, move this driver to a dedicated
      directory and split it into several files.
      
      Since this driver has a lot of register defines and structure
      definitions, it can benefit from having all of this into a dedicated
      header file, named mvpp2.h.
      
      A good chunk of the mvpp2 code is dedicated to Header Parser handling, so
      we introduce mvpp2_prs.h where all Header Parser definitions are located,
      and mvpp2_prs.c containing the related code.
      
      In the same way, mvpp2_cls.h and mvpp2_cls.c are created to contain
      Classifier and RSS related code.
      
      The former 'mvpp2.c' file is renamed 'mvpp2_main.c' so that we can keep
      the driver binary named 'mvpp2'.
      
      This commit is only about spliting the driver into multiple files and
      doesn't introduce any new function, feature or fix besides removing
      'static' keywords when needed.
      
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Tested-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db9d7d36
    • Vlad Buslov's avatar
      net: sched: split tc_ctl_tfilter into three handlers · c431f89b
      Vlad Buslov authored
      
      
      tc_ctl_tfilter handles three netlink message types: RTM_NEWTFILTER,
      RTM_DELTFILTER, RTM_GETTFILTER. However, implementation of this function
      involves a lot of branching on specific message type because most of the
      code is message-specific. This significantly complicates adding new
      functionality and doesn't provide much benefit of code reuse.
      
      Split tc_ctl_tfilter to three standalone functions that handle filter new,
      delete and get requests.
      
      The only truly protocol independent part of tc_ctl_tfilter is code that
      looks up queue, class, and block. Refactor this code to standalone
      tcf_block_find function that is used by all three new handlers.
      
      Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c431f89b
    • Prashant Bhole's avatar
      rtnetlink: Fix null-ptr-deref in rtnl_newlink · af066ed3
      Prashant Bhole authored
      In rtnl_newlink(), NULL check is performed on m_ops however member of
      ops is accessed. Fixed by accessing member of m_ops instead of ops.
      
      [  345.432629] BUG: KASAN: null-ptr-deref in rtnl_newlink+0x400/0x1110
      [  345.432629] Read of size 4 at addr 0000000000000088 by task ip/986
      [  345.432629]
      [  345.432629] CPU: 1 PID: 986 Comm: ip Not tainted 4.17.0-rc6+ #9
      [  345.432629] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
      [  345.432629] Call Trace:
      [  345.432629]  dump_stack+0xc6/0x150
      [  345.432629]  ? dump_stack_print_info.cold.0+0x1b/0x1b
      [  345.432629]  ? kasan_report+0xb4/0x410
      [  345.432629]  kasan_report.cold.4+0x8f/0x91
      [  345.432629]  ? rtnl_newlink+0x400/0x1110
      [  345.432629]  rtnl_newlink+0x400/0x1110
      [...]
      
      Fixes: ccf8dbcd
      
       ("rtnetlink: Remove VLA usage")
      Signed-off-by: default avatarPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
      Tested-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af066ed3
    • Wei Yongjun's avatar
      virtio_net: fix error return code in virtnet_probe() · 4b8e6ac4
      Wei Yongjun authored
      Fix to return a negative error code from the failover create fail error
      handling case instead of 0, as done elsewhere in this function.
      
      Fixes: ba5e4426
      
       ("virtio_net: Extend virtio to use VF datapath when available")
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b8e6ac4
    • Kees Cook's avatar
      rtnetlink: Remove VLA usage · ccf8dbcd
      Kees Cook authored
      In the quest to remove all stack VLA usage from the kernel[1], this
      allocates the maximum size expected for all possible types and adds
      sanity-checks at both registration and usage to make sure nothing gets
      out of sync. This matches the proposed VLA solution for nfnetlink[2]. The
      values chosen here were based on finding assignments for .maxtype and
      .slave_maxtype and manually counting the enums:
      
      slave_maxtype (max 33):
      	IFLA_BRPORT_MAX     33
      	IFLA_BOND_SLAVE_MAX  9
      
      maxtype (max 45):
      	IFLA_BOND_MAX       28
      	IFLA_BR_MAX         45
      	__IFLA_CAIF_HSI_MAX  8
      	IFLA_CAIF_MAX        4
      	IFLA_CAN_MAX        16
      	IFLA_GENEVE_MAX     12
      	IFLA_GRE_MAX        25
      	IFLA_GTP_MAX         5
      	IFLA_HSR_MAX         7
      	IFLA_IPOIB_MAX       4
      	IFLA_IPTUN_MAX      21
      	IFLA_IPVLAN_MAX      3
      	IFLA_MACSEC_MAX     15
      	IFLA_MACVLAN_MAX     7
      	IFLA_PPP_MAX         2
      	__IFLA_RMNET_MAX     4
      	IFLA_VLAN_MAX        6
      	IFLA_VRF_MAX         2
      	IFLA_VTI_MAX         7
      	IFLA_VXLAN_MAX      28
      	VETH_INFO_MAX        2
      	VXCAN_INFO_MAX       2
      
      This additionally changes maxtype and slave_maxtype fields to unsigned,
      since they're only ever using positive values.
      
      [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com
      [2] https://patchwork.kernel.org/patch/10439647/
      
      
      
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ccf8dbcd
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Be explicit about DT or pdata · 7bb8c996
      Andrew Lunn authored
      
      
      Make it explicit that either device tree is used or platform data.  If
      neither is available, abort the probe.
      
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Fixes: 877b7cb0
      
       ("net: dsa: mv88e6xxx: Add minimal platform_data support")
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7bb8c996
    • Arnd Bergmann's avatar
      net: ti: cpsw: include gpio/consumer.h · e2b3e493
      Arnd Bergmann authored
      On platforms that don't always enable CONFIG_GPIOLIB, we run into
      a build failure:
      
      drivers/net/ethernet/ti/cpsw.c: In function 'cpsw_probe':
      drivers/net/ethernet/ti/cpsw.c:3006:9: error: implicit declaration of function 'devm_gpiod_get_array_optional' [-Werror=implicit-function-declaration]
        mode = devm_gpiod_get_array_optional(&pdev->dev, "mode", GPIOD_OUT_LOW);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/ti/cpsw.c:3006:59: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'?
        mode = devm_gpiod_get_array_optional(&pdev->dev, "mode", GPIOD_OUT_LOW);
      
      Since we cannot rely on this to be visible from gpio.h, we have to include
      gpio/consumer.h directly.
      
      Fixes: 2652113f
      
       ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e2b3e493
    • David S. Miller's avatar
      Merge branch 'mlx5-new-device-events' · b009f1a2
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      Mellanox, mlx5 new device events
      
      The following series is for mlx5-next tree [1], it adds the support of two
      new device events, from Ilan Tayari:
      
      1. High temperature warnings.
      2. FPGA QP error event.
      
      In case of no objection this series will be applied to mlx5-next tree
      and will be sent later as a pull request to both rdma and net trees.
      
      [1] https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git/log/?h=mlx5-next
      
      
      
      v1->v2:
        - improve commit message of the FPGA QP error event patch.
      ====================
      
      Acked-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b009f1a2
    • Ilan Tayari's avatar
      net/mlx5: Add FPGA QP error event · 1f0cf89b
      Ilan Tayari authored
      
      
      The FPGA queue pair (QP) event fires whenever a QP on the FPGA
      transitions to the error state.
      
      At this stage, this event is unrecoverable, it may become recoverable
      in the future.
      
      Signed-off-by: default avatarIlan Tayari <ilant@mellanox.com>
      Signed-off-by: default avatarAdi Nissim <adin@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f0cf89b
    • Ilan Tayari's avatar
      net/mlx5: Add temperature warning event to log · 1865ea9a
      Ilan Tayari authored
      
      
      Temperature warning event is sent by FW to indicate high temperature
      as detected by one of the sensors on the board.
      Add handling of this event by writing the numbers of the alert sensors
      to the kernel log.
      
      Signed-off-by: default avatarIlan Tayari <ilant@mellanox.com>
      Signed-off-by: default avatarAdi Nissim <adin@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1865ea9a
    • Donald Sharp's avatar
      rtnetlink: Add more well known protocol values · 35aada99
      Donald Sharp authored
      
      
      FRRouting installs routes into the kernel associated with
      the originating protocol.  Add these values to the well
      known values in rtnetlink.h.
      
      Signed-off-by: default avatarDonald Sharp <sharpd@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      35aada99
    • Ganesh Goudar's avatar
      cxgb4: Add FORCE_PAUSE bit to 32 bit port caps · c5f732d7
      Ganesh Goudar authored
      
      
      Add FORCE_PAUSE bit to force local pause settings instead
      of using auto negotiated values.
      
      Signed-off-by: default avatarSantosh Rastapur <santosh@chelsio.com>
      Signed-off-by: default avatarCasey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5f732d7
    • David S. Miller's avatar
      Merge branch 'bridge-vlan-notify' · 9e7c5752
      David S. Miller authored
      Petr Machata says:
      
      ====================
      net: bridge: Notify about bridge VLANs
      
      In commit 946a11e7
      
       ("mlxsw: spectrum_span: Allow bridge for gretap
      mirror"), mlxsw got support for offloading mirror-to-gretap such that
      the underlay packet path involves a bridge. In that case, the offload is
      also influenced by PVID setting of said bridge. However, changes to VLAN
      configuration of the bridge itself do not generate switchdev
      notifications, so there's no mechanism to prod mlxsw to update the
      offload when these settings change.
      
      In this patchset, the problem is resolved by distributing the switchdev
      notification SWITCHDEV_OBJ_ID_PORT_VLAN also for configuration changes
      on bridge VLANs. Since stacked devices distribute the notification to
      lower devices, such event eventually reaches the driver, which can
      determine whether it's a bridge or port VLAN by inspecting orig_dev.
      
      To keep things consistent, the newly-distributed notifications observe
      the same protocol as the existing ones: dual prepare/commit, with
      -EOPNOTSUPP indicating lack of support, even though there's currently
      nothing to prepare for and nothing to support. Correspondingly, all
      switchdev drivers have been updated to return -EOPNOTSUPP for bridge
      VLAN notifications.
      
      In patches #1 and #2, the code base is changed to support the following
      additions: functions br_switchdev_port_vlan_add() and
      br_switchdev_port_vlan_del() are introduced to simplify sending
      notifications; and br_vlan_add_existing() is introduced to later make it
      simpler to add error-handling code for the case of configuring a
      preexisting VLAN on bridge CPU port.
      
      In patches #3-#6, respectively for mlxsw, rocker, DSA and DPAA2 ethsw,
      the new notifications (which are not enabled yet) are ignored to
      maintain the current behavior.
      
      In patch #7, the notification is actually enabled.
      
      In patch #8, mlxsw is changed to update offloads of mirror-to-gre also
      for bridge-related notifications.
      
      Changes from v3 to v4:
      
      - In patch #1, separate variable declarations from program logic.
      - Add patch #2.
      - In patch #7, add error handling around a newly-introduced call to
        br_switchdev_port_vlan_add().
      - Rephrase commit messages of patches #3-#6 to explain motivation for
        the change.
      
      Changes from v2 to v3:
      
      - Add a fallback definition for br_switchdev_port_obj_add() and
        br_switchdev_port_obj_del() when !CONFIG_NET_SWITCHDEV.
      
      Changes from v1 to v2:
      
      - Rename br_switchdev_port_obj_add() and br_switchdev_port_obj_del() to
        br_switchdev_port_vlan_add() and br_switchdev_port_vlan_del(), and
        move from br_vlan.c to br_switchdev.c.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e7c5752