Skip to content

Commit 29fbff8

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix various build warnings in tlan/qed/xen-netback drivers, from Arnd Bergmann. 2) Propagate proper error code in strparser's strp_recv(), from Geert Uytterhoeven. 3) Fix accidental broadcast of RTM_GETTFILTER responses, from Eric Dumazret. 4) Need to use list_for_each_entry_safe() in qed driver, from Wei Yongjun. 5) Openvswitch 802.1AD bug fixes from Jiri Benc. 6) Cure BUILD_BUG_ON() in mlx5 driver, from Tom Herbert. 7) Fix UDP ipv6 checksumming in netvsc driver, from Stephen Hemminger. 8) stmmac driver fixes from Giuseppe CAVALLARO. 9) Fix access to mangled IP6CB in tcp, from Eric Dumazet. 10) Fix info leaks in tipc and rtnetlink, from Dan Carpenter. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits) net: bridge: add the multicast_flood flag attribute to brport_attrs net: axienet: Remove unused parameter from __axienet_device_reset liquidio: CN23XX: fix a loop timeout net: rtnl: info leak in rtnl_fill_vfinfo() tipc: info leak in __tipc_nl_add_udp_addr() net: ipv4: Do not drop to make_route if oif is l3mdev net: phy: Trigger state machine on state change and not polling. ipv6: tcp: restore IP6CB for pktoptions skbs netvsc: Remove mistaken udp.h inclusion. xen-netback: fix type mismatch warning stmmac: fix error check when init ptp stmmac: fix ptp init for gmac4 qed: fix old-style function definition netvsc: fix checksum on UDP IPV6 net_sched: reorder pernet ops and act ops registrations xen-netback: fix guest Rx stall detection (after guest Rx refactor) drivers/ptp: Fix kernel memory disclosure net/mlx5: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON qmi_wwan: add support for Quectel EC21 and EC25 openvswitch: add NETIF_F_HW_VLAN_STAG_TX to internal dev ...
2 parents c4a8616 + 4eb6753 commit 29fbff8

File tree

29 files changed

+294
-114
lines changed

29 files changed

+294
-114
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ static int cn23xx_enable_io_queues(struct octeon_device *oct)
693693
while ((reg_val & CN23XX_PKT_INPUT_CTL_RST) &&
694694
!(reg_val &
695695
CN23XX_PKT_INPUT_CTL_QUIET) &&
696-
loop--) {
696+
--loop) {
697697
reg_val = octeon_read_csr64(
698698
oct,
699699
CN23XX_SLI_IQ_PKT_CONTROL64(q_no));

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static int give_pages(struct mlx5_core_dev *dev, u16 func_id, int npages,
287287

288288
goto retry;
289289
}
290-
MLX5_SET64(manage_pages_in, in, pas[i], addr);
290+
MLX5_ARRAY_SET64(manage_pages_in, in, pas, i, addr);
291291
}
292292

293293
MLX5_SET(manage_pages_in, in, opcode, MLX5_CMD_OP_MANAGE_PAGES);
@@ -344,7 +344,7 @@ static int reclaim_pages_cmd(struct mlx5_core_dev *dev,
344344
if (fwp->func_id != func_id)
345345
continue;
346346

347-
MLX5_SET64(manage_pages_out, out, pas[i], fwp->addr);
347+
MLX5_ARRAY_SET64(manage_pages_out, out, pas, i, fwp->addr);
348348
i++;
349349
}
350350

drivers/net/ethernet/qlogic/qed/qed_ll2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ static void qed_ll2_register_cb_ops(struct qed_dev *cdev,
15171517
static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params)
15181518
{
15191519
struct qed_ll2_info ll2_info;
1520-
struct qed_ll2_buffer *buffer;
1520+
struct qed_ll2_buffer *buffer, *tmp_buffer;
15211521
enum qed_ll2_conn_type conn_type;
15221522
struct qed_ptt *p_ptt;
15231523
int rc, i;
@@ -1587,7 +1587,7 @@ static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params)
15871587

