Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  be2net: Fix to avoid a crash seen on PPC with LRO and Jumbo frames.
  gro: Flush GRO packets in napi_disable_pending path
  inet: Call skb_orphan before tproxy activates
  mac80211: Use rcu_barrier() on unload.
  sunrpc: Use rcu_barrier() on unload.
  bridge: Use rcu_barrier() instead of syncronize_net() on unload.
  ipv6: Use rcu_barrier() on module unload.
  decnet: Use rcu_barrier() on module unload.
  sky2: Fix checksum endianness
  mdio add missing GPL flag
  sh_eth: remove redundant test on unsigned
  fsl_pq_mdio: Fix fsl_pq_mdio to work with modules
  ipv6: avoid wraparound for expired preferred lifetime
  tcp: missing check ACK flag of received segment in FIN-WAIT-2 state
  atl1*: add device_set_wakeup_enable to atl1*_set_wol
  Phonet: generate Netlink RTM_DELADDR when destroying a device
  Phonet: publicize the Netlink notification function
  Revert "veth: prevent oops caused by netdev destructor"
  cpmac: fix compilation failure introduced with netdev_ops conversion
  ipsec: Fix name of CAST algorithm
  • Loading branch information
Linus Torvalds committed Jun 29, 2009
2 parents 9a8fb9e + bd46cb6 commit 5298976
Show file tree
Hide file tree
Showing 25 changed files with 135 additions and 78 deletions.
2 changes: 2 additions & 0 deletions drivers/net/atl1c/atl1c_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ static int atl1c_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
if (wol->wolopts & WAKE_PHY)
adapter->wol |= AT_WUFC_LNKC;

device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);

return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/atl1e/atl1e_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ static int atl1e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
if (wol->wolopts & WAKE_PHY)
adapter->wol |= AT_WUFC_LNKC;

device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static inline char *nic_name(struct pci_dev *pdev)
#define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST)

#define BE_MAX_LRO_DESCRIPTORS 16
#define BE_MAX_FRAGS_PER_FRAME 16
#define BE_MAX_FRAGS_PER_FRAME (min((u32) 16, (u32) MAX_SKB_FRAGS))

