All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: ipmr/ip6mr: add support for keeping an entry age
@ 2016-07-14 15:08 Nikolay Aleksandrov
  2016-07-14 16:28 ` [PATCH net-next v2] " Nikolay Aleksandrov
  2016-07-15 23:19 ` [PATCH net-next] " Nikolay Aleksandrov
  0 siblings, 2 replies; 7+ messages in thread
From: Nikolay Aleksandrov @ 2016-07-14 15:08 UTC (permalink / raw)
  To: netdev
  Cc: Nikolay Aleksandrov, Roopa Prabhu, Shrijeet Mukherjee,
	Satish Ashok, Donald Sharp, David S. Miller, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy

In preparation for hardware offloading of ipmr/ip6mr we need an
interface that allows to check (and later update) the age of entries.
Relying on stats alone can show activity but not actual age of the entry,
furthermore when there're tens of thousands of entries a lot of the
hardware implementations only support "hit" bits which are cleared on
read to denote that the entry was active and shouldn't be aged out,
these can then be naturally translated into age timestamp and will be
compatible with the software forwarding age. Using a lastuse entry doesn't
affect performance because the entries in that cache line are written to
along with the age. Once an entry goes above the member size (32 bits) we
keep it at UINT_MAX as we cannot afford to wrap it which will falsely show
that it was used recently. This is not supposed to happen as entries should
be aged out in matter of minutes or seconds.
Since all new users are encouraged to use ipmr via netlink, this is
exported via the RTA_CACHEINFO attribute which has rta_lastuse entry.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: Shrijeet Mukherjee <shm@cumulusnetworks.com>
CC: Satish Ashok <sashok@cumulusnetworks.com>
CC: Donald Sharp <sharpd@cumulusnetworks.com>
CC: David S. Miller <davem@davemloft.net>
CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
CC: James Morris <jmorris@namei.org>
CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
CC: Patrick McHardy <kaber@trash.net>
---
RTA_CACHEINFO was chosen because there're other useful members of the
struct which will be used later when we gradually remove the ipmr/ip6mr
entry cache limitations.

 include/linux/mroute.h  |  1 +
 include/linux/mroute6.h |  1 +
 net/ipv4/ipmr.c         | 18 +++++++++++++++---
 net/ipv6/ip6mr.c        | 17 ++++++++++++++---
 4 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index bf9b322cb0b0..d351fd3e1049 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -104,6 +104,7 @@ struct mfc_cache {
 			unsigned long bytes;
 			unsigned long pkt;
 			unsigned long wrong_if;
+			unsigned long lastuse;
 			unsigned char ttls[MAXVIFS];	/* TTL thresholds		*/
 		} res;
 	} mfc_un;
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index 66982e764051..3987b64040c5 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -92,6 +92,7 @@ struct mfc6_cache {
 			unsigned long bytes;
 			unsigned long pkt;
 			unsigned long wrong_if;
+			unsigned long lastuse;
 			unsigned char ttls[MAXMIFS];	/* TTL thresholds		*/
 		} res;
 	} mfc_un;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 5ad48ec77710..b0ba7f6d2731 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1150,6 +1150,7 @@ static int ipmr_mfc_add(struct net *net, struct mr_table *mrt,
 	c->mfc_origin = mfc->mfcc_origin.s_addr;
 	c->mfc_mcastgrp = mfc->mfcc_mcastgrp.s_addr;
 	c->mfc_parent = mfc->mfcc_parent;
+	c->mfc_un.res.lastuse = jiffies;
 	ipmr_update_thresholds(mrt, c, mfc->mfcc_ttls);
 	if (!mrtsock)
 		c->mfc_flags |= MFC_STATIC;
@@ -1792,6 +1793,7 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 	vif = cache->mfc_parent;
 	cache->mfc_un.res.pkt++;
 	cache->mfc_un.res.bytes += skb->len;
+	cache->mfc_un.res.lastuse = jiffies;
 
 	if (cache->mfc_origin == htonl(INADDR_ANY) && true_vifi >= 0) {
 		struct mfc_cache *cache_proxy;
@@ -2071,10 +2073,13 @@ drop:
 static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
 			      struct mfc_cache *c, struct rtmsg *rtm)
 {
-	int ct;
-	struct rtnexthop *nhp;
-	struct nlattr *mp_attr;
 	struct rta_mfc_stats mfcs;
+	struct rta_cacheinfo ci;
+	struct nlattr *mp_attr;
+	struct rtnexthop *nhp;
+	long delta;
+	int ct;
+
 
 	/* If cache is unresolved, don't try to parse IIF and OIF */
 	if (c->mfc_parent >= MAXVIFS)
@@ -2109,7 +2114,14 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
 	if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) < 0)
 		return -EMSGSIZE;
 
+	memset(&ci, 0, sizeof(ci));
+	delta = jiffies - c->mfc_un.res.lastuse;
+	/* rta_lastuse is 32 bit, we shouldn't wrap the age */
+	ci.rta_lastuse = min_t(u64, jiffies_delta_to_clock_t(delta), UINT_MAX);
+	if (nla_put(skb, RTA_CACHEINFO, sizeof(ci), &ci) < 0)
+		return -EMSGSIZE;
 	rtm->rtm_type = RTN_MULTICAST;
+
 	return 1;
 }
 
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index c7ca0f5d1a3b..6a5f1ca1dcca 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1500,6 +1500,7 @@ static int ip6mr_mfc_add(struct net *net, struct mr6_table *mrt,
 	c->mf6c_origin = mfc->mf6cc_origin.sin6_addr;
 	c->mf6c_mcastgrp = mfc->mf6cc_mcastgrp.sin6_addr;
 	c->mf6c_parent = mfc->mf6cc_parent;
+	c->mfc_un.res.lastuse = jiffies;
 	ip6mr_update_thresholds(mrt, c, ttls);
 	if (!mrtsock)
 		c->mfc_flags |= MFC_STATIC;
@@ -2092,6 +2093,7 @@ static void ip6_mr_forward(struct net *net, struct mr6_table *mrt,
 	vif = cache->mf6c_parent;
 	cache->mfc_un.res.pkt++;
 	cache->mfc_un.res.bytes += skb->len;
+	cache->mfc_un.res.lastuse = jiffies;
 
 	if (ipv6_addr_any(&cache->mf6c_origin) && true_vifi >= 0) {
 		struct mfc6_cache *cache_proxy;
@@ -2234,10 +2236,12 @@ int ip6_mr_input(struct sk_buff *skb)
 static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
 			       struct mfc6_cache *c, struct rtmsg *rtm)
 {
-	int ct;
-	struct rtnexthop *nhp;
-	struct nlattr *mp_attr;
 	struct rta_mfc_stats mfcs;
+	struct rta_cacheinfo ci;
+	struct nlattr *mp_attr;
+	struct rtnexthop *nhp;
+	long delta;
+	int ct;
 
 	/* If cache is unresolved, don't try to parse IIF and OIF */
 	if (c->mf6c_parent >= MAXMIFS)
@@ -2273,7 +2277,14 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
 	if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) < 0)
 		return -EMSGSIZE;
 
+	memset(&ci, 0, sizeof(ci));
+	delta = jiffies - c->mfc_un.res.lastuse;
+	/* rta_lastuse is 32 bit, we shouldn't wrap the age */
+	ci.rta_lastuse = min_t(u64, jiffies_delta_to_clock_t(delta), UINT_MAX);
+	if (nla_put(skb, RTA_CACHEINFO, sizeof(ci), &ci) < 0)
+		return -EMSGSIZE;
 	rtm->rtm_type = RTN_MULTICAST;
+
 	return 1;
 }
 
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next v2] net: ipmr/ip6mr: add support for keeping an entry age
  2016-07-14 15:08 [PATCH net-next] net: ipmr/ip6mr: add support for keeping an entry age Nikolay Aleksandrov
@ 2016-07-14 16:28 ` Nikolay Aleksandrov
  2016-07-16  5:56   ` David Miller
  2016-07-17  3:20   ` David Miller
  2016-07-15 23:19 ` [PATCH net-next] " Nikolay Aleksandrov
  1 sibling, 2 replies; 7+ messages in thread
