]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
netinet: simplify RSS ifdef statements
authorFranco Fichtner <franco@opnsense.org>
Tue, 8 Feb 2022 02:22:03 +0000 (19:22 -0700)
committerKevin Bowling <kbowling@FreeBSD.org>
Thu, 3 Mar 2022 15:56:22 +0000 (08:56 -0700)
Approved by: transport (rrs)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D31583

(cherry picked from commit 47ded797ce9620f055f005e9dccfcd03613b1804)

sys/netinet/tcp_hpts.c
sys/netinet/tcp_timer.c

index 9ec092f703ec8a44675b0da629a0abc503674d97..d18c9db358d2685c446617803fc97c2d87ed7930 100644 (file)
@@ -1165,7 +1165,7 @@ static uint16_t
 hpts_cpuid(struct inpcb *inp, int *failed)
 {
        u_int cpuid;
-#if !defined(RSS) && defined(NUMA)
+#ifdef NUMA
        struct hpts_domain_info *di;
 #endif
 
@@ -1197,7 +1197,7 @@ hpts_cpuid(struct inpcb *inp, int *failed)
                return (hpts_random_cpu(inp));
        else
                return (cpuid);
-#else
+#endif
        /*
         * We don't have a flowid -> cpuid mapping, so cheat and just map
         * unknown cpuids to curcpu.  Not the best, but apparently better
@@ -1220,7 +1220,6 @@ hpts_cpuid(struct inpcb *inp, int *failed)
                cpuid = inp->inp_flowid % mp_ncpus;
        counter_u64_add(cpu_uses_flowid, 1);
        return (cpuid);
-#endif
 }
 
 static void
index 139e321725317e7234a36d9941829f636bddd2f4..96b95ab1c15f2da6e4be4b1dbb9b6cfe5bd48961 100644 (file)
@@ -210,17 +210,14 @@ inp_to_cpuid(struct inpcb *inp)
 {
        u_int cpuid;
 
-#ifdef RSS
        if (per_cpu_timers) {
+#ifdef RSS
                cpuid = rss_hash2cpuid(inp->inp_flowid, inp->inp_flowtype);
                if (cpuid == NETISR_CPUID_NONE)
                        return (curcpu);        /* XXX */
                else
                        return (cpuid);
-       }
-#else
-       /* Legacy, pre-RSS behaviour */
-       if (per_cpu_timers) {
+#endif
                /*
                 * We don't have a flowid -> cpuid mapping, so cheat and
                 * just map unknown cpuids to curcpu.  Not the best, but
@@ -230,10 +227,7 @@ inp_to_cpuid(struct inpcb *inp)
                if (! CPU_ABSENT(cpuid))
                        return (cpuid);
                return (curcpu);
-       }
-#endif
-       /* Default for RSS and non-RSS - cpuid 0 */
-       else {
+       } else {
                return (0);
        }
 }