From 4b51cae1bfe736004ddc5ea6c7a60f0d418ec793 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Mon, 3 Dec 2012 09:22:43 -0500 Subject: [PATCH] --- yaml --- r: 341746 b: refs/heads/master c: 7c47bab62192d4dd6ba7f7633f2fb94d259e964e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/arcnet/com20020-pci.c | 6 +- .../net/ethernet/broadcom/bnx2x/bnx2x_main.c | 8 -- .../net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 4 +- trunk/drivers/net/ethernet/dlink/sundance.c | 81 +------------------ trunk/drivers/net/ethernet/marvell/sky2.c | 15 ++-- trunk/drivers/net/ethernet/realtek/8139cp.c | 23 +++++- .../net/ethernet/stmicro/stmmac/dwmac_dma.h | 2 + trunk/drivers/net/irda/ep7211-sir.c | 73 ++++++++++------- trunk/drivers/net/tun.c | 35 +++++--- trunk/drivers/vhost/net.c | 3 - trunk/include/net/sctp/sctp.h | 12 --- trunk/include/net/sctp/structs.h | 36 --------- trunk/include/net/sctp/user.h | 27 ------- trunk/include/uapi/linux/if_tun.h | 2 - trunk/net/ipv6/addrconf.c | 2 +- trunk/net/ipv6/route.c | 24 +++--- trunk/net/sctp/associola.c | 10 +-- trunk/net/sctp/endpointola.c | 5 +- trunk/net/sctp/inqueue.c | 2 - trunk/net/sctp/output.c | 14 ++-- trunk/net/sctp/outqueue.c | 12 +-- trunk/net/sctp/sm_make_chunk.c | 5 +- trunk/net/sctp/sm_sideeffect.c | 1 - trunk/net/sctp/sm_statefuns.c | 10 +-- trunk/net/sctp/socket.c | 69 ---------------- trunk/net/sctp/transport.c | 2 - 27 files changed, 130 insertions(+), 355 deletions(-) diff --git a/[refs] b/[refs] index 75a9509b95d5..23c83719e904 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5a81f0b9025867efb999d14a8dfc1907c5a4c3b +refs/heads/master: 7c47bab62192d4dd6ba7f7633f2fb94d259e964e diff --git a/trunk/drivers/net/arcnet/com20020-pci.c b/trunk/drivers/net/arcnet/com20020-pci.c index d427493997b6..cbc44f53755a 100644 --- a/trunk/drivers/net/arcnet/com20020-pci.c +++ b/trunk/drivers/net/arcnet/com20020-pci.c @@ -61,7 +61,7 @@ module_param(clockp, int, 0); module_param(clockm, int, 0); MODULE_LICENSE("GPL"); -static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) +static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct net_device *dev; struct arcnet_local *lp; @@ -135,7 +135,7 @@ static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_de return err; } -static void __devexit com20020pci_remove(struct pci_dev *pdev) +static void com20020pci_remove(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); unregister_netdev(dev); @@ -178,7 +178,7 @@ static struct pci_driver com20020pci_driver = { .name = "com20020", .id_table = com20020pci_id_table, .probe = com20020pci_probe, - .remove = __devexit_p(com20020pci_remove), + .remove = com20020pci_remove, }; static int __init com20020pci_init(void) diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 6064294802af..c8ec3fcd2d35 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -11570,14 +11570,6 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, goto err_out_disable; } - pci_read_config_dword(pdev, PCICFG_REVISION_ID_OFFSET, &pci_cfg_dword); - if ((pci_cfg_dword & PCICFG_REVESION_ID_MASK) == - PCICFG_REVESION_ID_ERROR_VAL) { - pr_err("PCI device error, probably due to fan failure, aborting\n"); - rc = -ENODEV; - goto err_out_disable; - } - if (atomic_read(&pdev->enable_cnt) == 1) { rc = pci_request_regions(pdev, DRV_MODULE_NAME); if (rc) { diff --git a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h index bc2f65b32649..87cf37c71b30 100644 --- a/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h @@ -6160,9 +6160,7 @@ #define PCICFG_COMMAND_INT_DISABLE (1<<10) #define PCICFG_COMMAND_RESERVED (0x1f<<11) #define PCICFG_STATUS_OFFSET 0x06 -#define PCICFG_REVISION_ID_OFFSET 0x08 -#define PCICFG_REVESION_ID_MASK 0xff -#define PCICFG_REVESION_ID_ERROR_VAL 0xff +#define PCICFG_REVESION_ID_OFFSET 0x08 #define PCICFG_CACHE_LINE_SIZE 0x0c #define PCICFG_LATENCY_TIMER 0x0d #define PCICFG_BAR_1_LOW 0x10 diff --git a/trunk/drivers/net/ethernet/dlink/sundance.c b/trunk/drivers/net/ethernet/dlink/sundance.c index bbeb4c7a85ba..3b83588e51f6 100644 --- a/trunk/drivers/net/ethernet/dlink/sundance.c +++ b/trunk/drivers/net/ethernet/dlink/sundance.c @@ -259,7 +259,6 @@ enum alta_offsets { EECtrl = 0x36, FlashAddr = 0x40, FlashData = 0x44, - WakeEvent = 0x45, TxStatus = 0x46, TxFrameId = 0x47, DownCounter = 0x18, @@ -334,14 +333,6 @@ enum mac_ctrl1_bits { RxEnable=0x0800, RxDisable=0x1000, RxEnabled=0x2000, }; -/* Bits in WakeEvent register. */ -enum wake_event_bits { - WakePktEnable = 0x01, - MagicPktEnable = 0x02, - LinkEventEnable = 0x04, - WolEnable = 0x80, -}; - /* The Rx and Tx buffer descriptors. */ /* Note that using only 32 bit fields simplifies conversion to big-endian architectures. */ @@ -401,7 +392,6 @@ struct netdev_private { unsigned int default_port:4; /* Last dev->if_port value. */ unsigned int an_enable:1; unsigned int speed; - unsigned int wol_enabled:1; /* Wake on LAN enabled */ struct tasklet_struct rx_tasklet; struct tasklet_struct tx_tasklet; int budget; @@ -839,7 +829,7 @@ static int netdev_open(struct net_device *dev) unsigned long flags; int i; - sundance_reset(dev, 0x00ff << 16); + /* Do we need to reset the chip??? */ i = request_irq(irq, intr_handler, IRQF_SHARED, dev->name, dev); if (i) @@ -887,10 +877,6 @@ static int netdev_open(struct net_device *dev) iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); - /* Disable Wol */ - iowrite8(ioread8(ioaddr + WakeEvent) | 0x00, ioaddr + WakeEvent); - np->wol_enabled = 0; - if (netif_msg_ifup(np)) printk(KERN_DEBUG "%s: Done netdev_open(), status: Rx %x Tx %x " "MAC Control %x, %4.4x %4.4x.\n", @@ -1729,60 +1715,6 @@ static void get_ethtool_stats(struct net_device *dev, data[i++] = np->xstats.rx_mcasts; } -#ifdef CONFIG_PM - -static void sundance_get_wol(struct net_device *dev, - struct ethtool_wolinfo *wol) -{ - struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = np->base; - u8 wol_bits; - - wol->wolopts = 0; - - wol->supported = (WAKE_PHY | WAKE_MAGIC); - if (!np->wol_enabled) - return; - - wol_bits = ioread8(ioaddr + WakeEvent); - if (wol_bits & MagicPktEnable) - wol->wolopts |= WAKE_MAGIC; - if (wol_bits & LinkEventEnable) - wol->wolopts |= WAKE_PHY; -} - -static int sundance_set_wol(struct net_device *dev, - struct ethtool_wolinfo *wol) -{ - struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = np->base; - u8 wol_bits; - - if (!device_can_wakeup(&np->pci_dev->dev)) - return -EOPNOTSUPP; - - np->wol_enabled = !!(wol->wolopts); - wol_bits = ioread8(ioaddr + WakeEvent); - wol_bits &= ~(WakePktEnable | MagicPktEnable | - LinkEventEnable | WolEnable); - - if (np->wol_enabled) { - if (wol->wolopts & WAKE_MAGIC) - wol_bits |= (MagicPktEnable | WolEnable); - if (wol->wolopts & WAKE_PHY) - wol_bits |= (LinkEventEnable | WolEnable); - } - iowrite8(wol_bits, ioaddr + WakeEvent); - - device_set_wakeup_enable(&np->pci_dev->dev, np->wol_enabled); - - return 0; -} -#else -#define sundance_get_wol NULL -#define sundance_set_wol NULL -#endif /* CONFIG_PM */ - static const struct ethtool_ops ethtool_ops = { .begin = check_if_running, .get_drvinfo = get_drvinfo, @@ -1790,8 +1722,6 @@ static const struct ethtool_ops ethtool_ops = { .set_settings = set_settings, .nway_reset = nway_reset, .get_link = get_link, - .get_wol = sundance_get_wol, - .set_wol = sundance_set_wol, .get_msglevel = get_msglevel, .set_msglevel = set_msglevel, .get_strings = get_strings, @@ -1937,8 +1867,6 @@ static void __devexit sundance_remove1 (struct pci_dev *pdev) static int sundance_suspend(struct pci_dev *pci_dev, pm_message_t state) { struct net_device *dev = pci_get_drvdata(pci_dev); - struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = np->base; if (!netif_running(dev)) return 0; @@ -1947,12 +1875,6 @@ static int sundance_suspend(struct pci_dev *pci_dev, pm_message_t state) netif_device_detach(dev); pci_save_state(pci_dev); - if (np->wol_enabled) { - iowrite8(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode); - iowrite16(RxEnable, ioaddr + MACCtrl1); - } - pci_enable_wake(pci_dev, pci_choose_state(pci_dev, state), - np->wol_enabled); pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state)); return 0; @@ -1968,7 +1890,6 @@ static int sundance_resume(struct pci_dev *pci_dev) pci_set_power_state(pci_dev, PCI_D0); pci_restore_state(pci_dev); - pci_enable_wake(pci_dev, PCI_D0, 0); err = netdev_open(dev); if (err) { diff --git a/trunk/drivers/net/ethernet/marvell/sky2.c b/trunk/drivers/net/ethernet/marvell/sky2.c index 19e6494f6ed3..78946feab4a2 100644 --- a/trunk/drivers/net/ethernet/marvell/sky2.c +++ b/trunk/drivers/net/ethernet/marvell/sky2.c @@ -4919,13 +4919,13 @@ static int __devinit sky2_probe(struct pci_dev *pdev, err = pci_read_config_dword(pdev, PCI_DEV_REG2, ®); if (err) { dev_err(&pdev->dev, "PCI read config failed\n"); - goto err_out_disable; + goto err_out; } if (~reg == 0) { dev_err(&pdev->dev, "PCI configuration read error\n"); err = -EIO; - goto err_out_disable; + goto err_out; } err = pci_request_regions(pdev, DRV_NAME); @@ -5012,11 +5012,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev, if (!disable_msi && pci_enable_msi(pdev) == 0) { err = sky2_test_msi(hw); - if (err) { + if (err == -EOPNOTSUPP) pci_disable_msi(pdev); - if (err != -EOPNOTSUPP) - goto err_out_free_netdev; - } + else if (err) + goto err_out_free_netdev; } err = register_netdev(dev); @@ -5064,10 +5063,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev, err_out_free_dev1: free_netdev(dev1); err_out_unregister: - unregister_netdev(dev); -err_out_free_netdev: if (hw->flags & SKY2_HW_USE_MSI) pci_disable_msi(pdev); + unregister_netdev(dev); +err_out_free_netdev: free_netdev(dev); err_out_free_pci: pci_free_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le), diff --git a/trunk/drivers/net/ethernet/realtek/8139cp.c b/trunk/drivers/net/ethernet/realtek/8139cp.c index 0da3f5e9b1a5..6cb96b4afdf5 100644 --- a/trunk/drivers/net/ethernet/realtek/8139cp.c +++ b/trunk/drivers/net/ethernet/realtek/8139cp.c @@ -1226,9 +1226,12 @@ static void cp_tx_timeout(struct net_device *dev) spin_unlock_irqrestore(&cp->lock, flags); } +#ifdef BROKEN static int cp_change_mtu(struct net_device *dev, int new_mtu) { struct cp_private *cp = netdev_priv(dev); + int rc; + unsigned long flags; /* check for invalid MTU, according to hardware limits */ if (new_mtu < CP_MIN_MTU || new_mtu > CP_MAX_MTU) @@ -1241,12 +1244,22 @@ static int cp_change_mtu(struct net_device *dev, int new_mtu) return 0; } - /* network IS up, close it, reset MTU, and come up again. */ - cp_close(dev); + spin_lock_irqsave(&cp->lock, flags); + + cp_stop_hw(cp); /* stop h/w and free rings */ + cp_clean_rings(cp); + dev->mtu = new_mtu; - cp_set_rxbufsize(cp); - return cp_open(dev); + cp_set_rxbufsize(cp); /* set new rx buf size */ + + rc = cp_init_rings(cp); /* realloc and restart h/w */ + cp_start_hw(cp); + + spin_unlock_irqrestore(&cp->lock, flags); + + return rc; } +#endif /* BROKEN */ static const char mii_2_8139_map[8] = { BasicModeCtrl, @@ -1822,7 +1835,9 @@ static const struct net_device_ops cp_netdev_ops = { .ndo_start_xmit = cp_start_xmit, .ndo_tx_timeout = cp_tx_timeout, .ndo_set_features = cp_set_features, +#ifdef BROKEN .ndo_change_mtu = cp_change_mtu, +#endif #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = cp_poll_controller, diff --git a/trunk/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h b/trunk/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h index ab4896ecac1c..807f30371e49 100644 --- a/trunk/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h +++ b/trunk/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h @@ -80,6 +80,8 @@ #define DMA_STATUS_GPI 0x10000000 /* PMT interrupt */ #define DMA_STATUS_GMI 0x08000000 /* MMC interrupt */ #define DMA_STATUS_GLI 0x04000000 /* GMAC Line interface int */ +#define DMA_STATUS_GMI 0x08000000 +#define DMA_STATUS_GLI 0x04000000 #define DMA_STATUS_EB_MASK 0x00380000 /* Error Bits Mask */ #define DMA_STATUS_EB_TX_ABORT 0x00080000 /* Error Bits - TX Abort */ #define DMA_STATUS_EB_RX_ABORT 0x00100000 /* Error Bits - RX Abort */ diff --git a/trunk/drivers/net/irda/ep7211-sir.c b/trunk/drivers/net/irda/ep7211-sir.c index 5fe1f4dd3369..f83c5b881d2d 100644 --- a/trunk/drivers/net/irda/ep7211-sir.c +++ b/trunk/drivers/net/irda/ep7211-sir.c @@ -1,18 +1,52 @@ /* - * IR port driver for the Cirrus Logic CLPS711X processors + * IR port driver for the Cirrus Logic EP7211 processor. * * Copyright 2001, Blue Mug Inc. All rights reserved. * Copyright 2007, Samuel Ortiz */ - #include -#include +#include +#include +#include +#include + +#include +#include +#include #include #include "sir-dev.h" -static int clps711x_dongle_open(struct sir_dev *dev) +#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */ +#define MAX_DELAY 10000 /* 1 ms */ + +static int ep7211_open(struct sir_dev *dev); +static int ep7211_close(struct sir_dev *dev); +static int ep7211_change_speed(struct sir_dev *dev, unsigned speed); +static int ep7211_reset(struct sir_dev *dev); + +static struct dongle_driver ep7211 = { + .owner = THIS_MODULE, + .driver_name = "EP7211 IR driver", + .type = IRDA_EP7211_DONGLE, + .open = ep7211_open, + .close = ep7211_close, + .reset = ep7211_reset, + .set_speed = ep7211_change_speed, +}; + +static int __init ep7211_sir_init(void) +{ + return irda_register_dongle(&ep7211); +} + +static void __exit ep7211_sir_cleanup(void) +{ + irda_unregister_dongle(&ep7211); +} + +static int ep7211_open(struct sir_dev *dev) { unsigned int syscon; @@ -24,7 +58,7 @@ static int clps711x_dongle_open(struct sir_dev *dev) return 0; } -static int clps711x_dongle_close(struct sir_dev *dev) +static int ep7211_close(struct sir_dev *dev) { unsigned int syscon; @@ -36,35 +70,20 @@ static int clps711x_dongle_close(struct sir_dev *dev) return 0; } -static struct dongle_driver clps711x_dongle = { - .owner = THIS_MODULE, - .driver_name = "EP7211 IR driver", - .type = IRDA_EP7211_DONGLE, - .open = clps711x_dongle_open, - .close = clps711x_dongle_close, -}; - -static int clps711x_sir_probe(struct platform_device *pdev) +static int ep7211_change_speed(struct sir_dev *dev, unsigned speed) { - return irda_register_dongle(&clps711x_dongle); + return 0; } -static int clps711x_sir_remove(struct platform_device *pdev) +static int ep7211_reset(struct sir_dev *dev) { - return irda_unregister_dongle(&clps711x_dongle); + return 0; } -static struct platform_driver clps711x_sir_driver = { - .driver = { - .name = "sir-clps711x", - .owner = THIS_MODULE, - }, - .probe = clps711x_sir_probe, - .remove = clps711x_sir_remove, -}; -module_platform_driver(clps711x_sir_driver); - MODULE_AUTHOR("Samuel Ortiz "); MODULE_DESCRIPTION("EP7211 IR dongle driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("irda-dongle-13"); /* IRDA_EP7211_DONGLE */ + +module_init(ep7211_sir_init); +module_exit(ep7211_sir_cleanup); diff --git a/trunk/drivers/net/tun.c b/trunk/drivers/net/tun.c index a1b2389e6d7f..607a3a5981c6 100644 --- a/trunk/drivers/net/tun.c +++ b/trunk/drivers/net/tun.c @@ -493,6 +493,9 @@ static int tun_attach(struct tun_struct *tun, struct file *file) tun_set_real_num_queues(tun); + if (tun->numqueues == 1) + netif_carrier_on(tun->dev); + /* device is allowed to go away first, so no need to hold extra * refcnt. */ @@ -690,8 +693,21 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) * number of queues. */ if (skb_queue_len(&tfile->socket.sk->sk_receive_queue) - >= dev->tx_queue_len / tun->numqueues) - goto drop; + >= dev->tx_queue_len / tun->numqueues){ + if (!(tun->flags & TUN_ONE_QUEUE)) { + /* Normal queueing mode. */ + /* Packet scheduler handles dropping of further packets. */ + netif_stop_subqueue(dev, txq); + + /* We won't see all dropped packets individually, so overrun + * error is more appropriate. */ + dev->stats.tx_fifo_errors++; + } else { + /* Single queue mode. + * Driver handles dropping of all packets itself. */ + goto drop; + } + } /* Orphan the skb - required as we might hang on to it * for indefinite time. */ @@ -1306,6 +1322,7 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile, schedule(); continue; } + netif_wake_subqueue(tun->dev, tfile->queue_index); ret = tun_put_user(tun, tfile, skb, iv, len); kfree_skb(skb); @@ -1468,9 +1485,6 @@ static int tun_flags(struct tun_struct *tun) if (tun->flags & TUN_NO_PI) flags |= IFF_NO_PI; - /* This flag has no real effect. We track the value for backwards - * compatibility. - */ if (tun->flags & TUN_ONE_QUEUE) flags |= IFF_ONE_QUEUE; @@ -1598,10 +1612,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) TUN_USER_FEATURES; dev->features = dev->hw_features; - err = tun_attach(tun, file); - if (err < 0) - goto err_free_dev; - err = register_netdevice(tun->dev); if (err < 0) goto err_free_dev; @@ -1611,7 +1621,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) device_create_file(&tun->dev->dev, &dev_attr_group)) pr_err("Failed to create tun sysfs files\n"); - netif_carrier_on(tun->dev); + err = tun_attach(tun, file); + if (err < 0) + goto err_free_dev; } tun_debug(KERN_INFO, tun, "tun_set_iff\n"); @@ -1621,9 +1633,6 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) else tun->flags &= ~TUN_NO_PI; - /* This flag has no real effect. We track the value for backwards - * compatibility. - */ if (ifr->ifr_flags & IFF_ONE_QUEUE) tun->flags |= TUN_ONE_QUEUE; else diff --git a/trunk/drivers/vhost/net.c b/trunk/drivers/vhost/net.c index ff6c91995c96..67898fa9c447 100644 --- a/trunk/drivers/vhost/net.c +++ b/trunk/drivers/vhost/net.c @@ -823,9 +823,6 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) r = vhost_init_used(vq); if (r) goto err_vq; - - n->tx_packets = 0; - n->tx_zcopy_err = 0; } mutex_unlock(&vq->mutex); diff --git a/trunk/include/net/sctp/sctp.h b/trunk/include/net/sctp/sctp.h index 7fdf298a47ef..9c6414f553f9 100644 --- a/trunk/include/net/sctp/sctp.h +++ b/trunk/include/net/sctp/sctp.h @@ -272,18 +272,6 @@ struct sctp_mib { unsigned long mibs[SCTP_MIB_MAX]; }; -/* helper function to track stats about max rto and related transport */ -static inline void sctp_max_rto(struct sctp_association *asoc, - struct sctp_transport *trans) -{ - if (asoc->stats.max_obs_rto < (__u64)trans->rto) { - asoc->stats.max_obs_rto = trans->rto; - memset(&asoc->stats.obs_rto_ipaddr, 0, - sizeof(struct sockaddr_storage)); - memcpy(&asoc->stats.obs_rto_ipaddr, &trans->ipaddr, - trans->af_specific->sockaddr_len); - } -} /* Print debugging messages. */ #if SCTP_DEBUG diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index c2521016d646..2b2f61dd4036 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -1312,40 +1312,6 @@ struct sctp_inithdr_host { __u32 initial_tsn; }; -/* SCTP_GET_ASSOC_STATS counters */ -struct sctp_priv_assoc_stats { - /* Maximum observed rto in the association during subsequent - * observations. Value is set to 0 if no RTO measurement took place - * The transport where the max_rto was observed is returned in - * obs_rto_ipaddr - */ - struct sockaddr_storage obs_rto_ipaddr; - __u64 max_obs_rto; - /* Total In and Out SACKs received and sent */ - __u64 isacks; - __u64 osacks; - /* Total In and Out packets received and sent */ - __u64 opackets; - __u64 ipackets; - /* Total retransmitted chunks */ - __u64 rtxchunks; - /* TSN received > next expected */ - __u64 outofseqtsns; - /* Duplicate Chunks received */ - __u64 idupchunks; - /* Gap Ack Blocks received */ - __u64 gapcnt; - /* Unordered data chunks sent and received */ - __u64 ouodchunks; - __u64 iuodchunks; - /* Ordered data chunks sent and received */ - __u64 oodchunks; - __u64 iodchunks; - /* Control chunks sent and received */ - __u64 octrlchunks; - __u64 ictrlchunks; -}; - /* RFC2960 * * 12. Recommended Transmission Control Block (TCB) Parameters @@ -1864,8 +1830,6 @@ struct sctp_association { __u8 need_ecne:1, /* Need to send an ECNE Chunk? */ temp:1; /* Is it a temporary association? */ - - struct sctp_priv_assoc_stats stats; }; diff --git a/trunk/include/net/sctp/user.h b/trunk/include/net/sctp/user.h index 9a0ae091366d..1b02d7ad453b 100644 --- a/trunk/include/net/sctp/user.h +++ b/trunk/include/net/sctp/user.h @@ -107,7 +107,6 @@ typedef __s32 sctp_assoc_t; #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */ #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ -#define SCTP_GET_ASSOC_STATS 112 /* Read only */ /* * 5.2.1 SCTP Initiation Structure (SCTP_INIT) @@ -720,32 +719,6 @@ struct sctp_getaddrs { __u8 addrs[0]; /*output, variable size*/ }; -/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves - * association stats. All stats are counts except sas_maxrto and - * sas_obs_rto_ipaddr. maxrto is the max observed rto + transport since - * the last call. Will return 0 when RTO was not update since last call - */ -struct sctp_assoc_stats { - sctp_assoc_t sas_assoc_id; /* Input */ - /* Transport of observed max RTO */ - struct sockaddr_storage sas_obs_rto_ipaddr; - __u64 sas_maxrto; /* Maximum Observed RTO for period */ - __u64 sas_isacks; /* SACKs received */ - __u64 sas_osacks; /* SACKs sent */ - __u64 sas_opackets; /* Packets sent */ - __u64 sas_ipackets; /* Packets received */ - __u64 sas_rtxchunks; /* Retransmitted Chunks */ - __u64 sas_outofseqtsns;/* TSN received > next expected */ - __u64 sas_idupchunks; /* Dups received (ordered+unordered) */ - __u64 sas_gapcnt; /* Gap Acknowledgements Received */ - __u64 sas_ouodchunks; /* Unordered data chunks sent */ - __u64 sas_iuodchunks; /* Unordered data chunks received */ - __u64 sas_oodchunks; /* Ordered data chunks sent */ - __u64 sas_iodchunks; /* Ordered data chunks received */ - __u64 sas_octrlchunks; /* Control chunks sent */ - __u64 sas_ictrlchunks; /* Control chunks received */ -}; - /* These are bit fields for msghdr->msg_flags. See section 5.1. */ /* On user space Linux, these live in as an enum. */ enum sctp_msg_flags { diff --git a/trunk/include/uapi/linux/if_tun.h b/trunk/include/uapi/linux/if_tun.h index 2835b85fd46d..958497ad5bb5 100644 --- a/trunk/include/uapi/linux/if_tun.h +++ b/trunk/include/uapi/linux/if_tun.h @@ -31,7 +31,6 @@ #define TUN_FASYNC 0x0010 #define TUN_NOCHECKSUM 0x0020 #define TUN_NO_PI 0x0040 -/* This flag has no real effect */ #define TUN_ONE_QUEUE 0x0080 #define TUN_PERSIST 0x0100 #define TUN_VNET_HDR 0x0200 @@ -61,7 +60,6 @@ #define IFF_TUN 0x0001 #define IFF_TAP 0x0002 #define IFF_NO_PI 0x1000 -/* This flag has no real effect */ #define IFF_ONE_QUEUE 0x2000 #define IFF_VNET_HDR 0x4000 #define IFF_TUN_EXCL 0x8000 diff --git a/trunk/net/ipv6/addrconf.c b/trunk/net/ipv6/addrconf.c index 22ae75d54017..4b644f656c41 100644 --- a/trunk/net/ipv6/addrconf.c +++ b/trunk/net/ipv6/addrconf.c @@ -2988,7 +2988,7 @@ static void addrconf_rs_timer(unsigned long data) if (idev->dead || !(idev->if_flags & IF_READY)) goto out; - if (!ipv6_accept_ra(idev)) + if (idev->cnf.forwarding) goto out; /* Announcement received after solicitation was sent */ diff --git a/trunk/net/ipv6/route.c b/trunk/net/ipv6/route.c index e229a3bc345d..8f124f575116 100644 --- a/trunk/net/ipv6/route.c +++ b/trunk/net/ipv6/route.c @@ -544,32 +544,35 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif) return 0; } -static inline bool rt6_check_neigh(struct rt6_info *rt) +static inline int rt6_check_neigh(struct rt6_info *rt) { struct neighbour *neigh; - bool ret = false; + int m; neigh = rt->n; if (rt->rt6i_flags & RTF_NONEXTHOP || !(rt->rt6i_flags & RTF_GATEWAY)) - ret = true; + m = 1; else if (neigh) { read_lock_bh(&neigh->lock); if (neigh->nud_state & NUD_VALID) - ret = true; + m = 2; #ifdef CONFIG_IPV6_ROUTER_PREF - else if (!(neigh->nud_state & NUD_FAILED)) - ret = true; + else if (neigh->nud_state & NUD_FAILED) + m = 0; #endif + else + m = 1; read_unlock_bh(&neigh->lock); - } - return ret; + } else + m = 0; + return m; } static int rt6_score_route(struct rt6_info *rt, int oif, int strict) { - int m; + int m, n; m = rt6_check_dev(rt, oif); if (!m && (strict & RT6_LOOKUP_F_IFACE)) @@ -577,7 +580,8 @@ static int rt6_score_route(struct rt6_info *rt, int oif, #ifdef CONFIG_IPV6_ROUTER_PREF m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; #endif - if (!rt6_check_neigh(rt) && (strict & RT6_LOOKUP_F_REACHABLE)) + n = rt6_check_neigh(rt); + if (!n && (strict & RT6_LOOKUP_F_REACHABLE)) return -1; return m; } diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index ba3f9cc4c047..b1ef3bc301a5 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -321,9 +321,6 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a asoc->default_timetolive = sp->default_timetolive; asoc->default_rcv_context = sp->default_rcv_context; - /* SCTP_GET_ASSOC_STATS COUNTERS */ - memset(&asoc->stats, 0, sizeof(struct sctp_priv_assoc_stats)); - /* AUTH related initializations */ INIT_LIST_HEAD(&asoc->endpoint_shared_keys); err = sctp_auth_asoc_copy_shkeys(ep, asoc, gfp); @@ -763,7 +760,6 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, /* Set the transport's RTO.initial value */ peer->rto = asoc->rto_initial; - sctp_max_rto(asoc, peer); /* Set the peer's active state. */ peer->state = peer_state; @@ -1156,12 +1152,8 @@ static void sctp_assoc_bh_rcv(struct work_struct *work) */ if (sctp_chunk_is_data(chunk)) asoc->peer.last_data_from = chunk->transport; - else { + else SCTP_INC_STATS(net, SCTP_MIB_INCTRLCHUNKS); - asoc->stats.ictrlchunks++; - if (chunk->chunk_hdr->type == SCTP_CID_SACK) - asoc->stats.isacks++; - } if (chunk->transport) chunk->transport->last_time_heard = jiffies; diff --git a/trunk/net/sctp/endpointola.c b/trunk/net/sctp/endpointola.c index 32ab55b18281..1859e2bc83d1 100644 --- a/trunk/net/sctp/endpointola.c +++ b/trunk/net/sctp/endpointola.c @@ -480,11 +480,8 @@ static void sctp_endpoint_bh_rcv(struct work_struct *work) */ if (asoc && sctp_chunk_is_data(chunk)) asoc->peer.last_data_from = chunk->transport; - else { + else SCTP_INC_STATS(sock_net(ep->base.sk), SCTP_MIB_INCTRLCHUNKS); - if (asoc) - asoc->stats.ictrlchunks++; - } if (chunk->transport) chunk->transport->last_time_heard = jiffies; diff --git a/trunk/net/sctp/inqueue.c b/trunk/net/sctp/inqueue.c index 2d5ad280de38..397296fb156f 100644 --- a/trunk/net/sctp/inqueue.c +++ b/trunk/net/sctp/inqueue.c @@ -104,8 +104,6 @@ void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *chunk) * on the BH related data structures. */ list_add_tail(&chunk->list, &q->in_chunk_list); - if (chunk->asoc) - chunk->asoc->stats.ipackets++; q->immediate.func(&q->immediate); } diff --git a/trunk/net/sctp/output.c b/trunk/net/sctp/output.c index f5200a2ad852..4e90188bf489 100644 --- a/trunk/net/sctp/output.c +++ b/trunk/net/sctp/output.c @@ -311,8 +311,6 @@ static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet, case SCTP_CID_SACK: packet->has_sack = 1; - if (chunk->asoc) - chunk->asoc->stats.osacks++; break; case SCTP_CID_AUTH: @@ -586,13 +584,11 @@ int sctp_packet_transmit(struct sctp_packet *packet) */ /* Dump that on IP! */ - if (asoc) { - asoc->stats.opackets++; - if (asoc->peer.last_sent_to != tp) - /* Considering the multiple CPU scenario, this is a - * "correcter" place for last_sent_to. --xguo - */ - asoc->peer.last_sent_to = tp; + if (asoc && asoc->peer.last_sent_to != tp) { + /* Considering the multiple CPU scenario, this is a + * "correcter" place for last_sent_to. --xguo + */ + asoc->peer.last_sent_to = tp; } if (has_data) { diff --git a/trunk/net/sctp/outqueue.c b/trunk/net/sctp/outqueue.c index 379c81dee9d1..1b4a7f8ec3fd 100644 --- a/trunk/net/sctp/outqueue.c +++ b/trunk/net/sctp/outqueue.c @@ -667,7 +667,6 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, chunk->fast_retransmit = SCTP_DONT_FRTX; q->empty = 0; - q->asoc->stats.rtxchunks++; break; } @@ -877,14 +876,12 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) if (status != SCTP_XMIT_OK) { /* put the chunk back */ list_add(&chunk->list, &q->control_chunk_list); - } else { - asoc->stats.octrlchunks++; + } else if (chunk->chunk_hdr->type == SCTP_CID_FWD_TSN) { /* PR-SCTP C5) If a FORWARD TSN is sent, the * sender MUST assure that at least one T3-rtx * timer is running. */ - if (chunk->chunk_hdr->type == SCTP_CID_FWD_TSN) - sctp_transport_reset_timers(transport); + sctp_transport_reset_timers(transport); } break; @@ -1058,10 +1055,6 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) */ if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING) chunk->chunk_hdr->flags |= SCTP_DATA_SACK_IMM; - if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) - asoc->stats.ouodchunks++; - else - asoc->stats.oodchunks++; break; @@ -1169,7 +1162,6 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk) sack_ctsn = ntohl(sack->cum_tsn_ack); gap_ack_blocks = ntohs(sack->num_gap_ack_blocks); - asoc->stats.gapcnt += gap_ack_blocks; /* * SFR-CACC algorithm: * On receipt of a SACK the sender SHOULD execute the diff --git a/trunk/net/sctp/sm_make_chunk.c b/trunk/net/sctp/sm_make_chunk.c index e1c5fc2be6b8..e0f01a4e8cd6 100644 --- a/trunk/net/sctp/sm_make_chunk.c +++ b/trunk/net/sctp/sm_make_chunk.c @@ -804,11 +804,10 @@ struct sctp_chunk *sctp_make_sack(const struct sctp_association *asoc) gabs); /* Add the duplicate TSN information. */ - if (num_dup_tsns) { - aptr->stats.idupchunks += num_dup_tsns; + if (num_dup_tsns) sctp_addto_chunk(retval, sizeof(__u32) * num_dup_tsns, sctp_tsnmap_get_dups(map)); - } + /* Once we have a sack generated, check to see what our sack * generation is, if its 0, reset the transports to 0, and reset * the association generation to 1 diff --git a/trunk/net/sctp/sm_sideeffect.c b/trunk/net/sctp/sm_sideeffect.c index c9577754a708..c0769569b05d 100644 --- a/trunk/net/sctp/sm_sideeffect.c +++ b/trunk/net/sctp/sm_sideeffect.c @@ -542,7 +542,6 @@ static void sctp_do_8_2_transport_strike(sctp_cmd_seq_t *commands, */ if (!is_hb || transport->hb_sent) { transport->rto = min((transport->rto * 2), transport->asoc->rto_max); - sctp_max_rto(asoc, transport); } } diff --git a/trunk/net/sctp/sm_statefuns.c b/trunk/net/sctp/sm_statefuns.c index ebcd1eedb115..e92079d27eae 100644 --- a/trunk/net/sctp/sm_statefuns.c +++ b/trunk/net/sctp/sm_statefuns.c @@ -6133,8 +6133,6 @@ static int sctp_eat_data(const struct sctp_association *asoc, /* The TSN is too high--silently discard the chunk and * count on it getting retransmitted later. */ - if (chunk->asoc) - chunk->asoc->stats.outofseqtsns++; return SCTP_IERROR_HIGH_TSN; } else if (tmp > 0) { /* This is a duplicate. Record it. */ @@ -6234,14 +6232,10 @@ static int sctp_eat_data(const struct sctp_association *asoc, /* Note: Some chunks may get overcounted (if we drop) or overcounted * if we renege and the chunk arrives again. */ - if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) { + if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) SCTP_INC_STATS(net, SCTP_MIB_INUNORDERCHUNKS); - if (chunk->asoc) - chunk->asoc->stats.iuodchunks++; - } else { + else { SCTP_INC_STATS(net, SCTP_MIB_INORDERCHUNKS); - if (chunk->asoc) - chunk->asoc->stats.iodchunks++; ordered = 1; } diff --git a/trunk/net/sctp/socket.c b/trunk/net/sctp/socket.c index 9e65758cb038..bc1624913c42 100644 --- a/trunk/net/sctp/socket.c +++ b/trunk/net/sctp/socket.c @@ -611,7 +611,6 @@ static int sctp_send_asconf_add_ip(struct sock *sk, 2*asoc->pathmtu, 4380)); trans->ssthresh = asoc->peer.i.a_rwnd; trans->rto = asoc->rto_initial; - sctp_max_rto(asoc, trans); trans->rtt = trans->srtt = trans->rttvar = 0; sctp_transport_route(trans, NULL, sctp_sk(asoc->base.sk)); @@ -5636,71 +5635,6 @@ static int sctp_getsockopt_paddr_thresholds(struct sock *sk, return 0; } -/* - * SCTP_GET_ASSOC_STATS - * - * This option retrieves local per endpoint statistics. It is modeled - * after OpenSolaris' implementation - */ -static int sctp_getsockopt_assoc_stats(struct sock *sk, int len, - char __user *optval, - int __user *optlen) -{ - struct sctp_assoc_stats sas; - struct sctp_association *asoc = NULL; - - /* User must provide at least the assoc id */ - if (len < sizeof(sctp_assoc_t)) - return -EINVAL; - - if (copy_from_user(&sas, optval, len)) - return -EFAULT; - - asoc = sctp_id2assoc(sk, sas.sas_assoc_id); - if (!asoc) - return -EINVAL; - - sas.sas_rtxchunks = asoc->stats.rtxchunks; - sas.sas_gapcnt = asoc->stats.gapcnt; - sas.sas_outofseqtsns = asoc->stats.outofseqtsns; - sas.sas_osacks = asoc->stats.osacks; - sas.sas_isacks = asoc->stats.isacks; - sas.sas_octrlchunks = asoc->stats.octrlchunks; - sas.sas_ictrlchunks = asoc->stats.ictrlchunks; - sas.sas_oodchunks = asoc->stats.oodchunks; - sas.sas_iodchunks = asoc->stats.iodchunks; - sas.sas_ouodchunks = asoc->stats.ouodchunks; - sas.sas_iuodchunks = asoc->stats.iuodchunks; - sas.sas_idupchunks = asoc->stats.idupchunks; - sas.sas_opackets = asoc->stats.opackets; - sas.sas_ipackets = asoc->stats.ipackets; - - /* New high max rto observed, will return 0 if not a single - * RTO update took place. obs_rto_ipaddr will be bogus - * in such a case - */ - sas.sas_maxrto = asoc->stats.max_obs_rto; - memcpy(&sas.sas_obs_rto_ipaddr, &asoc->stats.obs_rto_ipaddr, - sizeof(struct sockaddr_storage)); - - /* Mark beginning of a new observation period */ - asoc->stats.max_obs_rto = asoc->rto_min; - - /* Allow the struct to grow and fill in as much as possible */ - len = min_t(size_t, len, sizeof(sas)); - - if (put_user(len, optlen)) - return -EFAULT; - - SCTP_DEBUG_PRINTK("sctp_getsockopt_assoc_stat(%d): %d\n", - len, sas.sas_assoc_id); - - if (copy_to_user(optval, &sas, len)) - return -EFAULT; - - return 0; -} - SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { @@ -5842,9 +5776,6 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname, case SCTP_PEER_ADDR_THLDS: retval = sctp_getsockopt_paddr_thresholds(sk, optval, len, optlen); break; - case SCTP_GET_ASSOC_STATS: - retval = sctp_getsockopt_assoc_stats(sk, len, optval, optlen); - break; default: retval = -ENOPROTOOPT; break; diff --git a/trunk/net/sctp/transport.c b/trunk/net/sctp/transport.c index 310f11eb2206..206cf5238fd3 100644 --- a/trunk/net/sctp/transport.c +++ b/trunk/net/sctp/transport.c @@ -363,7 +363,6 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt) if (tp->rto > tp->asoc->rto_max) tp->rto = tp->asoc->rto_max; - sctp_max_rto(tp->asoc, tp); tp->rtt = rtt; /* Reset rto_pending so that a new RTT measurement is started when a @@ -621,7 +620,6 @@ void sctp_transport_reset(struct sctp_transport *t) t->burst_limited = 0; t->ssthresh = asoc->peer.i.a_rwnd; t->rto = asoc->rto_initial; - sctp_max_rto(asoc, t); t->rtt = 0; t->srtt = 0; t->rttvar = 0;