Skip to content

Commit

Permalink
Merge tag 'net-6.10-rc0' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/netdev/net

Pull networking fixes from Jakub Kicinski:
 "Current release - regressions:

   - virtio_net: fix missed error path rtnl_unlock after control queue
     locking rework

  Current release - new code bugs:

   - bpf: fix KASAN slab-out-of-bounds in percpu_array_map_gen_lookup,
     caused by missing nested map handling

   - drv: dsa: correct initialization order for KSZ88x3 ports

  Previous releases - regressions:

   - af_packet: do not call packet_read_pending() from
     tpacket_destruct_skb() fix performance regression

   - ipv6: fix route deleting failure when metric equals 0, don't assume
     0 means not set / default in this case

  Previous releases - always broken:

   - bridge: couple of syzbot-driven fixes"

* tag 'net-6.10-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (30 commits)
  selftests: net: local_termination: annotate the expected failures
  net: dsa: microchip: Correct initialization order for KSZ88x3 ports
  MAINTAINERS: net: Update reviewers for TI's Ethernet drivers
  dt-bindings: net: ti: Update maintainers list
  l2tp: fix ICMP error handling for UDP-encap sockets
  net: txgbe: fix to control VLAN strip
  net: wangxun: match VLAN CTAG and STAG features
  net: wangxun: fix to change Rx features
  af_packet: do not call packet_read_pending() from tpacket_destruct_skb()
  virtio_net: Fix missed rtnl_unlock
  netrom: fix possible dead-lock in nr_rt_ioctl()
  idpf: don't skip over ethtool tcp-data-split setting
  dt-bindings: net: qcom: ethernet: Allow dma-coherent
  bonding: fix oops during rmmod
  net/ipv6: Fix route deleting failure when metric equals 0
  selftests/net: reduce xfrm_policy test time
  selftests/bpf: Adjust btf_dump test to reflect recent change in file_operations
  selftests/bpf: Adjust test_access_variable_array after a kernel function name change
  selftests/net/lib: no need to record ns name if it already exist
  net: qrtr: ns: Fix module refcnt
  ...
  • Loading branch information
torvalds committed May 18, 2024
2 parents 26aa834 + fe56d6e commit f08a1e9
Show file tree
Hide file tree
Showing 39 changed files with 304 additions and 110 deletions.
5 changes: 3 additions & 2 deletions Documentation/bpf/standardization/instruction-set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ Arithmetic instructions
``ALU`` uses 32-bit wide operands while ``ALU64`` uses 64-bit wide operands for
otherwise identical operations. ``ALU64`` instructions belong to the
base64 conformance group unless noted otherwise.
The 'code' field encodes the operation as below, where 'src' and 'dst' refer
to the values of the source and destination registers, respectively.
The 'code' field encodes the operation as below, where 'src' refers to the
the source operand and 'dst' refers to the value of the destination
register.

===== ===== ======= ==========================================================
name code offset description
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/net/qcom,ethqos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ properties:
iommus:
maxItems: 1

dma-coherent: true

phys: true

phy-names:
Expand Down
1 change: 0 additions & 1 deletion Documentation/devicetree/bindings/net/ti,cpsw-switch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ title: TI SoC Ethernet Switch Controller (CPSW)

maintainers:
- Siddharth Vadapalli <s-vadapalli@ti.com>
- Ravi Gunasekaran <r-gunasekaran@ti.com>
- Roger Quadros <rogerq@kernel.org>

