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) Fix skb leak in mac802154, from Martin Townsend

 2) Use select not depends on NF_NAT for NFT_NAT, from Pablo Neira
    Ayuso

 3) Fix union initializer bogosity in vxlan, from Gerhard Stenzel

 4) Fix RX checksum configuration in stmmac driver, from Giuseppe
    CAVALLARO

 5) Fix TSO with non-accelerated VLANs in e1000, e1000e, bna, ehea,
    i40e, i40evf, mvneta, and qlge, from Vlad Yasevich

 6) Fix capability checks in phy_init_eee(), from Giuseppe CAVALLARO

 7) Try high order allocations more sanely for SKBs, specifically if a
    high order allocation fails, fall back directly to zero order pages
    rather than iterating down one order at a time.  From Eric Dumazet

 8) Fix a memory leak in openvswitch, from Li RongQing

 9) amd-xgbe initializes wrong spinlock, from Thomas Lendacky

10) RTNL locking was busted in setsockopt for anycast and multicast, fix
    from Sabrina Dubroca

11) Fix peer address refcount leak in ipv6, from Nicolas Dichtel

12) DocBook typo fixes, from Masanari Iida

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (101 commits)
  ipv6: restore the behavior of ipv6_sock_ac_drop()
  amd-xgbe: Enable interrupts for all management counters
  amd-xgbe: Treat certain counter registers as 64 bit
  greth: moved TX ring cleaning to NAPI rx poll func
  cnic : Cleanup CONFIG_IPV6 & VLAN check
  net: treewide: Fix typo found in DocBook/networking.xml
  bnx2x: Fix link problems for 1G SFP RJ45 module
  3c59x: avoid panic in boomerang_start_xmit when finding page address:
  netfilter: add explicit Kconfig for NETFILTER_XT_NAT
  ipv6: use addrconf_get_prefix_route() to remove peer addr
  ipv6: fix a refcnt leak with peer addr
  net-timestamp: only report sw timestamp if reporting bit is set
  drivers/net/fddi/skfp/h/skfbi.h: Remove useless PCI_BASE_2ND macros
  l2tp: fix race while getting PMTU on PPP pseudo-wire
  ipv6: fix rtnl locking in setsockopt for anycast and multicast
  VMXNET3: Check for map error in vmxnet3_set_mc
  openvswitch: distinguish between the dropped and consumed skb
  amd-xgbe: Fix initialization of the wrong spin lock
  openvswitch: fix a memory leak
  netfilter: fix missing dependencies in NETFILTER_XT_TARGET_LOG
  ...
  • Loading branch information
torvalds committed Sep 8, 2014
2 parents 2ce7598 + 45ce829 commit b531f5d
Show file tree
Hide file tree
Showing 116 changed files with 1,082 additions and 555 deletions.
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/net/stmmac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Optional properties:
further clocks may be specified in derived bindings.
- clock-names: One name for each entry in the clocks property, the
first one should be "stmmaceth".
- clk_ptp_ref: this is the PTP reference clock; in case of the PTP is
available this clock is used for programming the Timestamp Addend Register.
If not passed then the system clock will be used and this is fine on some
platforms.

Examples:

Expand Down
1 change: 1 addition & 0 deletions drivers/bcma/host_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xA8DB */
{ 0, },
};
MODULE_DEVICE_TABLE(pci, bcma_pci_bridge_tbl);
Expand Down
30 changes: 30 additions & 0 deletions drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,30 @@ static int __mlx4_ib_destroy_flow(struct mlx4_dev *dev, u64 reg_id)
return err;
}

