Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
1) We have to be careful to not try and place a checksum after the end
of a rawv6 packet, fix from Dave Jones with help from Hannes
Frederic Sowa.
2) Missing memory barriers in tcp_tasklet_func() lead to crashes, from
Eric Dumazet.
3) Several bug fixes for the new XDP support in virtio_net, from Jason
Wang.
4) Increase headroom in RX skbs in be2net driver to accomodate
encapsulations such as geneve. From Kalesh A P.
5) Fix SKB frag unmapping on TX in mvpp2, from Thomas Petazzoni.
6) Pre-pulling UDP headers created a regression in RECVORIGDSTADDR
socket option support, from Willem de Bruijn.
7) UID based routing added a potential OOPS in ip_do_redirect() when we
see an SKB without a socket attached. We just need it for the
network namespace which we can get from skb->dev instead. Fix from
Lorenzo Colitti.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (30 commits)
sctp: fix recovering from 0 win with small data chunks
sctp: do not loose window information if in rwnd_over
virtio-net: XDP support for small buffers
virtio-net: remove big packet XDP codes
virtio-net: forbid XDP when VIRTIO_NET_F_GUEST_UFO is support
virtio-net: make rx buf size estimation works for XDP
virtio-net: unbreak csumed packets for XDP_PASS
virtio-net: correctly handle XDP_PASS for linearized packets
virtio-net: fix page miscount during XDP linearizing
virtio-net: correctly xmit linearized page on XDP_TX
virtio-net: remove the warning before XDP linearizing
mlxsw: spectrum_router: Correctly remove nexthop groups
mlxsw: spectrum_router: Don't reflect dead neighs
neigh: Send netevent after marking neigh as dead
ipv6: handle -EFAULT from skb_copy_bits
inet: fix IP(V6)_RECVORIGDSTADDR for udp sockets
net/sched: cls_flower: Mandate mask when matching on flags
net/sched: act_tunnel_key: Fix setting UDP dst port in metadata under IPv6
stmmac: CSR clock configuration fix
net: ipv4: Don't crash if passing a null sk to ip_do_redirect.
...
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
/* Number of bytes of an RX frame that are copied to skb->data */
|
||||
#define BE_HDR_LEN ((u16) 64)
|
||||
/* allocate extra space to allow tunneling decapsulation without head reallocation */
|
||||
#define BE_RX_SKB_ALLOC_SIZE (BE_HDR_LEN + 64)
|
||||
#define BE_RX_SKB_ALLOC_SIZE 256
|
||||
|
||||
#define BE_MAX_JUMBO_FRAME_SIZE 9018
|
||||
#define BE_MIN_MTU 256
|
||||
|
||||
@@ -770,6 +770,17 @@ struct mvpp2_rx_desc {
|
||||
u32 reserved8;
|
||||
};
|
||||
|
||||
struct mvpp2_txq_pcpu_buf {
|
||||
/* Transmitted SKB */
|
||||
struct sk_buff *skb;
|
||||
|
||||
/* Physical address of transmitted buffer */
|
||||
dma_addr_t phys;
|
||||
|
||||
/* Size transmitted */
|
||||
size_t size;
|
||||
};
|
||||
|
||||
/* Per-CPU Tx queue control */
|
||||
struct mvpp2_txq_pcpu {
|
||||
int cpu;
|
||||
@@ -785,11 +796,8 @@ struct mvpp2_txq_pcpu {
|
||||
/* Number of Tx DMA descriptors reserved for each CPU */
|
||||
int reserved_num;
|
||||
|
||||
/* Array of transmitted skb */
|
||||
struct sk_buff **tx_skb;
|
||||
|
||||
/* Array of transmitted buffers' physical addresses */
|
||||
dma_addr_t *tx_buffs;
|
||||
/* Infos about transmitted buffers */
|
||||
struct mvpp2_txq_pcpu_buf *buffs;
|
||||
|
||||
/* Index of last TX DMA descriptor that was inserted */
|
||||
int txq_put_index;
|
||||
@@ -979,10 +987,11 @@ static void mvpp2_txq_inc_put(struct mvpp2_txq_pcpu *txq_pcpu,
|
||||
struct sk_buff *skb,
|
||||
struct mvpp2_tx_desc *tx_desc)
|
||||
{
|
||||
txq_pcpu->tx_skb[txq_pcpu->txq_put_index] = skb;
|
||||
if (skb)
|
||||
txq_pcpu->tx_buffs[txq_pcpu->txq_put_index] =
|
||||
tx_desc->buf_phys_addr;
|
||||
struct mvpp2_txq_pcpu_buf *tx_buf =
|
||||
txq_pcpu->buffs + txq_pcpu->txq_put_index;
|
||||
tx_buf->skb = skb;
|
||||
tx_buf->size = tx_desc->data_size;
|
||||
tx_buf->phys = tx_desc->buf_phys_addr;
|
||||
txq_pcpu->txq_put_index++;
|
||||
if (txq_pcpu->txq_put_index == txq_pcpu->size)
|
||||
txq_pcpu->txq_put_index = 0;
|
||||
@@ -4401,17 +4410,16 @@ static void mvpp2_txq_bufs_free(struct mvpp2_port *port,
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
dma_addr_t buf_phys_addr =
|
||||
txq_pcpu->tx_buffs[txq_pcpu->txq_get_index];
|
||||
struct sk_buff *skb = txq_pcpu->tx_skb[txq_pcpu->txq_get_index];
|
||||
struct mvpp2_txq_pcpu_buf *tx_buf =
|
||||
txq_pcpu->buffs + txq_pcpu->txq_get_index;
|
||||
|
||||
mvpp2_txq_inc_get(txq_pcpu);
|
||||
|
||||
dma_unmap_single(port->dev->dev.parent, buf_phys_addr,
|
||||
skb_headlen(skb), DMA_TO_DEVICE);
|
||||
if (!skb)
|
||||
dma_unmap_single(port->dev->dev.parent, tx_buf->phys,
|
||||
tx_buf->size, DMA_TO_DEVICE);
|
||||
if (!tx_buf->skb)
|
||||
continue;
|
||||
dev_kfree_skb_any(skb);
|
||||
dev_kfree_skb_any(tx_buf->skb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4651,15 +4659,10 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
|
||||
for_each_present_cpu(cpu) {
|
||||
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
|
||||
txq_pcpu->size = txq->size;
|
||||
txq_pcpu->tx_skb = kmalloc(txq_pcpu->size *
|
||||
sizeof(*txq_pcpu->tx_skb),
|
||||
GFP_KERNEL);
|
||||
if (!txq_pcpu->tx_skb)
|
||||
goto error;
|
||||
|
||||
txq_pcpu->tx_buffs = kmalloc(txq_pcpu->size *
|
||||
sizeof(dma_addr_t), GFP_KERNEL);
|
||||
if (!txq_pcpu->tx_buffs)
|
||||
txq_pcpu->buffs = kmalloc(txq_pcpu->size *
|
||||
sizeof(struct mvpp2_txq_pcpu_buf),
|
||||
GFP_KERNEL);
|
||||
if (!txq_pcpu->buffs)
|
||||
goto error;
|
||||
|
||||
txq_pcpu->count = 0;
|
||||
@@ -4673,8 +4676,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
|
||||
error:
|
||||
for_each_present_cpu(cpu) {
|
||||
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
|
||||
kfree(txq_pcpu->tx_skb);
|
||||
kfree(txq_pcpu->tx_buffs);
|
||||
kfree(txq_pcpu->buffs);
|
||||
}
|
||||
|
||||
dma_free_coherent(port->dev->dev.parent,
|
||||
@@ -4693,8 +4695,7 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port,
|
||||
|
||||
for_each_present_cpu(cpu) {
|
||||
txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
|
||||
kfree(txq_pcpu->tx_skb);
|
||||
kfree(txq_pcpu->tx_buffs);
|
||||
kfree(txq_pcpu->buffs);
|
||||
}
|
||||
|
||||
if (txq->descs)
|
||||
|
||||
@@ -942,7 +942,7 @@ static void mlxsw_sp_router_neigh_update_hw(struct work_struct *work)
|
||||
char rauht_pl[MLXSW_REG_RAUHT_LEN];
|
||||
struct net_device *dev;
|
||||
bool entry_connected;
|
||||
u8 nud_state;
|
||||
u8 nud_state, dead;
|
||||
bool updating;
|
||||
bool removing;
|
||||
bool adding;
|
||||
@@ -953,10 +953,11 @@ static void mlxsw_sp_router_neigh_update_hw(struct work_struct *work)
|
||||
dip = ntohl(*((__be32 *) n->primary_key));
|
||||
memcpy(neigh_entry->ha, n->ha, sizeof(neigh_entry->ha));
|
||||
nud_state = n->nud_state;
|
||||
dead = n->dead;
|
||||
dev = n->dev;
|
||||
read_unlock_bh(&n->lock);
|
||||
|
||||
entry_connected = nud_state & NUD_VALID;
|
||||
entry_connected = nud_state & NUD_VALID && !dead;
|
||||
adding = (!neigh_entry->offloaded) && entry_connected;
|
||||
updating = neigh_entry->offloaded && entry_connected;
|
||||
removing = neigh_entry->offloaded && !entry_connected;
|
||||
@@ -1351,7 +1352,7 @@ static int mlxsw_sp_nexthop_init(struct mlxsw_sp *mlxsw_sp,
|
||||
struct mlxsw_sp_neigh_entry *neigh_entry;
|
||||
struct net_device *dev = fib_nh->nh_dev;
|
||||
struct neighbour *n;
|
||||
u8 nud_state;
|
||||
u8 nud_state, dead;
|
||||
|
||||
/* Take a reference of neigh here ensuring that neigh would
|
||||
* not be detructed before the nexthop entry is finished.
|
||||
@@ -1383,8 +1384,9 @@ static int mlxsw_sp_nexthop_init(struct mlxsw_sp *mlxsw_sp,
|
||||
list_add_tail(&nh->neigh_list_node, &neigh_entry->nexthop_list);
|
||||
read_lock_bh(&n->lock);
|
||||
nud_state = n->nud_state;
|
||||
dead = n->dead;
|
||||
read_unlock_bh(&n->lock);
|
||||
__mlxsw_sp_nexthop_neigh_update(nh, !(nud_state & NUD_VALID));
|
||||
__mlxsw_sp_nexthop_neigh_update(nh, !(nud_state & NUD_VALID && !dead));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1394,6 +1396,7 @@ static void mlxsw_sp_nexthop_fini(struct mlxsw_sp *mlxsw_sp,
|
||||
{
|
||||
struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry;
|
||||
|
||||
__mlxsw_sp_nexthop_neigh_update(nh, true);
|
||||
list_del(&nh->neigh_list_node);
|
||||
|
||||
/* If that is the last nexthop connected to that neigh, remove from
|
||||
@@ -1452,6 +1455,8 @@ mlxsw_sp_nexthop_group_destroy(struct mlxsw_sp *mlxsw_sp,
|
||||
nh = &nh_grp->nexthops[i];
|
||||
mlxsw_sp_nexthop_fini(mlxsw_sp, nh);
|
||||
}
|
||||
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh_grp);
|
||||
WARN_ON_ONCE(nh_grp->adj_index_valid);
|
||||
kfree(nh_grp);
|
||||
}
|
||||
|
||||
|
||||
@@ -864,6 +864,10 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
|
||||
int ret;
|
||||
struct device *dev = &bsp_priv->pdev->dev;
|
||||
|
||||
ret = gmac_clk_enable(bsp_priv, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/*rmii or rgmii*/
|
||||
if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII) {
|
||||
dev_info(dev, "init for RGMII\n");
|
||||
@@ -880,10 +884,6 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = gmac_clk_enable(bsp_priv, true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
|
||||
@@ -539,7 +539,7 @@ struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr, int mcbins,
|
||||
mac->mii.reg_shift = 6;
|
||||
mac->mii.reg_mask = 0x000007C0;
|
||||
mac->mii.clk_csr_shift = 2;
|
||||
mac->mii.clk_csr_mask = 0xF;
|
||||
mac->mii.clk_csr_mask = GENMASK(5, 2);
|
||||
|
||||
/* Get and dump the chip ID */
|
||||
*synopsys_id = stmmac_get_synopsys_id(hwid);
|
||||
|
||||
@@ -197,7 +197,7 @@ struct mac_device_info *dwmac100_setup(void __iomem *ioaddr, int *synopsys_id)
|
||||
mac->mii.reg_shift = 6;
|
||||
mac->mii.reg_mask = 0x000007C0;
|
||||
mac->mii.clk_csr_shift = 2;
|
||||
mac->mii.clk_csr_mask = 0xF;
|
||||
mac->mii.clk_csr_mask = GENMASK(5, 2);
|
||||
|
||||
/* Synopsys Id is not available on old chips */
|
||||
*synopsys_id = 0;
|
||||
|
||||
@@ -81,8 +81,8 @@ static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg)
|
||||
value |= (phyaddr << priv->hw->mii.addr_shift)
|
||||
& priv->hw->mii.addr_mask;
|
||||
value |= (phyreg << priv->hw->mii.reg_shift) & priv->hw->mii.reg_mask;
|
||||
value |= (priv->clk_csr & priv->hw->mii.clk_csr_mask)
|
||||
<< priv->hw->mii.clk_csr_shift;
|
||||
value |= (priv->clk_csr << priv->hw->mii.clk_csr_shift)
|
||||
& priv->hw->mii.clk_csr_mask;
|
||||
if (priv->plat->has_gmac4)
|
||||
value |= MII_GMAC4_READ;
|
||||
|
||||
@@ -122,8 +122,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
|
||||
& priv->hw->mii.addr_mask;
|
||||
value |= (phyreg << priv->hw->mii.reg_shift) & priv->hw->mii.reg_mask;
|
||||
|
||||
value |= ((priv->clk_csr & priv->hw->mii.clk_csr_mask)
|
||||
<< priv->hw->mii.clk_csr_shift);
|
||||
value |= (priv->clk_csr << priv->hw->mii.clk_csr_shift)
|
||||
& priv->hw->mii.clk_csr_mask;
|
||||
if (priv->plat->has_gmac4)
|
||||
value |= MII_GMAC4_WRITE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user