1. 03 1月, 2017 1 次提交
    • S
      benet: stricter vxlan offloading check in be_features_check · 096de2f8
      Sabrina Dubroca 提交于
      When VXLAN offloading is enabled, be_features_check() tries to check if
      an encapsulated packet is indeed a VXLAN packet. The check is not strict
      enough, and considers any UDP-encapsulated ethernet frame with a 8-byte
      tunnel header as being VXLAN. Unfortunately, both GENEVE and VXLAN-GPE
      have a 8-byte header, so they get through this check.
      
      Force the UDP destination port to be the one that has been offloaded to
      hardware.
      
      Without this, GENEVE-encapsulated packets can end up having an incorrect
      checksum when both a GENEVE and a VXLAN (offloaded) tunnel are
      configured.
      
      This is similar to commit a547224d ("mlx4e: Do not attempt to
      offload VXLAN ports that are unrecognized").
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      096de2f8
  2. 17 11月, 2016 1 次提交
    • E
      be2net: do not call napi_hash_del() · ea339343
      Eric Dumazet 提交于
      Calling napi_hash_del() before netif_napi_del() is dangerous
      if a synchronize_rcu() is not enforced before NAPI struct freeing.
      
      Lets leave this detail to core networking stack and feel
      more comfortable.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Sathya Perla <sathya.perla@broadcom.com>
      Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
      Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Cc: Somnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea339343
  3. 21 10月, 2016 1 次提交
    • J
      ethernet: use net core MTU range checking in more drivers · d894be57
      Jarod Wilson 提交于
      Somehow, I missed a healthy number of ethernet drivers in the last pass.
      Most of these drivers either were in need of an updated max_mtu to make
      jumbo frames possible to enable again. In a few cases, also setting a
      different min_mtu to match previous lower bounds. There are also a few
      drivers that had no upper bounds checking, so they're getting a brand new
      ETH_MAX_MTU that is identical to IP_MAX_MTU, but accessible by includes
      all ethernet and ethernet-like drivers all have already.
      
      acenic:
      - min_mtu = 0, max_mtu = 9000
      
      amazon/ena:
      - min_mtu = 128, max_mtu = adapter->max_mtu
      
      amd/xgbe:
      - min_mtu = 0, max_mtu = 9000
      
      sb1250:
      - min_mtu = 0, max_mtu = 1518
      
      cxgb3:
      - min_mtu = 81, max_mtu = 65535
      
      cxgb4:
      - min_mtu = 81, max_mtu = 9600
      
      cxgb4vf:
      - min_mtu = 81, max_mtu = 65535
      
      benet:
      - min_mtu = 256, max_mtu = 9000
      
      ibmveth:
      - min_mtu = 68, max_mtu = 65535
      
      ibmvnic:
      - min_mtu = adapter->min_mtu, max_mtu = adapter->max_mtu
      - remove now redundant ibmvnic_change_mtu
      
      jme:
      - min_mtu = 1280, max_mtu = 9202
      
      mv643xx_eth:
      - min_mtu = 64, max_mtu = 9500
      
      mlxsw:
      - min_mtu = 0, max_mtu = 65535
      - Basically bypassing the core checks, and instead relying on dynamic
        checks in the respective switch drivers' ndo_change_mtu functions
      
      ns83820:
      - min_mtu = 0
      - remove redundant ns83820_change_mtu, only checked for mtu > 1500
      
      netxen:
      - min_mtu = 0, max_mtu = 8000 (P2), max_mtu = 9600 (P3)
      
      qlge:
      - min_mtu = 1500, max_mtu = 9000
      - driver only supports setting mtu to 1500 or 9000, so the core check only
        rules out < 1500 and > 9000, qlge_change_mtu still needs to check that
        the value is 1500 or 9000
      
      qualcomm/emac:
      - min_mtu = 46, max_mtu = 9194
      
      xilinx_axienet:
      - min_mtu = 64, max_mtu = 9000
      
      Fixes: 61e84623 ("net: centralize net_device min/max MTU checking")
      CC: netdev@vger.kernel.org
      CC: Jes Sorensen <jes@trained-monkey.org>
      CC: Netanel Belgazal <netanel@annapurnalabs.com>
      CC: Tom Lendacky <thomas.lendacky@amd.com>
      CC: Santosh Raspatur <santosh@chelsio.com>
      CC: Hariprasad S <hariprasad@chelsio.com>
      CC: Sathya Perla <sathya.perla@broadcom.com>
      CC: Ajit Khaparde <ajit.khaparde@broadcom.com>
      CC: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      CC: Somnath Kotur <somnath.kotur@broadcom.com>
      CC: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
      CC: John Allen <jallen@linux.vnet.ibm.com>
      CC: Guo-Fu Tseng <cooldavid@cooldavid.org>
      CC: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      CC: Jiri Pirko <jiri@mellanox.com>
      CC: Ido Schimmel <idosch@mellanox.com>
      CC: Manish Chopra <manish.chopra@qlogic.com>
      CC: Sony Chacko <sony.chacko@qlogic.com>
      CC: Rajesh Borundia <rajesh.borundia@qlogic.com>
      CC: Timur Tabi <timur@codeaurora.org>
      CC: Anirudha Sarangi <anirudh@xilinx.com>
      CC: John Linn <John.Linn@xilinx.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d894be57
  4. 09 10月, 2016 1 次提交
  5. 26 9月, 2016 1 次提交
  6. 24 9月, 2016 1 次提交
    • M
      net: Update API for VF vlan protocol 802.1ad support · 79aab093
      Moshe Shemesh 提交于
      Introduce new rtnl UAPI that exposes a list of vlans per VF, giving
      the ability for user-space application to specify it for the VF, as an
      option to support 802.1ad.
      We adjusted IP Link tool to support this option.
      
      For future use cases, the new UAPI supports multiple vlans. For now we
      limit the list size to a single vlan in kernel.
      Add IFLA_VF_VLAN_LIST in addition to IFLA_VF_VLAN to keep backward
      compatibility with older versions of IP Link tool.
      
      Add a vlan protocol parameter to the ndo_set_vf_vlan callback.
      We kept 802.1Q as the drivers' default vlan protocol.
      Suitable ip link tool command examples:
        Set vf vlan protocol 802.1ad:
          ip link set eth0 vf 1 vlan 100 proto 802.1ad
        Set vf to VST (802.1Q) mode:
          ip link set eth0 vf 1 vlan 100 proto 802.1Q
        Or by omitting the new parameter
          ip link set eth0 vf 1 vlan 100
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79aab093
  7. 20 9月, 2016 1 次提交
    • B
      be2net: mark symbols static where possible · d766e7e6
      Baoyou Xie 提交于
      We get 4 warnings when building kernel with W=1:
      drivers/net/ethernet/emulex/benet/be_main.c:4368:6: warning: no previous prototype for 'be_calculate_pf_pool_rss_tables' [-Wmissing-prototypes]
      drivers/net/ethernet/emulex/benet/be_cmds.c:4385:5: warning: no previous prototype for 'be_get_nic_pf_num_list' [-Wmissing-prototypes]
      drivers/net/ethernet/emulex/benet/be_cmds.c:4537:6: warning: no previous prototype for 'be_reset_nic_desc' [-Wmissing-prototypes]
      drivers/net/ethernet/emulex/benet/be_cmds.c:4910:5: warning: no previous prototype for '__be_cmd_set_logical_link_config' [-Wmissing-prototypes]
      
      In fact, these functions are only used in the file in which they are
      declared and don't need a declaration, but can be made static.
      so this patch marks these functions with 'static'.
      Signed-off-by: NBaoyou Xie <baoyou.xie@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d766e7e6
  8. 08 9月, 2016 4 次提交
    • S
      be2net: Fix mac address collision in some configurations · c27ebf58
      Suresh Reddy 提交于
      If the device mac address is updated using ndo_set_mac_address(),
      while the same mac address is already programmed, the driver does not
      detect this condition if its netdev->dev_addr has been changed. The
      driver tries to add the same mac address resulting in mac address
      collision error. This has been observed in bonding mode-5 configuration.
      
      To fix this, store the mac address configured in HW in the adapter
      structure. Use this to compare against the new address being updated
      to avoid collision.
      Signed-off-by: NSuresh Reddy <Suresh.Reddy@broadcom.com>
      Signed-off-by: NSathya Perla <sathya.perla@broadcom.com>
      Signed-off-by: NSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c27ebf58
    • S
      be2net: Avoid redundant addition of mac address in HW · 988d44b1
      Suresh Reddy 提交于
      If a mac address is added to the uc_list and later the same mac address
      is added via ndo_set_mac_address() or vice versa, the driver does not
      detect this condition and tries to add it again. This results in a mac
      address collision error when the FW rejects it.
      
      Fix this by checking if the given mac address is present in uc_list while
      setting the device mac address and vice versa. Similarly skip deletion if
      the address is still in use in the other form.
      Signed-off-by: NSuresh Reddy <Suresh.Reddy@broadcom.com>
      Signed-off-by: NSathya Perla <sathya.perla@broadcom.com>
      Signed-off-by: NSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      988d44b1
    • S
      be2net: Issue COMMON_RESET_FUNCTION cmd during driver unload · f72099e0
      Somnath Kotur 提交于
      As per SLI guideline, drivers need to issue COMMON_RESET_FUNCTION SLI
      cmd during driver unload to clean up any non-persistent state
      information.
      Issue this cmd only if VFs are not assigned to VMs as it is possible
      for PF driver to unload while it\'s VF remains functional and assigned
      to a VM.
      Signed-off-by: NSomnath Kotur <somnath.kotur@broadcom.com>
      Signed-off-by: NSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f72099e0
    • S
      be2net: Support UE recovery in BEx/Skyhawk adapters · 710f3e59
      Sriharsha Basavapatna 提交于
      This patch supports recovery from UEs caused due to Transient Parity
      Errors (TPE), in BE2, BE3 and Skyhawk adapters. This change avoids
      system reboot when such errors occur. The driver recovers from these
      errors such that the adapter resumes full operational status as prior
      to the UE.
      
      Following is the list of changes in the driver to support this:
      
      o The driver registers its UE recoverable capability with ARM FW at init
      time. This also allows the driver to know if the feature is supported in
      the FW.
      
      o As the UE recovery requires precise time bound processing, the driver
      creates its own error recovery work queue with a single worker thread (per
      module, shared across functions).
      
      o Each function runs an error detection task at an interval of 1 second as
      required by the FW. The error detection logic already exists for BEx/SH,
      but it now runs in the context of a separate worker thread.
      
      o When an error is detected by the task, if it is recoverable, the PF0
      driver instance initiates a soft reset, while other PF driver instances
      wait for the reset to complete and the chip to become ready. Once
      the chip is ready, all driver instances including PF0, resume to
      reinitialize the respective functions.
      
      o The PF0 driver checks for some recovery criteria, to determine if the
      recovery can be initiated. If the criteria is not met, the PF0 driver does
      not initiate a soft reset, it retains the existing behavior to stop
      further processing and requires a reboot to get the chip to operational
      state again.
      
      o To allow each function to share the workq, while also making progress in
      its recovery process, a per-function recovery state machine is used.
      The per-function tasks avoid blocking operations like msleep() while in
      this state machine (until reinit state) and instead reschedule for the
      required delay.
      
      o With these changes, the existing error recovery code for Lancer also
      runs in the context of the new worker thread.
      Signed-off-by: NSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      710f3e59
  9. 09 8月, 2016 4 次提交
  10. 27 7月, 2016 1 次提交
  11. 30 6月, 2016 1 次提交
  12. 27 6月, 2016 4 次提交
  13. 18 6月, 2016 1 次提交
  14. 08 6月, 2016 3 次提交
    • S
      be2net: Fix provisioning of RSS for VFs in multi-partition configurations · de2b1e03
      Somnath Kotur 提交于
      Currently, we do not distribute queue resources to enable RSS for VFs
      in multi-channel/partition configurations.
      Fix this by having each PF(SRIOV capable) calculate it's share of the
      15 RSS Policy Tables available per port before provisioning resources for
      all the VFs.
      This  proportional share calculation is done based on division of the
      PF's MAX VFs with the Total MAX VFs on that port. It also needs to
      learn about the no: of NIC PFs on the port and subtract that from
      the 15 RSS Policy Tables on the port.
      Signed-off-by: NSomnath Kotur <somnath.kotur@emulex.com>
      Signed-off-by: NSathya Perla <sathya.perla@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de2b1e03
    • S
      be2net: Enable Wake-On-LAN from shutdown for Skyhawk · 45f13df7
      Sriharsha Basavapatna 提交于
      Skyhawk does support wake-up from ACPI shutdown state - S5, provided the
      platform supports it (like Auxiliary power source etc). The changes listed
      below are done to fix this.
      
      1) There's no need to defer the HW configuration of WOL to be_suspend().
      Remove this in be_suspend() and move it to be_set_wol() ethtool function
      so it is configured directly in the context of ethtool. This automatically
      takes care of the shutdown case.
      
      2) The driver incorrectly uses WOL_CAP field in the FW response to
      get_acpi_wol_cap() command, to determine if WOL is enabled. Instead the
      driver must rely on the macaddr field in the response to infer WOL state.
      
      3) In be_get_config() during init, if we find that WOL is enabled in FW,
      call pci_enable_wake() to enable pmcsr.pme_en bit. This is needed to
      support persistent WOL configuration provided by the FW in some platforms.
      
      4) Remove code in be_set_wol() that writes to PCICFG_PM_CONTROL_OFFSET
      to set pme_en bit; pci_enable_wake() sets that.
      
      Fixes: 028991e4 ("Enabling Wake-on-LAN is not supported in S5 state")
      Signed-off-by: NSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Signed-off-by: NSathya Perla <sathya.perla@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      45f13df7
    • S
      be2net: use max-TXQs limit too while provisioning VF queue pairs · b9263cbf
      Suresh Reddy 提交于
      When the PF driver provisions resources for VFs, it currently only looks
      at max RSS queues available to calculate the number of VF queue pairs.
      This logic breaks when there are less number of TX-queues than RSS-queues.
      This patch fixes this problem by using the max-TXQs available in the
      PF-pool in the calculations. As a part of this change the
      be_calculate_vf_qs() routine is renamed as be_calculate_vf_res() and the
      code that calculates limits on other related resources is moved here to
      contain all resource calculation code inside one routine.
      Signed-off-by: NSuresh Reddy <suresh.reddy@broadcom.com>
      Signed-off-by: NSathya Perla <sathya.perla@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9263cbf
  15. 22 4月, 2016 1 次提交
  16. 08 3月, 2016 1 次提交
  17. 04 3月, 2016 1 次提交
    • V
      be2net: don't enable multicast flag in be_enable_if_filters() routine · c1bb0a55
      Venkat Duvvuru 提交于
      When the interface is opened (in be_open()) the routine
      be_enable_if_filters() must be called to switch on the basic filtering
      capabilities of an interface that are not changed at run-time.
      These include the flags UNTAGGED, BROADCAST and PASS_L3L4_ERRORS.
      Other flags such as MULTICAST and PROMISC must be enabled later by
      be_set_rx_mode() based on the state in the netdev/adapter struct.
      
      be_enable_if_filters() routine is wrongly trying to enable MULTICAST flag
      without checking the current adapter state. This can cause the RX_FILTER
      cmds to the FW to fail.  This patch fixes this problem by only enabling
      the basic filtering flags in be_enable_if_filters().
      
      The VF must be able to issue RX_FILTER cmd with any filter flag, as long
      as the PF allowed those flags (if_cap_flags) in the iface it provisioned
      for the VF. This rule is applicable even when the VF doesn't have the
      FILTMGMT privilege. There is a bug in BE3 FW that wrongly fails RX_FILTER
      multicast programming cmds on VFs that don't have FILTMGMT privilege.
      This patch also helps in insulating the VF driver from be_open failures due
      to the FW bug. A fix for the BE3 FW issue will be available in
      versions >= 11.0.283.0 and 10.6.334.0
      Reported-by: NIvan Vecera <ivecera@redhat.com>
      Signed-off-by: NVenkat Duvvuru <venkatkumar.duvvuru@avagotech.com>
      Signed-off-by: NSathya Perla <sathya.perla@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1bb0a55
  18. 25 2月, 2016 2 次提交
  19. 20 2月, 2016 1 次提交
  20. 12 2月, 2016 1 次提交
  21. 11 2月, 2016 2 次提交
  22. 08 2月, 2016 5 次提交
  23. 20 1月, 2016 1 次提交
    • D
      RDMA/be2net: Remove open and close entry points · 9781808c
      Devesh Sharma 提交于
      Recently Dough Ledford reported a deadlock happening
      between ocrdma-load sequence and NetworkManager service
      issueing "open" on be2net interface.
      
      The deadlock happens when any be2net hook (e.g. open/close) is called
      in parallel to insmod ocrdma.ko.
      
      A. be2net is sending administrative open/close event to ocrdma holding
         device_list_mutex. It does this from ndo_open/ndo_stop hooks of be2net.
         So sequence of locks is rtnl_lock---> device_list lock
      
      B.  When new ocrdma roce device gets registered, infiniband stack now
          takes rtnl_lock in ib_register_device() in GID initialization routines.
          So sequence of locks in this path is device_list lock ---> rtnl_lock.
      
      This improper locking sequence causes deadlock.
      
      In order to resolve the above deadlock condition, ocrdma intorduced a
      patch to stop listening to administrative open/close events generated from
      be2net driver. It now depends on link-state-change async-event generated from
      CNA. This change leaves behind dead code which used to generate administrative
      open/close events. This patch cleans-up all that dead code from be2net.
      Reported-by: NDoug Ledford <dledford@redhat.com>
      CC: Sathya Perla <sathya.perla@avagotech.com>
      Signed-off-by: NPadmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>
      Signed-off-by: NSelvin Xavier <selvin.xavier@avagotech.com>
      Signed-off-by: NDevesh Sharma <devesh.sharma@avagotech.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      9781808c