Netdev List
 help / color / mirror / Atom feed
* [PATCH] qlcnic - Fix scheduling while atomic bug
From: Narendra_K @ 2012-09-25 17:53 UTC (permalink / raw)
  To: netdev; +Cc: sony.chacko, jitendra.kalsaria, john.r.fastabend

From: Narendra K <narendra_k@dell.com>

In the device close path, 'qlcnic_fw_destroy_ctx' and
'qlcnic_poll_rsp' call msleep. But  'qlcnic_fw_destroy_ctx' and
'qlcnic_poll_rsp' are called with 'adapter->tx_clean_lock' spin lock
held resulting in scheduling while atomic bug causing the following
trace.

I observed that the commit 012dc19a45b2b9cc2ebd14aaa401cf782c2abba4
from John Fastabend addresses a similar issue in ixgbevf driver.
Adopting the same approach used in the commit, this patch uses mdelay
to address the issue.

[79884.999115] BUG: scheduling while atomic: ip/30846/0x00000002
[79885.005562] INFO: lockdep is turned off.
[79885.009958] Modules linked in: qlcnic fuse nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE bnep bluetooth rfkill ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables iptable_nat nf_nat iptable_mangle ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter ip_tables dcdbas coretemp kvm_intel kvm iTCO_wdt ixgbe iTCO_vendor_support crc32c_intel ghash_clmulni_intel nfsd microcode sb_edac pcspkr edac_core dca bnx2x shpchp auth_rpcgss nfs_acl lpc_ich mfd_core mdio lockd libcrc32c wmi acpi_pad acpi_power_meter sunrpc uinput sd_mod sr_mod cdrom crc_t10dif ahci libahci libata megaraid_sas usb_storage dm_mirror dm_region_hash dm_log dm_mod [last unloaded: qlcnic]
[79885.083608] Pid: 30846, comm: ip Tainted: G        W  O 3.6.0-rc7+ #1
[79885.090805] Call Trace:
[79885.093569]  [<ffffffff816764d8>] __schedule_bug+0x68/0x76
[79885.099699]  [<ffffffff8168358e>] __schedule+0x99e/0xa00
[79885.105634]  [<ffffffff81683929>] schedule+0x29/0x70
[79885.111186]  [<ffffffff81680def>] schedule_timeout+0x16f/0x350
[79885.117724]  [<ffffffff811afb7a>] ? init_object+0x4a/0x90
[79885.123770]  [<ffffffff8107c190>] ? __internal_add_timer+0x140/0x140
[79885.130873]  [<ffffffff81680fee>] schedule_timeout_uninterruptible+0x1e/0x20
[79885.138773]  [<ffffffff8107e830>] msleep+0x20/0x30
[79885.144159]  [<ffffffffa04c7fbf>] qlcnic_issue_cmd+0xef/0x290 [qlcnic]
[79885.151478]  [<ffffffffa04c8265>] qlcnic_fw_cmd_destroy_rx_ctx+0x55/0x90 [qlcnic]
[79885.159868]  [<ffffffffa04c92fd>] qlcnic_fw_destroy_ctx+0x2d/0xa0 [qlcnic]
[79885.167576]  [<ffffffffa04bf2ed>] __qlcnic_down+0x11d/0x180 [qlcnic]
[79885.174708]  [<ffffffffa04bf6f8>] qlcnic_close+0x18/0x20 [qlcnic]
[79885.181547]  [<ffffffff8153b4c5>] __dev_close_many+0x95/0xe0
[79885.187899]  [<ffffffff8153b548>] __dev_close+0x38/0x50
[79885.193761]  [<ffffffff81545101>] __dev_change_flags+0xa1/0x180
[79885.200419]  [<ffffffff81545298>] dev_change_flags+0x28/0x70
[79885.206779]  [<ffffffff815531b8>] do_setlink+0x378/0xa00
[79885.212731]  [<ffffffff81354fe1>] ? nla_parse+0x31/0xe0
[79885.218612]  [<ffffffff815558ee>] rtnl_newlink+0x37e/0x560
[79885.224768]  [<ffffffff812cfa19>] ? selinux_capable+0x39/0x50
[79885.231217]  [<ffffffff812cbf98>] ? security_capable+0x18/0x20
[79885.237765]  [<ffffffff81555114>] rtnetlink_rcv_msg+0x114/0x2f0
[79885.244412]  [<ffffffff81551f87>] ? rtnl_lock+0x17/0x20
[79885.250280]  [<ffffffff81551f87>] ? rtnl_lock+0x17/0x20
[79885.256148]  [<ffffffff81555000>] ? __rtnl_unlock+0x20/0x20
[79885.262413]  [<ffffffff81570fc1>] netlink_rcv_skb+0xa1/0xb0
[79885.268661]  [<ffffffff81551fb5>] rtnetlink_rcv+0x25/0x40
[79885.274727]  [<ffffffff815708bd>] netlink_unicast+0x19d/0x220
[79885.281146]  [<ffffffff81570c45>] netlink_sendmsg+0x305/0x3f0
[79885.287595]  [<ffffffff8152b188>] ? sock_update_classid+0x148/0x2e0
[79885.294650]  [<ffffffff81525c2c>] sock_sendmsg+0xbc/0xf0
[79885.300600]  [<ffffffff8152600c>] __sys_sendmsg+0x3ac/0x3c0
[79885.306853]  [<ffffffff8109be23>] ? up_read+0x23/0x40
[79885.312510]  [<ffffffff816896cc>] ? do_page_fault+0x2bc/0x570
[79885.318968]  [<ffffffff81191854>] ? sys_brk+0x44/0x150
[79885.324715]  [<ffffffff811c458c>] ? fget_light+0x24c/0x520
[79885.330875]  [<ffffffff815286f9>] sys_sendmsg+0x49/0x90
[79885.336707]  [<ffffffff8168e429>] system_call_fastpath+0x16/0x1b

Signed-off-by: Narendra K <narendra_k@dell.com>
---
The patch applies to latest mainline kernel version 3.6-rc7

 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index b8ead69..2a179d0 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -15,7 +15,7 @@ qlcnic_poll_rsp(struct qlcnic_adapter *adapter)
 
 	do {
 		/* give atleast 1ms for firmware to respond */
-		msleep(1);
+		mdelay(1);
 
 		if (++timeout > QLCNIC_OS_CRB_RETRY_COUNT)
 			return QLCNIC_CDRP_RSP_TIMEOUT;
@@ -601,7 +601,7 @@ void qlcnic_fw_destroy_ctx(struct qlcnic_adapter *adapter)
 		qlcnic_fw_cmd_destroy_tx_ctx(adapter);
 
 		/* Allow dma queues to drain after context reset */
-		msleep(20);
+		mdelay(20);
 	}
 }
 
-- 
1.7.10.2

-- 
With regards,
Narendra K

^ permalink raw reply related

* Re: [PATCH] net: sh-eth: fix sleeping in atomic context
From: Guennadi Liakhovetski @ 2012-09-25 17:27 UTC (permalink / raw)
  To: David Miller; +Cc: linux-sh, lethal, netdev
In-Reply-To: <20120925.130831.369798738695859924.davem@davemloft.net>

Hi David

On Tue, 25 Sep 2012, David Miller wrote:

> From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Date: Tue, 25 Sep 2012 12:38:59 +0200 (CEST)
> 
> > I'm not sure, whether this is the correct fix, i.e., whether this function 
> > is guaranteed to be called on a resumed device, but at least this fixes 
> > this specific issue in 3.6-rc7, but leaves another BUG open:
> 
> Someone added the runtime PM calls for a reason.

Sure they did.

> I cannot seriously consider your change until you are able to adequately
> consider that aspect.

I did too - as adequately as I could:-) My understanding is the following: 
assuming the networking stack is right, calling .ndo_get_stats() under a 
lock, I see 2 possibilities: (1) the method is only called during a 
running IO, i.e. the hardware cannot possibly be runtime-suspended at that 
time, so, no need to resume it; (2) the method can be called at any time, 
also when the hardware is suspended, then no IO shall be perdormed there, 
because it might involve having to wait for hardware to wake up from 
suspend. My patch fixes the former case, in the latter case statistics has 
to be collected outside of that method and inside it it only has to be 
atomically returned. This is a bigger change, if this indeed is the case, 
of course, my patch is wrong and an alternative, likely, more complex 
solution has to be found.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply

* Re: pull request: batman-adv 2012-09-25
From: David Miller @ 2012-09-25 17:25 UTC (permalink / raw)
  To: ordex-GaUfNO9RBHfsrOwW+9ziJQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
Date: Tue, 25 Sep 2012 17:57:15 +0200

> here are two fixes (the last set) we would to propose for net/linux-3.6.
> 
> The one from Def fixes a wrong behaviour of batman-adv in case of virtual
> interface mac address change, while the other from Linüs fixes a problem in the
> route selection which can lead to a continuous route flapping under certain
> conditions.
> 
> We would also like to enqueue both patches for sending to stable-3.5.
> 
> During merge with net/master you will hit a conflict. I'm going to send some
> instructions on how to solve it.
 ...
>   git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem

Pulled, thanks.

^ permalink raw reply

* Re: [PATCH] ipconfig: fix trivial build error
From: David Miller @ 2012-09-25 17:23 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: netdev, linux-next, chf.fritz
In-Reply-To: <1348560598-21233-1-git-send-email-andriy.shevchenko@linux.intel.com>

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: Tue, 25 Sep 2012 11:09:58 +0300

