From owner-svn-src-all@freebsd.org Tue Mar 5 22:06:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22D8715181C3 for ; Tue, 5 Mar 2019 22:06:04 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24E098B124 for ; Tue, 5 Mar 2019 22:06:03 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-ed1-f50.google.com with SMTP id a16so8597344edn.1 for ; Tue, 05 Mar 2019 14:06:03 -0800 (PST) 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:cc; bh=isPgUCUBgVDZw3lZCArQ73KKXEu1eDT1pQ/WeXH8Hm0=; b=JWV11mfLp5uguYEA40e3F7EOrFF3QyEY+uaFDL4sce23yNfp0uXP1wCONsZXVOa02p XfQES3+dYLUIcOiD8Jk9CV9hg4X6O1mkEMfptoU7xgjTY3IkZGj6FhzvWDZ0VTukJLjX TctdVIAzbz0xDGceGDM53cxcwBFDddaRKlhyfs0XO2y0Y/gKYFphkC9MF4yJwEdnaPxH BABPFb8QNQWKcrCt/AUGOPRIBQHdrbzZGCYfK5NzFagUGmAlRlLBvsRn2kGSdQmPrt47 RgdXrujBrFhZR6y/+7GgYiXZqPWK6jmYxFKe7fw+Ul8jW+b0JqjG9bBgxSUd990dDxAt 32hg== X-Gm-Message-State: APjAAAUJpx6xJRX2XJUWSHJvr8Kh8083hy8YIA85UXgKz1NnBlzDWp0P aDxeZ5yyCmRmd9j4w5FoAaQIXqwP X-Google-Smtp-Source: APXvYqy6UfVaz/yS65FmeaofFUivlbGtJkVldwfRDHvGBDrcRIHuHKtOXYaasjtD+1HIfBS06QRjZg== X-Received: by 2002:aa7:da0f:: with SMTP id r15mr21188878eds.34.1551823561392; Tue, 05 Mar 2019 14:06:01 -0800 (PST) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com. [209.85.221.50]) by smtp.gmail.com with ESMTPSA id d16sm1997840eja.67.2019.03.05.14.06.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2019 14:06:00 -0800 (PST) Received: by mail-wr1-f50.google.com with SMTP id l5so11158860wrw.6 for ; Tue, 05 Mar 2019 14:06:00 -0800 (PST) X-Received: by 2002:a05:6000:1252:: with SMTP id j18mr647409wrx.11.1551823559948; Tue, 05 Mar 2019 14:05:59 -0800 (PST) MIME-Version: 1.0 References: <5c7ee64f.1c69fb81.1168f.5802SMTPIN_ADDED_BROKEN@mx.google.com> In-Reply-To: <5c7ee64f.1c69fb81.1168f.5802SMTPIN_ADDED_BROKEN@mx.google.com> From: Eric Joyner Date: Tue, 5 Mar 2019 14:05:48 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r344817 - in head/sys: dev/e1000 net To: rgrimes@freebsd.org, Matthew Macy Cc: src-committers , svn-src-all , svn-src-head , Jacob Keller X-Rspamd-Queue-Id: 24E098B124 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ricera10@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=ricera10@gmail.com X-Spamd-Result: default: False [-5.41 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FORGED_SENDER(0.30)[erj@freebsd.org,ricera10@gmail.com]; MIME_TRACE(0.00)[0:+,1:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[erj@freebsd.org,ricera10@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(-2.41)[ip: (-6.13), ipnet: 209.85.128.0/17(-3.83), asn: 15169(-2.02), country: US(-0.07)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[50.208.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[50.208.85.209.rep.mailspike.net : 127.0.0.17] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2019 22:06:04 -0000 I'm cc'ing Jake so that he can provide a response. - Eric On Tue, Mar 5, 2019 at 1:12 PM Rodney W. Grimes wrote: > > This represents a misunderstanding of how defines are used. This left > > the option open to the user to enable the use of larger than page size > > buffers as it does enable better performance. Over the course of a > > long uptime memory can get too fragmented. However, this left it open > > to the end consumer. > > > > I'd like to see this reverted with perhaps a better name for the > > define and the addition of an explanatory comment. > > Thanks. > Yes please. > > Also, Matt, does it/would it work to stop the memory fragmentation issue > if we push the allocation up to the next page size and just waste the > 3k bytes? Some people might be willing to make that trade off to get > long up times and full 9k jumbo's. > > > Thanks, > Rod > > > -M > > > > On Tue, Mar 5, 2019 at 11:13 AM Eric Joyner wrote: > > > > > > Author: erj > > > Date: Tue Mar 5 19:12:51 2019 > > > New Revision: 344817 > > > URL: https://svnweb.freebsd.org/changeset/base/344817 > > > > > > Log: > > > Remove references to CONTIGMALLOC_WORKS in iflib and em > > > > > > From Jake: > > > "The iflib_fl_setup() function tries to pick various buffer sizes > based > > > on the max_frame_size value defined by the parent driver. However, > this > > > code was wrapped under CONTIGMALLOC_WORKS, which was never actually > > > defined anywhere. > > > > > > This same code pattern was used in if_em.c, likely trying to match > > > what iflib uses. > > > > > > Since CONTIGMALLOC_WORKS is not defined, remove this dead code from > > > iflib_fl_setup and if_em.c > > > > > > Given that various iflib drivers appear to be using a similar > > > calculation, it might be worth making this buffer size a value that > the > > > driver can peek at in the future." > > > > > > Submitted by: Jacob Keller > > > Reviewed by: shurd@ > > > MFC after: 1 week > > > Sponsored by: Intel Corporation > > > Differential Revision: https://reviews.freebsd.org/D19199 > > > > > > Modified: > > > head/sys/dev/e1000/if_em.c > > > head/sys/net/iflib.c > > > > > > Modified: head/sys/dev/e1000/if_em.c > > > > ============================================================================== > > > --- head/sys/dev/e1000/if_em.c Tue Mar 5 19:08:37 2019 > (r344816) > > > +++ head/sys/dev/e1000/if_em.c Tue Mar 5 19:12:51 2019 > (r344817) > > > @@ -1276,15 +1276,8 @@ em_if_init(if_ctx_t ctx) > > > */ > > > if (adapter->hw.mac.max_frame_size <= 2048) > > > adapter->rx_mbuf_sz = MCLBYTES; > > > -#ifndef CONTIGMALLOC_WORKS > > > else > > > adapter->rx_mbuf_sz = MJUMPAGESIZE; > > > -#else > > > - else if (adapter->hw.mac.max_frame_size <= 4096) > > > - adapter->rx_mbuf_sz = MJUMPAGESIZE; > > > - else > > > - adapter->rx_mbuf_sz = MJUM9BYTES; > > > -#endif > > > em_initialize_receive_unit(ctx); > > > > > > /* Use real VLAN Filter support? */ > > > > > > Modified: head/sys/net/iflib.c > > > > ============================================================================== > > > --- head/sys/net/iflib.c Tue Mar 5 19:08:37 2019 > (r344816) > > > +++ head/sys/net/iflib.c Tue Mar 5 19:12:51 2019 > (r344817) > > > @@ -2187,17 +2187,8 @@ iflib_fl_setup(iflib_fl_t fl) > > > */ > > > if (sctx->isc_max_frame_size <= 2048) > > > fl->ifl_buf_size = MCLBYTES; > > > -#ifndef CONTIGMALLOC_WORKS > > > else > > > fl->ifl_buf_size = MJUMPAGESIZE; > > > -#else > > > - else if (sctx->isc_max_frame_size <= 4096) > > > - fl->ifl_buf_size = MJUMPAGESIZE; > > > - else if (sctx->isc_max_frame_size <= 9216) > > > - fl->ifl_buf_size = MJUM9BYTES; > > > - else > > > - fl->ifl_buf_size = MJUM16BYTES; > > > -#endif > > > if (fl->ifl_buf_size > ctx->ifc_max_fl_buf_size) > > > ctx->ifc_max_fl_buf_size = fl->ifl_buf_size; > > > fl->ifl_cltype = m_gettype(fl->ifl_buf_size); > > > > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > >