Skip to content

Commit

Permalink
Merge tag 'net-6.12-rc1' 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 Paolo Abeni:
 "Including fixes from netfilter.

  It looks like that most people are still traveling: both the ML volume
  and the processing capacity are low.

  Previous releases - regressions:

    - netfilter:
        - nf_reject_ipv6: fix nf_reject_ip6_tcphdr_put()
        - nf_tables: keep deleted flowtable hooks until after RCU

    - tcp: check skb is non-NULL in tcp_rto_delta_us()

    - phy: aquantia: fix -ETIMEDOUT PHY probe failure when firmware not
      present

    - eth: virtio_net: fix mismatched buf address when unmapping for
      small packets

    - eth: stmmac: fix zero-division error when disabling tc cbs

    - eth: bonding: fix unnecessary warnings and logs from
      bond_xdp_get_xmit_slave()

  Previous releases - always broken:

    - netfilter:
        - fix clash resolution for bidirectional flows
        - fix allocation with no memcg accounting

    - eth: r8169: add tally counter fields added with RTL8125

    - eth: ravb: fix rx and tx frame size limit"

* tag 'net-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (35 commits)
  selftests: netfilter: Avoid hanging ipvs.sh
  kselftest: add test for nfqueue induced conntrack race
  netfilter: nfnetlink_queue: remove old clash resolution logic
  netfilter: nf_tables: missing objects with no memcg accounting
  netfilter: nf_tables: use rcu chain hook list iterator from netlink dump path
  netfilter: ctnetlink: compile ctnetlink_label_size with CONFIG_NF_CONNTRACK_EVENTS
  netfilter: nf_reject: Fix build warning when CONFIG_BRIDGE_NETFILTER=n
  netfilter: nf_tables: Keep deleted flowtable hooks until after RCU
  docs: tproxy: ignore non-transparent sockets in iptables
  netfilter: ctnetlink: Guard possible unused functions
  selftests: netfilter: nft_tproxy.sh: add tcp tests
  selftests: netfilter: add reverse-clash resolution test case
  netfilter: conntrack: add clash resolution for reverse collisions
  netfilter: nf_nat: don't try nat source port reallocation for reverse dir clash
  selftests/net: packetdrill: increase timing tolerance in debug mode
  usbnet: fix cyclical race on disconnect with work queue
  net: stmmac: set PP_FLAG_DMA_SYNC_DEV only if XDP is enabled
  virtio_net: Fix mismatched buf address when unmapping for small packets
  bonding: Fix unnecessary warnings and logs from bond_xdp_get_xmit_slave()
  r8169: add missing MODULE_FIRMWARE entry for RTL8126A rev.b
  ...
  • Loading branch information
Linus Torvalds committed Sep 26, 2024
2 parents 5e54664 + aef3a58 commit 62a0e2f
Show file tree
Hide file tree
Showing 41 changed files with 1,289 additions and 209 deletions.
2 changes: 1 addition & 1 deletion Documentation/networking/tproxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The idea is that you identify packets with destination address matching a local
socket on your box, set the packet mark to a certain value::

# iptables -t mangle -N DIVERT
# iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
# iptables -t mangle -A PREROUTING -p tcp -m socket --transparent -j DIVERT
# iptables -t mangle -A DIVERT -j MARK --set-mark 1
# iptables -t mangle -A DIVERT -j ACCEPT

Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -17316,8 +17316,8 @@ M: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
L: netdev@vger.kernel.org
S: Maintained
F: Documentation/networking/oa-tc6-framework.rst
F: drivers/include/linux/oa_tc6.h
F: drivers/net/ethernet/oa_tc6.c
F: include/linux/oa_tc6.h

OPEN FIRMWARE AND FLATTENED DEVICE TREE
M: Rob Herring <robh@kernel.org>
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5610,9 +5610,9 @@ bond_xdp_get_xmit_slave(struct net_device *bond_dev, struct xdp_buff *xdp)
break;

default:
/* Should never happen. Mode guarded by bond_xdp_check() */
netdev_err(bond_dev, "Unknown bonding mode %d for xdp xmit\n", BOND_MODE(bond));
WARN_ON_ONCE(1);
if (net_ratelimit())
netdev_err(bond_dev, "Unknown bonding mode %d for xdp xmit\n",
BOND_MODE(bond));
return NULL;
}