> The commit 5e953778a2aab04929a5e7b69f53dc26e39b079e ("ipconfig: add nameserver
> IPs to kernel-parameter ip=") introduces ic_nameservers_predef() that defined
> only for BOOTP. However it is used by ip_auto_config_setup() as well. This
> patch moves it outside of #ifdef BOOTP.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] ipv6: raw: fix icmpv6_filter()
From: David Miller @ 2012-09-25 17:23 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev
In-Reply-To: <1348592620.26828.3215.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 25 Sep 2012 19:03:40 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> icmpv6_filter() should not modify its input, or else its caller
> would need to recompute ipv6_hdr() if skb->head is reallocated.
> 
> Use skb_header_pointer() instead of pskb_may_pull() and
> change the prototype to make clear both sk and skb are const.
> 
> Also, if icmpv6 header cannot be found, do not deliver the packet,
> as we do in IPv4.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> Note: another patch is needed in mip6_mh_filter()

A rather pervasive issues, it appears.

Applied and queued up for -stable, thanks Eric.

^ permalink raw reply

* Re: [PATCH] net: sh-eth: fix sleeping in atomic context
From: David Miller @ 2012-09-25 17:08 UTC (permalink / raw)
  To: g.liakhovetski; +Cc: linux-sh, lethal, netdev
In-Reply-To: <Pine.LNX.4.64.1209251143210.9446@axis700.grange>

From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Date: Tue, 25 Sep 2012 12:38:59 +0200 (CEST)

> I'm not sure, whether this is the correct fix, i.e., whether this function 
> is guaranteed to be called on a resumed device, but at least this fixes 
> this specific issue in 3.6-rc7, but leaves another BUG open:

Someone added the runtime PM calls for a reason.

I cannot seriously consider your change until you are able to adequately
consider that aspect.

^ permalink raw reply

* Re: [PATCH net-next] tcp: avoid tcp loop connection on lo device
From: David Miller @ 2012-09-25 17:04 UTC (permalink / raw)
  To: shanwei88; +Cc: netdev
In-Reply-To: <50616772.8040704@gmail.com>

From: Shan Wei <shanwei88@gmail.com>
Date: Tue, 25 Sep 2012 16:12:34 +0800

> Tcp supports simultaneous Connection, but we meat odd phenomenon
> that tcp client can receive what send by itself. tcp client and tcp
> server communicate through loop device. tcp server selects port
> 40000 to listen which is in local port range. But after tcp server
> program is killed, tcp client still can connect successfully.

This is expected behavior and we're not special casing this after
it being this way for 20+ years.

^ permalink raw reply

* [PATCH] ipv6: raw: fix icmpv6_filter()
From: Eric Dumazet @ 2012-09-25 17:03 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

icmpv6_filter() should not modify its input, or else its caller
would need to recompute ipv6_hdr() if skb->head is reallocated.

Use skb_header_pointer() instead of pskb_may_pull() and
change the prototype to make clear both sk and skb are const.

Also, if icmpv6 header cannot be found, do not deliver the packet,
as we do in IPv4.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
Note: another patch is needed in mip6_mh_filter()

 net/ipv6/raw.c |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index ef0579d..4a5f78b 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -107,21 +107,20 @@ found:
  *	0 - deliver
  *	1 - block
  */
-static __inline__ int icmpv6_filter(struct sock *sk, struct sk_buff *skb)
+static int icmpv6_filter(const struct sock *sk, const struct sk_buff *skb)
 {
-	struct icmp6hdr *icmph;
-	struct raw6_sock *rp = raw6_sk(sk);
-
-	if (pskb_may_pull(skb, sizeof(struct icmp6hdr))) {
-		__u32 *data = &rp->filter.data[0];
-		int bit_nr;
+	struct icmp6hdr *_hdr;
+	const struct icmp6hdr *hdr;
 
-		icmph = (struct icmp6hdr *) skb->data;
-		bit_nr = icmph->icmp6_type;
+	hdr = skb_header_pointer(skb, skb_transport_offset(skb),
+				 sizeof(_hdr), &_hdr);
+	if (hdr) {
+		const __u32 *data = &raw6_sk(sk)->filter.data[0];
+		unsigned int type = hdr->icmp6_type;
 
-		return (data[bit_nr >> 5] & (1 << (bit_nr & 31))) != 0;
+		return (data[type >> 5] & (1U << (type & 31))) != 0;
 	}
-	return 0;
+	return 1;
 }
 
 #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)

^ permalink raw reply related

* Re: [PATCH net-next] netxen: write IP address to firmware when using bonding
From: Nikolay Aleksandrov @ 2012-09-25 16:43 UTC (permalink / raw)
  To: sony.chacko; +Cc: netdev, agospoda, rajesh.borundia, davem
In-Reply-To: <1348562883-14780-1-git-send-email-nikolay@redhat.com>

On 25/09/12 10:48, Nikolay Aleksandrov wrote:
> From: Nikolay Aleksandrov<naleksan@redhat.com>
>
> This patch allows LRO aggregation on bonded devices that contain an NX3031
> device. It also adds a for_each_netdev_in_bond_rcu(bond, slave) macro
> which executes for each slave that has bond as master.
>
> Signed-off-by: Andy Gospodarek<agospoda@redhat.com>
> Signed-off-by: Nikolay Aleksandrov<nikolay@redhat.com>
> ---
>   .../net/ethernet/qlogic/netxen/netxen_nic_main.c   | 113 +++++++++++++++------
>   include/linux/netdevice.h                          |   3 +
>   2 files changed, 87 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
> index e2a4858..aaf6cf7 100644
> --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
> +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
> @@ -3244,6 +3244,25 @@ netxen_restore_indev_addr(struct net_device *netdev, unsigned long event)
>   	}
>   }
>
> +static inline int
> +netxen_config_checkdev(struct net_device *dev)
> +{
> +	struct netxen_adapter *adapter;
> +
> +	if (!is_netxen_netdev(dev))
> +		return -ENODEV;
> +	
> +	adapter = netdev_priv(dev);
> +
> +	if(!adapter)
> +		return -ENODEV;
> +
> +	if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
>   static int netxen_netdev_event(struct notifier_block *this,
>   				 unsigned long event, void *ptr)
>   {
> @@ -3260,18 +3279,27 @@ recheck:
>   		goto recheck;
>   	}
>
> -	if (!is_netxen_netdev(dev))
> -		goto done;
> -
> -	adapter = netdev_priv(dev);
> -
> -	if (!adapter)
> -		goto done;
> +	/* If this is a bonding device, look for netxen-based slaves*/
> +	if (dev->priv_flags&  IFF_BONDING) {
> +		struct net_device *slave;
>
> -	if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
> -		goto done;
> +		rcu_read_lock();
> +		for_each_netdev_in_bond_rcu(dev, slave) {
> +			if (netxen_config_checkdev(slave)<  0)
> +				continue;
> +			
> +			adapter = netdev_priv(slave);
> +			netxen_config_indev_addr(adapter, orig_dev, event);
> +		}
> +		rcu_read_unlock();
>
> -	netxen_config_indev_addr(adapter, orig_dev, event);
> +	} else {
> +		if (netxen_config_checkdev(dev)<  0)
> +			goto done;
> +		
> +		adapter = netdev_priv(dev);
> +		netxen_config_indev_addr(adapter, orig_dev, event);
> +	}
>   done:
>   	return NOTIFY_DONE;
>   }
> @@ -3296,30 +3324,57 @@ recheck:
>   		goto recheck;
>   	}
>
> -	if (!is_netxen_netdev(dev))
> -		goto done;
> +	/* If this is a bonding device, look for netxen-based slaves*/
> +	if (dev->priv_flags&  IFF_BONDING) {
> +		struct net_device *slave;
>
> -	adapter = netdev_priv(dev);
> +		rcu_read_lock();
> +		for_each_netdev_in_bond_rcu(dev, slave) {
> +			if (netxen_config_checkdev(slave)<  0)
> +				continue;
>
> -	if (!adapter || !netxen_destip_supported(adapter))
> -		goto done;
> +			adapter = netdev_priv(slave);
>
> -	if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
> -		goto done;
> +			if (!netxen_destip_supported(adapter))
> +				continue;
>
> -	switch (event) {
> -	case NETDEV_UP:
> -		netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
> -		netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
> -		break;
> -	case NETDEV_DOWN:
> -		netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
> -		netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
> -		break;
> -	default:
> -		break;
> -	}
> +			switch (event) {
> +			case NETDEV_UP:
> +				netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
> +				netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
> +				break;
> +			case NETDEV_DOWN:
> +				netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
> +				netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
> +				break;
> +			default:
> +				break;
> +			}
> +		}
> +		rcu_read_unlock();
>
> +	} else {
> +		if (netxen_config_checkdev(dev)<  0)
> +			goto done;
> +
> +		adapter = netdev_priv(dev);
> +
> +		if (!netxen_destip_supported(adapter))
> +			goto done;
> +
> +		switch (event) {
> +		case NETDEV_UP:
> +			netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
> +			netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
> +			break;
> +		case NETDEV_DOWN:
> +			netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
> +			netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
> +			break;
> +		default:
> +			break;
> +		}
> +	}
>   done:
>   	return NOTIFY_DONE;
>   }
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 59dc05f3..463bb40 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1578,6 +1578,9 @@ extern rwlock_t				dev_base_lock;		/* Device list lock */
>   		list_for_each_entry_continue(d,&(net)->dev_base_head, dev_list)
>   #define for_each_netdev_continue_rcu(net, d)		\
>   	list_for_each_entry_continue_rcu(d,&(net)->dev_base_head, dev_list)
> +#define for_each_netdev_in_bond_rcu(bond, slave)	\
> +	for_each_netdev_rcu(&init_net, slave)		\
> +		if (slave->master == bond)
>   #define net_device_entry(lh)	list_entry(lh, struct net_device, dev_list)
>
>   static inline struct net_device *next_net_device(struct net_device *dev)
Ah yes, you're correct. I'll fix the cosmetic issues and re-post it.
I would like to know if the patch is acceptable otherwise, and if
there are any comments about the implementation so I will
wait a little bit to see if anything else comes up.
Thank you for the review.

Best regards,
  Nikolay Aleksandrov

^ permalink raw reply

* [PATCH linux-next] nf_defrag_ipv6: fix oops on module unloading
From: Konstantin Khlebnikov @ 2012-09-25 16:07 UTC (permalink / raw)
  Cc: netdev, Amerigo Wang, David S. Miller

fix copy-paste error introduced in linux-next commit
"ipv6: add a new namespace for nf_conntrack_reasm"

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: David S. Miller <davem@davemloft.net>

---

[    1.958698] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
[    1.962639] IP: [<ffffffffa1d521e3>] nf_ct_net_exit+0x24/0x79 [nf_defrag_ipv6]
[    1.962639] PGD 0
[    1.962639] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
[    1.962639] Modules linked in: dib3000mc dibx000_common rng_core whci umc nop_usb_xceiv eni videocodec orinoco pcmcia pcmcia_core xfrm_algo spi_bitbang ppp_generic videobuf_vmalloc nf_nat s5h1420 scsi_dh cs5535_mfgpt speakup(C) nf_defrag_ipv6(-) pmbus_core ptp pps_core scsi_transport_sas videobuf2_vmalloc videobuf2_memops videobuf2_core scsi_transport_iscsi i8042 sound suni serio phonet usbip_core(C) sir_dev irda dvb_usb dvb_core slhc udc_core atm snd_mpu401_uart snd_ac97_codec ac97_bus snd_rawmidi uio comedi(C) rt2x00pci rt2x00lib crc_itu_t snd_soc_core snd_compress btcx_risc tveeprom videobuf_dma_sg videobuf_core v4l2_common rc_core videodev media regmap_i2c wusbcore uwb ni_tio(C) x_tables industrialio nf_conntrack p54common mac80211 cfg80211 crc_ccitt led_class b1 kernelcapi ppdev lp
  bnep rfcomm
[    1.962639]  bluetooth rfkill uinput fuse nfsd auth_rpcgss nfs_acl nfs lockd sunrpc af_packet ipv6 loop evbug evdev mac_hid snd_hda_codec_realtek snd_hda_intel snd_hda_codec nouveau snd_hwdep snd_pcm powernow_k8 mxm_wmi snd_page_alloc freq_table wmi video kvm_amd ttm snd_seq kvm drm_kms_helper snd_seq_device snd_timer drm agpgart i2c_algo_bit cfbfillrect cfbimgblt snd cfbcopyarea backlight fb edac_core fbdev edac_mce_amd soundcore firmware_class pcspkr k8temp hid_generic parport_pc parport rtc_cmos 8250_pnp i2c_nforce2 processor thermal_sys button hwmon i2c_core ext4 crc16 jbd2 mbcache btrfs crc32c libcrc32c zlib_deflate usbhid hid sd_mod crc_t10dif ide_cd_mod cdrom ohci_hcd ata_generic pata_acpi pata_amd ehci_hcd sata_nv amd74xx forcedeth usbcore libata usb_common scsi_mod ide_pci_gene
 ric ide_core
