Commit aba74e63 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking fixes from Jakub Kicinski:
 "Including fixes from wireles and netfilter.

  Nothing major here. Over the last two weeks we gathered only around
  two-thirds of our normal weekly fix count, but delaying sending these
  until -rc7 seemed like a really bad idea.

  AFAIK we have no bugs under investigation. One or two reverts for
  stuff for which we haven't gotten a proper fix will likely come in the
  next PR.

  Current release - fix to a fix:

   - netfilter: nft_set_hash: unaligned atomic read on struct
     nft_set_ext

   - eth: gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup

  Previous releases - regressions:

   - net: reenable NETIF_F_IPV6_CSUM offload for BIG TCP packets

   - mptcp:
      - fix sleeping rcvmsg sleeping forever after bad recvbuffer adjust
      - fix TCP options overflow
      - prevent excessive coalescing on receive, fix throughput

   - net: fix memory leak in tcp_conn_request() if map insertion fails

   - wifi: cw1200: fix potential NULL dereference after conversion to
     GPIO descriptors

   - phy: micrel: dynamically control external clock of KSZ PHY, fix
     suspend behavior

  Previous releases - always broken:

   - af_packet: fix VLAN handling with MSG_PEEK

   - net: restrict SO_REUSEPORT to inet sockets

   - netdev-genl: avoid empty messages in NAPI get

   - dsa: microchip: fix set_ageing_time function on KSZ9477 and LAN937X

   - eth:
      - gve: XDP fixes around transmit, queue wakeup etc.
      - ti: icssg-prueth: fix firmware load sequence to prevent time
        jump which breaks timesync related operations

  Misc:

   - netlink: specs: mptcp: add missing attr and improve documentation"

* tag 'net-6.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (50 commits)
  net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init
  net: ti: icssg-prueth: Fix firmware load sequence.
  mptcp: prevent excessive coalescing on receive
  mptcp: don't always assume copied data in mptcp_cleanup_rbuf()
  mptcp: fix recvbuffer adjust on sleeping rcvmsg
  ila: serialize calls to nf_register_net_hooks()
  af_packet: fix vlan_get_protocol_dgram() vs MSG_PEEK
  af_packet: fix vlan_get_tci() vs MSG_PEEK
  net: wwan: iosm: Properly check for valid exec stage in ipc_mmio_init()
  net: restrict SO_REUSEPORT to inet sockets
  net: reenable NETIF_F_IPV6_CSUM offload for BIG TCP packets
  net: sfc: Correct key_len for efx_tc_ct_zone_ht_params
  net: wwan: t7xx: Fix FSM command timeout issue
  sky2: Add device ID 11ab:4373 for Marvell 88E8075
  mptcp: fix TCP options overflow.
  net: mv643xx_eth: fix an OF node reference leak
  gve: trigger RX NAPI instead of TX NAPI in gve_xsk_wakeup
  eth: bcmsysport: fix call balance of priv->clk handling routines
  net: llc: reset skb->transport_header
  netlink: specs: mptcp: fix missing doc
  ...
parents ee063c23 ce21419b
Loading
Loading
Loading
Loading
+31 −29
Original line number Diff line number Diff line
@@ -22,65 +22,67 @@ definitions:
      doc: unused event
     -
      name: created
      doc:
        token, family, saddr4 | saddr6, daddr4 | daddr6, sport, dport
      doc: >-
        A new MPTCP connection has been created. It is the good time to
        allocate memory and send ADD_ADDR if needed. Depending on the
        traffic-patterns it can take a long time until the
        MPTCP_EVENT_ESTABLISHED is sent.
        Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
        dport, server-side.
     -
      name: established
      doc:
        token, family, saddr4 | saddr6, daddr4 | daddr6, sport, dport
      doc: >-
        A MPTCP connection is established (can start new subflows).
        Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
        dport, server-side.
     -
      name: closed
      doc:
        token
      doc: >-
        A MPTCP connection has stopped.
        Attribute: token.
     -
      name: announced
      value: 6
      doc:
        token, rem_id, family, daddr4 | daddr6 [, dport]
      doc: >-
        A new address has been announced by the peer.
        Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
     -
      name: removed
      doc:
        token, rem_id
      doc: >-
        An address has been lost by the peer.
        Attributes: token, rem_id.
     -
      name: sub-established
      value: 10
      doc:
        token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | daddr6, sport,
        dport, backup, if_idx [, error]
      doc: >-
        A new subflow has been established. 'error' should not be set.
        Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
        daddr6, sport, dport, backup, if_idx [, error].
     -
      name: sub-closed
      doc:
        token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | daddr6, sport,
        dport, backup, if_idx [, error]
      doc: >-
        A subflow has been closed. An error (copy of sk_err) could be set if an
        error has been detected for this subflow.
        Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
        daddr6, sport, dport, backup, if_idx [, error].
     -
      name: sub-priority
      value: 13
      doc:
        token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | daddr6, sport,
        dport, backup, if_idx [, error]
      doc: >-
        The priority of a subflow has changed. 'error' should not be set.
        Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
        daddr6, sport, dport, backup, if_idx [, error].
     -
      name: listener-created
      value: 15
      doc:
        family, sport, saddr4 | saddr6
      doc: >-
        A new PM listener is created.
        Attributes: family, sport, saddr4 | saddr6.
     -
      name: listener-closed
      doc:
        family, sport, saddr4 | saddr6
      doc: >-
        A PM listener is closed.
        Attributes: family, sport, saddr4 | saddr6.

