Skip to content

Commit 08ad43d

Browse files
committed
Merge tag 'net-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from rxrpc, netfilter and xfrm. Current release - regressions: - dccp/tcp: fix bhash2 issues related to WARN_ON() in inet_csk_get_port() - l2tp: don't sleep and disable BH under writer-side sk_callback_lock - eth: ice: fix handling of burst tx timestamps Current release - new code bugs: - xfrm: squelch kernel warning in case XFRM encap type is not available - eth: mlx5e: fix possible race condition in macsec extended packet number update routine Previous releases - regressions: - neigh: decrement the family specific qlen - netfilter: fix ipset regression - rxrpc: fix race between conn bundle lookup and bundle removal [ZDI-CAN-15975] - eth: iavf: do not restart tx queues after reset task failure - eth: nfp: add port from netdev validation for EEPROM access - eth: mtk_eth_soc: fix potential memory leak in mtk_rx_alloc() Previous releases - always broken: - tipc: set con sock in tipc_conn_alloc - nfc: - fix potential memory leaks - fix incorrect sizing calculations in EVT_TRANSACTION - eth: octeontx2-af: fix pci device refcount leak - eth: bonding: fix ICMPv6 header handling when receiving IPv6 messages - eth: prestera: add missing unregister_netdev() in prestera_port_create() - eth: tsnep: fix rotten packets Misc: - usb: qmi_wwan: add support for LARA-L6" * tag 'net-6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (95 commits) net: thunderx: Fix the ACPI memory leak octeontx2-af: Fix reference count issue in rvu_sdp_init() net: altera_tse: release phylink resources in tse_shutdown() virtio_net: Fix probe failed when modprobe virtio_net net: wwan: t7xx: Fix the ACPI memory leak octeontx2-pf: Add check for devm_kcalloc net: enetc: preserve TX ring priority across reconfiguration net: marvell: prestera: add missing unregister_netdev() in prestera_port_create() nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION nfc: st-nci: fix memory leaks in EVT_TRANSACTION nfc: st-nci: fix incorrect validating logic in EVT_TRANSACTION Documentation: networking: Update generic_netlink_howto URL net/cdc_ncm: Fix multicast RX support for CDC NCM devices with ZLP net: usb: qmi_wwan: add u-blox 0x1342 composition l2tp: Don't sleep and disable BH under writer-side sk_callback_lock net: dm9051: Fix missing dev_kfree_skb() in dm9051_loop_rx() arcnet: fix potential memory leak in com20020_probe() ipv4: Fix error return code in fib_table_insert() net: ethernet: mtk_eth_soc: fix memory leak in error path net: ethernet: mtk_eth_soc: fix resource leak in error path ...
2 parents cd89db6 + 661e5eb commit 08ad43d

File tree

119 files changed

+917
-483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+917
-483
lines changed

Documentation/networking/generic_netlink.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Generic Netlink
66

77
A wiki document on how to use Generic Netlink can be found here:
88

9-
* http://www.linuxfoundation.org/collaborate/workgroups/networking/generic_netlink_howto
9+
* https://wiki.linuxfoundation.org/networking/generic_netlink_howto

drivers/net/arcnet/com20020_cs.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ static int com20020_probe(struct pcmcia_device *p_dev)
113113
struct com20020_dev *info;
114114
struct net_device *dev;
115115
struct arcnet_local *lp;
116+
int ret = -ENOMEM;
116117

117118
dev_dbg(&p_dev->dev, "com20020_attach()\n");
118119

@@ -142,12 +143,18 @@ static int com20020_probe(struct pcmcia_device *p_dev)
142143
info->dev = dev;
143144
p_dev->priv = info;
144145

145-
return com20020_config(p_dev);
146+
ret = com20020_config(p_dev);
147+
if (ret)
148+
goto fail_config;
149+
150+
return 0;
146151

152+
fail_config:
153+
free_arcdev(dev);
147154
fail_alloc_dev:
148155
kfree(info);
149156
fail_alloc_info:
150-
return -ENOMEM;
157+
return ret;
151158
} /* com20020_attach */
152159

153160
static void com20020_detach(struct pcmcia_device *link)

drivers/net/bonding/bond_main.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,16 +3231,23 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond,
32313231
struct slave *slave)
32323232
{
32333233
struct slave *curr_active_slave, *curr_arp_slave;
3234-
struct icmp6hdr *hdr = icmp6_hdr(skb);
32353234
struct in6_addr *saddr, *daddr;
3235+
struct {
3236+
struct ipv6hdr ip6;
3237+
struct icmp6hdr icmp6;
3238+
} *combined, _combined;
32363239

32373240
if (skb->pkt_type == PACKET_OTHERHOST ||
3238-
skb->pkt_type == PACKET_LOOPBACK ||
3239-
hdr->icmp6_type != NDISC_NEIGHBOUR_ADVERTISEMENT)
3241+
skb->pkt_type == PACKET_LOOPBACK)
3242+
goto out;
3243+
3244+
combined = skb_header_pointer(skb, 0, sizeof(_combined), &_combined);
3245+
if (!combined || combined->ip6.nexthdr != NEXTHDR_ICMP ||
3246+
combined->icmp6.icmp6_type != NDISC_NEIGHBOUR_ADVERTISEMENT)
32403247
goto out;
32413248

3242-
saddr = &ipv6_hdr(skb)->saddr;
3243-
daddr = &ipv6_hdr(skb)->daddr;
3249+
saddr = &combined->ip6.saddr;
3250+
daddr = &combined->ip6.saddr;
32443251

32453252
slave_dbg(bond->dev, slave->dev, "%s: %s/%d av %d sv %d sip %pI6c tip %pI6c\n",
32463253
__func__, slave->dev->name, bond_slave_state(slave),

drivers/net/dsa/sja1105/sja1105_mdio.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ static int sja1105_base_tx_mdio_read(struct mii_bus *bus, int phy, int reg)
256256
u32 tmp;
257257
int rc;
258258

259+
if (reg & MII_ADDR_C45)
260+
return -EOPNOTSUPP;
261+
259262
rc = sja1105_xfer_u32(priv, SPI_READ, regs->mdio_100base_tx + reg,
260263
&tmp, NULL);
261264
if (rc < 0)
@@ -272,6 +275,9 @@ static int sja1105_base_tx_mdio_write(struct mii_bus *bus, int phy, int reg,
272275
const struct sja1105_regs *regs = priv->info->regs;
273276
u32 tmp = val;
274277

278+
if (reg & MII_ADDR_C45)
279+
return -EOPNOTSUPP;
280+
275281
return sja1105_xfer_u32(priv, SPI_WRITE, regs->mdio_100base_tx + reg,
276282
&tmp, NULL);
277283
}

drivers/net/ethernet/altera/altera_tse_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ static int tse_shutdown(struct net_device *dev)
990990
int ret;
991991

992992
phylink_stop(priv->phylink);
993+
phylink_disconnect_phy(priv->phylink);
993994
netif_stop_queue(dev);
994995
napi_disable(&priv->napi);
995996

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,16 +795,20 @@ static void bnx2x_vf_enable_traffic(struct bnx2x *bp, struct bnx2x_virtf *vf)
795795

796796
static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp, u8 abs_vfid)
797797
{
798-
struct pci_dev *dev;
799798
struct bnx2x_virtf *vf = bnx2x_vf_by_abs_fid(bp, abs_vfid);
799+
struct pci_dev *dev;
800+
bool pending;
800801

801802
if (!vf)
802803
return false;
803804

804805
dev = pci_get_domain_bus_and_slot(vf->domain, vf->bus, vf->devfn);
805-
if (dev)
806-
return bnx2x_is_pcie_pending(dev);
807-
return false;
806+
if (!dev)
807+
return false;
808+
pending = bnx2x_is_pcie_pending(dev);
809+
pci_dev_put(dev);
810+
811+
return pending;
808812
}
809813

810814
int bnx2x_vf_flr_clnup_epilog(struct bnx2x *bp, u8 abs_vfid)

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,7 @@ static int liquidio_open(struct net_device *netdev)
17941794

17951795
ifstate_set(lio, LIO_IFSTATE_RUNNING);
17961796

1797-
if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on)) {
1797+
if (!OCTEON_CN23XX_PF(oct) || !oct->msix_on) {
17981798
ret = setup_tx_poll_fn(netdev);
17991799
if (ret)
18001800
goto err_poll;
@@ -1824,7 +1824,7 @@ static int liquidio_open(struct net_device *netdev)
18241824
return 0;
18251825

18261826
err_rx_ctrl:
1827-
if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on))
1827+
if (!OCTEON_CN23XX_PF(oct) || !oct->msix_on)
18281828
cleanup_tx_poll_fn(netdev);
18291829
err_poll:
18301830
if (lio->ptp_clock) {

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,8 +1436,10 @@ static acpi_status bgx_acpi_match_id(acpi_handle handle, u32 lvl,
14361436
return AE_OK;
14371437
}
14381438

1439-
if (strncmp(string.pointer, bgx_sel, 4))
1439+
if (strncmp(string.pointer, bgx_sel, 4)) {
1440+
kfree(string.pointer);
14401441
return AE_OK;
1442+
}
14411443

14421444
acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
14431445
bgx_acpi_register_phy, NULL, bgx, NULL);

