* Re: [GIT PULL nf-next-2.6 v2] IPVS build fixes and clean-ups
From: Patrick McHardy @ 2011-02-01 13:24 UTC (permalink / raw)
To: Simon Horman
Cc: netdev, linux-next, linux-kernel, lvs-devel, Randy Dunlap,
Stephen Rothwell, Hans Schillstrom
In-Reply-To: <1296554868-17002-1-git-send-email-horms@verge.net.au>
On 01.02.2011 11:07, Simon Horman wrote:
> This short patch series addresses two linux-next build problems
> raised by Randy Dunlap:
>
> * net/netfilter/ipvs/ip_vs_core.c:1891: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int'
> * ERROR: "unregister_net_sysctl_table" [net/netfilter/ipvs/ip_vs.ko]
> ERROR: "register_net_sysctl_table" [net/netfilter/ipvs/ip_vs.ko] undefined!
> * WARNING: net/netfilter/ipvs/ip_vs.o(.init.text+0x161): Section mismatch in reference from the function init_module() to the function .exit.text:ip_vs_sync_cleanup()
>
> The remainder of the changsets are cleanups that I noticed along the way.
>
> The changes are available at
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git master
>
> They are currently compile-tested only.
Just to avoid any confusion, do you want me to pull these patches
already?
^ permalink raw reply
* [PATCH] depca: Fix warnings
From: Alan Cox @ 2011-02-01 11:32 UTC (permalink / raw)
To: netdev
From: Alan Cox <alan@linux.intel.com>
Replace the rather weird use of ++ with + 1 as the value is being assigned
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/net/depca.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 1b48b68..8b0084d 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -1094,7 +1094,7 @@ static int depca_rx(struct net_device *dev)
}
}
/* Change buffer ownership for this last frame, back to the adapter */
- for (; lp->rx_old != entry; lp->rx_old = (++lp->rx_old) & lp->rxRingMask) {
+ for (; lp->rx_old != entry; lp->rx_old = (lp->rx_old + 1) & lp->rxRingMask) {
writel(readl(&lp->rx_ring[lp->rx_old].base) | R_OWN, &lp->rx_ring[lp->rx_old].base);
}
writel(readl(&lp->rx_ring[entry].base) | R_OWN, &lp->rx_ring[entry].base);
@@ -1103,7 +1103,7 @@ static int depca_rx(struct net_device *dev)
/*
** Update entry information
*/
- lp->rx_new = (++lp->rx_new) & lp->rxRingMask;
+ lp->rx_new = (lp->rx_new + 1) & lp->rxRingMask;
}
return 0;
@@ -1148,7 +1148,7 @@ static int depca_tx(struct net_device *dev)
}
/* Update all the pointers */
- lp->tx_old = (++lp->tx_old) & lp->txRingMask;
+ lp->tx_old = (lp->tx_old + 1) & lp->txRingMask;
}
return 0;
^ permalink raw reply related
* Re: x25: possible skb leak on bad facilities
From: Andrew Hendry @ 2011-02-01 11:55 UTC (permalink / raw)
To: Andy Whitcroft
Cc: David S. Miller, John Hughes, linux-x25, netdev, linux-kernel,
Tim Gardner
In-Reply-To: <20110131130826.GC16804@shadowen.org>
There are two callers, when I was crashing it I don't remember it
using the backlog path.
x25_process_rx_frame is called from both x25_backlog_rcv and also
x25_receive_data (via x25_lapb_receive_frame)
But reviewing that second path now it looks like it will also leak, -1
would make it skip the kfree_skb there as well.
So patch looks good to me, when I have some time I'll run it through
the environment I had setup originally to confirm.
On Tue, Feb 1, 2011 at 12:08 AM, Andy Whitcroft <apw@canonical.com> wrote:
> Looking at the changes introduced in the commit below, we seem to
> introduce an skb leak when a packet with bad facilities are present:
>
> commit a6331d6f9a4298173b413cf99a40cc86a9d92c37
> Author: andrew hendry <andrew.hendry@gmail.com>
> Date: Wed Nov 3 12:54:53 2010 +0000
>
> memory corruption in X.25 facilities parsing
>
> If I am understanding things correctly then we trigger a -1 return to
> the main packet dispatch loop, this being non-zero implies that we have
> requeued the skb and it should not be freed. As it was not requeued,
> I believe the skb is no longer referenced and then is leaked.
>
> Perhaps someone better aquainted with this code could review my analysis
> in the patch leader below. If accurate I believe we need the patch below
> to resolve this. If it is not then I suspect a comment is required on
> the -1 return.
>
> Thoughts?
>
> -apw
>
> From 5728c05fb669e8ee1e6d20fb7a71916362039411 Mon Sep 17 00:00:00 2001
> From: Andy Whitcroft <apw@canonical.com>
> Date: Mon, 31 Jan 2011 10:37:36 +0000
> Subject: [PATCH] x25: drop packet on invalid facility headers
>
> The commit below introduced additional checks for invalid facilities,
> and a new return path when these were detected:
>
> commit a6331d6f9a4298173b413cf99a40cc86a9d92c37
> Author: andrew hendry <andrew.hendry@gmail.com>
> Date: Wed Nov 3 12:54:53 2010 +0000
>
> memory corruption in X.25 facilities parsing
>
> This new return path short circuits packet handling, the new return -1
> below:
>
> static int x25_state1_machine(struct sock *sk, struct sk_buff *skb,
> int frametype)
> {
> [...]
> len = x25_parse_facilities(skb, &x25->facilities,
> &x25->dte_facilities,
> &x25->vc_facil_mask);
> if (len > 0)
> skb_pull(skb, len);
> else
> return -1;
> [...]
>
> This return code is passed back up the chain (via x25_process_rx_frame)
> and is interpreted as below by the caller:
>
> int x25_backlog_rcv(struct sock *sk, struct sk_buff *skb)
> {
> int queued = x25_process_rx_frame(sk, skb);
>
> if (!queued)
> kfree_skb(skb);
>
> return 0;
> }
>
> Here we interpret the non-zero status as indicating the skb has been
> requeued and should be preserved. As we have not actually done so it
> will be leaked.
>
> Fix this up by indicating that the packet should be dropped.
>
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
> net/x25/x25_in.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c
> index f729f02..213b93a 100644
> --- a/net/x25/x25_in.c
> +++ b/net/x25/x25_in.c
> @@ -120,7 +120,7 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp
> if (len > 0)
> skb_pull(skb, len);
> else
> - return -1;
> + return 0;
> /*
> * Copy any Call User Data.
> */
> --
> 1.7.1
>
>
^ permalink raw reply
* Re: [PATCH] usb:smsc: preserve MAC address when resetting device
From: David Lamparter @ 2011-02-01 11:24 UTC (permalink / raw)
To: Sergiy Kibrik; +Cc: Steve Glendinning, netdev, linux-usb
In-Reply-To: <1296556457-4969-1-git-send-email-sakib@meta.ua>
[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]
On Tue, Feb 01, 2011 at 12:34:17PM +0200, Sergiy Kibrik wrote:
> Initialize MAC address only once, when device opened first time
> to avoid generation random addresses when failed to read one from ROM.
>
> Some hardware hasn't hw address in ROM, e.g. Pandaboard (http://pandaboard.org),
> so every time device is up, its address is regenerated again.
> It makeis impossible to set custom hw address and also makes DHCP servers and switches crazy.
[snip]
> +++ b/drivers/net/usb/smsc75xx.c
> @@ -77,6 +77,7 @@ struct usb_context {
> };
>
> static int turbo_mode = true;
> +static int first_reset = true;
> module_param(turbo_mode, bool, 0644);
> MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
>
> @@ -836,7 +837,10 @@ static int smsc75xx_reset(struct usbnet *dev)
>
> netif_dbg(dev, ifup, dev->net, "PHY reset complete");
>
> - smsc75xx_init_mac_address(dev);
> + if (first_reset){
> + smsc75xx_init_mac_address(dev);
> + first_reset = false;
> + }
[snip]
You cannot do that. Imagine if I plug in two devices. Only the first one
will get a MAC properly. Or imagine if i plug a device, unplug it and
plug it back. It will have an uninitialized mac address.
You need to move the init_mac_address call to happen on device plug-in.
-David
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH v5 0/4] Adding HID Feature Report Support to hidraw
From: Antonio Ospite @ 2011-02-01 11:47 UTC (permalink / raw)
To: Alan Ott
Cc: Jiri Kosina, Marcel Holtmann, Gustavo F. Padovan, David S. Miller,
Michael Poole, Eric Dumazet, linux-input, linux-kernel, linux-usb,
linux-bluetooth, netdev, Bastien Nocera
In-Reply-To: <1295337880-12452-1-git-send-email-alan@signal11.us>
[-- Attachment #1: Type: text/plain, Size: 942 bytes --]
On Tue, 18 Jan 2011 03:04:36 -0500
Alan Ott <alan@signal11.us> wrote:
> This patch adds Feature Report support for USB and Bluetooth HID devices
> through hidraw.
>
> The first two patches prepare the bluetooth side for the change.
> a. Make sure the hidp_session() thread is started before
> device's probe() functions are called.
> b. Wait for ACK/NAK on sent reports, and return proper
> error codes.
> The third patch is the hidraw core and USB changes.
In particular, this third patch is a prerequisite for the bluez
sixaxis-cable plugin, originally written by Bastien Nocera (added to
CC) which I plan to submit when these changes are merged in mainline
linux.
[...]
--
Antonio Ospite
http://ao2.it
PGP public key ID: 0x4553B001
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* [PATCH net-2.6] bnx2x: multicasts in NPAR mode
From: Vlad Zolotarov @ 2011-02-01 10:57 UTC (permalink / raw)
To: davem@davemloft.net, netdev@vger.kernel.org, Eilon Greenstein
The chip was erroneously configured to accept all multicast frames
in a normal (none-promisc) rx mode both on the RSS and on the FCoE L2 rings
when in an NPAR mode. This caused packet duplication for every received multicast
frame in this mode.
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_main.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 404d93e..f40740e 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -2301,15 +2301,10 @@ static void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters)
/* accept matched ucast */
drop_all_ucast = 0;
}
- if (filters & BNX2X_ACCEPT_MULTICAST) {
+ if (filters & BNX2X_ACCEPT_MULTICAST)
/* accept matched mcast */
drop_all_mcast = 0;
- if (IS_MF_SI(bp))
- /* since mcast addresses won't arrive with ovlan,
- * fw needs to accept all of them in
- * switch-independent mode */
- accp_all_mcast = 1;
- }
+
if (filters & BNX2X_ACCEPT_ALL_UNICAST) {
/* accept all mcast */
drop_all_ucast = 0;
--
1.7.0.4
^ permalink raw reply related
* [PATCH] usb:smsc: preserve MAC address when resetting device
From: Sergiy Kibrik @ 2011-02-01 10:34 UTC (permalink / raw)
To: Steve Glendinning; +Cc: netdev, linux-usb, Sergiy Kibrik
Initialize MAC address only once, when device opened first time
to avoid generation random addresses when failed to read one from ROM.
Some hardware hasn't hw address in ROM, e.g. Pandaboard (http://pandaboard.org),
so every time device is up, its address is regenerated again.
It makeis impossible to set custom hw address and also makes DHCP servers and switches crazy.
Signed-off-by: Sergiy Kibrik <sakib@meta.ua>
---
drivers/net/usb/smsc75xx.c | 6 +++++-
drivers/net/usb/smsc95xx.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 753ee6e..a45dfa2 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -77,6 +77,7 @@ struct usb_context {
};
static int turbo_mode = true;
+static int first_reset = true;
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
@@ -836,7 +837,10 @@ static int smsc75xx_reset(struct usbnet *dev)
netif_dbg(dev, ifup, dev->net, "PHY reset complete");
- smsc75xx_init_mac_address(dev);
+ if (first_reset){
+ smsc75xx_init_mac_address(dev);
+ first_reset = false;
+ }
ret = smsc75xx_set_mac_address(dev);
check_warn_return(ret, "Failed to set mac address");
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index bc86f4b..83008c1 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -59,6 +59,7 @@ struct usb_context {
struct usbnet *dev;
};
+static int first_reset = true;
static int turbo_mode = true;
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
@@ -1045,7 +1046,10 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
pdata->use_tx_csum = DEFAULT_TX_CSUM_ENABLE;
pdata->use_rx_csum = DEFAULT_RX_CSUM_ENABLE;
- smsc95xx_init_mac_address(dev);
+ if (first_reset){
+ smsc95xx_init_mac_address(dev);
+ first_reset = false;
+ }
/* Init all registers */
ret = smsc95xx_reset(dev);
--
1.7.1
^ permalink raw reply related
* Re: Realtek r8168C / r8169 driver VLAN TAG stripping
From: Anand Raj Manickam @ 2011-02-01 10:38 UTC (permalink / raw)
To: Francois Romieu; +Cc: Ivan Vecera, netdev, Hayes
In-Reply-To: <20110201101253.GA8681@electric-eye.fr.zoreil.com>
On Tue, Feb 1, 2011 at 3:42 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
> Ivan Vecera <ivecera@redhat.com> :
> [...]
>> Unfortunately I have no local access (it's placed in China) or remote
>> serial console to the system with this 8168c. The second problem is that
>> the system is connected to the switch that does not pass the packets
>> with VLAN tags -> it seems that at least Tx packets have the VLAN tag.
>>
>> I'm sorry I'm not able to help more.
>
> Thanks a lot for the information, it is both welcome and helpful.
>
> I'll freeze Anand's report for now as "8168c + unspecified glue hardware
> bug with unknown product manufactured by Arkino on unidentified motherboard
> with unknown number of processors".
cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 6
model name : AMD Sempron(tm) 140 Processor
stepping : 2
cpu MHz : 2700.641
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb
rdtscp lm 3dnowext 3dnow constant_tsc up nonstop_tsc extd_apicid pni
monitor cx16 popcnt lahf_lm svm extapic cr8_legacy abm sse4a
misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock
nrip_save
bogomips : 5401.28
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
>
> --
> Ueimor
>
^ permalink raw reply
* Re: [PATCH] r8169: use RxFIFO overflow workaround for 8168c chipset
From: Ivan Vecera @ 2011-02-01 10:30 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, Hayes
In-Reply-To: <20110128172854.GA8151@electric-eye.fr.zoreil.com>
On Fri, 2011-01-28 at 18:28 +0100, Francois Romieu wrote:
> Ivan Vecera <ivecera@redhat.com> :
> [...]
> > The test case was: Migration of the several kvm guests at the same time
> > between two hosts.
>
> :o(
>
> Could you check if simply leaving the irq handler when status == RxFIFOOver
> works by any chance ?
It does not help, I tried two versions:
1) Simply leave the loop (only "break;") when status == RxFIFOOver
...
if (unlikely(status & RxFIFOOver)) {
static int rxfifo_count = 0;
printk("r8169: Rx FIFO overflows detected: %d\n",
++rxfifo_count);
break;
}
...
2) the same but with interrupt confirmation before leave
...
if (unlikely(status & RxFIFOOver)) {
static int rxfifo_count = 0;
printk("r8169: Rx FIFO overflows detected: %d\n",
++rxfifo_count);
RTL_W16(IntrStatus,
(status & RxFIFOOver) ?
(status | RxOverflow) : status);
break;
}
...
In both cases the NIC continues in generating Rx FIFO overflows.
Ivan
>
> Faced with pktgen, RTL_GIGA_MAC_VER_26 spits RxFIFO overflow errors quite
> fast (10000 packets kill it, reliably). The same fix as your avoids the crash.
>
> As is, RTL_GIGA_MAC_VER_12 seems to survive at 900kpps. It signals RXFIFO
> overflow, loses half the packets and sends pause control frames but it does
> not crash. I have made it leave the irq handler when status == RxFIFOOver.
> I'll see if it can stand a few hours like that.
>
^ permalink raw reply
* Re: Realtek r8168C / r8169 driver VLAN TAG stripping
From: Francois Romieu @ 2011-02-01 10:12 UTC (permalink / raw)
To: Ivan Vecera; +Cc: Anand Raj Manickam, netdev, Hayes
In-Reply-To: <1296479698.8750.55.camel@ceranb.intra.cera.cz>
Ivan Vecera <ivecera@redhat.com> :
[...]
> Unfortunately I have no local access (it's placed in China) or remote
> serial console to the system with this 8168c. The second problem is that
> the system is connected to the switch that does not pass the packets
> with VLAN tags -> it seems that at least Tx packets have the VLAN tag.
>
> I'm sorry I'm not able to help more.
Thanks a lot for the information, it is both welcome and helpful.
I'll freeze Anand's report for now as "8168c + unspecified glue hardware
bug with unknown product manufactured by Arkino on unidentified motherboard
with unknown number of processors".
--
Ueimor
^ permalink raw reply
* [PATCH 5/5] IPVS: Remove ip_vs_sync_cleanup from section __exit
From: Simon Horman @ 2011-02-01 10:07 UTC (permalink / raw)
To: netdev, linux-next, linux-kernel, lvs-devel
Cc: Randy Dunlap, Stephen Rothwell, Hans Schillstrom, Patrick McHardy,
Simon Horman
In-Reply-To: <1296554868-17002-1-git-send-email-horms@verge.net.au>
ip_vs_sync_cleanup() may be called from ip_vs_init() on error
and thus needs to be accesible from section __init
Reporte-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_sync.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index d5a6e64..2a2a836 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1686,7 +1686,7 @@ int __init ip_vs_sync_init(void)
return register_pernet_subsys(&ipvs_sync_ops);
}
-void __exit ip_vs_sync_cleanup(void)
+void ip_vs_sync_cleanup(void)
{
unregister_pernet_subsys(&ipvs_sync_ops);
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH 4/5] IPVS: Allow compilation with CONFIG_SYSCTL disabled
From: Simon Horman @ 2011-02-01 10:07 UTC (permalink / raw)
To: netdev, linux-next, linux-kernel, lvs-devel
Cc: Randy Dunlap, Stephen Rothwell, Hans Schillstrom, Patrick McHardy,
Simon Horman
In-Reply-To: <1296554868-17002-1-git-send-email-horms@verge.net.au>
This is a rather naieve approach to allowing PVS to compile with
CONFIG_SYSCTL disabled. I am working on a more comprehensive patch which
will remove compilation of all sysctl-related IPVS code when CONFIG_SYSCTL
is disabled.
Cc: Hans Schillstrom <hans@schillstrom.com>
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_ctl.c | 14 +++++++++-----
net/netfilter/ipvs/ip_vs_lblc.c | 20 ++++++++++----------
net/netfilter/ipvs/ip_vs_lblcr.c | 20 ++++++++++----------
3 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index d7c2fa8..c73b0c8 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -3552,10 +3552,15 @@ int __net_init __ip_vs_control_init(struct net *net)
tbl[idx++].data = &ipvs->sysctl_nat_icmp_send;
+#ifdef CONFIG_SYSCTL
ipvs->sysctl_hdr = register_net_sysctl_table(net, net_vs_ctl_path,
tbl);
- if (ipvs->sysctl_hdr == NULL)
- goto err_reg;
+ if (ipvs->sysctl_hdr == NULL) {
+ if (!net_eq(net, &init_net))
+ kfree(tbl);
+ goto err_dup;
+ }
+#endif
ip_vs_new_estimator(net, ipvs->tot_stats);
ipvs->sysctl_tbl = tbl;
/* Schedule defense work */
@@ -3563,9 +3568,6 @@ int __net_init __ip_vs_control_init(struct net *net)
schedule_delayed_work(&ipvs->defense_work, DEFENSE_TIMER_PERIOD);
return 0;
-err_reg:
- if (!net_eq(net, &init_net))
- kfree(tbl);
err_dup:
free_percpu(ipvs->cpustats);
err_alloc:
@@ -3581,7 +3583,9 @@ static void __net_exit __ip_vs_control_cleanup(struct net *net)
ip_vs_kill_estimator(net, ipvs->tot_stats);
cancel_delayed_work_sync(&ipvs->defense_work);
cancel_work_sync(&ipvs->defense_work.work);
+#ifdef CONFIG_SYSCTL
unregister_net_sysctl_table(ipvs->sysctl_hdr);
+#endif
proc_net_remove(net, "ip_vs_stats_percpu");
proc_net_remove(net, "ip_vs_stats");
proc_net_remove(net, "ip_vs");
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index d5bec33..00b5ffa 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -554,33 +554,33 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
sizeof(vs_vars_table),
GFP_KERNEL);
if (ipvs->lblc_ctl_table == NULL)
- goto err_dup;
+ return -ENOMEM;
} else
ipvs->lblc_ctl_table = vs_vars_table;
ipvs->sysctl_lblc_expiration = 24*60*60*HZ;
ipvs->lblc_ctl_table[0].data = &ipvs->sysctl_lblc_expiration;
+#ifdef CONFIG_SYSCTL
ipvs->lblc_ctl_header =
register_net_sysctl_table(net, net_vs_ctl_path,
ipvs->lblc_ctl_table);
- if (!ipvs->lblc_ctl_header)
- goto err_reg;
+ if (!ipvs->lblc_ctl_header) {
+ if (!net_eq(net, &init_net))
+ kfree(ipvs->lblc_ctl_table);
+ return -ENOMEM;
+ }
+#endif
return 0;
-
-err_reg:
- if (!net_eq(net, &init_net))
- kfree(ipvs->lblc_ctl_table);
-
-err_dup:
- return -ENOMEM;
}
static void __net_exit __ip_vs_lblc_exit(struct net *net)
{
struct netns_ipvs *ipvs = net_ipvs(net);
+#ifdef CONFIG_SYSCTL
unregister_net_sysctl_table(ipvs->lblc_ctl_header);
+#endif
if (!net_eq(net, &init_net))
kfree(ipvs->lblc_ctl_table);
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index 61ae8cf..bfa25f1 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -754,33 +754,33 @@ static int __net_init __ip_vs_lblcr_init(struct net *net)
sizeof(vs_vars_table),
GFP_KERNEL);
if (ipvs->lblcr_ctl_table == NULL)
- goto err_dup;
+ return -ENOMEM;
} else
ipvs->lblcr_ctl_table = vs_vars_table;
ipvs->sysctl_lblcr_expiration = 24*60*60*HZ;
ipvs->lblcr_ctl_table[0].data = &ipvs->sysctl_lblcr_expiration;
+#ifdef CONFIG_SYSCTL
ipvs->lblcr_ctl_header =
register_net_sysctl_table(net, net_vs_ctl_path,
ipvs->lblcr_ctl_table);
- if (!ipvs->lblcr_ctl_header)
- goto err_reg;
+ if (!ipvs->lblcr_ctl_header) {
+ if (!net_eq(net, &init_net))
+ kfree(ipvs->lblcr_ctl_table);
+ return -ENOMEM;
+ }
+#endif
return 0;
-
-err_reg:
- if (!net_eq(net, &init_net))
- kfree(ipvs->lblcr_ctl_table);
^ permalink raw reply related
* [PATCH 3/5] IPVS: Remove unused variables
From: Simon Horman @ 2011-02-01 10:07 UTC (permalink / raw)
To: netdev, linux-next, linux-kernel, lvs-devel
Cc: Randy Dunlap, Stephen Rothwell, Hans Schillstrom, Patrick McHardy,
Simon Horman
In-Reply-To: <1296554868-17002-1-git-send-email-horms@verge.net.au>
These variables are unused as a result of the recent netns work.
Cc: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index b23bea6..5d75fea 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1109,8 +1109,6 @@ extern int ip_vs_icmp_xmit_v6
* we are loaded. Just set ip_vs_drop_rate to 'n' and
* we start to drop 1/rate of the packets
*/
-extern int ip_vs_drop_rate;
-extern int ip_vs_drop_counter;
static inline int ip_vs_todrop(struct netns_ipvs *ipvs)
{
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/5] IPVS: remove duplicate initialisation or rs_table
From: Simon Horman @ 2011-02-01 10:07 UTC (permalink / raw)
To: netdev, linux-next, linux-kernel, lvs-devel
Cc: Randy Dunlap, Stephen Rothwell, Hans Schillstrom, Patrick McHardy,
Simon Horman
In-Reply-To: <1296554868-17002-1-git-send-email-horms@verge.net.au>
Cc: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_ctl.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 98df59a..d7c2fa8 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -3515,9 +3515,6 @@ int __net_init __ip_vs_control_init(struct net *net)
}
spin_lock_init(&ipvs->tot_stats->lock);
- for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)
- INIT_LIST_HEAD(&ipvs->rs_table[idx]);
-
proc_net_fops_create(net, "ip_vs", 0, &ip_vs_info_fops);
proc_net_fops_create(net, "ip_vs_stats", 0, &ip_vs_stats_fops);
proc_net_fops_create(net, "ip_vs_stats_percpu", 0,
--
1.7.2.3
^ permalink raw reply related
* [PATCH 1/5] IPVS: use z modifier for sizeof() argument
From: Simon Horman @ 2011-02-01 10:07 UTC (permalink / raw)
To: netdev, linux-next, linux-kernel, lvs-devel
Cc: Randy Dunlap, Stephen Rothwell, Hans Schillstrom, Patrick McHardy,
Simon Horman
In-Reply-To: <1296554868-17002-1-git-send-email-horms@verge.net.au>
Cc: Hans Schillstrom <hans@schillstrom.com>
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index d889f4f..4d06617 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1887,7 +1887,7 @@ static int __net_init __ip_vs_init(struct net *net)
ipvs->gen = atomic_read(&ipvs_netns_cnt);
atomic_inc(&ipvs_netns_cnt);
net->ipvs = ipvs;
- printk(KERN_INFO "IPVS: Creating netns size=%lu id=%d\n",
+ printk(KERN_INFO "IPVS: Creating netns size=%zu id=%d\n",
sizeof(struct netns_ipvs), ipvs->gen);
return 0;
}
--
1.7.2.3
^ permalink raw reply related
* [GIT PULL nf-next-2.6 v2] IPVS build fixes and clean-ups
From: Simon Horman @ 2011-02-01 10:07 UTC (permalink / raw)
To: netdev, linux-next, linux-kernel, lvs-devel
Cc: Randy Dunlap, Stephen Rothwell, Hans Schillstrom, Patrick McHardy
This short patch series addresses two linux-next build problems
raised by Randy Dunlap:
* net/netfilter/ipvs/ip_vs_core.c:1891: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int'
* ERROR: "unregister_net_sysctl_table" [net/netfilter/ipvs/ip_vs.ko]
ERROR: "register_net_sysctl_table" [net/netfilter/ipvs/ip_vs.ko] undefined!
* WARNING: net/netfilter/ipvs/ip_vs.o(.init.text+0x161): Section mismatch in reference from the function init_module() to the function .exit.text:ip_vs_sync_cleanup()
The remainder of the changsets are cleanups that I noticed along the way.
The changes are available at
git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git master
They are currently compile-tested only.
include/net/ip_vs.h | 2 --
net/netfilter/ipvs/ip_vs_core.c | 2 +-
net/netfilter/ipvs/ip_vs_ctl.c | 17 +++++++++--------
net/netfilter/ipvs/ip_vs_lblc.c | 20 ++++++++++----------
net/netfilter/ipvs/ip_vs_lblcr.c | 20 ++++++++++----------
net/netfilter/ipvs/ip_vs_sync.c | 2 +-
6 files changed, 31 insertions(+), 32 deletions(-)
^ permalink raw reply
* Re: [GIT PULL nf-next-2.6] IPVS build fixes and clean-ups
From: Simon Horman @ 2011-02-01 10:04 UTC (permalink / raw)
To: Randy Dunlap
Cc: netdev, linux-next, linux-kernel, lvs-devel, Stephen Rothwell,
Hans Schillstrom, Patrick McHardy
In-Reply-To: <20110201040634.GA2351@verge.net.au>
On Tue, Feb 01, 2011 at 03:06:37PM +1100, Simon Horman wrote:
> On Mon, Jan 31, 2011 at 04:50:09PM -0800, Randy Dunlap wrote:
> > On Tue, 1 Feb 2011 11:14:11 +1100 Simon Horman wrote:
> >
> > > Hi,
> > >
> > > This short patch series addresses two linux-next build problems
> > > raised by Randy Dunlap:
> > >
> > > * net/netfilter/ipvs/ip_vs_core.c:1891: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int'
> > > * ERROR: "unregister_net_sysctl_table" [net/netfilter/ipvs/ip_vs.ko]
> > > ERROR: "register_net_sysctl_table" [net/netfilter/ipvs/ip_vs.ko] undefined!
> > >
> > > The remainder of the changset is cleanups that I noticed along the way.
> >
> > These 4 patches build successfully for me.
> > However, I do see these warnings (sorry I missed them earlier):
> >
> > WARNING: net/netfilter/ipvs/ip_vs.o(.init.text+0x161): Section mismatch in reference from the function init_module() to the function .exit.text:ip_vs_sync_cleanup()
> > WARNING: net/netfilter/ipvs/ip_vs.o(.init.text+0x161): Section mismatch in reference from the function init_module() to the function .exit.text:ip_vs_sync_cleanup()
>
> Thanks, I'll look into that. I will be travelling for a good portion of the
> next day and a bit so I apologise in advance if that delays my next patch.
Hi,
I the following patch seems to be the right fix for this to me.
I will send an amended pull request.
IPVS: Remove ip_vs_sync_cleanup from section __exit
ip_vs_sync_cleanup() may be called from ip_vs_init() on error
and thus needs to be accesible from section __init
Reporte-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_sync.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index d5a6e64..2a2a836 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1686,7 +1686,7 @@ int __init ip_vs_sync_init(void)
return register_pernet_subsys(&ipvs_sync_ops);
}
-void __exit ip_vs_sync_cleanup(void)
+void ip_vs_sync_cleanup(void)
{
unregister_pernet_subsys(&ipvs_sync_ops);
}
--
1.7.2.3
^ permalink raw reply related
* Re:....
From: Young Chang @ 2011-02-01 10:01 UTC (permalink / raw)
May I ask if you would be eligible to pursue a Business Proposal of $19.7m with me if you dont mind? Let me know if you are interested.
^ permalink raw reply
* [patch 6/7] [PATCH] s390: Fix wrong size in memcmp (netiucv)
From: frank.blaschka @ 2011-02-01 8:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Stefan Weil
In-Reply-To: <20110201081647.173934635@de.ibm.com>
[-- Attachment #1: 609-netiucv-memcmp-size.diff --]
[-- Type: text/plain, Size: 850 bytes --]
From: Stefan Weil <weil@mail.berlios.de>
This error was reported by cppcheck:
drivers/s390/net/netiucv.c:568: error: Using sizeof for array given
as function argument returns the size of pointer.
sizeof(ipuser) did not result in 16 (as many programmers would have
expected) but sizeof(u8 *), so it is 4 or 8, too small here.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/netiucv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -565,7 +565,7 @@ static int netiucv_callback_connreq(stru
struct iucv_event ev;
int rc;
- if (memcmp(iucvMagic, ipuser, sizeof(ipuser)))
+ if (memcmp(iucvMagic, ipuser, 16))
/* ipuser must match iucvMagic. */
return -EINVAL;
rc = -EINVAL;
^ permalink raw reply
* [patch 3/7] [PATCH] net,s390: provide architecture specific NET_SKB_PAD
From: frank.blaschka @ 2011-02-01 8:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Horst Hartmann
In-Reply-To: <20110201081647.173934635@de.ibm.com>
[-- Attachment #1: 606-net-skb-pad.diff --]
[-- Type: text/plain, Size: 1352 bytes --]
From: Horst Hartmann <horsth@linux.vnet.ibm.com>
NET_SKB_PAD has been increased from 32 to 64 and later to max(32, L1_CACHE_BYTES).
This led to a 25% throughput decrease for streaming workloads accompanied by a
37% CPU cost increase on s390.
In order to fix this provide an architecture specific NET_SKB_PAD config symbol.
Signed-off-by: Horst Hartmann <horsth@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
arch/s390/Kconfig | 4 ++++
include/linux/skbuff.h | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -49,6 +49,10 @@ config NO_DMA
config ARCH_DMA_ADDR_T_64BIT
def_bool 64BIT
+config NET_SKB_PAD
+ int
+ default "32"
+
config GENERIC_LOCKBREAK
def_bool y if SMP && PREEMPT
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1431,8 +1431,10 @@ static inline int pskb_network_may_pull(
* get_rps_cpus() for example only access one 64 bytes aligned block :
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
*/
-#ifndef NET_SKB_PAD
+#ifndef CONFIG_NET_SKB_PAD
#define NET_SKB_PAD max(32, L1_CACHE_BYTES)
+#else
+#define NET_SKB_PAD CONFIG_NET_SKB_PAD
#endif
extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
^ permalink raw reply
* [patch 2/7] [PATCH] qeth: add more strict MTU checking
From: frank.blaschka @ 2011-02-01 8:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
In-Reply-To: <20110201081647.173934635@de.ibm.com>
[-- Attachment #1: 605-qeth-mtu-checking.diff --]
[-- Type: text/plain, Size: 2285 bytes --]
From: Frank Blaschka <frank.blaschka@de.ibm.com>
HiperSockets and OSA hardware report a maximum MTU size. Add checking
to reject larger MTUs than allowed by hardware.
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 35 ++++-------------------------------
1 file changed, 4 insertions(+), 31 deletions(-)
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1832,33 +1832,6 @@ static inline int qeth_get_initial_mtu_f
}
}
-static inline int qeth_get_max_mtu_for_card(int cardtype)
-{
- switch (cardtype) {
-
- case QETH_CARD_TYPE_UNKNOWN:
- case QETH_CARD_TYPE_OSD:
- case QETH_CARD_TYPE_OSN:
- case QETH_CARD_TYPE_OSM:
- case QETH_CARD_TYPE_OSX:
- return 61440;
- case QETH_CARD_TYPE_IQD:
- return 57344;
- default:
- return 1500;
- }
-}
-
-static inline int qeth_get_mtu_out_of_mpc(int cardtype)
-{
- switch (cardtype) {
- case QETH_CARD_TYPE_IQD:
- return 1;
- default:
- return 0;
- }
-}
-
static inline int qeth_get_mtu_outof_framesize(int framesize)
{
switch (framesize) {
@@ -1881,10 +1854,9 @@ static inline int qeth_mtu_is_valid(stru
case QETH_CARD_TYPE_OSD:
case QETH_CARD_TYPE_OSM:
case QETH_CARD_TYPE_OSX:
- return ((mtu >= 576) && (mtu <= 61440));
case QETH_CARD_TYPE_IQD:
return ((mtu >= 576) &&
- (mtu <= card->info.max_mtu + 4096 - 32));
+ (mtu <= card->info.max_mtu));
case QETH_CARD_TYPE_OSN:
case QETH_CARD_TYPE_UNKNOWN:
default:
@@ -1907,7 +1879,7 @@ static int qeth_ulp_enable_cb(struct qet
memcpy(&card->token.ulp_filter_r,
QETH_ULP_ENABLE_RESP_FILTER_TOKEN(iob->data),
QETH_MPC_TOKEN_LENGTH);
- if (qeth_get_mtu_out_of_mpc(card->info.type)) {
+ if (card->info.type == QETH_CARD_TYPE_IQD) {
memcpy(&framesize, QETH_ULP_ENABLE_RESP_MAX_MTU(iob->data), 2);
mtu = qeth_get_mtu_outof_framesize(framesize);
if (!mtu) {
@@ -1920,7 +1892,8 @@ static int qeth_ulp_enable_cb(struct qet
card->qdio.in_buf_size = mtu + 2 * PAGE_SIZE;
} else {
card->info.initial_mtu = qeth_get_initial_mtu_for_card(card);
- card->info.max_mtu = qeth_get_max_mtu_for_card(card->info.type);
+ card->info.max_mtu = *(__u16 *)QETH_ULP_ENABLE_RESP_MAX_MTU(
+ iob->data);
card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT;
}
^ permalink raw reply
* [patch 1/7] [PATCH] qeth: show new mac-address if its setting fails
From: frank.blaschka @ 2011-02-01 8:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula Braun
In-Reply-To: <20110201081647.173934635@de.ibm.com>
[-- Attachment #1: 604-qeth-mac-address.diff --]
[-- Type: text/plain, Size: 1152 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
Setting of a MAC-address may fail because an already used MAC-address
is to bet set or because of authorization problems. In those cases
qeth issues a message, but the mentioned MAC-address is not the
new MAC-address to be set, but the actual MAC-address. This patch
chooses now the new MAC-address to be set for the error messages.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_l2_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -573,13 +573,13 @@ static int qeth_l2_send_setmac_cb(struct
case IPA_RC_L2_DUP_LAYER3_MAC:
dev_warn(&card->gdev->dev,
"MAC address %pM already exists\n",
- card->dev->dev_addr);
+ cmd->data.setdelmac.mac);
break;
case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP:
case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP:
dev_warn(&card->gdev->dev,
"MAC address %pM is not authorized\n",
- card->dev->dev_addr);
+ cmd->data.setdelmac.mac);
break;
default:
break;
^ permalink raw reply
* [patch 7/7] [PATCH] s390: Fix possibly wrong size in strncmp (smsgiucv)
From: frank.blaschka @ 2011-02-01 8:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Stefan Weil
In-Reply-To: <20110201081647.173934635@de.ibm.com>
[-- Attachment #1: 610-smsgiucv-strncmp-size.diff --]
[-- Type: text/plain, Size: 951 bytes --]
From: Stefan Weil <weil@mail.berlios.de>
This error was reported by cppcheck:
drivers/s390/net/smsgiucv.c:63: error: Using sizeof for array given as
function argument returns the size of pointer.
Although there is no runtime problem as long as sizeof(u8 *) == 8,
this misleading code should get fixed.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/smsgiucv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -60,7 +60,7 @@ static struct iucv_handler smsg_handler
static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8],
u8 ipuser[16])
{
- if (strncmp(ipvmid, "*MSG ", sizeof(ipvmid)) != 0)
+ if (strncmp(ipvmid, "*MSG ", 8) != 0)
return -EINVAL;
/* Path pending from *MSG. */
return iucv_path_accept(path, &smsg_handler, "SMSGIUCV ", NULL);
^ permalink raw reply
* [patch 5/7] [PATCH] qeth: allow OSA CHPARM change in suspend state
From: frank.blaschka @ 2011-02-01 8:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, Ursula braun
In-Reply-To: <20110201081647.173934635@de.ibm.com>
[-- Attachment #1: 608-qeth-osa-chparm-change.diff --]
[-- Type: text/plain, Size: 4525 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
For OSA the CHPARM-definition determines the number of available
outbound queues.
A CHPARM-change may occur while a Linux system with probed
OSA device is in suspend state. This patch enables proper
resuming of an OSA device in this case.
Signed-off-by: Ursula braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 104 +++++++++++++++++++++++---------------
1 file changed, 63 insertions(+), 41 deletions(-)
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -988,16 +988,30 @@ static void qeth_get_channel_path_desc(s
chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0);
if (chp_dsc != NULL) {
/* CHPP field bit 6 == 1 -> single queue */
- if ((chp_dsc->chpp & 0x02) == 0x02)
+ if ((chp_dsc->chpp & 0x02) == 0x02) {
+ if ((atomic_read(&card->qdio.state) !=
+ QETH_QDIO_UNINITIALIZED) &&
+ (card->qdio.no_out_queues == 4))
+ /* change from 4 to 1 outbound queues */
+ qeth_free_qdio_buffers(card);
card->qdio.no_out_queues = 1;
+ if (card->qdio.default_out_queue != 0)
+ dev_info(&card->gdev->dev,
+ "Priority Queueing not supported\n");
+ card->qdio.default_out_queue = 0;
+ } else {
+ if ((atomic_read(&card->qdio.state) !=
+ QETH_QDIO_UNINITIALIZED) &&
+ (card->qdio.no_out_queues == 1)) {
+ /* change from 1 to 4 outbound queues */
+ qeth_free_qdio_buffers(card);
+ card->qdio.default_out_queue = 2;
+ }
+ card->qdio.no_out_queues = 4;
+ }
card->info.func_level = 0x4100 + chp_dsc->desc;
kfree(chp_dsc);
}
- if (card->qdio.no_out_queues == 1) {
- card->qdio.default_out_queue = 0;
- dev_info(&card->gdev->dev,
- "Priority Queueing not supported\n");
- }
QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues);
QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level);
return;
@@ -3756,6 +3770,47 @@ static inline int qeth_get_qdio_q_format
}
}
+static void qeth_determine_capabilities(struct qeth_card *card)
+{
+ int rc;
+ int length;
+ char *prcd;
+ struct ccw_device *ddev;
+ int ddev_offline = 0;
+
+ QETH_DBF_TEXT(SETUP, 2, "detcapab");
+ ddev = CARD_DDEV(card);
+ if (!ddev->online) {
+ ddev_offline = 1;
+ rc = ccw_device_set_online(ddev);
+ if (rc) {
+ QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
+ goto out;
+ }
+ }
+
+ rc = qeth_read_conf_data(card, (void **) &prcd, &length);
+ if (rc) {
+ QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n",
+ dev_name(&card->gdev->dev), rc);
+ QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc);
+ goto out_offline;
+ }
+ qeth_configure_unitaddr(card, prcd);
+ qeth_configure_blkt_default(card, prcd);
+ kfree(prcd);
+
+ rc = qdio_get_ssqd_desc(ddev, &card->ssqd);
+ if (rc)
+ QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
+
+out_offline:
+ if (ddev_offline == 1)
+ ccw_device_set_offline(ddev);
+out:
+ return;
+}
+
static int qeth_qdio_establish(struct qeth_card *card)
{
struct qdio_initialize init_data;
@@ -3886,6 +3941,7 @@ int qeth_core_hardsetup_card(struct qeth
QETH_DBF_TEXT(SETUP, 2, "hrdsetup");
atomic_set(&card->force_alloc_skb, 0);
+ qeth_get_channel_path_desc(card);
retry:
if (retries)
QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n",
@@ -3914,6 +3970,7 @@ retriable:
else
goto retry;
}
+ qeth_determine_capabilities(card);
qeth_init_tokens(card);
qeth_init_func_level(card);
rc = qeth_idx_activate_channel(&card->read, qeth_idx_read_cb);
@@ -4183,41 +4240,6 @@ void qeth_core_free_discipline(struct qe
card->discipline.ccwgdriver = NULL;
}
-static void qeth_determine_capabilities(struct qeth_card *card)
-{
- int rc;
- int length;
- char *prcd;
-
- QETH_DBF_TEXT(SETUP, 2, "detcapab");
- rc = ccw_device_set_online(CARD_DDEV(card));
- if (rc) {
- QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
- goto out;
- }
-
-
- rc = qeth_read_conf_data(card, (void **) &prcd, &length);
- if (rc) {
- QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n",
- dev_name(&card->gdev->dev), rc);
- QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc);
- goto out_offline;
- }
- qeth_configure_unitaddr(card, prcd);
- qeth_configure_blkt_default(card, prcd);
- kfree(prcd);
-
- rc = qdio_get_ssqd_desc(CARD_DDEV(card), &card->ssqd);
- if (rc)
- QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
-
-out_offline:
- ccw_device_set_offline(CARD_DDEV(card));
-out:
- return;
-}
-
static int qeth_core_probe_device(struct ccwgroup_device *gdev)
{
struct qeth_card *card;
^ permalink raw reply
* [patch 0/7] s390: network patches for net-next
From: frank.blaschka @ 2011-02-01 8:16 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390
Hi Dave,
here are some patches for net-next.
shortlog:
Ursula Braun (3)
qeth: show new mac-address if its setting fails
qeth: allow HiperSockets framesize change in suspend
qeth: allow OSA CHPARM change in suspend state
Frank Blaschka (1)
qeth: add more strict MTU checking
Horst Hartmann (1)
net,s390: provide architecture specific NET_SKB_PAD
Stefan Weil (2)
s390: Fix wrong size in memcmp (netiucv)
s390: Fix possibly wrong size in strncmp (smsgiucv)
Thanks,
Frank
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox