1. 04 Apr, 2023 3 commits
    • Íñigo Huguet's avatar
      sfc: support unicast PTP · 49ed35a0
      Íñigo Huguet authored
      When sending a PTP event packet, add the correct filters that will make
      that future incoming unicast PTP event packets will be timestamped.
      The unicast address for the filter is gotten from the outgoing skb
      before sending it.
      
      Until now they were not timestamped because only filters that match with
      the PTP multicast addressed were being configured into the NIC for the
      PTP special channel. Packets received through different channels are not
      timestamped, getting "received SYNC without timestamp" error in ptp4l.
      
      Note that the inserted filters are never removed unless the NIC is stopped
      or reconfigured, so efx_ptp_stop is called. Removal of old filters will
      be handled by the next patch.
      
      Additionally, cleanup a bit efx_ptp_xmit_skb_mc to use the reverse xmas
      tree convention and remove an unnecessary assignment to rc variable in
      void function.
      Reported-by: default avatarYalin Li <yalli@redhat.com>
      Signed-off-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
      Reviewed-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      49ed35a0
    • Íñigo Huguet's avatar
      sfc: allow insertion of filters for unicast PTP · 75687cd0
      Íñigo Huguet authored
      Add a second list for unicast filters and generalize the
      efx_ptp_insert/remove_filters functions to allow acting in any of the 2
      lists.
      
      No filters for unicast are inserted yet. That will be done in the next
      patch.
      
      The reason to use 2 different lists instead of a single one is that, in
      next patches, we will want to check if unicast filters are already added
      and if they're expired. We don't need that for multicast filters.
      Reported-by: default avatarYalin Li <yalli@redhat.com>
      Signed-off-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
      Reviewed-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      75687cd0
    • Íñigo Huguet's avatar
      sfc: store PTP filters in a list · e790fc15
      Íñigo Huguet authored
      Instead of using a fixed sized array for the PTP filters, use a list.
      
      This is not actually necessary at this point because the filters for
      multicast PTP are a fixed number, but this is a preparation for the
      following patches adding support for unicast PTP.
      
      To avoid confusion with the new struct type efx_ptp_rxfilter, change the
      name of some local variables from rxfilter to spec, given they're of the
      type efx_filter_spec.
      Reported-by: default avatarYalin Li <yalli@redhat.com>
      Signed-off-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
      Reviewed-by: default avatarEdward Cree <ecree.xilinx@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e790fc15
  2. 03 Apr, 2023 31 commits
  3. 02 Apr, 2023 6 commits
    • Tom Rix's avatar
      net: alteon: remove unused len variable · 51aaa682
      Tom Rix authored
      clang with W=1 reports
      drivers/net/ethernet/alteon/acenic.c:2438:10: error: variable
        'len' set but not used [-Werror,-Wunused-but-set-variable]
                      int i, len = 0;
                             ^
      This variable is not used so remove it.
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      51aaa682
    • David S. Miller's avatar
      Merge branch 'mlxsw-transceiver-trip-points' · f85b8824
      David S. Miller authored
      Petr Machata says:
      
      ====================
      mlxsw: Use static trip points for transceiver modules
      
      Ido Schimmel writes:
      
      See patch #1 for motivation and implementation details.
      
      Patches #2-#3 are simple cleanups as a result of the changes in the
      first patch.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f85b8824
    • Ido Schimmel's avatar
      mlxsw: core_thermal: Simplify transceiver module get_temp() callback · cc19439f
      Ido Schimmel authored
      The get_temp() callback of a thermal zone associated with a transceiver
      module no longer needs to read the temperature thresholds of the module.
      Therefore, simplify the callback by only reading the temperature.
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cc19439f
    • Ido Schimmel's avatar
      mlxsw: core_thermal: Make mlxsw_thermal_module_init() void · c1536d85
      Ido Schimmel authored
      The function can no longer fail so make it void and remove the
      associated error path.
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1536d85
    • Ido Schimmel's avatar
      mlxsw: core_thermal: Use static trip points for transceiver modules · 5601ef91
      Ido Schimmel authored
      The driver registers a thermal zone for each transceiver module and
      tries to set the trip point temperatures according to the thresholds
      read from the transceiver. If a threshold cannot be read or if a
      transceiver is unplugged, the trip point temperature is set to zero,
      which means that it is disabled as far as the thermal subsystem is
      concerned.
      
      A recent change in the thermal core made it so that such trip points are
      no longer marked as disabled, which lead the thermal subsystem to
      incorrectly set the associated cooling devices to the their maximum
      state [1]. A fix to restore this behavior was merged in commit
      f1b80a38 ("thermal: core: Restore behavior regarding invalid trip
      points"). However, the thermal maintainer suggested to not rely on this
      behavior and instead always register a valid array of trip points [2].
      
      Therefore, create a static array of trip points with sane defaults
      (suggested by Vadim) and register it with the thermal zone of each
      transceiver module. User space can choose to override these defaults
      using the thermal zone sysfs interface since these files are writeable.
      
      Before:
      
       $ cat /sys/class/thermal/thermal_zone11/type
       mlxsw-module11
       $ cat /sys/class/thermal/thermal_zone11/trip_point_*_temp
       65000
       75000
       80000
      
      After:
      
       $ cat /sys/class/thermal/thermal_zone11/type
       mlxsw-module11
       $ cat /sys/class/thermal/thermal_zone11/trip_point_*_temp
       55000
       65000
       80000
      
      Also tested by reverting commit f1b80a38 ("thermal: core: Restore
      behavior regarding invalid trip points") and making sure that the
      associated cooling devices are not set to their maximum state.
      
      [1] https://lore.kernel.org/linux-pm/ZA3CFNhU4AbtsP4G@shredder/
      [2] https://lore.kernel.org/linux-pm/f78e6b70-a963-c0ca-a4b2-0d4c6aeef1fb@linaro.org/Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5601ef91
    • Jakub Kicinski's avatar
      net: minor reshuffle of napi_struct · dd2d6604
      Jakub Kicinski authored
      napi_id is read by GRO and drivers to mark skbs, and it currently
      sits at the end of the structure, in a mostly unused cache line.
      Move it up into a hole, and separate the clearly control path
      fields from the important ones.
      
      Before:
      
      struct napi_struct {
      	struct list_head           poll_list;            /*     0    16 */
      	long unsigned int          state;                /*    16     8 */
      	int                        weight;               /*    24     4 */
      	int                        defer_hard_irqs_count; /*    28     4 */
      	long unsigned int          gro_bitmask;          /*    32     8 */
      	int                        (*poll)(struct napi_struct *, int); /*    40     8 */
      	int                        poll_owner;           /*    48     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct net_device *        dev;                  /*    56     8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	struct gro_list            gro_hash[8];          /*    64   192 */
      	/* --- cacheline 4 boundary (256 bytes) --- */
      	struct sk_buff *           skb;                  /*   256     8 */
      	struct list_head           rx_list;              /*   264    16 */
      	int                        rx_count;             /*   280     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct hrtimer             timer;                /*   288    64 */
      
      	/* XXX last struct has 4 bytes of padding */
      
      	/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
      	struct list_head           dev_list;             /*   352    16 */
      	struct hlist_node          napi_hash_node;       /*   368    16 */
      	/* --- cacheline 6 boundary (384 bytes) --- */
      	unsigned int               napi_id;              /*   384     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct task_struct *       thread;               /*   392     8 */
      
      	/* size: 400, cachelines: 7, members: 17 */
      	/* sum members: 388, holes: 3, sum holes: 12 */
      	/* paddings: 1, sum paddings: 4 */
      	/* last cacheline: 16 bytes */
      };
      
      After:
      
      struct napi_struct {
      	struct list_head           poll_list;            /*     0    16 */
      	long unsigned int          state;                /*    16     8 */
      	int                        weight;               /*    24     4 */
      	int                        defer_hard_irqs_count; /*    28     4 */
      	long unsigned int          gro_bitmask;          /*    32     8 */
      	int                        (*poll)(struct napi_struct *, int); /*    40     8 */
      	int                        poll_owner;           /*    48     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct net_device *        dev;                  /*    56     8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	struct gro_list            gro_hash[8];          /*    64   192 */
      	/* --- cacheline 4 boundary (256 bytes) --- */
      	struct sk_buff *           skb;                  /*   256     8 */
      	struct list_head           rx_list;              /*   264    16 */
      	int                        rx_count;             /*   280     4 */
      	unsigned int               napi_id;              /*   284     4 */
      	struct hrtimer             timer;                /*   288    64 */
      
      	/* XXX last struct has 4 bytes of padding */
      
      	/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
      	struct task_struct *       thread;               /*   352     8 */
      	struct list_head           dev_list;             /*   360    16 */
      	struct hlist_node          napi_hash_node;       /*   376    16 */
      
      	/* size: 392, cachelines: 7, members: 17 */
      	/* sum members: 388, holes: 1, sum holes: 4 */
      	/* paddings: 1, sum paddings: 4 */
      	/* forced alignments: 1 */
      	/* last cacheline: 8 bytes */
      } __attribute__((__aligned__(8)));
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dd2d6604