An error occurred fetching the project authors.
  1. 25 Mar, 2024 1 commit
  2. 02 Jan, 2024 1 commit
  3. 18 Dec, 2023 1 commit
    • Jesse Brandeburg's avatar
      ice: field prep conversion · 23eca34e
      Jesse Brandeburg authored
      Refactor ice driver to use FIELD_PREP(), which reduces lines of code
      and adds clarity of intent.
      
      This code was generated by the following coccinelle/spatch script and
      then manually repaired.
      
      Several places I changed to OR into a single variable with |= instead of
      using a multi-line statement with trailing OR operators, as it
      (subjectively) makes the code clearer.
      
      A local variable vmvf_and_timeout was created and used to avoid multiple
      logical ORs being __le16 converted, which shortened some lines and makes
      the code cleaner.
      
      Also clean up a couple of places where conversions were made to have the
      code read more clearly/consistently.
      
      @prep2@
      constant shift,mask;
      type T;
      expression a;
      @@
      -(((T)(a) << shift) & mask)
      +FIELD_PREP(mask, a)
      
      @prep@
      constant shift,mask;
      type T;
      expression a;
      @@
      -((T)((a) << shift) & mask)
      +FIELD_PREP(mask, a)
      
      Cc: Julia Lawall <Julia.Lawall@inria.fr>
      CC: Alexander Lobakin <aleksander.lobakin@intel.com>
      Reviewed-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      23eca34e
  4. 03 Oct, 2023 1 commit
  5. 17 Aug, 2023 2 commits
  6. 07 Aug, 2023 2 commits
  7. 27 Jul, 2023 2 commits
  8. 24 Jul, 2023 2 commits
  9. 22 Jun, 2023 1 commit
  10. 19 May, 2023 5 commits
  11. 28 Mar, 2023 1 commit
  12. 06 Feb, 2023 1 commit
  13. 20 Sep, 2022 1 commit
  14. 06 Sep, 2022 1 commit
  15. 18 Aug, 2022 1 commit
  16. 17 Aug, 2022 2 commits
  17. 28 Jul, 2022 1 commit
    • Michal Wilczynski's avatar
      ice: Introduce enabling promiscuous mode on multiple VF's · d7393425
      Michal Wilczynski authored
      In current implementation default VSI switch filter is only able to
      forward traffic to a single VSI. This limits promiscuous mode with
      private flag 'vf-true-promisc-support' to a single VF. Enabling it on
      the second VF won't work. Also allmulticast support doesn't seem to be
      properly implemented when vf-true-promisc-support is true.
      
      Use standard ice_add_rule_internal() function that already implements
      forwarding to multiple VSI's instead of constructing AQ call manually.
      
      Add switch filter for allmulticast mode when vf-true-promisc-support is
      enabled. The same filter is added regardless of the flag - it doesn't
      matter for this case.
      
      Remove unnecessary fields in switch structure. From now on book keeping
      will be done by ice_add_rule_internal().
      
      Refactor unnecessarily passed function arguments.
      
      To test:
      1) Create 2 VM's, and two VF's. Attach VF's to VM's.
      2) Enable promiscuous mode on both of them and check if
         traffic is seen on both of them.
      Signed-off-by: default avatarMichal Wilczynski <michal.wilczynski@intel.com>
      Tested-by: default avatarMarek Szlosek <marek.szlosek@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      d7393425
  18. 26 Jul, 2022 1 commit
    • Marcin Szycik's avatar
      ice: Add support for PPPoE hardware offload · cd8efeee
      Marcin Szycik authored
      Add support for creating PPPoE filters in switchdev mode. Add support
      for parsing PPPoE and PPP-specific tc options: pppoe_sid and ppp_proto.
      
      Example filter:
      tc filter add dev $PF1 ingress protocol ppp_ses prio 1 flower pppoe_sid \
          1234 ppp_proto ip skip_sw action mirred egress redirect dev $VF1_PR
      
      Changes in iproute2 are required to use the new fields.
      
      ICE COMMS DDP package is required to create a filter as it contains PPPoE
      profiles. Added a warning message when loaded DDP package does not contain
      required profiles.
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      cd8efeee
  19. 01 Jul, 2022 1 commit
    • Alexander Lobakin's avatar
      net/ice: fix initializing the bitmap in the switch code · 2f7ee2a7
      Alexander Lobakin authored
      Kbuild spotted the following bug during the testing of one of
      the optimizations:
      
      In file included from include/linux/cpumask.h:12,
      [...]
                      from drivers/net/ethernet/intel/ice/ice_switch.c:4:
      drivers/net/ethernet/intel/ice/ice_switch.c: In function 'ice_find_free_recp_res_idx.constprop':
      include/linux/bitmap.h:447:22: warning: 'possible_idx[0]' is used uninitialized [-Wuninitialized]
        447 |                 *map |= GENMASK(start + nbits - 1, start);
            |                      ^~
      In file included from drivers/net/ethernet/intel/ice/ice.h:7,
                       from drivers/net/ethernet/intel/ice/ice_lib.h:7,
                       from drivers/net/ethernet/intel/ice/ice_switch.c:4:
      drivers/net/ethernet/intel/ice/ice_switch.c:4929:24: note: 'possible_idx[0]' was declared here
       4929 |         DECLARE_BITMAP(possible_idx, ICE_MAX_FV_WORDS);
            |                        ^~~~~~~~~~~~
      include/linux/types.h:11:23: note: in definition of macro 'DECLARE_BITMAP'
         11 |         unsigned long name[BITS_TO_LONGS(bits)]
            |                       ^~~~
      
      %ICE_MAX_FV_WORDS is 48, so bitmap_set() here was initializing only
      48 bits, leaving a junk in the rest 16.
      It was previously hidden due to that filling 48 bits makes
      bitmap_set() call external __bitmap_set(), but after making it use
      plain bit arithmetics on small bitmaps, compilers started seeing
      the issue. It was still working because those 16 weren't used
      anywhere anyhow.
      bitmap_{clear,set}() are not really intended to initialize bitmaps,
      rather to modify already initialized ones, as they don't do anything
      past the passed number of bits. The correct function to do this in
      that particular case is bitmap_fill(), so use it here. It will do
      `*possible_idx = ~0UL` instead of `*possible_idx |= GENMASK(47, 0)`,
      not leaving anything in an undefined state.
      
      Fixes: fd2a6b71 ("ice: create advanced switch recipe")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      2f7ee2a7
  20. 30 Jun, 2022 3 commits
  21. 02 Jun, 2022 1 commit
    • Alexander Lobakin's avatar
      ice: fix access-beyond-end in the switch code · 6e1ff618
      Alexander Lobakin authored
      Global `-Warray-bounds` enablement revealed some problems, one of
      which is the way we define and use AQC rules messages.
      In fact, they have a shared header, followed by the actual message,
      which can be of one of several different formats. So it is
      straightforward enough to define that header as a separate struct
      and then embed it into message structures as needed, but currently
      all the formats reside in one union coupled with the header. Then,
      the code allocates only the memory needed for a particular message
      format, leaving the union potentially incomplete.
      There are no actual reads or writes beyond the end of an allocated
      chunk, but at the same time, the whole implementation is fragile and
      backed by an equilibrium rather than strong type and memory checks.
      
      Define the structures the other way around: one for the common
      header and the rest for the actual formats with the header embedded.
      There are no places where several union members would be used at the
      same time anyway. This allows to use proper struct_size() and let
      the compiler know what is going to be done.
      Finally, unsilence `-Warray-bounds` back for ice_switch.c.
      
      Other little things worth mentioning:
      * &ice_sw_rule_vsi_list_query is not used anywhere, remove it. It's
        weird anyway to talk to hardware with purely kernel types
        (bitmaps);
      * expand the ICE_SW_RULE_*_SIZE() macros to pass a structure
        variable name to struct_size() to let it do strict typechecking;
      * rename ice_sw_rule_lkup_rx_tx::hdr to ::hdr_data to keep ::hdr
        for the header structure to have the same name for it constistenly
        everywhere;
      * drop the duplicate of %ICE_SW_RULE_RX_TX_NO_HDR_SIZE residing in
        ice_switch.h.
      
      Fixes: 9daf8208 ("ice: Add support for switch filter programming")
      Fixes: 66486d89 ("ice: replace single-element array used for C struct hack")
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Acked-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Link: https://lore.kernel.org/r/20220601105924.2841410-1-alexandr.lobakin@intel.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      6e1ff618
  22. 05 May, 2022 1 commit
  23. 07 Apr, 2022 5 commits
  24. 16 Mar, 2022 1 commit
  25. 11 Mar, 2022 1 commit