* Re: [PATCH net-next 4/7] be2net: code to support tx rate configuration on virtual functions
From: David Miller @ 2010-07-23 19:44 UTC (permalink / raw)
To: ajitk; +Cc: netdev
In-Reply-To: <20100723115201.GA24975@serverengines.com>
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:22:13 +0530
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Applied, but:
> diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
> index 344e062..32ae324 100644
> --- a/drivers/net/benet/be_cmds.c
> +++ b/drivers/net/benet/be_cmds.c
> @@ -1730,3 +1730,37 @@ err:
...
> +err:
> + spin_unlock_bh(&adapter->mcc_lock);
> + return status;
> +}
> +
Adds trailing empty line at EOF, which GIT warns about, so I killed
it when adding this patch to the tree.
^ permalink raw reply
* Re: [PATCH net-next 3/7] be2net: add vlan support for sriov virtual functions
From: David Miller @ 2010-07-23 19:43 UTC (permalink / raw)
To: ajitk; +Cc: netdev
In-Reply-To: <20100723115112.GA24955@serverengines.com>
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:21:22 +0530
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 2/7] be2net: add support to get vf config
From: David Miller @ 2010-07-23 19:43 UTC (permalink / raw)
To: ajitk; +Cc: netdev
In-Reply-To: <20100723115022.GA24909@serverengines.com>
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:20:34 +0530
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 1/7] be2net: change to call pmac_del only if necessary
From: David Miller @ 2010-07-23 19:43 UTC (permalink / raw)
To: ajitk; +Cc: netdev
In-Reply-To: <20100723114850.GA24854@serverengines.com>
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:19:04 +0530
> If a mac address has not been configured for a VF,
> there is no need to call be_cmd_pmac_del.
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 5/7] be2net: supress printing error when mac query fails for VF
From: David Miller @ 2010-07-23 19:38 UTC (permalink / raw)
To: ajitk; +Cc: netdev
In-Reply-To: <20100723120008.GA24995@serverengines.com>
From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:30:24 +0530
> - } else if (compl_status != MCC_STATUS_NOT_SUPPORTED) {
> + } else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) &&
> + (compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) {
I'll fix up this formatting when applying this patch but please be mindful
of this in the future, it should look like:
} else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) &&
(compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) {
^ permalink raw reply
* Re: [patch 0/8] s390: qeth some more patches for 2.6.36
From: David Miller @ 2010-07-23 19:36 UTC (permalink / raw)
To: frank.blaschka; +Cc: netdev, linux-s390
In-Reply-To: <20100723091502.678949000@de.ibm.com>
From: frank.blaschka@de.ibm.com
Date: Fri, 23 Jul 2010 11:15:02 +0200
> this is the second patch set (qeth + 1 claw) for 2.6.36 (net-next).
All applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [PATCH] bonding: set device in RLB ARP packet handler
From: Andy Gospodarek @ 2010-07-23 19:34 UTC (permalink / raw)
To: Greg Edwards; +Cc: Jay Vosburgh, bonding-devel, linux-kernel, netdev
On Thu, Jul 22, 2010 at 3:52 PM, Greg Edwards <greg.edwards@hp.com> wrote:
> With commit 6146b1a4, the dev field in the RLB ARP packet handler was
> set to NULL to wildcard and accommodate balancing VLANs on top of
> bonds.
>
> This has the side-effect of the packet handler being called against
> other, non RLB-enabled bonds, and a kernel oops results when it tries
> to
> dereference rx_hashtbl in rlb_update_entry_from_arp(), which won't be
> set for those bonds, e.g. active-backup.
>
> With the __netif_receive_skb() changes from commit 1f3c8804, frames
> received on VLANs correctly make their way to the bond's handler,
> so we no longer need to wildcard the device.
>
I see this problem as well, but I would propose to fix it another way to
not alter the receive path so close to the release of 2.6.35 and to
catch this for 802.3ad bonds as well.
> Signed-off-by: Greg Edwards <greg.edwards@hp.com>
> ---
> Jay,
>
> The oops can be reproduced by:
>
> modprobe bonding
>
> echo active-backup > /sys/class/net/bond0/bonding/mode
> echo 100 > /sys/class/net/bond0/bonding/miimon
> ifconfig bond0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
> echo +eth0 > /sys/class/net/bond0/bonding/slaves
> echo +eth1 > /sys/class/net/bond0/bonding/slaves
>
> echo +bond1 > /sys/class/net/bonding_masters
> echo balance-alb > /sys/class/net/bond1/bonding/mode
> echo 100 > /sys/class/net/bond1/bonding/miimon
> ifconfig bond1 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx
> echo +eth2 > /sys/class/net/bond1/bonding/slaves
> echo +eth3 > /sys/class/net/bond1/bonding/slaves
>
> Pass some traffic on bond0. Boom.
>
bonding: make sure mode-specific handlers handle appropriate frames
This patch will exit out of rlb_arp_recv and bond_3ad_lacpdu_recv early
if the bond receiving the frame isn't using that mode.
Fixes problem reported by Greg Edwards <greg.edwards@hp.com>.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
drivers/net/bonding/bond_3ad.c | 3 ++-
drivers/net/bonding/bond_alb.c | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 822f586..cf7b08d 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2463,7 +2463,8 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac
struct slave *slave = NULL;
int ret = NET_RX_DROP;
- if (!(dev->flags & IFF_MASTER))
+ if (!(dev->flags & IFF_MASTER) ||
+ (bond->params.mode != BOND_MODE_8023AD))
goto out;
read_lock(&bond->lock);
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index df48307..a82e38c 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -353,7 +353,7 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct packet_type *ptype, struct net_device *orig_dev)
{
- struct bonding *bond;
+ struct bonding *bond = netdev_priv(bond_dev);
struct arp_pkt *arp = (struct arp_pkt *)skb->data;
int res = NET_RX_DROP;
@@ -361,7 +361,8 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
bond_dev = vlan_dev_real_dev(bond_dev);
if (!(bond_dev->priv_flags & IFF_BONDING) ||
- !(bond_dev->flags & IFF_MASTER))
+ !(bond_dev->flags & IFF_MASTER) ||
+ (bond->params.mode != BOND_MODE_ALB))
goto out;
if (!arp) {
@@ -376,7 +377,6 @@ static int rlb_arp_recv(struct sk_buff *skb, struct net_device *bond_dev, struct
if (arp->op_code == htons(ARPOP_REPLY)) {
/* update rx hash table for this ARP */
- bond = netdev_priv(bond_dev);
rlb_update_entry_from_arp(bond, arp);
pr_debug("Server received an ARP Reply from client\n");
}
--
1.6.2.5
^ permalink raw reply related
* Re: [PATCH] iproute2: use int instead of long for RTAX_HOPLIMIT compare
From: David Miller @ 2010-07-23 19:16 UTC (permalink / raw)
To: shemminger; +Cc: uweber, netdev
In-Reply-To: <20100723090139.346b6cca@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 23 Jul 2010 09:01:39 -0700
> All applied
Please update patchwork, and in the future please do so before emailing
the submitter that the patch is applied.
Patches assigned to you tend to just pile up, defeating the whole purpose
of using patchwork.
If you really don't want to stay on top of this and actually use the
tool, just let me know and I'll just toss all the patches that come
into the netdev group for iproute2.
This is about the 4th or 5th time I've brought this issue up with you.
I know you might find this hard to believe, but it will be less work
for you if the first thing you do as iproute2 maintainer every day is
open up the patchwork web page and scan the incoming patches and
process them, instead of hitting them via the mailing list first. :-)
^ permalink raw reply
* Re: [PATCH 6/6] pcmcia: remove cs_types.h
From: David Miller @ 2010-07-23 18:48 UTC (permalink / raw)
To: linux
Cc: linux-pcmcia, netdev, linux-wireless, linux-ide, linux-usb,
laforge, linux-mtd, linux-bluetooth, alsa-devel, linux-serial
In-Reply-To: <1279874305-21191-6-git-send-email-linux@dominikbrodowski.net>
From: Dominik Brodowski <linux@dominikbrodowski.net>
Date: Fri, 23 Jul 2010 10:38:25 +0200
> Remove cs_types.h which is no longer needed: Most definitions aren't
> used at all, a few can be made away with, and two remaining definitions
> (typedefs, unfortunatley) may be moved to more specific places.
>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH iptables] extension: add xt_cpu match
From: Jan Engelhardt @ 2010-07-23 17:53 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Patrick McHardy, Netfilter Development Mailinglist, netdev
In-Reply-To: <1279906219.2481.94.camel@edumazet-laptop>
On Friday 2010-07-23 19:30, Eric Dumazet wrote:
>> >+
>> >+static const struct option cpu_opts[] = {
>> >+ { "cpu", 1, NULL, '1' },
>> >+ { .name = NULL }
>> >+};
>>
>> I will never understand that sort of style mix logic. Why the
>> C99 initializer only on the sentinel?
>>
>> {
>> {.name = "cpu", .has_arg = true, .val = '1'},
>> {NULL},
>> };
>>
>
>copy/paste from another module ?
>
>
>> >diff --git a/extensions/libxt_cpu.man b/extensions/libxt_cpu.man
>> >index e69de29..f42ac7a 100644
>> >--- a/extensions/libxt_cpu.man
>> >+++ b/extensions/libxt_cpu.man
>> >@@ -0,0 +1,16 @@
>> >+.TP
>> >+[\fB!\fP] \fB\-\-cpu\fP \fInumber\fP
>> >+
>> >+Match cpu handling this packet. cpus are numbered from 0 to NR_CPUS-1
>>
>> Unwanted blank line.
>>
>> >+Can be used in combination with RPS (Remote Packet Steering) or
>> >+multiqueue NICS to spread network traffic on different queues.
>> >+.PP
>> >+Example:
>> >+.PP
>> >+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 0
>> >+ \-j REDIRECT \-\-to\-port 8080
>>
>> Unwanted indent.
>>
>> >+.PP
>> >+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 1
>> >+ \-j REDIRECT \-\-to\-port 8081
>> >+.PP
>> >+Available since linux 2.6.36
>>
>> Linux.
>
>
>OK ;)
>
>I'll provide a cleanup patch, not only to xt_cpu but all other iptables
>modules that dont meet your coding style requirements ;)
Well nah I'm already on it myself, given Patrick has already imported the
patches.
^ permalink raw reply
* Re: [PATCH iptables] extension: add xt_cpu match
From: Eric Dumazet @ 2010-07-23 17:30 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Patrick McHardy, Netfilter Development Mailinglist, netdev
In-Reply-To: <alpine.LSU.2.01.1007231841500.2880@obet.zrqbmnf.qr>
Le vendredi 23 juillet 2010 à 18:46 +0200, Jan Engelhardt a écrit :
> On Friday 2010-07-23 15:43, Eric Dumazet wrote:
> >+
> >+static const struct option cpu_opts[] = {
> >+ { "cpu", 1, NULL, '1' },
> >+ { .name = NULL }
> >+};
>
> I will never understand that sort of style mix logic. Why the
> C99 initializer only on the sentinel?
>
> {
> {.name = "cpu", .has_arg = true, .val = '1'},
> {NULL},
> };
>
copy/paste from another module ?
> >+cpu_print(const void *ip, const struct xt_entry_match *match, int numeric)
> >+{
> >+ const struct xt_cpu_info *info = (void *)match->data;
> >+
> >+ printf("cpu %s%u ", info->invert ? "! ":"", info->cpu);
> >+}
> >+
> >+static void cpu_save(const void *ip, const struct xt_entry_match *match)
> >+{
> >+ const struct xt_cpu_info *info = (void *)match->data;
> >+
> >+ printf("%s--cpu %u ", info->invert ? "! ":"", info->cpu);
> >+}
>
> Using if (info->invert) would save the empty string.
>
Not sure what you mean. You want to save an empty string (1 byte long),
and add multiple printf() calls ?
> >diff --git a/extensions/libxt_cpu.man b/extensions/libxt_cpu.man
> >index e69de29..f42ac7a 100644
> >--- a/extensions/libxt_cpu.man
> >+++ b/extensions/libxt_cpu.man
> >@@ -0,0 +1,16 @@
> >+.TP
> >+[\fB!\fP] \fB\-\-cpu\fP \fInumber\fP
> >+
> >+Match cpu handling this packet. cpus are numbered from 0 to NR_CPUS-1
>
> Unwanted blank line.
>
> >+Can be used in combination with RPS (Remote Packet Steering) or
> >+multiqueue NICS to spread network traffic on different queues.
> >+.PP
> >+Example:
> >+.PP
> >+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 0
> >+ \-j REDIRECT \-\-to\-port 8080
>
> Unwanted indent.
>
> >+.PP
> >+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 1
> >+ \-j REDIRECT \-\-to\-port 8081
> >+.PP
> >+Available since linux 2.6.36
>
> Linux.
OK ;)
I'll provide a cleanup patch, not only to xt_cpu but all other iptables
modules that dont meet your coding style requirements ;)
Thanks
--
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: IPv6 Anycast?
From: Stuart Sheldon @ 2010-07-23 16:54 UTC (permalink / raw)
To: Ulrich Weber; +Cc: Mikael Abrahamsson, netdev, Stuart Sheldon
In-Reply-To: <4C49C352.6010701@astaro.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi Ulrich,
Thanks, that resolves half the issue. So as of right now, there is no
userspace program to add anycast addresses?
Thanks in advance,
Stu Sheldon
ACT USA
Ulrich Weber wrote:
> Hi Stuart,
>
> you probably mean the IPV6_JOIN_ANYCAST/IPV6_LEAVE_ANYCAST socket option
> support? See the old patch documentation:
> http://lkml.indiana.edu/hypermail/linux/net/0208.3/0028.html
>
> To remove the automatic generated IPv6 Anycast addresses, you can remove
> the routes from the local table manually:
> ip -6 route del 2607:ff38:: table local
>
> Best regards
> Ulrich
>
- --
Hey nineteen Thats retha franklin, She dont remember The queen of soul,
Its hard times befallen The sole survivors, She thinks Im crazy,
But Im just growing old
-- Steely Dan - "Hey 19 - Lyrics"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iQIcBAEBCAAGBQJMSckqAAoJEFKVLITDJSGSHlEP+QHx5MZugq8US0Q5K8EwWvKM
3eOaELHz7tdNT6R3YJ1h5evcmPkj8iG8HDA65BjOghsUavZczSsZtC85azJ6lTaP
lBJdJRiyQa1b9HjnLgu4zGbRWfPyYzLstwvfWUkV7SrrWzAen7HnaMy/0+vRgOb1
MDncta1DzFjJrEwKao1qT/LbN7VVSR7BGAAlhDaJSczEfo0xXRuxpVvHEG+MHT0c
EIufckWjJ9TiaYyPALldtFOdEkmS9sqZ2ryMkgrCrL7AiuqqHhTWJgywTrCZk+1O
YPy9jZGiMd7vC1u3L34ZRDT30F6bF9LrYcwk+qM0fFPbjdjDrWhIz//G67azADeJ
Z/B9KX3UgbRt+tpjDefIR4aGX2sy2YwBNz4mPrM/eq+VGp4ATayFxs4+g5Y7kbFz
a5IsnXoqTPpyeJ3dcSVQQxXB00SA2TCc167RgN4xDFu+7ZEoUM9Bbsun8KT2BywE
LnNwnRlRmlCq9MZ31Hc+3nwpeW/+kS9xnK7GmwdRhDBLskuiQZbYdsU+t4ouga0m
ylhnVQkj7cx0l9SQLUWNwz541MOY5+/tUSZNr3n7Tjyp8J7jf1v0oj2l9BqIDBRY
EW8kfHM9QF5z79jBMTgEBPeJtZYpiN/xjToGo+Xs3RZLM0ZffCWQqpE8Sre3ZdiM
6XAaGjSwTRzmYYpblhe6
=ZWuG
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH iptables] extension: add xt_cpu match
From: Jan Engelhardt @ 2010-07-23 16:46 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Patrick McHardy, Netfilter Development Mailinglist, netdev
In-Reply-To: <1279892621.2481.53.camel@edumazet-laptop>
On Friday 2010-07-23 15:43, Eric Dumazet wrote:
>+
>+static const struct option cpu_opts[] = {
>+ { "cpu", 1, NULL, '1' },
>+ { .name = NULL }
>+};
I will never understand that sort of style mix logic. Why the
C99 initializer only on the sentinel?
{
{.name = "cpu", .has_arg = true, .val = '1'},
{NULL},
};
>+cpu_print(const void *ip, const struct xt_entry_match *match, int numeric)
>+{
>+ const struct xt_cpu_info *info = (void *)match->data;
>+
>+ printf("cpu %s%u ", info->invert ? "! ":"", info->cpu);
>+}
>+
>+static void cpu_save(const void *ip, const struct xt_entry_match *match)
>+{
>+ const struct xt_cpu_info *info = (void *)match->data;
>+
>+ printf("%s--cpu %u ", info->invert ? "! ":"", info->cpu);
>+}
Using if (info->invert) would save the empty string.
>diff --git a/extensions/libxt_cpu.man b/extensions/libxt_cpu.man
>index e69de29..f42ac7a 100644
>--- a/extensions/libxt_cpu.man
>+++ b/extensions/libxt_cpu.man
>@@ -0,0 +1,16 @@
>+.TP
>+[\fB!\fP] \fB\-\-cpu\fP \fInumber\fP
>+
>+Match cpu handling this packet. cpus are numbered from 0 to NR_CPUS-1
Unwanted blank line.
>+Can be used in combination with RPS (Remote Packet Steering) or
>+multiqueue NICS to spread network traffic on different queues.
>+.PP
>+Example:
>+.PP
>+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 0
>+ \-j REDIRECT \-\-to\-port 8080
Unwanted indent.
>+.PP
>+iptables \-t nat \-A PREROUTING \-p tcp \-\-dport 80 \-m cpu \-\-cpu 1
>+ \-j REDIRECT \-\-to\-port 8081
>+.PP
>+Available since linux 2.6.36
Linux.
^ permalink raw reply
* [PATCH] net: 3c59x: fix leak of iomaps
From: Kulikov Vasiliy @ 2010-07-23 16:44 UTC (permalink / raw)
To: kernel-janitors
Cc: Steffen Klassert, David S. Miller, Eric Dumazet, Ben Hutchings,
Alexey Dobriyan, Joe Perches, netdev
If vortex_probe1() fails we should unmap ioaddr mapped earlier.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/net/3c59x.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 9b137e1..ebd4c19 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -1029,6 +1029,7 @@ static int __devinit vortex_init_one(struct pci_dev *pdev,
rc = vortex_probe1(&pdev->dev, ioaddr, pdev->irq,
ent->driver_data, unit);
if (rc < 0) {
+ pci_iounmap(pdev, ioaddr);
pci_disable_device(pdev);
goto out;
}
--
1.7.0.4
^ permalink raw reply related
* Re: IPv6 Anycast?
From: Ulrich Weber @ 2010-07-23 16:29 UTC (permalink / raw)
To: Stuart Sheldon; +Cc: Mikael Abrahamsson, netdev
In-Reply-To: <4C49B163.8090400@actusa.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Stuart,
you probably mean the IPV6_JOIN_ANYCAST/IPV6_LEAVE_ANYCAST socket option
support? See the old patch documentation:
http://lkml.indiana.edu/hypermail/linux/net/0208.3/0028.html
To remove the automatic generated IPv6 Anycast addresses, you can remove
the routes from the local table manually:
ip -6 route del 2607:ff38:: table local
Best regards
Ulrich
- --
Ulrich Weber | uweber@astaro.com | Software Engineer
Astaro GmbH & Co. KG | www.astaro.com | Phone +49-721-25516-0 | Fax –200
An der RaumFabrik 33a | 76227 Karlsruhe | Germany
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkxJw1IACgkQ22t2oTuElzpt9ACfYR7cZ2tWRb9kVuvTl3d8nbkn
oCUAmwVQYjBJ9a35yA/UyJdLeti8cNWK
=UDP7
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH] ip6tables: use skb->len for accounting
From: Jan Engelhardt @ 2010-07-23 16:40 UTC (permalink / raw)
To: Changli Gao
Cc: Patrick McHardy, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris, Hideaki YOSHIFUJI,
netfilter-devel, netdev
In-Reply-To: <AANLkTi=PAVfcX4ttUsSgm+A_WMYcfXt4FLvYunccgtjS@mail.gmail.com>
On Friday 2010-07-23 15:05, Changli Gao wrote:
>On Fri, Jul 23, 2010 at 7:48 PM, Patrick McHardy <kaber@trash.net> wrote:
>> On 23.07.2010 08:38, Changli Gao wrote:
>>>
>>> For the packets received, ip_rcv, ipv6_rcv and bridge all call
>>> pskb_trim_rcsum before feeding them to netfilter. The raw packets are
>>> sent via dev_queue_xmit(), and they don't pass through the output path
>>> of netfilter.
>>
>> That's not true, raw packets also pass through netfilter. However
>> I agree that this patch makes sense to properly deal with jumbo
>> frames, but you should also update xt_length for consistency.
>>
>
>In order to support jumbo frames, we have to change the type of min
>and max in xt_length_info to u32. I'll change xt_match.revision to 1,
>do I need to support the current revision 0 at the same time?
This is all already handled by xt_length.2. But alas, merge has been
declined so far.
^ permalink raw reply
* [PATCH] net: s2io: fix buffer overflow
From: Kulikov Vasiliy @ 2010-07-23 16:36 UTC (permalink / raw)
To: kernel-janitors
Cc: Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur,
Jon Mason, David S. Miller, Joe Perches, Jiri Pirko, netdev
vpd_data[] is allocated as kmalloc(256, GFP_KERNEL), so if cnt = 255
then (cnt + 3) overflows 256. memset() is executed without checking.
vpd_data[cnt+2] must be less than 256-cnt-2 as the latter is number of
vpd_data[] elements to copy.
Do not fill with zero the beginning of nic->serial_num as it will
be filled with vpd_data[].
String in product_name[] should be terminated by '\0'.
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
drivers/net/s2io.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index b8b8584..18bc5b7 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -5796,7 +5796,7 @@ static void s2io_vpd_read(struct s2io_nic *nic)
{
u8 *vpd_data;
u8 data;
- int i = 0, cnt, fail = 0;
+ int i = 0, cnt, len, fail = 0;
int vpd_addr = 0x80;
struct swStat *swstats = &nic->mac_control.stats_info->sw_stat;
@@ -5837,20 +5837,28 @@ static void s2io_vpd_read(struct s2io_nic *nic)
if (!fail) {
/* read serial number of adapter */
- for (cnt = 0; cnt < 256; cnt++) {
+ for (cnt = 0; cnt < 252; cnt++) {
if ((vpd_data[cnt] == 'S') &&
- (vpd_data[cnt+1] == 'N') &&
- (vpd_data[cnt+2] < VPD_STRING_LEN)) {
- memset(nic->serial_num, 0, VPD_STRING_LEN);
- memcpy(nic->serial_num, &vpd_data[cnt + 3],
- vpd_data[cnt+2]);
- break;
+ (vpd_data[cnt+1] == 'N')) {
+ len = vpd_data[cnt+2];
+ if (len < min(VPD_STRING_LEN, 256-cnt-2)) {
+ memcpy(nic->serial_num,
+ &vpd_data[cnt + 3],
+ len);
+ memset(nic->serial_num+len,
+ 0,
+ VPD_STRING_LEN-len);
+ break;
+ }
}
}
}
- if ((!fail) && (vpd_data[1] < VPD_STRING_LEN))
- memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);
+ if ((!fail) && (vpd_data[1] < VPD_STRING_LEN)) {
+ len = vpd_data[1];
+ memcpy(nic->product_name, &vpd_data[3], len);
+ nic->product_name[len] = 0;
+ }
kfree(vpd_data);
swstats->mem_freed += 256;
}
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH net-next] sysfs: add entry to indicate network interfaces with random MAC address
From: Casey Leedom @ 2010-07-23 16:35 UTC (permalink / raw)
To: Stefan Assmann
Cc: Rose, Gregory V, David Miller, shemminger, andy, harald,
bhutchings, netdev, linux-kernel, gospo, Duyck, Alexander H
In-Reply-To: <4C494DEE.3010101@redhat.com>
| From: Stefan Assmann <sassmann@redhat.com>
| Date: Friday, July 23, 2010 01:08 am
|
| On 23.07.2010 02:26, Casey Leedom wrote:
| > Or you simply don't have the VF Driver loaded in the "Domain 0" Control
| > OS. When we install the cxgb4 PF Driver with "num_vf=..." this enables
| > the PCI-E SR-IOV Capabilities within the various PFs and the
| > corresponding VF PCI Devices are instantiated and discovered by the
| > Domain 0 Linux OS. But without a cxgb4vf VF Driver loaded, those
| > devices just sit there available for "Device Assignment" to VMs.
|
| Just out of curiosity, how do you prevent the VF driver from getting
| loaded in the host? Except from blacklisting it.
I don't install them. :-)
I'm actually fairly unfamiliar with the details of managing/administering
Linux systems so I'm guessing that there are much better ways of controlling for
which devices a Linux system will attempt to load drivers. For instance, I
didn't know about the concept of "blacklisting" a driver.
Casey
^ permalink raw reply
* Re: [patch -next v2] mv643xx_eth: potential null dereference
From: walter harms @ 2010-07-23 16:30 UTC (permalink / raw)
To: Dan Carpenter
Cc: Joe Perches, Lennert Buytenhek, David S. Miller, Jiri Pirko,
Denis Kirjanov, Saeed Bishara, netdev, kernel-janitors
In-Reply-To: <20100723110504.GG26313@bicker>
Dan Carpenter schrieb:
> We assume that "pd" can be null on the previous line, and throughout the
> function so we should check it here as well. This was introduced by
> 9b2c2ff7a1c0 "mv643xx_eth: use sw csum for big packets"
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> v2: style change
>
> diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
> index 73bb8ea..f5e72fe 100644
> --- a/drivers/net/mv643xx_eth.c
> +++ b/drivers/net/mv643xx_eth.c
> @@ -2670,7 +2670,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
> * Detect hardware parameters.
> */
> msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000;
> - msp->tx_csum_limit = pd->tx_csum_limit ? pd->tx_csum_limit : 9 * 1024;
> + msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
> + pd->tx_csum_limit : 9 * 1024;
> infer_hw_params(msp);
>
> platform_set_drvdata(pdev, msp);
this is a bit complicated, IMHO ppl have a bigger chance to discover what is going on
with this version:
if (!pd ) {
msp->t_clk = 133000000;
msp->tx_csum_limit = 9 * 1024;
}
else
{
msp->t_clk = pd->t_clk ? pd->t_clk : 133000000 ;
msp->tx_csum_limit = pd->tx_csum_limit ? pd->tx_csum_limit : 9 * 1024;
}
re,
wh
^ permalink raw reply
* Re: [iproute2] iproute2: Fix batch-mode for mrules.
From: Ben Greear @ 2010-07-23 16:09 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20100723090327.2af5ad1f@nehalam>
On 07/23/2010 09:03 AM, Stephen Hemminger wrote:
> On Thu, 15 Jul 2010 15:48:10 -0700
> Ben Greear<greearb@candelatech.com> wrote:
>
>> The do_multirule logic was broken in batch mode because
>> it expected the preferred_family to be AF_INET or AF_INET6,
>> but it then assigned it to RTNL_FAMILY_IPMR or RTNL_FAMILY_IP6MR.
>> So, the next iteration of the batch processing, it failed
>> the check for AF_INET or AF_INET6.
>>
>> Signed-off-by: Ben Greear<greearb@candelatech.com>
>> ---
>> :100644 100644 9c8c6ef... d3b97e2... M ip/iprule.c
>> ip/iprule.c | 6 +++++-
>> 1 files changed, 5 insertions(+), 1 deletions(-)
>>
>> diff --git a/ip/iprule.c b/ip/iprule.c
>> index 9c8c6ef..d3b97e2 100644
>> --- a/ip/iprule.c
>> +++ b/ip/iprule.c
>> @@ -446,8 +446,12 @@ int do_multirule(int argc, char **argv)
>> case AF_INET6:
>> preferred_family = RTNL_FAMILY_IP6MR;
>> break;
>> + case RTNL_FAMILY_IPMR:
>> + case RTNL_FAMILY_IP6MR:
>> + break;
>> default:
>> - fprintf(stderr, "Multicast rules are only supported for IPv4/IPv6\n");
>> + fprintf(stderr, "Multicast rules are only supported for IPv4/IPv6, was: %i\n",
>> + preferred_family);
>> exit(-1);
>> }
>>
>
> Applied
Thanks. I recently realized this patch is not quite enough
for full flexibility.
It does help the case where you have 'normal' cmds followed by
mrule commands, but it doesn't fix the case where you have 'normal' commands
after the mrule commands.
I was thinking maybe we should pass the preferred_family in as an argument
to the method(s) instead of twiddling the global value?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [iproute2] iproute2: Fix batch-mode for mrules.
From: Stephen Hemminger @ 2010-07-23 16:03 UTC (permalink / raw)
To: Ben Greear; +Cc: netdev
In-Reply-To: <1279234090-18624-1-git-send-email-greearb@candelatech.com>
On Thu, 15 Jul 2010 15:48:10 -0700
Ben Greear <greearb@candelatech.com> wrote:
> The do_multirule logic was broken in batch mode because
> it expected the preferred_family to be AF_INET or AF_INET6,
> but it then assigned it to RTNL_FAMILY_IPMR or RTNL_FAMILY_IP6MR.
> So, the next iteration of the batch processing, it failed
> the check for AF_INET or AF_INET6.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 9c8c6ef... d3b97e2... M ip/iprule.c
> ip/iprule.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/ip/iprule.c b/ip/iprule.c
> index 9c8c6ef..d3b97e2 100644
> --- a/ip/iprule.c
> +++ b/ip/iprule.c
> @@ -446,8 +446,12 @@ int do_multirule(int argc, char **argv)
> case AF_INET6:
> preferred_family = RTNL_FAMILY_IP6MR;
> break;
> + case RTNL_FAMILY_IPMR:
> + case RTNL_FAMILY_IP6MR:
> + break;
> default:
> - fprintf(stderr, "Multicast rules are only supported for IPv4/IPv6\n");
> + fprintf(stderr, "Multicast rules are only supported for IPv4/IPv6, was: %i\n",
> + preferred_family);
> exit(-1);
> }
>
Applied
--
^ permalink raw reply
* Re: [PATCH] iproute2: use int instead of long for RTAX_HOPLIMIT compare
From: Stephen Hemminger @ 2010-07-23 16:01 UTC (permalink / raw)
To: Ulrich Weber; +Cc: netdev
In-Reply-To: <20100723133910.GC12942@babylon>
On Fri, 23 Jul 2010 15:39:10 +0200
Ulrich Weber <uweber@astaro.com> wrote:
> otherwise "if ((int)val == -1)" will never match on 64 bit systems
>
> Signed-off-by: Ulrich Weber <uweber@astaro.com>
> ---
> ip/iproute.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/ip/iproute.c b/ip/iproute.c
> index 04b253a..711576e 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -494,7 +494,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
> val = *(unsigned*)RTA_DATA(mxrta[i]);
> switch (i) {
> case RTAX_HOPLIMIT:
> - if ((long)val == -1)
> + if ((int)val == -1)
> val = 0;
> /* fall through */
> default:
All applied
--
^ permalink raw reply
* Re: [PATCH 6/6] pcmcia: remove cs_types.h
From: Marcel Holtmann @ 2010-07-23 15:28 UTC (permalink / raw)
To: Dominik Brodowski
Cc: linux-pcmcia, netdev, linux-wireless, linux-ide, linux-usb,
laforge, linux-mtd, linux-bluetooth, alsa-devel, linux-serial
In-Reply-To: <1279874305-21191-6-git-send-email-linux@dominikbrodowski.net>
Hi Dominik,
> Remove cs_types.h which is no longer needed: Most definitions aren't
> used at all, a few can be made away with, and two remaining definitions
> (typedefs, unfortunatley) may be moved to more specific places.
>
> CC: netdev@vger.kernel.org
> CC: linux-wireless@vger.kernel.org
> CC: linux-ide@vger.kernel.org
> CC: linux-usb@vger.kernel.org
> CC: laforge@gnumonks.org
> CC: linux-mtd@lists.infradead.org
> CC: linux-bluetooth@vger.kernel.org
> CC: alsa-devel@alsa-project.org
> CC: linux-serial@vger.kernel.org
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> ---
> Documentation/pcmcia/driver-changes.txt | 5 +++
> drivers/ata/pata_pcmcia.c | 1 -
> drivers/bluetooth/bluecard_cs.c | 1 -
> drivers/bluetooth/bt3c_cs.c | 1 -
> drivers/bluetooth/btuart_cs.c | 1 -
> drivers/bluetooth/dtl1_cs.c | 1 -
> drivers/char/pcmcia/cm4000_cs.c | 1 -
> drivers/char/pcmcia/cm4040_cs.c | 1 -
> drivers/char/pcmcia/ipwireless/main.h | 1 -
> drivers/char/pcmcia/ipwireless/tty.h | 1 -
> drivers/char/pcmcia/synclink_cs.c | 1 -
> drivers/ide/ide-cs.c | 1 -
> drivers/isdn/hardware/avm/avm_cs.c | 1 -
> drivers/isdn/hisax/avma1_cs.c | 1 -
> drivers/isdn/hisax/elsa_cs.c | 1 -
> drivers/isdn/hisax/sedlbauer_cs.c | 1 -
> drivers/isdn/hisax/teles_cs.c | 1 -
> drivers/mmc/host/sdricoh_cs.c | 1 -
> drivers/mtd/maps/pcmciamtd.c | 1 -
> drivers/net/pcmcia/3c574_cs.c | 1 -
> drivers/net/pcmcia/3c589_cs.c | 1 -
> drivers/net/pcmcia/axnet_cs.c | 1 -
> drivers/net/pcmcia/com20020_cs.c | 1 -
> drivers/net/pcmcia/fmvj18x_cs.c | 1 -
> drivers/net/pcmcia/ibmtr_cs.c | 1 -
> drivers/net/pcmcia/nmclan_cs.c | 1 -
> drivers/net/pcmcia/pcnet_cs.c | 5 +--
> drivers/net/pcmcia/smc91c92_cs.c | 1 -
> drivers/net/pcmcia/xirc2ps_cs.c | 1 -
> drivers/net/wireless/airo_cs.c | 1 -
> drivers/net/wireless/atmel_cs.c | 1 -
> drivers/net/wireless/b43/pcmcia.c | 1 -
> drivers/net/wireless/hostap/hostap_cs.c | 3 +-
> drivers/net/wireless/libertas/if_cs.c | 1 -
> drivers/net/wireless/orinoco/orinoco_cs.c | 1 -
> drivers/net/wireless/orinoco/spectrum_cs.c | 1 -
> drivers/net/wireless/ray_cs.c | 1 -
> drivers/net/wireless/wl3501_cs.c | 10 +-----
> drivers/parport/parport_cs.c | 1 -
> drivers/pcmcia/au1000_generic.h | 1 -
> drivers/pcmcia/au1000_pb1x00.c | 2 -
> drivers/pcmcia/cistpl.c | 1 -
> drivers/pcmcia/cs.c | 1 -
> drivers/pcmcia/db1xxx_ss.c | 1 -
> drivers/pcmcia/ds.c | 1 -
> drivers/pcmcia/i82092.c | 1 -
> drivers/pcmcia/i82365.c | 1 -
> drivers/pcmcia/m32r_cfc.c | 1 -
> drivers/pcmcia/m32r_pcc.c | 1 -
> drivers/pcmcia/m8xx_pcmcia.c | 1 -
> drivers/pcmcia/pcmcia_cis.c | 1 -
> drivers/pcmcia/pcmcia_resource.c | 1 -
> drivers/pcmcia/pd6729.c | 1 -
> drivers/pcmcia/pxa2xx_base.c | 1 -
> drivers/pcmcia/rsrc_iodyn.c | 1 -
> drivers/pcmcia/rsrc_mgr.c | 1 -
> drivers/pcmcia/rsrc_nonstatic.c | 1 -
> drivers/pcmcia/sa1100_generic.c | 1 -
> drivers/pcmcia/soc_common.h | 1 -
> drivers/pcmcia/socket_sysfs.c | 1 -
> drivers/pcmcia/tcic.c | 1 -
> drivers/pcmcia/xxs1500_ss.c | 1 -
> drivers/pcmcia/yenta_socket.c | 1 -
> drivers/scsi/pcmcia/aha152x_stub.c | 1 -
> drivers/scsi/pcmcia/fdomain_stub.c | 1 -
> drivers/scsi/pcmcia/nsp_cs.c | 1 -
> drivers/scsi/pcmcia/qlogic_stub.c | 1 -
> drivers/scsi/pcmcia/sym53c500_cs.c | 1 -
> drivers/serial/serial_cs.c | 1 -
> drivers/ssb/main.c | 1 -
> drivers/ssb/pcmcia.c | 1 -
> drivers/ssb/scan.c | 1 -
> drivers/staging/comedi/drivers/cb_das16_cs.c | 1 -
> drivers/staging/comedi/drivers/das08_cs.c | 1 -
> drivers/staging/comedi/drivers/ni_daq_700.c | 1 -
> drivers/staging/comedi/drivers/ni_daq_dio24.c | 1 -
> drivers/staging/comedi/drivers/ni_labpc_cs.c | 1 -
> drivers/staging/comedi/drivers/ni_mio_cs.c | 1 -
> drivers/staging/comedi/drivers/quatech_daqp_cs.c | 1 -
> drivers/staging/wlags49_h2/wl_cs.c | 1 -
> drivers/staging/wlags49_h2/wl_internal.h | 1 -
> drivers/telephony/ixj_pcmcia.c | 1 -
> drivers/usb/host/sl811_cs.c | 5 +--
> include/pcmcia/cistpl.h | 2 +
> include/pcmcia/cs.h | 10 +-----
> include/pcmcia/cs_types.h | 40 ----------------------
> include/pcmcia/ds.h | 3 +-
> include/pcmcia/ss.h | 1 -
> sound/pcmcia/pdaudiocf/pdaudiocf.h | 1 -
> sound/pcmcia/vx/vxpocket.h | 1 -
> 90 files changed, 14 insertions(+), 151 deletions(-)
> delete mode 100644 include/pcmcia/cs_types.h
for drivers/bluetooth/
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply
* Re: Yet another bridge netfilter crash
From: Herbert Xu @ 2010-07-23 15:26 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Stephen Hemminger, netdev
In-Reply-To: <4C49B296.10009@trash.net>
On Fri, Jul 23, 2010 at 05:17:42PM +0200, Patrick McHardy wrote:
>
> No concrete plans yet, but its something I'm definitely planning
> to try at some point.
Great!
> > There's also the matter of fragments jumping between bridges.
>
> Conntrack zones can be used to avoid that, but that currently needs
> manual configuration.
I think this is something that we need to fix. Because as it
stands, it can still crash if you get the wrong nf_bridge.
The reason is that skb->dev does not hold a ref count. So the
reassembly code just throws it away and always uses the dev of
the last fragment.
This breaks when two bridges combine to reassemble a single
packet, as the nf_bridge attribute of the reassembled packet
may come from an skb whose device is now dead. This is then
used to fill in the skb->dev (via nf_bridge->physindev).
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* [PATCH nf-next-2.6] netfilter: {ip,ip6,arp}_tables: dont block bottom half more than necessary
From: Eric Dumazet @ 2010-07-23 15:23 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Netfilter Development Mailinglist, netdev
We currently disable BH for the whole duration of get_counters()
On machines with a lot of cpus and large tables, this might be too long.
We can disable preemption during the whole function, and disable BH only
while fetching counters for the current cpu.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv4/netfilter/arp_tables.c | 10 ++++++----
net/ipv4/netfilter/ip_tables.c | 10 ++++++----
net/ipv6/netfilter/ip6_tables.c | 10 ++++++----
3 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index c868dd5..6bccba3 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -710,7 +710,7 @@ static void get_counters(const struct xt_table_info *t,
struct arpt_entry *iter;
unsigned int cpu;
unsigned int i;
- unsigned int curcpu;
+ unsigned int curcpu = get_cpu();
/* Instead of clearing (by a previous call to memset())
* the counters and using adds, we set the counters
@@ -720,14 +720,16 @@ static void get_counters(const struct xt_table_info *t,
* if new softirq were to run and call ipt_do_table
*/
local_bh_disable();
- curcpu = smp_processor_id();
-
i = 0;
xt_entry_foreach(iter, t->entries[curcpu], t->size) {
SET_COUNTER(counters[i], iter->counters.bcnt,
iter->counters.pcnt);
++i;
}
+ local_bh_enable();
+ /* Processing counters from other cpus, we can let bottom half enabled,
+ * (preemption is disabled)
+ */
for_each_possible_cpu(cpu) {
if (cpu == curcpu)
@@ -741,7 +743,7 @@ static void get_counters(const struct xt_table_info *t,
}
xt_info_wrunlock(cpu);
}
- local_bh_enable();
+ put_cpu();
}
static struct xt_counters *alloc_counters(const struct xt_table *table)
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 3c584a6..c439721 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -884,7 +884,7 @@ get_counters(const struct xt_table_info *t,
struct ipt_entry *iter;
unsigned int cpu;
unsigned int i;
- unsigned int curcpu;
+ unsigned int curcpu = get_cpu();
/* Instead of clearing (by a previous call to memset())
* the counters and using adds, we set the counters
@@ -894,14 +894,16 @@ get_counters(const struct xt_table_info *t,
* if new softirq were to run and call ipt_do_table
*/
local_bh_disable();
- curcpu = smp_processor_id();
-
i = 0;
xt_entry_foreach(iter, t->entries[curcpu], t->size) {
SET_COUNTER(counters[i], iter->counters.bcnt,
iter->counters.pcnt);
++i;
}
+ local_bh_enable();
+ /* Processing counters from other cpus, we can let bottom half enabled,
+ * (preemption is disabled)
+ */
for_each_possible_cpu(cpu) {
if (cpu == curcpu)
@@ -915,7 +917,7 @@ get_counters(const struct xt_table_info *t,
}
xt_info_wrunlock(cpu);
}
- local_bh_enable();
+ put_cpu();
}
static struct xt_counters *alloc_counters(const struct xt_table *table)
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 33113c1..5359ef4 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -897,7 +897,7 @@ get_counters(const struct xt_table_info *t,
struct ip6t_entry *iter;
unsigned int cpu;
unsigned int i;
- unsigned int curcpu;
+ unsigned int curcpu = get_cpu();
/* Instead of clearing (by a previous call to memset())
* the counters and using adds, we set the counters
@@ -907,14 +907,16 @@ get_counters(const struct xt_table_info *t,
* if new softirq were to run and call ipt_do_table
*/
local_bh_disable();
- curcpu = smp_processor_id();
-
i = 0;
xt_entry_foreach(iter, t->entries[curcpu], t->size) {
SET_COUNTER(counters[i], iter->counters.bcnt,
iter->counters.pcnt);
++i;
}
+ local_bh_enable();
+ /* Processing counters from other cpus, we can let bottom half enabled,
+ * (preemption is disabled)
+ */
for_each_possible_cpu(cpu) {
if (cpu == curcpu)
@@ -928,7 +930,7 @@ get_counters(const struct xt_table_info *t,
}
xt_info_wrunlock(cpu);
}
- local_bh_enable();
+ put_cpu();
}
static struct xt_counters *alloc_counters(const struct xt_table *table)
^ permalink raw reply related
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