[Devel,RHEL7,COMMIT] ms/vxlan: fix fdb_dump index calculation

Submitted by Konstantin Khorenko on Nov. 23, 2016, 2:56 p.m.

Details

Message ID 201611231456.uANEuTos010288@finist_cl7.x64_64.work.ct
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Nov. 23, 2016, 2:56 p.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.1
------>
commit 494db45a11d329f523d90a43037bed79343fbe2e
Author: Atzm Watanabe <atzm@iij.ad.jp>
Date:   Wed Nov 23 18:56:28 2016 +0400

    ms/vxlan: fix fdb_dump index calculation
    
    When too many remotes are bound to an FDB entry, index may not be increased.
    This problem will be caused on the large scale environment that is based on
    the unicast default destination, for instance.
    
    Signed-off-by: Atzm Watanabe <atzm@iij.ad.jp>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    
    ms commit: 07a51cd ("vxlan: fix fdb_dump index calculation")
    
    *same as in br_fdb_dump
    https://jira.sw.ru/browse/PSBM-53629
    
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Acked-by: Andrei Vagin <avagin@virtuozzo.com>
---
 drivers/net/vxlan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 8e89665..7fc54fa 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -965,10 +965,10 @@  static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 		hlist_for_each_entry_rcu(f, &vxlan->fdb_head[h], hlist) {
 			struct vxlan_rdst *rd;
 
-			if (idx < cb->args[0])
-				goto skip;
-
 			list_for_each_entry_rcu(rd, &f->remotes, list) {
+				if (idx < cb->args[0])
+					goto skip;
+
 				err = vxlan_fdb_info(skb, vxlan, f,
 						     NETLINK_CB(cb->skb).portid,
 						     cb->nlh->nlmsg_seq,
@@ -976,9 +976,9 @@  static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 						     NLM_F_MULTI, rd);
 				if (err < 0)
 					goto out;
-			}
 skip:
-			++idx;
+				++idx;
+			}
 		}
 	}
 out: