1. 27 10月, 2017 1 次提交
  2. 24 10月, 2017 1 次提交
  3. 14 10月, 2017 1 次提交
    • A
      liquidio: fix timespec64_to_ns typo · e7ad9793
      Arnd Bergmann 提交于
      While experimenting with changes to the timekeeping code, I
      ran into a build error in the liquidio driver:
      
      drivers/net/ethernet/cavium/liquidio/lio_main.c: In function 'liquidio_ptp_settime':
      drivers/net/ethernet/cavium/liquidio/lio_main.c:1850:22: error: passing argument 1 of 'timespec_to_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
      
      The driver had a type mismatch since it was first merged, but
      this never caused problems because it is only built on 64-bit
      architectures that define timespec and timespec64 to the same
      type.
      
      If we ever want to compile-test the driver on 32-bit or change
      the way that 64-bit timespec64 is defined, we need to fix it,
      so let's just do it now.
      
      Fixes: f21fb3ed ("Add support of Cavium Liquidio ethernet adapters")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e7ad9793
  4. 26 9月, 2017 3 次提交
  5. 29 8月, 2017 1 次提交
    • Y
      smp: Avoid using two cache lines for struct call_single_data · 966a9671
      Ying Huang 提交于
      struct call_single_data is used in IPIs to transfer information between
      CPUs.  Its size is bigger than sizeof(unsigned long) and less than
      cache line size.  Currently it is not allocated with any explicit alignment
      requirements.  This makes it possible for allocated call_single_data to
      cross two cache lines, which results in double the number of the cache lines
      that need to be transferred among CPUs.
      
      This can be fixed by requiring call_single_data to be aligned with the
      size of call_single_data. Currently the size of call_single_data is the
      power of 2.  If we add new fields to call_single_data, we may need to
      add padding to make sure the size of new definition is the power of 2
      as well.
      
      Fortunately, this is enforced by GCC, which will report bad sizes.
      
      To set alignment requirements of call_single_data to the size of
      call_single_data, a struct definition and a typedef is used.
      
      To test the effect of the patch, I used the vm-scalability multiple
      thread swap test case (swap-w-seq-mt).  The test will create multiple
      threads and each thread will eat memory until all RAM and part of swap
      is used, so that huge number of IPIs are triggered when unmapping
      memory.  In the test, the throughput of memory writing improves ~5%
      compared with misaligned call_single_data, because of faster IPIs.
      Suggested-by: NPeter Zijlstra <peterz@infradead.org>
      Signed-off-by: NHuang, Ying <ying.huang@intel.com>
      [ Add call_single_data_t and align with size of call_single_data. ]
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Aaron Lu <aaron.lu@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/87bmnqd6lz.fsf@yhuang-mobile.sh.intel.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      966a9671
  6. 24 8月, 2017 1 次提交
  7. 21 8月, 2017 1 次提交
  8. 19 8月, 2017 3 次提交
  9. 16 8月, 2017 4 次提交
  10. 15 8月, 2017 10 次提交
  11. 12 8月, 2017 1 次提交
  12. 10 8月, 2017 1 次提交
  13. 09 8月, 2017 1 次提交
  14. 07 8月, 2017 1 次提交
  15. 03 8月, 2017 1 次提交
  16. 20 7月, 2017 1 次提交
    • G
      liquidio: lio_main: remove unnecessary static in setup_io_queues() · eb2b9874
      Gustavo A. R. Silva 提交于
      Remove unnecessary static on local variables cpu_id_modulus and cpu_id.
      Such variables are initialized before being used, on every execution
      path throughout the function. The static has no benefit and, removing
      it reduces the object file size.
      
      This issue was detected using Coccinelle and the following semantic patch:
      
      @bad exists@
      position p;
      identifier x;
      type T;
      @@
      
      static T x@p;
      ...
      x = <+...x...+>
      
      @@
      identifier x;
      expression e;
      type T;
      position p != bad.p;
      @@
      
      -static
       T x@p;
       ... when != x
           when strict
      ?x = e;
      
      In the following log you can see a significant difference in the object
      file size. Also, there is a significant difference in the bss segment.
      This log is the output of the size command, before and after the code
      change:
      
      before:
         text    data     bss     dec     hex filename
        78689   15272   27808  121769   1dba9 drivers/net/ethernet/cavium/liquidio/lio_main.o
      
      after:
         text    data     bss     dec     hex filename
        78667   15128   27680  121475   1da83 drivers/net/ethernet/cavium/liquidio/lio_main.o
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Acked-by: NFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb2b9874
  17. 19 6月, 2017 2 次提交
  18. 22 5月, 2017 1 次提交
  19. 18 5月, 2017 2 次提交
  20. 08 4月, 2017 1 次提交
    • F
      liquidio: fix VF incorrectly indicating that it successfully set its VLAN · 0c264588
      Felix Manlunas 提交于
      For security reasons, NIC firmware does not allow VF to set its VLAN if PF
      set it already.  Firmware allows VF to set its VLAN if PF did not set it.
      After the VF instructs the firmware to set the VLAN, VF always indicates
      (via return 0) that the operation is successful--even for the times when it
      isn't.
      
      Put in a mechanism for the VF's set VLAN function to receive the firmware
      response code, then make that function return -EPERM if the firmware
      forbids the operation.
      
      Make that mechanism available for other functions that may, in the future,
      be interested in receiving the response code from the firmware.  That
      mechanism involves adding new fields to struct octnic_ctrl_pkt, so make all
      users of struct octnic_ctrl_pkt initialize the struct to zero before using
      it; otherwise, the mechanism might act on uninitialized garbage.
      Signed-off-by: NFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: NDerek Chickles <derek.chickles@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c264588
  21. 07 4月, 2017 1 次提交
    • F
      liquidio: fix Octeon core watchdog timeout false alarm · bb54be58
      Felix Manlunas 提交于
      Detection of watchdog timeout of Octeon cores is flawed and susceptible to
      false alarms.  Refactor by removing the detection code, and in its place,
      leverage existing code that monitors for an indication from the NIC
      firmware that an Octeon core crashed; expand the meaning of the indication
      to "an Octeon core crashed or its watchdog timer expired".  Detection of
      watchdog timeout is now delegated to an exception handler in the NIC
      firmware; this is free of false alarms.
      
      Also if there's an Octeon core crash or watchdog timeout:
      (1) Disable VF Ethernet links.
      (2) Decrement the module refcount by an amount equal to the number of
          active VFs of the NIC whose Octeon core crashed or had a watchdog
          timeout.  The refcount will continue to reflect the active VFs of
          other liquidio NIC(s) (if present) whose Octeon cores are faultless.
      
      Item (2) is needed to avoid the case of not being able to unload the driver
      because the module refcount is stuck at some non-zero number.  There is
      code that, in normal cases, decrements the refcount upon receiving a
      message from the firmware that a VF driver was unloaded.  But in
      exceptional cases like an Octeon core crash or watchdog timeout, arrival of
      that particular message from the firmware might be unreliable.  That normal
      case code is changed to not touch the refcount in the exceptional case to
      avoid contention (over the refcount) with the liquidio_watchdog kernel
      thread who will carry out item (2).
      Signed-off-by: NFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: NDerek Chickles <derek.chickles@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb54be58
  22. 31 3月, 2017 1 次提交