aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranco Fichtner <franco@opnsense.org>2022-02-08 02:22:03 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2022-02-08 02:22:03 +0000
commit47ded797ce9620f055f005e9dccfcd03613b1804 (patch)
tree19716a9a20e3cc0e5c37963151e06b0b6d503521
parent511b83b167b02608a1f857fa2e0cc5fb3218e09d (diff)
downloadsrc-47ded797ce9620f055f005e9dccfcd03613b1804.tar.gz
src-47ded797ce9620f055f005e9dccfcd03613b1804.zip
netinet: simplify RSS ifdef statements
Approved by: transport (rrs) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D31583
-rw-r--r--sys/netinet/tcp_hpts.c5
-rw-r--r--sys/netinet/tcp_timer.c12
2 files changed, 5 insertions, 12 deletions
diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c
index 40747a238918..456abe53723a 100644
--- a/sys/netinet/tcp_hpts.c
+++ b/sys/netinet/tcp_hpts.c
@@ -1014,7 +1014,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
@@ -1040,7 +1040,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
@@ -1063,7 +1063,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
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index a3cb16869dc9..8594ad3a65fa 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -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);
}
}