15881588
/* Post all Rx buffers to FW */
15891589
spin_lock_bh(&cdev->ll2->lock);
1590-
list_for_each_entry(buffer, &cdev->ll2->list, list) {
1590+
list_for_each_entry_safe(buffer, tmp_buffer, &cdev->ll2->list, list) {
15911591
rc = qed_ll2_post_rx_buffer(QED_LEADING_HWFN(cdev),
15921592
cdev->ll2->handle,
15931593
buffer->phys_addr, 0, buffer, 1);

drivers/net/ethernet/qlogic/qed/qed_roce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2947,7 +2947,7 @@ static const struct qed_rdma_ops qed_rdma_ops_pass = {
29472947
.roce_ll2_stats = &qed_roce_ll2_stats,
29482948
};
29492949

2950-
const struct qed_rdma_ops *qed_get_rdma_ops()
2950+
const struct qed_rdma_ops *qed_get_rdma_ops(void)
29512951
{
29522952
return &qed_rdma_ops_pass;
29532953
}

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -650,20 +650,27 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
650650
if (IS_ERR(priv->clk_ptp_ref)) {
651651
priv->clk_ptp_rate = clk_get_rate(priv->stmmac_clk);
652652
priv->clk_ptp_ref = NULL;
653+
netdev_dbg(priv->dev, "PTP uses main clock\n");
653654
} else {
654655
clk_prepare_enable(priv->clk_ptp_ref);
655656
priv->clk_ptp_rate = clk_get_rate(priv->clk_ptp_ref);
657+
netdev_dbg(priv->dev, "PTP rate %d\n", priv->clk_ptp_rate);
656658
}
657659

658660
priv->adv_ts = 0;
659-
if (priv->dma_cap.atime_stamp && priv->extend_desc)
661+
/* Check if adv_ts can be enabled for dwmac 4.x core */
662+
if (priv->plat->has_gmac4 && priv->dma_cap.atime_stamp)
663+
priv->adv_ts = 1;
664+
/* Dwmac 3.x core with extend_desc can support adv_ts */
665+
else if (priv->extend_desc && priv->dma_cap.atime_stamp)
660666
priv->adv_ts = 1;
661667

662-
if (netif_msg_hw(priv) && priv->dma_cap.time_stamp)
663-
pr_debug("IEEE 1588-2002 Time Stamp supported\n");
668+
if (priv->dma_cap.time_stamp)
669+
netdev_info(priv->dev, "IEEE 1588-2002 Timestamp supported\n");
664670

665-
if (netif_msg_hw(priv) && priv->adv_ts)
666-
pr_debug("IEEE 1588-2008 Advanced Time Stamp supported\n");
671+
if (priv->adv_ts)
672+
netdev_info(priv->dev,
673+
"IEEE 1588-2008 Advanced Timestamp supported\n");
667674

668675
priv->hw->ptp = &stmmac_ptp;
669676
priv->hwts_tx_en = 0;
@@ -1702,8 +1709,8 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
17021709

17031710
if (init_ptp) {
17041711
ret = stmmac_init_ptp(priv);
1705-
if (ret && ret != -EOPNOTSUPP)
1706-
pr_warn("%s: failed PTP initialisation\n", __func__);
1712+
if (ret)
1713+
netdev_warn(priv->dev, "PTP support cannot init.\n");
17071714
}
17081715

17091716
#ifdef CONFIG_DEBUG_FS

drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ int stmmac_ptp_register(struct stmmac_priv *priv)
186186
priv->device);
187187
if (IS_ERR(priv->ptp_clock)) {
188188
priv->ptp_clock = NULL;
189-
pr_err("ptp_clock_register() failed on %s\n", priv->dev->name);
190-
} else if (priv->ptp_clock)
191-
pr_debug("Added PTP HW clock successfully on %s\n",
192-
priv->dev->name);
189+
return PTR_ERR(priv->ptp_clock);
190+
}
191+
192+
spin_lock_init(&priv->ptp_lock);
193+
194+
netdev_dbg(priv->dev, "Added PTP HW clock successfully\n");
193195

194196
return 0;
195197
}

drivers/net/ethernet/ti/tlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,8 @@ static int tlan_probe1(struct pci_dev *pdev, long ioaddr, int irq, int rev,
610610
#ifdef CONFIG_PCI
611611
if (pdev)
612612
pci_release_regions(pdev);
613-
#endif
614613
err_out:
614+
#endif
615615
if (pdev)
616616
pci_disable_device(pdev);
617617
return rc;

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,7 @@ static void axienet_setoptions(struct net_device *ndev, u32 options)
431431
lp->options |= options;
432432
}
433433

434-
static void __axienet_device_reset(struct axienet_local *lp,
435-
struct device *dev, off_t offset)
434+
static void __axienet_device_reset(struct axienet_local *lp, off_t offset)
436435
{
437436
u32 timeout;
438437
/* Reset Axi DMA. This would reset Axi Ethernet core as well. The reset
@@ -468,8 +467,8 @@ static void axienet_device_reset(struct net_device *ndev)
468467
u32 axienet_status;
469468
struct axienet_local *lp = netdev_priv(ndev);
470469

471-
__axienet_device_reset(lp, &ndev->dev, XAXIDMA_TX_CR_OFFSET);
472-
__axienet_device_reset(lp, &ndev->dev, XAXIDMA_RX_CR_OFFSET);
470+
__axienet_device_reset(lp, XAXIDMA_TX_CR_OFFSET);
471+
__axienet_device_reset(lp, XAXIDMA_RX_CR_OFFSET);
473472

474473
lp->max_frm_size = XAE_MAX_VLAN_FRAME_SIZE;
475474
lp->options |= XAE_OPTION_VLAN;
@@ -1338,8 +1337,8 @@ static void axienet_dma_err_handler(unsigned long data)
13381337
axienet_iow(lp, XAE_MDIO_MC_OFFSET, (mdio_mcreg &
13391338
~XAE_MDIO_MC_MDIOEN_MASK));
13401339

1341-
__axienet_device_reset(lp, &ndev->dev, XAXIDMA_TX_CR_OFFSET);
1342-
__axienet_device_reset(lp, &ndev->dev, XAXIDMA_RX_CR_OFFSET);
1340+
__axienet_device_reset(lp, XAXIDMA_TX_CR_OFFSET);
1341+
__axienet_device_reset(lp, XAXIDMA_RX_CR_OFFSET);
13431342

13441343
axienet_iow(lp, XAE_MDIO_MC_OFFSET, mdio_mcreg);
13451344
axienet_mdio_wait_until_ready(lp);

drivers/net/hyperv/netvsc_drv.c

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
442442
}
443443

444444
net_trans_info = get_net_transport_info(skb, &hdr_offset);
445-
if (net_trans_info == TRANSPORT_INFO_NOT_IP)
446-
goto do_send;
447445

448446
/*
449447
* Setup the sendside checksum offload only if this is not a
@@ -478,56 +476,29 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
478476
}
479477
lso_info->lso_v2_transmit.tcp_header_offset = hdr_offset;
480478
lso_info->lso_v2_transmit.mss = skb_shinfo(skb)->gso_size;
481-
goto do_send;
482-
}
483-
484-
if ((skb->ip_summed == CHECKSUM_NONE) ||
485-
(skb->ip_summed == CHECKSUM_UNNECESSARY))
486-
goto do_send;
487-
488-
rndis_msg_size += NDIS_CSUM_PPI_SIZE;
489-
ppi = init_ppi_data(rndis_msg, NDIS_CSUM_PPI_SIZE,
490-
TCPIP_CHKSUM_PKTINFO);
491-
492-
csum_info = (struct ndis_tcp_ip_checksum_info *)((void *)ppi +
493-
ppi->ppi_offset);
494-
495-
if (net_trans_info & (INFO_IPV4 << 16))
496-
csum_info->transmit.is_ipv4 = 1;
497-
else
498-
csum_info->transmit.is_ipv6 = 1;
499-
500-
if (net_trans_info & INFO_TCP) {
501-
csum_info->transmit.tcp_checksum = 1;
502-
csum_info->transmit.tcp_header_offset = hdr_offset;
503-
} else if (net_trans_info & INFO_UDP) {
504-
/* UDP checksum offload is not supported on ws2008r2.
505-
* Furthermore, on ws2012 and ws2012r2, there are some
506-
* issues with udp checksum offload from Linux guests.
507-
* (these are host issues).
508-
* For now compute the checksum here.
509-
*/
510-
struct udphdr *uh;
511-
u16 udp_len;
512-
513-
ret = skb_cow_head(skb, 0);
514-
if (ret)
515-
goto no_memory;
516-
517-
uh = udp_hdr(skb);
518-
udp_len = ntohs(uh->len);
519-
uh->check = 0;
520-
uh->check = csum_tcpudp_magic(ip_hdr(skb)->saddr,
521-
ip_hdr(skb)->daddr,
522-
udp_len, IPPROTO_UDP,
523-
csum_partial(uh, udp_len, 0));
524-
if (uh->check == 0)
525-
uh->check = CSUM_MANGLED_0;
526-
527-
csum_info->transmit.udp_checksum = 0;
479+
} else if (skb->ip_summed == CHECKSUM_PARTIAL) {
480+
if (net_trans_info & INFO_TCP) {
481+
rndis_msg_size += NDIS_CSUM_PPI_SIZE;
482+
ppi = init_ppi_data(rndis_msg, NDIS_CSUM_PPI_SIZE,
483+
TCPIP_CHKSUM_PKTINFO);
484+
485+
csum_info = (struct ndis_tcp_ip_checksum_info *)((void *)ppi +
486+
ppi->ppi_offset);
487+
488+
if (net_trans_info & (INFO_IPV4 << 16))
489+
csum_info->transmit.is_ipv4 = 1;
490+
else
491+
csum_info->transmit.is_ipv6 = 1;
492+
493+
csum_info->transmit.tcp_checksum = 1;
494+
csum_info->transmit.tcp_header_offset = hdr_offset;
495+
} else {
496+
/* UDP checksum (and other) offload is not supported. */
497+
if (skb_checksum_help(skb))
498+
goto drop;
499+
}
528500
}
529501

