* [PATCH 47/49] net/rds: Use vzalloc
From: Joe Perches @ 2010-11-05 3:08 UTC (permalink / raw)
To: Jiri Kosina; +Cc: Andy Grover, David S. Miller, rds-devel, netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
net/rds/ib_cm.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index ee369d2..cc6b073 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -374,23 +374,21 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
goto out;
}
- ic->i_sends = vmalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
+ ic->i_sends = vzalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
ibdev_to_node(dev));
if (!ic->i_sends) {
ret = -ENOMEM;
rdsdebug("send allocation failed\n");
goto out;
}
- memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
- ic->i_recvs = vmalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
+ ic->i_recvs = vzalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
ibdev_to_node(dev));
if (!ic->i_recvs) {
ret = -ENOMEM;
rdsdebug("recv allocation failed\n");
goto out;
}
- memset(ic->i_recvs, 0, ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
rds_ib_recv_init_ack(ic);
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 29/49] drivers/net/qlcnic: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Amit Kumar Salecha, Anirban Chakraborty, linux-driver, netdev,
linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/qlcnic/qlcnic_init.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 0d180c6..c5ea2f4 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -236,12 +236,11 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
tx_ring->num_desc = adapter->num_txd;
tx_ring->txq = netdev_get_tx_queue(netdev, 0);
- cmd_buf_arr = vmalloc(TX_BUFF_RINGSIZE(tx_ring));
+ cmd_buf_arr = vzalloc(TX_BUFF_RINGSIZE(tx_ring));
if (cmd_buf_arr == NULL) {
dev_err(&netdev->dev, "failed to allocate cmd buffer ring\n");
goto err_out;
}
- memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring));
tx_ring->cmd_buf_arr = cmd_buf_arr;
recv_ctx = &adapter->recv_ctx;
@@ -275,14 +274,12 @@ int qlcnic_alloc_sw_resources(struct qlcnic_adapter *adapter)
rds_ring->dma_size + NET_IP_ALIGN;
break;
}
- rds_ring->rx_buf_arr = (struct qlcnic_rx_buffer *)
- vmalloc(RCV_BUFF_RINGSIZE(rds_ring));
+ rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
if (rds_ring->rx_buf_arr == NULL) {
dev_err(&netdev->dev, "Failed to allocate "
"rx buffer ring %d\n", ring);
goto err_out;
}
- memset(rds_ring->rx_buf_arr, 0, RCV_BUFF_RINGSIZE(rds_ring));
INIT_LIST_HEAD(&rds_ring->free_list);
/*
* Now go through all of them, set reference handles
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* [PATCH 30/49] drivers/net/sfc: Use vzalloc
From: Joe Perches @ 2010-11-05 3:07 UTC (permalink / raw)
To: Jiri Kosina
Cc: Solarflare linux maintainers, Steve Hodgson, Ben Hutchings,
netdev, linux-kernel
In-Reply-To: <cover.1288925424.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/sfc/filter.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/sfc/filter.c b/drivers/net/sfc/filter.c
index 52cb608..44500b5 100644
--- a/drivers/net/sfc/filter.c
+++ b/drivers/net/sfc/filter.c
@@ -428,10 +428,9 @@ int efx_probe_filters(struct efx_nic *efx)
GFP_KERNEL);
if (!table->used_bitmap)
goto fail;
- table->spec = vmalloc(table->size * sizeof(*table->spec));
+ table->spec = vzalloc(table->size * sizeof(*table->spec));
if (!table->spec)
goto fail;
- memset(table->spec, 0, table->size * sizeof(*table->spec));
}
return 0;
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* RE: [PATCH 27/49] drivers/net/netxen: Use vzalloc
From: Amit Salecha @ 2010-11-05 5:18 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <61bf7e82bb35693aebdb3a56b30b1c38836bf502.1288925425.git.joe@perches.com>
> From: Joe Perches [joe@perches.com]
> Sent: Friday, November 05, 2010 8:37 AM
> To: Jiri Kosina
> Cc: Amit Salecha; netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 27/49] drivers/net/netxen: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/netxen/netxen_nic_init.c | 7 ++-----
> files changed, 2 insertions(+), 5 deletions(-)
Thanks.
^ permalink raw reply
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
From: Eric Dumazet @ 2010-11-05 6:30 UTC (permalink / raw)
To: Joe Perches, Jesper Juhl
Cc: Jiri Kosina, Patrick McHardy, David S. Miller, netfilter-devel,
netfilter, coreteam, netdev, linux-kernel
In-Reply-To: <7d6da34b7e84955795717b0241000a0701cd5b34.1288925425.git.joe@perches.com>
Le jeudi 04 novembre 2010 à 20:08 -0700, Joe Perches a écrit :
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> net/netfilter/x_tables.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
So many 'vzalloc' patches for net tree...
I had _one_ patch, waiting that David actually had vzalloc() in its tree
before sending it.
Given Jesper Juhl was doing this work, could you please take another
one, please ?
For example, explaining him how to use other tools than "bash+egrep
+manual inspection" as he mentioned in a previous mail.
Really Joe, your behavior should be smarter than that.
Thanks
^ permalink raw reply
* Re: [PATCH] ipv6: addrconf: clear IPv6 addresses and routes when losing link
From: Lorenzo Colitti @ 2010-11-05 6:40 UTC (permalink / raw)
To: Dan Williams; +Cc: Stephen Hemminger, netdev
In-Reply-To: <1288666459.4003.47.camel@dcbw.foobar.com>
On Tue, Nov 2, 2010 at 10:54 AM, Dan Williams <dcbw@redhat.com> wrote:
> For this sort of thing, I tend to think that only higher-level network
> management daemons like NM have the *possibility* to get this sort of
> thing right, because only they have overall knowledge of the networking
> situation, like whether you've actually connected to a different network
> or not. Specifically in the case of wifi, only the connection manager
> (or wpa_supplicant) knows whether you're on a different network or not,
> anything else is a layering violation.
Maybe you're right and everything should be done in userspace. But for
now, the kernel is still processing RAs itself and adding IPv6
addresses to interfaces itself. If we don't intend to rip that all out
and replace it with a userspace implementation, then we should fix the
kernel to be a little smarter and not keep addresses around when they
are not useful any more.
This can be done relatively in a hitless fashion by putting old
addresses into the deprecated state until they are refreshed by an RA,
etc.
I don't think it's reasonable to say that we need a network management
daemon because we need to delete addresses that the kernel created and
the kernel can't be bothered to clean up after itself.
Cheers,
Lorenzo
^ permalink raw reply
* Re: [PATCH] ipv6: addrconf: don't remove address state on ifdown if the address is being kept
From: Lorenzo Colitti @ 2010-11-05 6:45 UTC (permalink / raw)
To: David Miller; +Cc: Maciej Żenczykowski, Brian Haley, netdev
In-Reply-To: <AANLkTimLicmgC3BptZvXGoA0aN6-cFJtRG3DpqJ3NTpJ@mail.gmail.com>
On Thu, Oct 28, 2010 at 2:45 PM, Lorenzo Colitti <lorenzo@google.com> wrote:
>> Fix it so that none of this state is updated if the address is being kept on the interface.
David, any feedback on this? The existing code clearly has the
intention of keeping the addresses around, except they don't actually
work, and this just fixes the bug.
Thanks,
Lorenzo
^ permalink raw reply
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
From: Joe Perches @ 2010-11-05 6:55 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jesper Juhl, Jiri Kosina, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
In-Reply-To: <1288938640.3234.12.camel@edumazet-laptop>
On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> I had _one_ patch, waiting that David actually had vzalloc() in its tree
> before sending it.
Fine by me, use yours.
> Given Jesper Juhl was doing this work, could you please take another
> one, please ?
> For example, explaining him how to use other tools than "bash+egrep
> +manual inspection" as he mentioned in a previous mail.
Jesper Juhl was both pointed at the cocci docs and
given a cocci script. He said he'd investigate it
when he could. I trust he will get to it.
I think that for this sort of patchset, grep and
manual inspection works just as well as spatch
and likely better because a simple cocci script
doesn't transform code like:
if (size > PAGE_SIZE)
ptr = vmalloc(size);
else
ptr = kmalloc(size, GFP);
if (ptr)
memset(ptr, 0, size);
I did say in the 00 cover that this was broken up
just to cc the maintainers of each block.
I also think a single rolled-up single patch is good.
I believe Jiri Kosina can easily apply all these
individual patches as a single patch if he chooses.
^ permalink raw reply
* Re: [PATCH 46/49] net/netfilter: Use vzalloc
From: Eric Dumazet @ 2010-11-05 7:16 UTC (permalink / raw)
To: Joe Perches
Cc: Jesper Juhl, Jiri Kosina, Patrick McHardy, David S. Miller,
netfilter-devel, netfilter, coreteam, netdev, linux-kernel
In-Reply-To: <1288940146.18440.55.camel@Joe-Laptop>
Le jeudi 04 novembre 2010 à 23:55 -0700, Joe Perches a écrit :
> On Fri, 2010-11-05 at 07:30 +0100, Eric Dumazet wrote:
> > I had _one_ patch, waiting that David actually had vzalloc() in its tree
> > before sending it.
>
> Fine by me, use yours.
I dont care at all, only to say that David tree was not ready yet.
>
> > Given Jesper Juhl was doing this work, could you please take another
> > one, please ?
> > For example, explaining him how to use other tools than "bash+egrep
> > +manual inspection" as he mentioned in a previous mail.
>
> Jesper Juhl was both pointed at the cocci docs and
> given a cocci script. He said he'd investigate it
> when he could. I trust he will get to it.
>
Yes, yet you posted patches, knowing he was working on the _same_
subject.
I remember other occurrences of such behavior.
I find this behavior very unfriendly, time consuming, and not useful.
We try to work together, to increase our common knowledge, not to throw
a bunch of patches "just because I know better than you"
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [V2 PATCH] virtio-net: init link state correctly
From: Michael S. Tsirkin @ 2010-11-05 8:47 UTC (permalink / raw)
To: Jason Wang; +Cc: rusty, davem, markmc, linux-kernel, kvm, netdev
In-Reply-To: <19667.29541.897732.941476@gargle.gargle.HOWL>
On Fri, Nov 05, 2010 at 11:00:53AM +0800, Jason Wang wrote:
> Jason Wang writes:
>
> CC netdev missed in the original patch.
You'll have to repost it properly. Patches with a >
at start can't be applied :)
You can add my ack when you do.
> > For device that supports VIRTIO_NET_F_STATUS, there's no need to
> > assume the link is up and we need to call nerif_carrier_off() before
> > querying device status, otherwise we may get wrong operstate after
> > diver was loaded because the link watch event was not fired as
> > expected.
> >
> > For device that does not support VIRITO_NET_F_STATUS, we could not get
> > its status through virtnet_update_status() and what we can only do is
> > always assuming the link is up.
> >
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > ---
> > drivers/net/virtio_net.c | 12 +++++++++---
> > 1 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index bb6b67f..b6d4028 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -986,9 +986,15 @@ static int virtnet_probe(struct virtio_device *vdev)
> > goto unregister;
> > }
> >
> > - vi->status = VIRTIO_NET_S_LINK_UP;
> > - virtnet_update_status(vi);
> > - netif_carrier_on(dev);
> > + /* Assume link up if device can't report link status,
> > + otherwise get link status from config. */
> > + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
> > + netif_carrier_off(dev);
> > + virtnet_update_status(vi);
> > + } else {
> > + vi->status = VIRTIO_NET_S_LINK_UP;
> > + netif_carrier_on(dev);
> > + }
> >
> > pr_debug("virtnet: registered device %s\n", dev->name);
> > return 0;
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe kvm" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [RESEND PATCH] virtio-net: init link state correctly
From: Jason Wang @ 2010-11-05 9:47 UTC (permalink / raw)
To: netdev, rusty, linux-kernel, davem; +Cc: markmc, kvm, mst
For device that supports VIRTIO_NET_F_STATUS, there's no need to
assume the link is up and we need to call nerif_carrier_off() before
querying device status, otherwise we may get wrong operstate after
diver was loaded because the link watch event was not fired as
expected.
For device that does not support VIRITO_NET_F_STATUS, we could not get
its status through virtnet_update_status() and what we can only do is
always assuming the link is up.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
drivers/net/virtio_net.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index bb6b67f..b6d4028 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -986,9 +986,15 @@ static int virtnet_probe(struct virtio_device *vdev)
goto unregister;
}
- vi->status = VIRTIO_NET_S_LINK_UP;
- virtnet_update_status(vi);
- netif_carrier_on(dev);
+ /* Assume link up if device can't report link status,
+ otherwise get link status from config. */
+ if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
+ netif_carrier_off(dev);
+ virtnet_update_status(vi);
+ } else {
+ vi->status = VIRTIO_NET_S_LINK_UP;
+ netif_carrier_on(dev);
+ }
pr_debug("virtnet: registered device %s\n", dev->name);
return 0;
^ permalink raw reply related
* [PATCH] via-rhine: hardware VLAN support
From: Roger Luethi @ 2010-11-05 10:43 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller
This patch adds VLAN hardware support for Rhine chips.
The driver uses up to 3 additional bytes of buffer space when extracting
802.1Q headers; PKT_BUF_SZ should still be sufficient.
The initial code was provided by David Lv. I reworked it to use standard
kernel facilities. Coding style clean up mostly follows via-velocity.
Signed-off-by: David Lv <DavidLv@viatech.com.cn>
Signed-off-by: Roger Luethi <rl@hellgate.ch>
drivers/net/via-rhine.c | 351 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 337 insertions(+), 14 deletions(-)
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 4930f9d..67afc48 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -30,8 +30,8 @@
*/
#define DRV_NAME "via-rhine"
-#define DRV_VERSION "1.4.3"
-#define DRV_RELDATE "2007-03-06"
+#define DRV_VERSION "1.5.0"
+#define DRV_RELDATE "2010-10-09"
/* A few user-configurable values.
@@ -100,6 +100,7 @@ static const int multicast_filter_limit = 32;
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/crc32.h>
+#include <linux/if_vlan.h>
#include <linux/bitops.h>
#include <linux/workqueue.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
@@ -133,6 +134,9 @@ MODULE_PARM_DESC(debug, "VIA Rhine debug level (0-7)");
MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames");
MODULE_PARM_DESC(avoid_D3, "Avoid power state D3 (work-around for broken BIOSes)");
+#define MCAM_SIZE 32
+#define VCAM_SIZE 32
+
/*
Theory of Operation
@@ -279,15 +283,16 @@ MODULE_DEVICE_TABLE(pci, rhine_pci_tbl);
/* Offsets to the device registers. */
enum register_offsets {
StationAddr=0x00, RxConfig=0x06, TxConfig=0x07, ChipCmd=0x08,
- ChipCmd1=0x09,
+ ChipCmd1=0x09, TQWake=0x0A,
IntrStatus=0x0C, IntrEnable=0x0E,
MulticastFilter0=0x10, MulticastFilter1=0x14,
RxRingPtr=0x18, TxRingPtr=0x1C, GFIFOTest=0x54,
- MIIPhyAddr=0x6C, MIIStatus=0x6D, PCIBusConfig=0x6E,
+ MIIPhyAddr=0x6C, MIIStatus=0x6D, PCIBusConfig=0x6E, PCIBusConfig1=0x6F,
MIICmd=0x70, MIIRegAddr=0x71, MIIData=0x72, MACRegEEcsr=0x74,
ConfigA=0x78, ConfigB=0x79, ConfigC=0x7A, ConfigD=0x7B,
RxMissed=0x7C, RxCRCErrs=0x7E, MiscCmd=0x81,
StickyHW=0x83, IntrStatus2=0x84,
+ CamMask=0x88, CamCon=0x92, CamAddr=0x93,
WOLcrSet=0xA0, PwcfgSet=0xA1, WOLcgSet=0xA3, WOLcrClr=0xA4,
WOLcrClr1=0xA6, WOLcgClr=0xA7,
PwrcsrSet=0xA8, PwrcsrSet1=0xA9, PwrcsrClr=0xAC, PwrcsrClr1=0xAD,
@@ -299,6 +304,40 @@ enum backoff_bits {
BackCaptureEffect=0x04, BackRandom=0x08
};
+/* Bits in the TxConfig (TCR) register */
+enum tcr_bits {
+ TCR_PQEN=0x01,
+ TCR_LB0=0x02, /* loopback[0] */
+ TCR_LB1=0x04, /* loopback[1] */
+ TCR_OFSET=0x08,
+ TCR_RTGOPT=0x10,
+ TCR_RTFT0=0x20,
+ TCR_RTFT1=0x40,
+ TCR_RTSF=0x80,
+};
+
+/* Bits in the CamCon (CAMC) register */
+enum camcon_bits {
+ CAMC_CAMEN=0x01,
+ CAMC_VCAMSL=0x02,
+ CAMC_CAMWR=0x04,
+ CAMC_CAMRD=0x08,
+};
+
+/* Bits in the PCIBusConfig1 (BCR1) register */
+enum bcr1_bits {
+ BCR1_POT0=0x01,
+ BCR1_POT1=0x02,
+ BCR1_POT2=0x04,
+ BCR1_CTFT0=0x08,
+ BCR1_CTFT1=0x10,
+ BCR1_CTSF=0x20,
+ BCR1_TXQNOBK=0x40, /* for VT6105 */
+ BCR1_VIDFR=0x80, /* for VT6105 */
+ BCR1_MED0=0x40, /* for VT6102 */
+ BCR1_MED1=0x80, /* for VT6102 */
+};
+
#ifdef USE_MMIO
/* Registers we check that mmio and reg are the same. */
static const int mmio_verify_registers[] = {
@@ -356,6 +395,11 @@ enum desc_status_bits {
DescOwn=0x80000000
};
+/* Bits in *_desc.*_length */
+enum desc_length_bits {
+ DescTag=0x00010000
+};
+
/* Bits in ChipCmd. */
enum chip_cmd_bits {
CmdInit=0x01, CmdStart=0x02, CmdStop=0x04, CmdRxOn=0x08,
@@ -365,6 +409,7 @@ enum chip_cmd_bits {
};
struct rhine_private {
+ struct vlan_group *vlgrp;
/* Descriptor rings */
struct rx_desc *rx_ring;
struct tx_desc *tx_ring;
@@ -391,6 +436,9 @@ struct rhine_private {
spinlock_t lock;
struct work_struct reset_task;
+ u32 mCAMmask; /* 32 CAMs each (6105M and better) */
+ u32 vCAMmask;
+
/* Frequently used values: keep some adjacent for cache effect. */
u32 quirks;
struct rx_desc *rx_head_desc;
@@ -405,6 +453,22 @@ struct rhine_private {
void __iomem *base;
};
+#define BYTE_REG_BITS_ON(x, p) do { iowrite8((ioread8((p))|(x)), (p)); } while (0)
+#define WORD_REG_BITS_ON(x, p) do { iowrite16((ioread16((p))|(x)), (p)); } while (0)
+#define DWORD_REG_BITS_ON(x, p) do { iowrite32((ioread32((p))|(x)), (p)); } while (0)
+
+#define BYTE_REG_BITS_IS_ON(x, p) (ioread8((p)) & (x))
+#define WORD_REG_BITS_IS_ON(x, p) (ioread16((p)) & (x))
+#define DWORD_REG_BITS_IS_ON(x, p) (ioread32((p)) & (x))
+
+#define BYTE_REG_BITS_OFF(x, p) do { iowrite8(ioread8((p)) & (~(x)), (p)); } while (0)
+#define WORD_REG_BITS_OFF(x, p) do { iowrite16(ioread16((p)) & (~(x)), (p)); } while (0)
+#define DWORD_REG_BITS_OFF(x, p) do { iowrite32(ioread32((p)) & (~(x)), (p)); } while (0)
+
+#define BYTE_REG_BITS_SET(x, m, p) do { iowrite8((ioread8((p)) & (~(m)))|(x), (p)); } while (0)
+#define WORD_REG_BITS_SET(x, m, p) do { iowrite16((ioread16((p)) & (~(m)))|(x), (p)); } while (0)
+#define DWORD_REG_BITS_SET(x, m, p) do { iowrite32((ioread32((p)) & (~(m)))|(x), (p)); } while (0)
+
static int mdio_read(struct net_device *dev, int phy_id, int location);
static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
static int rhine_open(struct net_device *dev);
@@ -422,6 +486,15 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static const struct ethtool_ops netdev_ethtool_ops;
static int rhine_close(struct net_device *dev);
static void rhine_shutdown (struct pci_dev *pdev);
+static void rhine_vlan_rx_register(struct net_device *dev, struct vlan_group *grp);
+static void rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid);
+static void rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid);
+static void rhine_set_cam(void __iomem *ioaddr, int idx, u8 *addr);
+static void rhine_set_vlan_cam(void __iomem *ioaddr, int idx, u8 *addr);
+static void rhine_set_cam_mask(void __iomem *ioaddr, u32 mask);
+static void rhine_set_vlan_cam_mask(void __iomem *ioaddr, u32 mask);
+static void rhine_init_cam_filter(struct net_device *dev);
+static void rhine_update_vcam(struct rhine_private *rp);
#define RHINE_WAIT_FOR(condition) do { \
int i=1024; \
@@ -629,6 +702,9 @@ static const struct net_device_ops rhine_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
.ndo_do_ioctl = netdev_ioctl,
.ndo_tx_timeout = rhine_tx_timeout,
+ .ndo_vlan_rx_add_vid = rhine_vlan_rx_add_vid,
+ .ndo_vlan_rx_kill_vid = rhine_vlan_rx_kill_vid,
+ .ndo_vlan_rx_register = rhine_vlan_rx_register,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = rhine_poll,
#endif
@@ -795,6 +871,10 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
if (rp->quirks & rqRhineI)
dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
+ if (pdev->revision >= VT6105M)
+ dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
+ NETIF_F_HW_VLAN_FILTER;
+
/* dev->name not defined before register_netdev()! */
rc = register_netdev(dev);
if (rc)
@@ -1040,6 +1120,190 @@ static void rhine_set_carrier(struct mii_if_info *mii)
netif_carrier_ok(mii->dev));
}
+/**
+ * rhine_set_cam - set CAM multicast filters
+ * @ioaddr: register block of this Rhine
+ * @idx: multicast CAM index [0..MCAM_SIZE-1]
+ * @addr: multicast address (6 bytes)
+ *
+ * Load addresses into multicast filters.
+ */
+static void rhine_set_cam(void __iomem *ioaddr, int idx, u8 *addr)
+{
+ int i;
+
+ iowrite8(CAMC_CAMEN, ioaddr + CamCon);
+ wmb();
+
+ /* Paranoid -- idx out of range should never happen */
+ idx &= (MCAM_SIZE - 1);
+
+ iowrite8((u8) idx, ioaddr + CamAddr);
+
+ for (i = 0; i < 6; i++, addr++)
+ iowrite8(*addr, ioaddr + MulticastFilter0 + i);
+ udelay(10);
+ wmb();
+
+ iowrite8(CAMC_CAMWR | CAMC_CAMEN, ioaddr + CamCon);
+ udelay(10);
+
+ iowrite8(0, ioaddr + CamCon);
+}
+
+/**
+ * rhine_set_vlan_cam - set CAM VLAN filters
+ * @ioaddr: register block of this Rhine
+ * @idx: VLAN CAM index [0..VCAM_SIZE-1]
+ * @addr: VLAN ID (2 bytes)
+ *
+ * Load addresses into VLAN filters.
+ */
+static void rhine_set_vlan_cam(void __iomem *ioaddr, int idx, u8 *addr)
+{
+ iowrite8(CAMC_CAMEN | CAMC_VCAMSL, ioaddr + CamCon);
+ wmb();
+
+ /* Paranoid -- idx out of range should never happen */
+ idx &= (VCAM_SIZE - 1);
+
+ iowrite8((u8) idx, ioaddr + CamAddr);
+
+ iowrite16(*((u16 *) addr), ioaddr + MulticastFilter0 + 6);
+ udelay(10);
+ wmb();
+
+ iowrite8(CAMC_CAMWR | CAMC_CAMEN, ioaddr + CamCon);
+ udelay(10);
+
+ iowrite8(0, ioaddr + CamCon);
+}
+
+/**
+ * rhine_set_cam_mask - set multicast CAM mask
+ * @ioaddr: register block of this Rhine
+ * @mask: multicast CAM mask
+ *
+ * Mask sets multicast filters active/inactive.
+ */
+static void rhine_set_cam_mask(void __iomem *ioaddr, u32 mask)
+{
+ iowrite8(CAMC_CAMEN, ioaddr + CamCon);
+ wmb();
+
+ /* write mask */
+ iowrite32(mask, ioaddr + CamMask);
+
+ /* disable CAMEN */
+ iowrite8(0, ioaddr + CamCon);
+}
+
+/**
+ * rhine_set_vlan_cam_mask - set VLAN CAM mask
+ * @ioaddr: register block of this Rhine
+ * @mask: VLAN CAM mask
+ *
+ * Mask sets VLAN filters active/inactive.
+ */
+static void rhine_set_vlan_cam_mask(void __iomem *ioaddr, u32 mask)
+{
+ iowrite8(CAMC_CAMEN | CAMC_VCAMSL, ioaddr + CamCon);
+ wmb();
+
+ /* write mask */
+ iowrite32(mask, ioaddr + CamMask);
+
+ /* disable CAMEN */
+ iowrite8(0, ioaddr + CamCon);
+}
+
+/**
+ * rhine_init_cam_filter - initialize CAM filters
+ * @dev: network device
+ *
+ * Initialize (disable) hardware VLAN and multicast support on this
+ * Rhine.
+ */
+static void rhine_init_cam_filter(struct net_device *dev)
+{
+ struct rhine_private *rp = netdev_priv(dev);
+ void __iomem *ioaddr = rp->base;
+
+ /* Disable all CAMs */
+ rp->vCAMmask = 0;
+ rp->mCAMmask = 0;
+ rhine_set_vlan_cam_mask(ioaddr, rp->vCAMmask);
+ rhine_set_cam_mask(ioaddr, rp->mCAMmask);
+
+ /* disable hardware VLAN support */
+ BYTE_REG_BITS_OFF(TCR_PQEN, ioaddr + TxConfig);
+ BYTE_REG_BITS_OFF(BCR1_VIDFR, ioaddr + PCIBusConfig1);
+}
+
+/**
+ * rhine_update_vcam - update VLAN CAM filters
+ * @rp: rhine_private data of this Rhine
+ *
+ * Update VLAN CAM filters to match configuration change.
+ */
+static void rhine_update_vcam(struct rhine_private *rp)
+{
+ void __iomem *ioaddr = rp->base;
+
+ rp->mCAMmask = 0;
+
+ if (rp->vlgrp) {
+ unsigned int vid, i = 0;
+
+ for (vid = 1; (vid < VLAN_VID_MASK); vid++) {
+ if (vlan_group_get_device(rp->vlgrp, vid)) {
+ rhine_set_vlan_cam(ioaddr, i, (u8 *)&vid);
+ rp->vCAMmask |= 1 << i;
+ if (++i >= VCAM_SIZE)
+ break;
+ }
+ }
+ rhine_set_vlan_cam_mask(ioaddr, rp->vCAMmask);
+ }
+}
+
+static void rhine_vlan_rx_register(struct net_device *dev,
+ struct vlan_group *grp)
+{
+ struct rhine_private *rp = netdev_priv(dev);
+ void __iomem *ioaddr = rp->base;
+
+ rp->vlgrp = grp;
+ if (grp) {
+ BYTE_REG_BITS_ON(TCR_PQEN, ioaddr + TxConfig);
+ /* enable VLAN receive filtering */
+ if (!(dev->flags & IFF_PROMISC))
+ BYTE_REG_BITS_ON(BCR1_VIDFR, ioaddr + PCIBusConfig1);
+ } else {
+ BYTE_REG_BITS_OFF(TCR_PQEN, ioaddr + TxConfig);
+ BYTE_REG_BITS_OFF(BCR1_VIDFR, ioaddr + PCIBusConfig1);
+ }
+}
+
+static void rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
+{
+ struct rhine_private *rp = netdev_priv(dev);
+
+ spin_lock_irq(&rp->lock);
+ rhine_update_vcam(rp);
+ spin_unlock_irq(&rp->lock);
+}
+
+static void rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
+{
+ struct rhine_private *rp = netdev_priv(dev);
+
+ spin_lock_irq(&rp->lock);
+ vlan_group_set_device(rp->vlgrp, vid, NULL);
+ rhine_update_vcam(rp);
+ spin_unlock_irq(&rp->lock);
+}
+
static void init_registers(struct net_device *dev)
{
struct rhine_private *rp = netdev_priv(dev);
@@ -1061,6 +1325,9 @@ static void init_registers(struct net_device *dev)
rhine_set_rx_mode(dev);
+ if (rp->pdev->revision >= VT6105M)
+ rhine_init_cam_filter(dev);
+
napi_enable(&rp->napi);
/* Enable interrupts by setting the interrupt mask. */
@@ -1276,16 +1543,28 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
rp->tx_ring[entry].desc_length =
cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
+ if (unlikely(rp->vlgrp && vlan_tx_tag_present(skb))) {
+ rp->tx_ring[entry].tx_status = cpu_to_le32((vlan_tx_tag_get(skb)) << 16);
+ /* request tagging */
+ rp->tx_ring[entry].desc_length |= cpu_to_le32(0x020000);
+ }
+ else
+ rp->tx_ring[entry].tx_status = 0;
+
/* lock eth irq */
spin_lock_irqsave(&rp->lock, flags);
wmb();
- rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
+ rp->tx_ring[entry].tx_status |= cpu_to_le32(DescOwn);
wmb();
rp->cur_tx++;
/* Non-x86 Todo: explicitly flush cache lines here. */
+ if (rp->vlgrp && vlan_tx_tag_present(skb))
+ /* Tx queues are bits 7-0 (first Tx queue: bit 7) */
+ BYTE_REG_BITS_ON(1 << 7, ioaddr + TQWake);
+
/* Wake the potentially-idle transmit channel */
iowrite8(ioread8(ioaddr + ChipCmd1) | Cmd1TxDemand,
ioaddr + ChipCmd1);
@@ -1437,6 +1716,21 @@ static void rhine_tx(struct net_device *dev)
spin_unlock(&rp->lock);
}
+/**
+ * rhine_get_vlan_tci - extract TCI from Rx data buffer
+ * @skb: pointer to sk_buff
+ * @data_size: used data area of the buffer including CRC
+ *
+ * If hardware VLAN tag extraction is enabled and the chip indicates a 802.1Q
+ * packet, the extracted 802.1Q header (2 bytes TPID + 2 bytes TCI) is 4-byte
+ * aligned following the CRC.
+ */
+static inline u16 rhine_get_vlan_tci(struct sk_buff *skb, int data_size)
+{
+ u8 *trailer = (u8 *)skb->data + ((data_size + 3) & ~3) + 2;
+ return ntohs(*(u16 *)trailer);
+}
+
/* Process up to limit frames from receive ring */
static int rhine_rx(struct net_device *dev, int limit)
{
@@ -1454,6 +1748,7 @@ static int rhine_rx(struct net_device *dev, int limit)
for (count = 0; count < limit; ++count) {
struct rx_desc *desc = rp->rx_head_desc;
u32 desc_status = le32_to_cpu(desc->rx_status);
+ u32 desc_length = le32_to_cpu(desc->desc_length);
int data_size = desc_status >> 16;
if (desc_status & DescOwn)
@@ -1498,6 +1793,7 @@ static int rhine_rx(struct net_device *dev, int limit)
struct sk_buff *skb = NULL;
/* Length should omit the CRC */
int pkt_len = data_size - 4;
+ u16 vlan_tci = 0;
/* Check if the packet is long enough to accept without
copying to a minimally-sized skbuff. */
@@ -1532,8 +1828,16 @@ static int rhine_rx(struct net_device *dev, int limit)
rp->rx_buf_sz,
PCI_DMA_FROMDEVICE);
}
+
+ if (unlikely(rp->vlgrp && (desc_length & DescTag)))
+ vlan_tci = rhine_get_vlan_tci(skb, data_size);
+
skb->protocol = eth_type_trans(skb, dev);
- netif_receive_skb(skb);
+
+ if (unlikely(rp->vlgrp && (desc_length & DescTag)))
+ vlan_hwaccel_receive_skb(skb, rp->vlgrp, vlan_tci);
+ else
+ netif_receive_skb(skb);
dev->stats.rx_bytes += pkt_len;
dev->stats.rx_packets++;
}
@@ -1596,6 +1900,11 @@ static void rhine_restart_tx(struct net_device *dev) {
iowrite8(ioread8(ioaddr + ChipCmd) | CmdTxOn,
ioaddr + ChipCmd);
+
+ if (rp->tx_ring[entry].desc_length & cpu_to_le32(0x020000))
+ /* Tx queues are bits 7-0 (first Tx queue: bit 7) */
+ BYTE_REG_BITS_ON(1 << 7, ioaddr + TQWake);
+
iowrite8(ioread8(ioaddr + ChipCmd1) | Cmd1TxDemand,
ioaddr + ChipCmd1);
IOSYNC;
@@ -1631,7 +1940,7 @@ static void rhine_error(struct net_device *dev, int intr_status)
}
if (intr_status & IntrTxUnderrun) {
if (rp->tx_thresh < 0xE0)
- iowrite8(rp->tx_thresh += 0x20, ioaddr + TxConfig);
+ BYTE_REG_BITS_SET((rp->tx_thresh += 0x20), 0x80, ioaddr + TxConfig);
if (debug > 1)
printk(KERN_INFO "%s: Transmitter underrun, Tx "
"threshold now %2.2x.\n",
@@ -1646,7 +1955,7 @@ static void rhine_error(struct net_device *dev, int intr_status)
(intr_status & (IntrTxAborted |
IntrTxUnderrun | IntrTxDescRace)) == 0) {
if (rp->tx_thresh < 0xE0) {
- iowrite8(rp->tx_thresh += 0x20, ioaddr + TxConfig);
+ BYTE_REG_BITS_SET((rp->tx_thresh += 0x20), 0x80, ioaddr + TxConfig);
}
if (debug > 1)
printk(KERN_INFO "%s: Unspecified error. Tx "
@@ -1688,7 +1997,8 @@ static void rhine_set_rx_mode(struct net_device *dev)
struct rhine_private *rp = netdev_priv(dev);
void __iomem *ioaddr = rp->base;
u32 mc_filter[2]; /* Multicast hash filter */
- u8 rx_mode; /* Note: 0x02=accept runt, 0x01=accept errs */
+ u8 rx_mode = 0x0C; /* Note: 0x02=accept runt, 0x01=accept errs */
+ struct netdev_hw_addr *ha;
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
rx_mode = 0x1C;
@@ -1699,10 +2009,17 @@ static void rhine_set_rx_mode(struct net_device *dev)
/* Too many to match, or accept all multicasts. */
iowrite32(0xffffffff, ioaddr + MulticastFilter0);
iowrite32(0xffffffff, ioaddr + MulticastFilter1);
- rx_mode = 0x0C;
+ } else if (rp->pdev->revision >= VT6105M) {
+ int i = 0;
+ netdev_for_each_mc_addr(ha, dev) {
+ if (i == MCAM_SIZE)
+ break;
+ rhine_set_cam(ioaddr, i, ha->addr);
+ rp->mCAMmask |= 1 << i;
+ i++;
+ }
+ rhine_set_cam_mask(ioaddr, rp->mCAMmask);
} else {
- struct netdev_hw_addr *ha;
-
memset(mc_filter, 0, sizeof(mc_filter));
netdev_for_each_mc_addr(ha, dev) {
int bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
@@ -1711,9 +2028,15 @@ static void rhine_set_rx_mode(struct net_device *dev)
}
iowrite32(mc_filter[0], ioaddr + MulticastFilter0);
iowrite32(mc_filter[1], ioaddr + MulticastFilter1);
- rx_mode = 0x0C;
}
- iowrite8(rp->rx_thresh | rx_mode, ioaddr + RxConfig);
+ /* enable/disable VLAN receive filtering */
+ if (rp->pdev->revision >= VT6105M) {
+ if (dev->flags & IFF_PROMISC || !rp->vlgrp)
+ BYTE_REG_BITS_OFF(BCR1_VIDFR, ioaddr + PCIBusConfig1);
+ else
+ BYTE_REG_BITS_ON(BCR1_VIDFR, ioaddr + PCIBusConfig1);
+ }
+ BYTE_REG_BITS_ON(rx_mode, ioaddr + RxConfig);
}
static void netdev_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
--
1.7.2.2
^ permalink raw reply related
* 2.6.36 vlans & bridge crash - status?
From: Nikola Ciprich @ 2010-11-05 10:35 UTC (permalink / raw)
To: netdev list; +Cc: nikola.ciprich
Hello,
I would like to ask if somebody is trying to solve
https://bugzilla.kernel.org/show_bug.cgi?id=20462
and if needed, could I provide some help, testing etc?
thanks a lot in advance!
with best regards
nik
--
-------------------------------------
Ing. Nikola CIPRICH
LinuxBox.cz, s.r.o.
28. rijna 168, 709 01 Ostrava
tel.: +420 596 603 142
fax: +420 596 621 273
mobil: +420 777 093 799
www.linuxbox.cz
mobil servis: +420 737 238 656
email servis: servis@linuxbox.cz
-------------------------------------
^ permalink raw reply
* [PATCH] xfrm: update flowi saddr in icmp_send if unset
From: Ulrich Weber @ 2010-11-05 11:39 UTC (permalink / raw)
To: davem; +Cc: netdev
otherwise xfrm_lookup will fail to find correct policy
Signed-off-by: Ulrich Weber <uweber@astaro.com>
---
net/ipv4/icmp.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 96bc7f9..e5d1a44 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -569,6 +569,9 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
/* No need to clone since we're just using its address. */
rt2 = rt;
+ if (!fl.nl_u.ip4_u.saddr)
+ fl.nl_u.ip4_u.saddr = rt->rt_src;
+
err = xfrm_lookup(net, (struct dst_entry **)&rt, &fl, NULL, 0);
switch (err) {
case 0:
--
1.7.1
^ permalink raw reply related
* [PATCH] ipv6: fix overlap check for fragments
From: Shan Wei @ 2010-11-05 11:56 UTC (permalink / raw)
To: nicolas.dichtel, David Miller; +Cc: netdev@vger.kernel.org, Patrick McHardy
The type of FRAG6_CB(prev)->offset is int, skb->len is *unsigned* int,
and offset is int.
Without this patch, type conversion occurred to this expression, when
(FRAG6_CB(prev)->offset + prev->len) is less than offset.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv6/reassembly.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index c7ba314..0f27664 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -349,7 +349,7 @@ found:
/* Check for overlap with preceding fragment. */
if (prev &&
- (FRAG6_CB(prev)->offset + prev->len) - offset > 0)
+ (FRAG6_CB(prev)->offset + prev->len) > offset)
goto discard_fq;
/* Look for overlap with succeeding segment. */
--
1.6.3.3
^ permalink raw reply related
* [PATCH] netfilter: ipv6: fix overlap check for fragments
From: Shan Wei @ 2010-11-05 11:56 UTC (permalink / raw)
To: nicolas.dichtel, David Miller, netdev@vger.kernel.org,
netfilter-devel, Patrick McHardy
The type of FRAG6_CB(prev)->offset is int, skb->len is *unsigned* int,
and offset is int.
Without this patch, type conversion occurred to this expression, when
(FRAG6_CB(prev)->offset + prev->len) is less than offset.
Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
net/ipv6/netfilter/nf_conntrack_reasm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 3a3f129..79d43aa 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -286,7 +286,7 @@ found:
/* Check for overlap with preceding fragment. */
if (prev &&
- (NFCT_FRAG6_CB(prev)->offset + prev->len) - offset > 0)
+ (NFCT_FRAG6_CB(prev)->offset + prev->len) > offset)
goto discard_fq;
/* Look for overlap with succeeding segment. */
--
1.6.3.3
^ permalink raw reply related
* RE: [PATCH 23/49] drivers/net/igbvf: Use vzalloc
From: Rose, Gregory V @ 2010-11-05 11:58 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W,
Wyborny, Carolyn, Skidmore, Donald C, Waskiewicz Jr, Peter P,
Duyck, Alexander H, Ronciak, John,
e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <9f8b974fadf646f9227bd1d5fe8e448081ec9b2b.1288925424.git.joe@perches.com>
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Thursday, November 04, 2010 8:08 PM
> To: Jiri Kosina
> Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W; Wyborny,
> Carolyn; Skidmore, Donald C; Rose, Gregory V; Waskiewicz Jr, Peter P;
> Duyck, Alexander H; Ronciak, John; e1000-devel@lists.sourceforge.net;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 23/49] drivers/net/igbvf: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/igbvf/netdev.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
> index 28af019..08e7459 100644
> --- a/drivers/net/igbvf/netdev.c
> +++ b/drivers/net/igbvf/netdev.c
> @@ -429,10 +429,9 @@ int igbvf_setup_tx_resources(struct igbvf_adapter
> *adapter,
> int size;
>
> size = sizeof(struct igbvf_buffer) * tx_ring->count;
> - tx_ring->buffer_info = vmalloc(size);
> + tx_ring->buffer_info = vzalloc(size);
> if (!tx_ring->buffer_info)
> goto err;
> - memset(tx_ring->buffer_info, 0, size);
>
> /* round up to nearest 4K */
> tx_ring->size = tx_ring->count * sizeof(union e1000_adv_tx_desc);
> @@ -469,10 +468,9 @@ int igbvf_setup_rx_resources(struct igbvf_adapter
> *adapter,
> int size, desc_len;
>
> size = sizeof(struct igbvf_buffer) * rx_ring->count;
> - rx_ring->buffer_info = vmalloc(size);
> + rx_ring->buffer_info = vzalloc(size);
> if (!rx_ring->buffer_info)
> goto err;
> - memset(rx_ring->buffer_info, 0, size);
>
> desc_len = sizeof(union e1000_adv_rx_desc);
>
> --
> 1.7.3.1.g432b3.dirty
Acked By: Greg Rose <Gregory.v.rose@intel.com>
^ permalink raw reply
* Re: [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
From: Rose, Gregory V @ 2010-11-05 11:59 UTC (permalink / raw)
To: Joe Perches, Jiri Kosina
Cc: e1000-devel@lists.sourceforge.net, Allan, Bruce W,
Brandeburg, Jesse, linux-kernel@vger.kernel.org, Ronciak, John,
Kirsher, Jeffrey T, netdev@vger.kernel.org
In-Reply-To: <79b773f5012cba15686c4048d48cbbef6a13b049.1288925425.git.joe@perches.com>
> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Thursday, November 04, 2010 8:08 PM
> To: Jiri Kosina
> Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W; Wyborny,
> Carolyn; Skidmore, Donald C; Rose, Gregory V; Waskiewicz Jr, Peter P;
> Duyck, Alexander H; Ronciak, John; e1000-devel@lists.sourceforge.net;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 26/49] drivers/net/ixgbevf: Use vzalloc
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/ixgbevf/ixgbevf_main.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ixgbevf/ixgbevf_main.c
> b/drivers/net/ixgbevf/ixgbevf_main.c
> index dc03c96..6aeaf54 100644
> --- a/drivers/net/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ixgbevf/ixgbevf_main.c
> @@ -2488,10 +2488,9 @@ int ixgbevf_setup_tx_resources(struct
> ixgbevf_adapter *adapter,
> int size;
>
> size = sizeof(struct ixgbevf_tx_buffer) * tx_ring->count;
> - tx_ring->tx_buffer_info = vmalloc(size);
> + tx_ring->tx_buffer_info = vzalloc(size);
> if (!tx_ring->tx_buffer_info)
> goto err;
> - memset(tx_ring->tx_buffer_info, 0, size);
>
> /* round up to nearest 4K */
> tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
> @@ -2555,14 +2554,13 @@ int ixgbevf_setup_rx_resources(struct
> ixgbevf_adapter *adapter,
> int size;
>
> size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
> - rx_ring->rx_buffer_info = vmalloc(size);
> + rx_ring->rx_buffer_info = vzalloc(size);
> if (!rx_ring->rx_buffer_info) {
> hw_dbg(&adapter->hw,
> "Unable to vmalloc buffer memory for "
> "the receive descriptor ring\n");
> goto alloc_failed;
> }
> - memset(rx_ring->rx_buffer_info, 0, size);
>
> /* Round up to nearest 4K */
> rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
> --
> 1.7.3.1.g432b3.dirty
Acked By: Greg Rose <Gregory.v.rose@intel.com>
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply
* Re: [PATCH 0/15] RFC: create drivers/net/legacy for ISA, EISA, MCA drivers
From: Paul Gortmaker @ 2010-11-05 12:51 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: Joe Perches, davem@davemloft.net, netdev@vger.kernel.org
In-Reply-To: <AANLkTim2yH7eAqqYQW+JVC5GtFR5mX4uZnMa02+yubFk@mail.gmail.com>
On 10-11-04 10:28 PM, Jeff Kirsher wrote:
> On Thu, Nov 4, 2010 at 14:20, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
>> On 10-10-29 08:01 PM, Jeff Kirsher wrote:
>>> On Fri, 2010-10-29 at 15:08 -0700, Joe Perches wrote:
>>>> On Fri, 2010-10-29 at 17:26 -0400, Paul Gortmaker wrote:
>>>>> On 10-10-28 09:48 PM, Joe Perches wrote:
>>>>>> On Thu, 2010-10-28 at 21:19 -0400, Paul Gortmaker wrote:
>>>>>>> The drivers/net dir has a lot of files - originally there were
>>>>>>> no subdirs, but at least now subdirs are being used effectively.
>>>>>>> But the original drivers from 10+ years ago are still right
>>>>>>> there at the top. This series creates a drivers/net/legacy dir.
>>>>>> I like this idea.
>>>>>> I suggest a bit of a further grouping by using a
>>>>>> drivers/net/ethernet directory and putting those
>>>>>> legacy drivers in a new subdirectory
>>>>>> drivers/net/ethernet/legacy.
>>>>> That is a substantially larger change, since you'd now be
>>>>> relocating nearly every remaining driver, i.e. all the
>>>>> relatively modern 100M and GigE drivers.
>>>>
>>>
>>> I am not particularly a fan of making a "legacy" directory and moving
>>> old drivers into it. Just because this is very subjective, if you say
>>> "drivers which are X years old and not used much" is vague and depending
>>> on who you ask would get varying results. But if you were to were to
>>> define legacy as all ISA, EISA and MCA drivers (not based on their use)
>>> would be better.
>>
>> I think that being subjective can be an advantage. There may
>> be some debate on whether X is legacy or not, but I see no harm
>> in that. On the other hand, I see binding ourselves to concrete
>> inflexible rules as a disadvantage.
>>
>
> I am not disagreeing that we need to be flexible, and to organize the
> directory structure in a logical way does not equate to "concrete and
> inflexible".
>
> I brought the topic of organizing the /drivers/net directory up at
> NetConf/Plumbers and here is what came about the discussion...
Thanks for the update, I wasn't aware that happened.
>
> Joe and I are working to organize the drivers into
> /drivers/net/<technology> directories and to cleanup the Kconfig to
> reflect the organization. Ethernet drivers will be in
> /drivers/net/ethernet, and so on. I brought up your suggestion to
> making a "legacy" directory and those present did not like the idea.
Interesting. I would have not came to that conclusion based on
the feedback on netdev@vger alone. Oh well, if that was the
consensus then I'm not going to argue with it.
> In short, there is no advantage to this type of organization and
> having the drivers reside in their current location or in the model of
> /drivers/net/<technology> does not cause any problems
[...]
>>>>
>>>> There are arch specific directories under various drivers/...
>>>> so I don't see a need to move directories like drivers/net/arm
>>>> or drivers/s390.
>>>
>>> I agree with Joe.
>>
>> I don't think there is any disagreement here on this point.
>> Moving stuff that is already in an appropriate subdir was
>> never part of what I was proposing with drivers/legacy.
>>
>> But if we create subdirs with concrete definitions, then
>> people will most likely be expecting all drivers that match
>> to be in that specific subdir.
>
> Correct, although I would use "logical organization" versus "concrete
> definitions" and we are working on patches to do the clean up so that
> Ethernet drivers are under /drivers/net/ethernet/*, as well as the
If you do get agreement on subcategories under ethernet for one
reason or another (i.e. vendor grouping), then I'd suggest using
ns8390 as a grouping category - it would lend itself well to
coalescing a lot of legacy drivers in itself.
> other technologies. For the drivers like vlan, 8021q, bridging, etc
> we will place those in /drivers/net/sw/. That is the plan at least...
>
>>
>>>
>>>>
>>>>> With this, I tried to aim for a significant gain (close to 1/3
>>>>> less files) within what I felt was a reasonable sized change
>>>>> set that had a chance of getting an overall OK from folks.
>>>>> Giant "flag-day" type mammoth changesets are a PITA for all.
>>>>
>>>> I believe there's no need for a flag-day.
>>>> File renames could happen gradually or not at all.
>>>>
>>>>
>>>
>>> Again I agree with Joe.
>>
>> Sure, renames can be async, and driven by the individual
>> maintainers of the files, but typically when conversion
>> like events are left open ended (timewise) they tend
>> to drag on for longer times than necessary. At least in
>> my experience. If I had sent the RFC with one patch that
>> amounted to a "mkdir", and no actual file moves, I wouldn't
>> have expected much other than a bagful of scorn in return. :)
>> Putting it to use and showing a real cleanup is where the
>> value became really apparent, I think.
>>
>
> We are hoping not to drag this out and plan on getting this into
> 2.6.38 (net-next) within the couple of weeks.
Sounds good. In the end, the one thing I was hoping to see
happen was a bit more organization in drivers/net - and both
solutions should be able to provide this.
Paul.
>
>> In any case, I still think this is worthwhile, and in the
>> absence of an alternate proposal that gets a higher level
>> of universal agreement, I'm hoping we can still do this.
>> I've got a follow on commit ready that factors a lot of
>> the legacy related probe code out of Space.c too.
>>
>> Regardless of which way it goes, thanks for the feedback.
>> Paul.
>> --
>> 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
>>
>
>
>
^ permalink raw reply
* ping -I eth1 ....
From: Joakim Tjernlund @ 2010-11-05 13:14 UTC (permalink / raw)
To: netdev
If I do busybox ping -I eth1 x.x.y.y i see
socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
getuid() = 0
setuid(0) = 0
setsockopt(3, SOL_SOCKET, SO_BINDTODEVICE, "eth1\0\0\0\0\0\0\0\0\0\0\0\0\20\0[l\0\0\0\2\20\7\354(\0"..., 32) = 0
setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(3, SOL_SOCKET, SO_RCVBUF, [7280], 4) = 0
......
then this in a loop:
--- SIGALRM (Alarm clock) @ 0 (0) ---
clock_gettime(CLOCK_MONOTONIC, {1238, 116470107}) = 0
sendto(3, "\10\0\203\345\1\326\0\2I\314(v\0\0\0\0\0\0\0\0\0\0\0\0"..., 64, 0, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("1.1.1.1")}, 16) = 64
rt_sigaction(SIGALRM, {0x10017034, [ALRM], SA_RESTART}, {0x10017034, [ALRM], SA_RESTART}, 8) = 0
alarm(1) = 0
sigreturn() = ? (mask now [ILL ABRT FPE KILL ALRM STKFLT CONT STOP TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR RTMIN])
recvfrom(3, 0xbfe6a620, 192, 0, 0xbfe6a6f0, 0xbfe6a70c) = ? ERESTARTSYS (To be restarted)
Then I do ifconfig eth1 down
and I still see the same. Should not
sendto and/or revcfrom return some error as
the interface is down?
kernel 2.6.35
Jocke
^ permalink raw reply
* Re: ping -I eth1 ....
From: Eric Dumazet @ 2010-11-05 13:36 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: netdev
In-Reply-To: <OF339BCA8A.B674D6AE-ONC12577D2.00481B5E-C12577D2.0048B214@transmode.se>
Le vendredi 05 novembre 2010 à 14:14 +0100, Joakim Tjernlund a écrit :
> If I do busybox ping -I eth1 x.x.y.y i see
> socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
> getuid() = 0
> setuid(0) = 0
> setsockopt(3, SOL_SOCKET, SO_BINDTODEVICE, "eth1\0\0\0\0\0\0\0\0\0\0\0\0\20\0[l\0\0\0\2\20\7\354(\0"..., 32) = 0
> setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> setsockopt(3, SOL_SOCKET, SO_RCVBUF, [7280], 4) = 0
>
> ......
> then this in a loop:
> --- SIGALRM (Alarm clock) @ 0 (0) ---
> clock_gettime(CLOCK_MONOTONIC, {1238, 116470107}) = 0
> sendto(3, "\10\0\203\345\1\326\0\2I\314(v\0\0\0\0\0\0\0\0\0\0\0\0"..., 64, 0, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("1.1.1.1")}, 16) = 64
> rt_sigaction(SIGALRM, {0x10017034, [ALRM], SA_RESTART}, {0x10017034, [ALRM], SA_RESTART}, 8) = 0
> alarm(1) = 0
> sigreturn() = ? (mask now [ILL ABRT FPE KILL ALRM STKFLT CONT STOP TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR RTMIN])
> recvfrom(3, 0xbfe6a620, 192, 0, 0xbfe6a6f0, 0xbfe6a70c) = ? ERESTARTSYS (To be restarted)
>
> Then I do ifconfig eth1 down
> and I still see the same. Should not
> sendto and/or revcfrom return some error as
> the interface is down?
Hmm, this reminds me one patch, yes...
Search for " ipv4: remove all rt cache entries on UNREGISTER event"
http://permalink.gmane.org/gmane.linux.network/173391
I guess I should respin it for net-next-2.6
^ permalink raw reply
* [RFC] ipvs: allow transmit of GRO aggregated skbs
From: Simon Horman @ 2010-11-05 13:52 UTC (permalink / raw)
To: lvs-devel, netdev; +Cc: Julian Anastasov
This is a first attempt at allowing LVS to transmit
skbs of greater than MTU length that have been aggregated by GRO.
I have lightly tested the ip_vs_dr_xmit() portion of this patch and
although it seems to work I am unsure that netif_needs_gso() is the correct
test to use.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
LRO is still an outstanding issue, but as its deprecated in favour
of GRO perhaps it doesn't need to be solved.
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 93c15a1..93a782e 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -246,7 +246,8 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
/* MTU checking */
mtu = dst_mtu(&rt->u.dst);
- if ((skb->len > mtu) && (iph->frag_off & htons(IP_DF))) {
+ if ((skb->len > mtu) && (iph->frag_off & htons(IP_DF)) &&
+ !netif_needs_gso(rt->u.dst.dev, skb)) {
ip_rt_put(rt);
icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
IP_VS_DBG_RL("%s(): frag needed\n", __func__);
@@ -310,7 +311,7 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
/* MTU checking */
mtu = dst_mtu(&rt->u.dst);
- if (skb->len > mtu) {
+ if (skb->len > mtu && !netif_needs_gso(rt->u.dst.dev, skb)) {
dst_release(&rt->u.dst);
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
IP_VS_DBG_RL("%s(): frag needed\n", __func__);
@@ -377,7 +378,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
/* MTU checking */
mtu = dst_mtu(&rt->u.dst);
- if ((skb->len > mtu) && (iph->frag_off & htons(IP_DF))) {
+ if ((skb->len > mtu) && (iph->frag_off & htons(IP_DF)) &&
+ !netif_needs_gso(rt->u.dst.dev, skb)) {
ip_rt_put(rt);
icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
IP_VS_DBG_RL_PKT(0, pp, skb, 0, "ip_vs_nat_xmit(): frag needed for");
@@ -453,7 +455,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
/* MTU checking */
mtu = dst_mtu(&rt->u.dst);
- if (skb->len > mtu) {
+ if (skb->len > mtu && !netif_needs_gso(rt->u.dst.dev, skb)) {
dst_release(&rt->u.dst);
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
IP_VS_DBG_RL_PKT(0, pp, skb, 0,
@@ -562,8 +564,9 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
df |= (old_iph->frag_off & htons(IP_DF));
- if ((old_iph->frag_off & htons(IP_DF))
- && mtu < ntohs(old_iph->tot_len)) {
+ if ((old_iph->frag_off & htons(IP_DF) &&
+ mtu < ntohs(old_iph->tot_len) &&
+ !netif_needs_gso(rt->u.dst.dev, skb))) {
icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
ip_rt_put(rt);
IP_VS_DBG_RL("%s(): frag needed\n", __func__);
@@ -672,7 +675,8 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
if (skb_dst(skb))
skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu);
- if (mtu < ntohs(old_iph->payload_len) + sizeof(struct ipv6hdr)) {
+ if (mtu < ntohs(old_iph->payload_len) + sizeof(struct ipv6hdr) &&
+ !netif_needs_gso(rt->u.dst.dev, skb)) {
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
dst_release(&rt->u.dst);
IP_VS_DBG_RL("%s(): frag needed\n", __func__);
@@ -761,7 +765,8 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
/* MTU checking */
mtu = dst_mtu(&rt->u.dst);
- if ((iph->frag_off & htons(IP_DF)) && skb->len > mtu) {
+ if ((iph->frag_off & htons(IP_DF)) && skb->len > mtu &&
+ !netif_needs_gso(rt->u.dst.dev, skb)) {
icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
ip_rt_put(rt);
IP_VS_DBG_RL("%s(): frag needed\n", __func__);
@@ -889,7 +894,8 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
/* MTU checking */
mtu = dst_mtu(&rt->u.dst);
- if ((skb->len > mtu) && (ip_hdr(skb)->frag_off & htons(IP_DF))) {
+ if ((skb->len > mtu) && (ip_hdr(skb)->frag_off & htons(IP_DF)) &&
+ !netif_needs_gso(rt->u.dst.dev, skb)) {
ip_rt_put(rt);
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
IP_VS_DBG_RL("%s(): frag needed\n", __func__);
@@ -964,7 +970,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
/* MTU checking */
mtu = dst_mtu(&rt->u.dst);
- if (skb->len > mtu) {
+ if (skb->len > mtu && !netif_needs_gso(rt->u.dst.dev, skb)) {
dst_release(&rt->u.dst);
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
IP_VS_DBG_RL("%s(): frag needed\n", __func__);
^ permalink raw reply related
* Re: ping -I eth1 ....
From: Joakim Tjernlund @ 2010-11-05 14:01 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1288964206.2882.402.camel@edumazet-laptop>
Eric Dumazet <eric.dumazet@gmail.com> wrote on 2010/11/05 14:36:46:
>
> Le vendredi 05 novembre 2010 à 14:14 +0100, Joakim Tjernlund a écrit :
> > If I do busybox ping -I eth1 x.x.y.y i see
> > socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
> > getuid() = 0
> > setuid(0) = 0
> > setsockopt(3, SOL_SOCKET, SO_BINDTODEVICE, "eth1\0\0\0\0\0\0\0\0\0\0\0\0\20\0[l\0\0\0\2\20\7\354(\0"..., 32) = 0
> > setsockopt(3, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
> > setsockopt(3, SOL_SOCKET, SO_RCVBUF, [7280], 4) = 0
> >
> > ......
> > then this in a loop:
> > --- SIGALRM (Alarm clock) @ 0 (0) ---
> > clock_gettime(CLOCK_MONOTONIC, {1238, 116470107}) = 0
> > sendto(3, "\10\0\203\345\1\326\0\2I\314(v\0\0\0\0\0\0\0\0\0\0\0\0"..., 64, 0, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("1.1.1.1")}, 16) = 64
> > rt_sigaction(SIGALRM, {0x10017034, [ALRM], SA_RESTART}, {0x10017034, [ALRM], SA_RESTART}, 8) = 0
> > alarm(1) = 0
> > sigreturn() = ? (mask now [ILL ABRT FPE KILL ALRM STKFLT CONT STOP TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR RTMIN])
> > recvfrom(3, 0xbfe6a620, 192, 0, 0xbfe6a6f0, 0xbfe6a70c) = ? ERESTARTSYS (To be restarted)
> >
> > Then I do ifconfig eth1 down
> > and I still see the same. Should not
> > sendto and/or revcfrom return some error as
> > the interface is down?
>
> Hmm, this reminds me one patch, yes...
>
> Search for " ipv4: remove all rt cache entries on UNREGISTER event"
>
> http://permalink.gmane.org/gmane.linux.network/173391
Ah, that does the trick. A few comments though:
1) I think you should include IFF_RUNNING too
2) This only affects the TX(sendtoo) path?
The RX(recvfrom) should also get an error.
Jocke
>
> I guess I should respin it for net-next-2.6
Yes, pretty please :)
^ permalink raw reply
* Re: ping -I eth1 ....
From: Thomas Graf @ 2010-11-05 14:25 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: Eric Dumazet, netdev
In-Reply-To: <OF22F5901E.A7276220-ONC12577D2.004C79CB-C12577D2.004D1571@transmode.se>
On Fri, Nov 05, 2010 at 03:01:57PM +0100, Joakim Tjernlund wrote:
> > > Then I do ifconfig eth1 down
> > > and I still see the same. Should not
> > > sendto and/or revcfrom return some error as
> > > the interface is down?
> >
> > Hmm, this reminds me one patch, yes...
> >
> > Search for " ipv4: remove all rt cache entries on UNREGISTER event"
> >
> > http://permalink.gmane.org/gmane.linux.network/173391
>
> Ah, that does the trick. A few comments though:
>
> 1) I think you should include IFF_RUNNING too
Probably even better to base it on the operational state of the link
netif_running() && netif_oper_up() && netif_carrier_ok() && !netif_dormant()
^ permalink raw reply
* Re: ping -I eth1 ....
From: Eric Dumazet @ 2010-11-05 14:34 UTC (permalink / raw)
To: Thomas Graf; +Cc: Joakim Tjernlund, netdev
In-Reply-To: <20101105142510.GA14986@canuck.infradead.org>
Le vendredi 05 novembre 2010 à 10:25 -0400, Thomas Graf a écrit :
> On Fri, Nov 05, 2010 at 03:01:57PM +0100, Joakim Tjernlund wrote:
> > > > Then I do ifconfig eth1 down
> > > > and I still see the same. Should not
> > > > sendto and/or revcfrom return some error as
> > > > the interface is down?
> > >
> > > Hmm, this reminds me one patch, yes...
> > >
> > > Search for " ipv4: remove all rt cache entries on UNREGISTER event"
> > >
> > > http://permalink.gmane.org/gmane.linux.network/173391
> >
> > Ah, that does the trick. A few comments though:
> >
> > 1) I think you should include IFF_RUNNING too
>
> Probably even better to base it on the operational state of the link
>
> netif_running() && netif_oper_up() && netif_carrier_ok() && !netif_dormant()
At this point we setup a route.
Is a change of any of this status going to flush/cancel a previously
setup route ?
There must be a reason why in many places we only test (dev->flags &
IFF_UP), and _never_ netif_oper_up() (only in dev_get_flags() to export
it at userspace)
^ 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