Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Pull networking fixes from David Miller:

 1) Clear up some recent tipc regressions because of registration
    ordering. Fix from Junwei Hu.

 2) tipc's TLV_SET() can read past the end of the supplied buffer during
    the copy. From Chris Packham.

 3) ptp example program doesn't match the kernel, from Richard Cochran.

 4) Outgoing message type fix in qrtr, from Bjorn Andersson.

 5) Flow control regression in stmmac, from Tan Tee Min.

 6) Fix inband autonegotiation in phylink, from Russell King.

 7) Fix sk_bound_dev_if handling in rawv6_bind(), from Mike Manning.

 8) Fix usbnet crash after disconnect, from Kloetzke Jan.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits)
  usbnet: fix kernel crash after disconnect
  selftests: fib_rule_tests: use pre-defined DEV_ADDR
  net-next: net: Fix typos in ip-sysctl.txt
  ipv6: Consider sk_bound_dev_if when binding a raw socket to an address
  net: phylink: ensure inband AN works correctly
  usbnet: ipheth: fix racing condition
  net: stmmac: dma channel control register need to be init first
  net: stmmac: fix ethtool flow control not able to get/set
  net: qrtr: Fix message type of outgoing packets
  networking: : fix typos in code comments
  ptp: Fix example program to match kernel.
  fddi: fix typos in code comments
  selftests: fib_rule_tests: enable forwarding before ipv4 from/iif test
  selftests: fib_rule_tests: fix local IPv4 address typo
  tipc: Avoid copying bytes beyond the supplied data
  2/2] net: xilinx_emaclite: use readx_poll_timeout() in mdio wait function
  1/2] net: axienet: use readx_poll_timeout() in mdio wait function
  vlan: Mark expected switch fall-through
  macvlan: Mark expected switch fall-through
  net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query
  ...
  • Loading branch information
Linus Torvalds committed May 22, 2019
2 parents 86f9e56 + ad70411 commit f75b6f3
Show file tree
Hide file tree
Showing 23 changed files with 104 additions and 162 deletions.
4 changes: 2 additions & 2 deletions Documentation/networking/ip-sysctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ tcp_comp_sack_delay_ns - LONG INTEGER
Default : 1,000,000 ns (1 ms)

tcp_comp_sack_nr - INTEGER
Max numer of SACK that can be compressed.
Max number of SACK that can be compressed.
Using 0 disables SACK compression.

Detault : 44
Default : 44

tcp_slow_start_after_idle - BOOLEAN
If set, provide RFC2861 behavior and time out the congestion
Expand Down
4 changes: 2 additions & 2 deletions Documentation/networking/segmentation-offloads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following technologies are described:
* Generic Segmentation Offload - GSO
* Generic Receive Offload - GRO
* Partial Generic Segmentation Offload - GSO_PARTIAL
* SCTP accelleration with GSO - GSO_BY_FRAGS
* SCTP acceleration with GSO - GSO_BY_FRAGS


TCP Segmentation Offload
Expand Down Expand Up @@ -148,7 +148,7 @@ that the IPv4 ID field is incremented in the case that a given header does
not have the DF bit set.


SCTP accelleration with GSO
SCTP acceleration with GSO
===========================

SCTP - despite the lack of hardware support - can still take advantage of
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,8 @@ static int mlx4_en_set_tunable(struct net_device *dev,
return ret;
}

#define MLX4_EEPROM_PAGE_LEN 256

static int mlx4_en_get_module_info(struct net_device *dev,
struct ethtool_modinfo *modinfo)
{
Expand Down Expand Up @@ -2044,7 +2046,7 @@ static int mlx4_en_get_module_info(struct net_device *dev,
break;
case MLX4_MODULE_ID_SFP:
modinfo->type = ETH_MODULE_SFF_8472;
modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
modinfo->eeprom_len = MLX4_EEPROM_PAGE_LEN;
break;
default:
return -EINVAL;
Expand Down
5 changes: 0 additions & 5 deletions drivers/net/ethernet/mellanox/mlx4/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -2077,11 +2077,6 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
size -= offset + size - I2C_PAGE_SIZE;

i2c_addr = I2C_ADDR_LOW;
if (offset >= I2C_PAGE_SIZE) {
/* Reset offset to high page */
i2c_addr = I2C_ADDR_HIGH;
offset -= I2C_PAGE_SIZE;
}

cable_info = (struct mlx4_cable_info *)inmad->data;
cable_info->dev_mem_address = cpu_to_be16(offset);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ stmmac_get_pauseparam(struct net_device *netdev,
} else {
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
netdev->phydev->supported) ||
linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
!linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
netdev->phydev->supported))
return;
}
Expand Down Expand Up @@ -491,7 +491,7 @@ stmmac_set_pauseparam(struct net_device *netdev,
} else {
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
phy->supported) ||
linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
!linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
phy->supported))
return -EOPNOTSUPP;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,10 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
if (priv->plat->axi)
stmmac_axi(priv, priv->ioaddr, priv->plat->axi);

