* Re: [PATCH -next] net: calxeda xgmac ethernet driver add missing HAS_IOMEM dependency
From: Rob Herring @ 2011-12-27 14:16 UTC (permalink / raw)
To: Heiko Carstens; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1324994825-4197-1-git-send-email-heiko.carstens@de.ibm.com>
On 12/27/2011 08:07 AM, Heiko Carstens wrote:
> Fix allyesconfig build on architectures without IOMEM:
>
> drivers/net/ethernet/calxeda/xgmac.c:1800:2:
> error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Rob Herring <rob.herring@calxeda.com>
Thanks.
Acked-by: Rob Herring <rob.herring@calxeda.com>
> ---
> drivers/net/ethernet/calxeda/Kconfig | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/calxeda/Kconfig b/drivers/net/ethernet/calxeda/Kconfig
> index a52e725..aba435c 100644
> --- a/drivers/net/ethernet/calxeda/Kconfig
> +++ b/drivers/net/ethernet/calxeda/Kconfig
> @@ -1,6 +1,6 @@
> config NET_CALXEDA_XGMAC
> tristate "Calxeda 1G/10G XGMAC Ethernet driver"
> -
> + depends on HAS_IOMEM
> select CRC32
> help
> This is the driver for the XGMAC Ethernet IP block found on Calxeda
^ permalink raw reply
* [PATCH -next] net: calxeda xgmac ethernet driver add missing HAS_IOMEM dependency
From: Heiko Carstens @ 2011-12-27 14:07 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, linux-kernel, Heiko Carstens, Rob Herring
Fix allyesconfig build on architectures without IOMEM:
drivers/net/ethernet/calxeda/xgmac.c:1800:2:
error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Rob Herring <rob.herring@calxeda.com>
---
drivers/net/ethernet/calxeda/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/calxeda/Kconfig b/drivers/net/ethernet/calxeda/Kconfig
index a52e725..aba435c 100644
--- a/drivers/net/ethernet/calxeda/Kconfig
+++ b/drivers/net/ethernet/calxeda/Kconfig
@@ -1,6 +1,6 @@
config NET_CALXEDA_XGMAC
tristate "Calxeda 1G/10G XGMAC Ethernet driver"
-
+ depends on HAS_IOMEM
select CRC32
help
This is the driver for the XGMAC Ethernet IP block found on Calxeda
--
1.7.7.3
^ permalink raw reply related
* [PATCH v3] gianfar: add support for wake-on-packet
From: Zhao Chenhui @ 2011-12-27 11:30 UTC (permalink / raw)
To: linuxppc-dev; +Cc: netdev, devicetree-discuss, leoli, afleming
On certain chip like MPC8536 and P1022, system can be waked up from
sleep by user-defined packet and Magic Patcket.(The eTSEC cannot
supports both types of wake-up event simultaneously.) This patch
implements wake-up on user-defined patcket including ARP request
packet and 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 primary IP/MAC address of
the station. Do not support multiple IP/MAC addresses.
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>
---
This patch depends on my previous patches related to power management.
Changes for v3:
- Add "CONFIG_FSL_PMC"
.../devicetree/bindings/net/fsl-tsec-phy.txt | 3 +
drivers/net/ethernet/freescale/gianfar.c | 363 +++++++++++++++++---
drivers/net/ethernet/freescale/gianfar.h | 33 ++-
drivers/net/ethernet/freescale/gianfar_ethtool.c | 52 ++-
4 files changed, 373 insertions(+), 78 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..d0a46d8 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_table(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;
@@ -763,9 +775,21 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
else
priv->interface = PHY_INTERFACE_MODE_MII;
- if (of_get_property(np, "fsl,magic-packet", NULL))
+ /* Init Wake-on-LAN */
+ priv->wol_opts = 0;
+ priv->wol_supported = 0;
+#ifdef CONFIG_FSL_PMC
+ if (of_get_property(np, "fsl,magic-packet", NULL)) {
priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
+ priv->wol_supported |= GIANFAR_WOL_MAGIC;
+ }
+ if (of_get_property(np, "fsl,wake-on-filer", NULL)) {
+ priv->device_flags |= FSL_GIANFAR_DEV_HAS_WAKE_ON_FILER;
+ priv->wol_supported |= GIANFAR_WOL_ARP;
+ priv->wol_supported |= GIANFAR_WOL_UCAST;
+ }
+#endif
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 +1192,10 @@ 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->wol_supported) {
+ 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 +1286,143 @@ 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;
+ int ret = -ENOENT;
+
+ in_dev = in_dev_get(dev);
+ if (!in_dev)
+ return ret;
+
+ /* Get the primary IP address */
+ for_primary_ifa(in_dev) {
+ priv->ip_addr = ifa->ifa_address;
+ ret = 0;
+ break;
+ } endfor_ifa(in_dev);
+
+ in_dev_put(in_dev);
+ return ret;
+}
+
+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_table(struct net_device *dev)
+{
+ struct gfar_private *priv = netdev_priv(dev);
+ u32 dest_mac_addr;
+ u32 rqfcr, rqfpr;
+ u8 rqfcr_queue = priv->num_rx_queues - 1;
+ unsigned int index;
+
+ if (gfar_get_ip(dev)) {
+ netif_err(priv, wol, dev, "WOL: get the ip address error\n");
+ return;
+ }
+
+ lock_rx_qs(priv);
+
+ /* init filer table */
+ rqfcr = RQFCR_RJE | RQFCR_CMP_MATCH;
+ rqfpr = 0x0;
+ for (index = 0; index <= MAX_FILER_IDX; index++)
+ gfar_write_filer(priv, index, rqfcr, rqfpr);
+
+ index = 0;
+ if (priv->wol_opts & GIANFAR_WOL_ARP) {
+ /* ARP request filer, filling the packet to the last queue */
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_MASK;
+ rqfpr = RQFPR_ARQ;
+ gfar_write_filer(priv, index++, rqfcr, rqfpr);
+
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_PARSE;
+ rqfpr = RQFPR_ARQ;
+ gfar_write_filer(priv, index++, rqfcr, rqfpr);
+
+ /*
+ * DEST_IP address in ARP packet,
+ * filling it to the last queue.
+ */
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_MASK;
+ rqfpr = FPR_FILER_MASK;
+ gfar_write_filer(priv, index++, rqfcr, rqfpr);
+
+ rqfcr = (rqfcr_queue << 10) | RQFCR_GPI |
+ RQFCR_CMP_EXACT | RQFCR_PID_DIA;
+ rqfpr = priv->ip_addr;
+ gfar_write_filer(priv, index++, rqfcr, rqfpr);
+ }
+
+ if (priv->wol_opts & GIANFAR_WOL_UCAST) {
+ /* Unicast packet, filling it to the last queue */
+ dest_mac_addr = (dev->dev_addr[0] << 16) |
+ (dev->dev_addr[1] << 8) | dev->dev_addr[2];
+ rqfcr = (rqfcr_queue << 10) | RQFCR_AND |
+ RQFCR_CMP_EXACT | RQFCR_PID_DAH;
+ rqfpr = dest_mac_addr;
+ gfar_write_filer(priv, index++, rqfcr, rqfpr);
+
+ dest_mac_addr = (dev->dev_addr[3] << 16) |
+ (dev->dev_addr[4] << 8) | dev->dev_addr[5];
+ rqfcr = (rqfcr_queue << 10) | RQFCR_GPI |
+ RQFCR_CMP_EXACT | RQFCR_PID_DAL;
+ rqfpr = dest_mac_addr;
+ gfar_write_filer(priv, index++, rqfcr, rqfpr);
+ }
+
+ unlock_rx_qs(priv);
+}
static int gfar_suspend(struct device *dev)
{
@@ -1269,48 +1432,43 @@ static int gfar_suspend(struct device *dev)
unsigned long flags;
u32 tempval;
- int magic_packet = priv->wol_en &&
- (priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET);
-
netif_device_detach(ndev);
- if (netif_running(ndev)) {
-
- local_irq_save(flags);
- lock_tx_qs(priv);
- lock_rx_qs(priv);
-
- gfar_halt_nodisable(ndev);
-
- /* Disable Tx, and Rx if wake-on-LAN is disabled. */
- tempval = gfar_read(®s->maccfg1);
-
- tempval &= ~MACCFG1_TX_EN;
+ if (!netif_running(ndev))
+ return 0;
- if (!magic_packet)
- tempval &= ~MACCFG1_RX_EN;
+ local_irq_save(flags);
+ lock_tx_qs(priv);
+ lock_rx_qs(priv);
- gfar_write(®s->maccfg1, tempval);
+ gfar_halt(ndev);
- unlock_rx_qs(priv);
- unlock_tx_qs(priv);
- local_irq_restore(flags);
+ unlock_rx_qs(priv);
+ unlock_tx_qs(priv);
+ local_irq_restore(flags);
- disable_napi(priv);
+ disable_napi(priv);
- if (magic_packet) {
- /* Enable interrupt on Magic Packet */
- gfar_write(®s->imask, IMASK_MAG);
+ if (!priv->wol_opts && priv->phydev) {
+ phy_stop(priv->phydev);
+ return 0;
+ }
- /* Enable Magic Packet mode */
- tempval = gfar_read(®s->maccfg2);
- tempval |= MACCFG2_MPEN;
- gfar_write(®s->maccfg2, tempval);
- } else {
- phy_stop(priv->phydev);
- }
+ mpc85xx_pmc_set_wake(priv->ofdev, 1);
+ if (priv->wol_opts & GIANFAR_WOL_MAGIC) {
+ /* Enable Magic Packet mode */
+ tempval = gfar_read(®s->maccfg2);
+ tempval |= MACCFG2_MPEN;
+ gfar_write(®s->maccfg2, tempval);
}
+ if (priv->wol_opts & (GIANFAR_WOL_ARP | GIANFAR_WOL_UCAST)) {
+ mpc85xx_pmc_set_lossless_ethernet(1);
+ gfar_disable_filer(ndev);
+ gfar_config_filer_table(ndev);
+ gfar_enable_filer(ndev);
+ }
+ gfar_rx_start(ndev);
return 0;
}
@@ -1320,39 +1478,49 @@ static int gfar_resume(struct device *dev)
struct net_device *ndev = priv->ndev;
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);
+ u32 tempval, i;
if (!netif_running(ndev)) {
netif_device_attach(ndev);
return 0;
}
- if (!magic_packet && priv->phydev)
+ if (!priv->wol_opts && priv->phydev) {
phy_start(priv->phydev);
+ goto out;
+ }
+
+ mpc85xx_pmc_set_wake(priv->ofdev, 0);
- /* Disable Magic Packet mode, in case something
- * else woke us up.
- */
local_irq_save(flags);
- lock_tx_qs(priv);
lock_rx_qs(priv);
-
- tempval = gfar_read(®s->maccfg2);
- tempval &= ~MACCFG2_MPEN;
- gfar_write(®s->maccfg2, tempval);
-
- gfar_start(ndev);
-
+ gfar_halt_rx(ndev);
unlock_rx_qs(priv);
- unlock_tx_qs(priv);
local_irq_restore(flags);
- netif_device_attach(ndev);
+ if (priv->wol_opts & (GIANFAR_WOL_ARP | GIANFAR_WOL_UCAST)) {
+ mpc85xx_pmc_set_lossless_ethernet(0);
+ gfar_disable_filer(ndev);
+ gfar_restore_filer_table(ndev);
+ }
+
+ if (priv->wol_opts & GIANFAR_WOL_MAGIC) {
+ /* Disable Magic Packet mode */
+ tempval = gfar_read(®s->maccfg2);
+ tempval &= ~MACCFG2_MPEN;
+ gfar_write(®s->maccfg2, tempval);
+ }
+out:
+ gfar_start(ndev);
+ netif_device_attach(ndev);
enable_napi(priv);
+ if (priv->wol_opts & (GIANFAR_WOL_ARP | GIANFAR_WOL_UCAST)) {
+ /* send requests to process the received packets */
+ for (i = 0; i < priv->num_grps; i++)
+ gfar_schedule_cleanup(&priv->gfargrp[i]);
+ }
return 0;
}
@@ -1602,6 +1770,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 +2018,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 +2214,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_opts);
return err;
}
@@ -2657,6 +2901,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..1abebc4 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -232,6 +232,13 @@ extern const char gfar_driver_version[];
#define RQUEUE_EN7 0x00000001
#define RQUEUE_EN_ALL 0x000000FF
+/* Wake-On-Lan options */
+#define GIANFAR_WOL_UCAST 0x00000001 /* Unicast wakeup */
+#define GIANFAR_WOL_MCAST 0x00000002 /* Multicast wakeup */
+#define GIANFAR_WOL_BCAST 0x00000004 /* Broadcase wakeup */
+#define GIANFAR_WOL_ARP 0x00000008 /* ARP request wakeup */
+#define GIANFAR_WOL_MAGIC 0x00000010 /* Magic packet wakeup */
+
/* Init to do tx snooping for buffers and descriptors */
#define DMACTRL_INIT_SETTINGS 0x000000c3
#define DMACTRL_GRS 0x00000010
@@ -277,11 +284,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 +338,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 +372,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 | IMASK_MAG)
#define IMASK_RTX_DISABLED ((~(IMASK_RXFEN0 | IMASK_TXFEN | IMASK_BSY)) \
& IMASK_DEFAULT)
@@ -883,6 +897,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_WAKE_ON_FILER 0x00001000
#if (MAXGROUPS == 2)
#define DEFAULT_MAPPING 0xAA
@@ -1115,6 +1130,10 @@ struct gfar_private {
struct work_struct reset_task;
+ u32 ip_addr;
+ u32 wol_opts;
+ u32 wol_supported;
+
/* 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..296e762 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,32 +578,49 @@ static void gfar_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct gfar_private *priv = netdev_priv(dev);
- 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 = 0;
+ wol->wolopts = 0;
+
+ if (!priv->wol_supported || !device_can_wakeup(&priv->ofdev->dev))
+ return;
+
+ if (priv->wol_supported & GIANFAR_WOL_MAGIC)
+ wol->supported |= WAKE_MAGIC;
+
+ if (priv->wol_supported & GIANFAR_WOL_ARP)
+ wol->supported |= WAKE_ARP;
+
+ if (priv->wol_supported & GIANFAR_WOL_UCAST)
+ wol->supported |= WAKE_UCAST;
+
+ if (priv->wol_opts & GIANFAR_WOL_MAGIC)
+ wol->wolopts |= WAKE_MAGIC;
+
+ if (priv->wol_opts & GIANFAR_WOL_ARP)
+ wol->wolopts |= WAKE_ARP;
+
+ if (priv->wol_opts & GIANFAR_WOL_UCAST)
+ wol->wolopts |= WAKE_UCAST;
}
static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct gfar_private *priv = netdev_priv(dev);
- unsigned long flags;
- if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_MAGIC_PACKET) &&
- wol->wolopts != 0)
- return -EINVAL;
-
- if (wol->wolopts & ~WAKE_MAGIC)
- return -EINVAL;
+ if (!priv->wol_supported || !device_can_wakeup(&priv->ofdev->dev) ||
+ (wol->wolopts & ~(WAKE_MAGIC | WAKE_ARP | WAKE_UCAST)))
+ return -EOPNOTSUPP;
- device_set_wakeup_enable(&dev->dev, wol->wolopts & WAKE_MAGIC);
+ priv->wol_opts = 0;
- spin_lock_irqsave(&priv->bflock, flags);
- priv->wol_en = !!device_may_wakeup(&dev->dev);
- spin_unlock_irqrestore(&priv->bflock, flags);
+ if (wol->wolopts & WAKE_MAGIC)
+ priv->wol_opts |= GIANFAR_WOL_MAGIC;
+ if (wol->wolopts & WAKE_ARP)
+ priv->wol_opts |= GIANFAR_WOL_ARP;
+ if (wol->wolopts & WAKE_UCAST)
+ priv->wol_opts |= GIANFAR_WOL_UCAST;
+ device_set_wakeup_enable(&priv->ofdev->dev, (u32)priv->wol_opts);
return 0;
}
#endif
--
1.6.4.1
^ permalink raw reply related
* Re: [PATCH] net/ucc_geth: some fix in current kernel
From: Joakim Tjernlund @ 2011-12-27 10:56 UTC (permalink / raw)
To: Xie Xiaobo; +Cc: leoli, linuxppc-dev, netdev
In-Reply-To: <1324979328-32081-1-git-send-email-X.Xie@freescale.com>
>
> * Revert commit "ucc_geth: Fix hangs after switching from full to half duplex"
> This commit impacted the driver in all link state change more than
> duplex change.
hmm, so what will happen now when switching from full to half duplex? Will it just hang? If so
that doesn't seem like an improvement.
> * Change some parameters.
> Increased the BD ring length.
Increasing both TX and RX from 16 to 64 seems a bit much. I got away with
just increasing RX to 32. What memory are the BD ring using, the internal or external RAM?
Jocke
>
> Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
> Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
> ---
> drivers/net/ethernet/freescale/ucc_geth.c | 41 ++++------------------------
> drivers/net/ethernet/freescale/ucc_geth.h | 6 ++--
> 2 files changed, 9 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
> index b5dc027..3e18902 100644
> --- a/drivers/net/ethernet/freescale/ucc_geth.c
> +++ b/drivers/net/ethernet/freescale/ucc_geth.c
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (C) 2006-2009 Freescale Semicondutor, Inc. All rights reserved.
> + * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved.
> *
> * Author: Shlomi Gridish <gridish@freescale.com>
> * Li Yang <leoli@freescale.com>
> @@ -1570,28 +1570,6 @@ static int ugeth_disable(struct ucc_geth_private *ugeth, enum comm_dir mode)
> return 0;
> }
>
> -static void ugeth_quiesce(struct ucc_geth_private *ugeth)
> -{
> - /* Prevent any further xmits, plus detach the device. */
> - netif_device_detach(ugeth->ndev);
> -
> - /* Wait for any current xmits to finish. */
> - netif_tx_disable(ugeth->ndev);
> -
> - /* Disable the interrupt to avoid NAPI rescheduling. */
> - disable_irq(ugeth->ug_info->uf_info.irq);
> -
> - /* Stop NAPI, and possibly wait for its completion. */
> - napi_disable(&ugeth->napi);
> -}
> -
> -static void ugeth_activate(struct ucc_geth_private *ugeth)
> -{
> - napi_enable(&ugeth->napi);
> - enable_irq(ugeth->ug_info->uf_info.irq);
> - netif_device_attach(ugeth->ndev);
> -}
> -
> /* Called every time the controller might need to be made
> * aware of new link state. The PHY code conveys this
> * information through variables in the ugeth structure, and this
> @@ -1605,11 +1583,14 @@ static void adjust_link(struct net_device *dev)
> struct ucc_geth __iomem *ug_regs;
> struct ucc_fast __iomem *uf_regs;
> struct phy_device *phydev = ugeth->phydev;
> + unsigned long flags;
> int new_state = 0;
>
> ug_regs = ugeth->ug_regs;
> uf_regs = ugeth->uccf->uf_regs;
>
> + spin_lock_irqsave(&ugeth->lock, flags);
> +
> if (phydev->link) {
> u32 tempval = in_be32(&ug_regs->maccfg2);
> u32 upsmr = in_be32(&uf_regs->upsmr);
> @@ -1666,21 +1647,9 @@ static void adjust_link(struct net_device *dev)
> }
>
> if (new_state) {
> - /*
> - * To change the MAC configuration we need to disable
> - * the controller. To do so, we have to either grab
> - * ugeth->lock, which is a bad idea since 'graceful
> - * stop' commands might take quite a while, or we can
> - * quiesce driver's activity.
> - */
> - ugeth_quiesce(ugeth);
> - ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);
> -
> out_be32(&ug_regs->maccfg2, tempval);
> out_be32(&uf_regs->upsmr, upsmr);
>
> - ugeth_enable(ugeth, COMM_DIR_RX_AND_TX);
> - ugeth_activate(ugeth);
> }
> } else if (ugeth->oldlink) {
> new_state = 1;
> @@ -1691,6 +1660,8 @@ static void adjust_link(struct net_device *dev)
>
> if (new_state && netif_msg_link(ugeth))
> phy_print_status(phydev);
> +
> + spin_unlock_irqrestore(&ugeth->lock, flags);
> }
>
> /* Initialize TBI PHY interface for communicating with the
> diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h
> index d12fcad..b0b42b4 100644
> --- a/drivers/net/ethernet/freescale/ucc_geth.h
> +++ b/drivers/net/ethernet/freescale/ucc_geth.h
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (C) Freescale Semicondutor, Inc. 2006-2009. All rights reserved.
> + * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved.
> *
> * Author: Shlomi Gridish <gridish@freescale.com>
> *
> @@ -875,8 +875,8 @@ struct ucc_geth_hardware_statistics {
> #define UCC_GETH_SIZE_OF_BD QE_SIZEOF_BD
>
> /* Driver definitions */
> -#define TX_BD_RING_LEN 0x10
> -#define RX_BD_RING_LEN 0x10
> +#define TX_BD_RING_LEN 64
> +#define RX_BD_RING_LEN 64
>
> #define TX_RING_MOD_MASK(size) (size-1)
> #define RX_RING_MOD_MASK(size) (size-1)
> --
> 1.7.5.1
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* [PATCH] net/ucc_geth: some fix in current kernel
From: Xie Xiaobo @ 2011-12-27 9:48 UTC (permalink / raw)
To: linuxppc-dev, netdev, leoli; +Cc: Xie Xiaobo, Haiying Wang
* Revert commit "ucc_geth: Fix hangs after switching from full to half duplex"
This commit impacted the driver in all link state change more than
duplex change.
* Change some parameters.
Increased the BD ring length.
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
---
drivers/net/ethernet/freescale/ucc_geth.c | 41 ++++------------------------
drivers/net/ethernet/freescale/ucc_geth.h | 6 ++--
2 files changed, 9 insertions(+), 38 deletions(-)
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index b5dc027..3e18902 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2009 Freescale Semicondutor, Inc. All rights reserved.
+ * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved.
*
* Author: Shlomi Gridish <gridish@freescale.com>
* Li Yang <leoli@freescale.com>
@@ -1570,28 +1570,6 @@ static int ugeth_disable(struct ucc_geth_private *ugeth, enum comm_dir mode)
return 0;
}
-static void ugeth_quiesce(struct ucc_geth_private *ugeth)
-{
- /* Prevent any further xmits, plus detach the device. */
- netif_device_detach(ugeth->ndev);
-
- /* Wait for any current xmits to finish. */
- netif_tx_disable(ugeth->ndev);
-
- /* Disable the interrupt to avoid NAPI rescheduling. */
- disable_irq(ugeth->ug_info->uf_info.irq);
-
- /* Stop NAPI, and possibly wait for its completion. */
- napi_disable(&ugeth->napi);
-}
-
-static void ugeth_activate(struct ucc_geth_private *ugeth)
-{
- napi_enable(&ugeth->napi);
- enable_irq(ugeth->ug_info->uf_info.irq);
- netif_device_attach(ugeth->ndev);
-}
-
/* Called every time the controller might need to be made
* aware of new link state. The PHY code conveys this
* information through variables in the ugeth structure, and this
@@ -1605,11 +1583,14 @@ static void adjust_link(struct net_device *dev)
struct ucc_geth __iomem *ug_regs;
struct ucc_fast __iomem *uf_regs;
struct phy_device *phydev = ugeth->phydev;
+ unsigned long flags;
int new_state = 0;
ug_regs = ugeth->ug_regs;
uf_regs = ugeth->uccf->uf_regs;
+ spin_lock_irqsave(&ugeth->lock, flags);
+
if (phydev->link) {
u32 tempval = in_be32(&ug_regs->maccfg2);
u32 upsmr = in_be32(&uf_regs->upsmr);
@@ -1666,21 +1647,9 @@ static void adjust_link(struct net_device *dev)
}
if (new_state) {
- /*
- * To change the MAC configuration we need to disable
- * the controller. To do so, we have to either grab
- * ugeth->lock, which is a bad idea since 'graceful
- * stop' commands might take quite a while, or we can
- * quiesce driver's activity.
- */
- ugeth_quiesce(ugeth);
- ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);
-
out_be32(&ug_regs->maccfg2, tempval);
out_be32(&uf_regs->upsmr, upsmr);
- ugeth_enable(ugeth, COMM_DIR_RX_AND_TX);
- ugeth_activate(ugeth);
}
} else if (ugeth->oldlink) {
new_state = 1;
@@ -1691,6 +1660,8 @@ static void adjust_link(struct net_device *dev)
if (new_state && netif_msg_link(ugeth))
phy_print_status(phydev);
+
+ spin_unlock_irqrestore(&ugeth->lock, flags);
}
/* Initialize TBI PHY interface for communicating with the
diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h
index d12fcad..b0b42b4 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.h
+++ b/drivers/net/ethernet/freescale/ucc_geth.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) Freescale Semicondutor, Inc. 2006-2009. All rights reserved.
+ * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved.
*
* Author: Shlomi Gridish <gridish@freescale.com>
*
@@ -875,8 +875,8 @@ struct ucc_geth_hardware_statistics {
#define UCC_GETH_SIZE_OF_BD QE_SIZEOF_BD
/* Driver definitions */
-#define TX_BD_RING_LEN 0x10
-#define RX_BD_RING_LEN 0x10
+#define TX_BD_RING_LEN 64
+#define RX_BD_RING_LEN 64
#define TX_RING_MOD_MASK(size) (size-1)
#define RX_RING_MOD_MASK(size) (size-1)
--
1.7.5.1
^ permalink raw reply related
* Re: Cross posting
From: Niccolò Belli @ 2011-12-27 10:30 UTC (permalink / raw)
To: lartc, netdev
In-Reply-To: <1324938391.4401.75.camel@denise.theartistscloset.com>
Currently there are about 50 subscriptions to lartc, you can check
yourself at http://vger.kernel.org/vger-lists.html#lartc
Niccolò
Il 26/12/2011 23:26, John A. Sullivan III ha scritto:
> Hello, all. I still find myself posting most of my questions to
> netdev@vger.kernel.org since I'm not quite sure who has found there way
> to lartc yet.
>
> I know it is normally considered rude to cross post but would it be a
> good idea to cross post until lartc builds up a support community of its
> own and to help build its archives? Thoughts? Comments? Insults? Thanks
> - John
^ permalink raw reply
* Why network stack not reply RST
From: zrpeng @ 2011-12-27 8:31 UTC (permalink / raw)
To: netdev
Hi:
Why network stack not reply RST?
I am doing test recently based on kernel 2.6.32. In my case:
1) The server application closed the established socket, the network stack
sent FIN to client. The socket status in kernel's network stack was
TCP_FIN_WAIT1.
2) The client sent out a tcp packet with ACK bit set for the server's FIN,
the packet also took new data.
3) When the server received the packet, network stack entered "step 5" in
function "tcp_rcv_state_process".
4) Then came to 'case TCP_FIN_WAIT1:'
5) Then came to judgement
if (tp->linger2 < 0 ||
(TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) {
.....
}
6) Because the previous packet took data and ACK (for the FIN), it entered
the judgement. So, the socket is deleted in function 'tcp_done(sk)'.
7) No TCP message was sent back to client side from then on, and client
was left in LAST_ACK status.
My questions are:
1) Is this process correct? I think the server should sent RST to client,
is this correct?
2) What's the using of judgement
(TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)
The code exists from kernel 2.3.41 and 2.3.42.
Thank you very much!
Best Regards.
Peng Zhaoran from Linx-Info Tech.
www.linx-info.com
^ permalink raw reply
* Re: [PATCH] net: meth: Add set_rx_mode hook to fix ICMPv6 neighbor discovery
From: Joshua Kinard @ 2011-12-27 5:06 UTC (permalink / raw)
To: netdev, Linux MIPS List
In-Reply-To: <4EED3A3D.9080503@gentoo.org>
SGI IP32 (O2)'s ethernet driver (meth) lacks a set_rx_mode function, which
prevents IPv6 from working completely because any ICMPv6 neighbor
solicitation requests aren't picked up by the driver. So the machine can
ping out and connect to other systems, but other systems will have a very
hard time connecting to the O2.
Signed-off-by: Joshua Kinard <kumba@gentoo.org>
---
arch/mips/include/asm/ip32/mace.h | 2 -
drivers/net/ethernet/sgi/meth.c | 48 +++++++++++++++++++++++++++++++++++++-
2 files changed, 48 insertions(+), 2 deletions(-)
diff -Naurp a/arch/mips/include/asm/ip32/mace.h
b/arch/mips/include/asm/ip32/mace.h
--- a/arch/mips/include/asm/ip32/mace.h 2011-12-24 16:19:46.703561171 -0500
+++ b/arch/mips/include/asm/ip32/mace.h 2011-12-26 20:04:15.281839510 -0500
@@ -95,7 +95,7 @@ struct mace_video {
* Ethernet interface
*/
struct mace_ethernet {
- volatile unsigned long mac_ctrl;
+ volatile u64 mac_ctrl;
volatile unsigned long int_stat;
volatile unsigned long dma_ctrl;
volatile unsigned long timer;
diff -Naurp a/drivers/net/ethernet/sgi/meth.c b/drivers/net/ethernet/sgi/meth.c
--- a/drivers/net/ethernet/sgi/meth.c 2011-12-24 16:20:06.743560985 -0500
+++ b/drivers/net/ethernet/sgi/meth.c 2011-12-26 20:03:53.471839710 -0500
@@ -28,6 +28,7 @@
#include <linux/tcp.h> /* struct tcphdr */
#include <linux/skbuff.h>
#include <linux/mii.h> /* MII definitions */
+#include <linux/crc32.h>
#include <asm/ip32/mace.h>
#include <asm/ip32/ip32_ints.h>
@@ -58,12 +59,19 @@ static int timeout = TX_TIMEOUT;
module_param(timeout, int, 0);
/*
+ * Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
+ * MACE Ethernet uses a 64 element hash table based on the Ethernet CRC.
+ */
+#define METH_MCF_LIMIT 32
+
+/*
* This structure is private to each device. It is used to pass
* packets in and out, so there is place for a packet
*/
struct meth_private {
/* in-memory copy of MAC Control register */
- unsigned long mac_ctrl;
+ u64 mac_ctrl;
+
/* in-memory copy of DMA Control register */
unsigned long dma_ctrl;
/* address of PHY, used by mdio_* functions, initialized in mdio_probe */
@@ -79,6 +87,9 @@ struct meth_private {
struct sk_buff *rx_skbs[RX_RING_ENTRIES];
unsigned long rx_write;
+ /* Multicast filter. */
+ u64 mcast_filter;
+
spinlock_t meth_lock;
};
@@ -765,6 +776,40 @@ static int meth_ioctl(struct net_device
}
}
+static void meth_set_rx_mode(struct net_device *dev)
+{
+ struct meth_private *priv = netdev_priv(dev);
+ unsigned long flags;
+
+ netif_stop_queue(dev);
+ spin_lock_irqsave(&priv->meth_lock, flags);
+ priv->mac_ctrl &= ~METH_PROMISC;
+
+ if (dev->flags & IFF_PROMISC) {
+ priv->mac_ctrl |= METH_PROMISC;
+ priv->mcast_filter = 0xffffffffffffffffUL;
+ } else if ((netdev_mc_count(dev) > METH_MCF_LIMIT) ||
+ (dev->flags & IFF_ALLMULTI)) {
+ priv->mac_ctrl |= METH_ACCEPT_AMCAST;
+ priv->mcast_filter = 0xffffffffffffffffUL;
+ } else {
+ struct netdev_hw_addr *ha;
+ priv->mac_ctrl |= METH_ACCEPT_MCAST;
+
+ netdev_for_each_mc_addr(ha, dev)
+ set_bit((ether_crc(ETH_ALEN, ha->addr) >> 26),
+ (volatile unsigned long *)&priv->mcast_filter);
+ }
+
+ /* Write the changes to the chip registers. */
+ mace->eth.mac_ctrl = priv->mac_ctrl;
+ mace->eth.mcast_filter = priv->mcast_filter;
+
+ /* Done! */
+ spin_unlock_irqrestore(&priv->meth_lock, flags);
+ netif_wake_queue(dev);
+}
+
static const struct net_device_ops meth_netdev_ops = {
.ndo_open = meth_open,
.ndo_stop = meth_release,
@@ -774,6 +819,7 @@ static const struct net_device_ops meth_
.ndo_change_mtu = eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
+ .ndo_set_rx_mode = meth_set_rx_mode,
};
/*
^ permalink raw reply
* Re: [PATCH] net: meth: Add set_rx_mode hook to fix ICMPv6 neighbor discovery
From: Joshua Kinard @ 2011-12-27 4:54 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-mips
In-Reply-To: <20111226.151713.2002746283994460284.davem@davemloft.net>
On 12/26/2011 15:17, David Miller wrote:
> From: Joshua Kinard <kumba@gentoo.org>
> Date: Sat, 24 Dec 2011 20:45:32 -0500
>
>> SGI IP32 (O2)'s ethernet driver (meth) lacks meth_set_rx_mode, which
>> prevents IPv6 from working completely because any ICMPv6 neighbor
>> solicitation requests aren't picked up by the driver. So the machine can
>> ping out and connect to other systems, but other systems will have a very
>> hard time connecting to the O2.
>>
>> Signed-off-by: Joshua Kinard <kumba@gentoo.org>
>
> Lots of completely unrelated changes here, the IRQ name string has
> nothing to do with specifically fixing the ICMPv6 neighbour discovery
> bug.
>
> Do not mix changes like this, one change per patch please, thanks.
Noted. I dropped the name change patch and minimized the changes to the
mace registers to just the two registers needed for this specific case.
I'll send two separate patches for the remaining registers and the name bit
to just linux-mips later on. Patch to follow.
Thanks,
--
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
4096R/D25D95E3 2011-03-28
"The past tempts us, the present confuses us, the future frightens us. And
our lives slip away, moment by moment, lost in that vast, terrible in-between."
--Emperor Turhan, Centauri Republic
^ permalink raw reply
* Fwd: [PATCH] packet: fix dev refcnt leak when bind fail
From: Wei Yongjun @ 2011-12-27 4:28 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <CAPgLHd8ZX6eh+SOoE7CXJXTAsq3F8biQYSKcN-owfj_jBsZ_tg@mail.gmail.com>
cc netdev@vger.kernel.org
> From: Wei Yongjun <weiyj.lk@gmail.com>
> Date: Mon, 26 Dec 2011 17:02:59 +0800
>
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> If bind is fail such as bind is called after set PACKET_FANOUT
>> sock option, the dev refcnt will leak.
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> The device pointer is stored in ->prot_hook.dev
>
> Therefore, it will be released at the latest in packet_release() or
> earlier if another bind() attempt is done on the socket.
>
> There is no leak here as far as I can see.
Hi David,
In packet_do_bind(), if po->fanout is set, the device pointer may not be
stored in ->prot_hook.dev, see the following code:
static int packet_do_bind(struct sock *sk, struct net_device *dev, ...)
{
struct packet_sock *po = pkt_sk(sk);
if (po->fanout)
return -EINVAL;
...
po->prot_hook.dev = dev;
...
}
The leak is exists only if po->fanout is set.
^ permalink raw reply
* ipip6_tunnel_xmit
From: Rahul Kumar @ 2011-12-27 3:48 UTC (permalink / raw)
To: netdev
Hi,
I'm trying to understand the sit driver code net/ipv6/sit.c
(2.6.35.12). I'm trying to forward incoming packet from another
interface (eth0) to ISATAP tunnel interface (is0) by calling
dev_queue_xmit (dev) with dev set to is0. Eventually ipip6_tunnel_xmit
routine is getting called, skb_dst()->neighbor is returning null. (I
think this is returning null since the dest ip(v6) is incorrectly
set). I would like to know what should be the header fields that needs
to be set when passing down to tunnel, in order to forward it to
isatap router. Please let me know
^ permalink raw reply
* tc filter fw match and masks
From: John A. Sullivan III @ 2011-12-27 2:52 UTC (permalink / raw)
To: netdev
Hello, all. While working on my test WAN project, I was quite surprised
to see only half my packets matching my filter. I as using netfilter
marks which overlapped, e.g., inbound from Internet were
0011 0000
and interactive traffic was
0001 0001
I needed to switch to a u32 match as it appears the fw match does not
accept masks. Is there any plan to change this? Thanks - John
^ permalink raw reply
* Re: [PATCH V2] bonding: document undocumented active_slave sysfs entry.
From: David Miller @ 2011-12-27 1:09 UTC (permalink / raw)
To: nicolas.2p.debian; +Cc: netdev, fubar, andy
In-Reply-To: <1324942524-32116-1-git-send-email-nicolas.2p.debian@free.fr>
From: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Date: Tue, 27 Dec 2011 00:35:24 +0100
> v2, based on Jay's review.
>
> I kept the 'link must be up' part, because this is enforced in the code.
>
> Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
> cc: Andy Gospodarek <andy@greyhouse.net>
Applied, thanks.
^ permalink raw reply
* [PATCH V2] bonding: document undocumented active_slave sysfs entry.
From: Nicolas de Pesloüan @ 2011-12-26 23:35 UTC (permalink / raw)
To: netdev; +Cc: Nicolas de Pesloüan, Jay Vosburgh, Andy Gospodarek
In-Reply-To: <1324901955-5816-1-git-send-email-nicolas.2p.debian@free.fr>
v2, based on Jay's review.
I kept the 'link must be up' part, because this is enforced in the code.
Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
cc: Andy Gospodarek <andy@greyhouse.net>
---
Documentation/networking/bonding.txt | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 91df678..067e715 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -196,6 +196,23 @@ or, for backwards compatibility, the option value. E.g.,
The parameters are as follows:
+active_slave
+
+ Specifies the new active slave for modes that support it
+ (active-backup, balance-alb and balance-tlb). Possible values
+ are the name of any currently enslaved interface, or an empty
+ string. If a name is given, the slave and its link must be up in order
+ to be selected as the new active slave. If an empty string is
+ specified, the current active slave is cleared, and a new active
+ slave is selected automatically.
+
+ Note that this is only available through the sysfs interface. No module
+ parameter by this name exists.
+
+ The normal value of this option is the name of the currently
+ active slave, or the empty string if there is no active slave or
+ the current mode does not use an active slave.
+
ad_select
Specifies the 802.3ad aggregation selection logic to use. The
--
1.7.7.3
^ permalink raw reply related
* أنا السيدة ايلي الصريح، انا بحاجة الى مساعدتكم لأنه في حالتي المرضية يرجى البريد الالكتروني لي لمزيد من التفاصيل :
From: Avasthi, Sulekha (NIH/NCI) [C] @ 2011-12-26 23:10 UTC (permalink / raw)
أنا السيدة ايلي الصريح، انا بحاجة الى مساعدتكم لأنه في حالتي المرضية يرجى البريد الالكتروني لي لمزيد من التفاصيل : elifrank9@hotmail.com<mailto:elifrank9@hotmail.com>
^ permalink raw reply
* SEASONAL LOAN OFFER!!!
From: Finacial Loan Company LTD @ 2011-12-26 22:58 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 41 bytes --]
Kindly open the attach file for details
[-- Attachment #2: NOTIFICATION.txt --]
[-- Type: text/plain, Size: 2420 bytes --]
MR NANDA KUMAR FINANCIAL HOME
No16 Green Park Way, India.
Ref: TK-AFD/721OY8/11/Dh-India
SSL: PT/45/0018
GOVERNMENT ACCREDITED LICENSED!!
MR NANDA KUMAR IS REGISTERED
UNDER THE DATA PROTECTION ACT OF: MOF
Registration (PQX01Q04T4In).
Mobile:+91-7838-116971
Tel:+9111-3207-5073
Attn: Customer,
You are welcome to Choudhary Raj Kumar Financial Lending Company Service: We
offer loan to honest and God fearing people. Well we do offer all kind
of loan, for that reason we are ready to offer you the loan funds you
need from this company so that you can be able to carry out any type
of business you wish to do etc, we shall give, we will offer you loan
as you requested, be rest informed that we only attend to serious
minded individuals, if you are applying for this loan we will given
you the best in this transaction as well.
So it all depend on you. We will want you to fill out the borrower's
information below and return back to us as soon as possible so that we
can proceed with this transaction, Well we must let you know that this
company will highly appreciate your urgent response in this
transaction, and we shall all be in service with you to make sure you
receive this loan fast and with good faith, with grace all things are
possible so we shall invest trust and honest in this transaction.
Qualifications On This Transaction:
NOTE: 1) The Borrower must be trusted with good faith and unlimited
grace. 2) Even with Bad credit, we still guarantee the Borrower the
Loan with unlimited grace in this company. 3) The Loan Can Be granted
even with low credit. 4) Fixed Rate of the Loan interest is 3%. as
well.
FILL THE LOAN APPLICATION FORM
Your Full Name:
Your Country:
Your State:
Address:
Your Age:
Your Fax Number:
Occupation:
Marital status:
Current Status at place of work:
Sex:
Your Personal Phone Number:
Your Monthly Income:
Your Weekly Income:
Loan Funds Amount Needed:
Purpose of Loan:
Loan Duration:
How Urgent do you need the loan:
In acknowledgment to these details, We will send you a well calculated
Terms and Condition which will include the agreements of this
transaction, we will want you to fill the borrower's information above
and return back to us as soon as possible so that we can proceed
further in this transaction.
Management
Mr Nanda kumar
Financial Express Lending Company Service..
^ permalink raw reply
* Re: Cross posting
From: Jean-baptiste Théou @ 2011-12-26 22:49 UTC (permalink / raw)
To: John A. Sullivan III, netdev-owner, lartc, netdev
Just comment :)
------Message d'origine------
De: John A. Sullivan III
Expéditeur : netdev-owner@vger.kernel.org
À: lartc@vger.kernel.org
À: netdev@vger.kernel.org
Objet: Cross posting
Envoyé: 26 déc. 2011 23:26
Hello, all. I still find myself posting most of my questions to
netdev@vger.kernel.org since I'm not quite sure who has found there way
to lartc yet.
I know it is normally considered rude to cross post but would it be a
good idea to cross post until lartc builds up a support community of its
own and to help build its archives? Thoughts? Comments? Insults? Thanks
- John
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jean-Baptiste Théou
Société Latexpress, services pour l'édition.
www.latexpress.fr
^ permalink raw reply
* Re: [PATCH] bonding: document undocumented active_slave sysfs entry.
From: Nicolas de Pesloüan @ 2011-12-26 22:51 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: Nicolas de Pesloüan, netdev, Andy Gospodarek
In-Reply-To: <20213.1324933811@death>
Le 26/12/2011 22:10, Jay Vosburgh a écrit :
> Nicolas de Pesloüan <nicolas.2p.debian@free.fr> wrote:
>
>> Signed-off-by: Nicolas de Pesloüan<nicolas.2p.debian@free.fr>
>> cc: Jay Vosburgh<fubar@us.ibm.com>
>> cc: Andy Gospodarek<andy@greyhouse.net>
>>
>> ---
>> Documentation/networking/bonding.txt | 14 ++++++++++++++
>> 1 files changed, 14 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
>> index 91df678..83b44c2 100644
>> --- a/Documentation/networking/bonding.txt
>> +++ b/Documentation/networking/bonding.txt
>> @@ -196,6 +196,20 @@ or, for backwards compatibility, the option value. E.g.,
>>
>> The parameters are as follows:
>>
>> +active_slave
>> +
>> + Specifies the active slave for modes that support it (active-backup,
>> + balance-alb and balance-tlb). The possible values are one of the
>> + currently enslaved slaves. The selected slave must be up and the
>> + underlying link must be up too.
>
> I would phrase this a bit differently, also including the empty
> string as a possible value:
>
> Specifies the new active slave for modes that support it
> (active-backup, balance-alb and balance-tlb). Possible values
> are the name of any currently enslaved interface, or an empty
> string. If a name is given, the slave must be up in order to be
> selected as the new active slave. If an empty string is
> specified, the current active slave is cleared, and a new active
> slave is selected automatically.
>
>> + Note that this is only available through the sysfs interface. No module
>> + parameter by that name exists.
>
> "by this name" instead of "that".
>
>> + The default value is empty (no active slave). It will automatically be
>> + set every time an active slave is selected by normal bonding operation.
>> + The current active slave can be read from this sysfs entry.
>
> I'd write this as:
>
> The normal value of this option is the name of the currently
> active slave, or the empty string if there is no active slave or
> the current mode does not use an active slave.
>
> With the above changes (or something pretty much equivalent) I'm
> good with this, and you can add a signed-off for me.
Thanks for the review. I will send V2 later.
Nicolas.
^ permalink raw reply
* Re: [PATCH] libcxgbi: do not print a message when memory allocation fails
From: Mike Christie @ 2011-12-26 22:27 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo
Cc: linux-scsi, netdev, kxie, davem, JBottomley, linux-kernel
In-Reply-To: <1323877583-6844-1-git-send-email-cascardo@linux.vnet.ibm.com>
On 12/14/2011 09:46 AM, Thadeu Lima de Souza Cascardo wrote:
> In alloc_pdu, libcxgbi tries to allocate a skb with GFP_ATOMIC, which
> may potentially fail. When it happens, the current code prints a warning
> message.
>
> When the system is under IO stress, this failure may happen lots of
> times and it usually scares users.
>
> Instead of printing the warning message, the code now increases the
> tx_dropped statistics for the ethernet interface wich is doing the iscsi
> task.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
> ---
> drivers/scsi/cxgbi/libcxgbi.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
> index c10f74a..3422bc2 100644
> --- a/drivers/scsi/cxgbi/libcxgbi.c
> +++ b/drivers/scsi/cxgbi/libcxgbi.c
> @@ -1862,8 +1862,9 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 opcode)
>
> tdata->skb = alloc_skb(cdev->skb_tx_rsvd + headroom, GFP_ATOMIC);
> if (!tdata->skb) {
> - pr_warn("alloc skb %u+%u, opcode 0x%x failed.\n",
> - cdev->skb_tx_rsvd, headroom, opcode);
> + struct cxgbi_sock *csk = cconn->cep->csk;
> + struct net_device *ndev = cdev->ports[csk->port_id];
> + ndev->stats.tx_dropped++;
> return -ENOMEM;
> }
>
Looks ok to me.
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
^ permalink raw reply
* Cross posting
From: John A. Sullivan III @ 2011-12-26 22:26 UTC (permalink / raw)
To: lartc, netdev
Hello, all. I still find myself posting most of my questions to
netdev@vger.kernel.org since I'm not quite sure who has found there way
to lartc yet.
I know it is normally considered rude to cross post but would it be a
good idea to cross post until lartc builds up a support community of its
own and to help build its archives? Thoughts? Comments? Insults? Thanks
- John
^ permalink raw reply
* Redirection to multiple IFBs from different qdiscs on the same interface produces a loop
From: John A. Sullivan III @ 2011-12-26 22:22 UTC (permalink / raw)
To: netdev
Hello, all. I've been able to successfully create our WAN test
environment using netem on egress and ingress along with HFSC and have
eliminated the terrible bufferbloat effect. Since I can't do both HFSC
shaping and netem conditioning on the ingress, I got around it by
marking the packet coming in from the Internet, and then redirecting it
to a netem conditioned IFB interface on the egress if it has the
"Internet ingress" mark. It works perfectly fine for traffic traversing
the forward chain.
However, I hit a problem when trying to produce the same effect for
traffic directed to the test router. In this case, the packets must
pass twice through netem conditioning. Thus, I set up a "placeholder"
PRIO qdisc to hold the HFSC qdisc so I could put one redirection filter
on the first and a second on the second.
When I do so, I seem to create a loop. My pings stop and, when I remove
the filter, they resume without a single packet lost but huge round trip
times. I tried sending the packets to separate IFB interfaces rather
than passing twice through the same one and I tried creating a PRIO
qdisc to hold the PRIO qdisc to insert an extra processing step between
the redirections in case that was the problem. Nothing help - I always
create a loop.
How can I do this successfully?
Here is the rule set:
#egress traffic shaping
tc qdisc add dev eth1 root handle 2: prio bands 2 priomap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
tc qdisc add dev eth1 parent 2:1 handle 1: hfsc default 20
tc class add dev eth1 parent 1: classid 1:1 hfsc sc rate 1490kbit ul rate 1490kbit #mimic T1 on LAN outbound
tc class add dev eth1 parent 1:1 classid 1:20 hfsc rt rate 400kbit ls rate 200kbit
tc qdisc add dev eth1 parent 1:20 handle 1201 sfq perturb 60
tc class add dev eth1 parent 1:1 classid 1:10 hfsc rt umax 16kbit dmax 50ms rate 200kbit ls rate 1000kbit
tc qdisc add dev eth1 parent 1:10 handle 1101 sfq perturb 60
tc class add dev eth1 parent 1:1 classid 1:30 hfsc rt umax 1514b dmax 20ms rate 20kbit
tc qdisc add dev eth1 parent 1:30 handle 1301 sfq perturb 60
iptables -t mangle -A PREROUTING -p 6 --tcp-flags SYN,RST,FIN SYN --dport 443 -j CONNMARK --set-mark 0x12/0 #test settings
iptables -t mangle -A PREROUTING -p 6 --tcp-flags SYN,RST,FIN SYN --dport 822 -j CONNMARK --set-mark 0x11/0 #Interactive
iptables -t mangle -A PREROUTING -i eth1 -j CONNMARK --set-mark 0x30/0
iptables -t mangle -A POSTROUTING -o eth1 -j CONNMARK --restore-mark
iptables -t mangle -A PREROUTING -i eth1 -j CONNMARK --restore-mark
modprobe ifb #numifbs=3
ifconfig ifb0 up
ifconfig ifb1 up
#ingress traffic shaping
tc qdisc add dev ifb0 root handle 1: hfsc default 20
tc class add dev ifb0 parent 1: classid 1:1 hfsc sc rate 1490kbit ul rate 1490kbit - mimic T1 on LAN inbound
tc class add dev ifb0 parent 1:1 classid 1:20 hfsc rt rate 400kbit ls rate 200kbit
tc qdisc add dev ifb0 parent 1:20 handle 1201 sfq perturb 60
tc class add dev ifb0 parent 1:1 classid 1:10 hfsc rt umax 16kbit dmax 50ms rate 200kbit ls rate 1000kbit
tc qdisc add dev ifb0 parent 1:10 handle 1101 sfq perturb 60
tc class add dev ifb0 parent 1:1 classid 1:30 hfsc rt umax 1514b dmax 20ms rate 20kbit
tc qdisc add dev ifb0 parent 1:30 handle 1301 sfq perturb 60
tc filter add dev ifb0 parent 1:0 protocol ip prio 1 handle 6: u32 divisor 1
tc filter add dev ifb0 parent 1:0 protocol ip prio 1 u32 match ip protocol 6 0xff link 6: offset at 0 mask 0x0f00 shift 6 plus 0 eat
tc filter add dev ifb0 parent 1:0 protocol ip prio 1 u32 ht 6:0 match tcp src 443 0x00ff flowid 1:10
tc filter add dev ifb0 parent 1:0 protocol ip prio 1 u32 ht 6:0 match tcp dst 822 0xff00 flowid 1:30
#handle all netem conditioning in one definition
tc qdisc add dev ifb1 root handle 2 netem delay 25ms 5ms distribution normal loss 0.1% 30%
# ingress traffic shaping
tc qdisc add dev eth1 ingress
tc filter add dev eth1 parent ffff: protocol ip prio 50 u32 match u32 0 0 action mirred egress redirect dev ifb0
tc filter add dev eth1 parent 1:1 protocol ip prio 1 handle 0x11 fw flowid 1:30
tc filter add dev eth1 parent 1:1 protocol ip prio 1 handle 0x12 fw flowid 1:10
tc filter add dev eth1 parent 1:1 protocol ip prio 2 u32 match u32 0 0 flowid 1:20
#egress netem conditioning
tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb1
tc qdisc add dev eth0 root handle 10: prio
tc qdisc add dev eth0 parent 10:1 handle 110: sfq perturb 60
tc qdisc add dev eth0 parent 10:2 handle 120: sfq perturb 60
tc qdisc add dev eth0 parent 10:3 handle 130: sfq perturb 60
#ingress netem conditioning
tc filter add dev eth0 parent 10: protocol ip prio 1 handle 0x30/0x30 fw action mirred egress redirect dev ifb1
# THE NEXT ONE IS THE PROBLEM - this one acts on 2:0 as opposed to the eth1 redirect filter above which acts on 1:0
tc filter add dev eth1 parent 2:0 protocol ip prio 1 handle 0x30/0x30 fw action mirred egress redirect dev ifb1
#buffer management
ip link set eth1 txqueuelen 100
ip link set ifb1 txqueuelen 100
ip link set ifb0 txqueuelen 100
ethtool -K eth1 gso off gro off
Oh, as an aside, I first tried to do the "ingress marking" as an action
in the eth1 ingress filter but it seemed to be eliminated by the
--restore-mark in iptables. Am I correct to assume that is the expected
behavior and CONNMARK and marking in tc are somewhat incompatible?
Thanks - John
^ permalink raw reply
* Re: [PATCH] bonding: document undocumented active_slave sysfs entry.
From: Jay Vosburgh @ 2011-12-26 21:10 UTC (permalink / raw)
To: Nicolas de Pesloüan; +Cc: netdev, Andy Gospodarek
In-Reply-To: <1324901955-5816-1-git-send-email-nicolas.2p.debian@free.fr>
Nicolas de Pesloüan <nicolas.2p.debian@free.fr> wrote:
>Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
>cc: Jay Vosburgh <fubar@us.ibm.com>
>cc: Andy Gospodarek <andy@greyhouse.net>
>
>---
> Documentation/networking/bonding.txt | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
>diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
>index 91df678..83b44c2 100644
>--- a/Documentation/networking/bonding.txt
>+++ b/Documentation/networking/bonding.txt
>@@ -196,6 +196,20 @@ or, for backwards compatibility, the option value. E.g.,
>
> The parameters are as follows:
>
>+active_slave
>+
>+ Specifies the active slave for modes that support it (active-backup,
>+ balance-alb and balance-tlb). The possible values are one of the
>+ currently enslaved slaves. The selected slave must be up and the
>+ underlying link must be up too.
I would phrase this a bit differently, also including the empty
string as a possible value:
Specifies the new active slave for modes that support it
(active-backup, balance-alb and balance-tlb). Possible values
are the name of any currently enslaved interface, or an empty
string. If a name is given, the slave must be up in order to be
selected as the new active slave. If an empty string is
specified, the current active slave is cleared, and a new active
slave is selected automatically.
>+ Note that this is only available through the sysfs interface. No module
>+ parameter by that name exists.
"by this name" instead of "that".
>+ The default value is empty (no active slave). It will automatically be
>+ set every time an active slave is selected by normal bonding operation.
>+ The current active slave can be read from this sysfs entry.
I'd write this as:
The normal value of this option is the name of the currently
active slave, or the empty string if there is no active slave or
the current mode does not use an active slave.
With the above changes (or something pretty much equivalent) I'm
good with this, and you can add a signed-off for me.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
^ permalink raw reply
* [PATCH] ipv6: Kill useless route tracing bits in net/ipv6/route.c
From: David Miller @ 2011-12-26 20:25 UTC (permalink / raw)
To: netdev
RDBG() wasn't even used, and the messages printed by RT6_DEBUG() were
far from useful. Just get rid of all this stuff, we can replace it
with something more suitable if we want.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
There's some similar garbage in ip6_fib.c, but one thing at a time...
net/ipv6/route.c | 22 ++--------------------
1 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 5855e9e..35b07cc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -62,17 +62,6 @@
#include <linux/sysctl.h>
#endif
-/* Set to 3 to get tracing. */
-#define RT6_DEBUG 2
-
-#if RT6_DEBUG >= 3
-#define RDBG(x) printk x
-#define RT6_TRACE(x...) printk(KERN_DEBUG x)
-#else
-#define RDBG(x)
-#define RT6_TRACE(x...) do { ; } while (0)
-#endif
-
static struct rt6_info *ip6_rt_copy(const struct rt6_info *ort,
const struct in6_addr *dest);
static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie);
@@ -518,9 +507,6 @@ static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
struct rt6_info *match, *rt0;
struct net *net;
- RT6_TRACE("%s(fn->leaf=%p, oif=%d)\n",
- __func__, fn->leaf, oif);
-
rt0 = fn->rr_ptr;
if (!rt0)
fn->rr_ptr = rt0 = fn->leaf;
@@ -539,9 +525,6 @@ static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
fn->rr_ptr = next;
}
- RT6_TRACE("%s() => %p\n",
- __func__, match);
-
net = dev_net(rt0->rt6i_dev);
return match ? match : net->ipv6.ip6_null_entry;
}
@@ -2173,10 +2156,9 @@ static int fib6_ifdown(struct rt6_info *rt, void *arg)
const struct net_device *dev = adn->dev;
if ((rt->rt6i_dev == dev || !dev) &&
- rt != adn->net->ipv6.ip6_null_entry) {
- RT6_TRACE("deleted by ifdown %p\n", rt);
+ rt != adn->net->ipv6.ip6_null_entry)
return -1;
- }
+
return 0;
}
--
1.7.7.4
^ permalink raw reply related
* Re: [PATCH] bonding: document undocumented active_slave sysfs entry.
From: David Miller @ 2011-12-26 20:20 UTC (permalink / raw)
To: nicolas.2p.debian; +Cc: netdev, fubar, andy
In-Reply-To: <1324901955-5816-1-git-send-email-nicolas.2p.debian@free.fr>
From: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Date: Mon, 26 Dec 2011 13:19:15 +0100
> Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
> cc: Jay Vosburgh <fubar@us.ibm.com>
> cc: Andy Gospodarek <andy@greyhouse.net>
Jay/Andy, please review.
^ permalink raw reply
* Re: [PATCH] mlx4: Add missing include of linux/slab.h
From: David Miller @ 2011-12-26 20:19 UTC (permalink / raw)
To: axel.lin; +Cc: linux-kernel, yevgenyp, jackm, marcela, eugenia, netdev
In-Reply-To: <1324892134.9765.1.camel@phoenix>
From: Axel Lin <axel.lin@gmail.com>
Date: Mon, 26 Dec 2011 17:35:34 +0800
> Include linux/slab.h to fix below build error:
You make no indication whatsoever what source tree you see this
error in.
By trial and error I figured out that your patch only applies to
the net-next tree, so I added it there.
But I should not have to go through such a sequence just to figure out
what tree your patch is for, so please indicate this properly in the
future.
^ 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