description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ title: The TI AM654x/J721E/AM642x SoC Gigabit Ethernet MAC (Media Access Control

maintainers:
- Siddharth Vadapalli <s-vadapalli@ti.com>
- Ravi Gunasekaran <r-gunasekaran@ti.com>
- Roger Quadros <rogerq@kernel.org>

description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ title: The TI AM654x/J721E Common Platform Time Sync (CPTS) module

maintainers:
- Siddharth Vadapalli <s-vadapalli@ti.com>
- Ravi Gunasekaran <r-gunasekaran@ti.com>
- Roger Quadros <rogerq@kernel.org>

description: |+
Expand Down
3 changes: 1 addition & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3815,7 +3815,7 @@ F: arch/arm/net/
BPF JIT for ARM64
M: Daniel Borkmann <daniel@iogearbox.net>
M: Alexei Starovoitov <ast@kernel.org>
M: Zi Shen Lim <zlim.lnx@gmail.com>
M: Puranjay Mohan <puranjay@kernel.org>
L: bpf@vger.kernel.org
S: Supported
F: arch/arm64/net/
Expand Down Expand Up @@ -22392,7 +22392,6 @@ F: drivers/counter/ti-eqep.c

TI ETHERNET SWITCH DRIVER (CPSW)
R: Siddharth Vadapalli <s-vadapalli@ti.com>
R: Ravi Gunasekaran <r-gunasekaran@ti.com>
R: Roger Quadros <rogerq@kernel.org>
L: linux-omap@vger.kernel.org
L: netdev@vger.kernel.org
Expand Down
13 changes: 7 additions & 6 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6477,16 +6477,16 @@ static int __init bonding_init(void)
if (res)
goto out;

bond_create_debugfs();

res = register_pernet_subsys(&bond_net_ops);
if (res)
goto out;
goto err_net_ops;

res = bond_netlink_init();
if (res)
goto err_link;

bond_create_debugfs();

for (i = 0; i < max_bonds; i++) {
res = bond_create(&init_net, NULL);
if (res)
Expand All @@ -6501,10 +6501,11 @@ static int __init bonding_init(void)
out:
return res;
err:
bond_destroy_debugfs();
bond_netlink_fini();
err_link:
unregister_pernet_subsys(&bond_net_ops);
err_net_ops:
bond_destroy_debugfs();
goto out;

}
Expand All @@ -6513,11 +6514,11 @@ static void __exit bonding_exit(void)
{
unregister_netdevice_notifier(&bond_netdev_notifier);

bond_destroy_debugfs();

bond_netlink_fini();
unregister_pernet_subsys(&bond_net_ops);

bond_destroy_debugfs();

#ifdef CONFIG_NET_POLL_CONTROLLER
/* Make sure we don't have an imbalance on our netpoll blocking */
WARN_ON(atomic_read(&netpoll_block_tx));
Expand Down
10 changes: 10 additions & 0 deletions drivers/net/dsa/microchip/ksz_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,5 +805,15 @@ int ksz_dcb_init(struct ksz_device *dev)
if (ret)
return ret;

/* Enable 802.1p priority control on Port 2 during switch initialization.
* This setup is critical for the apptrust functionality on Port 1, which
* relies on the priority settings of Port 2. Note: Port 1 is naturally
* configured before Port 2, necessitating this configuration order.
*/
if (ksz_is_ksz88x3(dev))
return ksz_prmw8(dev, KSZ_PORT_2, KSZ8_REG_PORT_1_CTRL_0,
KSZ8_PORT_802_1P_ENABLE,
KSZ8_PORT_802_1P_ENABLE);

return 0;
}
3 changes: 2 additions & 1 deletion drivers/net/ethernet/intel/idpf/idpf_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ static int idpf_set_ringparam(struct net_device *netdev,
new_tx_count);

if (new_tx_count == vport->txq_desc_count &&
new_rx_count == vport->rxq_desc_count)
new_rx_count == vport->rxq_desc_count &&
kring->tcp_data_split == idpf_vport_get_hsplit(vport))
goto unlock_mutex;