/* DMA CSR Channel configuration */
for (chan = 0; chan < dma_csr_ch; chan++)
stmmac_init_chan(priv, priv->ioaddr, priv->plat->dma_cfg, chan);

/* DMA RX Channel Configuration */
for (chan = 0; chan < rx_channels_count; chan++) {
rx_q = &priv->rx_queue[chan];
Expand All @@ -2233,10 +2237,6 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
tx_q->tx_tail_addr, chan);
}

/* DMA CSR Channel configuration */
for (chan = 0; chan < dma_csr_ch; chan++)
stmmac_init_chan(priv, priv->ioaddr, priv->plat->dma_cfg, chan);

return ret;
}

Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/xilinx/xilinx_axienet.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ static inline u32 axienet_ior(struct axienet_local *lp, off_t offset)
return in_be32(lp->regs + offset);
}

static inline u32 axinet_ior_read_mcr(struct axienet_local *lp)
{
return axienet_ior(lp, XAE_MDIO_MCR_OFFSET);
}

/**
* axienet_iow - Memory mapped Axi Ethernet register write
* @lp: Pointer to axienet local structure
Expand Down
16 changes: 6 additions & 10 deletions drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/of_address.h>
#include <linux/of_mdio.h>
#include <linux/jiffies.h>
#include <linux/iopoll.h>

#include "xilinx_axienet.h"

Expand All @@ -20,16 +21,11 @@
/* Wait till MDIO interface is ready to accept a new transaction.*/
int axienet_mdio_wait_until_ready(struct axienet_local *lp)
{
unsigned long end = jiffies + 2;
while (!(axienet_ior(lp, XAE_MDIO_MCR_OFFSET) &
XAE_MDIO_MCR_READY_MASK)) {
if (time_before_eq(end, jiffies)) {
WARN_ON(1);
return -ETIMEDOUT;
}
udelay(1);
}
return 0;
u32 val;

return readx_poll_timeout(axinet_ior_read_mcr, lp,
val, val & XAE_MDIO_MCR_READY_MASK,
1, 20000);
}

/**
Expand Down
16 changes: 6 additions & 10 deletions drivers/net/ethernet/xilinx/xilinx_emaclite.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/of_net.h>
#include <linux/phy.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>

#define DRIVER_NAME "xilinx_emaclite"

Expand Down Expand Up @@ -714,20 +715,15 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)

static int xemaclite_mdio_wait(struct net_local *lp)
{
unsigned long end = jiffies + 2;
u32 val;

/* wait for the MDIO interface to not be busy or timeout
* after some time.
*/
while (xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &
XEL_MDIOCTRL_MDIOSTS_MASK) {
if (time_before_eq(end, jiffies)) {
WARN_ON(1);
return -ETIMEDOUT;
}
msleep(1);
}
return 0;
return readx_poll_timeout(xemaclite_readl,
lp->base_addr + XEL_MDIOCTRL_OFFSET,
val, !(val & XEL_MDIOCTRL_MDIOSTS_MASK),
1000, 20000);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/fddi/skfp/hwmtm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ void process_receive(struct s_smc *smc)
}
/*
* SUPERNET 3 Bug: FORMAC delivers status words
* of aborded frames to the BMU
* of aborted frames to the BMU
*/
if (len <= 4) {
DB_RX(2, "Frame length = 0");
Expand Down Expand Up @@ -1343,7 +1343,7 @@ void process_receive(struct s_smc *smc)
break ;
default :
/*
* unknown FC abord the frame
* unknown FC abort the frame
*/
DB_RX(2, "unknown FC error");
smt_free_mbuf(smc,mb) ;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ static int macvlan_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCSHWTSTAMP:
if (!net_eq(dev_net(dev), &init_net))
break;
/* fall through */
case SIOCGHWTSTAMP:
if (netif_device_present(real_dev) && ops->ndo_do_ioctl)
err = ops->ndo_do_ioctl(real_dev, &ifrr, cmd);
Expand Down
37 changes: 15 additions & 22 deletions drivers/net/phy/phylink.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,28 +422,21 @@ static void phylink_resolve(struct work_struct *w)

case MLO_AN_INBAND:
phylink_get_mac_state(pl, &link_state);
if (pl->phydev) {
bool changed = false;

link_state.link = link_state.link &&
pl->phy_state.link;

if (pl->phy_state.interface !=
link_state.interface) {
link_state.interface = pl->phy_state.interface;
changed = true;
}

/* Propagate the flow control from the PHY
* to the MAC. Also propagate the interface
* if changed.
*/
if (pl->phy_state.link || changed) {
link_state.pause |= pl->phy_state.pause;
phylink_resolve_flow(pl, &link_state);

phylink_mac_config(pl, &link_state);
}

/* If we have a phy, the "up" state is the union of
* both the PHY and the MAC */
if (pl->phydev)
link_state.link &= pl->phy_state.link;

/* Only update if the PHY link is up */
if (pl->phydev && pl->phy_state.link) {
link_state.interface = pl->phy_state.interface;

/* If we have a PHY, we need to update with
* the pause mode bits. */
link_state.pause |= pl->phy_state.pause;
phylink_resolve_flow(pl, &link_state);
phylink_mac_config(pl, &link_state);
}
break;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/usb/ipheth.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,18 @@ static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
dev);
dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;

netif_stop_queue(net);
retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC);
if (retval) {
dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
__func__, retval);
dev->net->stats.tx_errors++;
dev_kfree_skb_any(skb);
netif_wake_queue(net);
} else {
dev->net->stats.tx_packets++;
dev->net->stats.tx_bytes += skb->len;
dev_consume_skb_any(skb);
netif_stop_queue(net);
}

