Module Name: src Committed By: knakahara Date: Thu Jun 22 09:26:43 UTC 2017
Modified Files: src/sys/net: if_gif.c Log Message: I have forgotten to commit this gif(4) MP-ify patch for a long time, sorry. To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/sys/net/if_gif.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_gif.c diff -u src/sys/net/if_gif.c:1.126 src/sys/net/if_gif.c:1.127 --- src/sys/net/if_gif.c:1.126 Thu Jun 1 02:45:14 2017 +++ src/sys/net/if_gif.c Thu Jun 22 09:26:43 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gif.c,v 1.126 2017/06/01 02:45:14 chs Exp $ */ +/* $NetBSD: if_gif.c,v 1.127 2017/06/22 09:26:43 knakahara Exp $ */ /* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.126 2017/06/01 02:45:14 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.127 2017/06/22 09:26:43 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -608,7 +608,12 @@ gif_input(struct mbuf *m, int af, struct return; } - if (__predict_true(pktq_enqueue(pktq, m, 0))) { +#ifdef GIF_MPSAFE + const u_int h = curcpu()->ci_index; +#else + const uint32_t h = pktq_rps_hash(m); +#endif + if (__predict_true(pktq_enqueue(pktq, m, h))) { ifp->if_ibytes += pktlen; ifp->if_ipackets++; } else {