From nobody Mon Aug 02 04:10:41 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 2020312D8AEF for ; Mon, 2 Aug 2021 04:11:02 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdPgn1PfPz4j6P for ; Mon, 2 Aug 2021 04:11:01 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-lf1-f44.google.com with SMTP id a26so31251326lfr.11 for ; Sun, 01 Aug 2021 21:11:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=5fODCknY2v7P3jse2LzBcmelkEVs+a4y+3YsVRZXaCI=; b=gDyAsg6b8/8ZdLUtM+FNF4OD9wJhpL3TcM6+ugEo8Inl9LcOPAofXX3OvHWK7LJeR1 Fdm6d67SNnJvJQdbMMROGUpXIeRyqRlPXfKIAxjgk2Nk8uICI08L185TS23RuSN1bpuv 0ZSLsr9hroaBYooJIDSONpIejzqDpcLl7Ys8TWMU9zxfzJD35axliaC/CfytLUedCTXh 1G1QwNEMN+Aa08u7p3zdbLMTcLZy0IEA7urYqadwwroGWwG4RX32PjLbvh7xMIYIZNgk sHZycqJS5KqvqiOC1UQN8h2mT92OhTQfqn3jCJaUg2zqlAbpF3fH7eOg3GIZILsjdj9e 6buQ== X-Gm-Message-State: AOAM530euiDPKV/+8ar8+FGo1o7Wlxk4J8EQJlgi5Gxhk8lAwollkNuL S0VAffKN92QH2rTC+dL97++djiszBaE= X-Google-Smtp-Source: ABdhPJzNGSbfICw2qj9DJkWZa4TGGvXFpb/uURoeHPmo/VRcmRMPe7Xe/sgAgZO1PDotuK2wKq78Tw== X-Received: by 2002:ac2:54b0:: with SMTP id w16mr6763438lfk.577.1627877453692; Sun, 01 Aug 2021 21:10:53 -0700 (PDT) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com. [209.85.167.51]) by smtp.gmail.com with ESMTPSA id f2sm743716ljq.131.2021.08.01.21.10.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Aug 2021 21:10:52 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id z2so31374367lft.1 for ; Sun, 01 Aug 2021 21:10:52 -0700 (PDT) X-Received: by 2002:a05:6512:218e:: with SMTP id b14mr10890719lft.178.1627877452424; Sun, 01 Aug 2021 21:10:52 -0700 (PDT) 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 References: <20210802015852.GF41029@funkthat.com> In-Reply-To: <20210802015852.GF41029@funkthat.com> From: Eric Joyner Date: Sun, 1 Aug 2021 21:10:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: igb fc (aka flowcontrol) issue... To: freebsd-net@freebsd.org Content-Type: multipart/alternative; boundary="0000000000004a38d105c88bc136" X-Rspamd-Queue-Id: 4GdPgn1PfPz4j6P X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ricera10@gmail.com designates 209.85.167.44 as permitted sender) smtp.mailfrom=ricera10@gmail.com X-Spamd-Result: default: False [-2.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.99)[-0.991]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.44:from,209.85.167.51:received]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[erj@freebsd.org,ricera10@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.44:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[erj@freebsd.org,ricera10@gmail.com]; MAILMAN_DEST(0.00)[freebsd-net] X-ThisMailContainsUnwantedMimeParts: Y --0000000000004a38d105c88bc136 Content-Type: text/plain; charset="UTF-8" On Sun, Aug 1, 2021 at 6:59 PM John-Mark Gurney wrote: > 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." > I was looking at the hardware specs to see a mention of it, but I didn't find anything. But looking at the code, I do see that in if_em.c's em_set_flowcntl(), the value "input" used in the output of the sysctl is a "static int". So it seems like if you set the value to 0, you're going to read 0 from it, even on the second port. That looks like a bug that needs to be fixed. And for the man page, that sysctl doesn't accept "4" as a valid value (unless you're going to add that?). I wouldn't put that flow control sets the value for both ports on the card, either. But otherwise, that seems reasonable to me. - Eric --0000000000004a38d105c88bc136--