* Re: [PATCH ref0] net: add Faraday FTMAC100 10/100 Ethernet driver
From: Po-Yu Chuang @ 2011-02-25 9:45 UTC (permalink / raw)
To: Eric Dumazet
Cc: netdev, linux-kernel, bhutchings, joe, dilinger, mirqus, davem,
Po-Yu Chuang
In-Reply-To: <AANLkTikXUyQy+fjFSwagB3Uud2JPodsR2yFtt+jiZPSk@mail.gmail.com>
Hi Eric,
On Fri, Feb 25, 2011 at 10:32 AM, Po-Yu Chuang <ratbert.chuang@gmail.com> wrote:
> On Fri, Feb 25, 2011 at 1:48 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> Le jeudi 24 février 2011 à 18:39 +0100, Eric Dumazet a écrit :
>>> Le jeudi 24 février 2011 à 17:29 +0800, Po-Yu Chuang a écrit :
>>> > From: Po-Yu Chuang <ratbert@faraday-tech.com>
>>> > +
>>> > +static bool ftmac100_rx_packet(struct ftmac100 *priv, int *processed)
>>> > +{
>>> > + struct net_device *netdev = priv->netdev;
>>> > + struct ftmac100_rxdes *rxdes;
>>> > + struct sk_buff *skb;
>>> > + struct page *page;
>>> > + dma_addr_t map;
>>> > + int length;
>>> > +
>>> > + rxdes = ftmac100_rx_locate_first_segment(priv);
>>> > + if (!rxdes)
>>> > + return false;
>>> > +
>>> > + if (unlikely(ftmac100_rx_packet_error(priv, rxdes))) {
>>> > + ftmac100_rx_drop_packet(priv);
>>> > + return true;
>>> > + }
>>> > +
>>> > + /*
>>> > + * It is impossible to get multi-segment packets
>>> > + * because we always provide big enough receive buffers.
>>> > + */
>>> > + if (unlikely(!ftmac100_rxdes_last_segment(rxdes)))
>>> > + BUG();
>>> > +
>>> > + /* start processing */
>>> > + skb = netdev_alloc_skb_ip_align(netdev, ETH_HLEN);
>>>
>>> Oh I see... You should allocate a bigger head (say... 128 bytes)
>>>
>>> And copy in it up to 128 bytes of first part... this to avoid upper
>>> stack to reallocate skb head (because IP/TCP processing need to get
>>> their headers in skb head)
>>
>> Take a look at drivers/net/niu.c :
>>
>> #define RX_SKB_ALLOC_SIZE 128 + NET_IP_ALIGN
>>
>> static int niu_process_rx_pkt(...)
>> {
>> ...
>> skb = netdev_alloc_skb(np->dev, RX_SKB_ALLOC_SIZE);
>> ...
>> while (1) {
>> ...
>> niu_rx_skb_append(skb, page, off, append_size);
>> }
>> }
>
> Oh I got it.
>
> I will try this and redo the benchmarking.
It's a little faster than v5 now. Thanks.
I will submit the current version later.
One more question just curious, why 128 bytes?
best regards,
Po-Yu Chuang
^ permalink raw reply
* Re: [PATCH] r8169: disable ASPM
From: Francois Romieu @ 2011-02-25 9:34 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: netdev, stable, Hayes
In-Reply-To: <20110222171703.GA3285@redhat.com>
Stanislaw Gruszka <sgruszka@redhat.com> :
[...]
> Perhaps need to add entry in MAINTAINERS file?
Consider it Acked-by if Hayes wants to add himself.
--
Ueimor
^ permalink raw reply
* [PATCH 6/6] Phonet: fix flawed "SYN/ACK" logic
From: Rémi Denis-Courmont @ 2011-02-25 9:15 UTC (permalink / raw)
To: netdev
In-Reply-To: <201102251113.41620.remi.denis-courmont@nokia.com>
* Do not fail if the peer supports more or less than 3 algorithms.
* Ignore unknown congestion control algorithms instead of failing.
* Simplify congestion algorithm negotiation (largest is best).
* Do not use a static buffer.
* Fix off-by-two read overflow.
* Avoid extra memory copy (in addition to skb_copy_bits()).
The previous code really made no sense.
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
include/net/phonet/pep.h | 1 +
net/phonet/pep.c | 125 +++++++++++++++++----------------------------
2 files changed, 48 insertions(+), 78 deletions(-)
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
index 37f23dc..38eed1b 100644
--- a/include/net/phonet/pep.h
+++ b/include/net/phonet/pep.h
@@ -154,6 +154,7 @@ enum {
PN_LEGACY_FLOW_CONTROL,
PN_ONE_CREDIT_FLOW_CONTROL,
PN_MULTI_CREDIT_FLOW_CONTROL,
+ PN_MAX_FLOW_CONTROL,
};
#define pn_flow_safe(fc) ((fc) >> 1)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 0ecab59..b8c31fc 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -108,70 +108,6 @@ static int pep_reply(struct sock *sk, struct sk_buff *oskb,
#define PAD 0x00
#ifdef CONFIG_PHONET_PIPECTRLR
-static u8 pipe_negotiate_fc(u8 *host_fc, u8 *remote_fc, int len)
-{
- int i, j;
- u8 base_fc, final_fc;
-
- for (i = 0; i < len; i++) {
- base_fc = host_fc[i];
- for (j = 0; j < len; j++) {
- if (remote_fc[j] == base_fc) {
- final_fc = base_fc;
- goto done;
- }
- }
- }
- return -EINVAL;
-
-done:
- return final_fc;
-
-}
-
-static int pipe_get_flow_info(struct sock *sk, struct sk_buff *skb,
- u8 *pref_rx_fc, u8 *req_tx_fc)
-{
- struct pnpipehdr *hdr;
- u8 n_sb;
-
- if (!pskb_may_pull(skb, sizeof(*hdr) + 4))
- return -EINVAL;
-
- hdr = pnp_hdr(skb);
- n_sb = hdr->data[4];
-
- __skb_pull(skb, sizeof(*hdr) + 4);
- while (n_sb > 0) {
- u8 type, buf[3], len = sizeof(buf);
- u8 *data = pep_get_sb(skb, &type, &len, buf);
-
- if (data == NULL)
- return -EINVAL;
-
- switch (type) {
- case PN_PIPE_SB_REQUIRED_FC_TX:
- if (len < 3 || (data[2] | data[3] | data[4]) > 3)
- break;
- req_tx_fc[0] = data[2];
- req_tx_fc[1] = data[3];
- req_tx_fc[2] = data[4];
- break;
-
- case PN_PIPE_SB_PREFERRED_FC_RX:
- if (len < 3 || (data[2] | data[3] | data[4]) > 3)
- break;
- pref_rx_fc[0] = data[2];
- pref_rx_fc[1] = data[3];
- pref_rx_fc[2] = data[4];
- break;
-
- }
- n_sb--;
- }
- return 0;
-}
-
static int pipe_handler_send_req(struct sock *sk, u8 msg_id, gfp_t priority)
{
int len;
@@ -661,28 +597,61 @@ static void pipe_destruct(struct sock *sk)
}
#ifdef CONFIG_PHONET_PIPECTRLR
+static u8 pipe_negotiate_fc(const u8 *fcs, unsigned n)
+{
+ unsigned i;
+ u8 final_fc = PN_NO_FLOW_CONTROL;
+
+ for (i = 0; i < n; i++) {
+ u8 fc = fcs[i];
+
+ if (fc > final_fc && fc < PN_MAX_FLOW_CONTROL)
+ final_fc = fc;
+ }
+ return final_fc;
+}
+
static int pep_connresp_rcv(struct sock *sk, struct sk_buff *skb)
{
struct pep_sock *pn = pep_sk(sk);
- u8 host_pref_rx_fc[3] = {3, 2, 1}, host_req_tx_fc[3] = {3, 2, 1};
- u8 remote_pref_rx_fc[3], remote_req_tx_fc[3];
- u8 negotiated_rx_fc, negotiated_tx_fc;
-
- pipe_get_flow_info(sk, skb, remote_pref_rx_fc,
- remote_req_tx_fc);
- negotiated_tx_fc = pipe_negotiate_fc(remote_req_tx_fc,
- host_pref_rx_fc,
- sizeof(host_pref_rx_fc));
- negotiated_rx_fc = pipe_negotiate_fc(host_req_tx_fc,
- remote_pref_rx_fc,
- sizeof(host_pref_rx_fc));
+ struct pnpipehdr *hdr;
+ u8 n_sb;
+
+ if (!pskb_pull(skb, sizeof(*hdr) + 4))
+ return -EINVAL;
+
+ hdr = pnp_hdr(skb);
+
+ /* Parse sub-blocks */
+ n_sb = hdr->data[4];
+ while (n_sb > 0) {
+ u8 type, buf[6], len = sizeof(buf);
+ const u8 *data = pep_get_sb(skb, &type, &len, buf);
+
+ if (data == NULL)
+ return -EINVAL;
+
+ switch (type) {
+ case PN_PIPE_SB_REQUIRED_FC_TX:
+ if (len < 2 || len < data[0])
+ break;
+ pn->tx_fc = pipe_negotiate_fc(data + 2, len - 2);
+ break;
+
+ case PN_PIPE_SB_PREFERRED_FC_RX:
+ if (len < 2 || len < data[0])
+ break;
+ pn->rx_fc = pipe_negotiate_fc(data + 2, len - 2);
+ break;
+
+ }
+ n_sb--;
+ }
sk->sk_state = TCP_SYN_RECV;
sk->sk_backlog_rcv = pipe_do_rcv;
sk->sk_destruct = pipe_destruct;
pn->rx_credits = 0;
- pn->rx_fc = negotiated_rx_fc;
- pn->tx_fc = negotiated_tx_fc;
sk->sk_state_change(sk);
return pipe_handler_send_created_ind(sk, PNS_PIPE_CREATED_IND);
--
1.7.1
^ permalink raw reply related
* [PATCH 5/6] Phonet: don't bother with transaction IDs (especially for indications)
From: Rémi Denis-Courmont @ 2011-02-25 9:15 UTC (permalink / raw)
To: netdev
In-Reply-To: <201102251113.41620.remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
include/net/phonet/pep.h | 11 ----------
net/phonet/pep.c | 49 +++++++++++++--------------------------------
2 files changed, 14 insertions(+), 46 deletions(-)
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
index 4c48ed8..37f23dc 100644
--- a/include/net/phonet/pep.h
+++ b/include/net/phonet/pep.h
@@ -165,15 +165,4 @@ enum {
PEP_IND_READY,
};
-#ifdef CONFIG_PHONET_PIPECTRLR
-#define PNS_PEP_CONNECT_UTID 0x02
-#define PNS_PIPE_CREATED_IND_UTID 0x04
-#define PNS_PIPE_ENABLE_UTID 0x0A
-#define PNS_PIPE_ENABLED_IND_UTID 0x0C
-#define PNS_PIPE_DISABLE_UTID 0x0F
-#define PNS_PIPE_DISABLED_IND_UTID 0x11
-#define PNS_PEP_DISCONNECT_UTID 0x06
-
-#endif /* CONFIG_PHONET_PIPECTRLR */
-
#endif
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 15775a7..0ecab59 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -172,8 +172,7 @@ static int pipe_get_flow_info(struct sock *sk, struct sk_buff *skb,
return 0;
}
-static int pipe_handler_send_req(struct sock *sk, u8 utid,
- u8 msg_id, gfp_t priority)
+static int pipe_handler_send_req(struct sock *sk, u8 msg_id, gfp_t priority)
{
int len;
struct pnpipehdr *ph;
@@ -212,7 +211,7 @@ static int pipe_handler_send_req(struct sock *sk, u8 utid,
__skb_push(skb, sizeof(*ph));
skb_reset_transport_header(skb);
ph = pnp_hdr(skb);
- ph->utid = utid;
+ ph->utid = msg_id; /* whatever */
ph->message_id = msg_id;
ph->pipe_handle = pn->pipe_handle;
ph->error_code = PN_PIPE_NO_ERROR;
@@ -220,8 +219,7 @@ static int pipe_handler_send_req(struct sock *sk, u8 utid,
return pn_skb_send(sk, skb, NULL);
}
-static int pipe_handler_send_created_ind(struct sock *sk,
- u8 utid, u8 msg_id)
+static int pipe_handler_send_created_ind(struct sock *sk, u8 msg_id)
{
int err_code;
struct pnpipehdr *ph;
@@ -254,7 +252,7 @@ static int pipe_handler_send_created_ind(struct sock *sk,
__skb_push(skb, sizeof(*ph));
skb_reset_transport_header(skb);
ph = pnp_hdr(skb);
- ph->utid = utid;
+ ph->utid = 0;
ph->message_id = msg_id;
ph->pipe_handle = pn->pipe_handle;
ph->error_code = err_code;
@@ -262,7 +260,7 @@ static int pipe_handler_send_created_ind(struct sock *sk,
return pn_skb_send(sk, skb, NULL);
}
-static int pipe_handler_send_ind(struct sock *sk, u8 utid, u8 msg_id)
+static int pipe_handler_send_ind(struct sock *sk, u8 msg_id)
{
int err_code;
struct pnpipehdr *ph;
@@ -287,7 +285,7 @@ static int pipe_handler_send_ind(struct sock *sk, u8 utid, u8 msg_id)
__skb_push(skb, sizeof(*ph));
skb_reset_transport_header(skb);
ph = pnp_hdr(skb);
- ph->utid = utid;
+ ph->utid = 0;
ph->message_id = msg_id;
ph->pipe_handle = pn->pipe_handle;
ph->error_code = err_code;
@@ -297,16 +295,9 @@ static int pipe_handler_send_ind(struct sock *sk, u8 utid, u8 msg_id)
static int pipe_handler_enable_pipe(struct sock *sk, int enable)
{
- int utid, req;
-
- if (enable) {
- utid = PNS_PIPE_ENABLE_UTID;
- req = PNS_PEP_ENABLE_REQ;
- } else {
- utid = PNS_PIPE_DISABLE_UTID;
- req = PNS_PEP_DISABLE_REQ;
- }
- return pipe_handler_send_req(sk, utid, req, GFP_ATOMIC);
+ u8 id = enable ? PNS_PEP_ENABLE_REQ : PNS_PEP_DISABLE_REQ;
+
+ return pipe_handler_send_req(sk, id, GFP_KERNEL);
}
#endif
@@ -538,8 +529,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
#ifdef CONFIG_PHONET_PIPECTRLR
case PNS_PEP_ENABLE_RESP:
- pipe_handler_send_ind(sk, PNS_PIPE_ENABLED_IND_UTID,
- PNS_PIPE_ENABLED_IND);
+ pipe_handler_send_ind(sk, PNS_PIPE_ENABLED_IND);
if (!pn_flow_safe(pn->tx_fc)) {
atomic_set(&pn->tx_credits, 1);
@@ -573,8 +563,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
#ifdef CONFIG_PHONET_PIPECTRLR
case PNS_PEP_DISABLE_RESP:
atomic_set(&pn->tx_credits, 0);
- pipe_handler_send_ind(sk, PNS_PIPE_DISABLED_IND_UTID,
- PNS_PIPE_DISABLED_IND);
+ pipe_handler_send_ind(sk, PNS_PIPE_DISABLED_IND);
sk->sk_state = TCP_SYN_RECV;
pn->rx_credits = 0;
break;
@@ -678,7 +667,6 @@ static int pep_connresp_rcv(struct sock *sk, struct sk_buff *skb)
u8 host_pref_rx_fc[3] = {3, 2, 1}, host_req_tx_fc[3] = {3, 2, 1};
u8 remote_pref_rx_fc[3], remote_req_tx_fc[3];
u8 negotiated_rx_fc, negotiated_tx_fc;
- int ret;
pipe_get_flow_info(sk, skb, remote_pref_rx_fc,
remote_req_tx_fc);
@@ -697,12 +685,7 @@ static int pep_connresp_rcv(struct sock *sk, struct sk_buff *skb)
pn->tx_fc = negotiated_tx_fc;
sk->sk_state_change(sk);
- ret = pipe_handler_send_created_ind(sk,
- PNS_PIPE_CREATED_IND_UTID,
- PNS_PIPE_CREATED_IND
- );
-
- return ret;
+ return pipe_handler_send_created_ind(sk, PNS_PIPE_CREATED_IND);
}
#endif
@@ -943,9 +926,7 @@ static void pep_sock_close(struct sock *sk, long timeout)
pipe_do_remove(sk);
#else
/* send pep disconnect request */
- pipe_handler_send_req(sk,
- PNS_PEP_DISCONNECT_UTID, PNS_PEP_DISCONNECT_REQ,
- GFP_KERNEL);
+ pipe_handler_send_req(sk, PNS_PEP_DISCONNECT_REQ, GFP_KERNEL);
sk->sk_state = TCP_CLOSE;
#endif
}
@@ -1034,9 +1015,7 @@ static int pep_sock_connect(struct sock *sk, struct sockaddr *addr, int len)
pn->pn_sk.dobject = pn_sockaddr_get_object(spn);
pn->pn_sk.resource = pn_sockaddr_get_resource(spn);
- return pipe_handler_send_req(sk,
- PNS_PEP_CONNECT_UTID, PNS_PEP_CONNECT_REQ,
- GFP_ATOMIC);
+ return pipe_handler_send_req(sk, PNS_PEP_CONNECT_REQ, GFP_KERNEL);
}
#endif
--
1.7.1
^ permalink raw reply related
* [PATCH 4/6] Phonet: remove redumdant pep->pipe_state
From: Rémi Denis-Courmont @ 2011-02-25 9:14 UTC (permalink / raw)
To: netdev
In-Reply-To: <201102251113.41620.remi.denis-courmont@nokia.com>
sk->sk_state already contains the pipe state.
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
include/net/phonet/pep.h | 9 ---------
net/phonet/pep.c | 25 ++++++-------------------
2 files changed, 6 insertions(+), 28 deletions(-)
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
index 788ccf3..4c48ed8 100644
--- a/include/net/phonet/pep.h
+++ b/include/net/phonet/pep.h
@@ -45,9 +45,6 @@ struct pep_sock {
u8 tx_fc; /* TX flow control */
u8 init_enable; /* auto-enable at creation */
u8 aligned;
-#ifdef CONFIG_PHONET_PIPECTRLR
- u8 pipe_state;
-#endif
};
static inline struct pep_sock *pep_sk(struct sock *sk)
@@ -177,12 +174,6 @@ enum {
#define PNS_PIPE_DISABLED_IND_UTID 0x11
#define PNS_PEP_DISCONNECT_UTID 0x06
-/* Used for tracking state of a pipe */
-enum {
- PIPE_IDLE,
- PIPE_DISABLED,
- PIPE_ENABLED,
-};
#endif /* CONFIG_PHONET_PIPECTRLR */
#endif
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 4fce882..15775a7 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -527,7 +527,6 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
#ifdef CONFIG_PHONET_PIPECTRLR
case PNS_PEP_DISCONNECT_RESP:
- pn->pipe_state = PIPE_IDLE;
sk->sk_state = TCP_CLOSE;
break;
#endif
@@ -539,7 +538,6 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
#ifdef CONFIG_PHONET_PIPECTRLR
case PNS_PEP_ENABLE_RESP:
- pn->pipe_state = PIPE_ENABLED;
pipe_handler_send_ind(sk, PNS_PIPE_ENABLED_IND_UTID,
PNS_PIPE_ENABLED_IND);
@@ -574,7 +572,6 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
#ifdef CONFIG_PHONET_PIPECTRLR
case PNS_PEP_DISABLE_RESP:
- pn->pipe_state = PIPE_DISABLED;
atomic_set(&pn->tx_credits, 0);
pipe_handler_send_ind(sk, PNS_PIPE_DISABLED_IND_UTID,
PNS_PIPE_DISABLED_IND);
@@ -692,7 +689,6 @@ static int pep_connresp_rcv(struct sock *sk, struct sk_buff *skb)
remote_pref_rx_fc,
sizeof(host_pref_rx_fc));
- pn->pipe_state = PIPE_DISABLED;
sk->sk_state = TCP_SYN_RECV;
sk->sk_backlog_rcv = pipe_do_rcv;
sk->sk_destruct = pipe_destruct;
@@ -941,21 +937,18 @@ static void pep_sock_close(struct sock *sk, long timeout)
sk_for_each_safe(sknode, p, n, &pn->ackq)
sk_del_node_init(sknode);
sk->sk_state = TCP_CLOSE;
- } else if ((1 << sk->sk_state) & (TCPF_SYN_RECV|TCPF_ESTABLISHED))
+ } else if ((1 << sk->sk_state) & (TCPF_SYN_RECV|TCPF_ESTABLISHED)) {
+#ifndef CONFIG_PHONET_PIPECTRLR
/* Forcefully remove dangling Phonet pipe */
pipe_do_remove(sk);
-
-#ifdef CONFIG_PHONET_PIPECTRLR
- if (pn->pipe_state != PIPE_IDLE) {
+#else
/* send pep disconnect request */
pipe_handler_send_req(sk,
PNS_PEP_DISCONNECT_UTID, PNS_PEP_DISCONNECT_REQ,
GFP_KERNEL);
-
- pn->pipe_state = PIPE_IDLE;
sk->sk_state = TCP_CLOSE;
- }
#endif
+ }
ifindex = pn->ifindex;
pn->ifindex = 0;
@@ -1101,10 +1094,6 @@ static int pep_setsockopt(struct sock *sk, int level, int optname,
#ifdef CONFIG_PHONET_PIPECTRLR
case PNPIPE_PIPE_HANDLE:
if (val) {
- if (pn->pipe_state > PIPE_IDLE) {
- err = -EFAULT;
- break;
- }
pn->pipe_handle = val;
break;
}
@@ -1138,7 +1127,7 @@ static int pep_setsockopt(struct sock *sk, int level, int optname,
#ifdef CONFIG_PHONET_PIPECTRLR
case PNPIPE_ENABLE:
- if (pn->pipe_state <= PIPE_IDLE) {
+ if ((1 << sk->sk_state) & ~(TCPF_SYN_RECV|TCPF_ESTABLISHED)) {
err = -ENOTCONN;
break;
}
@@ -1177,9 +1166,7 @@ static int pep_getsockopt(struct sock *sk, int level, int optname,
#ifdef CONFIG_PHONET_PIPECTRLR
case PNPIPE_ENABLE:
- if (pn->pipe_state <= PIPE_IDLE)
- return -ENOTCONN;
- val = pn->pipe_state != PIPE_DISABLED;
+ val = sk->sk_state == TCP_ESTABLISHED;
break;
#endif
--
1.7.1
^ permalink raw reply related
* [PATCH 3/6] Phonet: use socket destination in pipe protocol
From: Rémi Denis-Courmont @ 2011-02-25 9:14 UTC (permalink / raw)
To: netdev
In-Reply-To: <201102251113.41620.remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
include/net/phonet/pep.h | 1 -
net/phonet/pep.c | 41 ++++++++++++++++-------------------------
2 files changed, 16 insertions(+), 26 deletions(-)
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
index b60b28c..788ccf3 100644
--- a/include/net/phonet/pep.h
+++ b/include/net/phonet/pep.h
@@ -47,7 +47,6 @@ struct pep_sock {
u8 aligned;
#ifdef CONFIG_PHONET_PIPECTRLR
u8 pipe_state;
- struct sockaddr_pn remote_pep;
#endif
};
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 3e60f2e..4fce882 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -50,11 +50,6 @@
#define CREDITS_MAX 10
#define CREDITS_THR 7
-static const struct sockaddr_pn pipe_srv = {
- .spn_family = AF_PHONET,
- .spn_resource = 0xD9, /* pipe service */
-};
-
#define pep_sb_size(s) (((s) + 5) & ~3) /* 2-bytes head, 32-bits aligned */
/* Get the next TLV sub-block. */
@@ -88,6 +83,7 @@ static int pep_reply(struct sock *sk, struct sk_buff *oskb,
const struct pnpipehdr *oph = pnp_hdr(oskb);
struct pnpipehdr *ph;
struct sk_buff *skb;
+ struct sockaddr_pn peer;
skb = alloc_skb(MAX_PNPIPE_HEADER + len, priority);
if (!skb)
@@ -105,7 +101,8 @@ static int pep_reply(struct sock *sk, struct sk_buff *oskb,
ph->pipe_handle = oph->pipe_handle;
ph->error_code = code;
- return pn_skb_send(sk, skb, &pipe_srv);
+ pn_skb_get_src_sockaddr(oskb, &peer);
+ return pn_skb_send(sk, skb, &peer);
}
#define PAD 0x00
@@ -220,7 +217,7 @@ static int pipe_handler_send_req(struct sock *sk, u8 utid,
ph->pipe_handle = pn->pipe_handle;
ph->error_code = PN_PIPE_NO_ERROR;
- return pn_skb_send(sk, skb, &pn->remote_pep);
+ return pn_skb_send(sk, skb, NULL);
}
static int pipe_handler_send_created_ind(struct sock *sk,
@@ -262,7 +259,7 @@ static int pipe_handler_send_created_ind(struct sock *sk,
ph->pipe_handle = pn->pipe_handle;
ph->error_code = err_code;
- return pn_skb_send(sk, skb, &pn->remote_pep);
+ return pn_skb_send(sk, skb, NULL);
}
static int pipe_handler_send_ind(struct sock *sk, u8 utid, u8 msg_id)
@@ -295,7 +292,7 @@ static int pipe_handler_send_ind(struct sock *sk, u8 utid, u8 msg_id)
ph->pipe_handle = pn->pipe_handle;
ph->error_code = err_code;
- return pn_skb_send(sk, skb, &pn->remote_pep);
+ return pn_skb_send(sk, skb, NULL);
}
static int pipe_handler_enable_pipe(struct sock *sk, int enable)
@@ -396,11 +393,7 @@ static int pipe_snd_status(struct sock *sk, u8 type, u8 status, gfp_t priority)
ph->data[3] = PAD;
ph->data[4] = status;
-#ifdef CONFIG_PHONET_PIPECTRLR
- return pn_skb_send(sk, skb, &pn->remote_pep);
-#else
- return pn_skb_send(sk, skb, &pipe_srv);
-#endif
+ return pn_skb_send(sk, skb, NULL);
}
/* Send our RX flow control information to the sender.
@@ -722,7 +715,7 @@ static int pep_connreq_rcv(struct sock *sk, struct sk_buff *skb)
struct sock *newsk;
struct pep_sock *newpn, *pn = pep_sk(sk);
struct pnpipehdr *hdr;
- struct sockaddr_pn dst;
+ struct sockaddr_pn dst, src;
u16 peer_type;
u8 pipe_handle, enabled, n_sb;
u8 aligned = 0;
@@ -789,8 +782,10 @@ static int pep_connreq_rcv(struct sock *sk, struct sk_buff *skb)
newpn = pep_sk(newsk);
pn_skb_get_dst_sockaddr(skb, &dst);
+ pn_skb_get_src_sockaddr(skb, &src);
newpn->pn_sk.sobject = pn_sockaddr_get_object(&dst);
- newpn->pn_sk.resource = pn->pn_sk.resource;
+ newpn->pn_sk.dobject = pn_sockaddr_get_object(&src);
+ newpn->pn_sk.resource = pn_sockaddr_get_resource(&dst);
skb_queue_head_init(&newpn->ctrlreq_queue);
newpn->pipe_handle = pipe_handle;
atomic_set(&newpn->tx_credits, 0);
@@ -925,7 +920,7 @@ static int pipe_do_remove(struct sock *sk)
ph->pipe_handle = pn->pipe_handle;
ph->data[0] = PAD;
- return pn_skb_send(sk, skb, &pipe_srv);
+ return pn_skb_send(sk, skb, NULL);
}
/* associated socket ceases to exist */
@@ -1042,10 +1037,10 @@ out:
static int pep_sock_connect(struct sock *sk, struct sockaddr *addr, int len)
{
struct pep_sock *pn = pep_sk(sk);
- struct sockaddr_pn *spn = (struct sockaddr_pn *)addr;
-
- memcpy(&pn->remote_pep, spn, sizeof(struct sockaddr_pn));
+ const struct sockaddr_pn *spn = (struct sockaddr_pn *)addr;
+ pn->pn_sk.dobject = pn_sockaddr_get_object(spn);
+ pn->pn_sk.resource = pn_sockaddr_get_resource(spn);
return pipe_handler_send_req(sk,
PNS_PEP_CONNECT_UTID, PNS_PEP_CONNECT_REQ,
GFP_ATOMIC);
@@ -1222,11 +1217,7 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb)
} else
ph->message_id = PNS_PIPE_DATA;
ph->pipe_handle = pn->pipe_handle;
-#ifdef CONFIG_PHONET_PIPECTRLR
- err = pn_skb_send(sk, skb, &pn->remote_pep);
-#else
- err = pn_skb_send(sk, skb, &pipe_srv);
-#endif
+ err = pn_skb_send(sk, skb, NULL);
if (err && pn_flow_safe(pn->tx_fc))
atomic_inc(&pn->tx_credits);
--
1.7.1
^ permalink raw reply related
* [PATCH 2/6] Phonet: implement per-socket destination/peer address
From: Rémi Denis-Courmont @ 2011-02-25 9:14 UTC (permalink / raw)
To: netdev
In-Reply-To: <201102251113.41620.remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
include/net/phonet/phonet.h | 1 +
net/phonet/af_phonet.c | 19 ++++++++++++++-----
net/phonet/socket.c | 4 ++--
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
index 5395e09..68e5097 100644
--- a/include/net/phonet/phonet.h
+++ b/include/net/phonet/phonet.h
@@ -36,6 +36,7 @@
struct pn_sock {
struct sock sk;
u16 sobject;
+ u16 dobject;
u8 resource;
};
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index 1072b2c..30cc676 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -110,6 +110,7 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol,
sk->sk_protocol = protocol;
pn = pn_sk(sk);
pn->sobject = 0;
+ pn->dobject = 0;
pn->resource = 0;
sk->sk_prot->init(sk);
err = 0;
@@ -242,8 +243,18 @@ int pn_skb_send(struct sock *sk, struct sk_buff *skb,
struct net_device *dev;
struct pn_sock *pn = pn_sk(sk);
int err;
- u16 src;
- u8 daddr = pn_sockaddr_get_addr(target), saddr = PN_NO_ADDR;
+ u16 src, dst;
+ u8 daddr, saddr, res;
+
+ src = pn->sobject;
+ if (target != NULL) {
+ dst = pn_sockaddr_get_object(target);
+ res = pn_sockaddr_get_resource(target);
+ } else {
+ dst = pn->dobject;
+ res = pn->resource;
+ }
+ daddr = pn_addr(dst);
err = -EHOSTUNREACH;
if (sk->sk_bound_dev_if)
@@ -271,12 +282,10 @@ int pn_skb_send(struct sock *sk, struct sk_buff *skb,
if (saddr == PN_NO_ADDR)
goto drop;
- src = pn->sobject;
if (!pn_addr(src))
src = pn_object(saddr, pn_obj(src));
- err = pn_send(skb, dev, pn_sockaddr_get_object(target),
- src, pn_sockaddr_get_resource(target), 0);
+ err = pn_send(skb, dev, dst, src, res, 0);
dev_put(dev);
return err;
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index ceb5143..65a0333 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -633,8 +633,8 @@ static int pn_sock_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, "%2d %04X:%04X:%02X %02X %08X:%08X %5d %lu "
"%d %p %d%n",
- sk->sk_protocol, pn->sobject, 0, pn->resource,
- sk->sk_state,
+ sk->sk_protocol, pn->sobject, pn->dobject,
+ pn->resource, sk->sk_state,
sk_wmem_alloc_get(sk), sk_rmem_alloc_get(sk),
sock_i_uid(sk), sock_i_ino(sk),
atomic_read(&sk->sk_refcnt), sk,
--
1.7.1
^ permalink raw reply related
* [PATCH 1/6] Phonet: allow multiple listen() and fix small race condition
From: Rémi Denis-Courmont @ 2011-02-25 9:14 UTC (permalink / raw)
To: netdev
In-Reply-To: <201102251113.41620.remi.denis-courmont@nokia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/phonet/socket.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 25f746d..ceb5143 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -428,19 +428,19 @@ static int pn_socket_listen(struct socket *sock, int backlog)
struct sock *sk = sock->sk;
int err = 0;
- if (sock->state != SS_UNCONNECTED)
- return -EINVAL;
if (pn_socket_autobind(sock))
return -ENOBUFS;
lock_sock(sk);
- if (sk->sk_state != TCP_CLOSE) {
+ if (sock->state != SS_UNCONNECTED) {
err = -EINVAL;
goto out;
}
- sk->sk_state = TCP_LISTEN;
- sk->sk_ack_backlog = 0;
+ if (sk->sk_state != TCP_LISTEN) {
+ sk->sk_state = TCP_LISTEN;
+ sk->sk_ack_backlog = 0;
+ }
sk->sk_max_ack_backlog = backlog;
out:
release_sock(sk);
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 0/6] Phonet: small pipe protocol fixes
From: Rémi Denis-Courmont @ 2011-02-25 9:13 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA; +Cc: ofono-bdc2hr5oBkPYtjvyW6yDsg
Hello,
This patch series cleans up and fixes a number of small bits in the Phonet pipe code, especially the experimental pipe
controller. Once this small bits are sorted out, I will try to fix the controller protocol implementation proper so that we do not
need the compile-time (experimental) flag anymore.
Comments welcome,
include/net/phonet/pep.h | 22 ----
include/net/phonet/phonet.h | 1
net/phonet/af_phonet.c | 19 ++-
net/phonet/pep.c | 240 +++++++++++++++-----------------------------
net/phonet/socket.c | 14 +-
5 files changed, 106 insertions(+), 190 deletions(-)
--
Rémi Denis-Courmont
http://www.remlab.net/
_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono
^ permalink raw reply
* Bug inkvm_set_irq
From: Jean-Philippe Menil @ 2011-02-25 9:07 UTC (permalink / raw)
To: kvm; +Cc: netdev, virtualization
[-- Attachment #1: Type: text/plain, Size: 6833 bytes --]
Hi,
Each time i try tou use vhost_net, i'm facing a kernel bug.
I do a "modprobe vhost_net", and start guest whith vhost=on.
Following is a trace with a kernel 2.6.37, but i had the same problem
with 2.6.36 (cf https://lkml.org/lkml/2010/11/30/29).
The bug only occurs whith vhost_net charged, so i don't know if this is
a bug in kvm module code or in the vhost_net code.
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.243100]
BUG: unable to handle kernel paging request at 0000000000002458
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.243250]
IP: [<ffffffffa041aa8a>] kvm_set_irq+0x2a/0x130 [kvm]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.243378]
PGD 45d363067 PUD 45e77a067 PMD 0
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.243556]
Oops: 0000 [#1] SMP
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.243692]
last sysfs file:
/sys/devices/pci0000:00/0000:00:0d.0/0000:05:00.0/0000:06:00.0/irq
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.243777] CPU 0
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.243820]
Modules linked in: vhost_net macvtap macvlan tun powernow_k8 mperf
cpufreq_userspace cpufreq_stats cpufreq_powersave cpufreq_ondemand fre
q_table cpufreq_conservative fuse xt_physdev ip6t_LOG ip6table_filter
ip6_tables ipt_LOG xt_multiport xt_limit xt_tcpudp xt_state
iptable_filter ip_tables x_tables nf_conntrack_tftp nf_conntrack_ftp
nf_connt
rack_ipv4 nf_defrag_ipv4 8021q bridge stp ext2 mbcache dm_round_robin
dm_multipath nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 kvm_amd kvm
ipv6 snd_pcm snd_timer snd soundcore snd_page_alloc tpm_tis tpm ps
mouse dcdbas tpm_bios processor i2c_nforce2 shpchp pcspkr ghes serio_raw
joydev evdev pci_hotplug i2c_core hed button thermal_sys xfs exportfs
dm_mod sg sr_mod cdrom usbhid hid usb_storage ses sd_mod enclosu
re megaraid_sas ohci_hcd lpfc scsi_transport_fc scsi_tgt bnx2 scsi_mod
ehci_hcd [last unloaded: scsi_wait_scan]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
Pid: 10, comm: kworker/0:1 Not tainted 2.6.37-dsiun-110105 #17
0K543T/PowerEdge M605
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
RIP: 0010:[<ffffffffa041aa8a>] [<ffffffffa041aa8a>]
kvm_set_irq+0x2a/0x130 [kvm]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
RSP: 0018:ffff88045fc89d30 EFLAGS: 00010246
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
RAX: 0000000000000000 RBX: 000000000000001a RCX: 0000000000000001
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
RBP: 0000000000000000 R08: 0000000000000001 R09: ffff880856a91e48
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
R10: 0000000000000000 R11: 00000000ffffffff R12: 0000000000000000
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
FS: 00007f617986c710(0000) GS:ffff88007f800000(0000) knlGS:0000000000000000
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
CR2: 0000000000002458 CR3: 000000045d197000 CR4: 00000000000006f0
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
Process kworker/0:1 (pid: 10, threadinfo ffff88045fc88000, task
ffff88085fc53c30)
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123] Stack:
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
ffff88045fc89fd8 00000000000119c0 ffff88045fc88010 ffff88085fc53ee8
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
ffff88045fc89fd8 ffff88085fc53ee0 ffff88085fc53c30 00000000000119c0
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
00000000000119c0 ffffffff8137f7ce ffff88007f80df40 00000000ffffffff
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
Call Trace:
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8137f7ce>] ? common_interrupt+0xe/0x13
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffffa041bc30>] ? irqfd_inject+0x0/0x50 [kvm]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffffa041bc57>] ? irqfd_inject+0x27/0x50 [kvm]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffffa041bc30>] ? irqfd_inject+0x0/0x50 [kvm]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8106b6f2>] ? process_one_work+0x112/0x460
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8106be25>] ? worker_thread+0x145/0x410
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8103a3d0>] ? __wake_up_common+0x50/0x80
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8106bce0>] ? worker_thread+0x0/0x410
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8106bce0>] ? worker_thread+0x0/0x410
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8106f786>] ? kthread+0x96/0xa0
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff81003ce4>] ? kernel_thread_helper+0x4/0x10
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff8106f6f0>] ? kthread+0x0/0xa0
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
[<ffffffff81003ce0>] ? kernel_thread_helper+0x0/0x10
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
Code: ff 41 57 41 89 f7 41 56 41 55 41 89 cd 41 54 49 89 fc 55 53 89 d3
48 81 ec 98 00 00 00 8b 15 c6 79 03 00 85 d2 0f 85 c4 00 00 00 <4
9> 8b 84 24 58 24 00 00 3b 98 28 01 00 00 73 5e 89 db 48 8b 84
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
RIP [<ffffffffa041aa8a>] kvm_set_irq+0x2a/0x130 [kvm]
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
RSP <ffff88045fc89d30>
Feb 23 13:56:19 ayrshire.u06.univ-nantes.prive kernel: [ 685.246123]
CR2: 0000000000002458
If someone can help me, on how to solve this.
Regards.
[-- Attachment #2: jean-philippe_menil.vcf --]
[-- Type: text/x-vcard, Size: 281 bytes --]
begin:vcard
fn:Jean-Philippe Menil
n:Menil;Jean-Philippe
org;quoted-printable:Universit=C3=A9 de Nantes;IRTS
adr;dom:;;;Nantes
email;internet:jean-philippe.menil@univ-nantes.fr
title:Reseau
tel;work:02.53.48.49.27
tel;fax:02.53.48.49.97
x-mozilla-html:FALSE
version:2.1
end:vcard
[-- Attachment #3: Type: text/plain, Size: 184 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: check for return value of clk_get() in mpc512x_can_get_clock()
From: Wolfgang Grandegger @ 2011-02-25 8:34 UTC (permalink / raw)
To: Andrej Krutak
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <201102231435.53991.andrej.krutak-uSbOeAmDUekAvxtiuMwx3w@public.gmane.org>
Hi,
On 02/23/2011 02:35 PM, Andrej Krutak wrote:
> Hi,
>
> just wanted to inform you - in the mpc512x_can_get_clock() function
> (drivers/net/can/mscan/mpc5xxx_can.c), there are calls to clg_get(), and later
> checks
>
> if (!sys_clk) {
> and
> if (!ref_clk) {
>
> but these should be
>
> if (IS_ERR(sys_clk)) {
> and
> if (IS_ERR(ref_clk)) {
>
> (otherwise you'll get an oops if something goes wrong with clg_get()).
Thanks for the info. I'm going to prepare a patch.
Wolfgang.
^ permalink raw reply
* Re: via-rhine -- VT6105M and checksum offloading
From: Roger Luethi @ 2011-02-25 7:53 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: David Miller, netdev
In-Reply-To: <20110224.122354.193728354.davem@davemloft.net>
On Thu, 24 Feb 2011 12:23:54 -0800, David Miller wrote:
> From: Benjamin LaHaise <bcrl@kvack.org>
> Date: Thu, 24 Feb 2011 13:58:05 -0500
>
> > Upon investigation, it looks like the VT6105M isn't actually using the
> > hardware checksum offloading support of the hardware. Are there any
> > known reasons why this isn't enabled (hardware bugs?)? I'll test enabling
>
> As far as I can tell it was never attempted. So it should work.
>
> If you do that, while you're here, you can make rhine_rx() take
> a "napi" arg and make this driver use netif_gso_receive() too.
> Don't forget to set NETIF_F_GRO or similar in netdev->flags during
> probe, and also hookup the necessary ethtool hooks.
I have a patch to enable hw checksumming (the ethtool hooks are done, but I
somehow missed the NETIF_F_GRO bit). Care to give it a whirl?
Roger
^ permalink raw reply
* Re: [PATCH V11 2/4] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
From: Richard Cochran @ 2011-02-25 7:53 UTC (permalink / raw)
To: Scott Wood
Cc: Mike Frysinger, Russell King, Arnd Bergmann, Peter Zijlstra,
linux-api-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, David Miller, Grant Likely,
Paul Mackerras, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
netdev-u79uwXL29TY76Z2rM5mHXA, John Stultz, Thomas Gleixner,
Rodolfo Giometti, Christoph Lameter, Alan Cox, Krzysztof Halasa
In-Reply-To: <20110224112731.2d9bf080@schlenkerla>
On Thu, Feb 24, 2011 at 11:27:31AM -0600, Scott Wood wrote:
> My vote, if it goes in a separate node at all, is "fsl,etsec-ptp",
So, that is what the patch does.
> and let the driver use SVR.
What is SVR?
Thanks,
Richard
^ permalink raw reply
* Re: pull request: wireless-next-2.6 2011-02-22
From: David Miller @ 2011-02-25 6:43 UTC (permalink / raw)
To: linville-2XuSBdqkA4R54TAoqtyWWQ
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20110222215229.GJ12153-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Date: Tue, 22 Feb 2011 16:52:30 -0500
> Here is the latest batch of wireless bits intended for 2.6.39. It seems
> I neglected to send a pull request last week, so this one is a bit big
> -- I apologize!
>
> This includes a rather large batch of bluetooth bits by way of Gustavo.
> It looks like a variety of bits, including some code refactoring, some
> protocol support enhancements, some bugfixes, etc. -- nothing too
> unusual.
>
> Other items of interest include a new driver from Realtek, some ssb
> support enhancements, and the usual sort of updates for mac80211 and a
> variety of drivers. Also included is a wireless-2.6 pull to resolve
> some build breakage.
>
> Please let me know if there are problems!
Pulled, thanks a lot John.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] skge: don't mark carrier down at start
From: David Miller @ 2011-02-25 6:17 UTC (permalink / raw)
To: akpm; +Cc: shemminger, netdev, bugzilla-daemon, bugme-daemon, gbillios
In-Reply-To: <20110223165243.8a536913.akpm@linux-foundation.org>
From: Andrew Morton <akpm@linux-foundation.org>
Date: Wed, 23 Feb 2011 16:52:43 -0800
> From: Stephen Hemminger <shemminger@linux-foundation.org>
>
> The API for network devices has changed so that setting carrier off at
> probe is no longer required. This should fix the IPv6 addrconf issue.
>
> Addresses https://bugzilla.kernel.org/show_bug.cgi?id=29612
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> Reported-by: George Billios <gbillios@gmail.com>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/6] netem patches
From: David Miller @ 2011-02-25 6:14 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20110223230416.532009518@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 23 Feb 2011 15:04:16 -0800
> These have been resting in a moldy place for far to long.
> The most important is the integration of a better packet
> loss model for netem
All applied, thanks Stephen.
^ permalink raw reply
* Re: [PATCH net-next-2.6] sch_choke: add choke_skb_cb
From: David Miller @ 2011-02-25 6:14 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, shemminger, kaber
In-Reply-To: <1298605541.2659.18.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 25 Feb 2011 04:45:41 +0100
> Better document choke skb->cb[] use, like we did in netem and sfb
>
> This adds a compile time check to make sure we dont exhaust skb->cb[]
> space.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Stephen Hemminger <shemminger@vyatta.com>
> CC: Patrick McHardy <kaber@trash.net>
Applied.
^ permalink raw reply
* [PATCH] sysctl: ipv6: use correct net in ipv6_sysctl_rtcache_flush
From: Lucian Adrian Grijincu @ 2011-02-25 5:48 UTC (permalink / raw)
To: netdev, David S . Miller, Daniel Lezcano, Benjamin Thery
Cc: Lucian Adrian Grijincu
Before this patch issuing these commands:
fd = open("/proc/sys/net/ipv6/route/flush")
unshare(CLONE_NEWNET)
write(fd, "stuff")
would flush the newly created net, not the original one.
The equivalent ipv4 code is correct (stores the net inside ->extra1).
---
net/ipv6/route.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f786aed..522563e 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2604,14 +2604,16 @@ static
int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
- struct net *net = current->nsproxy->net_ns;
- int delay = net->ipv6.sysctl.flush_delay;
- if (write) {
- proc_dointvec(ctl, write, buffer, lenp, ppos);
- fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);
- return 0;
- } else
+ struct net *net;
+ int delay;
+ if (!write)
return -EINVAL;
+
+ net = (struct net *)ctl->extra1;
+ delay = net->ipv6.sysctl.flush_delay;
+ proc_dointvec(ctl, write, buffer, lenp, ppos);
+ fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net);
+ return 0;
}
ctl_table ipv6_route_table_template[] = {
@@ -2698,6 +2700,7 @@ struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net)
if (table) {
table[0].data = &net->ipv6.sysctl.flush_delay;
+ table[0].extra1 = net;
table[1].data = &net->ipv6.ip6_dst_ops.gc_thresh;
table[2].data = &net->ipv6.sysctl.ip6_rt_max_size;
table[3].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval;
--
1.7.4.rc1.7.g2cf08.dirty
^ permalink raw reply related
* Re: [PATCH net-next-2.6 1/2] dcbnl: add support for retrieving peer configuration - ieee
From: John Fastabend @ 2011-02-25 4:58 UTC (permalink / raw)
To: Shmulik Ravid - Rabinovitz
Cc: davem@davemloft.net, Eilon Greenstein, netdev@vger.kernel.org
In-Reply-To: <A31CB8AA22AA1E44B81563BEDB2C187812203E0F8C@SJEXCHCCR01.corp.ad.broadcom.com>
On 2/24/2011 2:03 PM, Shmulik Ravid - Rabinovitz wrote:
>> -----Original Message-----
>> From: John Fastabend [mailto:john.r.fastabend@intel.com]
>> Sent: Thursday, February 24, 2011 10:37 PM
>> To: Shmulik Ravid - Rabinovitz
>> Cc: davem@davemloft.net; Eilon Greenstein; netdev@vger.kernel.org
>> Subject: Re: [PATCH net-next-2.6 1/2] dcbnl: add support for retrieving
>> peer configuration - ieee
>>
>> On 2/24/2011 1:03 PM, Shmulik Ravid wrote:
>>> These 2 patches add the support for retrieving the remote or peer
>> DCBX
>>> configuration via dcbnl for embedded DCBX stacks. The peer
>> configuration
>>> is part of the DCBX MIB and is useful for debugging and diagnostics
>> of
>>> the overall DCB configuration. The first patch add this support for
>> IEEE
>>> 802.1Qaz standard the second patch add the same support for the older
>>> CEE standard.
>>>
>>> Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
>>> ---
>>> include/linux/dcbnl.h | 38 ++++++++++++++++++++++++++
>>> include/net/dcbnl.h | 5 +++
>>> net/dcb/dcbnl.c | 71
>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>> 3 files changed, 114 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
>>> index 4c5b26e..3102185 100644
>>> --- a/include/linux/dcbnl.h
>>> +++ b/include/linux/dcbnl.h
>>> @@ -110,6 +110,22 @@ struct dcb_app {
>>> __u16 protocol;
>>> };
>>>
>>> +/* This structure contains the APP feature information sent by the
>> peer.
>>> + * It is used for both the IEEE 802.1Qaz and the CEE flavors.
>>> + *
>>> + * @willing: willing bit in the peer APP tlv
>>> + * @error: error bit in the peer APP tlv
>>> + * @app_count: The number of objects in the peer APP table.
>>> + *
>>> + * In addition to this information the full peer APP tlv also
>> contains
>>> + * a table of 'app_count' APP objects defined above.
>>> + */
>>> +struct dcb_peer_app_info {
>>> + __u8 willing;
>>> + __u8 error;
>>> + __u16 app_count;
>>> +};
>>> +
>>
>> The IEEE 802.1Qaz spec defines the APP TLV as informational
>> so there are no willing or error bits in this case. See
>> section D.2.12 of the 802.1Qaz draft.
>>
>> Can we drop these fields or do they have some other meaning
>> here?
>>
> OK, They are part of the CEE APP tlv though.
> I wanted to share this structure between the 802.1Qaz and CEE so
> I'll have a single driver handler that retrieve the number of
> peer apps. How about if we keep a single driver handler, but the
> APP info will be exposed to the user only with the CEE flavor.
> That is the PEER_APP attribute will be CEE specific ?
>
> Shmulik
>
That seems fine to me. Either don't expose the struct as you
suggested or zero the fields while in IEEE mode.
John.
^ permalink raw reply
* Re: [PATCH net-next-2.6] sch_choke: add choke_skb_cb
From: Eric Dumazet @ 2011-02-25 3:54 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev, Patrick McHardy
In-Reply-To: <20110224194812.6f96424d@nehalam>
Le jeudi 24 février 2011 à 19:48 -0800, Stephen Hemminger a écrit :
> Ideally class id should be u32, but then that would mean changing TC
> classifier id and that is hardwired into the API.
>
>
Yes, this is a bit disappointing, especially if we want to use rxhash
from external classifier (same problem for SFQ)
^ permalink raw reply
* Re: [PATCH net-next-2.6] sch_choke: add choke_skb_cb
From: Stephen Hemminger @ 2011-02-25 3:48 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, Patrick McHardy
In-Reply-To: <1298605541.2659.18.camel@edumazet-laptop>
On Fri, 25 Feb 2011 04:45:41 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Better document choke skb->cb[] use, like we did in netem and sfb
>
> This adds a compile time check to make sure we dont exhaust skb->cb[]
> space.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Stephen Hemminger <shemminger@vyatta.com>
> CC: Patrick McHardy <kaber@trash.net>
> ---
> net/sched/sch_choke.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
> index ee1e209..06afbae 100644
> --- a/net/sched/sch_choke.c
> +++ b/net/sched/sch_choke.c
> @@ -219,14 +219,25 @@ static bool choke_match_flow(struct sk_buff *skb1,
> return *ports1 == *ports2;
> }
>
> +struct choke_skb_cb {
> + u16 classid;
> +};
> +
> +static inline struct choke_skb_cb *choke_skb_cb(const struct sk_buff *skb)
> +{
> + BUILD_BUG_ON(sizeof(skb->cb) <
> + sizeof(struct qdisc_skb_cb) + sizeof(struct choke_skb_cb));
> + return (struct choke_skb_cb *)qdisc_skb_cb(skb)->data;
> +}
> +
> static inline void choke_set_classid(struct sk_buff *skb, u16 classid)
> {
> - *(unsigned int *)(qdisc_skb_cb(skb)->data) = classid;
> + choke_skb_cb(skb)->classid = classid;
> }
>
> static u16 choke_get_classid(const struct sk_buff *skb)
> {
> - return *(unsigned int *)(qdisc_skb_cb(skb)->data);
> + return choke_skb_cb(skb)->classid;
> }
>
Ideally class id should be u32, but then that would mean changing TC
classifier id and that is hardwired into the API.
--
^ permalink raw reply
* [PATCH net-next-2.6] sch_choke: add choke_skb_cb
From: Eric Dumazet @ 2011-02-25 3:45 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Stephen Hemminger, Patrick McHardy
Better document choke skb->cb[] use, like we did in netem and sfb
This adds a compile time check to make sure we dont exhaust skb->cb[]
space.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Patrick McHardy <kaber@trash.net>
---
net/sched/sch_choke.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index ee1e209..06afbae 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -219,14 +219,25 @@ static bool choke_match_flow(struct sk_buff *skb1,
return *ports1 == *ports2;
}
+struct choke_skb_cb {
+ u16 classid;
+};
+
+static inline struct choke_skb_cb *choke_skb_cb(const struct sk_buff *skb)
+{
+ BUILD_BUG_ON(sizeof(skb->cb) <
+ sizeof(struct qdisc_skb_cb) + sizeof(struct choke_skb_cb));
+ return (struct choke_skb_cb *)qdisc_skb_cb(skb)->data;
+}
+
static inline void choke_set_classid(struct sk_buff *skb, u16 classid)
{
- *(unsigned int *)(qdisc_skb_cb(skb)->data) = classid;
+ choke_skb_cb(skb)->classid = classid;
}
static u16 choke_get_classid(const struct sk_buff *skb)
{
- return *(unsigned int *)(qdisc_skb_cb(skb)->data);
+ return choke_skb_cb(skb)->classid;
}
/*
^ permalink raw reply related
* Re: [Bugme-new] [Bug 29712] New: Bonding Driver(version : 3.5.0) - Problem with ARP monitoring in active backup mode
From: Brian Haley @ 2011-02-25 3:42 UTC (permalink / raw)
To: Andrew Morton
Cc: harsha.r02, bugzilla-daemon, bugme-daemon, netdev, Jay Vosburgh
In-Reply-To: <20110224145129.f366b59e.akpm@linux-foundation.org>
On 02/24/2011 05:51 PM, Andrew Morton wrote:
> (switched to email. Please respond via emailed reply-to-all, not via the
> bugzilla web interface).
>
> On Wed, 23 Feb 2011 10:41:34 GMT
> bugzilla-daemon@bugzilla.kernel.org wrote:
>
>> https://bugzilla.kernel.org/show_bug.cgi?id=29712
>>
>> Summary: Bonding Driver(version : 3.5.0) - Problem with ARP
>> monitoring in active backup mode
>> Product: Drivers
>> Version: 2.5
>> Kernel Version: 2.6.32
>
> That's a paleolithic kernel you have there. This problem might have
> been fixed already. Can you test a more recent kernel?
I can add some more info since I originally looked at the problem. This
happens on 2.6.38 as well, and on this 2.6.32 kernel with a backported
3.7.0 bonding driver (with the primary_reselect option). Harsha has a
prototype patch that's being tested, but wanted to log the bug to see
if one of the bonding maintainers had a better solution.
I'll let him respond as I'm now out of the loop...
Thanks,
-Brian
^ permalink raw reply
* Please i wait to hear from you urgently, it very important
From: Ian Davies @ 2011-02-24 19:39 UTC (permalink / raw)
I am Ian Davies ;an accredited vendor of Alliot Groups, a subsidiary firm of Emirates International Holding (EIH); A private equity funds holding company that focuses on hedge funds.
I have contacted you in the hope that you can be my associate by accepting to stand as the legal recipient to a Fixed-Income deposit, valued at 25MUSD by provind an International Offshore account to clear the funds.
Once I file your details as the new recipient to the funds, the fundswill be approved through the AUTOMATED CLEARING HOUSE (ACH) - A facility used by financial institutions to distribute electronic debit and credit entries to bank accounts and therefore settles such entries. Under the automated clearing house system.
upon approval of your details as the new recipient; a Credit advice will be issued in your favor and the funds will clear in your account within three banking days. I am willing to give you 40% which is 10MUSD as your commission out of the 25MUSD for your assistance in providing an International Offshore account to clear the funds.
I am confident you will be honest enough to adhere to our agreed commissions in spite of the 25MUSD coming through your account. I will need you to forward me your legal names address and phone to file your details on the fund as the new recipient in this first Quater of the financial fiscal year 2011.
Looking forward to working with you.
Ian Davies
Accredited vendor
Alliot Groups PS
^ permalink raw reply
* [PATCH 1/3] ipvs: use hlist instead of list
From: Simon Horman @ 2011-02-25 2:43 UTC (permalink / raw)
To: lvs-devel, netdev, netfilter-devel, netfilter
Cc: Changli Gao, Wensong Zhang, Julian Anastasov, Patrick McHardy,
Simon Horman
In-Reply-To: <1298601812-8168-1-git-send-email-horms@verge.net.au>
From: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 2 +-
net/netfilter/ipvs/ip_vs_conn.c | 52 +++++++++++++++++++++-----------------
2 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 9399549..17b01b2 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -494,7 +494,7 @@ struct ip_vs_conn_param {
* IP_VS structure allocated for each dynamically scheduled connection
*/
struct ip_vs_conn {
- struct list_head c_list; /* hashed list heads */
+ struct hlist_node c_list; /* hashed list heads */
#ifdef CONFIG_NET_NS
struct net *net; /* Name space */
#endif
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 83233fe..9c2a517 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -59,7 +59,7 @@ static int ip_vs_conn_tab_mask __read_mostly;
/*
* Connection hash table: for input and output packets lookups of IPVS
*/
-static struct list_head *ip_vs_conn_tab __read_mostly;
+static struct hlist_head *ip_vs_conn_tab __read_mostly;
/* SLAB cache for IPVS connections */
static struct kmem_cache *ip_vs_conn_cachep __read_mostly;
@@ -201,7 +201,7 @@ static inline int ip_vs_conn_hash(struct ip_vs_conn *cp)
spin_lock(&cp->lock);
if (!(cp->flags & IP_VS_CONN_F_HASHED)) {
- list_add(&cp->c_list, &ip_vs_conn_tab[hash]);
+ hlist_add_head(&cp->c_list, &ip_vs_conn_tab[hash]);
cp->flags |= IP_VS_CONN_F_HASHED;
atomic_inc(&cp->refcnt);
ret = 1;
@@ -234,7 +234,7 @@ static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp)
spin_lock(&cp->lock);
if (cp->flags & IP_VS_CONN_F_HASHED) {
- list_del(&cp->c_list);
+ hlist_del(&cp->c_list);
cp->flags &= ~IP_VS_CONN_F_HASHED;
atomic_dec(&cp->refcnt);
ret = 1;
@@ -259,12 +259,13 @@ __ip_vs_conn_in_get(const struct ip_vs_conn_param *p)
{
unsigned hash;
struct ip_vs_conn *cp;
+ struct hlist_node *n;
hash = ip_vs_conn_hashkey_param(p, false);
ct_read_lock(hash);
- list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
+ hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
if (cp->af == p->af &&
p->cport == cp->cport && p->vport == cp->vport &&
ip_vs_addr_equal(p->af, p->caddr, &cp->caddr) &&
@@ -345,12 +346,13 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p)
{
unsigned hash;
struct ip_vs_conn *cp;
+ struct hlist_node *n;
hash = ip_vs_conn_hashkey_param(p, false);
ct_read_lock(hash);
- list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
+ hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
if (!ip_vs_conn_net_eq(cp, p->net))
continue;
if (p->pe_data && p->pe->ct_match) {
@@ -394,6 +396,7 @@ struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p)
{
unsigned hash;
struct ip_vs_conn *cp, *ret=NULL;
+ struct hlist_node *n;
/*
* Check for "full" addressed entries
@@ -402,7 +405,7 @@ struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p)
ct_read_lock(hash);
- list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
+ hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
if (cp->af == p->af &&
p->vport == cp->cport && p->cport == cp->dport &&
ip_vs_addr_equal(p->af, p->vaddr, &cp->caddr) &&
@@ -818,7 +821,7 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p,
return NULL;
}
- INIT_LIST_HEAD(&cp->c_list);
+ INIT_HLIST_NODE(&cp->c_list);
setup_timer(&cp->timer, ip_vs_conn_expire, (unsigned long)cp);
ip_vs_conn_net_set(cp, p->net);
cp->af = p->af;
@@ -894,8 +897,8 @@ ip_vs_conn_new(const struct ip_vs_conn_param *p,
*/
#ifdef CONFIG_PROC_FS
struct ip_vs_iter_state {
- struct seq_net_private p;
- struct list_head *l;
+ struct seq_net_private p;
+ struct hlist_head *l;
};
static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos)
@@ -903,13 +906,14 @@ static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos)
int idx;
struct ip_vs_conn *cp;
struct ip_vs_iter_state *iter = seq->private;
+ struct hlist_node *n;
for (idx = 0; idx < ip_vs_conn_tab_size; idx++) {
ct_read_lock_bh(idx);
- list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
+ hlist_for_each_entry(cp, n, &ip_vs_conn_tab[idx], c_list) {
if (pos-- == 0) {
iter->l = &ip_vs_conn_tab[idx];
- return cp;
+ return cp;
}
}
ct_read_unlock_bh(idx);
@@ -930,7 +934,8 @@ static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct ip_vs_conn *cp = v;
struct ip_vs_iter_state *iter = seq->private;
- struct list_head *e, *l = iter->l;
+ struct hlist_node *e;
+ struct hlist_head *l = iter->l;
int idx;
++*pos;
@@ -938,15 +943,15 @@ static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos)
return ip_vs_conn_array(seq, 0);
/* more on same hash chain? */
- if ((e = cp->c_list.next) != l)
- return list_entry(e, struct ip_vs_conn, c_list);
+ if ((e = cp->c_list.next))
+ return hlist_entry(e, struct ip_vs_conn, c_list);
idx = l - ip_vs_conn_tab;
ct_read_unlock_bh(idx);
while (++idx < ip_vs_conn_tab_size) {
ct_read_lock_bh(idx);
- list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
+ hlist_for_each_entry(cp, e, &ip_vs_conn_tab[idx], c_list) {
iter->l = &ip_vs_conn_tab[idx];
return cp;
}
@@ -959,7 +964,7 @@ static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void ip_vs_conn_seq_stop(struct seq_file *seq, void *v)
{
struct ip_vs_iter_state *iter = seq->private;
- struct list_head *l = iter->l;
+ struct hlist_head *l = iter->l;
if (l)
ct_read_unlock_bh(l - ip_vs_conn_tab);
@@ -1148,13 +1153,14 @@ void ip_vs_random_dropentry(struct net *net)
*/
for (idx = 0; idx < (ip_vs_conn_tab_size>>5); idx++) {
unsigned hash = net_random() & ip_vs_conn_tab_mask;
+ struct hlist_node *n;
/*
* Lock is actually needed in this loop.
*/
ct_write_lock_bh(hash);
- list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
+ hlist_for_each_entry(cp, n, &ip_vs_conn_tab[hash], c_list) {
if (cp->flags & IP_VS_CONN_F_TEMPLATE)
/* connection template */
continue;
@@ -1202,12 +1208,14 @@ static void ip_vs_conn_flush(struct net *net)
flush_again:
for (idx = 0; idx < ip_vs_conn_tab_size; idx++) {
+ struct hlist_node *n;
+
/*
* Lock is actually needed in this loop.
*/
ct_write_lock_bh(idx);
- list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
+ hlist_for_each_entry(cp, n, &ip_vs_conn_tab[idx], c_list) {
if (!ip_vs_conn_net_eq(cp, net))
continue;
IP_VS_DBG(4, "del connection\n");
@@ -1265,8 +1273,7 @@ int __init ip_vs_conn_init(void)
/*
* Allocate the connection hash table and initialize its list heads
*/
- ip_vs_conn_tab = vmalloc(ip_vs_conn_tab_size *
- sizeof(struct list_head));
+ ip_vs_conn_tab = vmalloc(ip_vs_conn_tab_size * sizeof(*ip_vs_conn_tab));
if (!ip_vs_conn_tab)
return -ENOMEM;
@@ -1286,9 +1293,8 @@ int __init ip_vs_conn_init(void)
IP_VS_DBG(0, "Each connection entry needs %Zd bytes at least\n",
sizeof(struct ip_vs_conn));
- for (idx = 0; idx < ip_vs_conn_tab_size; idx++) {
- INIT_LIST_HEAD(&ip_vs_conn_tab[idx]);
- }
+ for (idx = 0; idx < ip_vs_conn_tab_size; idx++)
+ INIT_HLIST_HEAD(&ip_vs_conn_tab[idx]);
for (idx = 0; idx < CT_LOCKARRAY_SIZE; idx++) {
rwlock_init(&__ip_vs_conntbl_lock_array[idx].l);
--
1.7.2.3
^ permalink raw reply related
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