static int mlx4_ib_tunnel_steer_add(struct ib_qp *qp, struct ib_flow_attr *flow_attr,
u64 *reg_id)
{
void *ib_flow;
union ib_flow_spec *ib_spec;
struct mlx4_dev *dev = to_mdev(qp->device)->dev;
int err = 0;

if (dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
return 0; /* do nothing */

ib_flow = flow_attr + 1;
ib_spec = (union ib_flow_spec *)ib_flow;

if (ib_spec->type != IB_FLOW_SPEC_ETH || flow_attr->num_of_specs != 1)
return 0; /* do nothing */

err = mlx4_tunnel_steer_add(to_mdev(qp->device)->dev, ib_spec->eth.val.dst_mac,
flow_attr->port, qp->qp_num,
MLX4_DOMAIN_UVERBS | (flow_attr->priority & 0xff),
reg_id);
return err;
}

static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
struct ib_flow_attr *flow_attr,
int domain)
Expand Down Expand Up @@ -1136,6 +1160,12 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
i++;
}

if (i < ARRAY_SIZE(type) && flow_attr->type == IB_FLOW_ATTR_NORMAL) {
err = mlx4_ib_tunnel_steer_add(qp, flow_attr, &mflow->reg_id[i]);
if (err)
goto err_free;
}

return &mflow->ibflow;

err_free:
Expand Down
8 changes: 7 additions & 1 deletion drivers/infiniband/hw/mlx4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,9 +1677,15 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
}
}

if (qp->ibqp.qp_type == IB_QPT_RAW_PACKET)
if (qp->ibqp.qp_type == IB_QPT_RAW_PACKET) {
context->pri_path.ackto = (context->pri_path.ackto & 0xf8) |
MLX4_IB_LINK_TYPE_ETH;
if (dev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) {
/* set QP to receive both tunneled & non-tunneled packets */
if (!(context->flags & (1 << MLX4_RSS_QPC_FLAG_OFFSET)))
context->srqn = cpu_to_be32(7 << 28);
}
}

if (ibqp->qp_type == IB_QPT_UD && (new_state == IB_QPS_RTR)) {
int is_eth = rdma_port_get_link_layer(
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/3com/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2177,10 +2177,10 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];

vp->tx_ring[entry].frag[i+1].addr =
cpu_to_le32(pci_map_single(
VORTEX_PCI(vp),
(void *)skb_frag_address(frag),
skb_frag_size(frag), PCI_DMA_TODEVICE));
cpu_to_le32(skb_frag_dma_map(
&VORTEX_PCI(vp)->dev,
frag,
frag->page_offset, frag->size, DMA_TO_DEVICE));

if (i == skb_shinfo(skb)->nr_frags-1)
vp->tx_ring[entry].frag[i+1].length = cpu_to_le32(skb_frag_size(frag)|LAST_FRAG);
Expand Down
86 changes: 48 additions & 38 deletions drivers/net/ethernet/aeroflex/greth.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ static inline void greth_enable_tx(struct greth_private *greth)
GRETH_REGORIN(greth->regs->control, GRETH_TXEN);
}

static inline void greth_enable_tx_and_irq(struct greth_private *greth)
{
wmb(); /* BDs must been written to memory before enabling TX */
GRETH_REGORIN(greth->regs->control, GRETH_TXEN | GRETH_TXI);
}

static inline void greth_disable_tx(struct greth_private *greth)
{
GRETH_REGANDIN(greth->regs->control, ~GRETH_TXEN);
Expand Down Expand Up @@ -447,29 +453,30 @@ greth_start_xmit(struct sk_buff *skb, struct net_device *dev)
return err;
}

static inline u16 greth_num_free_bds(u16 tx_last, u16 tx_next)
{
if (tx_next < tx_last)
return (tx_last - tx_next) - 1;
else
return GRETH_TXBD_NUM - (tx_next - tx_last) - 1;
}

