1. 22 2月, 2019 3 次提交
  2. 11 2月, 2019 2 次提交
    • J
      cfg80211: Use const more consistently in for_each_element macros · 7388afe0
      Jouni Malinen 提交于
      Enforce the first argument to be a correct type of a pointer to struct
      element and avoid unnecessary typecasts from const to non-const pointers
      (the change in validate_ie_attr() is needed to make this part work). In
      addition, avoid signed/unsigned comparison within for_each_element() and
      mark struct element packed just in case.
      Signed-off-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      7388afe0
    • J
      cfg80211: restore regulatory without calling userspace · e646a025
      Johannes Berg 提交于
      Jouni reports that in some cases it is possible that getting
      disconnected (or stopping AP, after previous patches) results
      in further operations hitting the window within the regulatory
      core restoring the regdomain to the defaults. The reason for
      this is that we have to call out to CRDA or otherwise do some
      asynchronous work, and thus can't do the restore atomically.
      
      However, we've previously seen all the data we need to do the
      restore, so we can hang on to that data and use it later for
      the restore. This makes the whole thing happen within a single
      locked section and thus atomic.
      
      However, we can't *always* do this - there are unfortunately
      cases where the restore needs to re-request, because this is
      also used (abused?) as an error recovery process, so make the
      new behaviour optional and only use it when doing a regular
      restore as described above.
      Reported-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e646a025
  3. 08 2月, 2019 17 次提交
  4. 04 2月, 2019 12 次提交
  5. 02 2月, 2019 6 次提交
    • J
      ethtool: add compat for devlink info · ddb6e99e
      Jakub Kicinski 提交于
      If driver did not fill the fw_version field, try to call into
      the new devlink get_info op and collect the versions that way.
      We assume ethtool was always reporting running versions.
      
      v4:
       - use IS_REACHABLE() to avoid problems with DEVLINK=m (kbuildbot).
      v3 (Jiri):
       - do a dump and then parse it instead of special handling;
       - concatenate all versions (well, all that fit :)).
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ddb6e99e
    • J
      devlink: add version reporting to devlink info API · fc6fae7d
      Jakub Kicinski 提交于
      ethtool -i has a few fixed-size fields which can be used to report
      firmware version and expansion ROM version. Unfortunately, modern
      hardware has more firmware components. There is usually some
      datapath microcode, management controller, PXE drivers, and a
      CPLD load. Running ethtool -i on modern controllers reveals the
      fact that vendors cram multiple values into firmware version field.
      
      Here are some examples from systems I could lay my hands on quickly:
      
      tg3:  "FFV20.2.17 bc 5720-v1.39"
      i40e: "6.01 0x800034a4 1.1747.0"
      nfp:  "0.0.3.5 0.25 sriov-2.1.16 nic"
      
      Add a new devlink API to allow retrieving multiple versions, and
      provide user-readable name for those versions.
      
      While at it break down the versions into three categories:
       - fixed - this is the board/fixed component version, usually vendors
                 report information like the board version in the PCI VPD,
                 but it will benefit from naming and common API as well;
       - running - this is the running firmware version;
       - stored - this is firmware in the flash, after firmware update
                  this value will reflect the flashed version, while the
                  running version may only be updated after reboot.
      
      v3:
       - add per-type helpers instead of using the special argument (Jiri).
      RFCv2:
       - remove the nesting in attr DEVLINK_ATTR_INFO_VERSIONS (now
         versions are mixed with other info attrs)l
       - have the driver report versions from the same callback as
         other info.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc6fae7d
    • J
      devlink: add device information API · f9cf2288
      Jakub Kicinski 提交于
      ethtool -i has served us well for a long time, but its showing
      its limitations more and more. The device information should
      also be reported per device not per-netdev.
      
      Lay foundation for a simple devlink-based way of reading device
      info. Add driver name and device serial number as initial pieces
      of information exposed via this new API.
      
      v3:
       - rename helpers (Jiri);
       - rename driver name attr (Jiri);
       - remove double spacing in commit message (Jiri).
      RFC v2:
       - wrap the skb into an opaque structure (Jiri);
       - allow the serial number of be any length (Jiri & Andrew);
       - add driver name (Jonathan).
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9cf2288
    • M
      ipconfig: add carrier_timeout kernel parameter · 3fc46fc9
      Martin Kepplinger 提交于
      commit 3fb72f1e ("ipconfig wait for carrier") added a
      "wait for carrier" policy, with a fixed worst case maximum wait
      of two minutes.
      
      Now make the wait for carrier timeout configurable on the kernel
      commandline and use the 120s as the default.
      
      The timeout messages introduced with
      commit 5e404cd6 ("ipconfig: add informative timeout messages while
      waiting for carrier") are done in a fixed interval of 20 seconds, just
      like they were before (240/12).
      Signed-off-by: NMartin Kepplinger <martin.kepplinger@ginzinger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3fc46fc9
    • G
      ipv4: fib: use struct_size() in kzalloc() · 1f533ba6
      Gustavo A. R. Silva 提交于
      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 foo {
          int stuff;
          struct boo entry[];
      };
      
      instance = kzalloc(sizeof(struct foo) + count * sizeof(struct boo), 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, entry, count), GFP_KERNEL);
      
      This code was detected with the help of Coccinelle.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f533ba6
    • D
      net: tls: Set async_capable for tls zerocopy only if we see EINPROGRESS · 5b053e12
      Dave Watson 提交于
      Currently we don't zerocopy if the crypto framework async bit is set.
      However some crypto algorithms (such as x86 AESNI) support async,
      but in the context of sendmsg, will never run asynchronously.  Instead,
      check for actual EINPROGRESS return code before assuming algorithm is
      async.
      Signed-off-by: NDave Watson <davejwatson@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b053e12