530-
do_send:
531502
/* Start filling in the page buffers with the rndis hdr */
532503
rndis_msg->msg_len += rndis_msg_size;
533504
packet->total_data_buflen = rndis_msg->msg_len;

drivers/net/phy/phy.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,21 @@ void phy_start_machine(struct phy_device *phydev)
607607
queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, HZ);
608608
}
609609

610+
/**
611+
* phy_trigger_machine - trigger the state machine to run
612+
*
613+
* @phydev: the phy_device struct
614+
*
615+
* Description: There has been a change in state which requires that the
616+
* state machine runs.
617+
*/
618+
619+
static void phy_trigger_machine(struct phy_device *phydev)
620+
{
621+
cancel_delayed_work_sync(&phydev->state_queue);
622+
queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, 0);
623+
}
624+
610625
/**
611626
* phy_stop_machine - stop the PHY state machine tracking
612627
* @phydev: target phy_device struct
@@ -639,6 +654,8 @@ static void phy_error(struct phy_device *phydev)
639654
mutex_lock(&phydev->lock);
640655
phydev->state = PHY_HALTED;
641656
mutex_unlock(&phydev->lock);
657+
658+
phy_trigger_machine(phydev);
642659
}
643660

644661
/**
@@ -800,8 +817,7 @@ void phy_change(struct work_struct *work)
800817
}
801818

802819
/* reschedule state queue work to run as soon as possible */
803-
cancel_delayed_work_sync(&phydev->state_queue);
804-
queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, 0);
820+
phy_trigger_machine(phydev);
805821
return;
806822

807823
ignore:
@@ -890,6 +906,8 @@ void phy_start(struct phy_device *phydev)
890906
/* if phy was suspended, bring the physical link up again */
891907
if (do_resume)
892908
phy_resume(phydev);
909+
910+
phy_trigger_machine(phydev);
893911
}
894912
EXPORT_SYMBOL(phy_start);
895913

drivers/net/usb/qmi_wwan.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ enum qmi_wwan_flags {
5959
QMI_WWAN_FLAG_RAWIP = 1 << 0,
6060
};
6161

62+
enum qmi_wwan_quirks {
63+
QMI_WWAN_QUIRK_DTR = 1 << 0, /* needs "set DTR" request */
64+
};
65+
6266
static void qmi_wwan_netdev_setup(struct net_device *net)
6367
{
6468
struct usbnet *dev = netdev_priv(net);
@@ -411,9 +415,14 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
411415
* clearing out state the clients might need.
412416
*
413417
* MDM9x30 is the first QMI chipset with USB3 support. Abuse
414-
* this fact to enable the quirk.
418+
* this fact to enable the quirk for all USB3 devices.
419+
*
420+
* There are also chipsets with the same "set DTR" requirement
421+
* but without USB3 support. Devices based on these chips
422+
* need a quirk flag in the device ID table.
415423
*/
416-
if (le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
424+
if (dev->driver_info->data & QMI_WWAN_QUIRK_DTR ||
425+
le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
417426
qmi_wwan_manage_power(dev, 1);
418427
qmi_wwan_change_dtr(dev, true);
419428
}
@@ -526,13 +535,28 @@ static const struct driver_info qmi_wwan_info = {
526535
.rx_fixup = qmi_wwan_rx_fixup,
527536
};
528537

538+
static const struct driver_info qmi_wwan_info_quirk_dtr = {
539+
.description = "WWAN/QMI device",
540+
.flags = FLAG_WWAN,
541+
.bind = qmi_wwan_bind,
542+
.unbind = qmi_wwan_unbind,
543+
.manage_power = qmi_wwan_manage_power,
544+
.rx_fixup = qmi_wwan_rx_fixup,
545+
.data = QMI_WWAN_QUIRK_DTR,
546+
};
547+
529548
#define HUAWEI_VENDOR_ID 0x12D1
530549

531550
/* map QMI/wwan function by a fixed interface number */
532551
#define QMI_FIXED_INTF(vend, prod, num) \
533552
USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
534553
.driver_info = (unsigned long)&qmi_wwan_info
535554

555+
/* devices requiring "set DTR" quirk */
556+
#define QMI_QUIRK_SET_DTR(vend, prod, num) \
557+
USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
558+
.driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr
559+
536560
/* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
537561
#define QMI_GOBI1K_DEVICE(vend, prod) \
538562
QMI_FIXED_INTF(vend, prod, 3)
@@ -895,6 +919,8 @@ static const struct usb_device_id products[] = {
895919
{QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
896920
{QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
897921
{QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */
922+
{QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
923+
{QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */
898924

899925
/* 4. Gobi 1000 devices */
900926
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */

drivers/net/xen-netback/common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,4 +407,8 @@ u32 xenvif_set_hash_mapping(struct xenvif *vif, u32 gref, u32 len,
407407

408408
void xenvif_set_skb_hash(struct xenvif *vif, struct sk_buff *skb);
409409

410+
#ifdef CONFIG_DEBUG_FS
411+
void xenvif_dump_hash_info(struct xenvif *vif, struct seq_file *m);
412+
#endif
413+
410414
#endif /* __XEN_NETBACK__COMMON_H__ */

0 commit comments

Comments
 (0)