* [PATCH 1/2] net: Push protocol type directly down to header_ops->cache()
From: David Miller @ 2011-07-13 8:52 UTC (permalink / raw)
To: netdev
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/firewire/net.c | 6 +++---
drivers/isdn/i4l/isdn_net.c | 5 +++--
drivers/net/plip.c | 6 +++---
include/linux/etherdevice.h | 2 +-
include/linux/netdevice.h | 2 +-
net/core/neighbour.c | 2 +-
net/ethernet/eth.c | 3 +--
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index b9762d0..eced1c2 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -261,16 +261,16 @@ static int fwnet_header_rebuild(struct sk_buff *skb)
}
static int fwnet_header_cache(const struct neighbour *neigh,
- struct hh_cache *hh)
+ struct hh_cache *hh, __be16 type)
{
struct net_device *net;
struct fwnet_header *h;
- if (hh->hh_type == cpu_to_be16(ETH_P_802_3))
+ if (type == cpu_to_be16(ETH_P_802_3))
return -1;
net = neigh->dev;
h = (struct fwnet_header *)((u8 *)hh->hh_data + 16 - sizeof(*h));
- h->h_proto = hh->hh_type;
+ h->h_proto = type;
memcpy(h->h_dest, neigh->ha, net->addr_len);
hh->hh_len = FWNET_HLEN;
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 9798811..48e9cc0 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -1983,13 +1983,14 @@ isdn_net_rebuild_header(struct sk_buff *skb)
return ret;
}
-static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
+static int isdn_header_cache(const struct neighbour *neigh, struct hh_cache *hh,
+ __be16 type)
{
const struct net_device *dev = neigh->dev;
isdn_net_local *lp = netdev_priv(dev);
if (lp->p_encap == ISDN_NET_ENCAP_ETHER)
- return eth_header_cache(neigh, hh);
+ return eth_header_cache(neigh, hh, type);
return -1;
}
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index ca4df7f..a9e9ca8 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -152,7 +152,7 @@ static int plip_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned len);
static int plip_hard_header_cache(const struct neighbour *neigh,
- struct hh_cache *hh);
+ struct hh_cache *hh, __be16 type);
static int plip_open(struct net_device *dev);
static int plip_close(struct net_device *dev);
static int plip_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
@@ -1026,11 +1026,11 @@ plip_hard_header(struct sk_buff *skb, struct net_device *dev,
}
static int plip_hard_header_cache(const struct neighbour *neigh,
- struct hh_cache *hh)
+ struct hh_cache *hh, __be16 type)
{
int ret;
- ret = eth_header_cache(neigh, hh);
+ ret = eth_header_cache(neigh, hh, type);
if (ret == 0) {
struct ethhdr *eth;
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index ab68f78..05955cf 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -38,7 +38,7 @@ extern int eth_header(struct sk_buff *skb, struct net_device *dev,
const void *daddr, const void *saddr, unsigned len);
extern int eth_rebuild_header(struct sk_buff *skb);
extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
-extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh);
+extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
extern void eth_header_cache_update(struct hh_cache *hh,
const struct net_device *dev,
const unsigned char *haddr);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 30f17e4..564d89f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -308,7 +308,7 @@ struct header_ops {
const void *saddr, unsigned len);
int (*parse)(const struct sk_buff *skb, unsigned char *haddr);
int (*rebuild)(struct sk_buff *skb);
- int (*cache)(const struct neighbour *neigh, struct hh_cache *hh);
+ int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
void (*cache_update)(struct hh_cache *hh,
const struct net_device *dev,
const unsigned char *haddr);
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 50bd960..8f7e1d8 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1247,7 +1247,7 @@ static void neigh_hh_init(struct neighbour *n, struct dst_entry *dst,
hh->hh_type = protocol;
atomic_set(&hh->hh_refcnt, 2);
- if (dev->header_ops->cache(n, hh)) {
+ if (dev->header_ops->cache(n, hh, protocol)) {
kfree(hh);
return;
}
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 44d2b42..5cffb63 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -233,9 +233,8 @@ EXPORT_SYMBOL(eth_header_parse);
* @hh: destination cache entry
* Create an Ethernet header template from the neighbour.
*/
-int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh)
+int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type)
{
- __be16 type = hh->hh_type;
struct ethhdr *eth;
const struct net_device *dev = neigh->dev;
--
1.7.6
^ permalink raw reply related
* [PATCH 0/2] Get rid of "multi-hh_cache" capability.
From: David Miller @ 2011-07-13 8:52 UTC (permalink / raw)
To: netdev
We support having multiple hh_cache entries in a list hung off
of a neighbour entry, one per unique ->hh_type protocol value.
Problem is, nobody uses this.
Neighbour entries are for one protocol type only (which determines the
type of the key), whose protocol is "dst_ops->protocol".
Kill all of this noise, which dates back to before Alexey Kuznetsov
added the neighbour layer. He just blinded copied over this
capability into the generic layer.
The next step will be to embed "struct hh_cache" directly into "struct
neighbour". Validity will be indicated by a non-zero hh_len.
Then we can get rid of all of this extra memory allocations, funky
refcounting, and SMP memory barriers.
And finally, move to refcount-less neigh entry usage in ip_finish_output2()
^ permalink raw reply
* [PATCH 4/4] slip: remove dead code within the slip initialization
From: Matvejchikov Ilya @ 2011-07-13 7:47 UTC (permalink / raw)
To: netdev; +Cc: matvejchikov
This following code contains a dead "if (dev).." block:
...
for (i = 0; i < slip_maxdev; i++) {
dev = slip_devs[i];
if (dev == NULL)
break;
}
/* Sorry, too many, all slots in use */
if (i >= slip_maxdev)
return NULL;
if (dev) {
sl = netdev_priv(dev);
if (test_bit(SLF_INUSE, &sl->flags)) {
unregister_netdevice(dev);
dev = NULL;
slip_devs[i] = NULL;
}
}
...
The reason is that the code starting with "if (dev).." is never called as
when we found an empty slot (dev == NULL) we break the loop and "if (dev).."
not works eiter the loop ends and we get out with "i >= slip_maxdev".
Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
---
drivers/net/slip.c | 24 ++++++------------------
1 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index 6f97c59..11c9ab3 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -723,6 +723,7 @@ static void sl_sync(void)
static struct slip *sl_alloc(dev_t line)
{
int i;
+ char name[IFNAMSIZ];
struct net_device *dev = NULL;
struct slip *sl;
@@ -735,25 +736,12 @@ static struct slip *sl_alloc(dev_t line)
if (i >= slip_maxdev)
return NULL;
- if (dev) {
- sl = netdev_priv(dev);
- if (test_bit(SLF_INUSE, &sl->flags)) {
- unregister_netdevice(dev);
- dev = NULL;
- slip_devs[i] = NULL;
- }
- }
-
- if (!dev) {
- char name[IFNAMSIZ];
- sprintf(name, "sl%d", i);
-
- dev = alloc_netdev(sizeof(*sl), name, sl_setup);
- if (!dev)
- return NULL;
- dev->base_addr = i;
- }
+ sprintf(name, "sl%d", i);
+ dev = alloc_netdev(sizeof(*sl), name, sl_setup);
+ if (!dev)
+ return NULL;
+ dev->base_addr = i;
sl = netdev_priv(dev);
/* Initialize channel control data */
--
1.7.6
^ permalink raw reply related
* [PATCH 3/4] slip: remove redundant check slip_devs for NULL
From: Matvejchikov Ilya @ 2011-07-13 7:46 UTC (permalink / raw)
To: netdev; +Cc: matvejchikov
As slip_devs is initialized on module load stage there is no reason to
check it for NULL anywhere instead of the deinitialization routine because
if we can't get enough memory on startup we don't run at all.
Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
---
drivers/net/slip.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index d724d47..6f97c59 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -726,9 +726,6 @@ static struct slip *sl_alloc(dev_t line)
struct net_device *dev = NULL;
struct slip *sl;
- if (slip_devs == NULL)
- return NULL; /* Master array missing ! */
-
for (i = 0; i < slip_maxdev; i++) {
dev = slip_devs[i];
if (dev == NULL)
--
1.7.6
^ permalink raw reply related
* [PATCH 2/4] slip: fix MTU comparation operation when reallocating buffers
From: Matvejchikov Ilya @ 2011-07-13 7:46 UTC (permalink / raw)
To: netdev; +Cc: matvejchikov
In sl_realloc_bufs() there is no reason to check if the requested MTU greater
than or equal to the current MTU value as this function called only
when requested
MTU not equals to the current value. So, the ">=" operation can be
safely replaced
with the ">".
Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
---
drivers/net/slip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index e8c4582..d724d47 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -247,7 +247,7 @@ static int sl_realloc_bufs(struct slip *sl, int mtu)
#else
if (xbuff == NULL || rbuff == NULL) {
#endif
- if (mtu >= sl->mtu) {
+ if (mtu > sl->mtu) {
printk(KERN_WARNING "%s: unable to grow slip buffers, MTU change
cancelled.\n",
dev->name);
err = -ENOBUFS;
--
1.7.6
^ permalink raw reply related
* [PATCH 1/4] slip: remove redundant NULL-pointer check before calling slhc_free
From: Matvejchikov Ilya @ 2011-07-13 7:45 UTC (permalink / raw)
To: netdev; +Cc: matvejchikov
Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
---
drivers/net/slip.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index 8ec1a9a..e8c4582 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -194,8 +194,7 @@ static int sl_alloc_bufs(struct slip *sl, int mtu)
err_exit:
#ifdef SL_INCLUDE_CSLIP
kfree(cbuff);
- if (slcomp)
- slhc_free(slcomp);
+ slhc_free(slcomp);
#endif
kfree(xbuff);
kfree(rbuff);
--
1.7.6
^ permalink raw reply related
* slip-driver cleanups
From: Matvejchikov Ilya @ 2011-07-13 7:43 UTC (permalink / raw)
To: netdev; +Cc: matvejchikov
There are some fixes in slip driver, please review.
^ permalink raw reply
* Re: softirqs are invoked while bottom halves are masked
From: Eric Dumazet @ 2011-07-13 7:38 UTC (permalink / raw)
To: Thomas De Schampheleire
Cc: David Miller, ronny.meeus, linuxppc-dev, netdev, afleming
In-Reply-To: <CAAXf6LXddZUHEz738DDTi-XqENRYT7dTODw+1C4RTYsCdyro7g@mail.gmail.com>
Le mercredi 13 juillet 2011 à 09:20 +0200, Thomas De Schampheleire a
écrit :
> I just want to mention that, although you seem to think that we
> shouldn't have created this thread in the first place, your and Eric's
> remarks have actually helped us in identifying the problem and
> increasing our understanding.
>
Thread was fine IMHO, but should have mentioned the context of "non
standard linux-2.6 or net-next-2.6 trees"
I would like to mention NETIF_F_LLTX existence.
While being marked deprecated, it allows a lockless tx path :
The device transmit handler can then perform custom actions, including
its own locking if needed.
If the user wants a specific Qdisc setup (instead of a no qdisc one), it
still can.
veth, loopback, dummy, macvlan & bond devices use NETIF_F_LLTX for
example.
But ndo_start_xmit() must always be called with BH disabled.
^ permalink raw reply
* Re: softirqs are invoked while bottom halves are masked
From: Thomas De Schampheleire @ 2011-07-13 7:20 UTC (permalink / raw)
To: David Miller; +Cc: ronny.meeus, eric.dumazet, linuxppc-dev, netdev, afleming
In-Reply-To: <20110712.051316.1963034055315982365.davem@davemloft.net>
On Tue, Jul 12, 2011 at 2:13 PM, David Miller <davem@davemloft.net> wrote:
> From: David Miller <davem@davemloft.net>
> Date: Tue, 12 Jul 2011 05:08:17 -0700 (PDT)
>
>> From: Ronny Meeus <ronny.meeus@gmail.com>
>> Date: Tue, 12 Jul 2011 14:03:04 +0200
>>
>>> but we still see the issue "BUG: sleeping function called from invalid context":
>>>
>>> [ 91.015989] BUG: sleeping function called from invalid context at
>>> include/linux/skbuff.h:786
>>> [ 91.117096] in_atomic(): 1, irqs_disabled(): 0, pid: 1865, name: NMTX_T1842
>>> [ 91.200461] Call Trace:
>>> [ 91.229672] [ec58bbd0] [c000789c] show_stack+0x78/0x18c (unreliable)
>>> [ 91.305791] [ec58bc10] [c0022900] __might_sleep+0x100/0x118
>>> [ 91.372524] [ec58bc20] [c029f8d8] dpa_tx+0x128/0x758
>>
>> Because this dpa driver's transmit method is doing something else that
>> is not allowed in software interrupt context.
>>
>> You must remove all things that might sleep in this driver's
>> ->ndo_start_xmit method, and I do mean everything.
>
> Also this whole HW QOS feature bit facility is beyond bogus.
>
> What if the user enables a qdisc that the hardware can't handle, or a
> configuration of a hw supported qdisc that the hardware can't support?
>
> What if I have packet classification and packet actions enabled in the
> packet scheduler?
>
> These changes are terrible, and we really need you guys to sort out
> your problems with these changes yoursleves because your wounds are
> entirely self-inflicted and totally not our problem.
>
Of course, you make very valid points.
I just want to mention that, although you seem to think that we
shouldn't have created this thread in the first place, your and Eric's
remarks have actually helped us in identifying the problem and
increasing our understanding.
So, thanks for that.
Thomas
^ permalink raw reply
* Re: [patch net-next-2.6] net: allow multiple rx_handler registration
From: Jiri Pirko @ 2011-07-13 5:28 UTC (permalink / raw)
To: David Lamparter
Cc: netdev, davem, shemminger, kaber, fubar, eric.dumazet,
nicolas.2p.debian, andy, greearb, mirqus
In-Reply-To: <20110712160330.GC909183@jupiter.n2.diac24.net>
Tue, Jul 12, 2011 at 06:03:30PM CEST, equinox@diac24.net wrote:
>On Tue, Jul 12, 2011 at 05:01:22PM +0200, Jiri Pirko wrote:
>> Tue, Jul 12, 2011 at 04:29:38PM CEST, equinox@diac24.net wrote:
>> >On Tue, Jul 12, 2011 at 03:20:08PM +0200, Jiri Pirko wrote:
>> >> Not possible. See netdev_set_master(). Anyway, before rx_handler was
>> >> introduced, this was possible and no one cared.
>> >
>> >I don't see how this is related. I'm talking about the other end of your
>> >bond. Like for example the 802.3ad capable switch you're bonding to.
>>
>> Well it is related in way that you cannot have one device in br an bond
>> in same time....
>
>Grah, I was looking at our production kernel tree, which doesn't have
>the netdev_set_master calls from the bridging code. Sorry, my fault.
>
>> >> >b) a device having macvlans and being a bond slave
>> >> > -> Fully incompatible. Same as above, packets to the macvlan will end
>> >> > up on other bond member devices.
>
>But case b) is still up & alive, macvlan doesn't use netdev_set_master.
>
>> >> This patch doen't introduce anything new which wasn't possible before
>> >> rx_handler times. Anyway removing bond from using rx_handler as you
>> >> suggested pushes us back.
>> >
>> >I would actually consider this a regression, if the clashing rx_handler
>> >is the only thing that gets bonding an 'exclusive' hold of the device.
>>
>> No regression. Regression it would be if something wouldn't work on same
>> setup. But this is not the case!
>
>Your patch allows a setup (bond+macvlan) that is not only a violation of
>the specification's letters, but will also wreak rather big havoc and
>may cause parts of itself to become non-functioning.
>
>What happens when the user does this?:
> eth0 -> bond0
> -> macvlan0 -> bond1
>
>My complaint is primary centering on the inclusion of bonding code into
>this. There might be bonding modes where this is acceptable, but in
>802.3ad mode this royally breaks things.
Well as I pointed out, this is not a regression. User should not
configure this. And as I said, I plan to cook some follow up patches to
make this configs not possible in future. But anyway, user should be
responsible for his config and if it's wrong he should not expect it to
work. I can imagine a large set of screwed up configs which are not
forbidden. Forbidding all wrong configs is not the right way I think.
>
>> >> And to your idea about multi-bridge support, br co needs to be
>> >> adjusted as well. And in relation with PRIO, my idea (inspired from RFC
>> >> of this patch comments) is to allow users to change priorities
>> >> dynamically from userspace. Also then it could be a range of prios for
>> >> bridge for example.
>> >
>> >Hoping I can convey my point,
>> >
>> >
>> >-David
>> >
>> >
>> >P.S.: Could you please provide some sample usage cases for this feature?
>>
>> Converting vlan to rx_handler needs this at least.
>
>Hm, yes. I guess this patch is needed to pave the way. I uphold my fears
>about including bonding (read: 802.3ad) in this though. Maybe I should
>cook up some code to give 802.3ad an exclusive grip on the slaves?
Sure you can. But I was thinking about some more generic way.
>
>
>-David
^ permalink raw reply
* Re: [PATCH v2] net: Add documentation for netdev features handling
From: David Miller @ 2011-07-13 5:27 UTC (permalink / raw)
To: mirq-linux
Cc: netdev, greearb, shemminger, bhutchings, donald.c.skidmore,
jeffrey.t.kirsher, rdunlap
In-Reply-To: <6c65d5e3927e36cbb356d406494f8b9843523769.1310499566.git.mirq-linux@rere.qmqm.pl>
From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Tue, 12 Jul 2011 21:41:29 +0200 (CEST)
> v2: incorporated suggestions from Randy Dunlap
>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] be2net: move to new vlan model
From: David Miller @ 2011-07-13 5:10 UTC (permalink / raw)
To: ajit.khaparde; +Cc: netdev
In-Reply-To: <20110712230855.GA13833@akhaparde-VBox>
From: Ajit Khaparde <ajit.khaparde@Emulex.Com>
Date: Tue, 12 Jul 2011 18:08:56 -0500
> Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Applied.
^ permalink raw reply
* Re: [PATCH] be2net: account for skb allocation failures
From: David Miller @ 2011-07-13 5:09 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, ajit.khaparde
In-Reply-To: <1310520703.2634.5.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 13 Jul 2011 03:31:43 +0200
> If we cannot allocate new skbs in RX completion handler, we should
> increase netdevice rx_dropped counter, not spam console messages.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Ajit Khaparde <ajit.khaparde@emulex.com>
> ---
> Note: This driver uses u64 fields without proper synch on 32bit arches.
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [net-next 2/2] e1000e: use GFP_KERNEL allocations at init time
From: David Miller @ 2011-07-13 5:08 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, eric.dumazet, greearb, bruce.w.allan
In-Reply-To: <1310523012-25391-2-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 12 Jul 2011 19:10:12 -0700
> In process and sleep allowed context, favor GFP_KERNEL allocations over
> GFP_ATOMIC ones.
>
> -v2: fixed checkpatch.pl warnings
>
> CC: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Ben Greear <greearb@candelatech.com>
> CC: Bruce Allan <bruce.w.allan@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Applied.
^ permalink raw reply
* Re: [net-next 1/2] e1000e: Add Jumbo Frame support to 82583 devices
From: David Miller @ 2011-07-13 5:08 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: carolyn.wyborny, netdev, gospo
In-Reply-To: <1310523012-25391-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 12 Jul 2011 19:10:11 -0700
> From: Carolyn Wyborny <carolyn.wyborny@intel.com>
>
> This patch adds support for the Jumbo Frames feature on 82583 devices.
>
> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* [PATCH net-next v2 1/1] af-packet: fix - avoid reading stale data
From: Chetan Loke @ 2011-07-13 2:47 UTC (permalink / raw)
To: davem, netdev; +Cc: lokechetan, eric.dumazet, Chetan Loke
Currently we flush tp_status and then flush the remainder of the header+payload.
tp_status should be flushed in the end to avoid stale data being read by user-space.
Incorrectly re-ordered barriers in v1.
Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
---
net/packet/af_packet.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index d2294ad..c698cec 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1129,7 +1129,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
else
sll->sll_ifindex = dev->ifindex;
- __packet_set_status(po, h.raw, status);
smp_mb();
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1
{
@@ -1138,8 +1137,10 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
end = (u8 *)PAGE_ALIGN((unsigned long)h.raw + macoff + snaplen);
for (start = h.raw; start < end; start += PAGE_SIZE)
flush_dcache_page(pgv_to_page(start));
+ smp_wmb();
}
#endif
+ __packet_set_status(po, h.raw, status);
sk->sk_data_ready(sk, 0);
--
1.7.5.2
^ permalink raw reply related
* Re: [PATCH net-next 1/1] af-packet: fix - avoid reading stale data
From: chetan loke @ 2011-07-13 2:19 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, netdev, lokechetan
In-Reply-To: <1310522190.2634.8.camel@edumazet-laptop>
On Tue, Jul 12, 2011 at 9:56 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le mardi 12 juillet 2011 à 21:42 -0400, Chetan Loke a écrit :
>> Currently we flush tp_status and then flush the remainder of the header+payload.
>> tp_status should be flushed in the end to avoid stale data being read by user-space.
>>
>>
>> Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
>> ---
>> net/packet/af_packet.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
>> index d2294ad..f7be71f 100644
>> --- a/net/packet/af_packet.c
>> +++ b/net/packet/af_packet.c
>> @@ -1129,8 +1129,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
>> else
>> sll->sll_ifindex = dev->ifindex;
>>
>> - __packet_set_status(po, h.raw, status);
>> - smp_mb();
>> #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1
>> {
>> u8 *start, *end;
>> @@ -1140,6 +1138,8 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
>> flush_dcache_page(pgv_to_page(start));
>> }
>> #endif
>> + smp_mb();
>> + __packet_set_status(po, h.raw, status);
>>
>> sk->sk_data_ready(sk, 0);
>>
>
> Are you sure we can perform the flush_dcache_page() before smp_mb() ?
>
> I believe we should do one smp_wmb() before __packet_set_status() as
> well.
Eric - something like this?
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1
smp_wmb();
#endif
__packet_set_status(po, h.raw, status);
Chetan Loke
^ permalink raw reply
* [net-next 1/2] e1000e: Add Jumbo Frame support to 82583 devices
From: Jeff Kirsher @ 2011-07-13 2:10 UTC (permalink / raw)
To: davem; +Cc: Carolyn Wyborny, netdev, gospo, Jeff Kirsher
From: Carolyn Wyborny <carolyn.wyborny@intel.com>
This patch adds support for the Jumbo Frames feature on 82583 devices.
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e1000e/82571.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index 8295f21..480f259 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -431,8 +431,6 @@ static s32 e1000_get_variants_82571(struct e1000_adapter *adapter)
adapter->flags &= ~FLAG_HAS_WOL;
break;
case e1000_82573:
- case e1000_82574:
- case e1000_82583:
if (pdev->device == E1000_DEV_ID_82573L) {
adapter->flags |= FLAG_HAS_JUMBO_FRAMES;
adapter->max_hw_frame_size = DEFAULT_JUMBO;
@@ -2104,10 +2102,11 @@ struct e1000_info e1000_82583_info = {
| FLAG_RX_CSUM_ENABLED
| FLAG_HAS_SMART_POWER_DOWN
| FLAG_HAS_AMT
+ | FLAG_HAS_JUMBO_FRAMES
| FLAG_HAS_CTRLEXT_ON_LOAD,
.flags2 = FLAG2_DISABLE_ASPM_L0S,
.pba = 32,
- .max_hw_frame_size = ETH_FRAME_LEN + ETH_FCS_LEN,
+ .max_hw_frame_size = DEFAULT_JUMBO,
.get_variants = e1000_get_variants_82571,
.mac_ops = &e82571_mac_ops,
.phy_ops = &e82_phy_ops_bm,
--
1.7.6
^ permalink raw reply related
* [net-next 2/2] e1000e: use GFP_KERNEL allocations at init time
From: Jeff Kirsher @ 2011-07-13 2:10 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, Eric Dumazet, Ben Greear,
Bruce Allan
In-Reply-To: <1310523012-25391-1-git-send-email-jeffrey.t.kirsher@intel.com>
In process and sleep allowed context, favor GFP_KERNEL allocations over
GFP_ATOMIC ones.
-v2: fixed checkpatch.pl warnings
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Ben Greear <greearb@candelatech.com>
CC: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
---
drivers/net/e1000e/e1000.h | 2 +-
drivers/net/e1000e/netdev.c | 37 +++++++++++++++++++++----------------
2 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index e9d6e0a..638d175 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -334,7 +334,7 @@ struct e1000_adapter {
int *work_done, int work_to_do)
____cacheline_aligned_in_smp;
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
- int cleaned_count);
+ int cleaned_count, gfp_t gfp);
struct e1000_ring *rx_ring;
u32 rx_int_delay;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index ed7a93d..4353ad5 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -523,7 +523,7 @@ static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err,
* @adapter: address of board private structure
**/
static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
- int cleaned_count)
+ int cleaned_count, gfp_t gfp)
{
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
@@ -544,7 +544,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
goto map_skb;
}
- skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ skb = __netdev_alloc_skb_ip_align(netdev, bufsz, gfp);
if (!skb) {
/* Better luck next round */
adapter->alloc_rx_buff_failed++;
@@ -589,7 +589,7 @@ map_skb:
* @adapter: address of board private structure
**/
static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
- int cleaned_count)
+ int cleaned_count, gfp_t gfp)
{
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
@@ -615,7 +615,7 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
continue;
}
if (!ps_page->page) {
- ps_page->page = alloc_page(GFP_ATOMIC);
+ ps_page->page = alloc_page(gfp);
if (!ps_page->page) {
adapter->alloc_rx_buff_failed++;
goto no_buffers;
@@ -641,8 +641,9 @@ static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
cpu_to_le64(ps_page->dma);
}
- skb = netdev_alloc_skb_ip_align(netdev,
- adapter->rx_ps_bsize0);
+ skb = __netdev_alloc_skb_ip_align(netdev,
+ adapter->rx_ps_bsize0,
+ gfp);
if (!skb) {
adapter->alloc_rx_buff_failed++;
@@ -692,7 +693,7 @@ no_buffers:
**/
static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
- int cleaned_count)
+ int cleaned_count, gfp_t gfp)
{
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
@@ -713,7 +714,7 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
goto check_page;
}
- skb = netdev_alloc_skb_ip_align(netdev, bufsz);
+ skb = __netdev_alloc_skb_ip_align(netdev, bufsz, gfp);
if (unlikely(!skb)) {
/* Better luck next round */
adapter->alloc_rx_buff_failed++;
@@ -724,7 +725,7 @@ static void e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
check_page:
/* allocate a new page if necessary */
if (!buffer_info->page) {
- buffer_info->page = alloc_page(GFP_ATOMIC);
+ buffer_info->page = alloc_page(gfp);
if (unlikely(!buffer_info->page)) {
adapter->alloc_rx_buff_failed++;
break;
@@ -888,7 +889,8 @@ next_desc:
/* return some buffers to hardware, one at a time is too slow */
if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
- adapter->alloc_rx_buf(adapter, cleaned_count);
+ adapter->alloc_rx_buf(adapter, cleaned_count,
+ GFP_ATOMIC);
cleaned_count = 0;
}
@@ -900,7 +902,7 @@ next_desc:
cleaned_count = e1000_desc_unused(rx_ring);
if (cleaned_count)
- adapter->alloc_rx_buf(adapter, cleaned_count);
+ adapter->alloc_rx_buf(adapter, cleaned_count, GFP_ATOMIC);
adapter->total_rx_bytes += total_rx_bytes;
adapter->total_rx_packets += total_rx_packets;
@@ -1230,7 +1232,8 @@ next_desc:
/* return some buffers to hardware, one at a time is too slow */
if (cleaned_count >= E1000_RX_BUFFER_WRITE) {
- adapter->alloc_rx_buf(adapter, cleaned_count);
+ adapter->alloc_rx_buf(adapter, cleaned_count,
+ GFP_ATOMIC);
cleaned_count = 0;
}
@@ -1244,7 +1247,7 @@ next_desc:
cleaned_count = e1000_desc_unused(rx_ring);
if (cleaned_count)
- adapter->alloc_rx_buf(adapter, cleaned_count);
+ adapter->alloc_rx_buf(adapter, cleaned_count, GFP_ATOMIC);
adapter->total_rx_bytes += total_rx_bytes;
adapter->total_rx_packets += total_rx_packets;
@@ -1411,7 +1414,8 @@ next_desc:
/* return some buffers to hardware, one at a time is too slow */
if (unlikely(cleaned_count >= E1000_RX_BUFFER_WRITE)) {
- adapter->alloc_rx_buf(adapter, cleaned_count);
+ adapter->alloc_rx_buf(adapter, cleaned_count,
+ GFP_ATOMIC);
cleaned_count = 0;
}
@@ -1423,7 +1427,7 @@ next_desc:
cleaned_count = e1000_desc_unused(rx_ring);
if (cleaned_count)
- adapter->alloc_rx_buf(adapter, cleaned_count);
+ adapter->alloc_rx_buf(adapter, cleaned_count, GFP_ATOMIC);
adapter->total_rx_bytes += total_rx_bytes;
adapter->total_rx_packets += total_rx_packets;
@@ -3105,7 +3109,8 @@ static void e1000_configure(struct e1000_adapter *adapter)
e1000_configure_tx(adapter);
e1000_setup_rctl(adapter);
e1000_configure_rx(adapter);
- adapter->alloc_rx_buf(adapter, e1000_desc_unused(adapter->rx_ring));
+ adapter->alloc_rx_buf(adapter, e1000_desc_unused(adapter->rx_ring),
+ GFP_KERNEL);
}
/**
--
1.7.6
^ permalink raw reply related
* Re: [PATCH net-next 1/1] af-packet: fix - avoid reading stale data
From: Eric Dumazet @ 2011-07-13 1:56 UTC (permalink / raw)
To: Chetan Loke; +Cc: davem, netdev, lokechetan
In-Reply-To: <1310521339-1115-1-git-send-email-loke.chetan@gmail.com>
Le mardi 12 juillet 2011 à 21:42 -0400, Chetan Loke a écrit :
> Currently we flush tp_status and then flush the remainder of the header+payload.
> tp_status should be flushed in the end to avoid stale data being read by user-space.
>
>
> Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
> ---
> net/packet/af_packet.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index d2294ad..f7be71f 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -1129,8 +1129,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
> else
> sll->sll_ifindex = dev->ifindex;
>
> - __packet_set_status(po, h.raw, status);
> - smp_mb();
> #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1
> {
> u8 *start, *end;
> @@ -1140,6 +1138,8 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
> flush_dcache_page(pgv_to_page(start));
> }
> #endif
> + smp_mb();
> + __packet_set_status(po, h.raw, status);
>
> sk->sk_data_ready(sk, 0);
>
Are you sure we can perform the flush_dcache_page() before smp_mb() ?
I believe we should do one smp_wmb() before __packet_set_status() as
well.
^ permalink raw reply
* [PATCH net-next 1/1] af-packet: fix - avoid reading stale data
From: Chetan Loke @ 2011-07-13 1:42 UTC (permalink / raw)
To: davem, netdev; +Cc: lokechetan, Chetan Loke
Currently we flush tp_status and then flush the remainder of the header+payload.
tp_status should be flushed in the end to avoid stale data being read by user-space.
Signed-off-by: Chetan Loke <loke.chetan@gmail.com>
---
net/packet/af_packet.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index d2294ad..f7be71f 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1129,8 +1129,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
else
sll->sll_ifindex = dev->ifindex;
- __packet_set_status(po, h.raw, status);
- smp_mb();
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1
{
u8 *start, *end;
@@ -1140,6 +1138,8 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
flush_dcache_page(pgv_to_page(start));
}
#endif
+ smp_mb();
+ __packet_set_status(po, h.raw, status);
sk->sk_data_ready(sk, 0);
--
1.7.5.2
^ permalink raw reply related
* [PATCH] be2net: account for skb allocation failures
From: Eric Dumazet @ 2011-07-13 1:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ajit Khaparde
If we cannot allocate new skbs in RX completion handler, we should
increase netdevice rx_dropped counter, not spam console messages.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Ajit Khaparde <ajit.khaparde@emulex.com>
---
Note: This driver uses u64 fields without proper synch on 32bit arches.
drivers/net/benet/be.h | 1 +
drivers/net/benet/be_ethtool.c | 1 +
drivers/net/benet/be_main.c | 4 ++--
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index 9aa1534..72ec00f 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -199,6 +199,7 @@ struct be_rx_stats {
u32 rx_polls; /* number of times NAPI called poll function */
u32 rx_events; /* number of ucast rx completion events */
u32 rx_compl; /* number of rx completion entries processed */
+ ulong rx_dropped; /* number of skb allocation errors */
ulong rx_jiffies;
u64 rx_bytes;
u64 rx_bytes_prev;
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 30c1386..7fd8130 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -102,6 +102,7 @@ static const struct be_ethtool_stat et_rx_stats[] = {
{DRVSTAT_RX_INFO(rx_compl)},
{DRVSTAT_RX_INFO(rx_mcast_pkts)},
{DRVSTAT_RX_INFO(rx_post_fail)},
+ {DRVSTAT_RX_INFO(rx_dropped)},
{ERXSTAT_INFO(rx_drops_no_fragments)}
};
#define ETHTOOL_RXSTATS_NUM (ARRAY_SIZE(et_rx_stats))
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 4ebd700..f7d6d9d 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -431,6 +431,7 @@ void netdev_stats_update(struct be_adapter *adapter)
pkts += rx_stats(rxo)->rx_pkts;
bytes += rx_stats(rxo)->rx_bytes;
mcast += rx_stats(rxo)->rx_mcast_pkts;
+ drops += rx_stats(rxo)->rx_dropped;
/* no space in linux buffers: best possible approximation */
if (adapter->generation == BE_GEN3) {
if (!(lancer_chip(adapter))) {
@@ -1181,8 +1182,7 @@ static void be_rx_compl_process(struct be_adapter *adapter,
skb = netdev_alloc_skb_ip_align(netdev, BE_HDR_LEN);
if (unlikely(!skb)) {
- if (net_ratelimit())
- dev_warn(&adapter->pdev->dev, "skb alloc failed\n");
+ rxo->stats.rx_dropped++;
be_rx_compl_discard(adapter, rxo, rxcp);
return;
}
^ permalink raw reply related
* [PATCH net-next] be2net: move to new vlan model
From: Ajit Khaparde @ 2011-07-12 23:08 UTC (permalink / raw)
To: davem; +Cc: netdev
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be.h | 1 -
drivers/net/benet/be_main.c | 34 +++++++++-------------------------
2 files changed, 9 insertions(+), 26 deletions(-)
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index 9aa1534..4d93ffb 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -332,7 +332,6 @@ struct be_adapter {
u8 eq_next_idx;
struct be_drv_stats drv_stats;
- struct vlan_group *vlan_grp;
u16 vlans_added;
u16 max_vlans; /* Number of vlans supported */
u8 vlan_tag[VLAN_N_VID];
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 4ebd700..469de79 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -653,7 +653,7 @@ static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1);
}
- if (adapter->vlan_grp && vlan_tx_tag_present(skb)) {
+ if (vlan_tx_tag_present(skb)) {
AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1);
vlan_tag = vlan_tx_tag_get(skb);
vlan_prio = (vlan_tag & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
@@ -846,13 +846,6 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num)
return status;
}
-static void be_vlan_register(struct net_device *netdev, struct vlan_group *grp)
-{
- struct be_adapter *adapter = netdev_priv(netdev);
-
- adapter->vlan_grp = grp;
-}
-
static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
{
struct be_adapter *adapter = netdev_priv(netdev);
@@ -871,7 +864,6 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
struct be_adapter *adapter = netdev_priv(netdev);
adapter->vlans_added--;
- vlan_group_set_device(adapter->vlan_grp, vid, NULL);
if (!be_physfn(adapter))
return;
@@ -1200,16 +1192,10 @@ static void be_rx_compl_process(struct be_adapter *adapter,
skb->rxhash = rxcp->rss_hash;
- if (unlikely(rxcp->vlanf)) {
- if (!adapter->vlan_grp || adapter->vlans_added == 0) {
- kfree_skb(skb);
- return;
- }
- vlan_hwaccel_receive_skb(skb, adapter->vlan_grp,
- rxcp->vlan_tag);
- } else {
- netif_receive_skb(skb);
- }
+ if (unlikely(rxcp->vlanf))
+ __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag);
+
+ netif_receive_skb(skb);
}
/* Process the RX completion indicated by rxcp when GRO is enabled */
@@ -1263,11 +1249,10 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
if (adapter->netdev->features & NETIF_F_RXHASH)
skb->rxhash = rxcp->rss_hash;
- if (likely(!rxcp->vlanf))
- napi_gro_frags(&eq_obj->napi);
- else
- vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp,
- rxcp->vlan_tag);
+ if (unlikely(rxcp->vlanf))
+ __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag);
+
+ napi_gro_frags(&eq_obj->napi);
}
static void be_parse_rx_compl_v1(struct be_adapter *adapter,
@@ -2950,7 +2935,6 @@ static struct net_device_ops be_netdev_ops = {
.ndo_set_mac_address = be_mac_addr_set,
.ndo_change_mtu = be_change_mtu,
.ndo_validate_addr = eth_validate_addr,
- .ndo_vlan_rx_register = be_vlan_register,
.ndo_vlan_rx_add_vid = be_vlan_add_vid,
.ndo_vlan_rx_kill_vid = be_vlan_rem_vid,
.ndo_set_vf_mac = be_set_vf_mac,
--
1.7.4.1
^ permalink raw reply related
* RE: [net-next 5/5] ixgbe: convert to ndo_fix_features
From: Skidmore, Donald C @ 2011-07-12 22:11 UTC (permalink / raw)
To: Michal Miroslaw
Cc: Kirsher, Jeffrey T, davem@davemloft.net, netdev@vger.kernel.org,
gospo@redhat.com
In-Reply-To: <20110712214445.GA14904@rere.qmqm.pl>
>-----Original Message-----
>From: Michal Miroslaw [mailto:mirq-linux@rere.qmqm.pl]
>Sent: Tuesday, July 12, 2011 2:45 PM
>To: Skidmore, Donald C
>Cc: Kirsher, Jeffrey T; davem@davemloft.net; netdev@vger.kernel.org;
>gospo@redhat.com
>Subject: Re: [net-next 5/5] ixgbe: convert to ndo_fix_features
>
>Good to see the idea converging. :) More hints below.
>
>On Tue, Jul 12, 2011 at 02:28:15PM -0700, Skidmore, Donald C wrote:
>[...]
>> The logic in this conditional is a little complex. I believe it would
>> end up looking something like the following:
>>
>> in fix_features:
>>
>> /* Prevent change if not RSC capable or invalid ITR setting */
>> if (data & NETIF_F_LRO)
>
>That's not a fast path - you can drop (data & NETIF_F_LRO) check.
Nice - I was spending too much time looking at the old code didn't notice this.
>
>> if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) {
>> data &= ~NETIF_F_LRO;
>> else if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) &&
>> (adapter->rx_itr_setting != 1 &&
>> adapter->rx_itr_setting > IXGBE_MAX_RSC_INT_RATE))
>{
>> data &= ~NETIF_F_LRO;
>> }
>> }
>
>Same for !(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED). After this
>change,
>you might add a call to netdev_update_features() whenever the second
>part
>of the condition is changed by user and you get correctness all the time
>'for free'.
I like this too and makes much more sense to me. This was a reflection of the original code but really didn't matter since anytime RSC_ENABLED was set the ITR values would have been correct anyway.
>
>> in set_feature:
>>
>> /* Make sure RSC matches LRO, reset if change */
>> if (!!(data & NETIF_F_LRO) !=
>> !!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)) {
>> adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED;
>> switch (adapter->hw.mac.type) {
>> case ixgbe_mac_X540:
>> case ixgbe_mac_82599EB:
>> need_reset = true;
>> break;
>> default:
>> break;
>> }
>> }
>
>Correct. Why would you need IXGBE_FLAG2_RSC_ENABLED now, when it just
>mirrors NETIF_F_LRO?
>
We currently have a lot of checks for the IXGBE_FLAG2_RSC_ENABLED flag all over the code. I bet your next question is why not just using NETIF_F_LRO. :) Well this same code base is used in our source forge driver that has to be backward compatible with older kernels. It might be possible to do the kcompat magic to make it all work out but it won't be trivial and I didn't want to include it in this patch. I had planned on looking at it in the future to see if it was possible/worth doing.
>[...]
>> Thanks again for the clarifications, the netdev-features.txt helped a
>lot too.
>
>Nice to hear (read) that!
>
>Best Regards,
>Michał Mirosław
I'll try to get a patch out soon.
Thanks again,
-Don Skidmore <donald.c.skidmore@intel.com>
^ permalink raw reply
* [IPv6] Why does IPV6_ROUTE_INFO still depends on EXPERIMENTAL?
From: Stefan (metze) Metzmacher @ 2011-07-12 22:03 UTC (permalink / raw)
To: netdev@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
Hi,
I'm wondering why IPV6_ROUTE_INFO still depends on EXPERIMENTAL about
5 years after the initial implementation?
I'm also wondering why IPV6_PRIVACY, IPV6_ROUTER_PREF, IPV6_ROUTE_INFO
are compile time switches at all, while there're runtime switches which
are of
by default.
It would be nice to have more IPv6 features enabled (at compile time) by
default,
so that features can be turned (at runtime) with default distribution
kernels.
Is there a chance get patches accepted, which remove some compile time
switches?
metze
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ 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