* [PATCH net 1/4] ovs: fix dp check in ovs_dp_reset_user_features
[not found] ` <1395338954-26206-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
@ 2014-03-20 18:09 ` Jesse Gross
2014-03-20 18:09 ` [PATCH net 2/4] openvswitch: Read tcp flags only then the tranport header is present Jesse Gross
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jesse Gross @ 2014-03-20 18:09 UTC (permalink / raw)
To: David Miller
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
Jiri Pirko
From: Jiri Pirko <jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
This fixes crash when userspace does "ovs-dpctl add-dp dev" where dev is
existing non-dp netdevice.
Introduced by:
commit 44da5ae5fbea4686f667dc854e5ea16814e44c59
"openvswitch: Drop user features if old user space attempted to create datapath"
Signed-off-by: Jiri Pirko <jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/datapath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index e9a48ba..e42340d 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
struct datapath *dp;
dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs);
- if (!dp)
+ if (IS_ERR(dp))
return;
WARN(dp->user_features, "Dropping previously announced user features\n");
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 2/4] openvswitch: Read tcp flags only then the tranport header is present.
[not found] ` <1395338954-26206-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2014-03-20 18:09 ` [PATCH net 1/4] ovs: fix dp check in ovs_dp_reset_user_features Jesse Gross
@ 2014-03-20 18:09 ` Jesse Gross
2014-03-20 18:09 ` [PATCH net 3/4] openvswitch: Fix race Jesse Gross
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jesse Gross @ 2014-03-20 18:09 UTC (permalink / raw)
To: David Miller; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
From: Jarno Rajahalme <jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Only the first IP fragment can have a TCP header, check for this.
Signed-off-by: Jarno Rajahalme <jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/flow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 16f4b46..d71e60f 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)
if ((flow->key.eth.type == htons(ETH_P_IP) ||
flow->key.eth.type == htons(ETH_P_IPV6)) &&
+ flow->key.ip.frag != OVS_FRAG_TYPE_LATER &&
flow->key.ip.proto == IPPROTO_TCP &&
likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 3/4] openvswitch: Fix race.
[not found] ` <1395338954-26206-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2014-03-20 18:09 ` [PATCH net 1/4] ovs: fix dp check in ovs_dp_reset_user_features Jesse Gross
2014-03-20 18:09 ` [PATCH net 2/4] openvswitch: Read tcp flags only then the tranport header is present Jesse Gross
@ 2014-03-20 18:09 ` Jesse Gross
2014-03-20 18:09 ` [PATCH net 4/4] openvswitch: Correctly report flow used times for first 5 minutes after boot Jesse Gross
2014-03-20 21:30 ` [GIT net] Open vSwitch David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Jesse Gross @ 2014-03-20 18:09 UTC (permalink / raw)
To: David Miller; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
From: Jarno Rajahalme <jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
ovs_vport_cmd_dump() did rcu_read_lock() only after getting the
datapath, which could have been deleted in between. Resolved by
taking rcu_read_lock() before the get_dp() call.
Signed-off-by: Jarno Rajahalme <jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Pravin B Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/datapath.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index e42340d..8601b32 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1762,11 +1762,12 @@ static int ovs_vport_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb)
int bucket = cb->args[0], skip = cb->args[1];
int i, j = 0;
+ rcu_read_lock();
dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex);
- if (!dp)
+ if (!dp) {
+ rcu_read_unlock();
return -ENODEV;
-
- rcu_read_lock();
+ }
for (i = bucket; i < DP_VPORT_HASH_BUCKETS; i++) {
struct vport *vport;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 4/4] openvswitch: Correctly report flow used times for first 5 minutes after boot.
[not found] ` <1395338954-26206-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
` (2 preceding siblings ...)
2014-03-20 18:09 ` [PATCH net 3/4] openvswitch: Fix race Jesse Gross
@ 2014-03-20 18:09 ` Jesse Gross
2014-03-20 21:30 ` [GIT net] Open vSwitch David Miller
4 siblings, 0 replies; 6+ messages in thread
From: Jesse Gross @ 2014-03-20 18:09 UTC (permalink / raw)
To: David Miller; +Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
From: Ben Pfaff <blp-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
The kernel starts out its "jiffies" timer as 5 minutes below zero, as
shown in include/linux/jiffies.h:
/*
* Have the 32 bit jiffies value wrap 5 minutes after boot
* so jiffies wrap bugs show up earlier.
*/
#define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))
The loop in ovs_flow_stats_get() starts out with 'used' set to 0, then
takes any "later" time. This means that for the first five minutes after
boot, flows will always be reported as never used, since 0 is greater than
any time already seen.
Signed-off-by: Ben Pfaff <blp-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Acked-by: Pravin B Shelar <pshelar-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
---
net/openvswitch/flow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index d71e60f..dda451f 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -92,7 +92,7 @@ static void stats_read(struct flow_stats *stats,
unsigned long *used, __be16 *tcp_flags)
{
spin_lock(&stats->lock);
- if (time_after(stats->used, *used))
+ if (!*used || time_after(stats->used, *used))
*used = stats->used;
*tcp_flags |= stats->tcp_flags;
ovs_stats->n_packets += stats->packet_count;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [GIT net] Open vSwitch
[not found] ` <1395338954-26206-1-git-send-email-jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
` (3 preceding siblings ...)
2014-03-20 18:09 ` [PATCH net 4/4] openvswitch: Correctly report flow used times for first 5 minutes after boot Jesse Gross
@ 2014-03-20 21:30 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-03-20 21:30 UTC (permalink / raw)
To: jesse-l0M0P4e3n4LQT0dZR+AlfA
Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA
From: Jesse Gross <jesse-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
Date: Thu, 20 Mar 2014 11:09:10 -0700
> Four small fixes for net/3.14. I realize that these are late in the cycle - just got back from vacation.
>
> The following changes since commit c14e0953ca51dbcb8d1ac92acbdcff23d0caa158:
>
> openvswitch: Suppress error messages on megaflow updates (2014-02-04 22:32:38 -0800)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch.git fixes
Pulled, thanks Jesse.
^ permalink raw reply [flat|nested] 6+ messages in thread