netif: Configure mbuf clusters/jclusters limits Default mbuf clusters limit work for most of the network device drivers. The drivers modified by this commit: - Use mbuf jclusters. - Size of the reception queues could be configured. - Support multiple reception queues. et(4) and mxge(4) are special; they use non-cluster mbuf for small packets reception, so we adjust non-cluster mbuf limit manually in these two drivers.
kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions. The main reason is that our having to use the MB_WAIT and MB_DONTWAIT flags was a recurring issue when porting drivers from FreeBSD because it tended to get forgotten and the code would compile anyway with the wrong constants. And since MB_WAIT and MB_DONTWAIT ended up as ocflags for an objcache_get() or objcache_reclaimlist call (which use M_WAITOK and M_NOWAIT), it was just one big converting back and forth with some sanitization in between. This commit allows M_* again for the mbuf functions and keeps the sanitizing as it was before: when M_WAITOK is among the passed flags, objcache functions will be called with M_WAITOK and when it is absent, they will be called with M_NOWAIT. All other flags are scrubbed by the MB_OCFLAG() macro which does the same as the former MBTOM(). Approved-by: dillon
ethernet: If caller thread cpu is fixed, pass cpuid to ether_input_pkt() So we could use optimized lwkt_sendmsg_oncpu() instead of lwkt_sendmsg(), if the target netisr is on the same cpu as caller thread cpu. Mainly to avoid unnecessary wakeup() IPIs to other cpus. THE RESULT: On i7-3770 w/ HT enabled (8 logical cpus); NIC is 82599ES w/ 8 RX rings and 8 TX rings. Run: repeat 10 tcp_stream -H ... -i 256 -l 10 -r (256 netperf TCP_MAERTS instances for 10 seconds, 10 rounds) Total amount of cross IPIs before this commit is 6946097. Total amount of cross IPIs as of this commit is 5445324. ~22% unnecessary wakeup() IPIs are avoided!
bnx: Merge several recent bge changes 57b622244562b2b67b60bc5eeecd498f5946d359 f2ccc3cdd409facd7b596fcc3f6157e3a7029df2 e6fdacca28b0af2f878e74dd2acc6f40288a4cb3 b87c703422a52f1b874b6f00516b7a096f826b6a 9062031ed71445ef2de9bf9b4e0d96fd6cdf9c34 cc224beafa386c6a9777d1a3296217d768ea7405 0bf9631eae999627c5ae189775a5fe4b1ee75280 d05296cfacc7c2847af2f475bfb374ddf5f985ac
kernel: Generate miidevs.h, pccarddevs.h and pcidevs.h on the fly. It removes the need to regenerate those header file after first editing the associated list of IDs (miidevs, pccarddevs or pcidevs). After this commit, editing the list alone is enough to add IDs. We already did it like that for usb4bsd's usbdevs.h before. This commit adjusts things for the remaining ID lists.
bnx: In polling mode, force chip update status block for status changes If the status block updating is not forced, we will always see staled status changes in polling mode, which causes bunch of unnecessary register reading. For status changes sharing status block with transmission, staled status changes probably won't linger for too much time, since any data transmit completion will cause status block to be updated. However, for status changes using its own status block, staled status changes will be there until the chips are stopped.
bnx: Optimize RX STD ring refilling scheduling At the end of the RX RET ring interrupt, the RX STD ring refilling is scheduled only when the number of consumed RX BDs are more then half of the RX STD ring size (256). This reduces the IPI rate on CPU that performs the RX STD ring refilling from ~17000ipis/s to ~4000ipis/s on the system with heavy network loading.
bnx: Implement multiple RX/TX rings and MSI-X support for 5718/57785 BCM5718 and BCM57785 families support 4 RX rings and 5 MSI-X vectors. Additionally BCM5719/BCM5720 support 4 TX rings, while other chips in these two families only support 1 TX ring. Each MSI-X vector has its own interrupt moderation parameters. Hardware supplied RSS hash and packet type are not utilized yet; they will be supported in the upcoming commits. This commit also fixes some RX standard ring refilling races introduced in: 841cdf08263117c54b0a800440c7630b6913c21e RX standard ring refilling scheduling may enjoy futher optimization.