if (!idpf_vport_set_hsplit(vport, kring->tcp_data_split)) {
Expand Down
18 changes: 1 addition & 17 deletions drivers/net/ethernet/micrel/ks8851_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,32 +328,24 @@ static irqreturn_t ks8851_irq(int irq, void *_ks)
{
struct ks8851_net *ks = _ks;
struct sk_buff_head rxq;
unsigned handled = 0;
unsigned long flags;
unsigned int status;
struct sk_buff *skb;

ks8851_lock(ks, &flags);

status = ks8851_rdreg16(ks, KS_ISR);
ks8851_wrreg16(ks, KS_ISR, status);

netif_dbg(ks, intr, ks->netdev,
"%s: status 0x%04x\n", __func__, status);

if (status & IRQ_LCI)
handled |= IRQ_LCI;

if (status & IRQ_LDI) {
u16 pmecr = ks8851_rdreg16(ks, KS_PMECR);
pmecr &= ~PMECR_WKEVT_MASK;
ks8851_wrreg16(ks, KS_PMECR, pmecr | PMECR_WKEVT_LINK);

handled |= IRQ_LDI;
}

if (status & IRQ_RXPSI)
handled |= IRQ_RXPSI;

if (status & IRQ_TXI) {
unsigned short tx_space = ks8851_rdreg16(ks, KS_TXMIR);

Expand All @@ -365,20 +357,12 @@ static irqreturn_t ks8851_irq(int irq, void *_ks)
if (netif_queue_stopped(ks->netdev))
netif_wake_queue(ks->netdev);
spin_unlock(&ks->statelock);

handled |= IRQ_TXI;
}

if (status & IRQ_RXI)
handled |= IRQ_RXI;

if (status & IRQ_SPIBEI) {
netdev_err(ks->netdev, "%s: spi bus error\n", __func__);
handled |= IRQ_SPIBEI;
}

ks8851_wrreg16(ks, KS_ISR, handled);

if (status & IRQ_RXI) {
/* the datasheet says to disable the rx interrupt during
* packet read-out, however we're masking the interrupt
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/ethernet/microchip/lan966x/lan966x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,6 @@ static int lan966x_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, lan966x);
lan966x->dev = &pdev->dev;

lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL);

if (!device_get_mac_address(&pdev->dev, mac_addr)) {
ether_addr_copy(lan966x->base_mac, mac_addr);
} else {
Expand Down Expand Up @@ -1179,6 +1177,8 @@ static int lan966x_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, -ENODEV,
"no ethernet-ports child found\n");

lan966x->debugfs_root = debugfs_create_dir("lan966x", NULL);

/* init switch */
lan966x_init(lan966x);
lan966x_stats_init(lan966x);
Expand Down Expand Up @@ -1257,6 +1257,8 @@ static int lan966x_probe(struct platform_device *pdev)
destroy_workqueue(lan966x->stats_queue);
mutex_destroy(&lan966x->stats_lock);

debugfs_remove_recursive(lan966x->debugfs_root);

return err;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/wangxun/libwx/wx_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,8 @@ int wx_sw_init(struct wx *wx)
return -ENOMEM;
}

bitmap_zero(wx->state, WX_STATE_NBITS);

return 0;
}
EXPORT_SYMBOL(wx_sw_init);
Expand Down
56 changes: 52 additions & 4 deletions drivers/net/ethernet/wangxun/libwx/wx_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2690,15 +2690,63 @@ int wx_set_features(struct net_device *netdev, netdev_features_t features)
wx->rss_enabled = false;
}

if (changed &
(NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_STAG_RX))
netdev->features = features;

if (wx->mac.type == wx_mac_sp && changed & NETIF_F_HW_VLAN_CTAG_RX)
wx->do_reset(netdev);
else if (changed & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER))
wx_set_rx_mode(netdev);

return 1;
return 0;
}
EXPORT_SYMBOL(wx_set_features);

#define NETIF_VLAN_STRIPPING_FEATURES (NETIF_F_HW_VLAN_CTAG_RX | \
NETIF_F_HW_VLAN_STAG_RX)

#define NETIF_VLAN_INSERTION_FEATURES (NETIF_F_HW_VLAN_CTAG_TX | \
NETIF_F_HW_VLAN_STAG_TX)

#define NETIF_VLAN_FILTERING_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \
NETIF_F_HW_VLAN_STAG_FILTER)

netdev_features_t wx_fix_features(struct net_device *netdev,
netdev_features_t features)
{
netdev_features_t changed = netdev->features ^ features;
struct wx *wx = netdev_priv(netdev);

if (changed & NETIF_VLAN_STRIPPING_FEATURES) {
if ((features & NETIF_VLAN_STRIPPING_FEATURES) != NETIF_VLAN_STRIPPING_FEATURES &&
(features & NETIF_VLAN_STRIPPING_FEATURES) != 0) {
features &= ~NETIF_VLAN_STRIPPING_FEATURES;
features |= netdev->features & NETIF_VLAN_STRIPPING_FEATURES;
wx_err(wx, "802.1Q and 802.1ad VLAN stripping must be either both on or both off.");
}
}

if (changed & NETIF_VLAN_INSERTION_FEATURES) {
if ((features & NETIF_VLAN_INSERTION_FEATURES) != NETIF_VLAN_INSERTION_FEATURES &&
(features & NETIF_VLAN_INSERTION_FEATURES) != 0) {
features &= ~NETIF_VLAN_INSERTION_FEATURES;
features |= netdev->features & NETIF_VLAN_INSERTION_FEATURES;
wx_err(wx, "802.1Q and 802.1ad VLAN insertion must be either both on or both off.");
}
}

if (changed & NETIF_VLAN_FILTERING_FEATURES) {
if ((features & NETIF_VLAN_FILTERING_FEATURES) != NETIF_VLAN_FILTERING_FEATURES &&
(features & NETIF_VLAN_FILTERING_FEATURES) != 0) {
features &= ~NETIF_VLAN_FILTERING_FEATURES;
features |= netdev->features & NETIF_VLAN_FILTERING_FEATURES;
wx_err(wx, "802.1Q and 802.1ad VLAN filtering must be either both on or both off.");
}
}

return features;
}
EXPORT_SYMBOL(wx_fix_features);