attribute-sets:
  -
@@ -307,7 +309,7 @@ operations:
           - addr
    -
      name: flush-addrs
      doc: flush addresses
      doc: Flush addresses
      attribute-set: endpoint
      dont-validate: [ strict ]
      flags: [ uns-admin-perm ]
@@ -351,7 +353,7 @@ operations:
            - addr-remote
    -
      name: announce
      doc: announce new sf
      doc: Announce new address
      attribute-set: attr
      dont-validate: [ strict ]
      flags: [ uns-admin-perm ]
@@ -362,7 +364,7 @@ operations:
            - token
    -
      name: remove
      doc: announce removal
      doc: Announce removal
      attribute-set: attr
      dont-validate: [ strict ]
      flags: [ uns-admin-perm ]
@@ -373,7 +375,7 @@ operations:
           - loc-id
    -
      name: subflow-create
      doc: todo
      doc: Create subflow
      attribute-set: attr
      dont-validate: [ strict ]
      flags: [ uns-admin-perm ]
@@ -385,7 +387,7 @@ operations:
            - addr-remote
    -
      name: subflow-destroy
      doc: todo
      doc: Destroy subflow
      attribute-set: attr
      dont-validate: [ strict ]
      flags: [ uns-admin-perm ]
+1 −0
Original line number Diff line number Diff line
@@ -3607,6 +3607,7 @@ F: drivers/phy/qualcomm/phy-ath79-usb.c
ATHEROS ATH GENERIC UTILITIES
M:	Kalle Valo <kvalo@kernel.org>
M:	Jeff Johnson <jjohnson@kernel.org>
L:	linux-wireless@vger.kernel.org
S:	Supported
F:	drivers/net/wireless/ath/*
+36 −11
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*
 * Microchip KSZ9477 switch driver main logic
 *
 * Copyright (C) 2017-2019 Microchip Technology Inc.
 * Copyright (C) 2017-2024 Microchip Technology Inc.
 */

#include <linux/kernel.h>
@@ -983,26 +983,51 @@ void ksz9477_get_caps(struct ksz_device *dev, int port,
int ksz9477_set_ageing_time(struct ksz_device *dev, unsigned int msecs)
{
	u32 secs = msecs / 1000;
	u8 value;
	u8 data;
	u8 data, mult, value;
	u32 max_val;
	int ret;

	value = FIELD_GET(SW_AGE_PERIOD_7_0_M, secs);
#define MAX_TIMER_VAL	((1 << 8) - 1)

	ret = ksz_write8(dev, REG_SW_LUE_CTRL_3, value);
	if (ret < 0)
		return ret;
	/* The aging timer comprises a 3-bit multiplier and an 8-bit second
	 * value.  Either of them cannot be zero.  The maximum timer is then
	 * 7 * 255 = 1785 seconds.
	 */
	if (!secs)
		secs = 1;

	data = FIELD_GET(SW_AGE_PERIOD_10_8_M, secs);
	/* Return error if too large. */
	else if (secs > 7 * MAX_TIMER_VAL)
		return -EINVAL;

	ret = ksz_read8(dev, REG_SW_LUE_CTRL_0, &value);
	if (ret < 0)
		return ret;

	/* Check whether there is need to update the multiplier. */
	mult = FIELD_GET(SW_AGE_CNT_M, value);
	max_val = MAX_TIMER_VAL;
	if (mult > 0) {
		/* Try to use the same multiplier already in the register as
		 * the hardware default uses multiplier 4 and 75 seconds for
		 * 300 seconds.
		 */
		max_val = DIV_ROUND_UP(secs, mult);
		if (max_val > MAX_TIMER_VAL || max_val * mult != secs)
			max_val = MAX_TIMER_VAL;
	}

	data = DIV_ROUND_UP(secs, max_val);
	if (mult != data) {
		value &= ~SW_AGE_CNT_M;
		value |= FIELD_PREP(SW_AGE_CNT_M, data);
		ret = ksz_write8(dev, REG_SW_LUE_CTRL_0, value);
		if (ret < 0)
			return ret;
	}

	return ksz_write8(dev, REG_SW_LUE_CTRL_0, value);
	value = DIV_ROUND_UP(secs, data);
	return ksz_write8(dev, REG_SW_LUE_CTRL_3, value);
}

void ksz9477_port_queue_split(struct ksz_device *dev, int port)
+1 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*
 * Microchip KSZ9477 register definitions
 *
 * Copyright (C) 2017-2018 Microchip Technology Inc.
 * Copyright (C) 2017-2024 Microchip Technology Inc.
 */

#ifndef __KSZ9477_REGS_H
@@ -165,8 +165,6 @@
#define SW_VLAN_ENABLE			BIT(7)
#define SW_DROP_INVALID_VID		BIT(6)
#define SW_AGE_CNT_M			GENMASK(5, 3)
#define SW_AGE_CNT_S			3
#define SW_AGE_PERIOD_10_8_M		GENMASK(10, 8)
#define SW_RESV_MCAST_ENABLE		BIT(2)
#define SW_HASH_OPTION_M		0x03
#define SW_HASH_OPTION_CRC		1
+59 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/* Microchip LAN937X switch driver main logic
 * Copyright (C) 2019-2022 Microchip Technology Inc.
 * Copyright (C) 2019-2024 Microchip Technology Inc.
 */
#include <linux/kernel.h>
#include <linux/module.h>
@@ -461,10 +461,66 @@ int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu)

int lan937x_set_ageing_time(struct ksz_device *dev, unsigned int msecs)
{
	u32 secs = msecs / 1000;
	u32 value;
	u8 data, mult, value8;
	bool in_msec = false;
	u32 max_val, value;
	u32 secs = msecs;
	int ret;

#define MAX_TIMER_VAL	((1 << 20) - 1)

	/* The aging timer comprises a 3-bit multiplier and a 20-bit second
	 * value.  Either of them cannot be zero.  The maximum timer is then
	 * 7 * 1048575 = 7340025 seconds.  As this value is too large for
	 * practical use it can be interpreted as microseconds, making the
	 * maximum timer 7340 seconds with finer control.  This allows for
	 * maximum 122 minutes compared to 29 minutes in KSZ9477 switch.
	 */
	if (msecs % 1000)
		in_msec = true;
	else
		secs /= 1000;
	if (!secs)
		secs = 1;

	/* Return error if too large. */
	else if (secs > 7 * MAX_TIMER_VAL)
		return -EINVAL;

	/* Configure how to interpret the number value. */
	ret = ksz_rmw8(dev, REG_SW_LUE_CTRL_2, SW_AGE_CNT_IN_MICROSEC,
		       in_msec ? SW_AGE_CNT_IN_MICROSEC : 0);
	if (ret < 0)
		return ret;

	ret = ksz_read8(dev, REG_SW_LUE_CTRL_0, &value8);
	if (ret < 0)
		return ret;

	/* Check whether there is need to update the multiplier. */
	mult = FIELD_GET(SW_AGE_CNT_M, value8);
	max_val = MAX_TIMER_VAL;
	if (mult > 0) {
		/* Try to use the same multiplier already in the register as
		 * the hardware default uses multiplier 4 and 75 seconds for
		 * 300 seconds.
		 */
		max_val = DIV_ROUND_UP(secs, mult);
		if (max_val > MAX_TIMER_VAL || max_val * mult != secs)
			max_val = MAX_TIMER_VAL;
	}

	data = DIV_ROUND_UP(secs, max_val);
	if (mult != data) {
		value8 &= ~SW_AGE_CNT_M;
		value8 |= FIELD_PREP(SW_AGE_CNT_M, data);
		ret = ksz_write8(dev, REG_SW_LUE_CTRL_0, value8);
		if (ret < 0)
			return ret;
	}

	secs = DIV_ROUND_UP(secs, data);

	value = FIELD_GET(SW_AGE_PERIOD_7_0_M, secs);

	ret = ksz_write8(dev, REG_SW_AGE_PERIOD__1, value);
Loading