Expand Down
28 changes: 28 additions & 0 deletions drivers/net/ethernet/realtek/r8169_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,33 @@ struct rtl8169_counters {
__le32 rx_multicast;
__le16 tx_aborted;
__le16 tx_underrun;
/* new since RTL8125 */
__le64 tx_octets;
__le64 rx_octets;
__le64 rx_multicast64;
__le64 tx_unicast64;
__le64 tx_broadcast64;
__le64 tx_multicast64;
__le32 tx_pause_on;
__le32 tx_pause_off;
__le32 tx_pause_all;
__le32 tx_deferred;
__le32 tx_late_collision;
__le32 tx_all_collision;
__le32 tx_aborted32;
__le32 align_errors32;
__le32 rx_frame_too_long;
__le32 rx_runt;
__le32 rx_pause_on;
__le32 rx_pause_off;
__le32 rx_pause_all;
__le32 rx_unknown_opcode;
__le32 rx_mac_error;
__le32 tx_underrun32;
__le32 rx_mac_missed;
__le32 rx_tcam_dropped;
__le32 tdu;
__le32 rdu;
};

struct rtl8169_tc_offsets {
Expand Down Expand Up @@ -681,6 +708,7 @@ MODULE_FIRMWARE(FIRMWARE_8107E_2);
MODULE_FIRMWARE(FIRMWARE_8125A_3);
MODULE_FIRMWARE(FIRMWARE_8125B_2);
MODULE_FIRMWARE(FIRMWARE_8126A_2);
MODULE_FIRMWARE(FIRMWARE_8126A_3);

static inline struct device *tp_to_dev(struct rtl8169_private *tp)
{
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/renesas/ravb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ struct ravb_hw_info {
netdev_features_t net_features;
int stats_len;
u32 tccr_mask;
u32 tx_max_frame_size;
u32 rx_max_frame_size;
u32 rx_buffer_size;
u32 rx_desc_size;
Expand Down
18 changes: 15 additions & 3 deletions drivers/net/ethernet/renesas/ravb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,16 @@ static void ravb_emac_init_gbeth(struct net_device *ndev)

static void ravb_emac_init_rcar(struct net_device *ndev)
{
/* Receive frame limit set register */
ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
struct ravb_private *priv = netdev_priv(ndev);

/* Set receive frame length
*
* The length set here describes the frame from the destination address
* up to and including the CRC data. However only the frame data,
* excluding the CRC, are transferred to memory. To allow for the
* largest frames add the CRC length to the maximum Rx descriptor size.
*/
ravb_write(ndev, priv->info->rx_max_frame_size + ETH_FCS_LEN, RFLR);

/* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */
ravb_write(ndev, ECMR_ZPF | ECMR_DM |
Expand Down Expand Up @@ -2674,6 +2682,7 @@ static const struct ravb_hw_info ravb_gen2_hw_info = {
.net_features = NETIF_F_RXCSUM,
.stats_len = ARRAY_SIZE(ravb_gstrings_stats),
.tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
.tx_max_frame_size = SZ_2K,
.rx_max_frame_size = SZ_2K,
.rx_buffer_size = SZ_2K +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
Expand All @@ -2696,6 +2705,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
.net_features = NETIF_F_RXCSUM,
.stats_len = ARRAY_SIZE(ravb_gstrings_stats),
.tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
.tx_max_frame_size = SZ_2K,
.rx_max_frame_size = SZ_2K,
.rx_buffer_size = SZ_2K +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
Expand All @@ -2721,6 +2731,7 @@ static const struct ravb_hw_info ravb_gen4_hw_info = {
.net_features = NETIF_F_RXCSUM,
.stats_len = ARRAY_SIZE(ravb_gstrings_stats),
.tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
.tx_max_frame_size = SZ_2K,
.rx_max_frame_size = SZ_2K,
.rx_buffer_size = SZ_2K +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
Expand Down Expand Up @@ -2770,6 +2781,7 @@ static const struct ravb_hw_info gbeth_hw_info = {
.net_features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM,
.stats_len = ARRAY_SIZE(ravb_gstrings_stats_gbeth),
.tccr_mask = TCCR_TSRQ0,
.tx_max_frame_size = 1522,
.rx_max_frame_size = SZ_8K,
.rx_buffer_size = SZ_2K,
.rx_desc_size = sizeof(struct ravb_rx_desc),
Expand Down Expand Up @@ -2981,7 +2993,7 @@ static int ravb_probe(struct platform_device *pdev)
priv->avb_link_active_low =
of_property_read_bool(np, "renesas,ether-link-active-low");

ndev->max_mtu = info->rx_max_frame_size -
ndev->max_mtu = info->tx_max_frame_size -
(ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
ndev->min_mtu = ETH_MIN_MTU;

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/seeq/ether3.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,11 @@ static void ether3_remove(struct expansion_card *ec)
{
struct net_device *dev = ecard_get_drvdata(ec);

ether3_outw(priv(dev)->regs.config2 |= CFG2_CTRLO, REG_CONFIG2);
ecard_set_drvdata(ec, NULL);

unregister_netdev(dev);
del_timer_sync(&priv(dev)->timer);
free_netdev(dev);
ecard_release_resources(ec);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,7 @@ static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv,
rx_q->queue_index = queue;
rx_q->priv_data = priv;

pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
pp_params.flags = PP_FLAG_DMA_MAP | (xdp_prog ? PP_FLAG_DMA_SYNC_DEV : 0);
pp_params.pool_size = dma_conf->dma_rx_size;
num_pages = DIV_ROUND_UP(dma_conf->dma_buf_sz, PAGE_SIZE);
pp_params.order = ilog2(num_pages);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ static int tc_setup_cbs(struct stmmac_priv *priv,
return ret;

priv->plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB;
return 0;
}

/* Final adjustments for HW */
Expand Down
37 changes: 22 additions & 15 deletions drivers/net/ethernet/xilinx/xilinx_axienet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,15 +736,15 @@ static int axienet_device_reset(struct net_device *ndev)
*
* Would either be called after a successful transmit operation, or after
* there was an error when setting up the chain.
* Returns the number of descriptors handled.
* Returns the number of packets handled.
*/
static int axienet_free_tx_chain(struct axienet_local *lp, u32 first_bd,
int nr_bds, bool force, u32 *sizep, int budget)
{
struct axidma_bd *cur_p;
unsigned int status;
int i, packets = 0;
dma_addr_t phys;
int i;

for (i = 0; i < nr_bds; i++) {
cur_p = &lp->tx_bd_v[(first_bd + i) % lp->tx_bd_num];
Expand All @@ -763,8 +763,10 @@ static int axienet_free_tx_chain(struct axienet_local *lp, u32 first_bd,
(cur_p->cntrl & XAXIDMA_BD_CTRL_LENGTH_MASK),
DMA_TO_DEVICE);

if (cur_p->skb && (status & XAXIDMA_BD_STS_COMPLETE_MASK))
if (cur_p->skb && (status & XAXIDMA_BD_STS_COMPLETE_MASK)) {
napi_consume_skb(cur_p->skb, budget);
packets++;
}

cur_p->app0 = 0;
cur_p->app1 = 0;
Expand All @@ -780,7 +782,13 @@ static int axienet_free_tx_chain(struct axienet_local *lp, u32 first_bd,
*sizep += status & XAXIDMA_BD_STS_ACTUAL_LEN_MASK;
}

return i;
if (!force) {
lp->tx_bd_ci += i;
if (lp->tx_bd_ci >= lp->tx_bd_num)
lp->tx_bd_ci %= lp->tx_bd_num;
}

return packets;
}

/**
Expand Down Expand Up @@ -953,13 +961,10 @@ static int axienet_tx_poll(struct napi_struct *napi, int budget)
u32 size = 0;
int packets;

packets = axienet_free_tx_chain(lp, lp->tx_bd_ci, budget, false, &size, budget);
packets = axienet_free_tx_chain(lp, lp->tx_bd_ci, lp->tx_bd_num, false,
&size, budget);

if (packets) {
lp->tx_bd_ci += packets;
if (lp->tx_bd_ci >= lp->tx_bd_num)
lp->tx_bd_ci %= lp->tx_bd_num;

u64_stats_update_begin(&lp->tx_stat_sync);
u64_stats_add(&lp->tx_packets, packets);
u64_stats_add(&lp->tx_bytes, size);
Expand Down Expand Up @@ -1282,9 +1287,10 @@ static irqreturn_t axienet_tx_irq(int irq, void *_ndev)
u32 cr = lp->tx_dma_cr;

cr &= ~(XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET, cr);

napi_schedule(&lp->napi_tx);
if (napi_schedule_prep(&lp->napi_tx)) {
axienet_dma_out32(lp, XAXIDMA_TX_CR_OFFSET, cr);
__napi_schedule(&lp->napi_tx);
}
}

return IRQ_HANDLED;
Expand Down Expand Up @@ -1326,9 +1332,10 @@ static irqreturn_t axienet_rx_irq(int irq, void *_ndev)
u32 cr = lp->rx_dma_cr;

cr &= ~(XAXIDMA_IRQ_IOC_MASK | XAXIDMA_IRQ_DELAY_MASK);
axienet_dma_out32(lp, XAXIDMA_RX_CR_OFFSET, cr);

napi_schedule(&lp->napi_rx);
if (napi_schedule_prep(&lp->napi_rx)) {
axienet_dma_out32(lp, XAXIDMA_RX_CR_OFFSET, cr);
__napi_schedule(&lp->napi_rx);
}
}

return IRQ_HANDLED;
Expand Down
42 changes: 24 additions & 18 deletions drivers/net/phy/aquantia/aquantia_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,26 +353,32 @@ int aqr_firmware_load(struct phy_device *phydev)
{
int ret;

ret = aqr_wait_reset_complete(phydev);
if (ret)
return ret;

/* Check if the firmware is not already loaded by pooling
* the current version returned by the PHY. If 0 is returned,
* no firmware is loaded.
/* Check if the firmware is not already loaded by polling
* the current version returned by the PHY.
*/
ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_FW_ID);
if (ret > 0)
goto exit;

ret = aqr_firmware_load_nvmem(phydev);
if (!ret)
goto exit;

ret = aqr_firmware_load_fs(phydev);
if (ret)
ret = aqr_wait_reset_complete(phydev);
switch (ret) {
case 0:
/* Some firmware is loaded => do nothing */
return 0;
case -ETIMEDOUT:
/* VEND1_GLOBAL_FW_ID still reads 0 after 2 seconds of polling.
* We don't have full confidence that no firmware is loaded (in
* theory it might just not have loaded yet), but we will
* assume that, and load a new image.
*/
ret = aqr_firmware_load_nvmem(phydev);
if (!ret)
return ret;

ret = aqr_firmware_load_fs(phydev);
if (ret)
return ret;
break;
default:
/* PHY read error, propagate it to the caller */
return ret;
}

exit:
return 0;
}
3 changes: 2 additions & 1 deletion drivers/net/phy/aquantia/aquantia_leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ int aqr_phy_led_hw_control_set(struct phy_device *phydev, u8 index,
int aqr_phy_led_active_low_set(struct phy_device *phydev, int index, bool enable)
{
return phy_modify_mmd(phydev, MDIO_MMD_VEND1, AQR_LED_DRIVE(index),
VEND1_GLOBAL_LED_DRIVE_VDD, enable);
VEND1_GLOBAL_LED_DRIVE_VDD,
enable ? VEND1_GLOBAL_LED_DRIVE_VDD : 0);
}

int aqr_phy_led_polarity_set(struct phy_device *phydev, int index, unsigned long modes)
Expand Down
24 changes: 17 additions & 7 deletions drivers/net/phy/aquantia/aquantia_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ static int aqr107_set_tunable(struct phy_device *phydev,
}
}

#define AQR_FW_WAIT_SLEEP_US 20000
#define AQR_FW_WAIT_TIMEOUT_US 2000000

/* If we configure settings whilst firmware is still initializing the chip,
* then these settings may be overwritten. Therefore make sure chip
* initialization has completed. Use presence of the firmware ID as
Expand All @@ -444,11 +447,19 @@ static int aqr107_set_tunable(struct phy_device *phydev,
*/
int aqr_wait_reset_complete(struct phy_device *phydev)
{
int val;
int ret, val;

ret = read_poll_timeout(phy_read_mmd, val, val != 0,
AQR_FW_WAIT_SLEEP_US, AQR_FW_WAIT_TIMEOUT_US,
false, phydev, MDIO_MMD_VEND1,
VEND1_GLOBAL_FW_ID);
if (val < 0) {
phydev_err(phydev, "Failed to read VEND1_GLOBAL_FW_ID: %pe\n",
ERR_PTR(val));
return val;
}

return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1,
VEND1_GLOBAL_FW_ID, val, val != 0,
20000, 2000000, false);
return ret;
}

static void aqr107_chip_info(struct phy_device *phydev)
Expand Down Expand Up @@ -478,7 +489,7 @@ static int aqr107_config_init(struct phy_device *phydev)
{
struct aqr107_priv *priv = phydev->priv;
u32 led_active_low;
int ret, index = 0;
int ret;

/* Check that the PHY interface type is compatible */
if (phydev->interface != PHY_INTERFACE_MODE_SGMII &&
Expand All @@ -505,10 +516,9 @@ static int aqr107_config_init(struct phy_device *phydev)

/* Restore LED polarity state after reset */
for_each_set_bit(led_active_low, &priv->leds_active_low, AQR_MAX_LEDS) {
ret = aqr_phy_led_active_low_set(phydev, index, led_active_low);
ret = aqr_phy_led_active_low_set(phydev, led_active_low, true);
if (ret)
return ret;
index++;
}

return 0;
Expand Down
Loading

0 comments on commit 62a0e2f

Please sign in to comment.