drivers/net/ethernet/davicom/dm9051.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,10 @@ static int dm9051_loop_rx(struct board_info *db)
798798
}
799799

800800
ret = dm9051_stop_mrcmd(db);
801-
if (ret)
801+
if (ret) {
802+
dev_kfree_skb(skb);
802803
return ret;
804+
}
803805

804806
skb->protocol = eth_type_trans(skb, db->ndev);
805807
if (db->ndev->features & NETIF_F_RXCSUM)

drivers/net/ethernet/engleder/tsnep_main.c

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,27 @@ static bool tsnep_tx_poll(struct tsnep_tx *tx, int napi_budget)
542542
return (budget != 0);
543543
}
544544

545+
static bool tsnep_tx_pending(struct tsnep_tx *tx)
546+
{
547+
unsigned long flags;
548+
struct tsnep_tx_entry *entry;
549+
bool pending = false;
550+
551+
spin_lock_irqsave(&tx->lock, flags);
552+
553+
if (tx->read != tx->write) {
554+
entry = &tx->entry[tx->read];
555+
if ((__le32_to_cpu(entry->desc_wb->properties) &
556+
TSNEP_TX_DESC_OWNER_MASK) ==
557+
(entry->properties & TSNEP_TX_DESC_OWNER_MASK))
558+
pending = true;
559+
}
560+
561+
spin_unlock_irqrestore(&tx->lock, flags);
562+
563+
return pending;
564+
}
565+
545566
static int tsnep_tx_open(struct tsnep_adapter *adapter, void __iomem *addr,
546567
int queue_index, struct tsnep_tx *tx)
547568
{
@@ -821,6 +842,19 @@ static int tsnep_rx_poll(struct tsnep_rx *rx, struct napi_struct *napi,
821842
return done;
822843
}
823844

845+
static bool tsnep_rx_pending(struct tsnep_rx *rx)
846+
{
847+
struct tsnep_rx_entry *entry;
848+
849+
entry = &rx->entry[rx->read];
850+
if ((__le32_to_cpu(entry->desc_wb->properties) &
851+
TSNEP_DESC_OWNER_COUNTER_MASK) ==
852+
(entry->properties & TSNEP_DESC_OWNER_COUNTER_MASK))
853+
return true;
854+
855+
return false;
856+
}
857+
824858
static int tsnep_rx_open(struct tsnep_adapter *adapter, void __iomem *addr,
825859
int queue_index, struct tsnep_rx *rx)
826860
{
@@ -866,6 +900,17 @@ static void tsnep_rx_close(struct tsnep_rx *rx)
866900
tsnep_rx_ring_cleanup(rx);
867901
}
868902

903+
static bool tsnep_pending(struct tsnep_queue *queue)
904+
{
905+
if (queue->tx && tsnep_tx_pending(queue->tx))
906+
return true;
907+
908+
if (queue->rx && tsnep_rx_pending(queue->rx))
909+
return true;
910+
911+
return false;
912+
}
913+
869914
static int tsnep_poll(struct napi_struct *napi, int budget)
870915
{
871916
struct tsnep_queue *queue = container_of(napi, struct tsnep_queue,
@@ -886,9 +931,19 @@ static int tsnep_poll(struct napi_struct *napi, int budget)
886931
if (!complete)
887932
return budget;
888933

889-
if (likely(napi_complete_done(napi, done)))
934+
if (likely(napi_complete_done(napi, done))) {
890935
tsnep_enable_irq(queue->adapter, queue->irq_mask);
891936

937+
/* reschedule if work is already pending, prevent rotten packets
938+
* which are transmitted or received after polling but before
939+
* interrupt enable
940+
*/
941+
if (tsnep_pending(queue)) {
942+
tsnep_disable_irq(queue->adapter, queue->irq_mask);
943+
napi_schedule(napi);
944+
}
945+
}
946+
892947
return min(done, budget - 1);
893948
}
894949

0 commit comments

Comments
 (0)