Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next-2.6] 3c59x: Fix call to mdio_sync() with the wrong argument
From: David Miller @ 2010-07-23 20:05 UTC (permalink / raw)
  To: ben; +Cc: netdev, dktrkranz, 589989
In-Reply-To: <1279844308.4883.365.camel@localhost>

From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 23 Jul 2010 01:18:28 +0100

> commit a095cfc40ec7ebe63e9532383c5b5c2a27b14075
> "3c59x: Specify window explicitly for access to windowed registers"
> changed the first parameter to mdio_sync(), from a pointer to the
> register mapping, to a pointer to the vortex_private structure,
> and changed all but one of the call sites.  Fix that last one.
> 
> Reported-by: Luca Falavigna <dktrkranz@debian.org>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Applied.

^ permalink raw reply

* [PATCH net-next-2.6] bonding: set device in RLB ARP packet handler
From: Jay Vosburgh @ 2010-07-23 20:02 UTC (permalink / raw)
  To: Greg Edwards; +Cc: netdev, David S. Miller, bonding-devel, linux-kernel
In-Reply-To: <20100722195240.GA25359@w-gedwards.lhn.com>


From: Greg Edwards <greg.edwards@hp.com>

After:

commit 6146b1a4da98377e4abddc91ba5856bef8f23f1e
Author: Jay Vosburgh <fubar@us.ibm.com>
Date:   Tue Nov 4 17:51:15 2008 -0800

    bonding: Fix ALB mode to balance traffic on VLANs

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 1f3c8804acba841b5573b953f5560d2683d2db0d
Author: Andy Gospodarek <andy@greyhouse.net>
Date:   Mon Dec 14 10:48:58 2009 +0000

    bonding: allow arp_ip_targets on separate vlans to use arp validation

frames received on VLANs correctly make their way to the bond's handler,
so we no longer need to wildcard the device.

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.

[ Tested, behaves as advertised.  I do not believe a test of the bonding
mode is necessary, as there is no race between the packet handler and
the bonding mode changing (the mode can only change when the device is
closed).  Also updated the log message to include the reproduction and
full commit ids.  -J ]
	
Signed-off-by: Greg Edwards <greg.edwards@hp.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

---

 drivers/net/bonding/bond_alb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index df48307..8d7dfd2 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -822,7 +822,7 @@ static int rlb_initialize(struct bonding *bond)

 	/*initialize packet type*/
 	pk_type->type = cpu_to_be16(ETH_P_ARP);
-	pk_type->dev = NULL;
+	pk_type->dev = bond->dev;
 	pk_type->func = rlb_arp_recv;

 	/* register to receive ARPs */
-- 
1.7.0.4

^ permalink raw reply related

* Re: ss -p is much too slow
From: Stephen Hemminger @ 2010-07-23 20:01 UTC (permalink / raw)
  To: David Miller; +Cc: sphink, netdev, stephen.hemminger
In-Reply-To: <20100723.124819.246519789.davem@davemloft.net>

On Fri, 23 Jul 2010 12:48:19 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: David Miller <davem@davemloft.net>
> Date: Mon, 28 Jun 2010 16:21:39 -0700 (PDT)
> 
> > ss: Avoid quadradic complexity with '-p'
> > 
> > Scan the process list of open sockets once, and store in a hash
> > table to be used by subsequent find_user() calls.
> > 
> > Reported-by: Steve Fink <sphink@gmail.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> Stephen, please apply this, it fixes the quadratic behavior and
> has been sitting for a month.
> 
> It's in patchwork, just check your todo list.
> 

I saw it but wanted to work out a more general solution,
will apply it next week if mine doesn't work.

^ permalink raw reply

* Re: [PATCH] bonding: set device in RLB ARP packet handler
From: Greg Edwards @ 2010-07-23 19:59 UTC (permalink / raw)
  To: Andy Gospodarek
  Cc: Jay Vosburgh, bonding-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <20100723193456.GS7497@gospo.rdu.redhat.com>

On Fri, Jul 23, 2010 at 07:34:56PM +0000, Andy Gospodarek wrote:
> 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.

