* Re: ipcomp regression in 2.6.24
From: Marco Berizzi @ 2008-02-08 9:12 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20080129.211227.160323820.davem@davemloft.net>
David Miller wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Wed, 30 Jan 2008 14:15:33 +1100
>
> > Marco Berizzi <pupilla@hotmail.com> wrote:
> > >
> > >> > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine,
data
> > >> > flows in both directions, but no data comes out of the tunnel.
> > >> > Needed to disable ipcomp.
> > >
> > > Same problem here: linux 2.6.24 driven by openswan 2.4.11
> > > on Slackware 11.0
> >
> > My bad. This patch should fix it.
> >
> > [IPCOMP]: Fetch nexthdr before ipch is destroyed
> >
> > When I moved the nexthdr setting out of IPComp I accidently moved
> > the reading of ipch->nexthdr after the decompression. Unfortunately
> > this means that we'd be reading from a stale ipch pointer which
> > doesn't work very well.
> >
> > This patch moves the reading up so that we get the correct nexthdr
> > value.
> >
> > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> Applied, and queued for -stable, thanks!
Hi David,
I haven't seen this patch in Greg 2.6.24-stable
review message.
^ permalink raw reply
* Re: ipcomp regression in 2.6.24
From: David Miller @ 2008-02-08 9:51 UTC (permalink / raw)
To: pupilla; +Cc: netdev
In-Reply-To: <BAY103-DAV366423029E541B55E047CB22F0@phx.gbl>
From: "Marco Berizzi" <pupilla@hotmail.com>
Date: Fri, 8 Feb 2008 10:12:25 +0100
> I haven't seen this patch in Greg 2.6.24-stable
> review message.
Due to having just returned from LCA08 I haven't
made any -stable submissions in a while, and I
notified Greg of this tonight.
The networking fixes will make it into the next
2.6.24.x release.
^ permalink raw reply
* [PATCH] smc91x: Add MigoR board support
From: Magnus Damm @ 2008-02-08 9:49 UTC (permalink / raw)
To: netdev; +Cc: Magnus Damm, linux-sh
This patch adds MigoR board support to the smc91x driver.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
drivers/net/smc91x.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- 0001/drivers/net/smc91x.h
+++ work/drivers/net/smc91x.h 2008-02-06 23:13:55.000000000 +0900
@@ -306,6 +306,20 @@ SMC_outw(u16 val, void __iomem *ioaddr,
#define SMC_insw(a, r, p, l) insw((a) + (r), p, l)
#define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l)
+#elif defined(CONFIG_SH_MIGOR)
+
+#define SMC_IRQ_FLAGS (-1)
+#define SMC_CAN_USE_8BIT 0
+#define SMC_CAN_USE_16BIT 1
+#define SMC_CAN_USE_32BIT 0
+#define SMC_IO_SHIFT 0
+#define SMC_NOWAIT 1
+
+#define SMC_inw(a, r) inw((a) + (r))
+#define SMC_outw(v, a, r) outw(v, (a) + (r))
+#define SMC_insw(a, r, p, l) insw((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l)
+
#else /* BOARDS */
#define SMC_CAN_USE_8BIT 1
^ permalink raw reply
* [PATCH] [IPV6] Replace using the magic constant "1024" with IP6_RT_PRIO_USER for fc_metric.
From: Rami Rosen @ 2008-02-08 10:14 UTC (permalink / raw)
To: David Miller, netdev
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
Hi,
This patch replaces the explicit usage of the magic constant "1024"
with IP6_RT_PRIO_USER in the IPV6 tree.
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 799 bytes --]
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 513f72e..6e7b56e 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1620,7 +1620,7 @@ static struct rt6_info *rt6_add_route_info(struct in6_addr *prefix, int prefixle
{
struct fib6_config cfg = {
.fc_table = RT6_TABLE_INFO,
- .fc_metric = 1024,
+ .fc_metric = IP6_RT_PRIO_USER,
.fc_ifindex = ifindex,
.fc_dst_len = prefixlen,
.fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO |
@@ -1670,7 +1670,7 @@ struct rt6_info *rt6_add_dflt_router(struct in6_addr *gwaddr,
{
struct fib6_config cfg = {
.fc_table = RT6_TABLE_DFLT,
- .fc_metric = 1024,
+ .fc_metric = IP6_RT_PRIO_USER,
.fc_ifindex = dev->ifindex,
.fc_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_DEFAULT |
RTF_UP | RTF_EXPIRES | RTF_PREF(pref),
^ permalink raw reply related
* tg3 kernel BUG at include/linux/netdevice.h:918!
From: Frank van Maarseveen @ 2008-02-08 10:06 UTC (permalink / raw)
To: netdev
FWIW,
kernel 2.6.22.10, tainted with nvidia and vmware. BUG triggered twice
now when a large number of processes (unrelated to vmware) tried to send
lots of TCP data to other linux boxes (real, not virtual). tg3 TSO has
been disabled with ethtool.
kernel BUG at include/linux/netdevice.h:918!
invalid opcode: 0000 [#1]
SMP
Modules linked in: nvidia(P) vmnetfilter vmnet(P) vmmon(P) vmthrottle sysprof
CPU: 0
EIP: 0060:[<c0344b61>] Tainted: P VLI
EFLAGS: 00010046 (2.6.22.10-x168 #1)
EIP is at tg3_poll+0x161/0x1c0
eax: 00000006 ebx: f7445000 ecx: 00000000 edx: f7532000
esi: f7445600 edi: 00000202 ebp: e1f55bcc esp: e1f55bb4
ds: 007b es: 007b fs: 00d8 gs: 0033 ss: 0068
Process fcp (pid: 13068, ti=e1f54000 task=dc6fb400 task.ti=e1f54000)
Stack: e1f55bcc 00000001 e1f55bdc f7445000 c2b3aa80 c2a22d2c e1f55bec c04b8e4d
0ae106dd c2a22d00 0000012c 00000005 c0796b18 c07fb820 e1f55c08 c0128de8
00000000 0000000a 00000246 f7445000 c7a179ac e1f55c14 c0128eac f7445200
Call Trace:
[<c01054aa>] show_trace_log_lvl+0x1a/0x30
[<c010557a>] show_stack_log_lvl+0x9a/0xc0
[<c01057d6>] show_registers+0x1d6/0x2e0
[<c0105a46>] die+0x106/0x240
[<c0105c11>]
do_trap+0x91/0xd0
[<c0105eb9>] do_invalid_op+0x89/0xa0
[<c0575b42>] error_code+0x72/0x80
[<c04b8e4d>] net_rx_action+0x8d/0x170
[<c0128de8>] __do_softirq+0x78/0x100
[<c0128eac>] do_softirq+0x3c/0x40
[<c0128cf0>] local_bh_enable+0x80/0xb0
[<c04b85f2>] dev_queue_xmit+0x222/0x310
[<c04f0de4>] ip_output+0x1d4/0x350
[<c04f13bc>] ip_queue_xmit+0x45c/0x480
[<c0502e06>] tcp_transmit_skb+0x2b6/0x490
[<c050461a>] tcp_write_xmit+0x18a/0x260
[<c0504707>] __tcp_push_pending_frames+0x17/0x80
[<c04f88c0>] tcp_sendmsg+0x780/0xbe0
[<c04acb67>] do_sock_write+0x97/0xb0
[<c04acbea>] sock_aio_write+0x6a/0x80
[<c0173b47>]
do_sync_write+0xc7/0x120
[<c0173cbf>] vfs_write+0x11f/0x130
[<c0173d7d>] sys_write+0x3d/0x70
[<c0104132>] syscall_call+0x7/0xb
=======================
Code: e0 fd 83 c8 01 89 07 8d 83 04 06 00 00 89 45 e8 e8 c5
0a 23 00 31 d2 89 f0 e8 7c f4 ff ff 8b 45 e8 e8 c4 0b 23 00 e9 c9 fe ff ff <0f> 0b
eb fe 9c 5f fa 8b 43
2c a8 20 74 40
8d 8b 80
01 00 00
8b
EIP: [<c0344b61>]
tg3_poll+0x161/0x1c0 SS:ESP 0068:e1f55bb4
Kernel panic - not syncing: Fatal exception in interrupt
913 /* same as netif_rx_complete, except that local_irq_save(flags)
914 * has already been issued
915 */
916 static inline void __netif_rx_complete(struct net_device *dev)
917 {
>918 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
919 list_del(&dev->poll_list);
920 smp_mb__before_clear_bit();
921 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
922 }
--
Frank
^ permalink raw reply
* Re: [PATCHv2] net: sh_eth: Add support for Renesas SuperH Ethernet
From: Yoshihiro Shimoda @ 2008-02-08 10:40 UTC (permalink / raw)
To: Andrew Morton; +Cc: jgarzik, netdev, David Brownell
In-Reply-To: <20080207010529.868e931b.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Thu, 07 Feb 2008 17:39:23 +0900 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> wrote:
>
>> Add support for Renesas SuperH Ethernet controller.
>> This driver supported SH7710 and SH7712.
>>
>
> Nice looking driver.
>
> Quick comments:
Thank you very much for your comment.
>> +static void __init update_mac_address(struct net_device *ndev)
>>
>> --- snip ---
>>
>> +static void __init read_mac_address(struct net_device *ndev)
>
> Both the above functions are called from non-__init code and hence cannot
> be __init. sh_eth_tsu_init() is wrong too. Please check all section
> annotations in the driver.
I understood it. I will modify it.
>> +struct bb_info {
>> + struct mdiobb_ctrl ctrl;
>> + u32 addr;
>> + u32 mmd_msk;/* MMD */
>> + u32 mdo_msk;
>> + u32 mdi_msk;
>> + u32 mdc_msk;
>> +};
>
> Please cc David Brownell on updates to this driver - perhaps he will find
> time to review the bit-banging interface usage.
>
>> +/* PHY bit set */
>> +static void bb_set(u32 addr, u32 msk)
>> +{
>> + ctrl_outl(ctrl_inl(addr) | msk, addr);
>> +}
>> +
>> +/* PHY bit clear */
>> +static void bb_clr(u32 addr, u32 msk)
>> +{
>> + ctrl_outl((ctrl_inl(addr) & ~msk), addr);
>> +}
>> +
>> +/* PHY bit read */
>> +static int bb_read(u32 addr, u32 msk)
>> +{
>> + return (ctrl_inl(addr) & msk) != 0;
>> +}
>> +
>> +/* Data I/O pin control */
>> +static inline void sh__mmd_ctrl(struct mdiobb_ctrl *ctrl, int bit)
>> +{
>> + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
>> + if (bit)
>> + bb_set(bitbang->addr, bitbang->mmd_msk);
>> + else
>> + bb_clr(bitbang->addr, bitbang->mmd_msk);
>> +}
>> +
>> +/* Set bit data*/
>> +static inline void sh__set_mdio(struct mdiobb_ctrl *ctrl, int bit)
>> +{
>> + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
>> +
>> + if (bit)
>> + bb_set(bitbang->addr, bitbang->mdo_msk);
>> + else
>> + bb_clr(bitbang->addr, bitbang->mdo_msk);
>> +}
>> +
>> +/* Get bit data*/
>> +static inline int sh__get_mdio(struct mdiobb_ctrl *ctrl)
>> +{
>> + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
>> + return bb_read(bitbang->addr, bitbang->mdi_msk);
>> +}
>
> There seems to be a fairly random mixture of inline and non-inline here.
> I'd suggest that you just remove all the `inline's. The compiler does a
> pretty good job of working doing this for you.
I understood it. I will remove inline. I will not use inline in future
as far as there is not a special reason.
>> +/* MDC pin control */
>> +static inline void sh__mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit)
>> +{
>> + struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
>> +
>> + if (bit)
>> + bb_set(bitbang->addr, bitbang->mdc_msk);
>> + else
>> + bb_clr(bitbang->addr, bitbang->mdc_msk);
>> +}
>> +
>> +/* mdio bus control struct */
>> +static struct mdiobb_ops bb_ops = {
>> + .owner = THIS_MODULE,
>> + .set_mdc = sh__mdc_ctrl,
>> + .set_mdio_dir = sh__mmd_ctrl,
>> + .set_mdio_data = sh__set_mdio,
>> + .get_mdio_data = sh__get_mdio,
>> +};
>
> It's particularly inappropriate that sh__mdc_ctrl() was inlined - it is
> only ever called via a function pointer and hence will never be inlined!
I understood it.
>> ...
>>
>> +static void sh_eth_timer(unsigned long data)
>> +{
>> + struct net_device *ndev = (struct net_device *)data;
>> + struct sh_eth_private *mdp = netdev_priv(ndev);
>> + int next_tick = 10 * HZ;
>> +
>> + /* We could do something here... nah. */
>> + mdp->timer.expires = jiffies + next_tick;
>> + add_timer(&mdp->timer);
>
> mod_timer() would be neater here.
>
>> +}
>>
>> --- snip ---
>>
>> + /* Set the timer to check for link beat. */
>> + init_timer(&mdp->timer);
>> + mdp->timer.expires = (jiffies + (24 * HZ)) / 10;/* 2.4 sec. */
>> + mdp->timer.data = (u32) ndev;
>> + mdp->timer.function = sh_eth_timer; /* timer handler */
>
> setup_timer()
I understood it. I will modify these.
>> +}
>> +
>>
>> +#ifdef __LITTLE_ENDIAN__
>> +static inline void swaps(char *src, int len)
>> +{
>> + u32 *p = (u32 *)src;
>> + u32 *maxp;
>> + maxp = p + ((len + sizeof(u32) - 1) / sizeof(u32));
>> +
>> + for (; p < maxp; p++)
>> + *p = swab32(*p);
>> +}
>> +#else
>> +#define swaps(x, y)
>> +#endif
>> +
>
> I'd say that the big-endian version of swaps() should be a C function
> rather than a macro. It's nicer to look at, consistent, provides typechecking,
> can help avoid unused-variable warnings (an inline function provides a
> reference to the arguments whereas a macro does not).
>
> The little-endian version of this function is too large to be inlined.
>
> This function looks fairly generic. Are we sure there isn't some library
> function which does this?
>
I looked for lib/ and include/linux/ and include/linux/byteorder/, but
such function was not found. So I will modify swaps().
Thanks,
Yoshihiro Shimoda
^ permalink raw reply
* Re: oops with ipcomp
From: Beschorner Daniel @ 2008-02-08 10:45 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
In-Reply-To: <20080208085836.GC14650@gondor.apana.org.au>
> No I meant the exact output of ip x p and ip x s.
I know, but as I end up every time with a tainted kernel on our
production server I didn't turn ipcomp on, but now I got it.
src Net_B dst A
dir in priority 2088
tmpl src B dst A
proto comp reqid 16394 mode tunnel
level use
tmpl src 0.0.0.0 dst 0.0.0.0
proto esp reqid 16393 mode transport
src Net_B dst Net_A
dir in priority 2344
tmpl src B dst A
proto comp reqid 16390 mode tunnel
level use
tmpl src 0.0.0.0 dst 0.0.0.0
proto esp reqid 16389 mode transport
src A dst Net_B
dir out priority 2088
tmpl src A dst B
proto comp reqid 16394 mode tunnel
tmpl src 0.0.0.0 dst 0.0.0.0
proto esp reqid 16393 mode transport
src Net_A dst Net_B
dir out priority 2344
tmpl src A dst B
proto comp reqid 16390 mode tunnel
tmpl src 0.0.0.0 dst 0.0.0.0
proto esp reqid 16389 mode transport
src Net_B dst A
dir fwd priority 2088
tmpl src B dst A
proto comp reqid 16394 mode tunnel
level use
tmpl src 0.0.0.0 dst 0.0.0.0
proto esp reqid 16393 mode transport
src Net_B dst Net_A
dir fwd priority 2344
tmpl src B dst A
proto comp reqid 16390 mode tunnel
level use
tmpl src 0.0.0.0 dst 0.0.0.0
proto esp reqid 16389 mode transport
src A dst B
proto comp spi 0x0000427e reqid 16390 mode tunnel
replay-window 0
comp deflate 0x
sel src 0.0.0.0/0 dst 0.0.0.0/0
src B dst A
proto comp spi 0x0000ecf0 reqid 16390 mode tunnel
replay-window 0
comp deflate 0x
sel src 0.0.0.0/0 dst 0.0.0.0/0
src A dst B
proto esp spi 0x53f15e96 reqid 16389 mode transport
replay-window 32
auth hmac(sha1) 0x...
enc cbc(aes) 0x...
sel src 0.0.0.0/0 dst 0.0.0.0/0
src B dst A
proto esp spi 0x7b329066 reqid 16389 mode transport
replay-window 32
auth hmac(sha1) 0...
enc cbc(aes) 0x...
sel src 0.0.0.0/0 dst 0.0.0.0/0
src A dst B
proto (null) spi 0x53ec987a reqid 0 mode tunnel
replay-window 0
sel src 0.0.0.0/0 dst 0.0.0.0/0
src B dst A
proto (null) spi 0xc19ef67c reqid 0 mode tunnel
replay-window 0
sel src 0.0.0.0/0 dst 0.0.0.0/0
src A dst B
proto comp spi 0x00001314 reqid 16394 mode tunnel
replay-window 0
comp deflate 0x
sel src 0.0.0.0/0 dst 0.0.0.0/0
src B dst A
proto comp spi 0x000032ff reqid 16394 mode tunnel
replay-window 0
comp deflate 0x
sel src 0.0.0.0/0 dst 0.0.0.0/0
src A dst B
proto esp spi 0xec7d12de reqid 16393 mode transport
replay-window 32
auth hmac(sha1) 0x...
enc cbc(aes) 0x...
sel src 0.0.0.0/0 dst 0.0.0.0/0
src B dst A
proto esp spi 0x75016d2d reqid 16393 mode transport
replay-window 32
auth hmac(sha1) 0x...
enc cbc(aes) 0x...
sel src 0.0.0.0/0 dst 0.0.0.0/0
^ permalink raw reply
* [PATCH 1/2][SCTP]: Use snmp_fold_field instead of a homebrew analogue.
From: Pavel Emelyanov @ 2008-02-08 11:04 UTC (permalink / raw)
To: David Miller; +Cc: Vlad Yasevich, lksctp-developers, Linux Netdev List
SCPT already depends in INET, so this doesn't create additional
dependencies.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
net/sctp/proc.c | 23 ++---------------------
1 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 2499732..974350b 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -38,6 +38,7 @@
#include <linux/seq_file.h>
#include <linux/init.h>
#include <net/sctp/sctp.h>
+#include <net/ip.h> /* for snmp_fold_field */
static struct snmp_mib sctp_snmp_list[] = {
SNMP_MIB_ITEM("SctpCurrEstab", SCTP_MIB_CURRESTAB),
@@ -75,26 +76,6 @@ static struct snmp_mib sctp_snmp_list[] = {
SNMP_MIB_SENTINEL
};
-/* Return the current value of a particular entry in the mib by adding its
- * per cpu counters.
- */
-static unsigned long
-fold_field(void *mib[], int nr)
-{
- unsigned long res = 0;
- int i;
-
- for_each_possible_cpu(i) {
- res +=
- *((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) +
- sizeof (unsigned long) * nr));
- res +=
- *((unsigned long *) (((void *) per_cpu_ptr(mib[1], i)) +
- sizeof (unsigned long) * nr));
- }
- return res;
-}
-
/* Display sctp snmp mib statistics(/proc/net/sctp/snmp). */
static int sctp_snmp_seq_show(struct seq_file *seq, void *v)
{
@@ -102,7 +83,7 @@ static int sctp_snmp_seq_show(struct seq_file *seq, void *v)
for (i = 0; sctp_snmp_list[i].name != NULL; i++)
seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name,
- fold_field((void **)sctp_statistics,
+ snmp_fold_field((void **)sctp_statistics,
sctp_snmp_list[i].entry));
return 0;
--
1.5.3.4
^ permalink raw reply related
* [PATCH 2/2][SCTP]: Convert sctp_dbg_objcnt to seq files.
From: Pavel Emelyanov @ 2008-02-08 11:08 UTC (permalink / raw)
To: David Miller; +Cc: Vlad Yasevich, lksctp-developers, Linux Netdev List
This makes the code use a good proc API and the text ~50 bytes shorter.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
net/sctp/objcnt.c | 85 +++++++++++++++++++++++++++-------------------------
1 files changed, 44 insertions(+), 41 deletions(-)
diff --git a/net/sctp/objcnt.c b/net/sctp/objcnt.c
index 2cf6ad6..2b9ac00 100644
--- a/net/sctp/objcnt.c
+++ b/net/sctp/objcnt.c
@@ -80,61 +80,64 @@ static sctp_dbg_objcnt_entry_t sctp_dbg_objcnt[] = {
/* Callback from procfs to read out objcount information.
* Walk through the entries in the sctp_dbg_objcnt array, dumping
* the raw object counts for each monitored type.
- *
- * This code was modified from similar code in route.c
*/
-static int sctp_dbg_objcnt_read(char *buffer, char **start, off_t offset,
- int length, int *eof, void *data)
+static int sctp_objcnt_seq_show(struct seq_file *seq, void *v)
{
- int len = 0;
- off_t pos = 0;
- int entries;
int i;
char temp[128];
- /* How many entries? */
- entries = ARRAY_SIZE(sctp_dbg_objcnt);
-
- /* Walk the entries and print out the debug information
- * for proc fs.
- */
- for (i = 0; i < entries; i++) {
- pos += 128;
-
- /* Skip ahead. */
- if (pos <= offset) {
- len = 0;
- continue;
- }
- /* Print out each entry. */
- sprintf(temp, "%s: %d",
- sctp_dbg_objcnt[i].label,
- atomic_read(sctp_dbg_objcnt[i].counter));
-
- sprintf(buffer + len, "%-127s\n", temp);
- len += 128;
- if (pos >= offset+length)
- goto done;
- }
-
-done:
- *start = buffer + len - (pos - offset);
- len = pos - offset;
- if (len > length)
- len = length;
-
- return len;
+ i = (int)*(loff_t *)v;
+ sprintf(temp, "%s: %d", sctp_dbg_objcnt[i].label,
+ atomic_read(sctp_dbg_objcnt[i].counter));
+ seq_printf(seq, "%-127s\n", temp);
+ return 0;
+}
+
+static void *sctp_objcnt_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ return (*pos >= ARRAY_SIZE(sctp_dbg_objcnt)) ? NULL : (void *)pos;
+}
+
+static void sctp_objcnt_seq_stop(struct seq_file *seq, void *v)
+{
+}
+
+static void * sctp_objcnt_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ ++*pos;
+ return (*pos >= ARRAY_SIZE(sctp_dbg_objcnt)) ? NULL : (void *)pos;
}
+static const struct seq_operations sctp_objcnt_seq_ops = {
+ .start = sctp_objcnt_seq_start,
+ .next = sctp_objcnt_seq_next,
+ .stop = sctp_objcnt_seq_stop,
+ .show = sctp_objcnt_seq_show,
+};
+
+static int sctp_objcnt_seq_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &sctp_objcnt_seq_ops);
+}
+
+static const struct file_operations sctp_objcnt_ops = {
+ .open = sctp_objcnt_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
/* Initialize the objcount in the proc filesystem. */
void sctp_dbg_objcnt_init(void)
{
struct proc_dir_entry *ent;
- ent = create_proc_read_entry("sctp_dbg_objcnt", 0, proc_net_sctp,
- sctp_dbg_objcnt_read, NULL);
+
+ ent = create_proc_entry("sctp_dbg_objcnt", 0, proc_net_sctp);
if (!ent)
printk(KERN_WARNING
"sctp_dbg_objcnt: Unable to create /proc entry.\n");
+ else
+ ent->proc_fops = &sctp_objcnt_ops;
}
/* Cleanup the objcount entry in the proc filesystem. */
--
1.5.3.4
^ permalink raw reply related
* [patch 7/7] pppol2tp: fix printk warnings
From: akpm @ 2008-02-08 11:11 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, akpm
From: Andrew Morton <akpm@linux-foundation.org>
drivers/net/pppol2tp.c: In function `pppol2tp_seq_tunnel_show':
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg (arg 4)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg (arg 5)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg (arg 6)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg (arg 7)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg (arg 8)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg (arg 9)
drivers/net/pppol2tp.c: In function `pppol2tp_seq_session_show':
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg (arg 5)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg (arg 6)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg (arg 7)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg (arg 8)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg (arg 9)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg (arg 10)
Not all platforms implement u64 with unsigned long long. eg: powerpc.
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/pppol2tp.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff -puN drivers/net/pppol2tp.c~pppol2tp-fix-printk-warnings drivers/net/pppol2tp.c
--- a/drivers/net/pppol2tp.c~pppol2tp-fix-printk-warnings
+++ a/drivers/net/pppol2tp.c
@@ -2289,10 +2289,12 @@ static void pppol2tp_seq_tunnel_show(str
atomic_read(&tunnel->ref_count) - 1);
seq_printf(m, " %08x %llu/%llu/%llu %llu/%llu/%llu\n",
tunnel->debug,
- tunnel->stats.tx_packets, tunnel->stats.tx_bytes,
- tunnel->stats.tx_errors,
- tunnel->stats.rx_packets, tunnel->stats.rx_bytes,
- tunnel->stats.rx_errors);
+ (unsigned long long)tunnel->stats.tx_packets,
+ (unsigned long long)tunnel->stats.tx_bytes,
+ (unsigned long long)tunnel->stats.tx_errors,
+ (unsigned long long)tunnel->stats.rx_packets,
+ (unsigned long long)tunnel->stats.rx_bytes,
+ (unsigned long long)tunnel->stats.rx_errors);
}
static void pppol2tp_seq_session_show(struct seq_file *m, void *v)
@@ -2320,12 +2322,12 @@ static void pppol2tp_seq_session_show(st
jiffies_to_msecs(session->reorder_timeout));
seq_printf(m, " %hu/%hu %llu/%llu/%llu %llu/%llu/%llu\n",
session->nr, session->ns,
- session->stats.tx_packets,
- session->stats.tx_bytes,
- session->stats.tx_errors,
- session->stats.rx_packets,
- session->stats.rx_bytes,
- session->stats.rx_errors);
+ (unsigned long long)session->stats.tx_packets,
+ (unsigned long long)session->stats.tx_bytes,
+ (unsigned long long)session->stats.tx_errors,
+ (unsigned long long)session->stats.rx_packets,
+ (unsigned long long)session->stats.rx_bytes,
+ (unsigned long long)session->stats.rx_errors);
}
static int pppol2tp_seq_show(struct seq_file *m, void *v)
_
^ permalink raw reply
* [patch 1/7] typhoon section fix
From: akpm @ 2008-02-08 11:11 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, akpm, sam
From: Andrew Morton <akpm@linux-foundation.org>
gcc-3.4.4 on powerpc:
drivers/net/typhoon.c:137: error: version causes a section type conflict
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/typhoon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/net/typhoon.c~typhoon-section-fix drivers/net/typhoon.c
--- a/drivers/net/typhoon.c~typhoon-section-fix
+++ a/drivers/net/typhoon.c
@@ -134,7 +134,7 @@ static const int multicast_filter_limit
#include "typhoon.h"
#include "typhoon-firmware.h"
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
"typhoon.c: version " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
MODULE_AUTHOR("David Dillow <dave@thedillows.org>");
@@ -178,7 +178,7 @@ enum typhoon_cards {
};
/* directly indexed by enum typhoon_cards, above */
-static const struct typhoon_card_info typhoon_card_info[] __devinitdata = {
+static struct typhoon_card_info typhoon_card_info[] __devinitdata = {
{ "3Com Typhoon (3C990-TX)",
TYPHOON_CRYPTO_NONE},
{ "3Com Typhoon (3CR990-TX-95)",
_
^ permalink raw reply
* [patch 2/7] natsemi section fix
From: akpm @ 2008-02-08 11:11 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, akpm, sam
From: Andrew Morton <akpm@linux-foundation.org>
gcc-3.4.4 on powerpc:
drivers/net/natsemi.c:245: error: natsemi_pci_info causes a section type conflict
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/natsemi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff -puN drivers/net/natsemi.c~natsemi-section-fix drivers/net/natsemi.c
--- a/drivers/net/natsemi.c~natsemi-section-fix
+++ a/drivers/net/natsemi.c
@@ -127,7 +127,7 @@ static int full_duplex[MAX_UNITS];
#define NATSEMI_RX_LIMIT 2046 /* maximum supported by hardware */
/* These identify the driver base version and may not be removed. */
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
KERN_INFO DRV_NAME " dp8381x driver, version "
DRV_VERSION ", " DRV_RELDATE "\n"
KERN_INFO " originally by Donald Becker <becker@scyld.com>\n"
@@ -238,7 +238,7 @@ enum {
};
/* array of board data directly indexed by pci_tbl[x].driver_data */
-static const struct {
+static struct {
const char *name;
unsigned long flags;
unsigned int eeprom_size;
@@ -247,7 +247,7 @@ static const struct {
{ "NatSemi DP8381[56]", 0, 24 },
};
-static const struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
+static struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 },
{ PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ } /* terminate list */
_
^ permalink raw reply
* [patch 6/7] starfire secton fix
From: akpm @ 2008-02-08 11:11 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, akpm, sam
From: Andrew Morton <akpm@linux-foundation.org>
gcc-3.4.4 on powerpc:
drivers/net/starfire.c:219: error: version causes a section type conflict
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/starfire.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/net/starfire.c~starfire-secton-fix drivers/net/starfire.c
--- a/drivers/net/starfire.c~starfire-secton-fix
+++ a/drivers/net/starfire.c
@@ -216,7 +216,7 @@ do { \
/* These identify the driver base version and may not be removed. */
-static const char version[] __devinitdata =
+static char version[] =
KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n"
KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
_
^ permalink raw reply
* [patch 5/7] via-velocity section fix
From: akpm @ 2008-02-08 11:11 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, akpm, sam
From: Andrew Morton <akpm@linux-foundation.org>
gcc-3.4.4 on powerpc:
drivers/net/via-velocity.c:443: error: chip_info_table causes a section type conflict
on this one I had to remove the __devinitdata too. Don't know why.
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/via-velocity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/net/via-velocity.c~via-velocity-section-fix drivers/net/via-velocity.c
--- a/drivers/net/via-velocity.c~via-velocity-section-fix
+++ a/drivers/net/via-velocity.c
@@ -440,7 +440,7 @@ static void velocity_unregister_notifier
* Internal board variants. At the moment we have only one
*/
-static const struct velocity_info_tbl chip_info_table[] __devinitdata = {
+static struct velocity_info_tbl chip_info_table[] = {
{CHIP_TYPE_VT6110, "VIA Networking Velocity Family Gigabit Ethernet Adapter", 1, 0x00FFFFFFUL},
{ }
};
_
^ permalink raw reply
* [patch 4/7] bnx2.c section fix
From: akpm @ 2008-02-08 11:11 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, akpm, sam
From: Andrew Morton <akpm@linux-foundation.org>
gcc-3.4.4 on powerpc:
drivers/net/bnx2.c:67: error: version causes a section type conflict
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/bnx2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/net/bnx2.c~bnx2c-section-fix drivers/net/bnx2.c
--- a/drivers/net/bnx2.c~bnx2c-section-fix
+++ a/drivers/net/bnx2.c
@@ -64,7 +64,7 @@
/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT (5*HZ)
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
"Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
@@ -90,7 +90,7 @@ typedef enum {
} board_t;
/* indexed by board_t, above */
-static const struct {
+static struct {
char *name;
} board_info[] __devinitdata = {
{ "Broadcom NetXtreme II BCM5706 1000Base-T" },
_
^ permalink raw reply
* [patch 3/7] bnx2x section fix
From: akpm @ 2008-02-08 11:11 UTC (permalink / raw)
To: davem; +Cc: jeff, netdev, akpm, sam
From: Andrew Morton <akpm@linux-foundation.org>
gcc-3.4.4 on powerpc:
drivers/net/bnx2x.c:73: error: version causes a section type conflict
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/bnx2x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/net/bnx2x.c~bnx2x-section-fix drivers/net/bnx2x.c
--- a/drivers/net/bnx2x.c~bnx2x-section-fix
+++ a/drivers/net/bnx2x.c
@@ -70,7 +70,7 @@
/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT (5*HZ)
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
"Broadcom NetXtreme II 577xx 10Gigabit Ethernet Driver "
DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
@@ -107,7 +107,7 @@ enum bnx2x_board_type {
};
/* indexed by board_t, above */
-static const struct {
+static struct {
char *name;
} board_info[] __devinitdata = {
{ "Broadcom NetXtreme II BCM57710 XGb" }
_
^ permalink raw reply
* [PATCH] [NETNS] Remove unused member (dst_net) of dst_ops.
From: Rami Rosen @ 2008-02-08 11:24 UTC (permalink / raw)
To: David Miller, den, netdev
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
Hi,
This patches removes dst_net member (a pointer to struct net)
of dst_ops (/include/net/dst.h).
Current network namespace implementation does not use it at all.
Denis - any comments ?
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 284 bytes --]
diff --git a/include/net/dst.h b/include/net/dst.h
index e3ac7d0..ad06622 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -102,7 +102,6 @@ struct dst_ops
atomic_t entries;
struct kmem_cache *kmem_cachep;
- struct net *dst_net;
};
#ifdef __KERNEL__
^ permalink raw reply related
* Re: [PATCH] Add IPv6 support to TCP SYN cookies
From: Andi Kleen @ 2008-02-08 12:07 UTC (permalink / raw)
To: Ross Vandegrift; +Cc: Andi Kleen, Glenn Griffin, netdev, linux-kernel
In-Reply-To: <20080207194446.GA25463@kallisti.us>
On Thu, Feb 07, 2008 at 02:44:46PM -0500, Ross Vandegrift wrote:
> On Wed, Feb 06, 2008 at 09:53:57AM +0100, Andi Kleen wrote:
> > That would be useful yes -- for different bandwidths.
>
> My initial test is end-to-end 1000Mbps, but I've got a few different
> packet rates.
>
> > If the young/old heuristics do not work well enough anymore most
> > likely we should try readding RED to the syn queue again. That used
> > to be pretty effective in the early days. I don't quite remember why
> > Linux didn't end up using it in fact.
>
> I'm running juno-z with 2, 4, & 8 threads of syn flood to port 80.
> wireshark measures 2 threads at 350pps, 4 threads at 750pps, and 8
What's the total bandwidth of the attack?
> threads at 1200pps. Under no SYN flood, the server handles 750 HTTP
> requests per second, measured via httping in flood mode.
Thanks for the tests. Could you please do an additional experiment?
Use sch_em or similar to add a jittering longer latency in the connection
(as would be realistic in a real distributed DOS). Does it make a
difference?
> With a default tcp_max_syn_backlog of 1024, I can trivially prevent
> any inbound client connections with 2 threads of syn flood.
> Enabling tcp_syncookies brings the connection handling back up to 725
> fetches per second.
Yes the defaults are probably too low. That's something that should
be fixed.
>
> At these levels the CPU impact of tcp_syncookies is nothing. I can't
CPU impact of syncookies was never a concern. The problems are rather
missing flow control and disabling of valuable TCP features.
> BUG: soft lockup detected on CPU#1!
> [<c044d1ec>] softlockup_tick+0x96/0xa4
> [<c042ddb0>] update_process_times+0x39/0x5c
> [<c04196f7>] smp_apic_timer_interrupt+0x5b/0x6c
> [<c04059bf>] apic_timer_interrupt+0x1f/0x24
> [<c045007b>] taskstats_exit_send+0x152/0x371
> [<c05c007b>] netlink_kernel_create+0x5/0x11c
> [<c05a7415>] reqsk_queue_alloc+0x32/0x81
> [<c05a5aca>] lock_sock+0x8e/0x96
I think the softirqs are starving user context through the socket
lock. Probably should be fixed too. Something like softirq should
detect when there is a user and it is looping too long and should
give up the lock for some time.
-Andi
^ permalink raw reply
* Re: [PATCH] [NETNS] Remove unused member (dst_net) of dst_ops.
From: Denis V. Lunev @ 2008-02-08 11:36 UTC (permalink / raw)
To: Rami Rosen; +Cc: David Miller, netdev, dlezcano
In-Reply-To: <eb3ff54b0802080324i4c7df923y3476faa34392279a@mail.gmail.com>
This has been added by the Daniel Lezcano <dlezcano@fr.ibm.com> in the
commit d4fa26ff44e31c2636a985e3092e2cd55d8045de. It looks to me a
preparatory staff for IPv6 namespacing.
I think this is not needed in 2.6.25 but will be required in 2.6.26
very soon.
Regards,
Den
On Fri, 2008-02-08 at 13:24 +0200, Rami Rosen wrote:
> Hi,
> This patches removes dst_net member (a pointer to struct net)
> of dst_ops (/include/net/dst.h).
>
> Current network namespace implementation does not use it at all.
>
> Denis - any comments ?
>
>
> Regards,
> Rami Rosen
>
>
> Signed-off-by: Rami Rosen <ramirose@gmail.com>
^ permalink raw reply
* [PATCH 1/2][KEY]: Clean up proc files creation a bit.
From: Pavel Emelyanov @ 2008-02-08 12:11 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Linux Netdev List
Mainly this removes ifdef-s from inside the ipsec_pfkey_init.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
net/key/af_key.c | 35 +++++++++++++++++++++++++++--------
1 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 45c3c27..162fcea 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3782,6 +3782,29 @@ done:
return len;
}
+
+static int pfkey_init_proc(void)
+{
+ if (create_proc_read_entry("pfkey", 0, init_net.proc_net,
+ pfkey_read_proc, NULL) == NULL)
+ return -ENOMEM;
+ else
+ return 0;
+}
+
+static void pfkey_exit_proc(void)
+{
+ remove_proc_entry("net/pfkey", NULL);
+}
+#else
+static inline int pfkey_init_proc(void)
+{
+ return 0;
+}
+
+static inline void pfkey_exit_proc(void)
+{
+}
#endif
static struct xfrm_mgr pfkeyv2_mgr =
@@ -3798,7 +3821,7 @@ static struct xfrm_mgr pfkeyv2_mgr =
static void __exit ipsec_pfkey_exit(void)
{
xfrm_unregister_km(&pfkeyv2_mgr);
- remove_proc_entry("pfkey", init_net.proc_net);
+ pfkey_exit_proc();
sock_unregister(PF_KEY);
proto_unregister(&key_proto);
}
@@ -3813,21 +3836,17 @@ static int __init ipsec_pfkey_init(void)
err = sock_register(&pfkey_family_ops);
if (err != 0)
goto out_unregister_key_proto;
-#ifdef CONFIG_PROC_FS
- err = -ENOMEM;
- if (create_proc_read_entry("pfkey", 0, init_net.proc_net, pfkey_read_proc, NULL) == NULL)
+ err = pfkey_init_proc();
+ if (err != 0)
goto out_sock_unregister;
-#endif
err = xfrm_register_km(&pfkeyv2_mgr);
if (err != 0)
goto out_remove_proc_entry;
out:
return err;
out_remove_proc_entry:
-#ifdef CONFIG_PROC_FS
- remove_proc_entry("net/pfkey", NULL);
+ pfkey_exit_proc();
out_sock_unregister:
-#endif
sock_unregister(PF_KEY);
out_unregister_key_proto:
proto_unregister(&key_proto);
--
1.5.3.4
^ permalink raw reply related
* [PATCH 2/2][KEY]: Convert net/pfkey to use seq files.
From: Pavel Emelyanov @ 2008-02-08 12:14 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Linux Netdev List
The seq files API disposes the caller of the difficulty of
checking file position, the length of data to produce and
the size of provided buffer.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
net/key/af_key.c | 94 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 58 insertions(+), 36 deletions(-)
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 162fcea..9793511 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3734,21 +3734,15 @@ static struct net_proto_family pfkey_family_ops = {
};
#ifdef CONFIG_PROC_FS
-static int pfkey_read_proc(char *buffer, char **start, off_t offset,
- int length, int *eof, void *data)
+static int pfkey_seq_show(struct seq_file *f, void *v)
{
- off_t pos = 0;
- off_t begin = 0;
- int len = 0;
struct sock *s;
- struct hlist_node *node;
-
- len += sprintf(buffer,"sk RefCnt Rmem Wmem User Inode\n");
-
- read_lock(&pfkey_table_lock);
-
- sk_for_each(s, node, &pfkey_table) {
- len += sprintf(buffer+len,"%p %-6d %-6u %-6u %-6u %-6lu",
+
+ s = (struct sock *)v;
+ if (v == SEQ_START_TOKEN)
+ seq_printf(f ,"sk RefCnt Rmem Wmem User Inode\n");
+ else
+ seq_printf(f ,"%p %-6d %-6u %-6u %-6u %-6lu\n",
s,
atomic_read(&s->sk_refcnt),
atomic_read(&s->sk_rmem_alloc),
@@ -3756,40 +3750,68 @@ static int pfkey_read_proc(char *buffer, char **start, off_t offset,
sock_i_uid(s),
sock_i_ino(s)
);
+ return 0;
+}
- buffer[len++] = '\n';
+static void *pfkey_seq_start(struct seq_file *f, loff_t *ppos)
+{
+ struct sock *s;
+ struct hlist_node *node;
+ loff_t pos = *ppos;
- pos = begin + len;
- if (pos < offset) {
- len = 0;
- begin = pos;
- }
- if(pos > offset + length)
- goto done;
- }
- *eof = 1;
+ read_lock(&pfkey_table_lock);
+ if (pos == 0)
+ return SEQ_START_TOKEN;
-done:
- read_unlock(&pfkey_table_lock);
+ sk_for_each(s, node, &pfkey_table)
+ if (pos-- == 1)
+ return s;
- *start = buffer + (offset - begin);
- len -= (offset - begin);
+ return NULL;
+}
- if (len > length)
- len = length;
- if (len < 0)
- len = 0;
+static void *pfkey_seq_next(struct seq_file *f, void *v, loff_t *ppos)
+{
+ ++*ppos;
+ return (v == SEQ_START_TOKEN) ?
+ sk_head(&pfkey_table) :
+ sk_next((struct sock *)v);
+}
+
+static void pfkey_seq_stop(struct seq_file *f, void *v)
+{
+ read_unlock(&pfkey_table_lock);
+}
+
+static struct seq_operations pfkey_seq_ops = {
+ .start = pfkey_seq_start,
+ .next = pfkey_seq_next,
+ .stop = pfkey_seq_stop,
+ .show = pfkey_seq_show,
+};
- return len;
+static int pfkey_seq_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &pfkey_seq_ops);
}
+static struct file_operations pfkey_proc_ops = {
+ .open = pfkey_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
static int pfkey_init_proc(void)
{
- if (create_proc_read_entry("pfkey", 0, init_net.proc_net,
- pfkey_read_proc, NULL) == NULL)
+ struct proc_dir_entry *e;
+
+ e = create_proc_entry("pfkey", 0, init_net.proc_net);
+ if (e == NULL)
return -ENOMEM;
- else
- return 0;
+
+ e->proc_fops = &pfkey_proc_ops;
+ return 0;
}
static void pfkey_exit_proc(void)
--
1.5.3.4
^ permalink raw reply related
* [patch 0/5] s390: claw/lcs/netiucv network driver patches for 2.6.25
From: Ursula Braun @ 2008-02-08 12:09 UTC (permalink / raw)
To: jgarzik, netdev, linux-s390
--
Jeff,
The following patches are intended for 2.6.25.
They affect the s390 network drivers claw, lcs, and netiucv.
Patch summary:
claw: remove unused volatile variables
netiucv: define module owner in device_driver structure
netiucv: renaming of NOP action
lcs: improvement for debug area setup
claw/lcs/netiucv: optimize a debugging macro
Regards, Ursula Braun
^ permalink raw reply
* [patch 1/5] claw: removal of volatile variables
From: Ursula Braun @ 2008-02-08 12:09 UTC (permalink / raw)
To: jgarzik, netdev, linux-s390
In-Reply-To: <20080208120900.295604000@linux.vnet.ibm.com>
[-- Attachment #1: 719-claw-volatile.diff --]
[-- Type: text/plain, Size: 1013 bytes --]
From: Ursula Braun <braunu@de.ibm.com>
Volatile variables queme_switch and pk_delay are not used anyway.
They are just a left over from an unused timer based packing logic.
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---
drivers/s390/net/claw.h | 2 --
1 file changed, 2 deletions(-)
Index: linux-2.6-uschi/drivers/s390/net/claw.h
===================================================================
--- linux-2.6-uschi.orig/drivers/s390/net/claw.h
+++ linux-2.6-uschi/drivers/s390/net/claw.h
@@ -278,8 +278,6 @@ struct claw_env {
__u16 write_size; /* write buffer size */
__u16 dev_id; /* device ident */
__u8 packing; /* are we packing? */
- volatile __u8 queme_switch; /* gate for imed packing */
- volatile unsigned long pk_delay; /* Delay for adaptive packing */
__u8 in_use; /* device active flag */
struct net_device *ndev; /* backward ptr to the net dev*/
};
--
^ permalink raw reply
* [patch 3/5] netiucv: change name of nop function
From: Ursula Braun @ 2008-02-08 12:09 UTC (permalink / raw)
To: jgarzik, netdev, linux-s390
In-Reply-To: <20080208120900.295604000@linux.vnet.ibm.com>
[-- Attachment #1: 753-netiucv-fsm.diff --]
[-- Type: text/plain, Size: 1322 bytes --]
From: Ursula Braun <braunu@de.ibm.com>
Dummy NOP actions for fsm-statemachines have to be defined
separately for every using module of fsm-statemachines.
Thus the generic name fsm_action_nop is replaced by
module specific name netiucv_action_nop.
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---
drivers/s390/net/netiucv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: linux-2.6-uschi/drivers/s390/net/netiucv.c
===================================================================
--- linux-2.6-uschi.orig/drivers/s390/net/netiucv.c
+++ linux-2.6-uschi/drivers/s390/net/netiucv.c
@@ -573,9 +573,9 @@ static void netiucv_callback_connres(str
}
/**
- * Dummy NOP action for all statemachines
+ * NOP action for statemachines
*/
-static void fsm_action_nop(fsm_instance *fi, int event, void *arg)
+static void netiucv_action_nop(fsm_instance *fi, int event, void *arg)
{
}
@@ -1111,7 +1111,7 @@ static const fsm_node dev_fsm[] = {
{ DEV_STATE_RUNNING, DEV_EVENT_STOP, dev_action_stop },
{ DEV_STATE_RUNNING, DEV_EVENT_CONDOWN, dev_action_conndown },
- { DEV_STATE_RUNNING, DEV_EVENT_CONUP, fsm_action_nop },
+ { DEV_STATE_RUNNING, DEV_EVENT_CONUP, netiucv_action_nop },
};
static const int DEV_FSM_LEN = sizeof(dev_fsm) / sizeof(fsm_node);
--
^ permalink raw reply
* [patch 2/5] netiucv: Remember to set driver->owner.
From: Ursula Braun @ 2008-02-08 12:09 UTC (permalink / raw)
To: jgarzik, netdev, linux-s390; +Cc: Cornelia Huck
In-Reply-To: <20080208120900.295604000@linux.vnet.ibm.com>
[-- Attachment #1: 752-netiucv-owner.diff --]
[-- Type: text/plain, Size: 689 bytes --]
From: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
---
drivers/s390/net/netiucv.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-2.6-uschi/drivers/s390/net/netiucv.c
===================================================================
--- linux-2.6-uschi.orig/drivers/s390/net/netiucv.c
+++ linux-2.6-uschi/drivers/s390/net/netiucv.c
@@ -137,6 +137,7 @@ PRINT_##importance(header "%02x %02x %02
#define PRINTK_HEADER " iucv: " /* for debugging */
static struct device_driver netiucv_driver = {
+ .owner = THIS_MODULE,
.name = "netiucv",
.bus = &iucv_bus,
};
--
^ 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