From: Nikolay Aleksandrov @ 2016-07-14 16:28 UTC (permalink / raw)
  To: netdev
  Cc: Nikolay Aleksandrov, Roopa Prabhu, Shrijeet Mukherjee,
	Satish Ashok, Donald Sharp, David S. Miller, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy

In preparation for hardware offloading of ipmr/ip6mr we need an
interface that allows to check (and later update) the age of entries.
Relying on stats alone can show activity but not actual age of the entry,
furthermore when there're tens of thousands of entries a lot of the
hardware implementations only support "hit" bits which are cleared on
read to denote that the entry was active and shouldn't be aged out,
these can then be naturally translated into age timestamp and will be
compatible with the software forwarding age. Using a lastuse entry doesn't
affect performance because the members in that cache line are written to
along with the age.
Since all new users are encouraged to use ipmr via netlink, this is
exported via the RTA_EXPIRES attribute.
Also do a minor local variable declaration style adjustment - arrange them
longest to shortest.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: Shrijeet Mukherjee <shm@cumulusnetworks.com>
CC: Satish Ashok <sashok@cumulusnetworks.com>
CC: Donald Sharp <sharpd@cumulusnetworks.com>
CC: David S. Miller <davem@davemloft.net>
CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
CC: James Morris <jmorris@namei.org>
CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
CC: Patrick McHardy <kaber@trash.net>
---
v2: Just reuse RTA_EXPIRES instead to minimize the attr size and simplify,
others will be added when needed

 include/linux/mroute.h  |  1 +
 include/linux/mroute6.h |  1 +
 net/ipv4/ipmr.c         | 13 +++++++++----
 net/ipv6/ip6mr.c        | 13 +++++++++----
 4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index bf9b322cb0b0..d351fd3e1049 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -104,6 +104,7 @@ struct mfc_cache {
 			unsigned long bytes;
 			unsigned long pkt;
 			unsigned long wrong_if;
+			unsigned long lastuse;
 			unsigned char ttls[MAXVIFS];	/* TTL thresholds		*/
 		} res;
 	} mfc_un;
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index 66982e764051..3987b64040c5 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -92,6 +92,7 @@ struct mfc6_cache {
 			unsigned long bytes;
 			unsigned long pkt;
 			unsigned long wrong_if;
+			unsigned long lastuse;
 			unsigned char ttls[MAXMIFS];	/* TTL thresholds		*/
 		} res;
 	} mfc_un;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 5ad48ec77710..e0d76f5f0113 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1150,6 +1150,7 @@ static int ipmr_mfc_add(struct net *net, struct mr_table *mrt,
 	c->mfc_origin = mfc->mfcc_origin.s_addr;
 	c->mfc_mcastgrp = mfc->mfcc_mcastgrp.s_addr;
 	c->mfc_parent = mfc->mfcc_parent;
+	c->mfc_un.res.lastuse = jiffies;
 	ipmr_update_thresholds(mrt, c, mfc->mfcc_ttls);
 	if (!mrtsock)
 		c->mfc_flags |= MFC_STATIC;
@@ -1792,6 +1793,7 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 	vif = cache->mfc_parent;
 	cache->mfc_un.res.pkt++;
 	cache->mfc_un.res.bytes += skb->len;
+	cache->mfc_un.res.lastuse = jiffies;
 
 	if (cache->mfc_origin == htonl(INADDR_ANY) && true_vifi >= 0) {
 		struct mfc_cache *cache_proxy;
@@ -2071,10 +2073,10 @@ drop:
 static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
 			      struct mfc_cache *c, struct rtmsg *rtm)
 {
-	int ct;
-	struct rtnexthop *nhp;
-	struct nlattr *mp_attr;
 	struct rta_mfc_stats mfcs;
+	struct nlattr *mp_attr;
+	struct rtnexthop *nhp;
+	int ct;
 
 	/* If cache is unresolved, don't try to parse IIF and OIF */
 	if (c->mfc_parent >= MAXVIFS)
@@ -2106,7 +2108,10 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb,
 	mfcs.mfcs_packets = c->mfc_un.res.pkt;
 	mfcs.mfcs_bytes = c->mfc_un.res.bytes;
 	mfcs.mfcs_wrong_if = c->mfc_un.res.wrong_if;
-	if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) < 0)
+	if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) ||
+	    nla_put_u64_64bit(skb, RTA_EXPIRES,
+			      jiffies_to_clock_t(c->mfc_un.res.lastuse),
+			      RTA_PAD))
 		return -EMSGSIZE;
 
 	rtm->rtm_type = RTN_MULTICAST;
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index c7ca0f5d1a3b..7adce139d92a 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1500,6 +1500,7 @@ static int ip6mr_mfc_add(struct net *net, struct mr6_table *mrt,
 	c->mf6c_origin = mfc->mf6cc_origin.sin6_addr;
 	c->mf6c_mcastgrp = mfc->mf6cc_mcastgrp.sin6_addr;
 	c->mf6c_parent = mfc->mf6cc_parent;
+	c->mfc_un.res.lastuse = jiffies;
 	ip6mr_update_thresholds(mrt, c, ttls);
 	if (!mrtsock)
 		c->mfc_flags |= MFC_STATIC;
@@ -2092,6 +2093,7 @@ static void ip6_mr_forward(struct net *net, struct mr6_table *mrt,
 	vif = cache->mf6c_parent;
 	cache->mfc_un.res.pkt++;
 	cache->mfc_un.res.bytes += skb->len;
+	cache->mfc_un.res.lastuse = jiffies;
 
 	if (ipv6_addr_any(&cache->mf6c_origin) && true_vifi >= 0) {
 		struct mfc6_cache *cache_proxy;
@@ -2234,10 +2236,10 @@ int ip6_mr_input(struct sk_buff *skb)
 static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
 			       struct mfc6_cache *c, struct rtmsg *rtm)
 {
-	int ct;
-	struct rtnexthop *nhp;
-	struct nlattr *mp_attr;
 	struct rta_mfc_stats mfcs;
+	struct nlattr *mp_attr;
+	struct rtnexthop *nhp;
+	int ct;
 
 	/* If cache is unresolved, don't try to parse IIF and OIF */
 	if (c->mf6c_parent >= MAXMIFS)
@@ -2270,7 +2272,10 @@ static int __ip6mr_fill_mroute(struct mr6_table *mrt, struct sk_buff *skb,
 	mfcs.mfcs_packets = c->mfc_un.res.pkt;
 	mfcs.mfcs_bytes = c->mfc_un.res.bytes;
 	mfcs.mfcs_wrong_if = c->mfc_un.res.wrong_if;
-	if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) < 0)
+	if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) ||
+	    nla_put_u64_64bit(skb, RTA_EXPIRES,
+			      jiffies_to_clock_t(c->mfc_un.res.lastuse),
+			      RTA_PAD))
 		return -EMSGSIZE;
 
 	rtm->rtm_type = RTN_MULTICAST;
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next] net: ipmr/ip6mr: add support for keeping an entry age
  2016-07-14 15:08 [PATCH net-next] net: ipmr/ip6mr: add support for keeping an entry age Nikolay Aleksandrov
  2016-07-14 16:28 ` [PATCH net-next v2] " Nikolay Aleksandrov
@ 2016-07-15 23:19 ` Nikolay Aleksandrov
  1 sibling, 0 replies; 7+ messages in thread
From: Nikolay Aleksandrov @ 2016-07-15 23:19 UTC (permalink / raw)
  To: netdev
  Cc: Roopa Prabhu, Shrijeet Mukherjee, Satish Ashok, Donald Sharp,
	David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy


> On Jul 14, 2016, at 8:08 AM, Nikolay Aleksandrov <nikolay@cumulusnetworks.com> wrote:
> 
> In preparation for hardware offloading of ipmr/ip6mr we need an
> interface that allows to check (and later update) the age of entries.
> Relying on stats alone can show activity but not actual age of the entry,
> furthermore when there're tens of thousands of entries a lot of the
> hardware implementations only support "hit" bits which are cleared on
> read to denote that the entry was active and shouldn't be aged out,
> these can then be naturally translated into age timestamp and will be
> compatible with the software forwarding age. Using a lastuse entry doesn't
> affect performance because the entries in that cache line are written to
> along with the age. Once an entry goes above the member size (32 bits) we
> keep it at UINT_MAX as we cannot afford to wrap it which will falsely show
> that it was used recently. This is not supposed to happen as entries should
> be aged out in matter of minutes or seconds.
> Since all new users are encouraged to use ipmr via netlink, this is
> exported via the RTA_CACHEINFO attribute which has rta_lastuse entry.
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> CC: Shrijeet Mukherjee <shm@cumulusnetworks.com>
> CC: Satish Ashok <sashok@cumulusnetworks.com>
> CC: Donald Sharp <sharpd@cumulusnetworks.com>
> CC: David S. Miller <davem@davemloft.net>
> CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> CC: James Morris <jmorris@namei.org>
> CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> CC: Patrick McHardy <kaber@trash.net>
> —

Self-NAK, I’ll send a revised v2 version using a single u32 attribute (RTA_EXPIRES), no need to waste the space
right now. We’ll add more as we need them.

Sorry for the noise.

Cheers,
 Nik

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v2] net: ipmr/ip6mr: add support for keeping an entry age
  2016-07-14 16:28 ` [PATCH net-next v2] " Nikolay Aleksandrov
@ 2016-07-16  5:56   ` David Miller
  2016-07-16  6:11     ` Nikolay Aleksandrov
  2016-07-17  3:20   ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2016-07-16  5:56 UTC (permalink / raw)
  To: nikolay
  Cc: netdev, roopa, shm, sashok, sharpd, kuznet, jmorris, yoshfuji, kaber

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Thu, 14 Jul 2016 19:28:27 +0300

> In preparation for hardware offloading of ipmr/ip6mr we need an
> interface that allows to check (and later update) the age of entries.
> Relying on stats alone can show activity but not actual age of the entry,
> furthermore when there're tens of thousands of entries a lot of the
> hardware implementations only support "hit" bits which are cleared on
> read to denote that the entry was active and shouldn't be aged out,
> these can then be naturally translated into age timestamp and will be
> compatible with the software forwarding age. Using a lastuse entry doesn't
> affect performance because the members in that cache line are written to
> along with the age.
> Since all new users are encouraged to use ipmr via netlink, this is
> exported via the RTA_EXPIRES attribute.
> Also do a minor local variable declaration style adjustment - arrange them
> longest to shortest.
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> CC: Shrijeet Mukherjee <shm@cumulusnetworks.com>
> CC: Satish Ashok <sashok@cumulusnetworks.com>
> CC: Donald Sharp <sharpd@cumulusnetworks.com>
> CC: David S. Miller <davem@davemloft.net>
> CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> CC: James Morris <jmorris@namei.org>
> CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> CC: Patrick McHardy <kaber@trash.net>
> ---
> v2: Just reuse RTA_EXPIRES instead to minimize the attr size and simplify,
> others will be added when needed

Why are your dates on these changes in the past?

Having them in the past messes up the ordering on patchwork because
patchwork orders incoming patches by date, and therefore I can't just
look at the first page to see "newer" submissions.

So please don't do whatever propagates commit dates into your emails,
or whatever is causing this problem.  It's best always to use the
current time.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v2] net: ipmr/ip6mr: add support for keeping an entry age
  2016-07-16  5:56   ` David Miller
@ 2016-07-16  6:11     ` Nikolay Aleksandrov
  2016-07-16  6:21       ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Nikolay Aleksandrov @ 2016-07-16  6:11 UTC (permalink / raw)
  To: David Miller
  Cc: Linux Kernel Network Developers, roopa, shm, sashok, sharpd,
	kuznet, jmorris, yoshfuji, kaber


> On Jul 15, 2016, at 10:56 PM, David Miller <davem@davemloft.net> wrote:
> 
> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Date: Thu, 14 Jul 2016 19:28:27 +0300
> 
>> In preparation for hardware offloading of ipmr/ip6mr we need an
>> interface that allows to check (and later update) the age of entries.
>> Relying on stats alone can show activity but not actual age of the entry,
>> furthermore when there're tens of thousands of entries a lot of the
>> hardware implementations only support "hit" bits which are cleared on
>> read to denote that the entry was active and shouldn't be aged out,
>> these can then be naturally translated into age timestamp and will be
>> compatible with the software forwarding age. Using a lastuse entry doesn't
>> affect performance because the members in that cache line are written to
>> along with the age.
>> Since all new users are encouraged to use ipmr via netlink, this is
>> exported via the RTA_EXPIRES attribute.
>> Also do a minor local variable declaration style adjustment - arrange them
>> longest to shortest.
>> 
>> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
>> CC: Shrijeet Mukherjee <shm@cumulusnetworks.com>
>> CC: Satish Ashok <sashok@cumulusnetworks.com>
>> CC: Donald Sharp <sharpd@cumulusnetworks.com>
>> CC: David S. Miller <davem@davemloft.net>
>> CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
>> CC: James Morris <jmorris@namei.org>
>> CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
>> CC: Patrick McHardy <kaber@trash.net>
>> ---
>> v2: Just reuse RTA_EXPIRES instead to minimize the attr size and simplify,
>> others will be added when needed
> 
> Why are your dates on these changes in the past?
> 
> Having them in the past messes up the ordering on patchwork because
> patchwork orders incoming patches by date, and therefore I can't just
> look at the first page to see "newer" submissions.
> 
> So please don't do whatever propagates commit dates into your emails,
> or whatever is causing this problem.  It's best always to use the
> current time.

Hmm, it seems my VM has its time zone messed up and since I’m in California right now the dates
come out wrong. Sorry about that, would you like me to resubmit the patch ?

Thanks,
 Nik

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v2] net: ipmr/ip6mr: add support for keeping an entry age
  2016-07-16  6:11     ` Nikolay Aleksandrov
@ 2016-07-16  6:21       ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2016-07-16  6:21 UTC (permalink / raw)
  To: nikolay
  Cc: netdev, roopa, shm, sashok, sharpd, kuznet, jmorris, yoshfuji, kaber

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Fri, 15 Jul 2016 23:11:15 -0700

> Sorry about that, would you like me to resubmit the patch ?

That's not necessary.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v2] net: ipmr/ip6mr: add support for keeping an entry age
  2016-07-14 16:28 ` [PATCH net-next v2] " Nikolay Aleksandrov
  2016-07-16  5:56   ` David Miller
@ 2016-07-17  3:20   ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2016-07-17  3:20 UTC (permalink / raw)
  To: nikolay
  Cc: netdev, roopa, shm, sashok, sharpd, kuznet, jmorris, yoshfuji, kaber

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Thu, 14 Jul 2016 19:28:27 +0300

> In preparation for hardware offloading of ipmr/ip6mr we need an
> interface that allows to check (and later update) the age of entries.
> Relying on stats alone can show activity but not actual age of the entry,
> furthermore when there're tens of thousands of entries a lot of the
> hardware implementations only support "hit" bits which are cleared on
> read to denote that the entry was active and shouldn't be aged out,
> these can then be naturally translated into age timestamp and will be
> compatible with the software forwarding age. Using a lastuse entry doesn't
> affect performance because the members in that cache line are written to
> along with the age.
> Since all new users are encouraged to use ipmr via netlink, this is
> exported via the RTA_EXPIRES attribute.
> Also do a minor local variable declaration style adjustment - arrange them
> longest to shortest.
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> CC: Shrijeet Mukherjee <shm@cumulusnetworks.com>
> CC: Satish Ashok <sashok@cumulusnetworks.com>
> CC: Donald Sharp <sharpd@cumulusnetworks.com>
> CC: David S. Miller <davem@davemloft.net>
> CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
> CC: James Morris <jmorris@namei.org>
> CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> CC: Patrick McHardy <kaber@trash.net>
> ---
> v2: Just reuse RTA_EXPIRES instead to minimize the attr size and simplify,
> others will be added when needed

Applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-07-17  3:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 15:08 [PATCH net-next] net: ipmr/ip6mr: add support for keeping an entry age Nikolay Aleksandrov
2016-07-14 16:28 ` [PATCH net-next v2] " Nikolay Aleksandrov
2016-07-16  5:56   ` David Miller
2016-07-16  6:11     ` Nikolay Aleksandrov
2016-07-16  6:21       ` David Miller
2016-07-17  3:20   ` David Miller
2016-07-15 23:19 ` [PATCH net-next] " Nikolay Aleksandrov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.