[    1.962639]  unix [last unloaded: nf_defrag_ipv4]
[    1.962639] CPU 1
[    1.962639] Pid: 12431, comm: rmmod Tainted: P    B   WC   3.6.0-rc6-next-20120921-00009-g0383d9a #563 Gigabyte Technology Co., Ltd. M52S-S3P/M52S-S3P
[    1.962639] RIP: 0010:[<ffffffffa1d521e3>]  [<ffffffffa1d521e3>] nf_ct_net_exit+0x24/0x79 [nf_defrag_ipv6]
[    1.962639] RSP: 0018:ffff8800539ade18  EFLAGS: 00010203
[    1.962639] RAX: ffffffff82529ab0 RBX: ffffffff82529a40 RCX: ffffffffa1d552d0
[    1.962639] RDX: ffff8800539ade68 RSI: ffff8800539ade68 RDI: 0000000000000000
[    1.962639] RBP: ffff8800539ade28 R08: ffff8800539ade68 R09: ffffffff8167c7c0
[    1.962639] R10: ffff88007d010240 R11: ffff88007d010240 R12: ffffffffa1d552d0
[    1.962639] R13: ffff8800539ade68 R14: 00007fad18abf170 R15: 0000000000000800
[    1.962639] FS:  00007fad18887700(0000) GS:ffff88007d000000(0000) knlGS:0000000000000000
[    1.962639] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[    1.962639] CR2: 0000000000000020 CR3: 0000000055278000 CR4: 00000000000007e0
[    1.962639] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    1.962639] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[    1.962639] Process rmmod (pid: 12431, threadinfo ffff8800539ac000, task ffff880056820000)
[    1.962639] Stack:
[    1.962639]  ffffffff82529a40 ffffffffa1d552d0 ffff8800539ade58 ffffffff81554af3
[    1.962639]  ffff8800539ade68 ffffffffa1d552d0 ffffffff8252ab30 ffff8800539ade68
[    1.962639]  ffff8800539ade98 ffffffff81555031 ffffffff82529ab0 ffffffff82529ab0
[    1.962639] Call Trace:
[    1.962639]  [<ffffffff81554af3>] ops_exit_list+0x4e/0x83
[    1.962639]  [<ffffffff81555031>] unregister_pernet_operations+0x84/0xe0
[    1.962639]  [<ffffffff8155512b>] unregister_pernet_subsys+0x32/0x50
[    1.962639]  [<ffffffffa1d5392e>] nf_ct_frag6_cleanup+0x1c/0x3a [nf_defrag_ipv6]
[    1.962639]  [<ffffffffa1d53974>] nf_defrag_fini+0x28/0x31 [nf_defrag_ipv6]
[    1.962639]  [<ffffffff8110ec5a>] sys_delete_module+0x328/0x3d2
[    1.962639]  [<ffffffff8168be58>] tracesys+0xe1/0xe6
[    1.962639] Code: 05 bb 4b 00 00 5d c3 66 66 66 66 90 55 48 ff 05 f4 4e 00 00 48 ff 05 0d 4f 00 00 48 89 e5 41 54 53 48 89 fb 48 8b bf 88 0b 00 00 <4c> 8b 67 20 e8 0d 8f 8e df 48 ff 05 f5 4e 00 00 48 81 fb 40 9a
[    1.962639] RIP  [<ffffffffa1d521e3>] nf_ct_net_exit+0x24/0x79 [nf_defrag_ipv6]
[    1.962639]  RSP <ffff8800539ade18>
[    1.962639] CR2: 0000000000000020
---
 net/ipv6/netfilter/nf_conntrack_reasm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 1af12fde..18bd9bb 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -106,7 +106,7 @@ static int __net_init nf_ct_frag6_sysctl_register(struct net *net)
 	if (hdr == NULL)
 		goto err_reg;
 
-	net->ipv6.sysctl.frags_hdr = hdr;
+	net->nf_frag.sysctl.frags_hdr = hdr;
 	return 0;
 
 err_reg:

^ permalink raw reply related

* Re: pull request: batman-adv 2012-09-25
From: Antonio Quartulli @ 2012-09-25 16:01 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

Hello David,

here are some instructions to solve the conflict you will hit while merging net
with net-next.

Thank you,
	Antonio




++<<<<<<< HEAD
++=======
+ 	int if_num;
++>>>>>>> 7caf69f... batman-adv: Fix symmetry check / route flapping in multi interface setups


resolves to:
========
	int if_num;
>>>>>>>>




++<<<<<<< HEAD
 +		sum_orig = orig_node_tmp->bcast_own_sum[if_incoming->if_num];
++=======
+ 		if_num = router->if_incoming->if_num;
+ 		sum_orig = orig_node_tmp->bcast_own_sum[if_num];
++>>>>>>> 7caf69f... batman-adv: Fix symmetry check / route flapping in multi interface setups

resolves to:
=======
		if_num = router->if_incoming->if_num;
		sum_orig = orig_node_tmp->bcast_own_sum[if_num];
>>>>>>>





++<<<<<<< HEAD
 +		sum_neigh = orig_node_tmp->bcast_own_sum[if_incoming->if_num];
++=======
+ 		if_num = neigh_node->if_incoming->if_num;
+ 		sum_neigh = orig_node_tmp->bcast_own_sum[if_num];
++>>>>>>> 7caf69f... batman-adv: Fix symmetry check / route flapping in multi interface setups

resolves to:
=======
		if_num = neigh_node->if_incoming->if_num;
		sum_neigh = orig_node_tmp->bcast_own_sum[if_num];
>>>>>>

^ permalink raw reply

* RE: [PATCH net-next] netxen: write IP address to firmware when using bonding
From: Rajesh Borundia @ 2012-09-25 15:59 UTC (permalink / raw)
  To: Nikolay Aleksandrov, Sony Chacko
  Cc: netdev, agospoda@redhat.com, David Miller
In-Reply-To: <1348562883-14780-1-git-send-email-nikolay@redhat.com>



>-----Original Message-----
>From: Nikolay Aleksandrov [mailto:nikolay@redhat.com]
>Sent: Tuesday, September 25, 2012 2:18 PM
>To: Sony Chacko
>Cc: netdev; agospoda@redhat.com; Rajesh Borundia; David Miller
>Subject: [PATCH net-next] netxen: write IP address to firmware when
>using bonding
>
>From: Nikolay Aleksandrov <naleksan@redhat.com>
>
>This patch allows LRO aggregation on bonded devices that contain an
>NX3031
>device. It also adds a for_each_netdev_in_bond_rcu(bond, slave) macro
>which executes for each slave that has bond as master.
>
>Signed-off-by: Andy Gospodarek <agospoda@redhat.com>
>Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
>---
> .../net/ethernet/qlogic/netxen/netxen_nic_main.c   | 113
>+++++++++++++++------
> include/linux/netdevice.h                          |   3 +
> 2 files changed, 87 insertions(+), 29 deletions(-)
>
>diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
>b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
>index e2a4858..aaf6cf7 100644
>--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
>+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
>@@ -3244,6 +3244,25 @@ netxen_restore_indev_addr(struct net_device
>*netdev, unsigned long event)
> 	}
> }
>
>+static inline int
>+netxen_config_checkdev(struct net_device *dev)
>+{
>+	struct netxen_adapter *adapter;
>+
>+	if (!is_netxen_netdev(dev))
>+		return -ENODEV;
>+
>+	adapter = netdev_priv(dev);
>+
>+	if(!adapter)
>+		return -ENODEV;

It Seems space is needed after if.
 
>+
>+	if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
>+		return -ENODEV;
>+
>+	return 0;
>+}
>+
> static int netxen_netdev_event(struct notifier_block *this,
> 				 unsigned long event, void *ptr)
> {
>@@ -3260,18 +3279,27 @@ recheck:
> 		goto recheck;
> 	}
>
>-	if (!is_netxen_netdev(dev))
>-		goto done;
>-
>-	adapter = netdev_priv(dev);
>-
>-	if (!adapter)
>-		goto done;
>+	/* If this is a bonding device, look for netxen-based slaves*/
>+	if (dev->priv_flags & IFF_BONDING) {
>+		struct net_device *slave;
>
>-	if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
>-		goto done;
>+		rcu_read_lock();
>+		for_each_netdev_in_bond_rcu(dev, slave) {
>+			if (netxen_config_checkdev(slave) < 0)
>+				continue;
>+
>+			adapter = netdev_priv(slave);
>+			netxen_config_indev_addr(adapter, orig_dev, event);
>+		}
>+		rcu_read_unlock();
>
>-	netxen_config_indev_addr(adapter, orig_dev, event);
>+	} else {
>+		if (netxen_config_checkdev(dev) < 0)
>+			goto done;
>+
>+		adapter = netdev_priv(dev);
>+		netxen_config_indev_addr(adapter, orig_dev, event);
>+	}
> done:
> 	return NOTIFY_DONE;
> }
>@@ -3296,30 +3324,57 @@ recheck:
> 		goto recheck;
> 	}
>
>-	if (!is_netxen_netdev(dev))
>-		goto done;
>+	/* If this is a bonding device, look for netxen-based slaves*/
>+	if (dev->priv_flags & IFF_BONDING) {
>+		struct net_device *slave;
>
>-	adapter = netdev_priv(dev);
>+		rcu_read_lock();
>+		for_each_netdev_in_bond_rcu(dev, slave) {
>+			if (netxen_config_checkdev(slave) < 0)
>+				continue;
>
>-	if (!adapter || !netxen_destip_supported(adapter))
>-		goto done;
>+			adapter = netdev_priv(slave);
>
>-	if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
>-		goto done;
>+			if (!netxen_destip_supported(adapter))
>+				continue;
>
>-	switch (event) {
>-	case NETDEV_UP:
>-		netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
>-		netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
>-		break;
>-	case NETDEV_DOWN:
>-		netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
>-		netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
>-		break;
>-	default:
>-		break;
>-	}
>+			switch (event) {
>+			case NETDEV_UP:
>+				netxen_config_ipaddr(adapter, ifa->ifa_address,
>NX_IP_UP);
>+				netxen_list_config_vlan_ip(adapter, ifa,
>NX_IP_UP);
>+				break;
>+			case NETDEV_DOWN:
>+				netxen_config_ipaddr(adapter, ifa->ifa_address,
>NX_IP_DOWN);
>+				netxen_list_config_vlan_ip(adapter, ifa,
>NX_IP_DOWN);
>+				break;
>+			default:
>+				break;
>+			}
>+		}
>+		rcu_read_unlock();
>
>+	} else {
>+		if (netxen_config_checkdev(dev) < 0)
>+			goto done;
>+
>+		adapter = netdev_priv(dev);
>+
>+		if (!netxen_destip_supported(adapter))
>+			goto done;
>+
>+		switch (event) {
>+		case NETDEV_UP:
>+			netxen_config_ipaddr(adapter, ifa->ifa_address,
>NX_IP_UP);
>+			netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
>+			break;
>+		case NETDEV_DOWN:
>+			netxen_config_ipaddr(adapter, ifa->ifa_address,
>NX_IP_DOWN);
>+			netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
>+			break;
>+		default:
>+			break;
>+		}
>+	}
> done:
> 	return NOTIFY_DONE;
> }
>diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>index 59dc05f3..463bb40 100644
>--- a/include/linux/netdevice.h
>+++ b/include/linux/netdevice.h
>@@ -1578,6 +1578,9 @@ extern rwlock_t
>	dev_base_lock;		/* Device list lock */
> 		list_for_each_entry_continue(d, &(net)->dev_base_head,
>dev_list)
> #define for_each_netdev_continue_rcu(net, d)		\
> 	list_for_each_entry_continue_rcu(d, &(net)->dev_base_head,
>dev_list)
>+#define for_each_netdev_in_bond_rcu(bond, slave)	\
>+	for_each_netdev_rcu(&init_net, slave)		\
>+		if (slave->master == bond)
> #define net_device_entry(lh)	list_entry(lh, struct net_device,
>dev_list)
>
> static inline struct net_device *next_net_device(struct net_device
>*dev)
>--
>1.7.11.4
>

It seems at some places line is over 80 characters.

^ permalink raw reply

* [PATCH net 2/2] batman-adv: Fix symmetry check / route flapping in multi interface setups
From: Antonio Quartulli @ 2012-09-25 15:57 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Linus Lüssing, Antonio Quartulli
In-Reply-To: <1348588637-18441-1-git-send-email-ordex@autistici.org>

From: Linus Lüssing <linus.luessing@web.de>

If receiving an OGM from a neighbor other than the currently selected
and if it has the same TQ then we are supposed to switch if this
neighbor provides a more symmetric link than the currently selected one.

However this symmetry check currently is broken if the interface of the
neighbor we received the OGM from and the one of the currently selected
neighbor differ: We are currently trying to determine the symmetry of the
link towards the selected router via the link we received the OGM from
instead of just checking via the link towards the currently selected
router.

This leads to way more route switches than necessary and can lead to
permanent route flapping in many common multi interface setups.

This patch fixes this issue by using the right interface for this
symmetry check.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 net/batman-adv/bat_iv_ogm.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index e877af8..469daab 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -642,7 +642,8 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
 	struct batadv_neigh_node *router = NULL;
 	struct batadv_orig_node *orig_node_tmp;
 	struct hlist_node *node;
-	uint8_t bcast_own_sum_orig, bcast_own_sum_neigh;
+	int if_num;
+	uint8_t sum_orig, sum_neigh;
 	uint8_t *neigh_addr;
 
 	batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
