Re: Tuning NIC Performance?

From: Frank Leonhardt <freebsd-doc_at_fjl.co.uk>
Date: Mon, 17 Mar 2025 18:32:35 UTC
On 2025-03-14 14:01, Tim Daneliuk wrote:
> With the advent of higher and higher broadband speeds to the small
> business premise, I am finally seeing the limits of what some of the
> older NICs could do.
> 
> I recently solved a throughput problem on a FreeBSD NATing 
> firewall/gateway
> by replacing the onboard RealTek connection with a PCie-based Intel 1G 
> NIC.
> 
> Is there a resource somewhere that speaks to how I can further tune 
> these 1G
> NICs for best throughput?

Seeing as no one else has answered, here are my thoughts...

Not all Ethernet adapter chips are the same, and neither are FreeBSD 
Ethernet drivers. As you probably know, most Intel chips are better than 
most Realtek ones. That's why they usually cost more.

With better chips they're not necessarily faster but they do allow the 
OS to offload processing to the chip and the overall system runs faster. 
(I've tested various chips on an idling system and there's not much in 
it, but when things get going a server grade Ethernet doesn't slow down 
whereas a cheap Realtek degrades).

However, being able to offload work to the NIC only works if the driver 
knows how to do it. This makes the drivers more complex. Intel has good 
support. IIRC Intel sponsors driver creation, and in many case wrote the 
thing. For 10Gb, Chelsio chips were probably better five years ago but 
Intel now has good chips and I believe good support. But my rule of 
thumb was that if it mattered with FreeBSD, go Intel at 1G and Chelsio 
at 10G or above.

Now if you've got a well supported chip with a good driver it's probably 
going to be optimized anyway. Probably the only thing I'd say was worth 
fiddling with was the MTU - send some pings go for the highest where the 
packet doesn't get fragmented but you have to fiddle with the switch and 
so on. I guess this wasn't your question.

Have you tried looking in the man page for the ethernet card in 
question? Probably "man 4 em" if it's most Intel chips. Most tuning 
information can be found there, but don't go monkeying around if the 
machine is at a data centre and you're connected through it ;-)

Perhaps this bump will prompt an Ethernet tuning fanatic to add some 
more.

Regards, Frank.