* Re: What was the reason for 2.6.22 SMP kernels to change how sendmsg is called?
From: Evgeniy Polyakov @ 2007-12-14 6:33 UTC (permalink / raw)
To: Kevin Wilson; +Cc: David Miller, netdev
In-Reply-To: <B1F576FE19C55C43B8D2E31F061B50C04E60B2@exchange.comtrol.com>
Hi Kevin.
On Thu, Dec 13, 2007 at 04:00:02PM -0600, Kevin Wilson (Kevin.Wilson@comtrol.com) wrote:
> I see your point but it just so happens it is a GPL'd driver, as is all of our Linux code we produce for our hardware. Granted it is out of tree, and after you saw it you would want it to stay that way. However, I would have sent you the whole thing if that is a pre-req to cordial exchanges on this list.
>
> Nonetheless, a somewhat recent change in your tree, that I could not pinpoint on my own, caused the driver to stop functioning properly. So after much searching in git/google/sources with no luck, I decided to ask for a little assistance, maybe just a hint as to where the culprit may be in the tree so I could investigate for myself. For SNGs I tried the method that now works but I am still at a loss as to (can't find) what changes in the tree caused it to fail.
Without having your code it is virtually impossible to say, why you have
a bug. And do not express your frustration telling 'zero people
responded to my bug report'. This was not a bug report at all, but empty
message about 'my code stopped working after some network changes, which
broke the stuff.
>Now in 2.6.22 and later kernels you must use the higher level SOCKET to
>make a call to PROTO_OPS then to sendmsg(). e.g., socket->ops->sendmsg().
It was done because of bug found in inet_sendmsg(), which tried to
autobind socket it should not try.
--
Evgeniy Polyakov
^ permalink raw reply
* Re: [3/4] DST: Network state machine.
From: Evgeniy Polyakov @ 2007-12-14 6:35 UTC (permalink / raw)
To: lkml, netdev, linux-fsdevel; +Cc: dmonakhov@sw.ru
In-Reply-To: <20071213204343.GC27398@dmon-lap.sw.ru>
On Thu, Dec 13, 2007 at 11:43:43PM +0300, Dmitry Monakhov (dmonakhov@sw.ru) wrote:
> On 14:47 Mon 10 Dec , Evgeniy Polyakov wrote:
> >
> > Network state machine.
> >
> > Includes network async processing state machine and related tasks.
> Hi, I've tried to play a little bit with DST and discover huge memory
> leak. Every read request from remote node result in bio + bio's pages leak.
>
> Data flow:
> ->kst_export_ready ## prepare and submit bio
> ->generic_make_request(bio) ## submit it
>
> ->kst_export_read_end_io ## block layer call bio_end_io callback
>
> ->kst_thread_process_state ## process ready requests
> ->kst_data_callback
> ->kst_data_process_bio ## submit pages to network layer
> ->kst_complete_req
> ->kst_bio_endio
> ->kst_export_read_end_io ## WoW we calling the same bio_end_io
> ## callback twice
> ->dst_free_request(req); ## request will be destroyed but it's bio
> ## and all bio's pages wasn't released.
> We may release bio's pages after it was sent to network, it is safe because
> sendpage() already called get_page(). I've attached simple patch which
> this this.
Yes, your patch looks good.
Thanks a lot, Dmitry.
--
Evgeniy Polyakov
^ permalink raw reply
* Re: [PATCH 2/2] ucc_geth: use rx-clock-name and tx-clock-name device tree properties
From: Jeff Garzik @ 2007-12-14 6:45 UTC (permalink / raw)
To: Kumar Gala; +Cc: netdev, linuxppc-dev list, Timur Tabi
In-Reply-To: <4373ED4B-5EDD-4725-9D99-BE39B0656E19@kernel.crashing.org>
Kumar Gala wrote:
>
> On Dec 3, 2007, at 3:17 PM, Timur Tabi wrote:
>
>> Updates the ucc_geth device driver to check the new rx-clock-name and
>> tx-clock-name properties first. If present, it uses the new function
>> qe_clock_source() to obtain the clock source. Otherwise, it checks the
>> deprecated rx-clock and tx-clock properties.
>>
>> Update the device trees for 832x, 836x, and 8568 to contain the new
>> property
>> names only.
>>
>> Signed-off-by: Timur Tabi <timur@freescale.com>
>> ---
>>
>> This patch applies to Kumar's for-2.6.25 branch. ucc_geth will
>> compile but not
>> run if my other patch, "qe: add function qe_clock_source" has not also
>> been
>> applied.
>
> Jeff, I'll take this patch via powerpc.git if you don't have any issue
> since its just touching probe/setup bits.
ACK
^ permalink raw reply
* Re: [PATCH] PS3: gelic: Add wireless support for PS3
From: David Woodhouse @ 2007-12-14 6:48 UTC (permalink / raw)
To: Masakazu Mokuno
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
geoffrey.levand-mEdOJwZ7QcZBDgjK7y7TUQ, Geert Uytterhoeven
In-Reply-To: <20071213211626.BF8E.MOKUNO-DfbDroY8Xu1L9jVzuh4AOg@public.gmane.org>
--- linux-2.6.23.ppc64/drivers/net/ps3_gelic_net.c~ 2007-12-14 01:31:50.000000000 -0500
+++ linux-2.6.23.ppc64/drivers/net/ps3_gelic_net.c 2007-12-14 01:39:25.000000000 -0500
@@ -1139,7 +1139,7 @@ static irqreturn_t gelic_card_interrupt(
*
* see Documentation/networking/netconsole.txt
*/
-static void gelic_net_poll_controller(struct net_device *netdev)
+void gelic_net_poll_controller(struct net_device *netdev)
{
struct gelic_card *card = netdev_card(netdev);
--- linux-2.6.23.ppc64/drivers/net/ps3_gelic_net.h~ 2007-12-14 01:31:50.000000000 -0500
+++ linux-2.6.23.ppc64/drivers/net/ps3_gelic_net.h 2007-12-14 01:39:47.000000000 -0500
@@ -346,6 +346,7 @@ extern void gelic_net_tx_timeout(struct
extern int gelic_net_change_mtu(struct net_device *netdev, int new_mtu);
extern int gelic_net_setup_netdev(struct net_device *netdev,
struct gelic_card *card);
+extern void gelic_net_poll_controller(struct net_device *netdev);
/* shared ethtool ops */
extern void gelic_net_get_drvinfo(struct net_device *netdev,
--
dwmw2
^ permalink raw reply
* Re: 2.6.24-rc4-mm1 - BUG in tcp_fragment
From: Cedric Le Goater @ 2007-12-14 6:52 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: David Miller, Andrew Morton, LKML, Netdev
In-Reply-To: <Pine.LNX.4.64.0712140024360.12376@kivilampi-30.cs.helsinki.fi>
Ilpo Järvinen wrote:
> On Thu, 13 Dec 2007, Cedric Le Goater wrote:
>
>> I got this one while compiling on NFS.
>>
>> C.
>>
>> kernel BUG at /home/legoater/linux/2.6.24-rc4-mm1/include/net/tcp.h:1480!
>
> I'm not exactly sure what patches you have applied and which patches are
> not, with rc4-mm1 there are two patches (first one was incomplete, I
> assume you had at least that one based on your other mail) to really fix
> the issues in (__|)tcp_reset_fack_counts(...).
Yes I only have the first patch you sent on lkml on top of 2.6.24-rc4-mm1.
attached below. I didn't see the second one on lkml ?
> However, there seems to be so much breakage that I have a bit trouble to
> decide where to start... The situation seems bit scary :-).
my n/w environment seems to reproduce these issues quite easily. if you
need some testing, just ping me.
Cheers,
C.
> So, I might soon prepare a revert patch for most of the questionable
> TCP parts and ask Dave to apply it (and drop them fully during next
> rebase) unless I suddently figure something out soon which explains
> all/most of the problems, then return to drawing board. ...As it seems
> that the cumulative ACK processing problem discovered later on (having
> rather cumbersome solution with skbs only) will make part of the work
> that's currently in net-2.6.25 quite useless/duplicate effort. But thanks
> anyway for reporting these.
>
>
Subject: [PATCH] [TCP]: Fix fack_count miscountings (multiple places)
1) Fack_count is set incorrectly if the highest sent skb is
already sacked (the skb->prev won't return it because it's on
the other list already). These manifest as fackets_out counting
error later on, the second-order effects are very hard to track,
so it may fix all out-standing TCP bug reports.
2) Prev == NULL check was wrong way around
3) Last skb's fack count was incorrectly skipped while() {} loop
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
---
include/net/tcp.h | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 9dbed0b..11a7e3e 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1337,10 +1337,20 @@ static inline struct sk_buff *tcp_send_head(struct sock *sk)
static inline void tcp_advance_send_head(struct sock *sk, struct sk_buff *skb)
{
struct sk_buff *prev = tcp_write_queue_prev(sk, skb);
+ unsigned int fc = 0;
+
+ if (prev == (struct sk_buff *)&sk->sk_write_queue)
+ prev = NULL;
+ else if (!tcp_skb_adjacent(sk, prev, skb))
+ prev = NULL;
- if (prev != (struct sk_buff *)&sk->sk_write_queue)
- TCP_SKB_CB(skb)->fack_count = TCP_SKB_CB(prev)->fack_count +
- tcp_skb_pcount(prev);
+ if ((prev == NULL) && !__tcp_write_queue_empty(sk, TCP_WQ_SACKED))
+ prev = __tcp_write_queue_tail(sk, TCP_WQ_SACKED);
+
+ if (prev != NULL)
+ fc = TCP_SKB_CB(prev)->fack_count + tcp_skb_pcount(prev);
+
+ TCP_SKB_CB(skb)->fack_count = fc;
sk->sk_send_head = tcp_write_queue_next(sk, skb);
if (sk->sk_send_head == (struct sk_buff *)&sk->sk_write_queue)
@@ -1464,7 +1474,7 @@ static inline struct sk_buff *__tcp_reset_fack_counts(struct sock *sk,
{
unsigned int fc = 0;
- if (prev == NULL)
+ if (prev != NULL)
fc = TCP_SKB_CB(*prev)->fack_count + tcp_skb_pcount(*prev);
BUG_ON((*prev != NULL) && !tcp_skb_adjacent(sk, *prev, skb));
@@ -1521,7 +1531,7 @@ static inline void tcp_reset_fack_counts(struct sock *sk, struct sk_buff *inskb)
skb[otherq] = prev->next;
}
- while (skb[queue] != __tcp_write_queue_tail(sk, queue)) {
+ do {
/* Lazy find for the other queue */
if (skb[queue] == NULL) {
skb[queue] = tcp_write_queue_find(sk, TCP_SKB_CB(prev)->seq,
@@ -1535,7 +1545,7 @@ static inline void tcp_reset_fack_counts(struct sock *sk, struct sk_buff *inskb)
break;
queue ^= TCP_WQ_SACKED;
- }
+ } while (skb[queue] != __tcp_write_queue_tail(sk, queue));
}
static inline void __tcp_insert_write_queue_after(struct sk_buff *skb,
-- 1.5.0.6
^ permalink raw reply related
* Re: [PATCH 2/2] ucc_geth: use rx-clock-name and tx-clock-name device tree properties
From: Kumar Gala @ 2007-12-14 7:19 UTC (permalink / raw)
To: Timur Tabi; +Cc: netdev, linuxppc-dev
In-Reply-To: <1196716685975-git-send-email-timur@freescale.com>
On Dec 3, 2007, at 3:17 PM, Timur Tabi wrote:
> Updates the ucc_geth device driver to check the new rx-clock-name and
> tx-clock-name properties first. If present, it uses the new function
> qe_clock_source() to obtain the clock source. Otherwise, it checks
> the
> deprecated rx-clock and tx-clock properties.
>
> Update the device trees for 832x, 836x, and 8568 to contain the new
> property
> names only.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
>
> This patch applies to Kumar's for-2.6.25 branch. ucc_geth will
> compile but not
> run if my other patch, "qe: add function qe_clock_source" has not
> also been
> applied.
>
> arch/powerpc/boot/dts/mpc832x_mds.dts | 8 ++--
> arch/powerpc/boot/dts/mpc832x_rdb.dts | 8 ++--
> arch/powerpc/boot/dts/mpc836x_mds.dts | 8 ++--
> arch/powerpc/boot/dts/mpc8568mds.dts | 8 ++--
> drivers/net/ucc_geth.c | 55 ++++++++++++++++++++++++
> ++++++--
> 5 files changed, 67 insertions(+), 20 deletions(-)
applied.
- k
^ permalink raw reply
* [GIT PULL] [NET]: Use {hton{s,l},cpu_to_be{16,32}}() where appropriate.
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2007-12-14 7:28 UTC (permalink / raw)
To: davem; +Cc: yoshfuji, netdev
Hello.
Please consider pulling the following changes from the branch
net-2.6-dev-20071214
available at
<git://git.linux-ipv6.org/gitroot/yoshfuji/linux-2.6-dev.git>
which is on top of your net-2.6-devel tree.
Regards,
---
HEADLINES
---------
[BRIDGE]: Use cpu_to_be16() where appropriate.
[DECNET]: Use htons() where appropriate.
[IEEE80211]: Use htons() where appropriate.
[IPVS]: Use htons() where appropriate.
[IRDA]: Use htons() where appropriate.
[MAC80211]: Use htons() where appropriate.
[RXRPC]: Use cpu_to_be32() where appropriate.
[SUNRPC]: Use htonl() where appropriate.
DIFFSTAT
--------
net/bridge/br_input.c | 2 +-
net/decnet/af_decnet.c | 2 +-
net/decnet/dn_nsp_out.c | 2 +-
net/decnet/dn_route.c | 2 +-
net/ieee80211/ieee80211_rx.c | 4 ++--
net/ipv4/ipvs/ip_vs_proto.c | 2 +-
net/ipv4/ipvs/ip_vs_proto_esp.c | 16 ++++++++--------
net/irda/iriap.c | 2 +-
net/mac80211/rx.c | 2 +-
net/mac80211/wme.c | 2 +-
net/rxrpc/ar-connection.c | 2 +-
net/rxrpc/ar-input.c | 4 ++--
net/rxrpc/rxkad.c | 4 ++--
net/sunrpc/xprtrdma/rpc_rdma.c | 6 +++---
14 files changed, 26 insertions(+), 26 deletions(-)
CHANGESETS
----------
commit 8979a93df4ca6b9b411296265ad3591d9f780569
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:51:03 2007 +0900
[BRIDGE]: Use cpu_to_be16() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 0ee79a7..255c00f 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -109,7 +109,7 @@ static inline int is_link_local(const unsigned char *dest)
{
__be16 *a = (__be16 *)dest;
static const __be16 *b = (const __be16 *)br_group_address;
- static const __be16 m = __constant_cpu_to_be16(0xfff0);
+ static const __be16 m = cpu_to_be16(0xfff0);
return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
}
---
commit c60e701fabb6c2371a9fab2aa6a71b00bfa3cc1d
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:51:49 2007 +0900
[DECNET]: Use htons() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 57d5749..acd48ee 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -1904,7 +1904,7 @@ static inline struct sk_buff *dn_alloc_send_pskb(struct sock *sk,
struct sk_buff *skb = sock_alloc_send_skb(sk, datalen,
noblock, errcode);
if (skb) {
- skb->protocol = __constant_htons(ETH_P_DNA_RT);
+ skb->protocol = htons(ETH_P_DNA_RT);
skb->pkt_type = PACKET_OUTGOING;
}
return skb;
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 7404653..1964faf 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -124,7 +124,7 @@ struct sk_buff *dn_alloc_skb(struct sock *sk, int size, gfp_t pri)
if ((skb = alloc_skb(size + hdr, pri)) == NULL)
return NULL;
- skb->protocol = __constant_htons(ETH_P_DNA_RT);
+ skb->protocol = htons(ETH_P_DNA_RT);
skb->pkt_type = PACKET_OUTGOING;
if (sk)
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 2d95cf1..20263d9 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1551,7 +1551,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
kfree_skb(skb);
return -ENODEV;
}
- skb->protocol = __constant_htons(ETH_P_DNA_RT);
+ skb->protocol = htons(ETH_P_DNA_RT);
skb->dev = dev;
cb->src = fl.fld_src;
cb->dst = fl.fld_dst;
---
commit 6a29ce9b3427655b4e54e64d156199262dc08078
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:52:26 2007 +0900
[IEEE80211]: Use htons() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 21c0fad..13b12a6 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -45,7 +45,7 @@ static void ieee80211_monitor_rx(struct ieee80211_device *ieee,
skb_reset_mac_header(skb);
skb_pull(skb, ieee80211_get_hdrlen(fc));
skb->pkt_type = PACKET_OTHERHOST;
- skb->protocol = __constant_htons(ETH_P_80211_RAW);
+ skb->protocol = htons(ETH_P_80211_RAW);
memset(skb->cb, 0, sizeof(skb->cb));
netif_rx(skb);
}
@@ -800,7 +800,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
if (skb2 != NULL) {
/* send to wireless media */
skb2->dev = dev;
- skb2->protocol = __constant_htons(ETH_P_802_3);
+ skb2->protocol = htons(ETH_P_802_3);
skb_reset_mac_header(skb2);
skb_reset_network_header(skb2);
/* skb2->network_header += ETH_HLEN; */
---
commit de4433f3e1cc68fc98b3dcd66318843aeb4d1f63
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:53:11 2007 +0900
[IPVS]: Use htons() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
index c0e11ec..dde28a2 100644
--- a/net/ipv4/ipvs/ip_vs_proto.c
+++ b/net/ipv4/ipvs/ip_vs_proto.c
@@ -165,7 +165,7 @@ ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp,
ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph);
if (ih == NULL)
sprintf(buf, "%s TRUNCATED", pp->name);
- else if (ih->frag_off & __constant_htons(IP_OFFSET))
+ else if (ih->frag_off & htons(IP_OFFSET))
sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u frag",
pp->name, NIPQUAD(ih->saddr),
NIPQUAD(ih->daddr));
diff --git a/net/ipv4/ipvs/ip_vs_proto_esp.c b/net/ipv4/ipvs/ip_vs_proto_esp.c
index c36ccf0..aef0d3e 100644
--- a/net/ipv4/ipvs/ip_vs_proto_esp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_esp.c
@@ -52,15 +52,15 @@ esp_conn_in_get(const struct sk_buff *skb,
if (likely(!inverse)) {
cp = ip_vs_conn_in_get(IPPROTO_UDP,
iph->saddr,
- __constant_htons(PORT_ISAKMP),
+ htons(PORT_ISAKMP),
iph->daddr,
- __constant_htons(PORT_ISAKMP));
+ htons(PORT_ISAKMP));
} else {
cp = ip_vs_conn_in_get(IPPROTO_UDP,
iph->daddr,
- __constant_htons(PORT_ISAKMP),
+ htons(PORT_ISAKMP),
iph->saddr,
- __constant_htons(PORT_ISAKMP));
+ htons(PORT_ISAKMP));
}
if (!cp) {
@@ -89,15 +89,15 @@ esp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
if (likely(!inverse)) {
cp = ip_vs_conn_out_get(IPPROTO_UDP,
iph->saddr,
- __constant_htons(PORT_ISAKMP),
+ htons(PORT_ISAKMP),
iph->daddr,
- __constant_htons(PORT_ISAKMP));
+ htons(PORT_ISAKMP));
} else {
cp = ip_vs_conn_out_get(IPPROTO_UDP,
iph->daddr,
- __constant_htons(PORT_ISAKMP),
+ htons(PORT_ISAKMP),
iph->saddr,
- __constant_htons(PORT_ISAKMP));
+ htons(PORT_ISAKMP));
}
if (!cp) {
---
commit 3c334ad2235143509705b30dd05dd41582498c8d
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:53:26 2007 +0900
[IRDA]: Use htons() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index a86a5d8..390a790 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -579,7 +579,7 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self,
fp[n++] = ret_code;
/* Insert list length (MSB first) */
- tmp_be16 = __constant_htons(0x0001);
+ tmp_be16 = htons(0x0001);
memcpy(fp+n, &tmp_be16, 2); n += 2;
/* Insert object identifier ( MSB first) */
---
commit bd45119bb0a0454ca7275b308465412e904b7487
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:54:23 2007 +0900
[MAC80211]: Use htons() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 50f99e7..c6a6177 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1193,7 +1193,7 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx)
if (xmit_skb) {
/* send to wireless media */
- xmit_skb->protocol = __constant_htons(ETH_P_802_3);
+ xmit_skb->protocol = htons(ETH_P_802_3);
skb_set_network_header(xmit_skb, 0);
skb_set_mac_header(xmit_skb, 0);
dev_queue_xmit(xmit_skb);
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 8dbdede..455fadc 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -55,7 +55,7 @@ static inline unsigned classify_1d(struct sk_buff *skb, struct Qdisc *qd)
/* check there is a valid IP header present */
offset = ieee80211_get_hdrlen_from_skb(skb) + 8 /* LLC + proto */;
- if (skb->protocol != __constant_htons(ETH_P_IP) ||
+ if (skb->protocol != htons(ETH_P_IP) ||
skb->len < offset + sizeof(*ip))
return 0;
---
commit df4caf512b5002deef7674595fea8612f55872da
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:55:22 2007 +0900
[RXRPC]: Use cpu_to_be32() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c
index d6667f7..3869a58 100644
--- a/net/rxrpc/ar-connection.c
+++ b/net/rxrpc/ar-connection.c
@@ -651,7 +651,7 @@ rxrpc_incoming_connection(struct rxrpc_transport *trans,
candidate->trans = trans;
candidate->epoch = hdr->epoch;
- candidate->cid = hdr->cid & __constant_cpu_to_be32(RXRPC_CIDMASK);
+ candidate->cid = hdr->cid & cpu_to_be32(RXRPC_CIDMASK);
candidate->service_id = hdr->serviceId;
candidate->security_ix = hdr->securityIndex;
candidate->in_clientflag = RXRPC_CLIENT_INITIATED;
diff --git a/net/rxrpc/ar-input.c b/net/rxrpc/ar-input.c
index f446d9b..f8a699e 100644
--- a/net/rxrpc/ar-input.c
+++ b/net/rxrpc/ar-input.c
@@ -595,7 +595,7 @@ dead_call:
read_unlock_bh(&conn->lock);
if (sp->hdr.flags & RXRPC_CLIENT_INITIATED &&
- sp->hdr.seq == __constant_cpu_to_be32(1)) {
+ sp->hdr.seq == cpu_to_be32(1)) {
_debug("incoming call");
skb_queue_tail(&conn->trans->local->accept_queue, skb);
rxrpc_queue_work(&conn->trans->local->acceptor);
@@ -774,7 +774,7 @@ cant_route_call:
_debug("can't route call");
if (sp->hdr.flags & RXRPC_CLIENT_INITIATED &&
sp->hdr.type == RXRPC_PACKET_TYPE_DATA) {
- if (sp->hdr.seq == __constant_cpu_to_be32(1)) {
+ if (sp->hdr.seq == cpu_to_be32(1)) {
_debug("first packet");
skb_queue_tail(&local->accept_queue, skb);
rxrpc_queue_work(&local->acceptor);
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 8e69d69..f48434a 100644
--- a/net/rxrpc/rxkad.c
+++ b/net/rxrpc/rxkad.c
@@ -284,7 +284,7 @@ static int rxkad_secure_packet(const struct rxrpc_call *call,
/* calculate the security checksum */
x = htonl(call->channel << (32 - RXRPC_CIDSHIFT));
- x |= sp->hdr.seq & __constant_cpu_to_be32(0x3fffffff);
+ x |= sp->hdr.seq & cpu_to_be32(0x3fffffff);
tmpbuf.x[0] = sp->hdr.callNumber;
tmpbuf.x[1] = x;
@@ -518,7 +518,7 @@ static int rxkad_verify_packet(const struct rxrpc_call *call,
/* validate the security checksum */
x = htonl(call->channel << (32 - RXRPC_CIDSHIFT));
- x |= sp->hdr.seq & __constant_cpu_to_be32(0x3fffffff);
+ x |= sp->hdr.seq & cpu_to_be32(0x3fffffff);
tmpbuf.x[0] = call->call_id;
tmpbuf.x[1] = x;
---
commit 5ef72974a45017d7c5a7caab023c5e98a24ad32a
Author: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Wed Dec 12 03:55:42 2007 +0900
[SUNRPC]: Use htonl() where appropriate.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
index 9e11ce7..2738248 100644
--- a/net/sunrpc/xprtrdma/rpc_rdma.c
+++ b/net/sunrpc/xprtrdma/rpc_rdma.c
@@ -387,7 +387,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst)
headerp->rm_xid = rqst->rq_xid;
headerp->rm_vers = xdr_one;
headerp->rm_credit = htonl(r_xprt->rx_buf.rb_max_requests);
- headerp->rm_type = __constant_htonl(RDMA_MSG);
+ headerp->rm_type = htonl(RDMA_MSG);
/*
* Chunks needed for results?
@@ -465,11 +465,11 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst)
RPCRDMA_INLINE_PAD_VALUE(rqst));
if (padlen) {
- headerp->rm_type = __constant_htonl(RDMA_MSGP);
+ headerp->rm_type = htonl(RDMA_MSGP);
headerp->rm_body.rm_padded.rm_align =
htonl(RPCRDMA_INLINE_PAD_VALUE(rqst));
headerp->rm_body.rm_padded.rm_thresh =
- __constant_htonl(RPCRDMA_INLINE_PAD_THRESH);
+ htonl(RPCRDMA_INLINE_PAD_THRESH);
headerp->rm_body.rm_padded.rm_pempty[0] = xdr_zero;
headerp->rm_body.rm_padded.rm_pempty[1] = xdr_zero;
headerp->rm_body.rm_padded.rm_pempty[2] = xdr_zero;
---
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply related
* Re: [patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()
From: Herbert Xu @ 2007-12-14 8:10 UTC (permalink / raw)
To: akpm; +Cc: davem, netdev, akpm
In-Reply-To: <200712140002.lBE02aGO025491@imap1.linux-foundation.org>
akpm@linux-foundation.org wrote:
>
> diff -puN drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl drivers/net/cxgb3/cxgb3_main.c
> --- a/drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl
> +++ a/drivers/net/cxgb3/cxgb3_main.c
> @@ -2191,7 +2191,7 @@ static void check_t3b2_mac(struct adapte
> {
> int i;
>
> - if (!rtnl_trylock()) /* synchronize with ifdown */
> + if (rtnl_is_locked()) /* synchronize with ifdown */
> return;
>
> for_each_port(adapter, i) {
> @@ -2219,7 +2219,6 @@ static void check_t3b2_mac(struct adapte
> p->mac.stats.num_resets++;
> }
> }
> - rtnl_unlock();
This doesn't look right. It seems that they really want trylock
here so we should just fix it by removing the bang.
Also, does ASSERT_RTNL still warn when someone calls it from an
atomic context? We definitely don't want to lose that check.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()
From: Andrew Morton @ 2007-12-14 8:22 UTC (permalink / raw)
To: Herbert Xu; +Cc: davem, netdev
In-Reply-To: <E1J35d6-00041l-00@gondolin.me.apana.org.au>
On Fri, 14 Dec 2007 16:10:44 +0800 Herbert Xu <herbert@gondor.apana.org.au> wrote:
> akpm@linux-foundation.org wrote:
> >
> > diff -puN drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl drivers/net/cxgb3/cxgb3_main.c
> > --- a/drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl
> > +++ a/drivers/net/cxgb3/cxgb3_main.c
> > @@ -2191,7 +2191,7 @@ static void check_t3b2_mac(struct adapte
> > {
> > int i;
> >
> > - if (!rtnl_trylock()) /* synchronize with ifdown */
> > + if (rtnl_is_locked()) /* synchronize with ifdown */
> > return;
> >
> > for_each_port(adapter, i) {
> > @@ -2219,7 +2219,6 @@ static void check_t3b2_mac(struct adapte
> > p->mac.stats.num_resets++;
> > }
> > }
> > - rtnl_unlock();
>
> This doesn't look right. It seems that they really want trylock
> here so we should just fix it by removing the bang.
doh.
> Also, does ASSERT_RTNL still warn when someone calls it from an
> atomic context? We definitely don't want to lose that check.
I don't see how it could warn about that. Nor should it - one might want
to check that rtnl_lock is held inside preempt_disable() or spin_lock or
whatever.
It might make sense to warn if ASSERT_RTNL is called in in_interrupt()
contexts though.
^ permalink raw reply
* Re: [patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()
From: Herbert Xu @ 2007-12-14 8:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: davem, netdev
In-Reply-To: <20071214002209.ac748206.akpm@linux-foundation.org>
On Fri, Dec 14, 2007 at 12:22:09AM -0800, Andrew Morton wrote:
>
> I don't see how it could warn about that. Nor should it - one might want
> to check that rtnl_lock is held inside preempt_disable() or spin_lock or
> whatever.
>
> It might make sense to warn if ASSERT_RTNL is called in in_interrupt()
> contexts though.
Well the paths where ASSERT_RTNL is used should never be in an
atomic context. In the past it has been quite useful in pointing
out bogus locking practices.
There is currently one path where it's known to warn because of
this and it (promiscuous mode) is on my todo list.
Oh and it only warns when you have mutex debugging enabled.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [patch] add tcp congestion control relevant parts
From: Michael Kerrisk @ 2007-12-14 8:48 UTC (permalink / raw)
To: netdev, linux-net; +Cc: Thomas Egerer, linux-man
In-Reply-To: <476000E7.4060104@secunet.com>
Hello Linux networking folk,
I received the patch below for the tcp.7 man page. Would anybody here be
prepared to review the new material / double check the details?
Cheers,
Michael
-------- Original Message --------
Subject: [patch] add tcp congestion control relevant parts
Date: Wed, 12 Dec 2007 16:40:23 +0100
From: Thomas Egerer <thomas.Egerer@secunet.com>
To: mtk.manpages@gmail.com
CC: linux-man@vger.kernel.org
Hello *,
man-pages version : 2.70 from http://www.kernel.org/pub/linux/docs/man-pages/
All required information were obtained by reading the kernel
code/documentation.
I'm not sure, whether it is completely bullet proof on when the sysctl
variables/socket option first appeared in the kernel, so you might as well
drop this information, but I'm pretty sure about how it works.
Here we go with my patch:
diff -ru man-pages-2.70/man7/tcp.7 man-pages-2.70.new/man7/tcp.7
--- man-pages-2.70/man7/tcp.7 2007-11-24 14:33:34.000000000 +0100
+++ man-pages-2.70.new/man7/tcp.7 2007-12-12 16:34:52.000000000 +0100
@@ -177,8 +177,6 @@
.\" FIXME As at Sept 2006, kernel 2.6.18-rc5, the following are
.\" not yet documented (shown with default values):
.\"
-.\" /proc/sys/net/ipv4/tcp_congestion_control (since 2.6.13)
-.\" bic
.\" /proc/sys/net/ipv4/tcp_moderate_rcvbuf
.\" 1
.\" /proc/sys/net/ipv4/tcp_no_metrics_save
@@ -224,6 +222,20 @@
are reserved for the application buffer.
A value of 0
implies that no amount is reserved.
+.TP
+.BR tcp_allowed_congestion_control \
+" (String; default: cubic reno) (since 2.6.13) "
+Show/set the congestion control choices available to non-privileged
+processes. The list is a subset of those listed in
+.IR tcp_available_congestion_control "."
+Default is "cubic reno" and the default setting
+.RI ( tcp_congestion_control ).
+.TP
+.BR tcp_available_congestion_control \
+" (String; default: cubic reno) (since 2.6.13) "
+Lists the TCP congestion control algorithms available on the system. This
value
+can only be changed by loading/unloading modules responsible for congestion
+control.
.\"
.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
.TP
@@ -257,6 +269,17 @@
Allows two flows sharing the same connection to converge
more rapidly.
.TP
+.BR tcp_congestion_control " (String; default: cubic reno) (since 2.6.13) "
+Determines the congestion control algorithm used for newly created TCP
+sockets. By default Linux uses cubic with reno as fallback. If you want
+to have more control over the algorithm used, you must enable the symbol
+CONFIG_TCP_CONG_ADVANCED in your kernel config.
+You can use
+.BR setsockopt (2)
+to individually change the algorithm on a single socket.
+Requires CAP_NET_ADMIN or congestion algorithm to be listed in
+.IR tcp_allowed_congestion_control "."
+.TP
.BR tcp_dsack " (Boolean; default: enabled)"
Enable RFC\ 2883 TCP Duplicate SACK support.
.TP
@@ -649,7 +672,21 @@
socket options are valid on TCP sockets.
For more information see
.BR ip (7).
-.\" FIXME Document TCP_CONGESTION (new in 2.6.13)
+.TP
+.BR TCP_CONGESTION " (new since kernel version 2.6.13)"
+If set to the name of an available congestion control algorithm,
+it will henceforth be used for the socket. To get a list of
+available congestion control algorithms, consult the sysctl variable
+.IR net.ipv4.tcp_available_congestion_control "."
+The algorithm that is used by default for all newly created
+TCP sockets can be viewed/changed via the sysctl variable
+.IR net.ipv4.tcp_congestion_control "."
+If you feel, you are missing an algorithm in the list,
+you may try to load the corresponding module using
+.BR modprobe (8),
+or if your kernel is built with module autoloading support
+.RI ( CONFIG_KMOD )
+and the algorithm has been compiled as a module, it will be autoloaded.
.TP
.B TCP_CORK
If set, don't send out partial frames.
--
Michael Kerrisk
Maintainer of the Linux man-pages project
http://www.kernel.org/doc/man-pages/
Want to report a man-pages bug? Look here:
http://www.kernel.org/doc/man-pages/reporting_bugs.html
^ permalink raw reply
* Re: [PATCH 1/2] add driver for enc28j60 ethernet chip
From: Claudio Lanconelli @ 2007-12-14 9:21 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20071211090648.24ee1742@freepuppy.rosehill>
Hi Stephen,
thank you for your suggestions.
I already applied trivial fixes, but I have questions on some points,
see inline.
Stephen Hemminger wrote:
> General comments:
> * device driver does no carrier detection. This makes it useless
> for bridging, bonding, or any form of failover.
>
> * use msglevel method (via ethtool) to control debug messages
> rather than kernel configuration. This allows enabling debugging
> without recompilation which is important in distributions.
>
> * Please add ethtool support
>
> * Consider using NAPI
>
>
Can you point me to a possibly simple driver that uses ethtool and NAPI?
Or other example that I can use for reference.
May be the skeleton should be updated.
> * use netdev_priv(netdev) rather than netdev->priv
I can't find where I used netdev->priv, may be do you mean priv->netdev?
> My comments:
>
> diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
> new file mode 100644
> index 0000000..6182473
> --- /dev/null
> +++ b/drivers/net/enc28j60.c
> @@ -0,0 +1,1400 @@
> +/*
> + * Microchip ENC28J60 ethernet driver (MAC + PHY)
> + *
> + * Copyright (C) 2007 Eurek srl
> + * Author: Claudio Lanconelli <lanconelli.claudio@eptar.com>
> + * based on enc28j60.c written by David Anders for 2.4 kernel version
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * $Id: enc28j60.c,v 1.10 2007/12/10 16:59:37 claudio Exp $
> + */
> +
> +#include <linux/autoconf.h>
>
> Use msglvl instead see netdevice.h
>
Ok
> +
> +#if CONFIG_ENC28J60_DBGLEVEL > 1
> +# define VERBOSE_DEBUG
> +#endif
> +#if CONFIG_ENC28J60_DBGLEVEL > 0
> +# define DEBUG
> +#endif
> +
>
> ...
> +
> +#define MY_TX_TIMEOUT ((500*HZ)/1000)
>
> That is a really short TX timeout, should be 2 seconds at least not 1/2 sec.
> Having it less than a second causes increased wakeups.
>
Ok
> +
> +/* Max TX retries in case of collision as suggested by errata datasheet */
> +#define MAX_TX_RETRYCOUNT 16
> +
> +/* Driver local data */
> +struct enc28j60_net_local {
>
> Rename something shorter like enc28j60_net or just enc28j60?
>
Ok, renamed enc28j60_net
> + struct net_device_stats stats;
>
> net_device_stats are now in net_device.
>
> + struct net_device *netdev;
> + struct spi_device *spi;
> + struct semaphore semlock; /* protect spi_transfer_buf */
> Use mutex (or spin_lock) rather than semaphore
>
Ok
> + uint8_t *spi_transfer_buf;
> + struct sk_buff *tx_skb;
> + struct work_struct tx_work;
> + struct work_struct irq_work;
>
> Not sure why you need to have workqueue's for
> tx_work and irq_work, rather than using a spin_lock
> and doing directly.
>
I need irq_work for sure because it needs to go sleep. Any
access to enc28j60 registers are through SPI blocking transaction,
spi_sync().
I'm not sure if the hard_start_xmit() can go sleep, so I used a work
queue to tx too.
> + int bank; /* current register bank selected */
> bank is really unsigned.
>
> + uint16_t next_pk_ptr; /* next packet pointer within FIFO */
> + int max_pk_counter; /* statistics: max packet counter */
> + int tx_retry_count;
> these are used as unsigned.
>
> + int hw_enable;
> +};
> +
> +/* Selects Full duplex vs. Half duplex mode */
> +static int full_duplex = 0;
>
> Use ethtool for this.
>
Ok
> +
> +static int enc28j60_send_packet(struct sk_buff *skb, struct net_device *dev);
> +static int enc28j60_net_close(struct net_device *dev);
> +static struct net_device_stats *enc28j60_net_get_stats(struct net_device *dev);
> +static void enc28j60_set_multicast_list(struct net_device *dev);
> +static void enc28j60_net_tx_timeout(struct net_device *ndev);
> +
> +static int enc28j60_chipset_init(struct net_device *dev);
> +static void enc28j60_hw_disable(struct enc28j60_net_local *priv);
> +static void enc28j60_hw_enable(struct enc28j60_net_local *priv);
> +static void enc28j60_hw_rx(struct enc28j60_net_local *priv);
> +static void enc28j60_hw_tx(struct enc28j60_net_local *priv);
>
> If you order functions correctly in code, you don't have to waste lots
> of space with all these forward declarations.
>
> ...
>
Ok
> + const char *msg);
> +
> +/*
> + * SPI read buffer
> + * wait for the SPI transfer and copy received data to destination
> + */
> +static int
> +spi_read_buf(struct enc28j60_net_local *priv, int len, uint8_t *data)
> +{
> + uint8_t *rx_buf;
> + uint8_t *tx_buf;
> + struct spi_transfer t;
> + struct spi_message msg;
> + int ret, slen;
> +
> + slen = 1;
> + memset(&t, 0, sizeof(t));
> + t.tx_buf = tx_buf = priv->spi_transfer_buf;
> + t.rx_buf = rx_buf = priv->spi_transfer_buf + 4;
> + t.len = slen + len;
>
> If you use structure initializer you can avoid having to do
> the memset
>
Ok
>
> +
> + down(&priv->semlock);
> + tx_buf[0] = ENC28J60_READ_BUF_MEM;
> + tx_buf[1] = tx_buf[2] = tx_buf[3] = 0; /* don't care */
> +
> + spi_message_init(&msg);
> + spi_message_add_tail(&t, &msg);
> + ret = spi_sync(priv->spi, &msg);
> + if (ret == 0) {
> + memcpy(data, &rx_buf[slen], len);
> + ret = msg.status;
> + }
> + up(&priv->semlock);
> + if (ret != 0)
> + dev_dbg(&priv->netdev->dev, "%s: failed: ret = %d\n",
> + __FUNCTION__, ret);
> +
> + return ret;
> +}
>
> ...
>
> +/*
> + * Register word read
> + */
> +static inline int enc28j60_regw_read(struct enc28j60_net_local *priv,
> + uint8_t address)
> +{
>
> I wouldn't bother marking these as "inline" since the compiler
> will decide to inline in most cases. By telling the compiler to
> inline it may generate bigger/slower code.
>
Ok
>
> + int rl, rh;
> +
> + enc28j60_set_bank(priv, address);
> + rl = spi_read_op(priv, ENC28J60_READ_CTRL_REG, address);
> + rh = spi_read_op(priv, ENC28J60_READ_CTRL_REG, address + 1);
> +
> + return (rh << 8) | rl;
> +}
>
> ...
>
> +/*
> + * Program the hardware MAC address from dev->dev_addr.
> + */
> +static void enc28j60_set_hw_macaddr(struct enc28j60_net_local *priv)
> +{
> + struct net_device *ndev = priv->netdev;
> +
> + if (!priv->hw_enable) {
> + /* NOTE: MAC address in ENC28J60 is byte-backward */
> + enc28j60_regb_write(priv, MAADR5, ndev->dev_addr[0]);
> + enc28j60_regb_write(priv, MAADR4, ndev->dev_addr[1]);
> + enc28j60_regb_write(priv, MAADR3, ndev->dev_addr[2]);
> + enc28j60_regb_write(priv, MAADR2, ndev->dev_addr[3]);
> + enc28j60_regb_write(priv, MAADR1, ndev->dev_addr[4]);
> + enc28j60_regb_write(priv, MAADR0, ndev->dev_addr[5]);
> +
> + dev_dbg(&ndev->dev,
> + "%s() [%s] Setting MAC address to "
> + "%02x:%02x:%02x:%02x:%02x:%02x\n",
> + __FUNCTION__, ndev->name, ndev->dev_addr[0],
> + ndev->dev_addr[1], ndev->dev_addr[2], ndev->dev_addr[3],
> + ndev->dev_addr[4], ndev->dev_addr[5]);
> + } else
> + dev_dbg(&ndev->dev,
> + "%s() Warning: hw must be disabled to set hw "
> + "Mac address\n", __FUNCTION__);
>
> Should return -EINVAL/-EBUSY/... instead of printing message.
>
Ok
> +}
> +
> +/*
> + * Store the new hardware address in dev->dev_addr, and update the MAC.
> + */
> +static int enc28j60_set_mac_address(struct net_device *dev, void *addr)
> +{
> + struct sockaddr *address = addr;
> + struct enc28j60_net_local *priv = netdev_priv(dev);
> +
> + if (!is_valid_ether_addr(address->sa_data))
> + return -EADDRNOTAVAIL;
> +
> + memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
> + enc28j60_set_hw_macaddr(priv);
> +
> + return 0;
> +}
> ...
>
> +
> +/*
> + * Get the current statistics.
> + * This may be called with the card open or closed.
> + */
> +static struct net_device_stats *enc28j60_net_get_stats(struct net_device *dev)
> +{
> + struct enc28j60_net_local *priv = netdev_priv(dev);
> +
> + return &priv->stats;
> +}
>
> If you use dev->stats, then you don't need your own get_stats function.
>
Ok
>
> ...
>
> +static int enc28j60_hw_init(struct enc28j60_net_local *priv)
> +{
> + uint8_t reg;
> +
> + dev_dbg(&priv->spi->dev, "%s() - %s\n",
> + __FUNCTION__, full_duplex ? "FullDuplex" : "HalfDuplex");
> + /* first soft reset the chip */
> + enc28j60_soft_reset(priv);
> +
> + dev_vdbg(&priv->spi->dev, "%s() bank0\n", __FUNCTION__);
> +
> + /* Clear ECON1 */
> + spi_write_op(priv, ENC28J60_WRITE_CTRL_REG, ECON1, 0x00);
> + priv->bank = 0;
> + priv->hw_enable = 0;
> + priv->tx_retry_count = 0;
> +
> + enc28j60_regb_write(priv, ECON2, ECON2_AUTOINC);
> + enc28j60_rxfifo_init(priv, RXSTART_INIT, RXEND_INIT);
> + enc28j60_txfifo_init(priv, TXSTART_INIT, TXEND_INIT);
> +
> + /*
> + * Check the RevID.
> + * If it's 0x00 or 0xFF probably the enc28j60 is not mounted or
> + * damaged
> + */
> + reg = enc28j60_regb_read(priv, EREVID);
> + if (reg == 0x00 || reg == 0xff)
> + return 0;
> +
> + dev_vdbg(&priv->spi->dev, "%s() bank1\n", __FUNCTION__);
> +
> + /* default filter mode: (unicast OR broadcast) AND crc valid */
> + enc28j60_regb_write(priv, ERXFCON,
> + ERXFCON_UCEN | ERXFCON_CRCEN | ERXFCON_BCEN);
> +
> + dev_vdbg(&priv->spi->dev, "%s() bank2\n", __FUNCTION__);
> + /* enable MAC receive */
> + enc28j60_regb_write(priv, MACON1,
> + MACON1_MARXEN | MACON1_TXPAUS | MACON1_RXPAUS);
> + /* enable automatic padding and CRC operations */
> + if (full_duplex) {
> + enc28j60_regb_write(priv, MACON3,
> + MACON3_PADCFG0 | MACON3_TXCRCEN |
> + MACON3_FRMLNEN | MACON3_FULDPX);
> + /* set inter-frame gap (non-back-to-back) */
> + enc28j60_regb_write(priv, MAIPGL, 0x12);
> + /* set inter-frame gap (back-to-back) */
> + enc28j60_regb_write(priv, MABBIPG, 0x15);
> + } else {
> + enc28j60_regb_write(priv, MACON3,
> + MACON3_PADCFG0 | MACON3_TXCRCEN |
> + MACON3_FRMLNEN);
> + enc28j60_regb_write(priv, MACON4, 1 << 6); /* DEFER bit */
> + /* set inter-frame gap (non-back-to-back) */
> + enc28j60_regw_write(priv, MAIPGL, 0x0C12);
> + /* set inter-frame gap (back-to-back) */
> + enc28j60_regb_write(priv, MABBIPG, 0x12);
> + }
> + /*
> + * MACLCON1 (default)
> + * MACLCON2 (default)
> + * Set the maximum packet size which the controller will accept
> + */
> + enc28j60_regw_write(priv, MAMXFLL, MAX_FRAMELEN);
> +
> + dev_vdbg(&priv->spi->dev, "%s() bank3\n", __FUNCTION__);
> + /* NOTE: MAC address in ENC28J60 is byte-backward */
> + enc28j60_regb_write(priv, MAADR5, ENC28J60_MAC0);
> + enc28j60_regb_write(priv, MAADR4, ENC28J60_MAC1);
> + enc28j60_regb_write(priv, MAADR3, ENC28J60_MAC2);
> + enc28j60_regb_write(priv, MAADR2, ENC28J60_MAC3);
> + enc28j60_regb_write(priv, MAADR1, ENC28J60_MAC4);
> + enc28j60_regb_write(priv, MAADR0, ENC28J60_MAC5);
>
> Rather than having same address, please use random_ether_addr()
> to avoid problems with two devices with same ethernet address.
>
Ok
> ...
>
> +static int __devinit enc28j60_probe(struct spi_device *spi)
> +{
> + struct net_device *dev;
> + struct enc28j60_net_local *priv;
> + int ret = 0;
> +
> + dev_dbg(&spi->dev, "%s() start\n", __FUNCTION__);
> +
> + dev = alloc_etherdev(sizeof(struct enc28j60_net_local));
> + if (!dev) {
> + ret = -ENOMEM;
> + goto error_alloc;
> + }
> + priv = netdev_priv(dev);
> +
> + priv->netdev = dev; /* priv to netdev reference */
> + priv->spi = spi; /* priv to spi reference */
> + priv->spi_transfer_buf = kmalloc(SPI_TRANSFER_BUF_LEN, GFP_KERNEL);
>
> Why not declare the transfer buffer as an array in spi?
>
I don't understand exactly what do you mean here.
spi field point to struct spi_device from SPI subsystem.
Other SPI client driver uses an allocated buffer too.
Cheers,
Claudio Lanconelli
^ permalink raw reply
* [NETFILTER] xt_hashlimit : speedups hash_dst()
From: Eric Dumazet @ 2007-12-14 11:09 UTC (permalink / raw)
To: Patrick McHardy; +Cc: netfilter-devel, netdev
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
1) Using jhash2() instead of jhash() is a litle bit faster if applicable.
2) Thanks to jhash, hash value uses full 32 bits.
Instead of returning hash % size (implying a divide)
we return the high 32 bits of the (hash * size) that will
give results between [0 and size-1] and same hash distribution.
On most cpus, a multiply is less expensive than a divide, by an order
of magnitude.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
[-- Attachment #2: xt_hashlimit.patch --]
[-- Type: text/plain, Size: 855 bytes --]
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 033d448..7cc04e8 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -105,7 +105,16 @@ static inline bool dst_cmp(const struct dsthash_ent *ent,
static u_int32_t
hash_dst(const struct xt_hashlimit_htable *ht, const struct dsthash_dst *dst)
{
- return jhash(dst, sizeof(*dst), ht->rnd) % ht->cfg.size;
+ u_int32_t hash = jhash2((const u32 *)dst,
+ sizeof(*dst)/sizeof(u32),
+ ht->rnd);
+ /*
+ * Instead of returning hash % ht->cfg.size (implying a divide)
+ * we return the high 32 bits of the (hash * ht->cfg.size) that will
+ * give results between [0 and cfg.size-1] and same hash distribution,
+ * but using a multiply, less expensive than a divide
+ */
+ return ((u64)hash * ht->cfg.size) >> 32;
}
static struct dsthash_ent *
^ permalink raw reply related
* [patch] authorize some users to bind on specifics priv ports
From: Arnauld Michelizza @ 2007-12-14 10:38 UTC (permalink / raw)
To: netdev
Really simpler and usable than POSIX/capabilities and I think it
covers basics needs for sysadmins... at least, it covers mine :-)
www-data$ nc -l -p 80 -v
Can't grab 0.0.0.0:80 with bind : Permission denied
root# id -u www-data
33
root# port_acl_set +80 www-data
root# cat /proc/net/port_acl
80: 33
www-data$ nc -l -p 80 -v
listening on [any] 80 ...
diff -r --unidirectional-new-file -u linux-2.6.23/arch/i386/kernel/syscall_table.S linux-2.6.23-patched/arch/i386/kernel/syscall_table.S
--- linux-2.6.23/arch/i386/kernel/syscall_table.S 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-patched/arch/i386/kernel/syscall_table.S 2007-12-13 14:29:40.000000000 +0100
@@ -324,3 +324,4 @@
.long sys_timerfd
.long sys_eventfd
.long sys_fallocate
+ .long sys_port_acl_set /* 325 */
diff -r --unidirectional-new-file -u linux-2.6.23/include/asm-i386/unistd.h linux-2.6.23-patched/include/asm-i386/unistd.h
--- linux-2.6.23/include/asm-i386/unistd.h 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-patched/include/asm-i386/unistd.h 2007-12-13 14:29:40.000000000 +0100
@@ -330,10 +330,11 @@
#define __NR_timerfd 322
#define __NR_eventfd 323
#define __NR_fallocate 324
+#define __NR_port_acl_set 325
#ifdef __KERNEL__
-#define NR_syscalls 325
+#define NR_syscalls 326
#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
diff -r --unidirectional-new-file -u linux-2.6.23/include/net/port_acl.h linux-2.6.23-patched/include/net/port_acl.h
--- linux-2.6.23/include/net/port_acl.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-patched/include/net/port_acl.h 2007-12-13 15:17:40.000000000 +0100
@@ -0,0 +1,15 @@
+#include <linux/types.h>
+
+struct port_acl {
+ uid_t uid;
+ struct port_acl *next;
+};
+
+#ifdef __PORT_ACL__
+ struct port_acl *port_acl_list[1024];
+#else
+ extern struct port_acl *port_acl_list[1024];
+#endif
+
+extern int port_acl(short int);
+extern int port_acl_get_info(char *, char **, off_t, int);
diff -r --unidirectional-new-file -u linux-2.6.23/kernel/sys.c linux-2.6.23-patched/kernel/sys.c
--- linux-2.6.23/kernel/sys.c 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-patched/kernel/sys.c 2007-12-13 16:01:24.000000000 +0100
@@ -43,6 +43,9 @@
#include <asm/io.h>
#include <asm/unistd.h>
+#define __PORT_ACL__
+#include <net/port_acl.h>
+
#ifndef SET_UNALIGN_CTL
# define SET_UNALIGN_CTL(a,b) (-EINVAL)
#endif
@@ -2356,4 +2359,89 @@
return ret;
}
+
+/*
+ * The following lines were added to implement port_acl secured
+ * mecanism :
+ * port_acl_add - add to a user the authorisation to acces a particular port
+ * port_acl_remove - remove to a user that authorisation
+ * sys_port_acl_set - front end for port_acl_add and port_acl_remove
+ */
+long port_acl_add(short int snum, uid_t uid)
+{
+ struct port_acl *ptr, *new;
+
+ /* we verify if the permition is already set for that user */
+ ptr = port_acl_list[snum];
+
+ while (ptr != NULL) {
+ if (ptr->uid == uid)
+ return -EBUSY;
+ if (ptr->next == NULL)
+ break;
+ ptr = ptr->next;
+ }
+
+ /* ok, we haven't found the user and ptr is a pointer on the
+ last structure */
+ new = kmalloc( sizeof(struct port_acl), GFP_KERNEL);
+ new->next = NULL;
+ new->uid = uid;
+
+ if(ptr == NULL)
+ port_acl_list[snum] = new;
+ else
+ ptr->next = new;
+
+ return 0;
+}
+
+long port_acl_remove(short int snum, uid_t uid)
+{
+ struct port_acl *ptr, *prev = 0;
+
+ /* we verify if the permition is already set for that user */
+ ptr = port_acl_list[snum];
+
+ while (ptr != NULL) {
+ /* we found the user */
+ if (ptr->uid == uid) {
+ if (ptr == port_acl_list[snum]) {
+ port_acl_list[snum] = ptr->next;
+ }
+ else {
+ prev->next = ptr->next;
+ }
+ kfree(ptr);
+ return 0;
+ }
+ prev = ptr;
+ ptr = ptr->next;
+ }
+
+ return -ENODATA;
+}
+
+asmlinkage long sys_port_acl_set(short int snum, uid_t uid, int act)
+{
+ /* the owner of the process must be root */
+ if (current->uid != 0)
+ return -EACCES;
+
+ /* we verify that the port is valid */
+ if (snum<0 || snum>1023)
+ return -EINVAL;
+
+ if (uid<1 || uid>65534)
+ return -EINVAL;
+
+ if (act == 0)
+ return port_acl_remove(snum, uid);
+ else if (act == 1)
+ return port_acl_add(snum, uid);
+ else
+ return -EPERM;
+}
+
+
EXPORT_SYMBOL_GPL(orderly_poweroff);
diff -r --unidirectional-new-file -u linux-2.6.23/net/ipv4/af_inet.c linux-2.6.23-patched/net/ipv4/af_inet.c
--- linux-2.6.23/net/ipv4/af_inet.c 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-patched/net/ipv4/af_inet.c 2007-12-13 15:58:55.000000000 +0100
@@ -112,6 +112,7 @@
#include <net/ipip.h>
#include <net/inet_common.h>
#include <net/xfrm.h>
+#include <net/port_acl.h>
#ifdef CONFIG_IP_MROUTE
#include <linux/mroute.h>
#endif
@@ -457,7 +458,7 @@
snum = ntohs(addr->sin_port);
err = -EACCES;
- if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
+ if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE) && !port_acl(snum))
goto out;
/* We keep a pair of addresses. rcv_saddr is the one
@@ -1456,6 +1457,8 @@
{
int rc = 0;
+ proc_net_create ("port_acl", 0, port_acl_get_info);
+
if (raw_proc_init())
goto out_raw;
if (tcp4_proc_init())
@@ -1466,6 +1469,7 @@
goto out_fib;
if (ip_misc_proc_init())
goto out_misc;
+
out:
return rc;
out_misc:
@@ -1486,6 +1490,7 @@
{
return 0;
}
+
#endif /* CONFIG_PROC_FS */
MODULE_ALIAS_NETPROTO(PF_INET);
diff -r --unidirectional-new-file -u linux-2.6.23/net/ipv4/Makefile linux-2.6.23-patched/net/ipv4/Makefile
--- linux-2.6.23/net/ipv4/Makefile 2007-10-09 22:31:38.000000000 +0200
+++ linux-2.6.23-patched/net/ipv4/Makefile 2007-12-13 14:29:40.000000000 +0100
@@ -10,7 +10,7 @@
tcp_minisocks.o tcp_cong.o \
datagram.o raw.o udp.o udplite.o \
arp.o icmp.o devinet.o af_inet.o igmp.o \
- sysctl_net_ipv4.o fib_frontend.o fib_semantics.o
+ sysctl_net_ipv4.o fib_frontend.o fib_semantics.o port_acl.o
obj-$(CONFIG_IP_FIB_HASH) += fib_hash.o
obj-$(CONFIG_IP_FIB_TRIE) += fib_trie.o
diff -r --unidirectional-new-file -u linux-2.6.23/net/ipv4/port_acl.c linux-2.6.23-patched/net/ipv4/port_acl.c
--- linux-2.6.23/net/ipv4/port_acl.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.23-patched/net/ipv4/port_acl.c 2007-12-13 16:01:12.000000000 +0100
@@ -0,0 +1,54 @@
+/*
+ * This is an implementation of acces list applied
+ * to privileged ports.
+ */
+#include <linux/sched.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+#include <net/port_acl.h>
+
+/*
+ * yields 1 if the owner of the current process is authorized to
+ * bind the port given in argument
+ */
+int port_acl(short int snum)
+{
+ struct port_acl *ptr;
+ ptr = port_acl_list[snum];
+
+ while (ptr != NULL) {
+ if (ptr->uid == current->uid)
+ return 1;
+ ptr = ptr->next;
+ }
+
+ return 0;
+}
+
+
+/*
+ * Report privileged port authorization
+ */
+int port_acl_get_info(char *buffer, char **start, off_t offset, int length)
+{
+ int p;
+ int len = 0;
+ int limit = length - 80;
+ struct port_acl *ptr;
+
+ /* for every port below 1024, we search privileged uid */
+ for (p=0;p<1024;p++) {
+ ptr = port_acl_list[p];
+ if (ptr != NULL) {
+ len += sprintf(buffer+len,"%d:", p);
+ do {
+ len += sprintf(buffer+len," %d", ptr->uid);
+ ptr = ptr->next;
+ } while (ptr != NULL && len < limit);
+ len += sprintf(buffer+len,"\n");
+ }
+ }
+
+ return len;
+}
port_acl_set.c
---
/*
* Add or remove to a user the authorisation to acces
* a particular port via the following system call :
* int sys_port_acl_set(short int snum, uid_t uid, int act)
*/
#include <syscall.h>
#include <linux/unistd.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
int main(int argc, char **argv)
{
int ret;
int pnum, action;
struct passwd *user;
/* parse args */
if (argc<3) {
fprintf(stderr, "usage : %s <+->service login\n", argv[0]);
exit(1);
}
switch (*argv[1]) {
case '+' :
action = 1 ; break;
case '-' :
action = 0 ; break;
default :
fprintf(stderr,"action '%c' is not valid\n", *argv[1]);
exit(1);
}
pnum = atoi(argv[1]+1);
user = getpwnam(argv[2]);
if (!user) {
fprintf(stderr,"%s is not a valid user\n", argv[2]);
exit(1);
}
/* display a nice message */
if (action == 1) {
printf("add access on port %d to user: %s(%d)\n", pnum, argv[2], user->pw_uid);
}
else {
printf("remove access on port %d to user: %s(%d)\n", pnum, argv[2], user->pw_uid);
}
ret = syscall(__NR_port_acl_set, pnum, user->pw_uid, action);
if (ret!=0) {
perror("");
exit(2);
}
return 0;
}
^ permalink raw reply
* Re: [NETFILTER] xt_hashlimit : speedups hash_dst()
From: Patrick McHardy @ 2007-12-14 11:20 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netfilter-devel, netdev
In-Reply-To: <4762646B.30207@cosmosbay.com>
Eric Dumazet wrote:
> 1) Using jhash2() instead of jhash() is a litle bit faster if applicable.
>
> 2) Thanks to jhash, hash value uses full 32 bits.
> Instead of returning hash % size (implying a divide)
> we return the high 32 bits of the (hash * size) that will
> give results between [0 and size-1] and same hash distribution.
>
> On most cpus, a multiply is less expensive than a divide, by an order
> of magnitude.
Clever :) Applied, thanks Eric.
^ permalink raw reply
* Re: [RFC] mac80211: clean up frame receive handling
From: Johannes Berg @ 2007-12-14 12:13 UTC (permalink / raw)
To: Jouni Malinen; +Cc: linux-wireless, netdev, Michael Wu, Tomas Winkler
In-Reply-To: <20071214050808.GE5698-mgr6C1c9aYeHXe+LvDLADg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]
> Is there any way for an user space application to figure out whether a
> received EAPOL frame was encrypted? In theory, WPA/WPA2 Authenticators
> (e.g., hostapd) should verify that the frame was encrypted if pairwise
> keys are set (whereas IEEE 802.1X Authenticator accepts unencrypted
> EAPOL frames).
Unfortunately not. Does that really matter? It seems that the
verification whether the frame was encrypted would either be "always
require encryption when pairwise keys in use" (which this patch doesn't
do right now but could trivially be done) or simply "don't care since it
doesn't really matter".
> Did you/someone already verify that the Linux bridge code does not
> bridge EAPOL frames? The use of a separate interface for this removed
> the need for doing such filtering based on ethertype, but with EAPOL
> frames using the same netdev with other data frames, the bridge code
> should filter these out (mainly the PAE group addressed ones, but if I
> remember correctly, IEEE 802.1X specified all frames using EAPOL
> ethertype not to be bridged).
Actually, 802.1X doesn't specify that, as I said previously it
*recommends* it in C.3.3 (not C.1.1 as the 802.11 specs lead you to
believe). Also, a patch to do this was rejected by Stephen Hemminger, so
I decided to only pass up EAPOL frames that are either for our own
unicast address or the link-local eapol address, both of which won't be
bridged.
> I haven't looked into the current implementations and/or proposed
> patches on for TX part, but I would assume that it is possible to select
> whether an EAPOL frame will be encrypted when injecting it(?).
Yes, by setting the F_WEP flag on any frame you decide whether it will
be encrypted (if possible) or not. Right now, the corresponding hostapd
patch always sets that flag.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [RFC] mac80211: clean up frame receive handling
From: Johannes Berg @ 2007-12-14 12:14 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless, netdev, Michael Wu, Tomas Winkler, Jouni Malinen
In-Reply-To: <20071213204933.GD3083@tuxdriver.com>
[-- Attachment #1: Type: text/plain, Size: 923 bytes --]
> > +static bool ieee80211_frame_allowed(struct ieee80211_txrx_data *rx)
> > +{
> > + static const u8 pae_group_addr[ETH_ALEN]
> > + = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x03 };
> > + struct ethhdr *ehdr = (struct ethhdr *)rx->skb->data;
> > +
> > + if (rx->skb->protocol == htons(ETH_P_PAE) &&
> > + (compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0 ||
> > + compare_ether_addr(ehdr->h_dest, rx->dev->dev_addr) == 0))
> > + return true;
>
> Should you reverse these two compare_ether_addr calls?
> rx->dev->dev_addr seems more likely for any given packet. It probably
> makes little difference but it seems like checking for that first
> would still be better.
I think in theory all eapol frames are sent to the PAE group address,
but I have no idea which of the checks would be more efficient. It seems
that the first could be optimised a lot because it's constant too...
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()
From: Johannes Berg @ 2007-12-14 12:37 UTC (permalink / raw)
To: Andrew Morton; +Cc: Herbert Xu, davem, netdev
In-Reply-To: <20071214002209.ac748206.akpm@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 433 bytes --]
> I don't see how it could warn about that. Nor should it - one might want
> to check that rtnl_lock is held inside preempt_disable() or spin_lock or
> whatever.
I agree with this. IIRC I removed some ASSERT_RTNL()s in the wireless
code (or maybe it was only during testing patches) where we had a
function that required only the rtnl to be held but in certain contexts
was called from within an RCU section.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()
From: Herbert Xu @ 2007-12-14 12:46 UTC (permalink / raw)
To: Johannes Berg; +Cc: Andrew Morton, davem, netdev
In-Reply-To: <1197635860.16079.51.camel@johannes.berg>
On Fri, Dec 14, 2007 at 01:37:40PM +0100, Johannes Berg wrote:
>
> I agree with this. IIRC I removed some ASSERT_RTNL()s in the wireless
> code (or maybe it was only during testing patches) where we had a
> function that required only the rtnl to be held but in certain contexts
> was called from within an RCU section.
Please point me to the actual code so I can see if this is legit
or not.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()
From: Johannes Berg @ 2007-12-14 12:54 UTC (permalink / raw)
To: Herbert Xu; +Cc: Andrew Morton, davem, netdev
In-Reply-To: <20071214124647.GB17898@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 476 bytes --]
> > I agree with this. IIRC I removed some ASSERT_RTNL()s in the wireless
> > code (or maybe it was only during testing patches) where we had a
> > function that required only the rtnl to be held but in certain contexts
> > was called from within an RCU section.
>
> Please point me to the actual code so I can see if this is legit
> or not.
I don't think I have that case any more since now my interface list is
either protected by RCU or the rtnl.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [PATCH] PS3: gelic: Add wireless support for PS3
From: Dan Williams @ 2007-12-14 12:58 UTC (permalink / raw)
To: Masakazu Mokuno
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
geoffrey.levand-mEdOJwZ7QcZBDgjK7y7TUQ, Geert Uytterhoeven
In-Reply-To: <20071214134918.275E.MOKUNO-DfbDroY8Xu1L9jVzuh4AOg@public.gmane.org>
On Fri, 2007-12-14 at 14:03 +0900, Masakazu Mokuno wrote:
> On Thu, 13 Dec 2007 16:13:38 -0500
> Dan Williams <dcbw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>
> > One more question; does the driver work with wpa_supplicant for WPA, or
> > does the firmware capture the EAPOL frames and handle the 4 way
> > handshake internally? Ideally the firmware would have the ability to
> > pass those frames up unmodified so the driver would at least have a
> > _hope_ of 802.1x capability. Does the firmware handle Dynamic WEP at
> > all?
> >
> > Basically, what happens when the AP you've just associated with starts
> > sending you EAPOL traffic to start the 802.1x process?
>
> The PS3 wireless device does the association and 4way handshake in its
> firmware/hypervisor. No interventions between them are allowed to the guest
> OSes.
> All frames which are sent/received from/to before the connection process
> completed seems to be dropped by the hardware. Only the static WEP is
> supported.
That sort of sucks; but I guess there's not too much you can do about
it. That probably means that using wpa_supplicant + WPA is completely
out of the picture, which unfortunately makes the PS3 wireless unlike
any other card, which would require special-casing the PS3 in userspace
tools.
Dan
^ permalink raw reply
* Re: 2.6.24-rc5-mm1
From: Dhaval Giani @ 2007-12-14 14:08 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, davem, netdev
In-Reply-To: <20071213024050.7d6e5f3e.akpm@linux-foundation.org>
Hi Andrew,
I hit this just now. Not sure if I can reproduce it though.
WARNING: at net/ipv4/tcp_input.c:2533 tcp_fastretrans_alert()
Pid: 4624, comm: yield Not tainted 2.6.24-rc5-mm1 #5
[<c010582a>] show_trace_log_lvl+0x12/0x22
[<c0105847>] show_trace+0xd/0xf
[<c0105959>] dump_stack+0x57/0x5e
[<c03db95b>] tcp_fastretrans_alert+0xde/0x5bd
[<c03dcab2>] tcp_ack+0x236/0x2e4
[<c03dea01>] tcp_rcv_established+0x51e/0x5c0
[<c03e56f1>] tcp_v4_do_rcv+0x22/0xc4
[<c03e5c49>] tcp_v4_rcv+0x4b6/0x7f5
[<c03cd5ad>] ip_local_deliver_finish+0xb9/0x169
[<c03cd68a>] ip_local_deliver+0x2d/0x34
[<c03cd91d>] ip_rcv_finish+0x28c/0x2ab
[<c03cdb16>] ip_rcv+0x1da/0x204
[<c03b800a>] netif_receive_skb+0x23c/0x26f
[<c02db326>] tg3_rx+0x246/0x353
[<c02db4ac>] tg3_poll_work+0x79/0x86
[<c02db4e8>] tg3_poll+0x2f/0x16f
[<c03b822b>] net_rx_action+0xbb/0x1a8
[<c0129596>] __do_softirq+0x73/0xe6
[<c0129642>] do_softirq+0x39/0x51
[<c01296c0>] irq_exit+0x47/0x49
[<c01064f4>] do_IRQ+0x55/0x69
[<c0105492>] common_interrupt+0x2e/0x34
=======================
--
regards,
Dhaval
^ permalink raw reply
* [PATCH 20/29] netfilter: NF_QUEUE vs emergency skbs
From: Peter Zijlstra @ 2007-12-14 15:39 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton, linux-kernel, linux-mm, netdev,
trond.myklebust
Cc: Peter Zijlstra
In-Reply-To: <20071214153907.770251000@chello.nl>
[-- Attachment #1: emergency-nf_queue.patch --]
[-- Type: text/plain, Size: 835 bytes --]
Avoid memory getting stuck waiting for userspace, drop all emergency packets.
This of course requires the regular storage route to not include an NF_QUEUE
target ;-)
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
net/netfilter/core.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-2.6/net/netfilter/core.c
===================================================================
--- linux-2.6.orig/net/netfilter/core.c
+++ linux-2.6/net/netfilter/core.c
@@ -176,9 +176,12 @@ next_hook:
ret = 1;
goto unlock;
} else if (verdict == NF_DROP) {
+drop:
kfree_skb(skb);
ret = -EPERM;
} else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) {
+ if (skb_emergency(*pskb))
+ goto drop;
if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn,
verdict >> NF_VERDICT_BITS))
goto next_hook;
--
^ permalink raw reply
* Re: [patch] add tcp congestion control relevant parts
From: Stephen Hemminger @ 2007-12-14 16:15 UTC (permalink / raw)
To: Michael Kerrisk; +Cc: netdev, linux-net, Thomas Egerer, linux-man
In-Reply-To: <47624360.5050007@gmail.com>
On Fri, 14 Dec 2007 09:48:32 +0100
Michael Kerrisk <mtk.manpages@googlemail.com> wrote:
> Hello Linux networking folk,
>
> I received the patch below for the tcp.7 man page. Would anybody here be
> prepared to review the new material / double check the details?
>
> Cheers,
>
> Michael
>
> -------- Original Message --------
> Subject: [patch] add tcp congestion control relevant parts
> Date: Wed, 12 Dec 2007 16:40:23 +0100
> From: Thomas Egerer <thomas.Egerer@secunet.com>
> To: mtk.manpages@gmail.com
> CC: linux-man@vger.kernel.org
>
> Hello *,
>
> man-pages version : 2.70 from http://www.kernel.org/pub/linux/docs/man-pages/
> All required information were obtained by reading the kernel
> code/documentation.
> I'm not sure, whether it is completely bullet proof on when the sysctl
> variables/socket option first appeared in the kernel, so you might as well
> drop this information, but I'm pretty sure about how it works.
> Here we go with my patch:
>
> diff -ru man-pages-2.70/man7/tcp.7 man-pages-2.70.new/man7/tcp.7
> --- man-pages-2.70/man7/tcp.7 2007-11-24 14:33:34.000000000 +0100
> +++ man-pages-2.70.new/man7/tcp.7 2007-12-12 16:34:52.000000000 +0100
> @@ -177,8 +177,6 @@
> .\" FIXME As at Sept 2006, kernel 2.6.18-rc5, the following are
> .\" not yet documented (shown with default values):
> .\"
> -.\" /proc/sys/net/ipv4/tcp_congestion_control (since 2.6.13)
> -.\" bic
> .\" /proc/sys/net/ipv4/tcp_moderate_rcvbuf
> .\" 1
> .\" /proc/sys/net/ipv4/tcp_no_metrics_save
> @@ -224,6 +222,20 @@
> are reserved for the application buffer.
> A value of 0
> implies that no amount is reserved.
> +.TP
> +.BR tcp_allowed_congestion_control \
> +" (String; default: cubic reno) (since 2.6.13) "
> +Show/set the congestion control choices available to non-privileged
> +processes. The list is a subset of those listed in
> +.IR tcp_available_congestion_control "."
> +Default is "cubic reno" and the default setting
> +.RI ( tcp_congestion_control ).
> +.TP
> +.BR tcp_available_congestion_control \
> +" (String; default: cubic reno) (since 2.6.13) "
> +Lists the TCP congestion control algorithms available on the system. This
> value
> +can only be changed by loading/unloading modules responsible for congestion
> +control.
> .\"
> .\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
> .TP
> @@ -257,6 +269,17 @@
> Allows two flows sharing the same connection to converge
> more rapidly.
> .TP
> +.BR tcp_congestion_control " (String; default: cubic reno) (since 2.6.13) "
> +Determines the congestion control algorithm used for newly created TCP
> +sockets. By default Linux uses cubic with reno as fallback. If you want
> +to have more control over the algorithm used, you must enable the symbol
> +CONFIG_TCP_CONG_ADVANCED in your kernel config.
You can choose the default congestion control as well as part of the kernel
configuration.
>
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply
* Packet per Second
From: Flávio Pires @ 2007-12-14 15:34 UTC (permalink / raw)
To: netdev; +Cc: bridge
Hi all,
It's my first time using usenet...
Well, I work on an ISP and we have a linux box acting as a
bridge+firewall. With this bridge+firewall we control the packet rate
per second from each client and from our repeaters. But I can`t
measure the packet rate per IP. Is there any tool for this?
Actually, what I want is to measure the packet rate per IP and
generate graphics with mrtg or rrdtool, but for this I must have the
number of packets per second of each client :)
Thank you all
--
Flávio
--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
^ 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