@@ -727,17 +728,17 @@ batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv,
 	if (router && (neigh_node->tq_avg == router->tq_avg)) {
 		orig_node_tmp = router->orig_node;
 		spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
-		bcast_own_sum_orig =
-			orig_node_tmp->bcast_own_sum[if_incoming->if_num];
+		if_num = router->if_incoming->if_num;
+		sum_orig = orig_node_tmp->bcast_own_sum[if_num];
 		spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
 
 		orig_node_tmp = neigh_node->orig_node;
 		spin_lock_bh(&orig_node_tmp->ogm_cnt_lock);
-		bcast_own_sum_neigh =
-			orig_node_tmp->bcast_own_sum[if_incoming->if_num];
+		if_num = neigh_node->if_incoming->if_num;
+		sum_neigh = orig_node_tmp->bcast_own_sum[if_num];
 		spin_unlock_bh(&orig_node_tmp->ogm_cnt_lock);
 
-		if (bcast_own_sum_orig >= bcast_own_sum_neigh)
+		if (sum_orig >= sum_neigh)
 			goto update_tt;
 	}
 
-- 
1.7.12

^ permalink raw reply related

* pull request: batman-adv 2012-09-25
From: Antonio Quartulli @ 2012-09-25 15:57 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n

Hello David,

here are two fixes (the last set) we would to propose for net/linux-3.6.

The one from Def fixes a wrong behaviour of batman-adv in case of virtual
interface mac address change, while the other from Linüs fixes a problem in the
route selection which can lead to a continuous route flapping under certain
conditions.

We would also like to enqueue both patches for sending to stable-3.5.

During merge with net/master you will hit a conflict. I'm going to send some
instructions on how to solve it.

Thank you very much,
		Antonio



The following changes since commit 2b018d57ff18e5405823e5cb59651a5b4d946d7b:

  pppoe: drop PPPOX_ZOMBIEs in pppoe_release (2012-09-22 15:49:31 -0400)

are available in the git repository at:

  git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem

for you to fetch changes up to 7caf69fb9c5017df01945a1861c042f6aa08edeb:

  batman-adv: Fix symmetry check / route flapping in multi interface setups (2012-09-23 23:12:49 +0200)

----------------------------------------------------------------
Included fixes:
- fix the behaviour of batman-adv in case of virtual interface MAC change event
- fix symmetric link check in neighbour selection

----------------------------------------------------------------
Def (1):
      batman-adv: Fix change mac address of soft iface.

Linus Lüssing (1):
      batman-adv: Fix symmetry check / route flapping in multi interface setups

 net/batman-adv/bat_iv_ogm.c     | 13 +++++++------
 net/batman-adv/soft-interface.c |  7 +++++--
 2 files changed, 12 insertions(+), 8 deletions(-)

^ permalink raw reply

* [PATCH net 1/2] batman-adv: Fix change mac address of soft iface.
From: Antonio Quartulli @ 2012-09-25 15:57 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1348588637-18441-1-git-send-email-ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

From: Def <def-QFKgK+z4sOrR7s880joybQ@public.gmane.org>

Into function interface_set_mac_addr, the function tt_local_add was
invoked before updating dev->dev_addr. The new MAC address was not
tagged as NoPurge.

Signed-off-by: Def <def-QFKgK+z4sOrR7s880joybQ@public.gmane.org>
Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
---
 net/batman-adv/soft-interface.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 109ea2a..21c5357 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -100,18 +100,21 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
 {
 	struct batadv_priv *bat_priv = netdev_priv(dev);
 	struct sockaddr *addr = p;
+	uint8_t old_addr[ETH_ALEN];
 
 	if (!is_valid_ether_addr(addr->sa_data))
 		return -EADDRNOTAVAIL;
 
+	memcpy(old_addr, dev->dev_addr, ETH_ALEN);
+	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+
 	/* only modify transtable if it has been initialized before */
 	if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) {
-		batadv_tt_local_remove(bat_priv, dev->dev_addr,
+		batadv_tt_local_remove(bat_priv, old_addr,
 				       "mac address changed", false);
 		batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX);
 	}
 
-	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
 	dev->addr_assign_type &= ~NET_ADDR_RANDOM;
 	return 0;
 }
-- 
1.7.12

^ permalink raw reply related

* Re: bridge igmp snooping implementation
From: Lin Ming @ 2012-09-25 15:12 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: netdev, Herbert Xu
In-Reply-To: <506184ED.5040104@openwrt.org>

On Tue, Sep 25, 2012 at 6:18 PM, Felix Fietkau <nbd@openwrt.org> wrote:
> Hi,
>
> I'v been looking at the bridge IGMP snooping code and I noticed that it
> appears to not keep track of multicast group member IP addresses. Is
> this intentional?
>
> It seems to me that this would lead to issues when multiple members of
> the same multicast group are behind the same bridge port, and one of
> them leaves.
>
> I'm currently looking into adding a feature that allows bridge ports to
> be configured to selectively turn multicast traffic into unicast
> traffic. For this I would need to change the code to keep track of
> member IP and MAC addresses.

Good idea. This can help to resolve my problem at:
http://marc.info/?l=linux-netdev&m=134855468803809&w=2

Thanks.

>
> This helps a lot on 802.11, where unicast is often much cheaper than
> multicast, even when sending out duplicate packets (higher data rates
> and aggregation heavily reduce airtime utilization).
>
> - Felix

^ permalink raw reply

* Re: [PATCH v3] ucc_geth: Lockless xmit
From: Joakim Tjernlund @ 2012-09-25 14:09 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev
In-Reply-To: <20120924211014.GA17378@electric-eye.fr.zoreil.com>

Francois Romieu <romieu@fr.zoreil.com> wrote on 2012/09/24 23:10:14:
>
> Joakim Tjernlund <joakim.tjernlund@transmode.se> :
> [...]
> > I don't get it. The skb test is there just for one special case, when
> > the BD ring is empty the (bd_status & T_R) == 0 will be true as well so
> > one need something more than the bd_status test.
>
> Sure but the converse is not true : (bd_status & T_R) == 0 && skb does not
> mean that the skb has been sent. It happens when said skb is about to be
> given to the hardware by hard_start_xmit as well.

duhh, I was too tired when trying to make sense of smp & racing in general, thanks.

Will probably be some time before I get to this again due to other stuff though.
The other patches are independent of this one, I hope they are good/accepted?

  Jocke

^ permalink raw reply

* Re: bnx2x: link detected up at startup even when it should be down
From: Jean-Michel Hautbois @ 2012-09-25 14:00 UTC (permalink / raw)
  To: Dmitry Kravkov
  Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <CAL8zT=h31Prm2dpyKM8wwg_cb1a8_0yP2ziNzhNFC-3J1M0Khg@mail.gmail.com>

2012/9/25 Jean-Michel Hautbois <jhautbois@gmail.com>:
> 2012/9/25 Dmitry Kravkov <dmitry@broadcom.com>:
>>> -----Original Message-----
>>> From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
>>> Sent: Tuesday, September 25, 2012 2:54 PM
>>> To: Dmitry Kravkov
>>> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
>>> Subject: Re: bnx2x: link detected up at startup even when it should be down
>>
>>
>>> After a reboot (with the added if but no netif_msg) :
>>
>> I'm looking for link messages during device load.
>> These (get_setting/set_settings) appear at the later stages.
>> Will you able to load driver with module param debug=0x4 instead? So we can catch all link related messages
>> (This can be done via /etc/modprobe.conf)
>>
>
> Sorry, you said after a reboot, so I used ethtool, I tried to set
> bnx2x.debug=4 in cmdline but does not seem to work...
> Looking at it...

Here is what I get when starting with cmdline and bnx2x.debug=4 :

[    0.000000] Command line: initrd=initrd_Diskless_full.img rw
root=/dev/ram0 ip=dhcp bnx2x.poll=1 bnx2x.debug=4 BOOT_IMAGE=vmlinuz
BOOTIF=01-80-c1-6e-7a-49-48
[    0.000000] Kernel command line: initrd=initrd_Diskless_full.img rw
root=/dev/ram0 ip=dhcp bnx2x.poll=1 bnx2x.debug=4 BOOT_IMAGE=vmlinuz
BOOTIF=01-80-c1-6e-7a-49-48
[   18.858801] bnx2x: Broadcom NetXtreme II 5771x/578xx 10/20-Gigabit
Ethernet Driver bnx2x 1.70.30-1 (2012/08/17)
[   18.858875] bnx2x 0000:04:00.0: PCI INT A -> GSI 32 (level, low) -> IRQ 32
[   18.858884] bnx2x 0000:04:00.0: setting latency timer to 64
[   18.859838] bnx2x 0000:04:00.0: part number
394D4342-31383735-31543030-47303030
[   18.860409] bnx2x 0000:04:00.0: irq 90 for MSI/MSI-X
[   18.860418] bnx2x 0000:04:00.0: irq 91 for MSI/MSI-X
[   18.860732] bnx2x 0000:04:00.0: eth0: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
ea000000, IRQ 32, node addr 80:c1:6e:7a:49:48
[   18.861031] bnx2x 0000:04:00.1: PCI INT B -> GSI 36 (level, low) -> IRQ 36
[   18.861035] bnx2x 0000:04:00.1: setting latency timer to 64
[   18.861968] bnx2x 0000:04:00.1: part number
394D4342-31383735-31543030-47303030
[   18.862540] bnx2x 0000:04:00.1: irq 92 for MSI/MSI-X
[   18.862548] bnx2x 0000:04:00.1: irq 93 for MSI/MSI-X
[   18.862816] bnx2x 0000:04:00.1: eth1: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
e8800000, IRQ 36, node addr 80:c1:6e:7a:49:4c
[   18.862848] bnx2x 0000:04:00.2: PCI INT B -> GSI 36 (level, low) -> IRQ 36
[   18.862852] bnx2x 0000:04:00.2: setting latency timer to 64
[   18.863784] bnx2x 0000:04:00.2: part number
394D4342-31383735-31543030-47303030
[   18.864347] bnx2x 0000:04:00.2: irq 94 for MSI/MSI-X
[   18.864355] bnx2x 0000:04:00.2: irq 95 for MSI/MSI-X
[   18.864628] bnx2x 0000:04:00.2: eth2: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
e7000000, IRQ 36, node addr 80:c1:6e:7a:49:49
[   18.864662] bnx2x 0000:04:00.3: PCI INT C -> GSI 37 (level, low) -> IRQ 37
[   18.864666] bnx2x 0000:04:00.3: setting latency timer to 64
[   18.865598] bnx2x 0000:04:00.3: part number
394D4342-31383735-31543030-47303030
[   18.866360] bnx2x 0000:04:00.3: irq 96 for MSI/MSI-X
[   18.866369] bnx2x 0000:04:00.3: irq 97 for MSI/MSI-X
[   18.866646] bnx2x 0000:04:00.3: eth3: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
e5800000, IRQ 37, node addr 80:c1:6e:7a:49:4d
[   18.866677] bnx2x 0000:04:00.4: PCI INT C -> GSI 37 (level, low) -> IRQ 37
[   18.866682] bnx2x 0000:04:00.4: setting latency timer to 64
[   18.867615] bnx2x 0000:04:00.4: part number
394D4342-31383735-31543030-47303030
[   18.868177] bnx2x 0000:04:00.4: irq 98 for MSI/MSI-X
[   18.868185] bnx2x 0000:04:00.4: irq 99 for MSI/MSI-X
[   18.868458] bnx2x 0000:04:00.4: eth4: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
e4000000, IRQ 37, node addr 80:c1:6e:7a:49:4a
[   18.868492] bnx2x 0000:04:00.5: PCI INT D -> GSI 38 (level, low) -> IRQ 38
[   18.868496] bnx2x 0000:04:00.5: setting latency timer to 64
[   18.869431] bnx2x 0000:04:00.5: part number
394D4342-31383735-31543030-47303030
[   18.870187] bnx2x 0000:04:00.5: irq 100 for MSI/MSI-X
[   18.870196] bnx2x 0000:04:00.5: irq 101 for MSI/MSI-X
[   18.870474] bnx2x 0000:04:00.5: eth5: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
e2800000, IRQ 38, node addr 80:c1:6e:7a:49:4e
[   18.870500] bnx2x 0000:04:00.6: PCI INT D -> GSI 38 (level, low) -> IRQ 38
[   18.870504] bnx2x 0000:04:00.6: setting latency timer to 64
[   18.871436] bnx2x 0000:04:00.6: part number
394D4342-31383735-31543030-47303030
[   18.872188] bnx2x 0000:04:00.6: irq 102 for MSI/MSI-X
[   18.872197] bnx2x 0000:04:00.6: irq 103 for MSI/MSI-X
[   18.872499] bnx2x 0000:04:00.6: eth6: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
e1000000, IRQ 38, node addr 80:c1:6e:7a:49:4b
[   18.872527] bnx2x 0000:04:00.7: PCI INT A -> GSI 32 (level, low) -> IRQ 32
[   18.872530] bnx2x 0000:04:00.7: setting latency timer to 64
[   18.873465] bnx2x 0000:04:00.7: part number
394D4342-31383735-31543030-47303030
[   18.874227] bnx2x 0000:04:00.7: irq 104 for MSI/MSI-X
[   18.874236] bnx2x 0000:04:00.7: irq 105 for MSI/MSI-X
[   18.874514] bnx2x 0000:04:00.7: eth7: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
df800000, IRQ 32, node addr 80:c1:6e:7a:49:4f
[   18.874550] bnx2x 0000:05:00.0: PCI INT A -> GSI 40 (level, low) -> IRQ 40
[   18.874554] bnx2x 0000:05:00.0: setting latency timer to 64
[   18.875488] bnx2x 0000:05:00.0: part number 0-0-0-0
[   18.876060] bnx2x 0000:05:00.0: irq 106 for MSI/MSI-X
[   18.876073] bnx2x 0000:05:00.0: irq 107 for MSI/MSI-X
[   18.876344] bnx2x 0000:05:00.0: eth8: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
f6000000, IRQ 40, node addr 2c:76:8a:59:b3:90
[   18.876377] bnx2x 0000:05:00.1: PCI INT B -> GSI 44 (level, low) -> IRQ 44
[   18.876381] bnx2x 0000:05:00.1: setting latency timer to 64
[   18.877314] bnx2x 0000:05:00.1: part number 0-0-0-0
[   18.877876] bnx2x 0000:05:00.1: irq 108 for MSI/MSI-X
[   18.877884] bnx2x 0000:05:00.1: irq 109 for MSI/MSI-X
[   18.878155] bnx2x 0000:05:00.1: eth9: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
f4800000, IRQ 44, node addr 2c:76:8a:59:b3:94
[   18.878180] bnx2x 0000:05:00.2: PCI INT B -> GSI 44 (level, low) -> IRQ 44
[   18.878184] bnx2x 0000:05:00.2: setting latency timer to 64
[   18.879121] bnx2x 0000:05:00.2: part number 0-0-0-0
[   18.879682] bnx2x 0000:05:00.2: irq 110 for MSI/MSI-X
[   18.879690] bnx2x 0000:05:00.2: irq 111 for MSI/MSI-X
[   18.879966] bnx2x 0000:05:00.2: eth10: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
f3000000, IRQ 44, node addr 2c:76:8a:59:b3:91
[   18.879991] bnx2x 0000:05:00.3: PCI INT C -> GSI 45 (level, low) -> IRQ 45
[   18.879995] bnx2x 0000:05:00.3: setting latency timer to 64
[   18.880927] bnx2x 0000:05:00.3: part number 0-0-0-0
[   18.881492] bnx2x 0000:05:00.3: irq 112 for MSI/MSI-X
[   18.881500] bnx2x 0000:05:00.3: irq 113 for MSI/MSI-X
[   18.881780] bnx2x 0000:05:00.3: eth11: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
f1800000, IRQ 45, node addr 2c:76:8a:59:b3:95
[   18.881806] bnx2x 0000:05:00.4: PCI INT C -> GSI 45 (level, low) -> IRQ 45
[   18.881810] bnx2x 0000:05:00.4: setting latency timer to 64
[   18.882743] bnx2x 0000:05:00.4: part number 0-0-0-0
[   18.883309] bnx2x 0000:05:00.4: irq 114 for MSI/MSI-X
[   18.883318] bnx2x 0000:05:00.4: irq 115 for MSI/MSI-X
[   18.883592] bnx2x 0000:05:00.4: eth12: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
f0000000, IRQ 45, node addr 2c:76:8a:59:b3:92
[   18.883628] bnx2x 0000:05:00.5: PCI INT D -> GSI 46 (level, low) -> IRQ 46
[   18.883632] bnx2x 0000:05:00.5: setting latency timer to 64
[   18.884796] bnx2x 0000:05:00.5: part number 0-0-0-0
[   18.885488] bnx2x 0000:05:00.5: irq 116 for MSI/MSI-X
[   18.885496] bnx2x 0000:05:00.5: irq 117 for MSI/MSI-X
[   18.885784] bnx2x 0000:05:00.5: eth13: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
ee800000, IRQ 46, node addr 2c:76:8a:59:b3:96
[   18.885809] bnx2x 0000:05:00.6: PCI INT D -> GSI 46 (level, low) -> IRQ 46
[   18.885813] bnx2x 0000:05:00.6: setting latency timer to 64
[   18.886747] bnx2x 0000:05:00.6: part number 0-0-0-0
[   18.887440] bnx2x 0000:05:00.6: irq 118 for MSI/MSI-X
[   18.887448] bnx2x 0000:05:00.6: irq 119 for MSI/MSI-X
[   18.887736] bnx2x 0000:05:00.6: eth14: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
ed000000, IRQ 46, node addr 2c:76:8a:59:b3:93
[   18.887761] bnx2x 0000:05:00.7: PCI INT A -> GSI 40 (level, low) -> IRQ 40
[   18.887765] bnx2x 0000:05:00.7: setting latency timer to 64
[   18.888701] bnx2x 0000:05:00.7: part number 0-0-0-0
[   18.889269] bnx2x 0000:05:00.7: irq 124 for MSI/MSI-X
[   18.889278] bnx2x 0000:05:00.7: irq 125 for MSI/MSI-X
[   18.889558] bnx2x 0000:05:00.7: eth15: Broadcom NetXtreme II
BCM57810 10 Gigabit Ethernet (B0) PCI-E x8 5GHz (Gen2) found at mem
eb800000, IRQ 40, node addr 2c:76:8a:59:b3:97
[   26.315404] bnx2x 0000:04:00.0: eth0: using MSI-X  IRQs: sp 90
fp[0] 91 ... fp[0] 91
[   26.767893] bnx2x 0000:04:00.0: eth0: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[   26.902940] bnx2x 0000:05:00.0: eth8: using MSI-X  IRQs: sp 106
fp[0] 107 ... fp[0] 107
[   27.497395] bnx2x 0000:05:00.0: eth8: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[  107.683651] bnx2x 0000:04:00.1: eth1: using MSI-X  IRQs: sp 92
fp[0] 93 ... fp[0] 93
[  108.138200] bnx2x 0000:04:00.1: eth1: NIC Link is Up, 8000 Mbps
full duplex, Flow control: ON - receive & transmit
[  108.267249] bnx2x 0000:05:00.1: eth9: using MSI-X  IRQs: sp 108
fp[0] 109 ... fp[0] 109
[  108.546115] bnx2x 0000:04:00.2: eth2: using MSI-X  IRQs: sp 94
fp[0] 95 ... fp[0] 95
[  108.563938] bnx2x 0000:04:00.2: eth2: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[  108.715802] bnx2x 0000:05:00.1: eth9: NIC Link is Up, 8000 Mbps
full duplex, Flow control: ON - receive & transmit
[  108.717056] bnx2x 0000:05:00.2: eth10: using MSI-X  IRQs: sp 110
fp[0] 111 ... fp[0] 111
[  108.742813] bnx2x 0000:05:00.2: eth10: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[  108.967781] bnx2x 0000:04:00.3: eth3: using MSI-X  IRQs: sp 96
fp[0] 97 ... fp[0] 97
[  108.985640] bnx2x 0000:04:00.3: eth3: NIC Link is Up, 1000 Mbps
full duplex, Flow control: ON - receive & transmit
[  109.138763] bnx2x 0000:05:00.3: eth11: using MSI-X  IRQs: sp 112
fp[0] 113 ... fp[0] 113
[  109.156525] bnx2x 0000:05:00.3: eth11: NIC Link is Up, 1000 Mbps
full duplex, Flow control: ON - receive & transmit
[  109.301397] bnx2x 0000:05:00.3: eth11: NIC Link is Down
[  109.378543] bnx2x 0000:04:00.4: eth4: using MSI-X  IRQs: sp 98
fp[0] 99 ... fp[0] 99
[  109.396368] bnx2x 0000:04:00.4: eth4: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[  109.553369] bnx2x 0000:05:00.4: eth12: using MSI-X  IRQs: sp 114
fp[0] 115 ... fp[0] 115
[  109.571232] bnx2x 0000:05:00.4: eth12: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[  109.795207] bnx2x 0000:04:00.5: eth5: using MSI-X  IRQs: sp 100
fp[0] 101 ... fp[0] 101
[  109.813079] bnx2x 0000:04:00.5: eth5: NIC Link is Up, 1000 Mbps
full duplex, Flow control: ON - receive & transmit
[  109.966199] bnx2x 0000:05:00.5: eth13: using MSI-X  IRQs: sp 116
fp[0] 117 ... fp[0] 117
[  109.983964] bnx2x 0000:05:00.5: eth13: NIC Link is Up, 1000 Mbps
full duplex, Flow control: ON - receive & transmit
[  110.205039] bnx2x 0000:04:00.6: eth6: using MSI-X  IRQs: sp 102
fp[0] 103 ... fp[0] 103
[  110.222802] bnx2x 0000:04:00.6: eth6: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[  110.375810] bnx2x 0000:05:00.6: eth14: using MSI-X  IRQs: sp 118
fp[0] 119 ... fp[0] 119
[  110.393678] bnx2x 0000:05:00.6: eth14: NIC Link is Up, 2500 Mbps
full duplex, Flow control: ON - receive & transmit
[  110.614756] bnx2x 0000:04:00.7: eth7: using MSI-X  IRQs: sp 104
fp[0] 105 ... fp[0] 105
[  110.632521] bnx2x 0000:04:00.7: eth7: NIC Link is Up, 10000 Mbps
full duplex, Flow control: ON - receive & transmit
[  110.785633] bnx2x 0000:05:00.7: eth15: using MSI-X  IRQs: sp 124
fp[0] 125 ... fp[0] 125
[  110.803399] bnx2x 0000:05:00.7: eth15: NIC Link is Up, 10000 Mbps
full duplex, Flow control: ON - receive & transmit
[  111.632943] bnx2x 0000:04:00.1: eth1: using MSI-X  IRQs: sp 92
fp[0] 93 ... fp[0] 93
[  111.651829] bnx2x 0000:04:00.1: eth1: NIC Link is Up, 8000 Mbps
full duplex, Flow control: ON - receive & transmit
[  111.859779] bnx2x 0000:05:00.1: eth9: using MSI-X  IRQs: sp 108
fp[0] 109 ... fp[0] 109
[  111.877664] bnx2x 0000:05:00.1: eth9: NIC Link is Up, 8000 Mbps
full duplex, Flow control: ON - receive & transmit

FYI, eth4 and eth5 are seen UP and they should be down.
JM

^ permalink raw reply

* Re: [PATCH] ipv6: del unreachable route when an addr is deleted on lo
From: Eric Dumazet @ 2012-09-25 13:43 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: netdev, yoshfuji, davem
In-Reply-To: <1348568699-3932-1-git-send-email-nicolas.dichtel@6wind.com>

On Tue, 2012-09-25 at 12:24 +0200, Nicolas Dichtel wrote:
> When an address is added on loopback (ip -6 a a 2002::1/128 dev lo), two routes
> are added:
>  - one in the local table:
>     local 2002::1 via :: dev lo  proto none  metric 0
>  - one the in main table (for the prefix):
>     unreachable 2002::1 dev lo  proto kernel  metric 256  error -101
> 
> When the address is deleted, the route inserted in the main table remains
> because we use rt6_lookup(), which returns NULL when dst->error is set, which
> is the case here! Thus, it is better to use ip6_route_lookup() to avoid this
> kind of filter.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
>  net/ipv6/addrconf.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 6bc85f7..b6b2f9f 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -788,8 +788,12 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
>  		struct in6_addr prefix;
>  		struct rt6_info *rt;
>  		struct net *net = dev_net(ifp->idev->dev);
> +		struct flowi6 fl6 = {};
>  		ipv6_addr_prefix(&prefix, &ifp->addr, ifp->prefix_len);
> -		rt = rt6_lookup(net, &prefix, NULL, ifp->idev->dev->ifindex, 1);
> +		fl6.flowi6_oif = ifp->idev->dev->ifindex;
> +		fl6.daddr = prefix;
> +		rt = (struct rt6_info *)ip6_route_lookup(net, &fl6,
> +							 RT6_LOOKUP_F_IFACE);
>  

rt cant be NULL here ( but can be ip6_null_entry )

>  		if (rt && addrconf_is_prefix_route(rt)) {

So this condition is obsolete...

^ permalink raw reply

* Warning! Your mailbox is almost full.
From: WEBMAIL UPGRADE @ 2012-09-22 13:58 UTC (permalink / raw)


You have exceeded your email limit quota of 450MB. You need to upgrade
your email limit quota to 2GB within the next 48 hours. Use the below
web link to upgrade your email account:

click link below:
  http://www.formchamp.com/goform.php?id=38467

Thank you for using our email.
Copyright ©2012 Email Helpdesk Centre.

^ permalink raw reply

* Re: bnx2x: link detected up at startup even when it should be down
From: Jean-Michel Hautbois @ 2012-09-25 13:16 UTC (permalink / raw)
  To: Dmitry Kravkov
  Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <504C9EFCA2D0054393414C9CB605C37F30910B@SJEXCHMB06.corp.ad.broadcom.com>

2012/9/25 Dmitry Kravkov <dmitry@broadcom.com>:
>> -----Original Message-----
>> From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
>> Sent: Tuesday, September 25, 2012 2:54 PM
>> To: Dmitry Kravkov
>> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
>> Subject: Re: bnx2x: link detected up at startup even when it should be down
>
>
>> After a reboot (with the added if but no netif_msg) :
>
> I'm looking for link messages during device load.
> These (get_setting/set_settings) appear at the later stages.
> Will you able to load driver with module param debug=0x4 instead? So we can catch all link related messages
> (This can be done via /etc/modprobe.conf)
>

Sorry, you said after a reboot, so I used ethtool, I tried to set
bnx2x.debug=4 in cmdline but does not seem to work...
Looking at it...

^ permalink raw reply

* RE: bnx2x: link detected up at startup even when it should be down
From: Dmitry Kravkov @ 2012-09-25 13:11 UTC (permalink / raw)
  To: Jean-Michel Hautbois
  Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <CAL8zT=j9LC5hKtmkzBA-Epa+NhX1YpC9RodJ-C+UunTH_HRVKQ@mail.gmail.com>

> -----Original Message-----
> From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
> Sent: Tuesday, September 25, 2012 2:54 PM
> To: Dmitry Kravkov
> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
> Subject: Re: bnx2x: link detected up at startup even when it should be down


> After a reboot (with the added if but no netif_msg) :

I'm looking for link messages during device load.
These (get_setting/set_settings) appear at the later stages.
Will you able to load driver with module param debug=0x4 instead? So we can catch all link related messages
(This can be done via /etc/modprobe.conf)

> 
> [  998.244250] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [  998.244251]   supported 0x7460  advertising 0x7460  speed 2500
> [  998.244252]   duplex 1  port 3  phy_address 1  transceiver 0
> [  998.244252]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  998.244551] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [  998.244552]   supported 0x7460  advertising 0x7460  speed 8000
> [  998.244552]   duplex 1  port 3  phy_address 1  transceiver 0
> [  998.244553]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  998.244851] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [  998.244852]   supported 0x7460  advertising 0x7460  speed 2500
> [  998.244852]   duplex 1  port 3  phy_address 1  transceiver 0
> [  998.244853]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  998.246453] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [  998.246454]   supported 0x7460  advertising 0x7460  speed 1000
> [  998.246454]   duplex 1  port 3  phy_address 1  transceiver 0
> [  998.246455]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  998.255995] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [  998.643647] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [  998.723597] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [  998.735816] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [  999.255050] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [  999.255051]   supported 0x7460  advertising 0x7460  speed 2500
> [  999.255052]   duplex 1  port 3  phy_address 1  transceiver 0
> [  999.255052]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  999.255356] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [  999.255356]   supported 0x7460  advertising 0x7460  speed 8000
> [  999.255357]   duplex 1  port 3  phy_address 1  transceiver 0
> [  999.255358]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  999.255651] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [  999.255652]   supported 0x7460  advertising 0x7460  speed 2500
> [  999.255653]   duplex 1  port 3  phy_address 1  transceiver 0
> [  999.255653]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  999.255943] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [  999.255944]   supported 0x7460  advertising 0x7460  speed 1000
> [  999.255944]   duplex 1  port 3  phy_address 1  transceiver 0
> [  999.255945]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [  999.257380] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [  999.644969] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [  999.724909] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [  999.737130] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [ 1000.258622] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [ 1000.263951] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [ 1000.263952]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1000.263952]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1000.263953]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1000.264240] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [ 1000.264241]   supported 0x7460  advertising 0x7460  speed 8000
> [ 1000.264241]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1000.264242]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1000.264525] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [ 1000.264525]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1000.264526]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1000.264527]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1000.264815] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [ 1000.264816]   supported 0x7460  advertising 0x7460  speed 1000
> [ 1000.264816]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1000.264817]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1000.646283] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [ 1000.726224] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [ 1000.738445] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [ 1001.260013] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [ 1001.272929] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [ 1001.272930]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1001.272931]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1001.272931]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1001.273221] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [ 1001.273222]   supported 0x7460  advertising 0x7460  speed 8000
> [ 1001.273222]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1001.273223]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1001.273503] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [ 1001.273504]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1001.273505]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1001.273505]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1001.273790] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [ 1001.273790]   supported 0x7460  advertising 0x7460  speed 1000
> [ 1001.273791]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1001.273791]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1001.647598] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [ 1001.727540] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [ 1001.739762] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [ 1002.261261] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [ 1002.281715] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [ 1002.281715]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1002.281716]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1002.281717]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1002.282002] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [ 1002.282003]   supported 0x7460  advertising 0x7460  speed 8000
> [ 1002.282003]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1002.282004]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1002.282294] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [ 1002.282295]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1002.282296]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1002.282296]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1002.282583] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [ 1002.282584]   supported 0x7460  advertising 0x7460  speed 1000
> [ 1002.282584]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1002.282585]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1002.648914] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [ 1002.728852] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [ 1002.741076] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [ 1003.262650] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [ 1003.290582] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [ 1003.290583]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1003.290584]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1003.290584]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1003.290886] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [ 1003.290887]   supported 0x7460  advertising 0x7460  speed 8000
> [ 1003.290887]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1003.290888]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1003.291188] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [ 1003.291188]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1003.291189]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1003.291190]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1003.291493] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [ 1003.291494]   supported 0x7460  advertising 0x7460  speed 1000
> [ 1003.291494]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1003.291495]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1003.650229] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [ 1003.730167] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [ 1003.742391] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [ 1004.263895] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [ 1004.299670] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [ 1004.299671]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1004.299672]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1004.299673]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1004.299986] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [ 1004.299987]   supported 0x7460  advertising 0x7460  speed 8000
> [ 1004.299987]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1004.299988]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1004.300293] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [ 1004.300293]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1004.300294]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1004.300295]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1004.300600] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [ 1004.300600]   supported 0x7460  advertising 0x7460  speed 1000
> [ 1004.300601]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1004.300601]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1004.651587] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [ 1004.731481] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [ 1004.743705] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [ 1005.265285] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [ 1005.308537] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [ 1005.308538]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1005.308538]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1005.308539]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1005.308840] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [ 1005.308841]   supported 0x7460  advertising 0x7460  speed 8000
> [ 1005.308841]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1005.308842]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1005.309147] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [ 1005.309147]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1005.309148]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1005.309149]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1005.309448] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [ 1005.309448]   supported 0x7460  advertising 0x7460  speed 1000
> [ 1005.309449]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1005.309450]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1005.652906] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [ 1005.732798] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [ 1005.745020] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> [ 1006.266543] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
> [ 1006.317428] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> [ 1006.317429]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1006.317430]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1006.317431]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1006.317731] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> [ 1006.317732]   supported 0x7460  advertising 0x7460  speed 8000
> [ 1006.317733]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1006.317733]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1006.318031] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> [ 1006.318031]   supported 0x7460  advertising 0x7460  speed 2500
> [ 1006.318032]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1006.318033]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1006.318329] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
> [ 1006.318330]   supported 0x7460  advertising 0x7460  speed 1000
> [ 1006.318331]   duplex 1  port 3  phy_address 1  transceiver 0
> [ 1006.318331]   autoneg 1  maxtxpkt 0  maxrxpkt 0
> [ 1006.654172] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> [ 1006.734109] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> [ 1006.746331] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0


^ permalink raw reply

* Re: [PATCH V3 0/8] ipvs: IPv6 fragment handling for IPVS
From: Jesper Dangaard Brouer @ 2012-09-25 13:11 UTC (permalink / raw)
  To: Julian Anastasov
  Cc: Hans Schillstrom, Hans Schillstrom, netdev, Patrick McHardy,
	Pablo Neira Ayuso, lvs-devel, Thomas Graf, Wensong Zhang,
	netfilter-devel, Simon Horman
In-Reply-To: <alpine.LFD.2.00.1209130143410.1653@ja.ssi.bg>

On Thu, 2012-09-13 at 01:57 +0300, Julian Anastasov wrote:
> 	Hello,
> 
> On Tue, 11 Sep 2012, Jesper Dangaard Brouer wrote:
> 
> > The following patchset implement IPv6 fragment handling for IPVS.
> > 
> > This work is based upon patches from Hans Schillstrom.  I have taken
> > over the patchset, in close agreement with Hans, because he don't have
> > (gotten allocated) time to complete his work.
> > 
> > I have cleaned up the patchset significantly, and split the patchset
> > up into eight patches.
> > 
> > The first 4 patches, are ready to be merged
> > 
> >  Patch01: Trivial changes, use compressed IPv6 address in output
> >  Patch02: IPv6 extend ICMPv6 handling for future types
> >  Patch03: Use config macro IS_ENABLED()
> >  Patch04: Fix bug in IPVS IPv6 NAT mangling of ports inside ICMPv6 packets
> > 
> > The next 4 patches, I consider V3 of the patches I have submitted
> > earlier, where I have incorporated all of Julian's feedback.  I have
> > also tried to make the patches easier to review, by reorganizing the
> > changes, to be more strictly split (exthdr vs. fragment handling).
> > 
> > I have also removed the API changes, and moved those to patch07.  This
> > is done, (1) to make it easier to review the patches, and (2) to allow
> > easier integration of Patricks idea and my RFC patch of caching exthdr
> > info in skb->cb[].  Thus, we can get these patches applied (and later
> > go back and apply the caching scheme easier).
> > 
> >  Patch05: Fix faulty IPv6 extension header handling in IPVS
> >  Patch06: Complete IPv6 fragment handling for IPVS
> >  Patch07: IPVS API change to avoid rescan of IPv6 exthdr
> >  Patch08: IPVS SIP fragment handling
> > 
> > The SIP frag handling have been split into its own patch, as I have
> > not been able to test this part my self.
> > 
> > This patchset is based upon:
> >   Pablo's nf-next tree:  git://1984.lsi.us.es/nf-next
> >   On top of commit 0edd94887d19ad73539477395c17ea0d6898947a
> > 
> > ---
> > 
> > Jesper Dangaard Brouer (8):
> >       ipvs: SIP fragment handling
> >       ipvs: API change to avoid rescan of IPv6 exthdr
> >       ipvs: Complete IPv6 fragment handling for IPVS
> >       ipvs: Fix faulty IPv6 extension header handling in IPVS
> >       ipvs: Fix bug in IPv6 NAT mangling of ports inside ICMPv6 packets
> >       ipvs: Use config macro IS_ENABLED()
> >       ipvs: IPv6 extend ICMPv6 handling for future types
> >       ipvs: Trivial changes, use compressed IPv6 address in output
> 
> 	Some comments:
> 
> - About patch 4: ip_vs_icmp_xmit_v6 already calls skb_make_writable
> before ip_vs_nat_icmp_v6, that is why we provide 'offset'.

I see, that call path is correct, BUT I was talking about another call
path of ip_vs_nat_icmp_v6(), via handle_response_icmp() (which also
calls skb_make_writable).  That call path is triggered, if the
real-server, have shutdown its service and send back an ICMPv6 packet.

Hmm, testing it again, I cannot trigger this issue.  Perhaps I was
confusing my self and were using my test script that added IPv6 exthdrs
to the packet.  Adding print statements to the code, also show the
correct offset now.
I'm dropping this patch-4, and I'll adjust/fix patch-5 ("ipvs: fix
faulty IPv6 extension header handling in IPVS") accordingly.  And I'll
double check patch-5, that exthdr have been accounted for (in the offset
used by skb_make_writable() before calling ip_vs_nat_icmp_v6()).



> - May be we can provide the offset of ICMPv6 header
> from ip_vs_in_icmp_v6 to ip_vs_icmp_xmit_v6 as additional
> argument (icmp_offset) and then to ip_vs_nat_icmp_v6. By this
> way we can avoid the two ipv6_find_hdr calls if we also provide
> the iph argument from ip_vs_icmp_xmit_v6 to ip_vs_nat_icmp_v6,
> its ->len points to the ports. ip_vs_in_icmp_v6 provides
> also protocol in this ciph, so may be we have everything.

Is this comment for the API patch-7 ("ipvs: API change to avoid rescan
of IPv6 exthdr") ?
The API patch is going to save 19 calls to ipv6_find_hdr ().


> - in ip_vs_in_icmp_v6 there must be 'offs_ciph = ciph.len;'
> just before this line:
> 
> if (IPPROTO_TCP == ciph.protocol || IPPROTO_UDP == ciph.protocol ||
> 

It would be a lot easier for me, if you commented directly on the
patches.

I can see that 'offs_ciph = ciph.len;' is set earlier in this patch, but
that value is primarily used by IP_VS_DBG_PKT.  And offs_ciph, needs to
be updated, again, with the value of ciph.len after the call to
ipv6_find_hdr().  So, yes you are right ;-)

I'll rename offs_ciph to "writable" to emphasize what we are using this
value for.

> 	The idea is that we linearize for writing the inner
> IP header and optionally the 2 ports. That is why old
> logic was 'offset += 2 * sizeof(__u16);'

The port logic was kept.  But I'll make it more clear whats happening,
and keep the "+=" coding style.


> - initially, ip_vs_fill_iph_skb fills iphdr->flags from
> current fragment, later ip_vs_out_icmp_v6 uses the same
> ipvsh when calling ipv6_find_hdr. Should we initialize
> ipvsh->flags to 0 before calling ipv6_find_hdr because
> it is I/O argument?

As we don't use the flag, after this point, we can just give
ipv6_find_hdr() a NULL value instead.

But I must give you, that it's a little confusing the way we reuse the
ipvsh variable (in ip_vs_out_icmp_v6()).  Think, this needs to be
rewritten to use a separate variable, like in ip_vs_in_icmp_v6().


> - in patch 5: in ip_vs_nat_icmp_v6 skb_make_writable can
> move data to other addresses on linearization. Any pointers
> like 'ciph' should be recalculated based on offsets. But
> it does not matter because we should not call skb_make_writable
> here.

Yes, as mentioned earlier, I'll fix up patch-5 and remove the
skb_make_writable call.


> 	I also see that we should not send ICMP
> errors (FRAG NEEDED/TOO BIG) in response to large
> ICMP error packets but it is not related to your changes,
> it needs separate change to all transmitters.

Yes, its unrelated, lets fix that in another patchset.

I'll hopefully soon have a patchset ready with these changes/updates...

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Sr. Network Kernel Developer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer



^ permalink raw reply

* Re: bnx2x: link detected up at startup even when it should be down
From: Jean-Michel Hautbois @ 2012-09-25 12:54 UTC (permalink / raw)
  To: Dmitry Kravkov
  Cc: netdev, Barak Witkowski, Eilon Greenstein, davem@davemloft.net
In-Reply-To: <CAL8zT=hJ84woFg0KFxztuTxf2NJEBzThPRXDhZ9KnMJnBxmoZA@mail.gmail.com>

2012/9/25 Jean-Michel Hautbois <jhautbois@gmail.com>:
> 2012/9/25 Dmitry Kravkov <dmitry@broadcom.com>:
>>> -----Original Message-----
>>> From: Jean-Michel Hautbois [mailto:jhautbois@gmail.com]
>>> Sent: Tuesday, September 25, 2012 10:11 AM
>>> To: Dmitry Kravkov
>>> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@davemloft.net
>>> Subject: Re: bnx2x: link detected up at startup even when it should be down
>>>
>>>
>>> I have tested several things, and I added some traces in order to get
>>> information.
>>> For instance, I trace the load_code in the function named "bnx2x_nic_load".
>>>
>>> [   25.693677] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load load_code=0x10130000
>>> [   25.693679] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load start period
>>> [  102.748934] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load load_code=0x10100000
>>> [  102.749065] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load start period
>>> [  104.007074] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load load_code=0x10120000
>>> [  104.007197] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load NOT start period
>>> [  104.423789] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load load_code=0x10120000
>>> [  104.423914] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load NOT start period
>>> [  104.836505] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load load_code=0x10120000
>>> [  104.836632] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load NOT start period
>>> [  105.254220] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load load_code=0x10120000
>>> [  105.254350] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load NOT start period
>>> [  105.667935] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load load_code=0x10120000
>>> [  105.668066] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load NOT start period
>>> [  106.081652] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load load_code=0x10120000
>>> [  106.081779] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load NOT start period
>>>
>>> This is a FlexNIC use.
>>> Here is my (quick and dirty) patch which makes the link detection
>>> working and adds the traces shown above :
>>>
>>> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>>> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>>> index 580b44e..dedd810 100644
>>> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>>> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
>>> @@ -1769,6 +1769,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>>>          */
>>>         if (!BP_NOMCP(bp)) {
>>>                 load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ, 0);
>>> +netdev_info(bp->dev, "bnx2x_nic_load bnx2x_fw_command
>>> load_code=0x%08X\n",load_code);
>>>                 if (!load_code) {
>>>                         BNX2X_ERR("MCP response failure, aborting\n");
>>>                         rc = -EBUSY;
>>> @@ -1785,22 +1786,31 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>>>                 DP(NETIF_MSG_IFUP, "NO MCP - load counts[%d]      %d, %d, %d\n",
>>>                    path, load_count[path][0], load_count[path][1],
>>>                    load_count[path][2]);
>>> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - load counts[%d]
>>> %d, %d, %d\n",
>>> +                  path, load_count[path][0], load_count[path][1],
>>> +                  load_count[path][2]);
>>>                 load_count[path][0]++;
>>>                 load_count[path][1 + port]++;
>>>                 DP(NETIF_MSG_IFUP, "NO MCP - new load counts[%d]  %d, %d, %d\n",
>>>                    path, load_count[path][0], load_count[path][1],
>>>                    load_count[path][2]);
>>> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - new load counts[%d]
>>> %d, %d, %d\n",
>>> +                  path, load_count[path][0], load_count[path][1],
>>> +                  load_count[path][2]);
>>>                 if (load_count[path][0] == 1)
>>>                         load_code = FW_MSG_CODE_DRV_LOAD_COMMON;
>>>                 else if (load_count[path][1 + port] == 1)
>>>                         load_code = FW_MSG_CODE_DRV_LOAD_PORT;
>>>                 else
>>>                         load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION;
>>> +netdev_info(bp->dev, "bnx2x_nic_load autre
>>> load_code=0x%08X\n",load_code);
>>>         }
>>>
>>> +netdev_info(bp->dev, "bnx2x_nic_load load_code=0x%08X\n",load_code);
>>>         if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) ||
>>>             (load_code == FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) ||
>>> -           (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) {
>>> +           (load_code == FW_MSG_CODE_DRV_LOAD_PORT) ||
>>> +                (load_code == FW_MSG_CODE_DRV_LOAD_FUNCTION)) {
>>>                 bp->port.pmf = 1;
>>>                 /*
>>>                  * We need the barrier to ensure the ordering between the
>>> @@ -1808,9 +1818,13 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>>>                  * bnx2x_periodic_task().
>>>                  */
>>>                 smp_mb();
>>> +netdev_info(bp->dev, "bnx2x_nic_load start period\n");
>>>                 queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
>>>         } else
>>> +{
>>> +netdev_info(bp->dev, "bnx2x_nic_load NOT start period\n");
>>>                 bp->port.pmf = 0;
>>> +}
>>>
>>>         DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf);
>>>
>> Thanks Jean,
>> But your output does not suit the patch.
>
> Yes, you are right, here it is :
> Sep 25 07:56:08 debian kernel: [   26.607197] bnx2x 0000:04:00.0:
> eth0: bnx2x_nic_load bnx2x_fw_command load_code=0x10130000
> Sep 25 07:56:08 debian kernel: [   26.608642] bnx2x 0000:04:00.0:
> eth0: bnx2x_nic_load load_code=0x10130000
> Sep 25 07:56:08 debian kernel: [   26.608644] bnx2x 0000:04:00.0:
> eth0: bnx2x_nic_load start period
> Sep 25 07:57:20 debian kernel: [  101.068231] bnx2x 0000:04:00.1:
> eth1: bnx2x_nic_load bnx2x_fw_command load_code=0x10100000
> Sep 25 07:57:20 debian kernel: [  101.068416] bnx2x 0000:04:00.1:
> eth1: bnx2x_nic_load load_code=0x10100000
> Sep 25 07:57:20 debian kernel: [  101.068533] bnx2x 0000:04:00.1:
> eth1: bnx2x_nic_load start period
> Sep 25 07:57:21 debian kernel: [  102.294393] bnx2x 0000:04:00.2:
> eth2: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
> Sep 25 07:57:21 debian kernel: [  102.294585] bnx2x 0000:04:00.2:
> eth2: bnx2x_nic_load load_code=0x10120000
> Sep 25 07:57:21 debian kernel: [  102.294711] bnx2x 0000:04:00.2:
> eth2: bnx2x_nic_load start period
> Sep 25 07:57:22 debian kernel: [  102.782057] bnx2x 0000:04:00.3:
> eth3: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
> Sep 25 07:57:22 debian kernel: [  102.782240] bnx2x 0000:04:00.3:
> eth3: bnx2x_nic_load load_code=0x10120000
> Sep 25 07:57:22 debian kernel: [  102.782359] bnx2x 0000:04:00.3:
> eth3: bnx2x_nic_load start period
> Sep 25 07:57:22 debian kernel: [  103.265731] bnx2x 0000:04:00.4:
> eth4: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
> Sep 25 07:57:22 debian kernel: [  103.265924] bnx2x 0000:04:00.4:
> eth4: bnx2x_nic_load load_code=0x10120000
> Sep 25 07:57:22 debian kernel: [  103.266051] bnx2x 0000:04:00.4:
> eth4: bnx2x_nic_load start period
> Sep 25 07:57:23 debian kernel: [  103.758390] bnx2x 0000:04:00.5:
> eth5: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
> Sep 25 07:57:23 debian kernel: [  103.758583] bnx2x 0000:04:00.5:
> eth5: bnx2x_nic_load load_code=0x10120000
> Sep 25 07:57:23 debian kernel: [  103.758711] bnx2x 0000:04:00.5:
> eth5: bnx2x_nic_load start period
> Sep 25 07:57:23 debian kernel: [  104.252053] bnx2x 0000:04:00.6:
> eth6: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
> Sep 25 07:57:23 debian kernel: [  104.252247] bnx2x 0000:04:00.6:
> eth6: bnx2x_nic_load load_code=0x10120000
> Sep 25 07:57:23 debian kernel: [  104.252373] bnx2x 0000:04:00.6:
> eth6: bnx2x_nic_load start period
> Sep 25 07:57:24 debian kernel: [  104.836655] bnx2x 0000:04:00.7:
> eth7: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
> Sep 25 07:57:24 debian kernel: [  104.836849] bnx2x 0000:04:00.7:
> eth7: bnx2x_nic_load load_code=0x10120000
> Sep 25 07:57:24 debian kernel: [  104.836976] bnx2x 0000:04:00.7:
> eth7: bnx2x_nic_load start period
> Sep 25 07:57:25 debian kernel: [  106.145755] bnx2x 0000:04:00.1:
> eth1: bnx2x_nic_load bnx2x_fw_command load_code=0x10120000
> Sep 25 07:57:25 debian kernel: [  106.145940] bnx2x 0000:04:00.1:
> eth1: bnx2x_nic_load load_code=0x10120000
> Sep 25 07:57:25 debian kernel: [  106.146056] bnx2x 0000:04:00.1:
> eth1: bnx2x_nic_load start period
>
>> Your patch will start periodic for every instance, but printout show that it's started for PMF only (which is correct).
>> Generally if all functions are marked as PMF (port management function) you will get into the problem accessing shared port resources, like phys and internal data structures, then configuration/data will be corrupted.
>>
>> Is it feasible to provide ethtool -i output and syslog when driver is loaded debug=0x4?
> $> ethtool -i eth0
> driver: bnx2x
> version: 1.70.30-1
> firmware-version: bc 7.0.49
> bus-info: 0000:04:00.0
>
> And msglvl set to 4 says this :
> Sep 25 12:29:20 debian kernel: [16410.336897] bnx2x:
> [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> Sep 25 12:29:20 debian kernel: [16410.337215] bnx2x:
> [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> Sep 25 12:29:20 debian kernel: [16410.337511] bnx2x:
> [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> Sep 25 12:29:21 debian kernel: [16410.395363] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> Sep 25 12:29:21 debian kernel: [16410.633207] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> Sep 25 12:29:21 debian kernel: [16411.174842] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> Sep 25 12:29:22 debian kernel: [16411.396739] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> Sep 25 12:29:22 debian kernel: [16411.432249] bnx2x:
> [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> Sep 25 12:29:22 debian kernel: [16411.432566] bnx2x:
> [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> Sep 25 12:29:22 debian kernel: [16411.433348] bnx2x:
> [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> Sep 25 12:29:22 debian kernel: [16411.634797] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> Sep 25 12:29:22 debian kernel: [16412.176170] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> Sep 25 12:29:23 debian kernel: [16412.408747] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
> Sep 25 12:29:23 debian kernel: [16412.489861] bnx2x:
> [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
> Sep 25 12:29:23 debian kernel: [16412.490182] bnx2x:
> [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
> Sep 25 12:29:23 debian kernel: [16412.490505] bnx2x:
> [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
> Sep 25 12:29:23 debian kernel: [16412.635849] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
> Sep 25 12:29:23 debian kernel: [16413.177496] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
> Sep 25 12:29:24 debian kernel: [16413.411329] bnx2x:
> [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
>
> JM

After a reboot (with the added if but no netif_msg) :

[  998.244250] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[  998.244251]   supported 0x7460  advertising 0x7460  speed 2500
[  998.244252]   duplex 1  port 3  phy_address 1  transceiver 0
[  998.244252]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  998.244551] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[  998.244552]   supported 0x7460  advertising 0x7460  speed 8000
[  998.244552]   duplex 1  port 3  phy_address 1  transceiver 0
[  998.244553]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  998.244851] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[  998.244852]   supported 0x7460  advertising 0x7460  speed 2500
[  998.244852]   duplex 1  port 3  phy_address 1  transceiver 0
[  998.244853]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  998.246453] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[  998.246454]   supported 0x7460  advertising 0x7460  speed 1000
[  998.246454]   duplex 1  port 3  phy_address 1  transceiver 0
[  998.246455]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  998.255995] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[  998.643647] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[  998.723597] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[  998.735816] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[  999.255050] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[  999.255051]   supported 0x7460  advertising 0x7460  speed 2500
[  999.255052]   duplex 1  port 3  phy_address 1  transceiver 0
[  999.255052]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  999.255356] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[  999.255356]   supported 0x7460  advertising 0x7460  speed 8000
[  999.255357]   duplex 1  port 3  phy_address 1  transceiver 0
[  999.255358]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  999.255651] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[  999.255652]   supported 0x7460  advertising 0x7460  speed 2500
[  999.255653]   duplex 1  port 3  phy_address 1  transceiver 0
[  999.255653]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  999.255943] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[  999.255944]   supported 0x7460  advertising 0x7460  speed 1000
[  999.255944]   duplex 1  port 3  phy_address 1  transceiver 0
[  999.255945]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[  999.257380] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[  999.644969] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[  999.724909] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[  999.737130] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[ 1000.258622] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[ 1000.263951] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[ 1000.263952]   supported 0x7460  advertising 0x7460  speed 2500
[ 1000.263952]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1000.263953]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1000.264240] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[ 1000.264241]   supported 0x7460  advertising 0x7460  speed 8000
[ 1000.264241]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1000.264242]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1000.264525] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[ 1000.264525]   supported 0x7460  advertising 0x7460  speed 2500
[ 1000.264526]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1000.264527]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1000.264815] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[ 1000.264816]   supported 0x7460  advertising 0x7460  speed 1000
[ 1000.264816]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1000.264817]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1000.646283] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[ 1000.726224] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[ 1000.738445] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[ 1001.260013] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[ 1001.272929] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[ 1001.272930]   supported 0x7460  advertising 0x7460  speed 2500
[ 1001.272931]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1001.272931]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1001.273221] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[ 1001.273222]   supported 0x7460  advertising 0x7460  speed 8000
[ 1001.273222]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1001.273223]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1001.273503] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[ 1001.273504]   supported 0x7460  advertising 0x7460  speed 2500
[ 1001.273505]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1001.273505]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1001.273790] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[ 1001.273790]   supported 0x7460  advertising 0x7460  speed 1000
[ 1001.273791]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1001.273791]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1001.647598] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[ 1001.727540] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[ 1001.739762] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[ 1002.261261] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[ 1002.281715] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[ 1002.281715]   supported 0x7460  advertising 0x7460  speed 2500
[ 1002.281716]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1002.281717]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1002.282002] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[ 1002.282003]   supported 0x7460  advertising 0x7460  speed 8000
[ 1002.282003]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1002.282004]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1002.282294] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[ 1002.282295]   supported 0x7460  advertising 0x7460  speed 2500
[ 1002.282296]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1002.282296]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1002.282583] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[ 1002.282584]   supported 0x7460  advertising 0x7460  speed 1000
[ 1002.282584]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1002.282585]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1002.648914] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[ 1002.728852] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[ 1002.741076] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[ 1003.262650] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[ 1003.290582] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[ 1003.290583]   supported 0x7460  advertising 0x7460  speed 2500
[ 1003.290584]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1003.290584]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1003.290886] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[ 1003.290887]   supported 0x7460  advertising 0x7460  speed 8000
[ 1003.290887]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1003.290888]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1003.291188] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[ 1003.291188]   supported 0x7460  advertising 0x7460  speed 2500
[ 1003.291189]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1003.291190]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1003.291493] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[ 1003.291494]   supported 0x7460  advertising 0x7460  speed 1000
[ 1003.291494]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1003.291495]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1003.650229] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[ 1003.730167] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[ 1003.742391] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[ 1004.263895] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[ 1004.299670] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[ 1004.299671]   supported 0x7460  advertising 0x7460  speed 2500
[ 1004.299672]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1004.299673]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1004.299986] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[ 1004.299987]   supported 0x7460  advertising 0x7460  speed 8000
[ 1004.299987]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1004.299988]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1004.300293] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[ 1004.300293]   supported 0x7460  advertising 0x7460  speed 2500
[ 1004.300294]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1004.300295]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1004.300600] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[ 1004.300600]   supported 0x7460  advertising 0x7460  speed 1000
[ 1004.300601]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1004.300601]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1004.651587] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[ 1004.731481] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[ 1004.743705] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[ 1005.265285] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[ 1005.308537] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[ 1005.308538]   supported 0x7460  advertising 0x7460  speed 2500
[ 1005.308538]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1005.308539]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1005.308840] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[ 1005.308841]   supported 0x7460  advertising 0x7460  speed 8000
[ 1005.308841]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1005.308842]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1005.309147] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[ 1005.309147]   supported 0x7460  advertising 0x7460  speed 2500
[ 1005.309148]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1005.309149]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1005.309448] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[ 1005.309448]   supported 0x7460  advertising 0x7460  speed 1000
[ 1005.309449]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1005.309450]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1005.652906] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[ 1005.732798] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[ 1005.745020] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0
[ 1006.266543] bnx2x: [bnx2x_set_aer_mmd:3342(eth3)]Set AER to 0x2
[ 1006.317428] bnx2x: [bnx2x_get_settings:251(eth0)]ethtool_cmd: cmd 1
[ 1006.317429]   supported 0x7460  advertising 0x7460  speed 2500
[ 1006.317430]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1006.317431]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1006.317731] bnx2x: [bnx2x_get_settings:251(eth1)]ethtool_cmd: cmd 1
[ 1006.317732]   supported 0x7460  advertising 0x7460  speed 8000
[ 1006.317733]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1006.317733]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1006.318031] bnx2x: [bnx2x_get_settings:251(eth2)]ethtool_cmd: cmd 1
[ 1006.318031]   supported 0x7460  advertising 0x7460  speed 2500
[ 1006.318032]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1006.318033]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1006.318329] bnx2x: [bnx2x_get_settings:251(eth3)]ethtool_cmd: cmd 1
[ 1006.318330]   supported 0x7460  advertising 0x7460  speed 1000
[ 1006.318331]   duplex 1  port 3  phy_address 1  transceiver 0
[ 1006.318331]   autoneg 1  maxtxpkt 0  maxrxpkt 0
[ 1006.654172] bnx2x: [bnx2x_set_aer_mmd:3342(eth1)]Set AER to 0x2
[ 1006.734109] bnx2x: [bnx2x_set_aer_mmd:3342(eth0)]Set AER to 0x0
[ 1006.746331] bnx2x: [bnx2x_set_aer_mmd:3342(eth2)]Set AER to 0x0

^ permalink raw reply

* [PATCH net-next] be2net: fix vfs enumeration
From: Ivan Vecera @ 2012-09-25 12:50 UTC (permalink / raw)
  To: netdev; +Cc: sathya.perla, ajit.khaparde

Current VFs enumeration algorithm used in be_find_vfs does not take domain
number into the match. The match found in igb/ixgbe is more elegant and
safe.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 84379f4..966d9af 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1076,7 +1076,7 @@ static int be_set_vf_tx_rate(struct net_device *netdev,
 static int be_find_vfs(struct be_adapter *adapter, int vf_state)
 {
 	struct pci_dev *dev, *pdev = adapter->pdev;
-	int vfs = 0, assigned_vfs = 0, pos, vf_fn;
+	int vfs = 0, assigned_vfs = 0, pos;
 	u16 offset, stride;
 
 	pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
@@ -1087,9 +1087,7 @@ static int be_find_vfs(struct be_adapter *adapter, int vf_state)
 
 	dev = pci_get_device(pdev->vendor, PCI_ANY_ID, NULL);
 	while (dev) {
-		vf_fn = (pdev->devfn + offset + stride * vfs) & 0xFFFF;
-		if (dev->is_virtfn && dev->devfn == vf_fn &&
-			dev->bus->number == pdev->bus->number) {
+		if (dev->is_virtfn && dev->physfn == pdev) {
 			vfs++;
 			if (dev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
 				assigned_vfs++;
-- 
1.7.8.6

^ permalink raw reply related


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