From nobody Sat Dec 25 17:15:55 2021 X-Original-To: stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6E3F619116CB for ; Sat, 25 Dec 2021 17:16:17 +0000 (UTC) (envelope-from eugene@zhegan.in) Received: from elf.hq.norma.perm.ru (mail.norma.perm.ru [128.127.146.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.norma.perm.ru", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JLrDv6Vttz4XmW for ; Sat, 25 Dec 2021 17:16:15 +0000 (UTC) (envelope-from eugene@zhegan.in) Received: from [192.168.243.7] ([192.168.243.7]) by elf.hq.norma.perm.ru (8.16.1/8.15.2) with ESMTP id 1BPHDhOO034128 for ; Sat, 25 Dec 2021 22:13:44 +0500 (+05) (envelope-from eugene@zhegan.in) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=vivat-retail.ru; s=key; t=1640452424; bh=iXfJhFClOfEXWmfX3KZseXpA0MBcTQaWjwIWezNfZ5o=; h=Date:To:From:Subject; b=dr38SSNqyWAdgAewaoTKB0C/T3PQX6Xd5/iDK2j5COBZ2FTiYnzmZYn3Wqc/t9zos VLk8reLKHwgt9fq9sXe61FYkQjCrfsd/l5EalFc2RMfKlTjRDJ00wVi/D/lJUjEsVU n7jDBx0wG2T51194eGRurSd9h6aWMuNRX0L3tUOE= Message-ID: <480b9b6c-33d2-4eb3-c48c-aeee8ded7751@zhegan.in> Date: Sat, 25 Dec 2021 22:15:55 +0500 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 To: stable@freebsd.org Content-Language: ru From: "Eugene M. Zheganin" Subject: FreeBSD and interface errors/drops Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4JLrDv6Vttz4XmW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=fail ("headers rsa verify failed") header.d=vivat-retail.ru header.s=key header.b=dr38SSNq; dmarc=none; spf=pass (mx1.freebsd.org: domain of eugene@zhegan.in designates 128.127.146.8 as permitted sender) smtp.mailfrom=eugene@zhegan.in X-Spamd-Result: default: False [-0.45 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_DKIM_REJECT(1.00)[vivat-retail.ru:s=key]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[stable@freebsd.org]; NEURAL_SPAM_MEDIUM(0.84)[0.839]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-0.998]; DMARC_NA(0.00)[zhegan.in]; R_SPF_ALLOW(-0.20)[+a]; DKIM_TRACE(0.00)[vivat-retail.ru:-]; NEURAL_HAM_SHORT(-1.00)[-0.996]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:212494, ipnet:128.127.146.0/24, country:RU]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hello, I have a FreeBSD used as an office router for an organisation. It was installed years ago and its configuration is: - IBM system x3250m2 - 4 gigs RAM - Intel Xeon E3110 - two WDC WD5000AADS-0 in a zfs mirror. - bge(4) NetXtreme BCM5722 Gigabit Ethernet PCI Express, initially present - em(4) 82572EI Gigabit Ethernet Controller (Copper) adapter, added later This server is connected with both WAN and LAN using one bge(4) link to a Cisco catalyst 2960, comprising several vlans. After several years of running, starting from 10.x, when 12.2 was already installed for quite some time, I started having a huge number of input errors on an interface, that were increasing the dev.bge.0 counters like dev.bge.0.stats.InputDiscards Error input rate was changing from 0 (most of the time) to 6K-80K per second. The observed interface input rate was floating around 300 Mbps during it's peak. Sample of netstat -I bge0 1 showing the moment when there's bunch of errors and the amount of traffic:           input        bge0       output    packets errs idrops bytes packets errs bytes colls      20695 701 0 19244062 18182 0 17059035 0        929 61003 0 938482 438 0 118494 0       1383 44667 0 1094321 537 0 196633 0      11726 1 0 8904828 11560 0 9012153 0       6116 0 0 3991680 6051 0 4001106 0       4772 0 0 3210074 4769 0 3224114 0       9679 0 0 8507153 9622 0 8719630 0      12355 0 0 10212352 12251 0 10288762 0       2975 0 0 1457118 2946 0 1466755 0       4397 0 0 3051610 4377 0 3056513 0       4782 0 0 3405659 4806 0 3501414 0       9202 0 0 7891629 9204 0 8080658 0 The catalyst shows to output errors when this is happening on the port that FreeBSD is connected to. Recovery measures that I attempted and that failed to resolve the sutuation (one step at a time): - changed the patch cable from catalyst - changed the onboard port from 1 to 0 - started to suspect the onboard ethernet controller, added the Intel Pro/1000 MT external adapter via the riser card, error rate migrated into the dev.em.0.mac_stats.missed_packets counter, sometimes triggering the dev.em.0.mac_stats.recv_no_buff: dev.em.0.mac_stats.recv_no_buff: 9424 dev.em.0.mac_stats.missed_packets: 1853592 - added the iflib/netmap tuning: net.isr.numthreads="2" net.isr.maxthreads="2" dev.em.0.iflib.rx_budget="65535" dev.em.0.iflib.override_nrxds="4096" dev.em.0.iflib.override_ntxds="4096" dev.em.0.iflib.disable_msix="0" - added the interrupt moderation dev.em.0.rx_int_delay="200" dev.em.0.tx_int_delay="200" dev.em.0.rx_abs_int_delay="4000" dev.em.0.tx_abs_int_delay="4000" - tried to play with the kern.eventtimer kern.eventtimer.periodic="1" - compiled out the em(4) driver from the kernel to dynamically loading module - changed the module from stock one to the one from net/intel-em-kmod port (with netmap compiled out. at this point errors even stopped for almost a day, and I was quick enough to report this as a regression into the FreeBSD bugtracker (I closed the bug as misdiagnosed after realizing this didn't help)). - upgraded the system to the FreeBSD 13.0 I also noticed that there's no correlation between reboots and the error flow: sometimes the er    ror counter could start to increase right after booting, sometimes several hours could pass. After realizing there's no options left, we switched to router to the neighbor server running FreeBSD 12.1-STABLE (I don't suspect the version that much, it was just running it) and at this time the errors stopped (however the network adapter there is igb(4)). After removing the load from the x3250 we did a full memtest scan, which reported no errors during several passes (didn't suspect the memory to be the root cause anyway, since the old one was able to build the world successfully, which is almost impossible when havingg memory issues). So - the obvious question is - what can be the cause of such errors ? Lack of system memory (the only thing that comes to mind) ? The memory distribution is like (when idle): Mem: 38M Active, 751M Inact, 2122M Wired, 988M Free ARC: 1064M Total, 312M MFU, 426M MRU, 575K Anon, 32M Header, 275M Other      559M Compressed, 1750M Uncompressed, 3,13:1 Ratio Swap: 2048M Total, 2048M Free But when loaded, there's almost no free memory. However, I've checked the netstat -m, and it reports to mbums requests were denied. CPU isn't loaded like at all during the peak input rate, or during the momemnts of time when the errors starts to stack. Thanks. Eugene.