* [PATCH net-next 12/28] tipc: Remove deferred queue head caching during broadcast message reception
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Modifies TIPC's incoming broadcast packet handler so that it no longer
pre-reads information about the deferred packet queue, since the cached
value is unreliable once the associated node lock has been released.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bcast.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index bc01ca6..8d29852 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -467,7 +467,6 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
/* Handle in-sequence broadcast message */
receive:
- deferred = node->bclink.deferred_head;
next_in = mod(node->bclink.last_in + 1);
seqno = msg_seqno(msg);
@@ -500,6 +499,7 @@ receive:
}
buf = NULL;
tipc_node_lock(node);
+ deferred = node->bclink.deferred_head;
if (deferred && (buf_seqno(deferred) == mod(next_in + 1))) {
buf = deferred;
msg = buf_msg(buf);
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 13/28] tipc: Discard incoming broadcast messages that are unexpected
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Modifies TIPC's incoming broadcast packet handler to discard messages
that cannot legally be sent over the broadcast link, including:
- broadcast protocol messages that do no contain state information
- payload messages that are not named multicast messages
- any other form of message except for bundled messages, fragmented
messages, and name distribution messages.
These checks are needed to prevent TIPC from handing an unexpected
message to a routine that isn't prepared to handle it, which could
lead to incorrect processing (up to and including invalid memory
references caused by attempts to access message fields that aren't
present in the message).
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bcast.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 8d29852..bead28b 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -39,6 +39,7 @@
#include "link.h"
#include "port.h"
#include "bcast.h"
+#include "name_distr.h"
#define MAX_PKT_DEFAULT_MCAST 1500 /* bcast link max packet size (fixed) */
@@ -445,6 +446,8 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf)
goto unlock;
if (unlikely(msg_user(msg) == BCAST_PROTOCOL)) {
+ if (msg_type(msg) != STATE_MSG)
+ goto unlock;
if (msg_destnode(msg) == tipc_own_addr) {
tipc_bclink_acknowledge(node, msg_bcast_ack(msg));
tipc_node_unlock(node);
@@ -480,7 +483,10 @@ receive:
}
if (likely(msg_isdata(msg))) {
tipc_node_unlock(node);
- tipc_port_recv_mcast(buf, NULL);
+ if (likely(msg_mcast(msg)))
+ tipc_port_recv_mcast(buf, NULL);
+ else
+ buf_discard(buf);
} else if (msg_user(msg) == MSG_BUNDLER) {
bcl->stats.recv_bundles++;
bcl->stats.recv_bundled += msg_msgcnt(msg);
@@ -493,9 +499,12 @@ receive:
bcl->stats.recv_fragmented++;
tipc_node_unlock(node);
tipc_net_route_msg(buf);
+ } else if (msg_user(msg) == NAME_DISTRIBUTOR) {
+ tipc_node_unlock(node);
+ tipc_named_recv(buf);
} else {
tipc_node_unlock(node);
- tipc_net_route_msg(buf);
+ buf_discard(buf);
}
buf = NULL;
tipc_node_lock(node);
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 14/28] tipc: Remove obsolete congestion handling when sending a broadcast NACK
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Eliminates obsolete code that handles broadcast bearer congestion when
the broadast link sends a NACK message, since the broadcast pseudo-bearer
never becomes blocked.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bcast.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index bead28b..28908f5 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -299,14 +299,9 @@ static void bclink_send_nack(struct tipc_node *n_ptr)
msg_set_bcgap_to(msg, n_ptr->bclink.gap_to);
msg_set_bcast_tag(msg, tipc_own_tag);
- if (tipc_bearer_send(&bcbearer->bearer, buf, NULL)) {
- bcl->stats.sent_nacks++;
- buf_discard(buf);
- } else {
- tipc_bearer_schedule(bcl->b_ptr, bcl);
- bcl->proto_msg_queue = buf;
- bcl->stats.bearer_congs++;
- }
+ tipc_bearer_send(&bcbearer->bearer, buf, NULL);
+ bcl->stats.sent_nacks++;
+ buf_discard(buf);
/*
* Ensure we doesn't send another NACK msg to the node
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 15/28] tipc: Eliminate redundant check when sending messages
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Eliminates code in tipc_send_buf_fast() that handles messages
sent to a destination on the current node, since the only caller
of the routine only passes in messages destined for other nodes.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/link.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index b43beea..bc655f4 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1032,9 +1032,6 @@ int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode)
u32 selector = msg_origport(buf_msg(buf)) & 1;
u32 dummy;
- if (destnode == tipc_own_addr)
- return tipc_port_recv_msg(buf);
-
read_lock_bh(&tipc_net_lock);
n_ptr = tipc_node_find(destnode);
if (likely(n_ptr)) {
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 17/28] tipc: Ensure congested links receive bearer status updates
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Modifies code that disables a bearer to ensure that all of its links
are deleted, not just its uncongested links. Similarly, modifies code
that blocks a bearer to ensure that all of its links are reset, not
just its uncongested links.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bearer.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index e465a92..e2202de 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -604,6 +604,7 @@ int tipc_block_bearer(const char *name)
info("Blocking bearer <%s>\n", name);
spin_lock_bh(&b_ptr->lock);
b_ptr->blocked = 1;
+ list_splice_init(&b_ptr->cong_links, &b_ptr->links);
list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
struct tipc_node *n_ptr = l_ptr->owner;
@@ -631,6 +632,7 @@ static void bearer_disable(struct tipc_bearer *b_ptr)
spin_lock_bh(&b_ptr->lock);
b_ptr->blocked = 1;
b_ptr->media->disable_bearer(b_ptr);
+ list_splice_init(&b_ptr->cong_links, &b_ptr->links);
list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) {
tipc_link_delete(l_ptr);
}
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH v2 4/7] per-cgroup tcp buffers control
From: Glauber Costa @ 2011-09-18 3:32 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Kirill A. Shutemov, linux-kernel, paul, lizf, kamezawa.hiroyu,
ebiederm, davem, gthelen, netdev, linux-mm
In-Reply-To: <20110917183358.GB2783@moon>
On 09/17/2011 03:33 PM, Cyrill Gorcunov wrote:
> On Sat, Sep 17, 2011 at 09:11:32PM +0300, Kirill A. Shutemov wrote:
>> On Wed, Sep 14, 2011 at 10:46:12PM -0300, Glauber Costa wrote:
>>> +int tcp_init_cgroup_fill(struct proto *prot, struct cgroup *cgrp,
>>> + struct cgroup_subsys *ss)
>>> +{
>>> + prot->enter_memory_pressure = tcp_enter_memory_pressure;
>>> + prot->memory_allocated = memory_allocated_tcp;
>>> + prot->prot_mem = tcp_sysctl_mem;
>>> + prot->sockets_allocated = sockets_allocated_tcp;
>>> + prot->memory_pressure = memory_pressure_tcp;
>>
>> No fancy formatting, please.
>>
>
> What's wrong with having fancy formatting? It's indeed easier to read
> when members are assigned this way. It's always up to maintainer to
> choose what he prefers, but I see nothing wrong in such style (if only it
> doesn't break the style of the whole file).
>
> Cyrill
I am in agreement with Cyrill, but I really, really don't care...
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [PATCH net-next 16/28] tipc: Prevent rounding issues when saving connect timeout option
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Saves a socket's TIPC_CONN_TIMEOUT socket option value in its original
form (milliseconds), rather than jiffies. This ensures that the exact
value set using setsockopt() is always returned by getsockopt(), without
being subject to rounding issues introduced by a ms->jiffies->ms
conversion sequence.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/socket.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index adb2eff..fc3c281 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -49,7 +49,7 @@ struct tipc_sock {
struct sock sk;
struct tipc_port *p;
struct tipc_portid peer_name;
- long conn_timeout;
+ unsigned int conn_timeout;
};
#define tipc_sk(sk) ((struct tipc_sock *)(sk))
@@ -231,7 +231,7 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol,
sock_init_data(sock, sk);
sk->sk_backlog_rcv = backlog_rcv;
tipc_sk(sk)->p = tp_ptr;
- tipc_sk(sk)->conn_timeout = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT);
+ tipc_sk(sk)->conn_timeout = CONN_TIMEOUT_DEFAULT;
spin_unlock_bh(tp_ptr->lock);
@@ -1369,7 +1369,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
struct msghdr m = {NULL,};
struct sk_buff *buf;
struct tipc_msg *msg;
- long timeout;
+ unsigned int timeout;
int res;
lock_sock(sk);
@@ -1434,7 +1434,8 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
res = wait_event_interruptible_timeout(*sk_sleep(sk),
(!skb_queue_empty(&sk->sk_receive_queue) ||
(sock->state != SS_CONNECTING)),
- timeout ? timeout : MAX_SCHEDULE_TIMEOUT);
+ timeout ? (long)msecs_to_jiffies(timeout)
+ : MAX_SCHEDULE_TIMEOUT);
lock_sock(sk);
if (res > 0) {
@@ -1696,7 +1697,7 @@ static int setsockopt(struct socket *sock,
res = tipc_set_portunreturnable(tport->ref, value);
break;
case TIPC_CONN_TIMEOUT:
- tipc_sk(sk)->conn_timeout = msecs_to_jiffies(value);
+ tipc_sk(sk)->conn_timeout = value;
/* no need to set "res", since already 0 at this point */
break;
default:
@@ -1752,7 +1753,7 @@ static int getsockopt(struct socket *sock,
res = tipc_portunreturnable(tport->ref, &value);
break;
case TIPC_CONN_TIMEOUT:
- value = jiffies_to_msecs(tipc_sk(sk)->conn_timeout);
+ value = tipc_sk(sk)->conn_timeout;
/* no need to set "res", since already 0 at this point */
break;
case TIPC_NODE_RECVQ_DEPTH:
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 18/28] tipc: Ensure both nodes recognize loss of contact between them
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Enhances TIPC to ensure that a node that loses contact with a
neighboring node does not allow contact to be re-established until
it sees that its peer has also recognized the loss of contact.
Previously, nodes that were connected by two or more links could
encounter a situation in which node A would lose contact with node B
on all of its links, purge its name table of names published by B,
and then fail to repopulate those names once contact with B was restored.
This would happen because B was able to re-establish one or more links
so quickly that it never reached a point where it had no links to A --
meaning that B never saw a loss of contact with A, and consequently
didn't re-publish its names to A.
This problem is now prevented by enhancing the cleanup done by TIPC
following a loss of contact with a neighboring node to ensure that
node A ignores all messages sent by B until it receives a LINK_PROTOCOL
message that indicates B has lost contact with A, thereby preventing
the (re)establishment of links between the nodes. The loss of contact
is recognized when a RESET or ACTIVATE message is received that has
a "redundant link exists" field of 0, indicating that B's sending link
endpoint is in a reset state and that B has no other working links.
Additionally, TIPC now suppresses the sending of (most) link protocol
messages to a neighboring node while it is cleaning up after an earlier
loss of contact with that node. This stops the peer node from prematurely
activating its link endpoint, which would prevent TIPC from later
activating its own end. TIPC still allows outgoing RESET messages to
occur during cleanup, to avoid problems if its own node recognizes
the loss of contact first and tries to notify the peer of the situation.
Finally, TIPC now recognizes an impending loss of contact with a peer node
as soon as it receives a RESET message on a working link that is the
peer's only link to the node, and ensures that the link protocol
suppression mentioned above goes into effect right away -- that is,
even before its own link endpoints have failed. This is necessary to
ensure correct operation when there are redundant links between the nodes,
since otherwise TIPC would send an ACTIVATE message upon receiving a RESET
on its first link and only begin suppressing when a RESET on its second
link was received, instead of initiating suppression with the first RESET
message as it needs to.
Note: The reworked cleanup code also eliminates a check that prevented
a link endpoint's discovery object from responding to incoming messages
while stale name table entries are being purged. This check is now
unnecessary and would have slowed down re-establishment of communication
between the nodes in some situations.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/discover.c | 6 ------
net/tipc/link.c | 33 ++++++++++++++++++++++++++++-----
net/tipc/node.c | 11 ++++++-----
net/tipc/node.h | 10 ++++++++--
4 files changed, 42 insertions(+), 18 deletions(-)
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 0987933..f2fb96e 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -159,12 +159,6 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct tipc_bearer *b_ptr)
}
tipc_node_lock(n_ptr);
- /* Don't talk to neighbor during cleanup after last session */
- if (n_ptr->cleanup_required) {
- tipc_node_unlock(n_ptr);
- return;
- }
-
link = n_ptr->links[b_ptr->identity];
/* Create a link endpoint for this bearer, if necessary */
diff --git a/net/tipc/link.c b/net/tipc/link.c
index bc655f4..74126db 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1669,17 +1669,24 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
goto cont;
tipc_node_lock(n_ptr);
- /* Don't talk to neighbor during cleanup after last session */
+ /* Locate unicast link endpoint that should handle message */
- if (n_ptr->cleanup_required) {
+ l_ptr = n_ptr->links[b_ptr->identity];
+ if (unlikely(!l_ptr)) {
tipc_node_unlock(n_ptr);
goto cont;
}
- /* Locate unicast link endpoint that should handle message */
+ /* Verify that communication with node is currently allowed */
- l_ptr = n_ptr->links[b_ptr->identity];
- if (unlikely(!l_ptr)) {
+ if ((n_ptr->block_setup & WAIT_PEER_DOWN) &&
+ msg_user(msg) == LINK_PROTOCOL &&
+ (msg_type(msg) == RESET_MSG ||
+ msg_type(msg) == ACTIVATE_MSG) &&
+ !msg_redundant_link(msg))
+ n_ptr->block_setup &= ~WAIT_PEER_DOWN;
+
+ if (n_ptr->block_setup) {
tipc_node_unlock(n_ptr);
goto cont;
}
@@ -1914,6 +1921,12 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
if (link_blocked(l_ptr))
return;
+
+ /* Abort non-RESET send if communication with node is prohibited */
+
+ if ((l_ptr->owner->block_setup) && (msg_typ != RESET_MSG))
+ return;
+
msg_set_type(msg, msg_typ);
msg_set_net_plane(msg, l_ptr->b_ptr->net_plane);
msg_set_bcast_ack(msg, mod(l_ptr->owner->bclink.last_in));
@@ -2045,6 +2058,16 @@ static void link_recv_proto_msg(struct link *l_ptr, struct sk_buff *buf)
if (less_eq(msg_session(msg), l_ptr->peer_session))
break; /* duplicate or old reset: ignore */
}
+
+ if (!msg_redundant_link(msg) && (link_working_working(l_ptr) ||
+ link_working_unknown(l_ptr))) {
+ /*
+ * peer has lost contact -- don't allow peer's links
+ * to reactivate before we recognize loss & clean up
+ */
+ l_ptr->owner->block_setup = WAIT_NODE_DOWN;
+ }
+
/* fall thru' */
case ACTIVATE_MSG:
/* Update link settings according other endpoint's values */
diff --git a/net/tipc/node.c b/net/tipc/node.c
index d75432f..27b4bb0 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -112,6 +112,7 @@ struct tipc_node *tipc_node_create(u32 addr)
break;
}
list_add_tail(&n_ptr->list, &temp_node->list);
+ n_ptr->block_setup = WAIT_PEER_DOWN;
tipc_num_nodes++;
@@ -312,7 +313,7 @@ static void node_established_contact(struct tipc_node *n_ptr)
}
}
-static void node_cleanup_finished(unsigned long node_addr)
+static void node_name_purge_complete(unsigned long node_addr)
{
struct tipc_node *n_ptr;
@@ -320,7 +321,7 @@ static void node_cleanup_finished(unsigned long node_addr)
n_ptr = tipc_node_find(node_addr);
if (n_ptr) {
tipc_node_lock(n_ptr);
- n_ptr->cleanup_required = 0;
+ n_ptr->block_setup &= ~WAIT_NAMES_GONE;
tipc_node_unlock(n_ptr);
}
read_unlock_bh(&tipc_net_lock);
@@ -371,10 +372,10 @@ static void node_lost_contact(struct tipc_node *n_ptr)
/* Notify subscribers */
tipc_nodesub_notify(n_ptr);
- /* Prevent re-contact with node until all cleanup is done */
+ /* Prevent re-contact with node until cleanup is done */
- n_ptr->cleanup_required = 1;
- tipc_k_signal((Handler)node_cleanup_finished, n_ptr->addr);
+ n_ptr->block_setup = WAIT_PEER_DOWN | WAIT_NAMES_GONE;
+ tipc_k_signal((Handler)node_name_purge_complete, n_ptr->addr);
}
struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
diff --git a/net/tipc/node.h b/net/tipc/node.h
index 5c61afc..4f15cb4 100644
--- a/net/tipc/node.h
+++ b/net/tipc/node.h
@@ -42,6 +42,12 @@
#include "net.h"
#include "bearer.h"
+/* Flags used to block (re)establishment of contact with a neighboring node */
+
+#define WAIT_PEER_DOWN 0x0001 /* wait to see that peer's links are down */
+#define WAIT_NAMES_GONE 0x0002 /* wait for peer's publications to be purged */
+#define WAIT_NODE_DOWN 0x0004 /* wait until peer node is declared down */
+
/**
* struct tipc_node - TIPC node structure
* @addr: network address of node
@@ -52,7 +58,7 @@
* @active_links: pointers to active links to node
* @links: pointers to all links to node
* @working_links: number of working links to node (both active and standby)
- * @cleanup_required: non-zero if cleaning up after a prior loss of contact
+ * @block_setup: bit mask of conditions preventing link establishment to node
* @link_cnt: number of links to node
* @permit_changeover: non-zero if node has redundant links to this system
* @bclink: broadcast-related info
@@ -77,7 +83,7 @@ struct tipc_node {
struct link *links[MAX_BEARERS];
int link_cnt;
int working_links;
- int cleanup_required;
+ int block_setup;
int permit_changeover;
struct {
int supported;
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 19/28] tipc: Fix unsafe device list search when enabling bearer
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Ensures that the device list lock is held while trying to locate
the Ethernet device used by a newly enabled bearer, so that the
addition or removal of a device does not cause problems.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/eth_media.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index b69092e..69bedd8 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -2,7 +2,7 @@
* net/tipc/eth_media.c: Ethernet bearer support for TIPC
*
* Copyright (c) 2001-2007, Ericsson AB
- * Copyright (c) 2005-2007, Wind River Systems
+ * Copyright (c) 2005-2008, 2011, Wind River Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -144,12 +144,15 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
/* Find device with specified name */
+ read_lock(&dev_base_lock);
for_each_netdev(&init_net, pdev) {
if (!strncmp(pdev->name, driver_name, IFNAMSIZ)) {
dev = pdev;
+ dev_hold(dev);
break;
}
}
+ read_unlock(&dev_base_lock);
if (!dev)
return -ENODEV;
@@ -166,7 +169,6 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
eb_ptr->tipc_packet_type.func = recv_msg;
eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr;
INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list));
- dev_hold(dev);
dev_add_pack(&eb_ptr->tipc_packet_type);
}
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 20/28] tipc: Remove redundant search when enabling bearer
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Removes obsolete code that searches for an Ethernet bearer structure entry
to use for a newly enabled bearer, since this search is now performed
at the start of the enabling algorithm.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/eth_media.c | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 69bedd8..413b337 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -156,21 +156,15 @@ static int enable_bearer(struct tipc_bearer *tb_ptr)
if (!dev)
return -ENODEV;
- /* Find Ethernet bearer for device (or create one) */
-
- while ((eb_ptr != stop) && eb_ptr->dev && (eb_ptr->dev != dev))
- eb_ptr++;
- if (eb_ptr == stop)
- return -EDQUOT;
- if (!eb_ptr->dev) {
- eb_ptr->dev = dev;
- eb_ptr->tipc_packet_type.type = htons(ETH_P_TIPC);
- eb_ptr->tipc_packet_type.dev = dev;
- eb_ptr->tipc_packet_type.func = recv_msg;
- eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr;
- INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list));
- dev_add_pack(&eb_ptr->tipc_packet_type);
- }
+ /* Create Ethernet bearer for device */
+
+ eb_ptr->dev = dev;
+ eb_ptr->tipc_packet_type.type = htons(ETH_P_TIPC);
+ eb_ptr->tipc_packet_type.dev = dev;
+ eb_ptr->tipc_packet_type.func = recv_msg;
+ eb_ptr->tipc_packet_type.af_packet_priv = eb_ptr;
+ INIT_LIST_HEAD(&(eb_ptr->tipc_packet_type.list));
+ dev_add_pack(&eb_ptr->tipc_packet_type);
/* Associate TIPC bearer with Ethernet bearer */
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 21/28] tipc: Lower limits for number of bearers and media types
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Reduces the number of bearers a node can support to 2, which can use
identical or non-identical media. This change won't impact users,
since they are currently limited to a maximum of 2 Ethernet bearers,
and will save memory by eliminating a number of unused entries in
TIPC's media and bearer arrays.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/bearer.h | 4 ++--
net/tipc/eth_media.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index 5ad70ef..d696f9e 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -39,8 +39,8 @@
#include "bcast.h"
-#define MAX_BEARERS 8
-#define MAX_MEDIA 4
+#define MAX_BEARERS 2
+#define MAX_MEDIA 2
/*
* Identifiers of supported TIPC media types
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 413b337..e728d4c 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -37,7 +37,7 @@
#include "core.h"
#include "bearer.h"
-#define MAX_ETH_BEARERS 2
+#define MAX_ETH_BEARERS MAX_BEARERS
#define ETH_LINK_PRIORITY TIPC_DEF_LINK_PRI
#define ETH_LINK_TOLERANCE TIPC_DEF_LINK_TOL
#define ETH_LINK_WINDOW TIPC_DEF_LINK_WIN
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 22/28] tipc: Prevent fragmented messages during initial name table exchange
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Reduces the maximum size of messages sent during the initial exchange
of name table information between two nodes to be no larger than the
MTU of the first link established between the nodes. This ensures that
messages will never need to be fragmented, which would add unnecessary
overhead to the name table synchronization mechanism.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/name_distr.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index cd356e5..21bc028 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -175,16 +175,32 @@ void tipc_named_withdraw(struct publication *publ)
void tipc_named_node_up(unsigned long node)
{
+ struct tipc_node *n_ptr;
+ struct link *l_ptr;
struct publication *publ;
struct distr_item *item = NULL;
struct sk_buff *buf = NULL;
u32 left = 0;
u32 rest;
- u32 max_item_buf;
+ u32 max_item_buf = 0;
+
+ /* compute maximum amount of publication data to send per message */
+
+ read_lock_bh(&tipc_net_lock);
+ n_ptr = tipc_node_find((u32)node);
+ if (n_ptr) {
+ tipc_node_lock(n_ptr);
+ l_ptr = n_ptr->active_links[0];
+ if (l_ptr)
+ max_item_buf = ((l_ptr->max_pkt - INT_H_SIZE) /
+ ITEM_SIZE) * ITEM_SIZE;
+ tipc_node_unlock(n_ptr);
+ }
+ read_unlock_bh(&tipc_net_lock);
+ if (!max_item_buf)
+ return;
read_lock_bh(&tipc_nametbl_lock);
- max_item_buf = TIPC_MAX_USER_MSG_SIZE / ITEM_SIZE;
- max_item_buf *= ITEM_SIZE;
rest = publ_cnt * ITEM_SIZE;
list_for_each_entry(publ, &publ_root, local_list) {
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 23/28] tipc: relocate/coalesce node cast in tipc_named_node_up
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
Functions like this are called using unsigned longs from
function pointers. In this case, the function is passed in
a node which is normally internally treated as a u32 by TIPC.
Rather than add more casts into this function in the future
for each added use of node within, move the cast to a single
place on a local.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/name_distr.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 21bc028..97546f0 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -173,13 +173,14 @@ void tipc_named_withdraw(struct publication *publ)
* tipc_named_node_up - tell specified node about all publications by this node
*/
-void tipc_named_node_up(unsigned long node)
+void tipc_named_node_up(unsigned long nodearg)
{
struct tipc_node *n_ptr;
struct link *l_ptr;
struct publication *publ;
struct distr_item *item = NULL;
struct sk_buff *buf = NULL;
+ u32 node = (u32)nodearg;
u32 left = 0;
u32 rest;
u32 max_item_buf = 0;
@@ -187,7 +188,7 @@ void tipc_named_node_up(unsigned long node)
/* compute maximum amount of publication data to send per message */
read_lock_bh(&tipc_net_lock);
- n_ptr = tipc_node_find((u32)node);
+ n_ptr = tipc_node_find(node);
if (n_ptr) {
tipc_node_lock(n_ptr);
l_ptr = n_ptr->active_links[0];
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 25/28] tipc: Add support for SO_SNDTIMEO socket option
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Ying Xue <ying.xue@windriver.com>
Adds support for the SO_SNDTIMEO socket option. (This complements the
existing support for SO_RCVTIMEO that is already present.)
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/socket.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index fc3c281..2f90beb 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -525,6 +525,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
struct tipc_port *tport = tipc_sk_port(sk);
struct sockaddr_tipc *dest = (struct sockaddr_tipc *)m->msg_name;
int needs_conn;
+ long timeout_val;
int res = -EINVAL;
if (unlikely(!dest))
@@ -564,6 +565,8 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
reject_rx_queue(sk);
}
+ timeout_val = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT);
+
do {
if (dest->addrtype == TIPC_ADDR_NAME) {
res = dest_name_check(dest, m);
@@ -600,16 +603,14 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
sock->state = SS_CONNECTING;
break;
}
- if (m->msg_flags & MSG_DONTWAIT) {
- res = -EWOULDBLOCK;
+ if (timeout_val <= 0L) {
+ res = timeout_val ? timeout_val : -EWOULDBLOCK;
break;
}
release_sock(sk);
- res = wait_event_interruptible(*sk_sleep(sk),
- !tport->congested);
+ timeout_val = wait_event_interruptible_timeout(*sk_sleep(sk),
+ !tport->congested, timeout_val);
lock_sock(sk);
- if (res)
- break;
} while (1);
exit:
@@ -636,6 +637,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
struct sock *sk = sock->sk;
struct tipc_port *tport = tipc_sk_port(sk);
struct sockaddr_tipc *dest = (struct sockaddr_tipc *)m->msg_name;
+ long timeout_val;
int res;
/* Handle implied connection establishment */
@@ -650,6 +652,8 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
if (iocb)
lock_sock(sk);
+ timeout_val = sock_sndtimeo(sk, m->msg_flags & MSG_DONTWAIT);
+
do {
if (unlikely(sock->state != SS_CONNECTED)) {
if (sock->state == SS_DISCONNECTING)
@@ -663,16 +667,14 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
total_len);
if (likely(res != -ELINKCONG))
break;
- if (m->msg_flags & MSG_DONTWAIT) {
- res = -EWOULDBLOCK;
+ if (timeout_val <= 0L) {
+ res = timeout_val ? timeout_val : -EWOULDBLOCK;
break;
}
release_sock(sk);
- res = wait_event_interruptible(*sk_sleep(sk),
- (!tport->congested || !tport->connected));
+ timeout_val = wait_event_interruptible_timeout(*sk_sleep(sk),
+ (!tport->congested || !tport->connected), timeout_val);
lock_sock(sk);
- if (res)
- break;
} while (1);
if (iocb)
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 24/28] tipc: Enhance sending of bulk name table messages
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Allan Stephens <allan.stephens@windriver.com>
Modifies the initial transfer of name table entries to a new neighboring
node so that the messages are enqueued as a unit, rather than individually.
The revised algorithm now locates the link carrying the message only once,
and eliminates unnecessary checks for link congestion, message fragmentation,
and message bundling that are not required when sending these messages.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/link.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
net/tipc/link.h | 1 +
net/tipc/name_distr.c | 10 ++++++++--
3 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 74126db..2ea3f22 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -986,6 +986,51 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
}
/*
+ * tipc_link_send_names - send name table entries to new neighbor
+ *
+ * Send routine for bulk delivery of name table messages when contact
+ * with a new neighbor occurs. No link congestion checking is performed
+ * because name table messages *must* be delivered. The messages must be
+ * small enough not to require fragmentation.
+ * Called without any locks held.
+ */
+
+void tipc_link_send_names(struct list_head *message_list, u32 dest)
+{
+ struct tipc_node *n_ptr;
+ struct link *l_ptr;
+ struct sk_buff *buf;
+ struct sk_buff *temp_buf;
+
+ if (list_empty(message_list))
+ return;
+
+ read_lock_bh(&tipc_net_lock);
+ n_ptr = tipc_node_find(dest);
+ if (n_ptr) {
+ tipc_node_lock(n_ptr);
+ l_ptr = n_ptr->active_links[0];
+ if (l_ptr) {
+ /* convert circular list to linear list */
+ ((struct sk_buff *)message_list->prev)->next = NULL;
+ link_add_chain_to_outqueue(l_ptr,
+ (struct sk_buff *)message_list->next, 0);
+ tipc_link_push_queue(l_ptr);
+ INIT_LIST_HEAD(message_list);
+ }
+ tipc_node_unlock(n_ptr);
+ }
+ read_unlock_bh(&tipc_net_lock);
+
+ /* discard the messages if they couldn't be sent */
+
+ list_for_each_safe(buf, temp_buf, ((struct sk_buff *)message_list)) {
+ list_del((struct list_head *)buf);
+ buf_discard(buf);
+ }
+}
+
+/*
* link_send_buf_fast: Entry for data messages where the
* destination link is known and the header is complete,
* inclusive total message length. Very time critical.
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 74fbeca..e56cb53 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -223,6 +223,7 @@ struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_s
struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_space);
void tipc_link_reset(struct link *l_ptr);
int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector);
+void tipc_link_send_names(struct list_head *message_list, u32 dest);
int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf);
u32 tipc_link_get_max_pkt(u32 dest, u32 selector);
int tipc_link_send_sections_fast(struct tipc_port *sender,
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index 97546f0..b7ca1bd 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -180,6 +180,7 @@ void tipc_named_node_up(unsigned long nodearg)
struct publication *publ;
struct distr_item *item = NULL;
struct sk_buff *buf = NULL;
+ struct list_head message_list;
u32 node = (u32)nodearg;
u32 left = 0;
u32 rest;
@@ -201,6 +202,10 @@ void tipc_named_node_up(unsigned long nodearg)
if (!max_item_buf)
return;
+ /* create list of publication messages, then send them as a unit */
+
+ INIT_LIST_HEAD(&message_list);
+
read_lock_bh(&tipc_nametbl_lock);
rest = publ_cnt * ITEM_SIZE;
@@ -219,13 +224,14 @@ void tipc_named_node_up(unsigned long nodearg)
item++;
left -= ITEM_SIZE;
if (!left) {
- msg_set_link_selector(buf_msg(buf), node);
- tipc_link_send(buf, node, node);
+ list_add_tail((struct list_head *)buf, &message_list);
buf = NULL;
}
}
exit:
read_unlock_bh(&tipc_nametbl_lock);
+
+ tipc_link_send_names(&message_list, (u32)node);
}
/**
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 26/28] tipc: Simplify prohibition of listen and accept for connectionless sockets
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Ying Xue <ying.xue@windriver.com>
Modifies the proto_ops structure used by TIPC DGRAM and RDM sockets
so that calls to listen() and accept() are handled by existing kernel
"unsupported operation" routines, and eliminates the related checks
in the listen and accept routines used by SEQPACKET and STREAM sockets
that are no longer needed.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/socket.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 2f90beb..9440a3d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -1483,9 +1483,7 @@ static int listen(struct socket *sock, int len)
lock_sock(sk);
- if (sock->state == SS_READY)
- res = -EOPNOTSUPP;
- else if (sock->state != SS_UNCONNECTED)
+ if (sock->state != SS_UNCONNECTED)
res = -EINVAL;
else {
sock->state = SS_LISTENING;
@@ -1513,10 +1511,6 @@ static int accept(struct socket *sock, struct socket *new_sock, int flags)
lock_sock(sk);
- if (sock->state == SS_READY) {
- res = -EOPNOTSUPP;
- goto exit;
- }
if (sock->state != SS_LISTENING) {
res = -EINVAL;
goto exit;
@@ -1793,11 +1787,11 @@ static const struct proto_ops msg_ops = {
.bind = bind,
.connect = connect,
.socketpair = sock_no_socketpair,
- .accept = accept,
+ .accept = sock_no_accept,
.getname = get_name,
.poll = poll,
.ioctl = sock_no_ioctl,
- .listen = listen,
+ .listen = sock_no_listen,
.shutdown = shutdown,
.setsockopt = setsockopt,
.getsockopt = getsockopt,
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 27/28] tipc: Remove callback field from subscription structure
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Ying Xue <ying.xue@windriver.com>
Eliminate the "event_cb" member from TIPC's "subscription" structure
since the function pointer it holds always points to subscr_send_event().
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/subscr.c | 3 +--
net/tipc/subscr.h | 6 ------
2 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index 6cf7268..1983717 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -151,7 +151,7 @@ void tipc_subscr_report_overlap(struct subscription *sub,
if (!must && !(sub->filter & TIPC_SUB_PORTS))
return;
- sub->event_cb(sub, found_lower, found_upper, event, port_ref, node);
+ subscr_send_event(sub, found_lower, found_upper, event, port_ref, node);
}
/**
@@ -365,7 +365,6 @@ static struct subscription *subscr_subscribe(struct tipc_subscr *s,
subscr_terminate(subscriber);
return NULL;
}
- sub->event_cb = subscr_send_event;
INIT_LIST_HEAD(&sub->nameseq_list);
list_add(&sub->subscription_list, &subscriber->subscription_list);
sub->server_ref = subscriber->port_ref;
diff --git a/net/tipc/subscr.h b/net/tipc/subscr.h
index 45d89bf..4b06ef6 100644
--- a/net/tipc/subscr.h
+++ b/net/tipc/subscr.h
@@ -39,16 +39,11 @@
struct subscription;
-typedef void (*tipc_subscr_event) (struct subscription *sub,
- u32 found_lower, u32 found_upper,
- u32 event, u32 port_ref, u32 node);
-
/**
* struct subscription - TIPC network topology subscription object
* @seq: name sequence associated with subscription
* @timeout: duration of subscription (in ms)
* @filter: event filtering to be done for subscription
- * @event_cb: routine invoked when a subscription event is detected
* @timer: timer governing subscription duration (optional)
* @nameseq_list: adjacent subscriptions in name sequence's subscription list
* @subscription_list: adjacent subscriptions in subscriber's subscription list
@@ -61,7 +56,6 @@ struct subscription {
struct tipc_name_seq seq;
u32 timeout;
u32 filter;
- tipc_subscr_event event_cb;
struct timer_list timer;
struct list_head nameseq_list;
struct list_head subscription_list;
--
1.7.4.4
^ permalink raw reply related
* [PATCH net-next 28/28] tipc: Remove unused link event tracking code
From: Paul Gortmaker @ 2011-09-18 3:32 UTC (permalink / raw)
To: davem; +Cc: netdev, allan.stephens, ying.xue, Paul Gortmaker
In-Reply-To: <1316316744-29514-1-git-send-email-paul.gortmaker@windriver.com>
From: Ying Xue <ying.xue@windriver.com>
Elimintes prototype link event tracking functionality that has never
been fleshed out and doesn't do anything useful at the current time.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/config.h | 1 -
net/tipc/link.c | 10 ----------
2 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/net/tipc/config.h b/net/tipc/config.h
index 443159a..80da6eb 100644
--- a/net/tipc/config.h
+++ b/net/tipc/config.h
@@ -65,7 +65,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd,
const void *req_tlv_area, int req_tlv_space,
int headroom);
-void tipc_cfg_link_event(u32 addr, char *name, int up);
int tipc_cfg_init(void);
void tipc_cfg_stop(void);
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 2ea3f22..ae98a72 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -537,9 +537,6 @@ void tipc_link_stop(struct link *l_ptr)
l_ptr->proto_msg_queue = NULL;
}
-/* LINK EVENT CODE IS NOT SUPPORTED AT PRESENT */
-#define link_send_event(fcn, l_ptr, up) do { } while (0)
-
void tipc_link_reset(struct link *l_ptr)
{
struct sk_buff *buf;
@@ -597,10 +594,6 @@ void tipc_link_reset(struct link *l_ptr)
l_ptr->fsm_msg_cnt = 0;
l_ptr->stale_count = 0;
link_reset_statistics(l_ptr);
-
- link_send_event(tipc_cfg_link_event, l_ptr, 0);
- if (!in_own_cluster(l_ptr->addr))
- link_send_event(tipc_disc_link_event, l_ptr, 0);
}
@@ -609,9 +602,6 @@ static void link_activate(struct link *l_ptr)
l_ptr->next_in_no = l_ptr->stats.recv_info = 1;
tipc_node_link_up(l_ptr->owner, l_ptr);
tipc_bearer_add_dest(l_ptr->b_ptr, l_ptr->addr);
- link_send_event(tipc_cfg_link_event, l_ptr, 1);
- if (!in_own_cluster(l_ptr->addr))
- link_send_event(tipc_disc_link_event, l_ptr, 1);
}
/**
--
1.7.4.4
^ permalink raw reply related
* Re: [PATCH v2 1/7] Basic kernel memory functionality for the Memory Controller
From: Glauber Costa @ 2011-09-18 3:39 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-kernel, paul, lizf, kamezawa.hiroyu, ebiederm, davem,
gthelen, netdev, linux-mm
In-Reply-To: <20110917174535.GA1658@shutemov.name>
>> struct mem_cgroup_stat_cpu *stat;
>> @@ -391,6 +404,7 @@ enum charge_type {
>> #define _MEM (0)
>> #define _MEMSWAP (1)
>> #define _OOM_TYPE (2)
>> +#define _KMEM (3)
>
> Ditto. Can we use enum instead?
Yes we can (tm)
>> if (!mem_cgroup_is_root(mem)) {
>> if (!swap)
>> - return res_counter_read_u64(&mem->res, RES_USAGE);
>> + kmem += res_counter_read_u64(&mem->res, RES_USAGE);
>> else
>> - return res_counter_read_u64(&mem->memsw, RES_USAGE);
>> + kmem += res_counter_read_u64(&mem->memsw, RES_USAGE);
>> +
>> + return kmem;
>> }
>>
>> val = mem_cgroup_recursive_stat(mem, MEM_CGROUP_STAT_CACHE);
>
> No kernel memory accounting for root cgroup, right?
Not sure. Maybe kernel memory accounting is useful even for root cgroup.
Same as normal memory accounting... what we want to avoid is kernel
memory limits. OTOH, if we are not limiting it anyway, accounting it is
just useless overhead... Even the statistics can then be gathered
through all
the proc files that show slab usage, I guess?
>
>> @@ -3979,6 +3999,10 @@ static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
>> else
>> val = res_counter_read_u64(&mem->memsw, name);
>> break;
>> + case _KMEM:
>> + val = res_counter_read_u64(&mem->kmem, name);
>> + break;
>> +
>
> Always zero in root cgroup?
Yes, if we're not accounting, it should be zero. WARN_ON, maybe?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [GIT] Networking
From: David Miller @ 2011-09-18 6:21 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
I thought the kernel.org issue would be cleared up a lot sooner than
it appears it will end up being resolved, so I held off on creating
another GIT tree to push changes to you until just a day or two ago.
Anyways, here are all of the fixes which have queued up meanwhile.
As usual, the majority of the stuff is in the drivers, with only a few
protocol and generic networking fixes here and there.
1) Fix DMA mapping failures and checksum offload failure handling in
ibmveth driver, from Anton Blanchard and Brian King.
2) Netfilter fixes:
a) Fix xt_rateest_mt_checkentry() error handling, from Eric Dumazet.
b) Fix leak in ipq_build_packet_message(), from Jesper Juhl.
c) Build dependencies for ebtables are wrong, from Bart De Schuymer.
d) Userspace should never be allowed to send NF_STOLEN verdicts to
nf_queue, fix from Florian Westphal.
e) Fix translation of peer's call-id field in nf_ct_pptp when
both the server and client are NATed, from Sanket Shah.
f) Fix handling of invalid TCP options in nf_ct_tcp, from Jozsef Kadlecsik.
g) Fix TCP option lengh calculations in nf_ct_tcp's tcp_sack(), also
from Jozsef.
3) Socket address hardening in inet_bind() broke some apps, loosen
the checks so they work again.
4) Fix locking in mac80211's __sta_info_destroy() from Johannes Berg.
5) Fix crash when unplugging ath9k devices, from Mohammed Shafi Shajakhan.
6) Fix stack corruption and command queue timeouts in iwlagn, from Johannes
Berg.
7) Fix resets while reading device config, eliminate accidental accesses of
not-present registers, and fix coalescing bug in bnx2x driver from Dmitry Kravkov,
Vladislav Zolotarov, and Ariel Elior.
8) cls_rsvp.h indexes attribute array off-by-one, fix from Igor Maravić.
9) Syn flooding messages fill people's logs, rate limit it and report the
number of times it is detected in a statistic. From Eric Dumazet.
10) CAN protocol layer needs to use del_time_sync(), from Rajan Aggarwal.
11) Flow cache accidently uses entries from one namespace in another, fix
from David Ward.
12) If zero copy skbs hit forward path, we must copy them, from Michael S. Tsirkin.
13) ether_setup() needs to "OR" in the IFF_TX_SKB_SHARING bit so that other
settings made already don't get lost, from Neil Horman.
14) Revert regression causing SFC write-combining change, from Ben Hutchings.
15) Cure FIFO overrun handling in pch_gbe driver, from Toshiharu Okada.
16) SCTP connection wedges when it sees two COOKIE_ECHO chunks, fix from
Max Matveev.
17) Fix NULL deref in CAIF stack, from Eric Dumazet.
18) Fix ipv4 route metrics leak caused by kfree_rcu() conversions, fix
from Zheng Yan.
19) flow_key_compare has dependencies upon flow key alignment, make sure
they are met. From David Ward.
20) Also from David Ward, compare flow keys correctly based upon their
address-family specific size. Otherwise we reference garbage.
21) Fix ti_hecc driver build, missing include, from Daniel Mack.
22) Don't use inetpeer for the metrics of anything other than host
routes, from Zheng Yan.
23) Fix EEPROM signature handling of e1000 devices on HPPA. From
Jeff Kirsher.
24) ipv6's datagram_send_ctl() needs to adhere to the socket's
->transparent setting, fix from Maciej Żenczykowski.
Please pull, thanks a lot!
The following changes since commit 9e79e3e9dd9672b37ac9412e9a926714306551fe:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc (2011-08-30 11:28:18 -0700)
are available in the git repository at:
git://github.com/davem330/net.git master
Andi Kleen (1):
IRDA: Fix global type conflicts in net/irda/irsysctl.c v2
Anton Blanchard (3):
ibmveth: Fix issue with DMA mapping failure
ibmveth: Checksum offload is always disabled
ibmveth: Fix checksum offload failure handling
Ariel Elior (1):
bnx2x: Fix for a host coalescing bug which impared latency.
Bart De Schuymer (1):
netfilter: ebtables: fix ebtables build dependency
Ben Hutchings (2):
Revert "sfc: Use write-combining to reduce TX latency" and follow-ups
sfc: Use 64-bit writes for TX push where possible
Brian King (1):
ibmveth: Fix DMA unmap error
Daniel Mack (1):
can: ti_hecc: include linux/io.h
David S. Miller (3):
Merge branch 'master' of git://git.kernel.org/.../kaber/nf-2.6
Merge branch 'for-davem' of git://git.infradead.org/users/linville/wireless
Merge branch 'master' of ../netdev/
David Ward (1):
net: Align AF-specific flowi structs to long
Dmitry Kravkov (6):
bnx2x: fix BRB thresholds for dropless_fc mode
bnx2x: decrease print level to debug
bnx2x: fix MF for 4-port devices
bnx2x: don't reset device while reading its configuration.
bnx2x: init fw_seq after undi_unload is done
bnx2x: don't access removed registers on 57712 and above
Eric Dumazet (4):
netfilter: xt_rateest: fix xt_rateest_mt_checkentry()
net: ipv4: relax AF_INET check in bind()
tcp: Change possible SYN flooding messages
caif: fix a potential NULL dereference
Felix Fietkau (1):
ath9k_hw: fix calibration on 5 ghz
Florian Westphal (1):
netfilter: nf_queue: reject NF_STOLEN verdicts from userspace
George (2):
rtlwifi: rtl8192su: Fix problem connecting to HT-enabled AP
rtlwifi: Fix problem when switching connections
Ian Campbell (3):
MAINTAINERS: Update ATLX driver maintainers
MAINTAINERS: Update Cisco VIC driver maintainers
MAINTAINERS: Update BNA 10G Maintainer
Igor Maravić (1):
pkt_sched: cls_rsvp.h was outdated
Jeff Kirsher (1):
e1000: Fix driver to be used on PA RISC C8000 workstations
Jesper Juhl (1):
netfilter: ip_queue: Fix small leak in ipq_build_packet_message()
Johannes Berg (3):
mac80211: fix missing sta_lock in __sta_info_destroy
iwlagn: fix stack corruption
iwlagn: fix command queue timeout
John W. Linville (1):
Merge branch 'master' of git://git.infradead.org/users/linville/wireless into for-davem
Jozsef Kadlecsik (2):
netfilter: nf_ct_tcp: fix incorrect handling of invalid TCP option
netfilter: nf_ct_tcp: wrong multiplication of TCPOLEN_TSTAMP_ALIGNED in tcp_sack skips fastpath
Kavan Smith (1):
ipheth: iPhone 4 Verizon CDMA USB Product ID add
Maciej Żenczykowski (1):
net: relax PKTINFO non local ipv6 udp xmit check
Marcos Paulo de Souza (1):
Documentation: networking: dmfe.txt: Remove the maintainer of orphan networking driver
Max Matveev (1):
sctp: deal with multiple COOKIE_ECHO chunks
Michael S. Tsirkin (1):
net: copy userspace buffers on device forwarding
Mohammed Shafi Shajakhan (1):
ath9k: Fix kernel panic on unplugging the device
Patrick McHardy (1):
netfilter: update netfilter git URL
Rajkumar Manoharan (1):
ath9k_hw: Fix init mode register regression
Sanket Shah (1):
netfilter: nf_ct_pptp: fix DNATed PPTP connection address translation
Stanislaw Gruszka (1):
iwlegacy: fix BUG_ON(info->control.rates[0].idx < 0)
Toshiharu Okada (3):
pch_gbe: fixed the issue which receives an unnecessary packet.
pch_gbe: added the process of FIFO over run error
pch_gbe: support ML7831 IOH
Vladislav Zolotarov (1):
bnx2x: fix rx ring size report
Yan, Zheng (2):
ipv4: Fix fib_info->fib_metrics leak
ipv6: don't use inetpeer to store metrics for routes.
Yaniv Rosner (6):
bnx2x: Fix ETS bandwidth
bnx2x: Enable FEC for 57810-KR
bnx2x: Remove fiber remote fault detection
bnx2x: Fix XMAC loopback test
bnx2x: Fix 578xx link LED
bnx2x: Fix ethtool advertisement
dpward (2):
net: Make flow cache namespace-aware
net: Handle different key sizes between address families in flow cache
nhorman (1):
net: don't clear IFF_XMIT_DST_RELEASE in ether_setup
rajan.aggarwal85@gmail.com (1):
net/can/af_can.c: Change del_timer to del_timer_sync
Documentation/networking/dmfe.txt | 3 +-
MAINTAINERS | 6 +-
drivers/net/Kconfig | 11 +-
drivers/net/bnx2x/bnx2x.h | 124 +++++++---
drivers/net/bnx2x/bnx2x_cmn.c | 27 +-
drivers/net/bnx2x/bnx2x_ethtool.c | 48 +++-
drivers/net/bnx2x/bnx2x_link.c | 46 ++--
drivers/net/bnx2x/bnx2x_main.c | 162 ++++++++----
drivers/net/bnx2x/bnx2x_reg.h | 7 +-
drivers/net/bnx2x/bnx2x_stats.c | 7 +-
drivers/net/can/ti_hecc.c | 1 +
drivers/net/e1000/e1000_hw.c | 6 +
drivers/net/ibmveth.c | 48 +++--
drivers/net/pch_gbe/pch_gbe.h | 12 +-
drivers/net/pch_gbe/pch_gbe_main.c | 302 ++++++++++++++--------
drivers/net/sfc/efx.c | 18 +--
drivers/net/sfc/io.h | 6 -
drivers/net/sfc/mcdi.c | 46 ++--
drivers/net/sfc/nic.c | 7 -
drivers/net/sfc/nic.h | 2 -
drivers/net/sfc/siena.c | 25 +--
drivers/net/sfc/workarounds.h | 2 -
drivers/net/usb/ipheth.c | 5 +
drivers/net/wireless/ath/ath9k/ar9002_calib.c | 3 +-
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 2 +-
drivers/net/wireless/ath/ath9k/main.c | 6 +
drivers/net/wireless/iwlegacy/iwl-3945-rs.c | 13 +-
drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | 2 +
drivers/net/wireless/rtlwifi/core.c | 8 +
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 11 +-
include/linux/skbuff.h | 1 +
include/linux/snmp.h | 2 +
include/net/flow.h | 25 ++-
include/net/request_sock.h | 3 +-
include/net/sctp/command.h | 1 +
include/net/tcp.h | 3 +
include/net/transp_v6.h | 1 +
net/bridge/netfilter/Kconfig | 2 +-
net/caif/caif_dev.c | 6 +-
net/can/af_can.c | 2 +-
net/core/dev.c | 8 +
net/core/flow.c | 36 ++-
net/core/skbuff.c | 22 ++-
net/ethernet/eth.c | 2 +-
net/ipv4/af_inet.c | 7 +-
net/ipv4/fib_semantics.c | 10 +-
net/ipv4/netfilter/ip_queue.c | 12 +-
net/ipv4/proc.c | 2 +
net/ipv4/tcp_ipv4.c | 51 ++--
net/ipv6/datagram.c | 5 +-
net/ipv6/ip6_flowlabel.c | 8 +-
net/ipv6/ipv6_sockglue.c | 2 +-
net/ipv6/netfilter/ip6_queue.c | 12 +-
net/ipv6/raw.c | 4 +-
net/ipv6/route.c | 33 ++-
net/ipv6/tcp_ipv6.c | 31 +--
net/ipv6/udp.c | 4 +-
net/irda/irsysctl.c | 6 +-
net/irda/qos.c | 6 +-
net/mac80211/sta_info.c | 2 +-
net/netfilter/nf_conntrack_pptp.c | 1 +
net/netfilter/nf_conntrack_proto_tcp.c | 6 +-
net/netfilter/nfnetlink_queue.c | 4 +-
net/netfilter/xt_rateest.c | 9 +-
net/sched/cls_rsvp.h | 27 +-
net/sctp/sm_sideeffect.c | 5 +
net/sctp/sm_statefuns.c | 6 +
68 files changed, 827 insertions(+), 508 deletions(-)
^ permalink raw reply
* Re: [PATCH ] dynamic_debug: call __netdev_printk only for CONFIG_NET
From: Greg KH @ 2011-09-18 8:27 UTC (permalink / raw)
To: Jason Baron
Cc: Arnd Bergmann, gregkh, joe, jim.cromie, bvanassche, linux-kernel,
davem, aloisio.almeida, netdev
In-Reply-To: <20110901151817.GA14324@redhat.com>
On Thu, Sep 01, 2011 at 11:18:18AM -0400, Jason Baron wrote:
> On Thu, Sep 01, 2011 at 04:57:02PM +0200, Arnd Bergmann wrote:
> > __netdev_printk is only defined when CONFIG_NET is set. Since we only need
> > __dynamic_netdev_dbg for network drivers, we can make it conditional on the
> > same Kconfig symbol.
> >
>
> Hi,
>
> Yes, I've posted a fix for this:
>
> https://lkml.org/lkml/2011/8/30/297
>
> Hopefully, it will be pulled in soon.
As that thread again spun off into confusion, can you please resend the
end result?
thanks,
greg k-h
^ permalink raw reply
* [PATCH 0/4] add fec support for imx6q
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches
This series adds imx6q enet support. The imx6q enet is a derivative of
imx28 enet controller. It fixed the frame endian issue found on imx28,
and added 1 Gbps support.
It's based on v3.1-rc6.
Shawn Guo (4):
net/fec: change phy-reset-gpio request warning to debug message
net/fec: fix fec1 check in fec_enet_mii_init()
net/fec: set phy_speed to the optimal frequency 2.5 MHz
net/fec: add imx6q enet support
drivers/net/Kconfig | 3 +-
drivers/net/fec.c | 65 ++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 52 insertions(+), 16 deletions(-)
^ permalink raw reply
* [PATCH 1/4] net/fec: change phy-reset-gpio request warning to debug message
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches, Shawn Guo
In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org>
FEC can work without a phy reset on some platforms, which means not
very platform necessarily have a phy-reset gpio encoded in device tree.
So it makes more sense to have the phy-reset-gpio request failure as
a debug message rather than a warning.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/fec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index e8266cc..6a638e9 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1422,7 +1422,7 @@ static int __devinit fec_reset_phy(struct platform_device *pdev)
phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0);
err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset");
if (err) {
- pr_warn("FEC: failed to get gpio phy-reset: %d\n", err);
+ pr_debug("FEC: failed to get gpio phy-reset: %d\n", err);
return err;
}
msleep(1);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/4] net/fec: fix fec1 check in fec_enet_mii_init()
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches, Shawn Guo
In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org>
In function fec_enet_mii_init(), it uses non-zero pdev->id as part
of the condition to check the second fec instance (fec1). This works
before the driver supports device tree probe. But in case of device
tree probe, pdev->id is -1 which is also non-zero, so the logic becomes
broken when device tree probe gets supported.
The patch change the logic to check "pdev->id > 0" as the part of the
condition for identifying fec1.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/fec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 6a638e9..5ef0e34 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -996,7 +996,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
* mdio interface in board design, and need to be configured by
* fec0 mii_bus.
*/
- if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id) {
+ if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) {
/* fec1 uses fec0 mii_bus */
fep->mii_bus = fec0_mii_bus;
return 0;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 3/4] net/fec: set phy_speed to the optimal frequency 2.5 MHz
From: Shawn Guo @ 2011-09-18 11:54 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, linux-arm-kernel, patches, Shawn Guo
In-Reply-To: <1316346852-17090-1-git-send-email-shawn.guo@linaro.org>
With the unnecessary 1 bit left-shift on fep->phy_speed during the
calculation, the phy_speed always runs at the half frequency of the
optimal one 2.5 MHz.
The patch removes that 1 bit left-shift to get the optimal phy_speed.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/fec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 5ef0e34..04206e4 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1007,7 +1007,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
/*
* Set MII speed to 2.5 MHz (= clk_get_rate() / 2 * phy_speed)
*/
- fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000) << 1;
+ fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000);
writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
fep->mii_bus = mdiobus_alloc();
--
1.7.4.1
^ 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