void wx_set_ring(struct wx *wx, u32 new_tx_count,
u32 new_rx_count, struct wx_ring *temp_ring)
{
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/wangxun/libwx/wx_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ int wx_setup_resources(struct wx *wx);
void wx_get_stats64(struct net_device *netdev,
struct rtnl_link_stats64 *stats);
int wx_set_features(struct net_device *netdev, netdev_features_t features);
netdev_features_t wx_fix_features(struct net_device *netdev,
netdev_features_t features);
void wx_set_ring(struct wx *wx, u32 new_tx_count,
u32 new_rx_count, struct wx_ring *temp_ring);

Expand Down
22 changes: 22 additions & 0 deletions drivers/net/ethernet/wangxun/libwx/wx_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,13 @@ struct wx_hw_stats {
u64 qmprc;
};

enum wx_state {
WX_STATE_RESETTING,
WX_STATE_NBITS, /* must be last */
};
struct wx {
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
DECLARE_BITMAP(state, WX_STATE_NBITS);

void *priv;
u8 __iomem *hw_addr;
Expand Down Expand Up @@ -1071,6 +1076,8 @@ struct wx {
u64 hw_csum_rx_good;
u64 hw_csum_rx_error;
u64 alloc_rx_buff_failed;

void (*do_reset)(struct net_device *netdev);
};

#define WX_INTR_ALL (~0ULL)
Expand Down Expand Up @@ -1131,4 +1138,19 @@ static inline struct wx *phylink_to_wx(struct phylink_config *config)
return container_of(config, struct wx, phylink_config);
}

static inline int wx_set_state_reset(struct wx *wx)
{
u8 timeout = 50;

while (test_and_set_bit(WX_STATE_RESETTING, wx->state)) {
timeout--;
if (!timeout)
return -EBUSY;

usleep_range(1000, 2000);
}

return 0;
}

#endif /* _WX_TYPE_H_ */
18 changes: 13 additions & 5 deletions drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int ngbe_set_ringparam(struct net_device *netdev,
struct wx *wx = netdev_priv(netdev);
u32 new_rx_count, new_tx_count;
struct wx_ring *temp_ring;
int i;
int i, err = 0;

new_tx_count = clamp_t(u32, ring->tx_pending, WX_MIN_TXD, WX_MAX_TXD);
new_tx_count = ALIGN(new_tx_count, WX_REQ_TX_DESCRIPTOR_MULTIPLE);
Expand All @@ -64,6 +64,10 @@ static int ngbe_set_ringparam(struct net_device *netdev,
new_rx_count == wx->rx_ring_count)
return 0;

err = wx_set_state_reset(wx);
if (err)
return err;

if (!netif_running(wx->netdev)) {
for (i = 0; i < wx->num_tx_queues; i++)
wx->tx_ring[i]->count = new_tx_count;
Expand All @@ -72,14 +76,16 @@ static int ngbe_set_ringparam(struct net_device *netdev,
wx->tx_ring_count = new_tx_count;
wx->rx_ring_count = new_rx_count;

return 0;
goto clear_reset;
}

/* allocate temporary buffer to store rings in */
i = max_t(int, wx->num_tx_queues, wx->num_rx_queues);
temp_ring = kvmalloc_array(i, sizeof(struct wx_ring), GFP_KERNEL);
if (!temp_ring)
return -ENOMEM;
if (!temp_ring) {
err = -ENOMEM;
goto clear_reset;
}

ngbe_down(wx);

Expand All @@ -89,7 +95,9 @@ static int ngbe_set_ringparam(struct net_device *netdev,
wx_configure(wx);
ngbe_up(wx);

return 0;
clear_reset:
clear_bit(WX_STATE_RESETTING, wx->state);
return err;
}

static int ngbe_set_channels(struct net_device *dev,
Expand Down
Loading

0 comments on commit f08a1e9

Please sign in to comment.