Is the problem demonstrable with 802.3ad bonds?  bond_register_lacpdu()
sets pk_type->dev = bond->dev.

>> 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.

I had originally thought of doing something like this, but it didn't
seem as clean.  I don't have strong feelings one way or the other,
though.

Greg

^ permalink raw reply

* Re: [PATCH 5/5] net: core: don't use own hex_to_bin() method
From: David Miller @ 2010-07-23 19:51 UTC (permalink / raw)
  To: andy.shevchenko; +Cc: netdev, linux-kernel
In-Reply-To: <2519848e90eac1857ff7a8399e118980dd0bfbd0.1279890832.git.andy.shevchenko@gmail.com>

From: Andy Shevchenko <andy.shevchenko@gmail.com>
Date: Fri, 23 Jul 2010 16:18:10 +0300

> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH 3/5] usb: usbnet: use newly introduced hex_to_bin()
From: David Miller @ 2010-07-23 19:51 UTC (permalink / raw)
  To: andy.shevchenko; +Cc: netdev, linux-kernel, gregkh, linux-usb
In-Reply-To: <dfeaa560c7a129bd667521be983794a05a12a12e.1279890832.git.andy.shevchenko@gmail.com>

From: Andy Shevchenko <andy.shevchenko@gmail.com>
Date: Fri, 23 Jul 2010 16:18:08 +0300

> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH 2/5] drivers: net: use newly introduced hex_to_bin()
From: David Miller @ 2010-07-23 19:51 UTC (permalink / raw)
  To: andy.shevchenko; +Cc: netdev, linux-kernel
In-Reply-To: <3f9b9040fd8614141d4d7df59fbccf32d50e997d.1279890832.git.andy.shevchenko@gmail.com>

From: Andy Shevchenko <andy.shevchenko@gmail.com>
Date: Fri, 23 Jul 2010 16:18:07 +0300

> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/5] drivers: atm: don't use private copy of hex_to_bin()
From: David Miller @ 2010-07-23 19:51 UTC (permalink / raw)
  To: andy.shevchenko; +Cc: netdev, linux-kernel, chas, linux-atm-general
In-Reply-To: <244718f934418c4a183e91e333de95ed07c501d4.1279890832.git.andy.shevchenko@gmail.com>

From: Andy Shevchenko <andy.shevchenko@gmail.com>
Date: Fri, 23 Jul 2010 16:18:06 +0300

> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Applied.

^ permalink raw reply

* Re: ss -p is much too slow
From: David Miller @ 2010-07-23 19:48 UTC (permalink / raw)
  To: sphink; +Cc: netdev, stephen.hemminger
In-Reply-To: <20100628.162139.59679342.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Mon, 28 Jun 2010 16:21:39 -0700 (PDT)

> ss: Avoid quadradic complexity with '-p'
> 
> Scan the process list of open sockets once, and store in a hash
> table to be used by subsequent find_user() calls.
> 
> Reported-by: Steve Fink <sphink@gmail.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>

Stephen, please apply this, it fixes the quadratic behavior and
has been sitting for a month.

It's in patchwork, just check your todo list.

Thanks.

^ permalink raw reply

* Re: [PATCH net-next 7/7] be2net: bump the driver version number
From: David Miller @ 2010-07-23 19:44 UTC (permalink / raw)
  To: ajitk; +Cc: netdev
In-Reply-To: <20100723120524.GA25060@serverengines.com>

From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:35:36 +0530

> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 6/7] be2net: variable name changes
From: David Miller @ 2010-07-23 19:44 UTC (permalink / raw)
  To: ajitk; +Cc: netdev
In-Reply-To: <20100723120441.GA25028@serverengines.com>

From: Ajit Khaparde <ajitk@serverengines.com>
Date: Fri, 23 Jul 2010 17:34:54 +0530

> This patch changes names of some variables.
> 
> 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:44 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

> When a virtual function driver in initialized, the network mac
> query command can fail. Skip display of error message in that case.
> 
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>

Applied.

^ permalink raw reply

* 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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox