svn commit: r290276 - head/sys/net

2015-11-02 Thread Randall Stewart
Author: rrs
Date: Mon Nov  2 21:21:00 2015
New Revision: 290276
URL: https://svnweb.freebsd.org/changeset/base/290276

Log:
  Fix three flowtable bugs, a) one lookup issue, b) a two cleaner issue.
  MFC after:3 days
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D4014

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cMon Nov  2 20:03:59 2015(r290275)
+++ head/sys/net/flowtable.cMon Nov  2 21:21:00 2015(r290276)
@@ -435,8 +435,7 @@ static int
 flow_stale(struct flowtable *ft, struct flentry *fle, int maxidle)
 {
 
-   if (((fle->f_rt->rt_flags & RTF_HOST) &&
-   ((fle->f_rt->rt_flags & (RTF_UP)) != (RTF_UP))) ||
+   if (((fle->f_rt->rt_flags & RTF_UP) == 0) ||
(fle->f_rt->rt_ifp == NULL) ||
!RT_LINK_IS_UP(fle->f_rt->rt_ifp) ||
(fle->f_lle->la_flags & LLE_VALID) == 0)
@@ -477,7 +476,7 @@ flow_matches(struct flentry *fle, uint32
CRITICAL_ASSERT(curthread);
 
/* Microoptimization for IPv4: don't use bcmp(). */
-   if (((keylen == sizeof(uint32_t) && (fle->f_key[0] != key[0])) ||
+   if (((keylen == sizeof(uint32_t) && (fle->f_key[0] == key[0])) ||
(bcmp(fle->f_key, key, keylen) == 0)) &&
fibnum == fle->f_fibnum &&
 #ifdef FLOWTABLE_HASH_ALL
@@ -818,8 +817,6 @@ flowtable_free_stale(struct flowtable *f
critical_exit();
 
bit_clear(tmpmask, curbit);
-   tmpmask += (curbit / 8);
-   tmpsize -= (curbit / 8) * 8;
bit_ffs(tmpmask, tmpsize, );
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r290276 - head/sys/net

2015-11-02 Thread Juli Mallett
On Mon, Nov 2, 2015 at 1:21 PM, Randall Stewart  wrote:

> Author: rrs
> Date: Mon Nov  2 21:21:00 2015
> New Revision: 290276
> URL: https://svnweb.freebsd.org/changeset/base/290276
>
> Log:
>   Fix three flowtable bugs, a) one lookup issue, b) a two cleaner issue.
>

This commit message is not helpful, but the review is; it seems like the
summary there might have been better for the commit message than naming the
number of bugs.  Should we assume the three hunks each fix a bug, or what?
What if there were four hunks, or two?  That kind of ambiguity and
obscurity is especially confusing as time passes.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"