* [PATCH net v2 5/8] forcedeth: Add messages to indicate using MSI or MSI-X
From: David Decotigny @ 2011-11-04 1:41 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David S. Miller, Ian Campbell, Eric Dumazet, Jeff Kirsher,
Jiri Pirko, Joe Perches, Szymon Janc, Mike Ditto, David Decotigny
In-Reply-To: <cover.1320369398.git.david.decotigny@google.com>
From: Mike Ditto <mditto@google.com>
This adds a few debug messages to indicate whether PCIe interrupts are
signaled with MSI or MSI-X.
Signed-off-by: David Decotigny <david.decotigny@google.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 4a45a46..0af12a8 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -3761,6 +3761,7 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
writel(0, base + NvRegMSIXMap0);
writel(0, base + NvRegMSIXMap1);
}
+ netdev_info(dev, "MSI-X enabled\n");
}
}
if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
@@ -3782,6 +3783,7 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
writel(0, base + NvRegMSIMap1);
/* enable msi vector 0 */
writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
+ netdev_info(dev, "MSI enabled\n");
}
}
if (ret != 0) {
--
1.7.3.1
^ permalink raw reply related
* [PATCH net v2 6/8] forcedeth: Fix a race during rmmod of forcedeth
From: David Decotigny @ 2011-11-04 1:41 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David S. Miller, Ian Campbell, Eric Dumazet, Jeff Kirsher,
Jiri Pirko, Joe Perches, Szymon Janc, Salman Qazi,
David Decotigny
In-Reply-To: <cover.1320369398.git.david.decotigny@google.com>
From: Salman Qazi <sqazi@google.com>
The race was between del_timer_sync and nv_do_stats_poll called through
nv_get_ethtool_stats. To prevent this, we have to introduce mutual
exclusion between nv_get_ethtool_stats and del_timer_sync. Notice
that we don't put the mutual exclusion in nv_do_stats_poll. That's
because doing so would result in a deadlock, since it is a timer
callback and hence already waited for by timer deletion.
Signed-off-by: David Decotigny <david.decotigny@google.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 0af12a8..7996782 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -3937,6 +3937,10 @@ static void nv_poll_controller(struct net_device *dev)
}
#endif
+/* No locking is needed as long as this is in the timer
+ * callback. However, any other callers must call this
+ * function with np->lock held.
+ */
static void nv_do_stats_poll(unsigned long data)
{
struct net_device *dev = (struct net_device *) data;
@@ -4589,12 +4593,17 @@ static int nv_get_sset_count(struct net_device *dev, int sset)
static void nv_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *buffer)
{
+ unsigned long flags;
struct fe_priv *np = netdev_priv(dev);
+ spin_lock_irqsave(&np->lock, flags);
+
/* update stats */
nv_do_stats_poll((unsigned long)dev);
memcpy(buffer, &np->estats, nv_get_sset_count(dev, ETH_SS_STATS)*sizeof(u64));
+
+ spin_unlock_irqrestore(&np->lock, flags);
}
static int nv_link_test(struct net_device *dev)
@@ -5189,13 +5198,13 @@ static int nv_close(struct net_device *dev)
spin_lock_irq(&np->lock);
np->in_shutdown = 1;
+ del_timer_sync(&np->stats_poll);
spin_unlock_irq(&np->lock);
nv_napi_disable(dev);
synchronize_irq(np->pci_dev->irq);
del_timer_sync(&np->oom_kick);
del_timer_sync(&np->nic_poll);
- del_timer_sync(&np->stats_poll);
netif_stop_queue(dev);
spin_lock_irq(&np->lock);
--
1.7.3.1
^ permalink raw reply related
* [PATCH net v2 7/8] forcedeth: expose module parameters in /sys/module
From: David Decotigny @ 2011-11-04 1:41 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David S. Miller, Ian Campbell, Eric Dumazet, Jeff Kirsher,
Jiri Pirko, Joe Perches, Szymon Janc, David Decotigny
In-Reply-To: <cover.1320369398.git.david.decotigny@google.com>
In particular, debug_tx_timeout can be updated at runtime.
Signed-off-by: David Decotigny <david.decotigny@google.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 7996782..5442638 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -6027,23 +6027,23 @@ static void __exit exit_nic(void)
pci_unregister_driver(&driver);
}
-module_param(max_interrupt_work, int, 0);
+module_param(max_interrupt_work, int, S_IRUGO);
MODULE_PARM_DESC(max_interrupt_work, "forcedeth maximum events handled per interrupt");
-module_param(optimization_mode, int, 0);
+module_param(optimization_mode, int, S_IRUGO);
MODULE_PARM_DESC(optimization_mode, "In throughput mode (0), every tx & rx packet will generate an interrupt. In CPU mode (1), interrupts are controlled by a timer. In dynamic mode (2), the mode toggles between throughput and CPU mode based on network load.");
-module_param(poll_interval, int, 0);
+module_param(poll_interval, int, S_IRUGO);
MODULE_PARM_DESC(poll_interval, "Interval determines how frequent timer interrupt is generated by [(time_in_micro_secs * 100) / (2^10)]. Min is 0 and Max is 65535.");
-module_param(msi, int, 0);
+module_param(msi, int, S_IRUGO);
MODULE_PARM_DESC(msi, "MSI interrupts are enabled by setting to 1 and disabled by setting to 0.");
-module_param(msix, int, 0);
+module_param(msix, int, S_IRUGO);
MODULE_PARM_DESC(msix, "MSIX interrupts are enabled by setting to 1 and disabled by setting to 0.");
-module_param(dma_64bit, int, 0);
+module_param(dma_64bit, int, S_IRUGO);
MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0.");
-module_param(phy_cross, int, 0);
+module_param(phy_cross, int, S_IRUGO);
MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0.");
-module_param(phy_power_down, int, 0);
+module_param(phy_power_down, int, S_IRUGO);
MODULE_PARM_DESC(phy_power_down, "Power down phy and disable link when interface is down (1), or leave phy powered up (0).");
-module_param(debug_tx_timeout, bool, 0);
+module_param(debug_tx_timeout, bool, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(debug_tx_timeout,
"Dump tx related registers and ring when tx_timeout happens");
--
1.7.3.1
^ permalink raw reply related
* [PATCH net v2 8/8] forcedeth: fix a few sparse warnings (variable shadowing)
From: David Decotigny @ 2011-11-04 1:41 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: David S. Miller, Ian Campbell, Eric Dumazet, Jeff Kirsher,
Jiri Pirko, Joe Perches, Szymon Janc, David Decotigny
In-Reply-To: <cover.1320369398.git.david.decotigny@google.com>
This fixes the following sparse warnings:
drivers/net/ethernet/nvidia/forcedeth.c:2113:7: warning: symbol 'size' shadows an earlier one
drivers/net/ethernet/nvidia/forcedeth.c:2102:6: originally declared here
drivers/net/ethernet/nvidia/forcedeth.c:2155:7: warning: symbol 'size' shadows an earlier one
drivers/net/ethernet/nvidia/forcedeth.c:2102:6: originally declared here
drivers/net/ethernet/nvidia/forcedeth.c:2227:7: warning: symbol 'size' shadows an earlier one
drivers/net/ethernet/nvidia/forcedeth.c:2215:6: originally declared here
drivers/net/ethernet/nvidia/forcedeth.c:2271:7: warning: symbol 'size' shadows an earlier one
drivers/net/ethernet/nvidia/forcedeth.c:2215:6: originally declared here
drivers/net/ethernet/nvidia/forcedeth.c:2986:20: warning: symbol 'addr' shadows an earlier one
drivers/net/ethernet/nvidia/forcedeth.c:2963:6: originally declared here
Signed-off-by: David Decotigny <david.decotigny@google.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 34 +++++++++++++++---------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 5442638..913f054 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -2110,10 +2110,10 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* add fragments to entries count */
for (i = 0; i < fragments; i++) {
- u32 size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
+ u32 frag_size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
- entries += (size >> NV_TX2_TSO_MAX_SHIFT) +
- ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
+ entries += (frag_size >> NV_TX2_TSO_MAX_SHIFT) +
+ ((frag_size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
}
spin_lock_irqsave(&np->lock, flags);
@@ -2152,13 +2152,13 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* setup the fragments */
for (i = 0; i < fragments; i++) {
const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
- u32 size = skb_frag_size(frag);
+ u32 frag_size = skb_frag_size(frag);
offset = 0;
do {
prev_tx = put_tx;
prev_tx_ctx = np->put_tx_ctx;
- bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
+ bcnt = (frag_size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : frag_size;
np->put_tx_ctx->dma = skb_frag_dma_map(
&np->pci_dev->dev,
frag, offset,
@@ -2170,12 +2170,12 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
put_tx->flaglen = cpu_to_le32((bcnt-1) | tx_flags);
offset += bcnt;
- size -= bcnt;
+ frag_size -= bcnt;
if (unlikely(put_tx++ == np->last_tx.orig))
put_tx = np->first_tx.orig;
if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx))
np->put_tx_ctx = np->first_tx_ctx;
- } while (size);
+ } while (frag_size);
}
/* set last fragment flag */
@@ -2224,10 +2224,10 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
/* add fragments to entries count */
for (i = 0; i < fragments; i++) {
- u32 size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
+ u32 frag_size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
- entries += (size >> NV_TX2_TSO_MAX_SHIFT) +
- ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
+ entries += (frag_size >> NV_TX2_TSO_MAX_SHIFT) +
+ ((frag_size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
}
spin_lock_irqsave(&np->lock, flags);
@@ -2268,13 +2268,13 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
/* setup the fragments */
for (i = 0; i < fragments; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
- u32 size = skb_frag_size(frag);
+ u32 frag_size = skb_frag_size(frag);
offset = 0;
do {
prev_tx = put_tx;
prev_tx_ctx = np->put_tx_ctx;
- bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
+ bcnt = (frag_size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : frag_size;
np->put_tx_ctx->dma = skb_frag_dma_map(
&np->pci_dev->dev,
frag, offset,
@@ -2287,12 +2287,12 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
put_tx->flaglen = cpu_to_le32((bcnt-1) | tx_flags);
offset += bcnt;
- size -= bcnt;
+ frag_size -= bcnt;
if (unlikely(put_tx++ == np->last_tx.ex))
put_tx = np->first_tx.ex;
if (unlikely(np->put_tx_ctx++ == np->last_tx_ctx))
np->put_tx_ctx = np->first_tx_ctx;
- } while (size);
+ } while (frag_size);
}
/* set last fragment flag */
@@ -2983,11 +2983,11 @@ static void nv_set_multicast(struct net_device *dev)
struct netdev_hw_addr *ha;
netdev_for_each_mc_addr(ha, dev) {
- unsigned char *addr = ha->addr;
+ unsigned char *hw_addr = ha->addr;
u32 a, b;
- a = le32_to_cpu(*(__le32 *) addr);
- b = le16_to_cpu(*(__le16 *) (&addr[4]));
+ a = le32_to_cpu(*(__le32 *) hw_addr);
+ b = le16_to_cpu(*(__le16 *) (&hw_addr[4]));
alwaysOn[0] &= a;
alwaysOff[0] &= ~a;
alwaysOn[1] &= b;
--
1.7.3.1
^ permalink raw reply related
* Re: [net 00/10][pull request] Intel Wired LAN Driver Update
From: David Miller @ 2011-11-04 1:57 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1320279601-1276-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 2 Nov 2011 17:19:51 -0700
> The following series contains fixes to e100, e1000e, igb, ixgbe and
> ixgbevf. The bulk of the fixes are to ixgbe. Here is a summary
> of the changes:
...
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net.git
Pulled, thanks Jeff.
^ permalink raw reply
* Re: [PATCH net-next 0/4] be2net fixes and updates
From: David Miller @ 2011-11-04 2:02 UTC (permalink / raw)
To: padmanabh.ratnakar; +Cc: netdev
In-Reply-To: <fafeb93b-224e-46d9-86c3-3aad8a01da36@exht2.ad.emulex.com>
From: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Date: Thu, 3 Nov 2011 17:17:59 +0530
> Please apply.
> Thanks,
> Padmanabh
>
> Padmanabh Ratnakar (4):
> be2net: Fix endian issue in RX filter command
> be2net: Fix disabling multicast promiscous mode
> be2net: Prevent CQ full condition for Lancer
> be2net: Add detect UE feature for Lancer
All applied, thank you.
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2011-11-04 2:40 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) NULL crash in x25_recvmsg(), fix from Dave Jones.
2) __alloc_skb() alignments need adjusting for SLOB, fix from Tony Lindgren.
3) l2tp_recv_dequeue() can leave queue in inconsistent state, resulting in
a subsequent crash, fix from Eric Dumazet.
4) Missing bh_unlock_sock() in inet_csk_route_child_sock(), from Eric
Dumazet.
5) Build fix for 3c505 driver from Andrew Morton.
6) Fix docbook comment in skbuff.h, from Marcos Paulo de Souza.
7) IPVS netfilter fixes from Krzysztof Wilczynski and Simon Horman.
8) Fix refcount leak in ipv6 netfilter core, from Florian Westphal.
9) Fix multicast/promisc state refcounting bug due to vlan propagating
flag state changes on downed devices. Fix from Matthijs Kooijman.
10) Fix build error due to typo in ll_temac driver, from Stephen Rothwell.
11) Fix build of AF_PACKET due to bogus inline prototypes, from Olof
Johansson.
12) be2net driver bug fixes from Padmanabh Ratnakar.
13) Intel ethernet fixes from Bruce Allan, Jesse Brandeburg, Tomasz Kantecki,
Emil Tantilov, John Fastabend, and Greg Rose.
Please pull, thanks a lot!
The following changes since commit d6748066ad0e8b2514545998f8367ebb3906f299:
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus (2011-11-03 13:28:14 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
Andrew Morton (1):
drivers/net/ethernet/i825xx/3c505.c: fix build with dynamic debug
Arjan van de Ven (1):
net: make the tcp and udp file_operations for the /proc stuff const
Bruce Allan (1):
e1000e: demote a debugging WARN to a debug log message
Cesar Eduardo Barros (1):
net/ethernet: sc92031 is not Realtek
Dave Jones (1):
x25: Fix NULL dereference in x25_recvmsg
David S. Miller (2):
neigh: Kill bogus SMP protected debugging message.
Merge git://git.kernel.org/.../jkirsher/net
Emil Tantilov (3):
ixgbe: Fix link issues caused by a reset while interface is down
ixgbe: fix disabling of Tx laser at probe
ixgbe: fix reading of the buffer returned by the firmware
Eric Dumazet (3):
udp: fix a race in encap_rcv handling
l2tp: fix race in l2tp_recv_dequeue()
net: add missing bh_unlock_sock() calls
Florian Westphal (2):
netfilter: ipv6: fix afinfo->route refcnt leak on error
netfilter: do not propagate nf_queue errors in nf_hook_slow
Geert Uytterhoeven (1):
net/ethernet: Move mac89x0.c from apple to cirrus
Greg Rose (2):
ixgbe: Fix compiler warnings
ixgbevf: Update release version
Jesse Brandeburg (1):
e100: make sure vlan support isn't advertised on old adapters
Joe Perches (1):
netfilter: Remove unnecessary OOM logging messages
John Fastabend (2):
ixgbe: fix smatch splat due to missing NULL check
ixgbe: DCB, return max for IEEE traffic classes
Kantecki, Tomasz (1):
igb: Fix for I347AT4 PHY cable length unit detection
Krzysztof Wilczynski (3):
ipvs: Expose ip_vs_ftp module parameters via sysfs.
ipvs: Remove unused variable "cs" from ip_vs_leave function.
ipvs: Fix compilation error in ip_vs.h for ip_vs_confirm_conntrack function.
Marcos Paulo de Souza (1):
include: linux: skbuf.h: Fix parameter documentation
Matthijs Kooijman (1):
vlan: Don't propagate flag changes on down interfaces.
Oliver Hartkopp (1):
MAINTAINERS: Add can-gw include to maintained files
Olof Johansson (1):
af_packet: de-inline some helper functions
Pablo Neira Ayuso (2):
netfilter: export NAT definitions through linux/netfilter_ipv4/nf_nat.h
MAINTAINERS: update netfilter maintainers
Padmanabh Ratnakar (4):
be2net: Fix endian issue in RX filter command
be2net: Fix disabling multicast promiscous mode
be2net: Prevent CQ full condition for Lancer
be2net: Add detect UE feature for Lancer
Paul Bolle (1):
isdn: hisax: Fix typo 'HISAX_DE_AOC'
Simon Horman (6):
ipvs: Add documentation for new sysctl entries
ipvs: Remove unused parameter from ip_vs_confirm_conntrack()
ipvs: Remove unused return value of protocol state transitions
ipvs: Removed unused variables
ipvs: secure_tcp does provide alternate state timeouts
ipvs: Enhance grammar used to refer to Kconfig options
Stephen Rothwell (1):
net: fix typo in drivers/net/ethernet/xilinx/ll_temac_main.c
Tony Lindgren (1):
net: Add back alignment for size for __alloc_skb
Weiping Pan (1):
bonding:update speed/duplex for NETDEV_CHANGE
Documentation/networking/ipvs-sysctl.txt | 62 +++++++++++++++++--
MAINTAINERS | 5 +-
drivers/isdn/hisax/l3dss1.c | 6 +-
drivers/net/bonding/bond_main.c | 37 ++++--------
drivers/net/bonding/bond_procfs.c | 12 +++-
drivers/net/ethernet/Kconfig | 1 +
drivers/net/ethernet/Makefile | 1 +
drivers/net/ethernet/apple/Kconfig | 12 ----
drivers/net/ethernet/apple/Makefile | 1 -
drivers/net/ethernet/cirrus/Kconfig | 14 ++++-
drivers/net/ethernet/cirrus/Makefile | 1 +
drivers/net/ethernet/{apple => cirrus}/mac89x0.c | 0
drivers/net/ethernet/emulex/benet/be_cmds.c | 12 +++-
drivers/net/ethernet/emulex/benet/be_hw.h | 2 +
drivers/net/ethernet/emulex/benet/be_main.c | 68 +++++++++++++-------
drivers/net/ethernet/i825xx/3c505.c | 6 +-
drivers/net/ethernet/intel/e100.c | 4 +
drivers/net/ethernet/intel/e1000e/ich8lan.c | 3 +-
drivers/net/ethernet/intel/igb/e1000_phy.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 20 +++---
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | 10 ++-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 48 ++++++---------
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | 2 +
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
drivers/net/ethernet/realtek/Kconfig | 12 ----
drivers/net/ethernet/realtek/Makefile | 1 -
drivers/net/ethernet/silan/Kconfig | 33 ++++++++++
drivers/net/ethernet/silan/Makefile | 5 ++
drivers/net/ethernet/{realtek => silan}/sc92031.c | 0
drivers/net/ethernet/xilinx/ll_temac_main.c | 4 +-
include/linux/netfilter_ipv4/Kbuild | 1 +
include/linux/netfilter_ipv4/nf_nat.h | 58 ++++++++++++++++++
include/linux/skbuff.h | 4 +-
include/net/ip_vs.h | 11 ++--
include/net/netfilter/nf_conntrack_tuple.h | 27 +--------
include/net/netfilter/nf_nat.h | 26 +--------
include/net/tcp.h | 10 ++-
include/net/udp.h | 12 ++--
net/8021q/vlan_dev.c | 10 ++-
net/bridge/netfilter/ebt_ulog.c | 7 +-
net/core/neighbour.c | 6 +--
net/core/skbuff.c | 1 +
net/dccp/ipv4.c | 1 +
net/ipv4/netfilter/ipt_CLUSTERIP.c | 1 -
net/ipv4/netfilter/ipt_ULOG.c | 4 +-
net/ipv4/netfilter/nf_nat_snmp_basic.c | 22 +------
net/ipv4/tcp_ipv4.c | 23 ++++---
net/ipv4/udp.c | 30 +++++----
net/ipv4/udplite.c | 13 +++-
net/ipv6/netfilter.c | 13 +++-
net/ipv6/netfilter/nf_conntrack_reasm.c | 7 +-
net/ipv6/tcp_ipv6.c | 12 +++-
net/ipv6/udp.c | 12 +++-
net/ipv6/udplite.c | 13 +++-
net/l2tp/l2tp_core.c | 3 +-
net/netfilter/core.c | 11 ++--
net/netfilter/ipset/ip_set_core.c | 4 +-
net/netfilter/ipvs/ip_vs_core.c | 20 +++---
net/netfilter/ipvs/ip_vs_ctl.c | 22 ++-----
net/netfilter/ipvs/ip_vs_dh.c | 5 +-
net/netfilter/ipvs/ip_vs_ftp.c | 5 +-
net/netfilter/ipvs/ip_vs_lblc.c | 9 +--
net/netfilter/ipvs/ip_vs_lblcr.c | 13 +---
net/netfilter/ipvs/ip_vs_nfct.c | 2 +-
net/netfilter/ipvs/ip_vs_proto.c | 5 +-
net/netfilter/ipvs/ip_vs_proto_sctp.c | 14 +---
net/netfilter/ipvs/ip_vs_proto_tcp.c | 6 +-
net/netfilter/ipvs/ip_vs_proto_udp.c | 5 +-
net/netfilter/ipvs/ip_vs_sh.c | 5 +-
net/netfilter/ipvs/ip_vs_wrr.c | 5 +-
net/netfilter/ipvs/ip_vs_xmit.c | 2 +-
net/netfilter/nf_conntrack_core.c | 5 +-
net/netfilter/nfnetlink_log.c | 7 +--
net/netfilter/xt_IDLETIMER.c | 2 -
net/netfilter/xt_hashlimit.c | 5 +-
net/packet/af_packet.c | 52 ++++++++--------
net/x25/af_x25.c | 11 +++-
77 files changed, 506 insertions(+), 422 deletions(-)
rename drivers/net/ethernet/{apple => cirrus}/mac89x0.c (100%)
create mode 100644 drivers/net/ethernet/silan/Kconfig
create mode 100644 drivers/net/ethernet/silan/Makefile
rename drivers/net/ethernet/{realtek => silan}/sc92031.c (100%)
create mode 100644 include/linux/netfilter_ipv4/nf_nat.h
^ permalink raw reply
* Re: [PATCH] ipv4: fix ipsec forward performance regression
From: David Miller @ 2011-11-04 2:43 UTC (permalink / raw)
To: kim.phillips; +Cc: stable, eric.dumazet, zheng.z.yan, netdev
In-Reply-To: <20111103135851.2229247682ec040d653479e1@freescale.com>
From: Kim Phillips <kim.phillips@freescale.com>
Date: Thu, 3 Nov 2011 13:58:51 -0500
> I see b732339 (ipv4: fix ipsec forward performance regression) has
> been added to the 3.0- and 3.1-stable trees.
>
> b732339 increases IPSec fwding performance from 0.2kpps to ~3.5kpps.
>
> However, adding upstream commit aa1c366 (net: Handle different key
> sizes between address families in flow cache) brings performance
> back up to 2.6.38 levels, i.e., ~44kpps.
>
> So can aa1c366 also be queued to the v2.6.39 and v3.0 stable
> trees?
1) stable@kernel.org no longer exists and will just go into the bit
bucket, it's now stable@vger.kernel.org
2) The patch in question doesn't apply cleanly to v3.0.8 -stable so
if it's important to you you'll need to submit a backport.
3) 2.6.39 is no longer a maintained -stable kernel series.
^ permalink raw reply
* Re: [PATCH] fsl_pq_mdio: Clean up tbi address configuration
From: David Miller @ 2011-11-04 2:44 UTC (permalink / raw)
To: afleming; +Cc: netdev
In-Reply-To: <1320357251-15335-1-git-send-email-afleming@freescale.com>
From: Andy Fleming <afleming@freescale.com>
Date: Thu, 3 Nov 2011 16:54:11 -0500
> The code for setting the address of the internal TBI PHY was
> convoluted enough without a maze of ifdefs. Clean it up a bit
> so we allow the logic to fail down to -ENODEV at the end of
> the if/else ladder, rather than using ifdefs to repeat the same
> failure code over and over.
>
> Also, remove the support for the auto-configuration. I'm not aware of
> anyone using it, and it ends up using the bus mutex before it's been
> initialized.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
Cleanups of this nature are not appropriate to submit at this time,
please wait until the net-next tree becomes active again.
^ permalink raw reply
* Re: [PATCH] ll_temac: Add support for phy_mii_ioctl
From: David Miller @ 2011-11-04 2:45 UTC (permalink / raw)
To: ricardo.ribalda
Cc: ian.campbell, eric.dumazet, jeffrey.t.kirsher, jpirko, netdev,
linux-kernel
In-Reply-To: <1320239646-15377-1-git-send-email-ricardo.ribalda@gmail.com>
From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Date: Wed, 2 Nov 2011 14:14:06 +0100
> This patch enables the ioctl support for the driver. So userspace
> programs like mii-tool can work.
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Please submit such feature additions when the net-next tree opens back up.
^ permalink raw reply
* Re: [PATCH v4 0/9] Cleanup and extension of netdev features
From: David Miller @ 2011-11-04 2:46 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev, bhutchings
In-Reply-To: <cover.1319495301.git.mirq-linux@rere.qmqm.pl>
From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Tue, 25 Oct 2011 02:36:33 +0200 (CEST)
> Commit fd38f734 (igbvf: convert to ndo_fix_features) removed last use
> of old ethtool ops for controlling netdevice's features. This series
> finishes the cleanup and extends feature pool to 64 bits.
>
> Also, there's additional patch that removes NETIF_F_NO_CSUM as it is
> now, and has been for some time, equivalent to NETIF_F_HW_CSUM.
>
> To see the new features in action, you need ethtool patched with:
>
> http://patchwork.ozlabs.org/patch/96374/
>
> Not much has changed in those patches compared to last version I posted
> in June.
>
> Compile tested whole series only. I'll do more thorough testing next
> week after I prepare new testing machine.
Sorry this just missed the merge window.
Please submit this again once the net-next tree opens back up.
Thanks!
^ permalink raw reply
* Re: [PATCH net v2 6/8] forcedeth: Fix a race during rmmod of forcedeth
From: Ben Hutchings @ 2011-11-04 3:46 UTC (permalink / raw)
To: David Decotigny
Cc: netdev, linux-kernel, David S. Miller, Ian Campbell, Eric Dumazet,
Jeff Kirsher, Jiri Pirko, Joe Perches, Szymon Janc, Salman Qazi
In-Reply-To: <267015997eb594f2fd859acd572aa20dfc3e3e63.1320369398.git.david.decotigny@google.com>
On Thu, 2011-11-03 at 18:41 -0700, David Decotigny wrote:
> From: Salman Qazi <sqazi@google.com>
>
> The race was between del_timer_sync and nv_do_stats_poll called through
> nv_get_ethtool_stats.
I don't think so. nv_close() and nv_get_ethtool_stats() are both called
with RTNL held.
Calling the timer function from nv_get_ethtool_stats is very likely part
of the problem though, so why don't you stop doing that?
[...]
> diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
> index 0af12a8..7996782 100644
> --- a/drivers/net/ethernet/nvidia/forcedeth.c
> +++ b/drivers/net/ethernet/nvidia/forcedeth.c
> @@ -3937,6 +3937,10 @@ static void nv_poll_controller(struct net_device *dev)
> }
> #endif
>
> +/* No locking is needed as long as this is in the timer
> + * callback. However, any other callers must call this
> + * function with np->lock held.
> + */
So long as this function is used by all of (1) the timer function (2)
the ndo_get_stats implementation (3) the ethtool get_stats
implementation, it can most certainly be called concurrently on multiple
processors.
You could have (2) and (3) return the last polled stats and not poll the
hardware themselves, but you would need to use the functions from
<linux/u64_stats_sync.h> to avoid word-tearing on 32-bit architectures.
> static void nv_do_stats_poll(unsigned long data)
> {
> struct net_device *dev = (struct net_device *) data;
> @@ -4589,12 +4593,17 @@ static int nv_get_sset_count(struct net_device *dev, int sset)
>
> static void nv_get_ethtool_stats(struct net_device *dev, struct ethtool_stats *estats, u64 *buffer)
> {
> + unsigned long flags;
> struct fe_priv *np = netdev_priv(dev);
>
> + spin_lock_irqsave(&np->lock, flags);
> +
> /* update stats */
> nv_do_stats_poll((unsigned long)dev);
>
> memcpy(buffer, &np->estats, nv_get_sset_count(dev, ETH_SS_STATS)*sizeof(u64));
> +
> + spin_unlock_irqrestore(&np->lock, flags);
This function is not called from interrupt context.
> }
>
> static int nv_link_test(struct net_device *dev)
> @@ -5189,13 +5198,13 @@ static int nv_close(struct net_device *dev)
>
> spin_lock_irq(&np->lock);
> np->in_shutdown = 1;
> + del_timer_sync(&np->stats_poll);
> spin_unlock_irq(&np->lock);
> nv_napi_disable(dev);
> synchronize_irq(np->pci_dev->irq);
>
> del_timer_sync(&np->oom_kick);
> del_timer_sync(&np->nic_poll);
> - del_timer_sync(&np->stats_poll);
>
> netif_stop_queue(dev);
> spin_lock_irq(&np->lock);
I don't believe this code movement is helpful.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Dear Friend
From: Mr.Andrew Wong @ 2011-11-04 8:35 UTC (permalink / raw)
I need your assistance to transfer Abandoned sum of $8.5 Million Dollars in Alliance Bank in Kuala Lumpur Malaysia,
Own by a billionaire Business Mogul Late Mr. Moises Saba Masri, a Jew
from Mexico who was a victim of a helicopter crash since 2010 year,
resulting to his death and his family members.
You can see more information about Saba Masri Mr.Moises unfortunate end
accident on the website-link below.
http://www.ynetnews.com/articles/0,7340,L-3832556,00.html.
We share in ratio 60%/40%. Reply if interested reply via email: mr.andrew.wong16@gmail.com
Best Regard
Mr.Andrew Wong
--
^ permalink raw reply
* iproute2 neighboring
From: Kevin Wilson @ 2011-11-04 11:11 UTC (permalink / raw)
To: netdev
Hi,
It seems to me that "ip -6 neigh show" does not show multicast entries from
IPv6 neighboring table. Is there a reason for this ?
rgs,
Kevin
^ permalink raw reply
* Re: iproute2 neighboring
From: Eric Dumazet @ 2011-11-04 11:55 UTC (permalink / raw)
To: Kevin Wilson; +Cc: netdev
In-Reply-To: <CAGXs5wUEiS-vpdsCDoyva2Vg9XKBmbJgoPVOXUXD0u9+PzXH=w@mail.gmail.com>
Le vendredi 04 novembre 2011 à 13:11 +0200, Kevin Wilson a écrit :
> Hi,
> It seems to me that "ip -6 neigh show" does not show multicast entries from
> IPv6 neighboring table. Is there a reason for this ?
> rgs,
What would be a neighbour entry for multicast ipv4 or ipv6 ?
Could you describe your need ?
^ permalink raw reply
* [PATCH 1/7] powerpc/85xx: re-enable timebase sync disabled by KEXEC patch
From: Zhao Chenhui @ 2011-11-04 12:16 UTC (permalink / raw)
To: netdev; +Cc: leoli, chenhui.zhao
From: Li Yang <leoli@freescale.com>
The timebase sync is not only necessary when using KEXEC. It should also
be used by normal boot up and cpu hotplug. Remove the ifdef added by
the KEXEC patch.
Signed-off-by: Jin Qing <b24347@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
arch/powerpc/platforms/85xx/smp.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 5b9b901..9b0de9c 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -113,10 +113,8 @@ smp_85xx_kick_cpu(int nr)
struct smp_ops_t smp_85xx_ops = {
.kick_cpu = smp_85xx_kick_cpu,
-#ifdef CONFIG_KEXEC
.give_timebase = smp_generic_give_timebase,
.take_timebase = smp_generic_take_timebase,
-#endif
};
#ifdef CONFIG_KEXEC
--
1.6.4.1
^ permalink raw reply related
* [PATCH 6/7] fsl_pmc: Add API to enable device as wakeup event source
From: Zhao Chenhui @ 2011-11-04 12:39 UTC (permalink / raw)
To: linuxppc-dev; +Cc: leoli, netdev
Add APIs for setting wakeup source and lossless Ethernet in low power modes.
These APIs can be used by wake-on-packet feature.
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jin Qing <b24347@freescale.com>
Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
---
arch/powerpc/sysdev/fsl_pmc.c | 67 +++++++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/fsl_soc.h | 11 +++++++
2 files changed, 78 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_pmc.c b/arch/powerpc/sysdev/fsl_pmc.c
index 58d35d8..dab8161 100644
--- a/arch/powerpc/sysdev/fsl_pmc.c
+++ b/arch/powerpc/sysdev/fsl_pmc.c
@@ -38,6 +38,7 @@ static struct device *pmc_dev;
static struct pmc_regs __iomem *pmc_regs;
#define PMCSR_SLP 0x00020000
+#define PMCSR_LOSSLESS 0x00400000
static int has_deep_sleep;
static int has_lossless;
@@ -45,6 +46,72 @@ static int has_lossless;
* code can be compatible with both 32-bit & 36-bit */
extern void mpc85xx_enter_deep_sleep(u64 ccsrbar, u32 powmgtreq);
+#ifdef CONFIG_FSL_PMC
+/**
+ * pmc_enable_wake - enable OF device as wakeup event source
+ * @pdev: platform device affected
+ * @state: PM state from which device will issue wakeup events
+ * @enable: True to enable event generation; false to disable
+ *
+ * This enables the device as a wakeup event source, or disables it.
+ *
+ * RETURN VALUE:
+ * 0 is returned on success
+ * -EINVAL is returned if device is not supposed to wake up the system
+ * Error code depending on the platform is returned if both the platform and
+ * the native mechanism fail to enable the generation of wake-up events
+ */
+int pmc_enable_wake(struct platform_device *pdev,
+ suspend_state_t state, bool enable)
+{
+ int ret = 0;
+ struct device_node *clk_np;
+ u32 *pmcdr_mask;
+
+ if (!pmc_regs) {
+ printk(KERN_WARNING "PMC is unavailable\n");
+ return -ENOMEM;
+ }
+
+ if (enable && !device_may_wakeup(&pdev->dev))
+ return -EINVAL;
+
+ clk_np = of_parse_phandle(pdev->dev.of_node, "clk-handle", 0);
+ if (!clk_np)
+ return -EINVAL;
+
+ pmcdr_mask = (u32 *)of_get_property(clk_np, "fsl,pmcdr-mask", NULL);
+ if (!pmcdr_mask) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /* clear to enable clock in low power mode */
+ if (enable)
+ clrbits32(&pmc_regs->pmcdr, *pmcdr_mask);
+ else
+ setbits32(&pmc_regs->pmcdr, *pmcdr_mask);
+
+out:
+ of_node_put(clk_np);
+ return ret;
+}
+EXPORT_SYMBOL_GPL(pmc_enable_wake);
+
+/**
+ * pmc_enable_lossless - enable lossless ethernet in low power mode
+ * @enable: True to enable event generation; false to disable
+ */
+void pmc_enable_lossless(int enable)
+{
+ if (enable && has_lossless)
+ setbits32(&pmc_regs->pmcsr, PMCSR_LOSSLESS);
+ else
+ clrbits32(&pmc_regs->pmcsr, PMCSR_LOSSLESS);
+}
+EXPORT_SYMBOL_GPL(pmc_enable_lossless);
+#endif
+
static int pmc_suspend_enter(suspend_state_t state)
{
int ret;
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index c6d0073..f4f322a 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -3,6 +3,8 @@
#ifdef __KERNEL__
#include <asm/mmu.h>
+#include <linux/platform_device.h>
+#include <linux/suspend.h>
struct spi_device;
@@ -21,6 +23,15 @@ struct device_node;
extern void fsl_rstcr_restart(char *cmd);
+#ifdef CONFIG_FSL_PMC
+int pmc_enable_wake(struct platform_device *pdev, suspend_state_t state,
+ bool enable);
+void pmc_enable_lossless(int enable);
+#else
+#define pmc_enable_wake(pdev, state, enable)
+#define pmc_enable_lossless(enable)
+#endif
+
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
/* The different ports that the DIU can be connected to */
--
1.6.4.1
^ permalink raw reply related
* [PATCH 7/7] gianfar: add support for wake-on-packet
From: Zhao Chenhui @ 2011-11-04 12:40 UTC (permalink / raw)
To: linuxppc-dev; +Cc: leoli, netdev, afleming
On certain chip like MPC8536 and P1022, system can be waked up from
sleep by user defined packet. This patch implements that system waked
up by ARP request packet or unicast patcket to this station.
When entering suspend state, the gianfar driver sets receive queue
filer table to filter all of packets except ARP request packet and
unicast patcket to this station. The driver temporarily uses the last
receive queue to receive the user defined packet.
In suspend state, the receive part of eTSEC keeps working. When
receiving a user defined packet, it generates an interrupt to
wake up the system.
The rule of the filer table is as below.
if (arp request to local ip address)
accept it to the last queue
elif (unicast packet to local mac address)
accept it to the last queue
else
reject it
endif
Note: The local ip/mac address is the ethernet ip/mac address of
the station.
Here is an example of enabling and testing wake up on user defined packet.
ifconfig eth0 10.193.20.169
ethtool -s eth0 wol a
echo standby > /sys/power/state or echo mem > /sys/power/state
Ping from PC host to wake up the station:
ping 10.193.20.169
Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Jin Qing <b24347@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
---
.../devicetree/bindings/net/fsl-tsec-phy.txt | 3 +
drivers/net/ethernet/freescale/gianfar.c | 320 +++++++++++++++++++-
drivers/net/ethernet/freescale/gianfar.h | 33 ++-
drivers/net/ethernet/freescale/gianfar_ethtool.c | 35 ++-
4 files changed, 366 insertions(+), 25 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index 2c6be03..543e36c 100644
--- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -56,6 +56,9 @@ Properties:
hardware.
- fsl,magic-packet : If present, indicates that the hardware supports
waking up via magic packet.
+ - fsl,wake-on-filer : If present, indicates that the hardware supports
+ waking up via arp request to local ip address or unicast packet to
+ local mac address.
- bd-stash : If present, indicates that the hardware supports stashing
buffer descriptors in the L2.
- rx-stash-len : Denotes the number of bytes of a received buffer to stash
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 83199fd..a159251 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -85,6 +85,8 @@
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/in.h>
+#include <linux/inetdevice.h>
+#include <sysdev/fsl_soc.h>
#include <linux/net_tstamp.h>
#include <asm/io.h>
@@ -147,6 +149,17 @@ static void gfar_clear_exact_match(struct net_device *dev);
static void gfar_set_mac_for_addr(struct net_device *dev, int num,
const u8 *addr);
static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
+static void gfar_schedule_cleanup(struct gfar_priv_grp *gfargrp);
+
+#ifdef CONFIG_PM
+static void gfar_halt_rx(struct net_device *dev);
+static void gfar_rx_start(struct net_device *dev);
+static void gfar_enable_filer(struct net_device *dev);
+static void gfar_disable_filer(struct net_device *dev);
+static void gfar_config_filer_arptable(struct net_device *dev);
+static void gfar_restore_filer_table(struct net_device *dev);
+static int gfar_get_ip(struct net_device *dev);
+#endif
MODULE_AUTHOR("Freescale Semiconductor, Inc");
MODULE_DESCRIPTION("Gianfar Ethernet Driver");
@@ -751,7 +764,6 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
FSL_GIANFAR_DEV_HAS_PADDING |
FSL_GIANFAR_DEV_HAS_CSUM |
FSL_GIANFAR_DEV_HAS_VLAN |
- FSL_GIANFAR_DEV_HAS_MAGIC_PACKET |
FSL_GIANFAR_DEV_HAS_EXTENDED_HASH |
FSL_GIANFAR_DEV_HAS_TIMER;
@@ -766,6 +778,9 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
if (of_get_property(np, "fsl,magic-packet", NULL))
priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
+ if (of_get_property(np, "fsl,wake-on-filer", NULL))
+ priv->device_flags |= FSL_GIANFAR_DEV_HAS_ARP_PACKET;
+
priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
/* Find the TBI PHY. If it's not there, we don't support SGMII */
@@ -1168,8 +1183,11 @@ static int gfar_probe(struct platform_device *ofdev)
goto register_fail;
}
- device_init_wakeup(&dev->dev,
- priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET);
+ if ((priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET) ||
+ (priv->device_flags & FSL_GIANFAR_DEV_HAS_ARP_PACKET)) {
+ device_set_wakeup_capable(&ofdev->dev, true);
+ device_set_wakeup_enable(&ofdev->dev, false);
+ }
/* fill out IRQ number and name fields */
len_devname = strlen(dev->name);
@@ -1260,6 +1278,163 @@ static int gfar_remove(struct platform_device *ofdev)
}
#ifdef CONFIG_PM
+static void gfar_enable_filer(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ struct gfar __iomem *regs = priv->gfargrp[0].regs;
+ u32 temp;
+
+ lock_rx_qs(priv);
+
+ temp = gfar_read(®s->rctrl);
+ temp &= ~(RCTRL_FSQEN | RCTRL_PRSDEP_MASK);
+ temp |= RCTRL_FILREN | RCTRL_PRSDEP_L2L3;
+ gfar_write(®s->rctrl, temp);
+
+ unlock_rx_qs(priv);
+}
+
+static void gfar_disable_filer(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ struct gfar __iomem *regs = priv->gfargrp[0].regs;
+ u32 temp;
+
+ lock_rx_qs(priv);
+
+ temp = gfar_read(®s->rctrl);
+ temp &= ~RCTRL_FILREN;
+ gfar_write(®s->rctrl, temp);
+
+ unlock_rx_qs(priv);
+}
+
+static int gfar_get_ip(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ struct in_device *in_dev = (struct in_device *)dev->ip_ptr;
+ struct in_ifaddr *ifa;
+
+ if (in_dev != NULL) {
+ ifa = (struct in_ifaddr *)in_dev->ifa_list;
+ if (ifa != NULL) {
+ memcpy(priv->ip_addr, &ifa->ifa_address, 4);
+ return 0;
+ }
+ }
+ return -ENOENT;
+}
+
+static void gfar_restore_filer_table(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ u32 rqfcr, rqfpr;
+ int i;
+
+ lock_rx_qs(priv);
+
+ for (i = 0; i <= MAX_FILER_IDX; i++) {
+ rqfcr = priv->ftp_rqfcr[i];
+ rqfpr = priv->ftp_rqfpr[i];
+ gfar_write_filer(priv, i, rqfcr, rqfpr);
+ }
+
+ unlock_rx_qs(priv);
+}
+
+static void gfar_config_filer_arptable(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ u8 *ip_addr;
+ u32 wakeup_ip, dest_mac_addr_h, dest_mac_addr_l;
+ u32 rqfpr = 0x0;
+ u32 rqfcr = RQFCR_RJE | RQFCR_CMP_MATCH;
+ u8 rqfcr_queue = priv->num_rx_queues - 1;
+ int i;
+
+ if (gfar_get_ip(dev))
+ netif_err(priv, wol, dev, "WOL: get the ip address error\n");
+ ip_addr = priv->ip_addr;
+
+ wakeup_ip = (*ip_addr << 24) | (*(ip_addr + 1) << 16) | \
+ (*(ip_addr + 2) << 8) | (*(ip_addr + 3));
+
+ dest_mac_addr_h = (dev->dev_addr[0] << 16) | \
+ (dev->dev_addr[1] << 8) | dev->dev_addr[2];
+ dest_mac_addr_l = (dev->dev_addr[3] << 16) | \
+ (dev->dev_addr[4] << 8) | dev->dev_addr[5];
+
+ lock_rx_qs(priv);
+
+ for (i = 0; i <= MAX_FILER_IDX; i++)
+ gfar_write_filer(priv, i, rqfcr, rqfpr);
+
+ /* ARP request filer, filling the packet to queue #1 */
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_MASK;
+ rqfpr = RQFPR_ARQ;
+ gfar_write_filer(priv, 0, rqfcr, rqfpr);
+
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_PARSE;
+ rqfpr = RQFPR_ARQ;
+ gfar_write_filer(priv, 1, rqfcr, rqfpr);
+
+ /* DEST_IP address in ARP packet, filling it to queue #1 */
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_MASK;
+ rqfpr = FPR_FILER_MASK;
+ gfar_write_filer(priv, 2, rqfcr, rqfpr);
+
+ rqfcr = RQFCR_GPI | (rqfcr_queue << 10) |
+ RQFCR_CMP_EXACT | RQFCR_PID_DIA;
+ rqfpr = wakeup_ip;
+ gfar_write_filer(priv, 3, rqfcr, rqfpr);
+
+ /* Unicast packet, filling it to queue #1 */
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_DAH;
+ rqfpr = dest_mac_addr_h;
+ gfar_write_filer(priv, 4, rqfcr, rqfpr);
+
+ rqfcr = RQFCR_GPI | (rqfcr_queue << 10) |
+ RQFCR_CMP_EXACT | RQFCR_PID_DAL;
+ mb();
+ rqfpr = dest_mac_addr_l;
+ gfar_write_filer(priv, 5, rqfcr, rqfpr);
+
+ unlock_rx_qs(priv);
+}
+
+static int gfar_arp_suspend(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ unsigned long flags;
+
+ netif_device_detach(dev);
+
+ if (netif_running(dev)) {
+ local_irq_save(flags);
+ lock_tx_qs(priv);
+ lock_rx_qs(priv);
+
+ gfar_halt(dev);
+
+ unlock_rx_qs(priv);
+ unlock_tx_qs(priv);
+ local_irq_restore(flags);
+
+ disable_napi(priv);
+
+ gfar_disable_filer(dev);
+ gfar_config_filer_arptable(dev);
+ gfar_enable_filer(dev);
+ gfar_rx_start(dev);
+ }
+
+ return 0;
+}
+
static int gfar_suspend(struct device *dev)
{
@@ -1268,9 +1443,17 @@ static int gfar_suspend(struct device *dev)
struct gfar __iomem *regs = priv->gfargrp[0].regs;
unsigned long flags;
u32 tempval;
-
int magic_packet = priv->wol_en &&
- (priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET);
+ (priv->wol_opts & GIANFAR_WOL_MAGIC);
+ int arp_packet = priv->wol_en &&
+ (priv->wol_opts & GIANFAR_WOL_ARP);
+
+ if (arp_packet) {
+ pmc_enable_wake(priv->ofdev, PM_SUSPEND_MEM, 1);
+ pmc_enable_lossless(1);
+ gfar_arp_suspend(ndev);
+ return 0;
+ }
netif_device_detach(ndev);
@@ -1299,6 +1482,7 @@ static int gfar_suspend(struct device *dev)
disable_napi(priv);
if (magic_packet) {
+ pmc_enable_wake(priv->ofdev, PM_SUSPEND_MEM, 1);
/* Enable interrupt on Magic Packet */
gfar_write(®s->imask, IMASK_MAG);
@@ -1314,6 +1498,30 @@ static int gfar_suspend(struct device *dev)
return 0;
}
+static int gfar_arp_resume(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ int i;
+
+ if (!netif_running(dev)) {
+ netif_device_attach(dev);
+ return 0;
+ }
+
+ gfar_halt_rx(dev);
+ gfar_disable_filer(dev);
+ gfar_restore_filer_table(dev);
+ gfar_start(dev);
+
+ netif_device_attach(dev);
+ enable_napi(priv);
+
+ for (i = 0; i < priv->num_grps; i++)
+ gfar_schedule_cleanup(&priv->gfargrp[i]);
+
+ return 0;
+}
+
static int gfar_resume(struct device *dev)
{
struct gfar_private *priv = dev_get_drvdata(dev);
@@ -1322,7 +1530,18 @@ static int gfar_resume(struct device *dev)
unsigned long flags;
u32 tempval;
int magic_packet = priv->wol_en &&
- (priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET);
+ (priv->wol_opts & GIANFAR_WOL_MAGIC);
+ int arp_packet = priv->wol_en &&
+ (priv->wol_opts & GIANFAR_WOL_ARP);
+
+ if (arp_packet) {
+ pmc_enable_wake(priv->ofdev, PM_SUSPEND_MEM, 0);
+ pmc_enable_lossless(0);
+ gfar_arp_resume(ndev);
+ return 0;
+ } else if (magic_packet) {
+ pmc_enable_wake(priv->ofdev, PM_SUSPEND_MEM, 0);
+ }
if (!netif_running(ndev)) {
netif_device_attach(ndev);
@@ -1602,6 +1821,48 @@ static int __gfar_is_rx_idle(struct gfar_private *priv)
return 0;
}
+#ifdef CONFIG_PM
+/* Halt the receive queues */
+static void gfar_halt_rx(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ struct gfar __iomem *regs = priv->gfargrp[0].regs;
+ u32 tempval;
+ int i = 0;
+
+ for (i = 0; i < priv->num_grps; i++) {
+ regs = priv->gfargrp[i].regs;
+ /* Mask all interrupts */
+ gfar_write(®s->imask, IMASK_INIT_CLEAR);
+
+ /* Clear all interrupts */
+ gfar_write(®s->ievent, IEVENT_INIT_CLEAR);
+ }
+
+ regs = priv->gfargrp[0].regs;
+ /* Stop the DMA, and wait for it to stop */
+ tempval = gfar_read(®s->dmactrl);
+ if ((tempval & DMACTRL_GRS) != DMACTRL_GRS) {
+ int ret;
+
+ tempval |= DMACTRL_GRS;
+ gfar_write(®s->dmactrl, tempval);
+
+ do {
+ ret = spin_event_timeout(((gfar_read(®s->ievent) &
+ IEVENT_GRSC) == IEVENT_GRSC), 1000000, 0);
+ if (!ret && !(gfar_read(®s->ievent) & IEVENT_GRSC))
+ ret = __gfar_is_rx_idle(priv);
+ } while (!ret);
+ }
+
+ /* Disable Rx in MACCFG1 */
+ tempval = gfar_read(®s->maccfg1);
+ tempval &= ~MACCFG1_RX_EN;
+ gfar_write(®s->maccfg1, tempval);
+}
+#endif
+
/* Halt the receive and transmit queues */
static void gfar_halt_nodisable(struct net_device *dev)
{
@@ -1808,6 +2069,40 @@ void gfar_start(struct net_device *dev)
dev->trans_start = jiffies; /* prevent tx timeout */
}
+#ifdef CONFIG_PM
+void gfar_rx_start(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ struct gfar __iomem *regs = priv->gfargrp[0].regs;
+ u32 tempval;
+ int i = 0;
+
+ /* Enable Rx in MACCFG1 */
+ tempval = gfar_read(®s->maccfg1);
+ tempval |= MACCFG1_RX_EN;
+ gfar_write(®s->maccfg1, tempval);
+
+ /* Initialize DMACTRL to have WWR and WOP */
+ tempval = gfar_read(®s->dmactrl);
+ tempval |= DMACTRL_INIT_SETTINGS;
+ gfar_write(®s->dmactrl, tempval);
+
+ /* Make sure we aren't stopped */
+ tempval = gfar_read(®s->dmactrl);
+ tempval &= ~DMACTRL_GRS;
+ gfar_write(®s->dmactrl, tempval);
+
+ for (i = 0; i < priv->num_grps; i++) {
+ regs = priv->gfargrp[i].regs;
+ /* Clear RHLT, so that the DMA starts polling now */
+ gfar_write(®s->rstat, priv->gfargrp[i].rstat);
+
+ /* Unmask the interrupts we look for */
+ gfar_write(®s->imask, IMASK_DEFAULT);
+ }
+}
+#endif
+
void gfar_configure_coalescing(struct gfar_private *priv,
unsigned long tx_mask, unsigned long rx_mask)
{
@@ -1970,7 +2265,7 @@ static int gfar_enet_open(struct net_device *dev)
netif_tx_start_all_queues(dev);
- device_set_wakeup_enable(&dev->dev, priv->wol_en);
+ device_set_wakeup_enable(&priv->ofdev->dev, priv->wol_en);
return err;
}
@@ -2657,6 +2952,17 @@ static inline void count_errors(unsigned short status, struct net_device *dev)
irqreturn_t gfar_receive(int irq, void *grp_id)
{
+ struct gfar_priv_grp *gfargrp = grp_id;
+ struct gfar __iomem *regs = gfargrp->regs;
+ u32 ievent;
+
+ ievent = gfar_read(®s->ievent);
+
+ if ((ievent & IEVENT_FGPI) == IEVENT_FGPI) {
+ gfar_write(®s->ievent, ievent & IEVENT_RX_MASK);
+ return IRQ_HANDLED;
+ }
+
gfar_schedule_cleanup((struct gfar_priv_grp *)grp_id);
return IRQ_HANDLED;
}
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 9aa4377..efa6478 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -232,6 +232,14 @@ extern const char gfar_driver_version[];
#define RQUEUE_EN7 0x00000001
#define RQUEUE_EN_ALL 0x000000FF
+/* Wake-On-Lan options */
+#define GIANFAR_WOL_PHY (1 << 0)
+#define GIANFAR_WOL_UCAST (1 << 1)
+#define GIANFAR_WOL_MCAST (1 << 2)
+#define GIANFAR_WOL_BCAST (1 << 3)
+#define GIANFAR_WOL_ARP (1 << 4)
+#define GIANFAR_WOL_MAGIC (1 << 5)
+
/* Init to do tx snooping for buffers and descriptors */
#define DMACTRL_INIT_SETTINGS 0x000000c3
#define DMACTRL_GRS 0x00000010
@@ -277,11 +285,15 @@ extern const char gfar_driver_version[];
#define RCTRL_PAL_MASK 0x001f0000
#define RCTRL_VLEX 0x00002000
#define RCTRL_FILREN 0x00001000
+#define RCTRL_FSQEN 0x00000800
#define RCTRL_GHTX 0x00000400
#define RCTRL_IPCSEN 0x00000200
#define RCTRL_TUCSEN 0x00000100
#define RCTRL_PRSDEP_MASK 0x000000c0
#define RCTRL_PRSDEP_INIT 0x000000c0
+#define RCTRL_PRSDEP_L2 0x00000040
+#define RCTRL_PRSDEP_L2L3 0x00000080
+#define RCTRL_PRSDEP_L2L3L4 0x000000c0
#define RCTRL_PRSFM 0x00000020
#define RCTRL_PROM 0x00000008
#define RCTRL_EMEN 0x00000002
@@ -327,18 +339,20 @@ extern const char gfar_driver_version[];
#define IEVENT_MAG 0x00000800
#define IEVENT_GRSC 0x00000100
#define IEVENT_RXF0 0x00000080
+#define IEVENT_FGPI 0x00000010
#define IEVENT_FIR 0x00000008
#define IEVENT_FIQ 0x00000004
#define IEVENT_DPE 0x00000002
#define IEVENT_PERR 0x00000001
-#define IEVENT_RX_MASK (IEVENT_RXB0 | IEVENT_RXF0 | IEVENT_BSY)
+#define IEVENT_RX_MASK (IEVENT_RXB0 | IEVENT_RXF0 | \
+ IEVENT_FGPI | IEVENT_BSY)
#define IEVENT_TX_MASK (IEVENT_TXB | IEVENT_TXF)
#define IEVENT_RTX_MASK (IEVENT_RX_MASK | IEVENT_TX_MASK)
#define IEVENT_ERR_MASK \
-(IEVENT_RXC | IEVENT_BSY | IEVENT_EBERR | IEVENT_MSRO | \
- IEVENT_BABT | IEVENT_TXC | IEVENT_TXE | IEVENT_LC \
- | IEVENT_CRL | IEVENT_XFUN | IEVENT_DPE | IEVENT_PERR \
- | IEVENT_MAG | IEVENT_BABR)
+ (IEVENT_RXC | IEVENT_BSY | IEVENT_EBERR | IEVENT_MSRO | \
+ IEVENT_BABT | IEVENT_TXC | IEVENT_TXE | IEVENT_LC | \
+ IEVENT_CRL | IEVENT_XFUN | IEVENT_FIR | IEVENT_FIQ | \
+ IEVENT_DPE | IEVENT_PERR | IEVENT_MAG | IEVENT_BABR)
#define IMASK_INIT_CLEAR 0x00000000
#define IMASK_BABR 0x80000000
@@ -359,14 +373,15 @@ extern const char gfar_driver_version[];
#define IMASK_MAG 0x00000800
#define IMASK_GRSC 0x00000100
#define IMASK_RXFEN0 0x00000080
+#define IMASK_FGPI 0x00000010
#define IMASK_FIR 0x00000008
#define IMASK_FIQ 0x00000004
#define IMASK_DPE 0x00000002
#define IMASK_PERR 0x00000001
#define IMASK_DEFAULT (IMASK_TXEEN | IMASK_TXFEN | IMASK_TXBEN | \
IMASK_RXFEN0 | IMASK_BSY | IMASK_EBERR | IMASK_BABR | \
- IMASK_XFUN | IMASK_RXC | IMASK_BABT | IMASK_DPE \
- | IMASK_PERR)
+ IMASK_XFUN | IMASK_RXC | IMASK_BABT | IMASK_FGPI | \
+ IMASK_FIR | IMASK_FIQ | IMASK_DPE | IMASK_PERR)
#define IMASK_RTX_DISABLED ((~(IMASK_RXFEN0 | IMASK_TXFEN | IMASK_BSY)) \
& IMASK_DEFAULT)
@@ -883,6 +898,7 @@ struct gfar {
#define FSL_GIANFAR_DEV_HAS_BD_STASHING 0x00000200
#define FSL_GIANFAR_DEV_HAS_BUF_STASHING 0x00000400
#define FSL_GIANFAR_DEV_HAS_TIMER 0x00000800
+#define FSL_GIANFAR_DEV_HAS_ARP_PACKET 0x00001000
#if (MAXGROUPS == 2)
#define DEFAULT_MAPPING 0xAA
@@ -1115,6 +1131,9 @@ struct gfar_private {
struct work_struct reset_task;
+ u8 ip_addr[4];
+ int wol_opts;
+
/* Network Statistics */
struct gfar_extra_stats extra_stats;
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 212736b..336c419 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -29,6 +29,7 @@
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
+#include <linux/platform_device.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -577,11 +578,18 @@ static void gfar_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct gfar_private *priv = netdev_priv(dev);
+ wol->supported = 0;
+ wol->wolopts = 0;
+
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET) {
- wol->supported = WAKE_MAGIC;
- wol->wolopts = priv->wol_en ? WAKE_MAGIC : 0;
- } else {
- wol->supported = wol->wolopts = 0;
+ wol->supported |= WAKE_MAGIC;
+ wol->wolopts |= (priv->wol_opts & GIANFAR_WOL_MAGIC) ?
+ WAKE_MAGIC : 0;
+ }
+ if (priv->device_flags & FSL_GIANFAR_DEV_HAS_ARP_PACKET) {
+ wol->supported |= WAKE_ARP;
+ wol->wolopts |= (priv->wol_opts & GIANFAR_WOL_ARP) ?
+ WAKE_ARP : 0;
}
}
@@ -591,16 +599,21 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
unsigned long flags;
if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET) &&
- wol->wolopts != 0)
- return -EINVAL;
-
- if (wol->wolopts & ~WAKE_MAGIC)
+ !(priv->device_flags & FSL_GIANFAR_DEV_HAS_ARP_PACKET))
return -EINVAL;
- device_set_wakeup_enable(&dev->dev, wol->wolopts & WAKE_MAGIC);
-
spin_lock_irqsave(&priv->bflock, flags);
- priv->wol_en = !!device_may_wakeup(&dev->dev);
+ if (wol->wolopts & WAKE_MAGIC) {
+ priv->wol_en = 1;
+ priv->wol_opts = GIANFAR_WOL_MAGIC;
+ } else if (wol->wolopts & WAKE_ARP) {
+ priv->wol_en = 1;
+ priv->wol_opts = GIANFAR_WOL_ARP;
+ } else {
+ priv->wol_en = 0;
+ priv->wol_opts = 0;
+ }
+ device_set_wakeup_enable(&priv->ofdev->dev, (u32)priv->wol_en);
spin_unlock_irqrestore(&priv->bflock, flags);
return 0;
--
1.6.4.1
^ permalink raw reply related
* Re: bridge: allow forwarding LLDP frames
From: Ed Swierk @ 2011-11-04 13:50 UTC (permalink / raw)
To: Nick Carter; +Cc: shemminger, davem, netdev
In-Reply-To: <CAEJpZP2oGUYW_i+7qYxyD8th_YdGo5+nZaevceYJJxGWsR5c2w@mail.gmail.com>
On Thu, Nov 3, 2011 at 3:17 PM, Nick Carter <ncarter100@gmail.com> wrote:
> The reason the group fwd mask was introduced was to make the bridge
> forward link local group addresses. This is non standards based
> behaviour. The point of the group fwd mask is so that users can have
> non standard bridging behaviour.
>
> I don't understand why the recent commit includes blocking the user
> from choosing to forward certain groups because it breaks standards ?
> The default mask of 0 is standards based behaviour. If the user sets
> it to anything other than 0 then they want non standards based
> behaviour.
>
> In my view the behaviour now is very confusing for the user. 802.1X
> is allowed to be forwarded but LLDP forwarding is rejected ?
>
> The group fwd mask should be allowed to be set to any value. This
> would give flexible and predictable behaviour to the user.
>
> I think we should assume users know the behaviour they require and
> BR_GROUPFWD_RESTRICTED should be removed from the codebase.
+1
It doesn't make sense to go out of our way to forbid users from
enabling forwarding of three magic addresses. Removing the restriction
would simplify the code and simplify the behavior.
--Ed
^ permalink raw reply
* (unknown),
From: averywpb @ 2011-11-04 14:04 UTC (permalink / raw)
To: bcollins.wrhu, cogord, netdev, louis.balthazar, atsiders,
m.wilesmith, m.v.khalil
http://murphycarpenter.com/ee/mcsys/cache/magpie_cache/markehjf.htm
^ permalink raw reply
* [RFC] The Linux kernel IPv6 stack don't follow the RFC 4942 recommendation
From: François-Xavier Le Bail @ 2011-11-04 14:46 UTC (permalink / raw)
To: netdev@vger.kernel.org
Hi,
I do some tests on a Linux 3.0 kernel with IPv6 forwarding mode enabled.
When I ping (ICMPv6 echo request) on one of its Subnet-Router anycast addresses
(SRAA, http://tools.ietf.org/html/rfc4291#section-2.6.1),
the Linux kernel reply with an unicast source address, not the anycast one.
When I send an IPv6 UDP packet to a server on Linux on one of its SRAA,
the Linux kernel build a reply with an unicast source address, not the anycast one.
The RFC 4942 states (http://tools.ietf.org/html/rfc4942#section-2.1.6) :
2.1.6. Anycast Traffic Identification and Security
[. . .]
To avoid exposing knowledge about the internal structure of the
network, it is recommended that anycast servers now take advantage of
the ability to return responses with the anycast address as the
source address if possible.
Also, If the source address of reply differs from destination address of the request, many applications are broken.
Please let me know your feedback.
Thanks,
Francois-Xavier Le Bail
^ permalink raw reply
* Re: [PATCH net v2 1/8] forcedeth: Improve stats counters
From: Stephen Hemminger @ 2011-11-04 14:54 UTC (permalink / raw)
To: David Decotigny
Cc: netdev, linux-kernel, David S. Miller, Ian Campbell, Eric Dumazet,
Jeff Kirsher, Jiri Pirko, Joe Perches, Szymon Janc,
Mandeep Baines
In-Reply-To: <f005f434ebc4922bbcc1b7bf6949bb3b7c45fbe8.1320369398.git.david.decotigny@google.com>
On Thu, 3 Nov 2011 18:41:16 -0700
David Decotigny <david.decotigny@google.com> wrote:
> From: Mandeep Baines <msb@google.com>
>
> Rx byte count was off; instead use the hardware's count. Tx packet
> count was counting pre-TSO packets; instead count on-the-wire packets.
> Report hardware dropped frame count as rx_fifo_errors.
>
> - The count of transmitted packets reported by the forcedeth driver
> reports pre-TSO (TCP Segmentation Offload) packet counts and not the
> count of the number of packets sent on the wire. This change fixes
> the forcedeth driver to report the correct count. Fixed the code by
> copying the count stored in the NIC H/W to the value reported by the
> driver.
>
> - Count rx_drop_frame errors as rx_fifo_errors:
> We see a lot of rx_drop_frame errors if we disable the rx bottom-halves
> for too long. Normally, rx_fifo_errors would be counted in this case.
> The rx_drop_frame error count is private to forcedeth and is not
> reported by ifconfig or sysfs. The rx_fifo_errors count is currently
> unused in the forcedeth driver. It is reported by ifconfig as overruns.
> This change reports rx_drop_frame errors as rx_fifo_errors.
>
>
>
> Signed-off-by: David Decotigny <david.decotigny@google.com>
> ---
> drivers/net/ethernet/nvidia/forcedeth.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
> index 1e37eb9..64b1c7c 100644
> --- a/drivers/net/ethernet/nvidia/forcedeth.c
> +++ b/drivers/net/ethernet/nvidia/forcedeth.c
> @@ -1682,6 +1682,7 @@ static void nv_get_hw_stats(struct net_device *dev)
> np->estats.tx_pause += readl(base + NvRegTxPause);
> np->estats.rx_pause += readl(base + NvRegRxPause);
> np->estats.rx_drop_frame += readl(base + NvRegRxDropFrame);
> + np->estats.rx_errors_total += np->estats.rx_drop_frame;
> }
>
> if (np->driver_data & DEV_HAS_STATISTICS_V3) {
> @@ -1706,11 +1707,14 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
> nv_get_hw_stats(dev);
>
> /* copy to net_device stats */
> + dev->stats.tx_packets = np->estats.tx_packets;
> + dev->stats.rx_bytes = np->estats.rx_bytes;
> dev->stats.tx_bytes = np->estats.tx_bytes;
> dev->stats.tx_fifo_errors = np->estats.tx_fifo_errors;
> dev->stats.tx_carrier_errors = np->estats.tx_carrier_errors;
> dev->stats.rx_crc_errors = np->estats.rx_crc_errors;
> dev->stats.rx_over_errors = np->estats.rx_over_errors;
> + dev->stats.rx_fifo_errors = np->estats.rx_drop_frame;
> dev->stats.rx_errors = np->estats.rx_errors_total;
> dev->stats.tx_errors = np->estats.tx_errors_total;
> }
Why not convert it to 64 bit stats as well.
^ permalink raw reply
* Re: iproute2 neighboring
From: David Stevens @ 2011-11-04 15:46 UTC (permalink / raw)
To: Kevin Wilson; +Cc: netdev, netdev-owner
In-Reply-To: <CAGXs5wUEiS-vpdsCDoyva2Vg9XKBmbJgoPVOXUXD0u9+PzXH=w@mail.gmail.com>
> From: Kevin Wilson <wkevils@gmail.com>
> Hi,
> It seems to me that "ip -6 neigh show" does not show multicast entries
from
> IPv6 neighboring table. Is there a reason for this ?
Multicast memberships aren't in the neighbor table. The
neighbor table is for translating protocol addresses to
MAC addresses and that translation is fixed for multicast
destinations.
You can see group memberships with "netstat -g". There are also
some data in /proc/net/{dev_mcast,igmp6,mcfilter6} depending on
what you're looking for.
+-DLS
^ permalink raw reply
* Re: iproute2 neighboring
From: François-Xavier Le Bail @ 2011-11-04 15:54 UTC (permalink / raw)
To: David Stevens, Kevin Wilson
Cc: netdev@vger.kernel.org, netdev-owner@vger.kernel.org
In-Reply-To: <OFD3A98142.1EDCCB6F-ON8825793E.0055C070-8825793E.0056A45E@us.ibm.com>
----- Original Message -----
> From: David Stevens <dlstevens@us.ibm.com>
> To: Kevin Wilson <wkevils@gmail.com>
> Cc: netdev@vger.kernel.org; netdev-owner@vger.kernel.org
> Sent: Friday, November 4, 2011 4:46 PM
> Subject: Re: iproute2 neighboring
>
>> From: Kevin Wilson <wkevils@gmail.com>
>
>> Hi,
>> It seems to me that "ip -6 neigh show" does not show multicast
> entries
> from
>> IPv6 neighboring table. Is there a reason for this ?
>
> Multicast memberships aren't in the neighbor table. The
> neighbor table is for translating protocol addresses to
> MAC addresses and that translation is fixed for multicast
> destinations.
>
> You can see group memberships with "netstat -g". There are also
> some data in /proc/net/{dev_mcast,igmp6,mcfilter6} depending on
> what you're looking for.
>
> +-DLS
Hi,
You can also see group memberships with "ip m".
François-Xavier
^ permalink raw reply
* Re: [RFC] The Linux kernel IPv6 stack don't follow the RFC 4942 recommendation
From: Eric Dumazet @ 2011-11-04 16:24 UTC (permalink / raw)
To: François-Xavier Le Bail; +Cc: netdev@vger.kernel.org
In-Reply-To: <1320417988.69298.YahooMailNeo@web126013.mail.ne1.yahoo.com>
Le vendredi 04 novembre 2011 à 07:46 -0700, François-Xavier Le Bail a
écrit :
> Hi,
>
> I do some tests on a Linux 3.0 kernel with IPv6 forwarding mode enabled.
>
> When I ping (ICMPv6 echo request) on one of its Subnet-Router anycast addresses
> (SRAA, http://tools.ietf.org/html/rfc4291#section-2.6.1),
> the Linux kernel reply with an unicast source address, not the anycast one.
>
> When I send an IPv6 UDP packet to a server on Linux on one of its SRAA,
> the Linux kernel build a reply with an unicast source address, not the anycast one.
>
Nothing in the kernel builds a reply to an UDP packet.
I would say the user application is responsible to build an answer, and
chose appropriate source address.
If your application uses a ANY_ADDR bind, then it must appropriate
action so that a good source address is used in answers.
In case of IPv6 socket, I advise you take a look at IPV6_PKTINFO /
IPV6_RECVPKTINFO options.
> The RFC 4942 states (http://tools.ietf.org/html/rfc4942#section-2.1.6) :
> 2.1.6. Anycast Traffic Identification and Security
> [. . .]
> To avoid exposing knowledge about the internal structure of the
> network, it is recommended that anycast servers now take advantage of
> the ability to return responses with the anycast address as the
> source address if possible.
>
> Also, If the source address of reply differs from destination address of the request, many applications are broken.
> Please let me know your feedback.
>
'anycast servers' are a combination of kernel and userland parts.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox