aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-03-20 17:29:02 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-20 17:29:02 -0400
commitb74d3feccc3f5e6e4cf98cf88daa2e0cdbc4ca62 (patch)
tree651a6736040bd5084916ed9c461817fb0cbbe52b /net
parentf518338b16038beeb73e155e60d0f70beb9379f4 (diff)
parentf9b8c4c8baded129535d82d74df8e87a7a369f54 (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
Jesse Gross says: ==================== Open vSwitch Four small fixes for net/3.14. I realize that these are late in the cycle - just got back from vacation. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/openvswitch/datapath.c9
-rw-r--r--net/openvswitch/flow.c3
2 files changed, 7 insertions, 5 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index e9a48baf8551..8601b320b443 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1174,7 +1174,7 @@ static void ovs_dp_reset_user_features(struct sk_buff *skb, struct genl_info *in
1174 struct datapath *dp; 1174 struct datapath *dp;
1175 1175
1176 dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs); 1176 dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs);
1177 if (!dp) 1177 if (IS_ERR(dp))
1178 return; 1178 return;
1179 1179
1180 WARN(dp->user_features, "Dropping previously announced user features\n"); 1180 WARN(dp->user_features, "Dropping previously announced user features\n");
@@ -1762,11 +1762,12 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
1762 int bucket = cb->args[0], skip = cb->args[1]; 1762 int bucket = cb->args[0], skip = cb->args[1];
1763 int i, j = 0; 1763 int i, j = 0;
1764 1764
1765 rcu_read_lock();
1765 dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); 1766 dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
1766 if (!dp) 1767 if (!dp) {
1768 rcu_read_unlock();
1767 return -ENODEV; 1769 return -ENODEV;
1768 1770 }
1769 rcu_read_lock();
1770 for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) { 1771 for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) {
1771 struct vport *vport; 1772 struct vport *vport;
1772 1773
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 16f4b46161d4..dda451f4429c 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -73,6 +73,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb)
73 73
74 if ((flow->key.eth.type == htons(ETH_P_IP) || 74 if ((flow->key.eth.type == htons(ETH_P_IP) ||
75 flow->key.eth.type == htons(ETH_P_IPV6)) && 75 flow->key.eth.type == htons(ETH_P_IPV6)) &&
76 flow->key.ip.frag != OVS_FRAG_TYPE_LATER &&
76 flow->key.ip.proto == IPPROTO_TCP && 77 flow->key.ip.proto == IPPROTO_TCP &&
77 likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { 78 likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
78 tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb)); 79 tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
@@ -91,7 +92,7 @@ static void stats_read(struct flow_stats *stats,
91 unsigned long *used, __be16 *tcp_flags) 92 unsigned long *used, __be16 *tcp_flags)
92{ 93{
93 spin_lock(&stats->lock); 94 spin_lock(&stats->lock);
94 if (time_after(stats->used, *used)) 95 if (!*used || time_after(stats->used, *used))
95 *used = stats->used; 96 *used = stats->used;
96 *tcp_flags |= stats->tcp_flags; 97 *tcp_flags |= stats->tcp_flags;
97 ovs_stats->n_packets += stats->packet_count; 98 ovs_stats->n_packets += stats->packet_count;