1. 19 1月, 2019 23 次提交
    • D
      Merge branch 'Devlink-health-reporting-and-recovery-system' · 51a5365c
      David S. Miller 提交于
      Eran Ben Elisha says:
      
      ====================
      Devlink health reporting and recovery system
      
      The health mechanism is targeted for Real Time Alerting, in order to know when
      something bad had happened to a PCI device
      - Provide alert debug information
      - Self healing
      - If problem needs vendor support, provide a way to gather all needed debugging
        information.
      
      The main idea is to unify and centralize driver health reports in the
      generic devlink instance and allow the user to set different
      attributes of the health reporting and recovery procedures.
      
      The devlink health reporter:
      Device driver creates a "health reporter" per each error/health type.
      Error/Health type can be a known/generic (eg pci error, fw error, rx/tx error)
      or unknown (driver specific).
      For each registered health reporter a driver can issue error/health reports
      asynchronously. All health reports handling is done by devlink.
      Device driver can provide specific callbacks for each "health reporter", e.g.
       - Recovery procedures
       - Diagnostics and object dump procedures
       - OOB initial attributes
      Different parts of the driver can register different types of health reporters
      with different handlers.
      
      Once an error is reported, devlink health will do the following actions:
        * A log is being send to the kernel trace events buffer
        * Health status and statistics are being updated for the reporter instance
        * Object dump is being taken and saved at the reporter instance (as long as
          there is no other dump which is already stored)
        * Auto recovery attempt is being done. Depends on:
          - Auto-recovery configuration
          - Grace period vs. time passed since last recover
      
      The user interface:
      User can access/change each reporter attributes and driver specific callbacks
      via devlink, e.g per error type (per health reporter)
       - Configure reporter's generic attributes (like: Disable/enable auto recovery)
       - Invoke recovery procedure
       - Run diagnostics
       - Object dump
      
      The devlink health interface (via netlink):
      DEVLINK_CMD_HEALTH_REPORTER_GET
        Retrieves status and configuration info per DEV and reporter.
      DEVLINK_CMD_HEALTH_REPORTER_SET
        Allows reporter-related configuration setting.
      DEVLINK_CMD_HEALTH_REPORTER_RECOVER
        Triggers a reporter's recovery procedure.
      DEVLINK_CMD_HEALTH_REPORTER_DIAGNOSE
        Retrieves diagnostics data from a reporter on a device.
      DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET
        Retrieves the last stored dump. Devlink health
        saves a single dump. If an dump is not already stored by the devlink
        for this reporter, devlink generates a new dump.
        dump output is defined by the reporter.
      DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR
        Clears the last saved dump file for the specified reporter.
      
                                                     netlink
                                            +--------------------------+
                                            |                          |
                                            |            +             |
                                            |            |             |
                                            +--------------------------+
                                                         |request for ops
                                                         |(diagnose,
       mlx5_core                             devlink     |recover,
                                                         |dump)
      +--------+                            +--------------------------+
      |        |                            |    reporter|             |
      |        |                            |  +---------v----------+  |
      |        |   ops execution            |  |                    |  |
      |     <----------------------------------+                    |  |
      |        |                            |  |                    |  |
      |        |                            |  + ^------------------+  |
      |        |                            |    | request for ops     |
      |        |                            |    | (recover, dump)     |
      |        |                            |    |                     |
      |        |                            |  +-+------------------+  |
      |        |     health report          |  | health handler     |  |
      |        +------------------------------->                    |  |
      |        |                            |  +--------------------+  |
      |        |     health reporter create |                          |
      |        +---------------------------->                          |
      +--------+                            +--------------------------+
      
      In this patchset, mlx5e TX reporter is implemented.
      
      v2:
      - Remove FW* reporters to decrease the amount of patches in the patchset
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      51a5365c
    • A
      devlink: Add Documentation/networking/devlink-health.txt · b8c45a03
      Aya Levin 提交于
      This patch adds a new file to add information about devlink health
      mechanism.
      Signed-off-by: NAya Levin <ayal@mellanox.com>
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b8c45a03
    • E
      net/mlx5e: Add TX timeout support for mlx5e TX reporter · ce019faa
      Eran Ben Elisha 提交于
      With this patch, ndo_tx_timeout callback will be redirected to the TX
      reporter in order to detect a TX timeout error and report it to the
      devlink health. (The watchdog detects TX timeouts, but the driver verify
      the issue still exists before launching any recover method).
      
      In addition, recover from TX timeout in case of lost interrupt was added
      to the TX reporter recover method. The TX timeout recover from lost
      interrupt is not a new feature in the driver, this patch re-organize the
      functionality and move it to the TX reporter recovery flow.
      
      TX timeout example:
      (with auto_recover set to false, if set to true, the manual recover and
      diagnose sections are irrelevant)
      
      $cat /sys/kernel/debug/tracing/trace
      ...
      devlink_health_report: bus_name=pci dev_name=0000:00:09.0
      driver_name=mlx5_core reporter_name=TX: TX timeout on queue: 0, SQ: 0xd8a, CQ:
      0x406, SQ Cons: 0x2 SQ Prod: 0x2, usecs since last trans: 13972000
      
      $devlink health diagnose pci/0000:00:09 reporter TX
      SQ 0xd8a: HW state: 1, stopped: 1
      SQ 0xe44: HW state: 1, stopped: 0
      SQ 0xeb4: HW state: 1, stopped: 0
      SQ 0xf1f: HW state: 1, stopped: 0
      SQ 0xf80: HW state: 1, stopped: 0
      SQ 0xfe5: HW state: 1, stopped: 0
      
      $devlink health recover pci/0000:00:09 reporter TX
      $devlink health show
      pci/0000:00:09.0:
        name TX state healthy #err 1 #recover 1 last_dump_ts N/A dump_available false
          attributes:
              grace_period 500 auto_recover false
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ce019faa
    • E
      net/mlx5e: Add TX reporter support · aba25279
      Eran Ben Elisha 提交于
      Add mlx5e tx reporter to devlink health reporters. This reporter will be
      responsible for diagnosing, reporting and recovering of TX errors.
      This patch declares the TX reporter operations and allocate it using the
      devlink health API. Currently, this reporter supports reporting and
      recovering from send error CQE only. In addition, it adds diagnose
      information for the open SQs.
      
      For a local SQ recover (due to driver error report), in case of SQ recover
      failure, the recover operation will be considered as a failure.
      For a full TX recover, an attempt to close and open the channels will be
      done. If this one passed successfully, it will be considered as a
      successful recover.
      
      The SQ recover from error CQE flow is not a new feature in the driver,
      this patch re-organize the functions and adapt them for the devlink
      health API. For this purpose, move code from en_main.c to a new file
      named reporter_tx.c.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aba25279
    • E
      devlink: Add health dump {get,clear} commands · 12bd0dce
      Eran Ben Elisha 提交于
      Add devlink health dump commands, in order to run an dump operation
      over a specific reporter.
      
      The supported operations are dump_get in order to get last saved
      dump (if not exist, dump now) and dump_clear to clear last saved
      dump.
      
      It is expected from driver's callback for diagnose command to fill it
      via the buffer descriptors API. Devlink will parse it and convert it to
      netlink nla API in order to pass it to the user.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12bd0dce
    • E
      devlink: Add health diagnose command · 8a66704a
      Eran Ben Elisha 提交于
      Add devlink health diagnose command, in order to run a diagnose
      operation over a specific reporter.
      
      It is expected from driver's callback for diagnose command to fill it
      via the buffer descriptors API. Devlink will parse it and convert it to
      netlink nla API in order to pass it to the user.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a66704a
    • E
      devlink: Add health recover command · fcd852c6
      Eran Ben Elisha 提交于
      Add devlink health recover command to the uapi, in order to allow the user
      to execute a recover operation over a specific reporter.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fcd852c6
    • E
      devlink: Add health set command · 6f9d5613
      Eran Ben Elisha 提交于
      Add devlink health set command, in order to set configuration parameters
      for a specific reporter.
      Supported parameters are:
      - graceful_period: Time interval between auto recoveries (in msec)
      - auto_recover: Determines if the devlink shall execute recover upon
      		receiving error for the reporter
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f9d5613
    • E
      devlink: Add health get command · ff253fed
      Eran Ben Elisha 提交于
      Add devlink health get command to provide reporter/s data for user space.
      Add the ability to get data per reporter or dump data from all available
      reporters.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff253fed
    • E
      devlink: Add health report functionality · c7af343b
      Eran Ben Elisha 提交于
      Upon error discover, every driver can report it to the devlink health
      mechanism via devlink_health_report function, using the appropriate
      reporter registered to it. Driver can pass error specific context which
      will be delivered to it as part of the dump / recovery callbacks.
      
      Once an error is reported, devlink health will do the following actions:
      * A log is being send to the kernel trace events buffer
      * Health status and statistics are being updated for the reporter instance
      * Object dump is being taken and stored at the reporter instance (as long
        as there is no other dump which is already stored)
      * Auto recovery attempt is being done. depends on:
        - Auto Recovery configuration
        - Grace period vs. time since last recover
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c7af343b
    • E
      devlink: Add health reporter create/destroy functionality · 880ee82f
      Eran Ben Elisha 提交于
      Devlink health reporter is an instance for reporting, diagnosing and
      recovering from run time errors discovered by the reporters.
      Define it's data structure and supported operations.
      In addition, expose devlink API to create and destroy a reporter.
      Each devlink instance will hold it's own reporters list.
      
      As part of the allocation, driver shall provide a set of callbacks which
      will be used the devlink in order to handle health reports and user
      commands related to this reporter. In addition, driver is entitled to
      provide some priv pointer, which can be fetched from the reporter by
      devlink_health_reporter_priv function.
      
      For each reporter, devlink will hold a metadata of statistics,
      buffers and status.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      880ee82f
    • E
      devlink: Add health buffer support · cb5ccfbe
      Eran Ben Elisha 提交于
      Devlink health buffer is a mechanism to pass descriptors between drivers
      and devlink. The API allows the driver to add objects, object pair,
      value array (nested attributes), value and name.
      
      Driver can use this API to fill the buffers in a format which can be
      translated by the devlink to the netlink message.
      
      In order to fulfill it, an internal buffer descriptor is defined. This
      will hold the data and metadata per each attribute and by used to pass
      actual commands to the netlink.
      
      This mechanism will be later used in devlink health for dump and diagnose
      data store by the drivers.
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Reviewed-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cb5ccfbe
    • C
      net_sched: add hit counter for matchall · f88c19aa
      Cong Wang 提交于
      Although matchall always matches packets, however, it still
      relies on a protocol match first. So it is still useful to have
      such a counter for matchall. Of course, unlike u32, every time
      we hit a matchall filter, it is always a success, so we don't
      have to distinguish them.
      
      Sample output:
      
      filter protocol 802.1Q pref 100 matchall chain 0
      filter protocol 802.1Q pref 100 matchall chain 0 handle 0x1
        not_in_hw (rule hit 10)
      	action order 1: vlan  pop continue
      	 index 1 ref 1 bind 1 installed 40 sec used 1 sec
      	Action statistics:
      	Sent 836 bytes 10 pkt (dropped 0, overlimits 0 requeues 0)
      	backlog 0b 0p requeues 0
      Reported-by: NMartin Olsson <martin.olsson+netdev@sentorsecurity.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f88c19aa
    • D
      Merge branch 'phy-improve-stopping-PHY' · 209f94e6
      David S. Miller 提交于
      Heiner Kallweit says:
      
      ====================
      net: phy: improve stopping PHY
      
      This patchset improves and simplifies stopping the PHY.
      
      Heiner Kallweit (3):
        net: phy: stop PHY if needed when entering phy_disconnect
        net: phy: ensure phylib state machine is stopped after calling phy_stop
        net: phy: remove phy_stop_interrupts
      
      v2:
      - break down the patch to a patchset
      v3:
      - don't warn if driver didn't call phy_stop before phy_disconnect
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      209f94e6
    • H
      net: phy: remove phy_stop_interrupts · bb658ab7
      Heiner Kallweit 提交于
      Interrupts have been disabled in phy_stop() already. So we can remove
      phy_stop_interrupts() and free the interrupt in phy_disconnect()
      directly.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb658ab7
    • H
      net: phy: ensure phylib state machine is stopped after calling phy_stop · cbfd12b3
      Heiner Kallweit 提交于
      The call to the phylib state machine in phy_stop() just ensures that
      the state machine isn't re-triggered, but a state machine call may
      be scheduled already. So lets's call phy_stop_machine().
      This also allows to get rid of the call to phy_stop_machine() in
      phy_disconnect().
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cbfd12b3
    • H
      net: phy: stop PHY if needed when entering phy_disconnect · 472115d9
      Heiner Kallweit 提交于
      Stop PHY if needed when entering phy_disconnect. This allows drivers
      that don't need a separate call to phy_stop() to omit this call.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      472115d9
    • Y
      tcp: declare tcp_mmap() only when CONFIG_MMU is set · 340a6f3d
      Yafang Shao 提交于
      Since tcp_mmap() is defined when CONFIG_MMU is set.
      Signed-off-by: NYafang Shao <laoar.shao@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      340a6f3d
    • C
      net: jme: fix indentation issues · fb70950e
      Colin Ian King 提交于
      There are two lines that have indentation issues, fix these. Also remove
      an empty line.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fb70950e
    • C
      net: vxge: fix indentation issue · c0028696
      Colin Ian King 提交于
      There is a goto statement that indented too deeply, fix it.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0028696
    • H
      net: phy: improve get_phy_id · d8cce3a1
      Heiner Kallweit 提交于
      Only caller of get_phy_id() is get_phy_device(). There a PHY ID of
      0xffffffff is translated back to -ENODEV. So we can avoid some
      overhead by returning -ENODEV directly.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d8cce3a1
    • H
      net: phy: remove state PHY_CHANGELINK · e302c2a5
      Heiner Kallweit 提交于
      Since recent changes to the phylib state machine state PHY_CHANGELINK
      isn't used any longer. Therefore let's remove it.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e302c2a5
    • L
      net: ip6_gre: remove gre_hdr_len from ip6erspan_rcv · a057fed3
      Lorenzo Bianconi 提交于
      Remove gre_hdr_len from ip6erspan_rcv routine signature since
      it is not longer used
      Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a057fed3
  2. 18 1月, 2019 17 次提交