From nobody Mon Aug 02 01:58:52 2021 X-Original-To: freebsd-net@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 03EC412D2486 for ; Mon, 2 Aug 2021 01:59:03 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdLlT5Z1Mz4Z9B; Mon, 2 Aug 2021 01:59:01 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 1721wqb4026306 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 1 Aug 2021 18:58:52 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 1721wq6q026305; Sun, 1 Aug 2021 18:58:52 -0700 (PDT) (envelope-from jmg) Date: Sun, 1 Aug 2021 18:58:52 -0700 From: John-Mark Gurney To: freebsd-net@FreeBSD.org Cc: erj@FreeBSD.org Subject: igb fc (aka flowcontrol) issue... Message-ID: <20210802015852.GF41029@funkthat.com> Mail-Followup-To: freebsd-net@FreeBSD.org, erj@FreeBSD.org List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sun, 01 Aug 2021 18:58:52 -0700 (PDT) X-Rspamd-Queue-Id: 4GdLlT5Z1Mz4Z9B X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-0.22 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jmg]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.58)[0.584]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; MAILMAN_DEST(0.00)[freebsd-net]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N I have a dual port igb card: igb0: port 0x2020-0x203f mem 0xd1020000-0xd103ffff,0xd0c00000-0xd0ffffff,0xd1044000-0xd1047fff irq 17 at device 0.0 on pci3 igb0: Using 1024 TX descriptors and 1024 RX descriptors igb0: Using 4 RX queues 4 TX queues igb0: Using MSI-X interrupts with 5 vectors igb0: Ethernet address: xxxx igb0: netmap queues/slots: TX 4/1024, RX 4/1024 igb1: port 0x2000-0x201f mem 0xd1000000-0xd101ffff,0xd0800000-0xd0bfffff,0xd1040000-0xd1043fff irq 18 at device 0.1 on pci3 igb1: Using 1024 TX descriptors and 1024 RX descriptors igb1: Using 4 RX queues 4 TX queues igb1: Using MSI-X interrupts with 5 vectors igb1: Ethernet address: xxxx igb1: netmap queues/slots: TX 4/1024, RX 4/1024 And I have observed an issue with it when adjusting flow control, it seems to adjust both ports at the same time: # sysctl dev.igb.0.fc dev.igb.0.fc: 3 # sysctl dev.igb.1.fc dev.igb.1.fc: 3 # sysctl dev.igb.0.fc=0 dev.igb.0.fc: 3 -> 0 # sysctl dev.igb.1.fc dev.igb.1.fc: 0 Is this correct behavior? Also, the fc sysctl is not documented, I propose the following: diff --git a/share/man/man4/em.4 b/share/man/man4/em.4 index a1fa22c..bad82e9 100644 --- a/share/man/man4/em.4 +++ b/share/man/man4/em.4 @@ -265,6 +265,26 @@ If is non-zero, this tunable limits the maximum delay in which a transmit interrupt is generated. .El +.Sh SYSCTL VARIABLES +The following variable is availabel: +.Bl -tag -width "dev.em.X.fc" +.It Va dev.em.X.fc +This sysctl sets the flow control for the card (this means both ports +on a dual port card). The values are as follows: +.Bl -tag -width "XX" -offset "XXXX" -compact +.It 0 +Disabled +.It 1 +Process received pause frames, do not transmit them. +.It 2 +Send pause frames, but to not process received frames. +.It 3 +Process and send pause frames. +.It 4 +No software override, use EEPROM configuration. +.El +.El +Note: That the variable is available for igb as well. .Sh FILES .Bl -tag -width /dev/led/em* .It Pa /dev/led/em* -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."