struct be_dma_mem {
void *va;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/benet/be_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
return -EINVAL;

adapter->max_rx_coal = coalesce->rx_max_coalesced_frames;
if (adapter->max_rx_coal > MAX_SKB_FRAGS)
adapter->max_rx_coal = MAX_SKB_FRAGS - 1;
if (adapter->max_rx_coal > BE_MAX_FRAGS_PER_FRAME)
adapter->max_rx_coal = BE_MAX_FRAGS_PER_FRAME;

/* if AIC is being turned on now, start with an EQD of 0 */
if (rx_eq->enable_aic == 0 &&
Expand Down
45 changes: 32 additions & 13 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
{
struct be_queue_info *rxq = &adapter->rx_obj.q;
struct be_rx_page_info *page_info;
u16 rxq_idx, i, num_rcvd;
u16 rxq_idx, i, num_rcvd, j;
u32 pktsize, hdr_len, curr_frag_len;
u8 *start;

Expand Down Expand Up @@ -709,22 +709,33 @@ static void skb_fill_rx_data(struct be_adapter *adapter,

/* More frags present for this completion */
pktsize -= curr_frag_len; /* account for above copied frag */
for (i = 1; i < num_rcvd; i++) {
for (i = 1, j = 0; i < num_rcvd; i++) {
index_inc(&rxq_idx, rxq->len);
page_info = get_rx_page_info(adapter, rxq_idx);

curr_frag_len = min(pktsize, rx_frag_size);

skb_shinfo(skb)->frags[i].page = page_info->page;
skb_shinfo(skb)->frags[i].page_offset = page_info->page_offset;
skb_shinfo(skb)->frags[i].size = curr_frag_len;
/* Coalesce all frags from the same physical page in one slot */
if (page_info->page_offset == 0) {
/* Fresh page */
j++;
skb_shinfo(skb)->frags[j].page = page_info->page;
skb_shinfo(skb)->frags[j].page_offset =
page_info->page_offset;
skb_shinfo(skb)->frags[j].size = 0;
skb_shinfo(skb)->nr_frags++;
} else {
put_page(page_info->page);
}

skb_shinfo(skb)->frags[j].size += curr_frag_len;
skb->len += curr_frag_len;
skb->data_len += curr_frag_len;
skb_shinfo(skb)->nr_frags++;
pktsize -= curr_frag_len;

memset(page_info, 0, sizeof(*page_info));
}
BUG_ON(j > MAX_SKB_FRAGS);

done:
be_rx_stats_update(adapter, pktsize, num_rcvd);
Expand Down Expand Up @@ -786,28 +797,36 @@ static void be_rx_compl_process_lro(struct be_adapter *adapter,
struct skb_frag_struct rx_frags[BE_MAX_FRAGS_PER_FRAME];
struct be_queue_info *rxq = &adapter->rx_obj.q;
u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len;
u16 i, rxq_idx = 0, vid;
u16 i, rxq_idx = 0, vid, j;

num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp);
vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);

remaining = pkt_size;
for (i = 0; i < num_rcvd; i++) {
for (i = 0, j = -1; i < num_rcvd; i++) {
page_info = get_rx_page_info(adapter, rxq_idx);

curr_frag_len = min(remaining, rx_frag_size);

rx_frags[i].page = page_info->page;
rx_frags[i].page_offset = page_info->page_offset;
rx_frags[i].size = curr_frag_len;
remaining -= curr_frag_len;
/* Coalesce all frags from the same physical page in one slot */
if (i == 0 || page_info->page_offset == 0) {
/* First frag or Fresh page */
j++;
rx_frags[j].page = page_info->page;
rx_frags[j].page_offset = page_info->page_offset;
rx_frags[j].size = 0;
} else {
put_page(page_info->page);
}
rx_frags[j].size += curr_frag_len;

remaining -= curr_frag_len;
index_inc(&rxq_idx, rxq->len);

memset(page_info, 0, sizeof(*page_info));
}
BUG_ON(j > MAX_SKB_FRAGS);

if (likely(!vlanf)) {
lro_receive_frags(&adapter->rx_obj.lro_mgr, rx_frags, pkt_size,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/cpmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ static const struct net_device_ops cpmac_netdev_ops = {
.ndo_start_xmit = cpmac_start_xmit,
.ndo_tx_timeout = cpmac_tx_timeout,
.ndo_set_multicast_list = cpmac_set_multicast_list,
.ndo_so_ioctl = cpmac_ioctl,
.ndo_do_ioctl = cpmac_ioctl,
.ndo_set_config = cpmac_config,
.ndo_change_mtu = eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/fsl_pq_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static int fsl_pq_mdio_find_free(struct mii_bus *new_bus)
}


#ifdef CONFIG_GIANFAR
#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs)
{
struct gfar __iomem *enet_regs;
Expand All @@ -206,7 +206,7 @@ static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs)
#endif


#ifdef CONFIG_UCC_GETH
#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
{
struct device_node *np = NULL;
Expand Down Expand Up @@ -291,15 +291,15 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,
if (of_device_is_compatible(np, "fsl,gianfar-mdio") ||
of_device_is_compatible(np, "fsl,gianfar-tbi") ||
of_device_is_compatible(np, "gianfar")) {
#ifdef CONFIG_GIANFAR
#if defined(CONFIG_GIANFAR) || defined(CONFIG_GIANFAR_MODULE)
tbipa = get_gfar_tbipa(regs);
#else
err = -ENODEV;
goto err_free_irqs;
#endif
} else if (of_device_is_compatible(np, "fsl,ucc-mdio") ||
of_device_is_compatible(np, "ucc_geth_phy")) {
#ifdef CONFIG_UCC_GETH
#if defined(CONFIG_UCC_GETH) || defined(CONFIG_UCC_GETH_MODULE)
u32 id;
static u32 mii_mng_master;

Expand Down
4 changes: 4 additions & 0 deletions drivers/net/mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include <linux/mdio.h>
#include <linux/module.h>

MODULE_DESCRIPTION("Generic support for MDIO-compatible transceivers");
MODULE_AUTHOR("Copyright 2006-2009 Solarflare Communications Inc.");
MODULE_LICENSE("GPL");

/**
* mdio45_probe - probe for an MDIO (clause 45) device
* @mdio: MDIO interface
Expand Down
9 changes: 1 addition & 8 deletions drivers/net/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
struct sh_eth_private *mdp = netdev_priv(ndev);
struct sh_eth_cpu_data *cd = mdp->cd;
irqreturn_t ret = IRQ_NONE;
u32 ioaddr, boguscnt = RX_RING_SIZE;
u32 intr_status = 0;
u32 ioaddr, intr_status = 0;

ioaddr = ndev->base_addr;
spin_lock(&mdp->lock);
Expand Down Expand Up @@ -901,12 +900,6 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
if (intr_status & cd->eesr_err_check)
sh_eth_error(ndev, intr_status);

if (--boguscnt < 0) {
printk(KERN_WARNING
"%s: Too much work at interrupt, status=0x%4.4x.\n",
ndev->name, intr_status);
}

other_irq:
spin_unlock(&mdp->lock);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
if (likely(status >> 16 == (status & 0xffff))) {
skb = sky2->rx_ring[sky2->rx_next].skb;
skb->ip_summed = CHECKSUM_COMPLETE;
skb->csum = status & 0xffff;
skb->csum = le16_to_cpu(status);
} else {
printk(KERN_NOTICE PFX "%s: hardware receive "
"checksum problem (status = %#x)\n",
Expand Down
41 changes: 25 additions & 16 deletions drivers/net/veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,29 +208,31 @@ static int veth_xmit(struct sk_buff *skb, struct net_device *dev)

static struct net_device_stats *veth_get_stats(struct net_device *dev)
{
struct veth_priv *priv = netdev_priv(dev);
struct net_device_stats *dev_stats = &dev->stats;
unsigned int cpu;
struct veth_priv *priv;
struct net_device_stats *dev_stats;
int cpu;
struct veth_net_stats *stats;

priv = netdev_priv(dev);
dev_stats = &dev->stats;

dev_stats->rx_packets = 0;
dev_stats->tx_packets = 0;
dev_stats->rx_bytes = 0;
dev_stats->tx_bytes = 0;
dev_stats->tx_dropped = 0;
dev_stats->rx_dropped = 0;

if (priv->stats)
for_each_online_cpu(cpu) {
stats = per_cpu_ptr(priv->stats, cpu);
for_each_online_cpu(cpu) {
stats = per_cpu_ptr(priv->stats, cpu);

dev_stats->rx_packets += stats->rx_packets;
dev_stats->tx_packets += stats->tx_packets;
dev_stats->rx_bytes += stats->rx_bytes;
dev_stats->tx_bytes += stats->tx_bytes;
dev_stats->tx_dropped += stats->tx_dropped;
dev_stats->rx_dropped += stats->rx_dropped;
}
dev_stats->rx_packets += stats->rx_packets;
dev_stats->tx_packets += stats->tx_packets;
dev_stats->rx_bytes += stats->rx_bytes;
dev_stats->tx_bytes += stats->tx_bytes;
dev_stats->tx_dropped += stats->tx_dropped;
dev_stats->rx_dropped += stats->rx_dropped;
}

return dev_stats;
}
Expand All @@ -257,8 +259,6 @@ static int veth_close(struct net_device *dev)
netif_carrier_off(dev);
netif_carrier_off(priv->peer);

free_percpu(priv->stats);
priv->stats = NULL;
return 0;
}

Expand Down Expand Up @@ -289,6 +289,15 @@ static int veth_dev_init(struct net_device *dev)
return 0;
}

static void veth_dev_free(struct net_device *dev)
{
struct veth_priv *priv;

priv = netdev_priv(dev);
free_percpu(priv->stats);
free_netdev(dev);
}

static const struct net_device_ops veth_netdev_ops = {
.ndo_init = veth_dev_init,
.ndo_open = veth_open,
Expand All @@ -306,7 +315,7 @@ static void veth_setup(struct net_device *dev)
dev->netdev_ops = &veth_netdev_ops;
dev->ethtool_ops = &veth_ethtool_ops;
dev->features |= NETIF_F_LLTX;
dev->destructor = free_netdev;
dev->destructor = veth_dev_free;
}

/*
Expand Down
1 change: 1 addition & 0 deletions include/net/phonet/pn_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ int phonet_address_add(struct net_device *dev, u8 addr);
int phonet_address_del(struct net_device *dev, u8 addr);
u8 phonet_address_get(struct net_device *dev, u8 addr);
int phonet_address_lookup(struct net *net, u8 addr);
void phonet_address_notify(int event, struct net_device *dev, u8 addr);

#define PN_NO_ADDR 0xff

Expand Down
2 changes: 1 addition & 1 deletion net/bridge/br.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void __exit br_deinit(void)

unregister_pernet_subsys(&br_net_ops);

synchronize_net();
rcu_barrier(); /* Wait for completion of call_rcu()'s */

br_netfilter_fini();
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
Expand Down
8 changes: 5 additions & 3 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2823,9 +2823,11 @@ static void net_rx_action(struct softirq_action *h)
* move the instance around on the list at-will.
*/
if (unlikely(work == weight)) {
if (unlikely(napi_disable_pending(n)))
__napi_complete(n);
else
if (unlikely(napi_disable_pending(n))) {
local_irq_enable();
napi_complete(n);
local_irq_disable();
} else
list_move_tail(&n->poll_list, list);
}

Expand Down
2 changes: 2 additions & 0 deletions net/decnet/af_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,8 @@ static void __exit decnet_exit(void)
proc_net_remove(&init_net, "decnet");

proto_unregister(&dn_proto);

rcu_barrier_bh(); /* Wait for completion of call_rcu_bh()'s */
}
module_exit(decnet_exit);
#endif
3 changes: 3 additions & 0 deletions net/ipv4/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
/* Remove any debris in the socket control block */
memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));

/* Must drop socket now because of tproxy. */
skb_orphan(skb);

return NF_HOOK(PF_INET, NF_INET_PRE_ROUTING, skb, dev, NULL,
ip_rcv_finish);

Expand Down
3 changes: 2 additions & 1 deletion net/ipv4/tcp_minisocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
goto kill_with_rst;

/* Dup ACK? */
if (!after(TCP_SKB_CB(skb)->end_seq, tcptw->tw_rcv_nxt) ||
if (!th->ack ||
!after(TCP_SKB_CB(skb)->end_seq, tcptw->tw_rcv_nxt) ||
TCP_SKB_CB(skb)->end_seq == TCP_SKB_CB(skb)->seq) {
inet_twsk_put(tw);
return TCP_TW_SUCCESS;
Expand Down
5 changes: 4 additions & 1 deletion net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3362,7 +3362,10 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
valid = ifa->valid_lft;
if (preferred != INFINITY_LIFE_TIME) {
long tval = (jiffies - ifa->tstamp)/HZ;
preferred -= tval;
if (preferred > tval)
preferred -= tval;
else
preferred = 0;
if (valid != INFINITY_LIFE_TIME)
valid -= tval;
}
Expand Down
2 changes: 2 additions & 0 deletions net/ipv6/af_inet6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,8 @@ static void __exit inet6_exit(void)
proto_unregister(&udplitev6_prot);
proto_unregister(&udpv6_prot);
proto_unregister(&tcpv6_prot);

rcu_barrier(); /* Wait for completion of call_rcu()'s */
}
module_exit(inet6_exit);

Expand Down
3 changes: 3 additions & 0 deletions net/ipv6/ip6_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt

rcu_read_unlock();

/* Must drop socket now because of tproxy. */
skb_orphan(skb);

return NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, skb, dev, NULL,
ip6_rcv_finish);
err:
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
* should it be using the interface and enqueuing
* frames at this very time on another CPU.
*/
synchronize_rcu();
rcu_barrier(); /* Wait for RX path and call_rcu()'s */
skb_queue_purge(&sdata->u.mesh.skb_queue);
}

Expand Down
Loading

0 comments on commit 5298976

Please sign in to comment.