static netdev_tx_t
greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
{
struct greth_private *greth = netdev_priv(dev);
struct greth_bd *bdp;
u32 status = 0, dma_addr, ctrl;
u32 status, dma_addr;
int curr_tx, nr_frags, i, err = NETDEV_TX_OK;
unsigned long flags;
u16 tx_last;

nr_frags = skb_shinfo(skb)->nr_frags;
tx_last = greth->tx_last;
rmb(); /* tx_last is updated by the poll task */

/* Clean TX Ring */
greth_clean_tx_gbit(dev);

if (greth->tx_free < nr_frags + 1) {
spin_lock_irqsave(&greth->devlock, flags);/*save from poll/irq*/
ctrl = GRETH_REGLOAD(greth->regs->control);
/* Enable TX IRQ only if not already in poll() routine */
if (ctrl & GRETH_RXI)
GRETH_REGSAVE(greth->regs->control, ctrl | GRETH_TXI);
if (greth_num_free_bds(tx_last, greth->tx_next) < nr_frags + 1) {
netif_stop_queue(dev);
spin_unlock_irqrestore(&greth->devlock, flags);
err = NETDEV_TX_BUSY;
goto out;
}
Expand All @@ -488,6 +495,8 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
/* Linear buf */
if (nr_frags != 0)
status = GRETH_TXBD_MORE;
else
status = GRETH_BD_IE;

if (skb->ip_summed == CHECKSUM_PARTIAL)
status |= GRETH_TXBD_CSALL;
Expand Down Expand Up @@ -545,14 +554,12 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)

/* Enable the descriptor chain by enabling the first descriptor */
bdp = greth->tx_bd_base + greth->tx_next;
greth_write_bd(&bdp->stat, greth_read_bd(&bdp->stat) | GRETH_BD_EN);
greth->tx_next = curr_tx;
greth->tx_free -= nr_frags + 1;

wmb();
greth_write_bd(&bdp->stat,
greth_read_bd(&bdp->stat) | GRETH_BD_EN);

spin_lock_irqsave(&greth->devlock, flags); /*save from poll/irq*/
greth_enable_tx(greth);
greth->tx_next = curr_tx;
greth_enable_tx_and_irq(greth);
spin_unlock_irqrestore(&greth->devlock, flags);

return NETDEV_TX_OK;
Expand Down Expand Up @@ -648,7 +655,6 @@ static void greth_clean_tx(struct net_device *dev)
if (greth->tx_free > 0) {
netif_wake_queue(dev);
}

}

static inline void greth_update_tx_stats(struct net_device *dev, u32 stat)
Expand All @@ -670,20 +676,22 @@ static void greth_clean_tx_gbit(struct net_device *dev)
{
struct greth_private *greth;
struct greth_bd *bdp, *bdp_last_frag;
struct sk_buff *skb;
struct sk_buff *skb = NULL;
u32 stat;
int nr_frags, i;
u16 tx_last;

greth = netdev_priv(dev);
tx_last = greth->tx_last;

while (greth->tx_free < GRETH_TXBD_NUM) {
while (tx_last != greth->tx_next) {

skb = greth->tx_skbuff[greth->tx_last];
skb = greth->tx_skbuff[tx_last];

nr_frags = skb_shinfo(skb)->nr_frags;

/* We only clean fully completed SKBs */
bdp_last_frag = greth->tx_bd_base + SKIP_TX(greth->tx_last, nr_frags);
bdp_last_frag = greth->tx_bd_base + SKIP_TX(tx_last, nr_frags);

GRETH_REGSAVE(greth->regs->status, GRETH_INT_TE | GRETH_INT_TX);
mb();
Expand All @@ -692,14 +700,14 @@ static void greth_clean_tx_gbit(struct net_device *dev)
if (stat & GRETH_BD_EN)
break;

greth->tx_skbuff[greth->tx_last] = NULL;
greth->tx_skbuff[tx_last] = NULL;

greth_update_tx_stats(dev, stat);
dev->stats.tx_bytes += skb->len;

bdp = greth->tx_bd_base + greth->tx_last;
bdp = greth->tx_bd_base + tx_last;

greth->tx_last = NEXT_TX(greth->tx_last);
tx_last = NEXT_TX(tx_last);

dma_unmap_single(greth->dev,
greth_read_bd(&bdp->addr),
Expand All @@ -708,21 +716,26 @@ static void greth_clean_tx_gbit(struct net_device *dev)

for (i = 0; i < nr_frags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
bdp = greth->tx_bd_base + greth->tx_last;
bdp = greth->tx_bd_base + tx_last;

dma_unmap_page(greth->dev,
greth_read_bd(&bdp->addr),
skb_frag_size(frag),
DMA_TO_DEVICE);

greth->tx_last = NEXT_TX(greth->tx_last);
tx_last = NEXT_TX(tx_last);
}
greth->tx_free += nr_frags+1;
dev_kfree_skb(skb);
}
if (skb) { /* skb is set only if the above while loop was entered */
wmb();
greth->tx_last = tx_last;

if (netif_queue_stopped(dev) && (greth->tx_free > (MAX_SKB_FRAGS+1)))
netif_wake_queue(dev);
if (netif_queue_stopped(dev) &&
(greth_num_free_bds(tx_last, greth->tx_next) >
(MAX_SKB_FRAGS+1)))
netif_wake_queue(dev);
}
}

static int greth_rx(struct net_device *dev, int limit)
Expand Down Expand Up @@ -965,16 +978,12 @@ static int greth_poll(struct napi_struct *napi, int budget)
greth = container_of(napi, struct greth_private, napi);

restart_txrx_poll:
if (netif_queue_stopped(greth->netdev)) {
if (greth->gbit_mac)
greth_clean_tx_gbit(greth->netdev);
else
greth_clean_tx(greth->netdev);
}

if (greth->gbit_mac) {
greth_clean_tx_gbit(greth->netdev);
work_done += greth_rx_gbit(greth->netdev, budget - work_done);
} else {
if (netif_queue_stopped(greth->netdev))
greth_clean_tx(greth->netdev);
work_done += greth_rx(greth->netdev, budget - work_done);
}

Expand All @@ -983,7 +992,8 @@ static int greth_poll(struct napi_struct *napi, int budget)
spin_lock_irqsave(&greth->devlock, flags);

ctrl = GRETH_REGLOAD(greth->regs->control);
if (netif_queue_stopped(greth->netdev)) {
if ((greth->gbit_mac && (greth->tx_last != greth->tx_next)) ||
(!greth->gbit_mac && netif_queue_stopped(greth->netdev))) {
GRETH_REGSAVE(greth->regs->control,
ctrl | GRETH_TXI | GRETH_RXI);
mask = GRETH_INT_RX | GRETH_INT_RE |
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/aeroflex/greth.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct greth_private {

u16 tx_next;
u16 tx_last;
u16 tx_free;
u16 tx_free; /* only used on 10/100Mbit */
u16 rx_cur;

struct greth_regs *regs; /* Address of controller registers. */
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ static ssize_t xpcs_reg_value_read(struct file *filp, char __user *buffer,
struct xgbe_prv_data *pdata = filp->private_data;
unsigned int value;

value = pdata->hw_if.read_mmd_regs(pdata, pdata->debugfs_xpcs_mmd,
pdata->debugfs_xpcs_reg);
value = XMDIO_READ(pdata, pdata->debugfs_xpcs_mmd,
pdata->debugfs_xpcs_reg);

return xgbe_common_read(buffer, count, ppos, value);
}
Expand All @@ -290,8 +290,8 @@ static ssize_t xpcs_reg_value_write(struct file *filp,
if (len < 0)
return len;

pdata->hw_if.write_mmd_regs(pdata, pdata->debugfs_xpcs_mmd,
pdata->debugfs_xpcs_reg, value);
XMDIO_WRITE(pdata, pdata->debugfs_xpcs_mmd, pdata->debugfs_xpcs_reg,
value);

return len;
}
Expand Down
Loading

0 comments on commit b531f5d

Please sign in to comment.