return NETDEV_TX_OK;
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)

if (netif_running (dev->net) &&
netif_device_present (dev->net) &&
test_bit(EVENT_DEV_OPEN, &dev->flags) &&
!test_bit (EVENT_RX_HALT, &dev->flags) &&
!test_bit (EVENT_DEV_ASLEEP, &dev->flags)) {
switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) {
Expand Down Expand Up @@ -1419,6 +1420,11 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
spin_unlock_irqrestore(&dev->txq.lock, flags);
goto drop;
}
if (netif_queue_stopped(net)) {
usb_autopm_put_interface_async(dev->intf);
spin_unlock_irqrestore(&dev->txq.lock, flags);
goto drop;
}

#ifdef CONFIG_PM
/* if this triggers the device is still a sleep */
Expand Down
10 changes: 7 additions & 3 deletions include/uapi/linux/tipc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,10 @@ static inline int TLV_SET(void *tlv, __u16 type, void *data, __u16 len)
tlv_ptr = (struct tlv_desc *)tlv;
tlv_ptr->tlv_type = htons(type);
tlv_ptr->tlv_len = htons(tlv_len);
if (len && data)
memcpy(TLV_DATA(tlv_ptr), data, tlv_len);
if (len && data) {
memcpy(TLV_DATA(tlv_ptr), data, len);
memset(TLV_DATA(tlv_ptr) + len, 0, TLV_SPACE(len) - tlv_len);
}
return TLV_SPACE(len);
}

Expand Down Expand Up @@ -405,8 +407,10 @@ static inline int TCM_SET(void *msg, __u16 cmd, __u16 flags,
tcm_hdr->tcm_len = htonl(msg_len);
tcm_hdr->tcm_type = htons(cmd);
tcm_hdr->tcm_flags = htons(flags);
if (data_len && data)
if (data_len && data) {
memcpy(TCM_DATA(msg), data, data_len);
memset(TCM_DATA(msg) + data_len, 0, TCM_SPACE(data_len) - msg_len);
}
return TCM_SPACE(data_len);
}

Expand Down
1 change: 1 addition & 0 deletions net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCSHWTSTAMP:
if (!net_eq(dev_net(dev), &init_net))
break;
/* fall through */
case SIOCGMIIPHY:
case SIOCGMIIREG:
case SIOCSMIIREG:
Expand Down
2 changes: 2 additions & 0 deletions net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ static int rawv6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
/* Binding to link-local address requires an interface */
if (!sk->sk_bound_dev_if)
goto out_unlock;
}

if (sk->sk_bound_dev_if) {
err = -ENODEV;
dev = dev_get_by_index_rcu(sock_net(sk),
sk->sk_bound_dev_if);
Expand Down
4 changes: 2 additions & 2 deletions net/qrtr/qrtr.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,8 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
struct sock *sk = sock->sk;
struct qrtr_node *node;
struct sk_buff *skb;
u32 type = 0;
size_t plen;
u32 type;
int rc;

if (msg->msg_flags & ~(MSG_DONTWAIT))
Expand Down Expand Up @@ -809,9 +809,9 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)

/* control messages already require the type as 'command' */
skb_copy_bits(skb, 0, &qrtr_type, 4);
type = le32_to_cpu(qrtr_type);
}

type = le32_to_cpu(qrtr_type);
rc = enqueue_fn(node, skb, type, &ipc->us, addr);
if (rc >= 0)
rc = len;
Expand Down
Loading

0 comments on commit f75b6f3

Please sign in to comment.