From owner-freebsd-net@freebsd.org Thu Feb 6 01:59:27 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 942FE2372DA for ; Thu, 6 Feb 2020 01:59:27 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 48ChSZ5mJyz4SQL for ; Thu, 6 Feb 2020 01:59:26 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pl1-x644.google.com with SMTP id a6so1659401plm.3 for ; Wed, 05 Feb 2020 17:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=0JngB+X9LY8HtvRtqgSbecD+Qph9UeKZxiB2+mSrFQk=; b=ggmsqFTPGxwsB53E6bWxjH9jlfDylp6Oz7pC0ZuycByOqRwpw5E05Qo38IHejXs+Ac CF3m8mCZ4459BS6kXXwNosBh/yJ64kgs+7hUGvwePvqflQFKwNzLxI9HmfZr4SVxv8nu kQNLp6Rwq6CrC4aHWzZJc0i9D6ZhdYDA34PKIC3r58yMKgCR15J5eQBDinU9bRSXNJ1i KadhCQHV9Eaw7oSLgB2bK0tfV38fjLgCXho+DnxQTAJfk60x9ekUp6QbS1Thyc7n+2uJ 54jDs1zdT0Ez37NBOym1+TwTCAPJdxF4pFIudorpsugHBDLtXWMajU2HMZ0i2XWWhviI Vh8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=0JngB+X9LY8HtvRtqgSbecD+Qph9UeKZxiB2+mSrFQk=; b=rVpBau4sHajrVt1q+kRnR71dYWqiKgObeommC6L1PYtk0Y+FMDmAZJ6e1RdA1cBpq9 /sUrLGFybCnyDIEgt4KCIEbp6dkMsLj3ntzCEr4vYKaUCrAdOKlU8VCOjUHo86AM9GoI jvY7QvDJsMwXSRyIPWRKE8KQPMfYjoez6l0b7u8IXegFyOeqXx6o2vMA/R4qG9TJjx7H O09Dp7Mwo7pK1Fd1gcP9/yPDtQCGi/VsKg9roIZNBZoUxIwtKuXfZAac5t7OjZaCoU4L Igye5ijiV/O+r7Cr9hP7/9vuPiH9mICtrUsLGWNJzMAIZ9z1nMIDi9a1Xi4aHCxcS2sR qTVQ== X-Gm-Message-State: APjAAAXNFksUaUFPOt3jpht0lZV7zXyofjmvTUWS6yawPxwHDpbCAldb 9Zjgx93xqZb3S9WeS8WQmAs1bADM X-Google-Smtp-Source: APXvYqwcLnPuA8lyfnSf7Q/PJF+oFtt/c5kXdl3Ha/rkD/gISKUSSEX+aGK4DD1CL3P8j142dboDqQ== X-Received: by 2002:a17:902:7b89:: with SMTP id w9mr1198295pll.46.1580954364761; Wed, 05 Feb 2020 17:59:24 -0800 (PST) Received: from x270 ([2601:641:c000:3700:80c9:613:5137:2928]) by smtp.gmail.com with ESMTPSA id e17sm831863pfm.12.2020.02.05.17.59.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Feb 2020 17:59:24 -0800 (PST) Sender: Navdeep Parhar Date: Wed, 5 Feb 2020 17:59:14 -0800 From: Navdeep Parhar To: Slawa Olhovchenkov Cc: freebsd-net@freebsd.org Subject: Re: Chelsio NETMAP performance Message-ID: <20200206015914.GA7071@x270> Mail-Followup-To: Slawa Olhovchenkov , freebsd-net@freebsd.org References: <20200203201728.GC8028@zxy.spb.ru> <863de9e1-42cc-6f3a-5c1f-1bf737714c9f@FreeBSD.org> <20200203222321.GB8012@zxy.spb.ru> <6868f207-d054-3d45-b60d-eaf7115760c1@FreeBSD.org> <20200204162005.GC8012@zxy.spb.ru> <3a8dfebd-aa26-84ad-a03a-0271b61a89a3@FreeBSD.org> <20200205113832.GE8012@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200205113832.GE8012@zxy.spb.ru> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 48ChSZ5mJyz4SQL X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ggmsqFTP; dmarc=none; spf=pass (mx1.freebsd.org: domain of nparhar@gmail.com designates 2607:f8b0:4864:20::644 as permitted sender) smtp.mailfrom=nparhar@gmail.com X-Spamd-Result: default: False [-2.58 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[4.4.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.88)[ip: (-0.61), ipnet: 2607:f8b0::/32(-1.98), asn: 15169(-1.74), country: US(-0.05)]; FORGED_SENDER(0.30)[np@FreeBSD.org,nparhar@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[np@FreeBSD.org,nparhar@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Feb 2020 01:59:27 -0000 On Wed, Feb 05, 2020 at 02:38:32PM +0300, Slawa Olhovchenkov wrote: > On Tue, Feb 04, 2020 at 12:37:08PM -0800, Navdeep Parhar wrote: > > > >> nm_holdoff_tmr_idx is a 0-based index into the list above. So if the > > >> tmr idx is 0 you are using the 0th (first) value from the list of > > >> timers. Try increasing nm_holdoff_tmr_idx and see if that brings down > > >> the interrupt rate under control. > > >> > > >> # sysctl hw.cxgbe.nm_holdoff_tmr_idx=3/4/5 > > > > > > OK, interrupt rate go down, but interrupt time about same. > > > (interrupt rate for intel card about 0, compared to 25% chelsio). > > > > I think iflib runs a lot of stuff in taskqueues rather than the driver > > ithread so the CPU accounting may vary. Use dtrace to see if > > Don't think this is impact: worker's CPU core w/o any syscalls and > only w/ bunding workker thread and NIC irq handler show about 100% > user CPU time. > > May be some cache-miss work performed later, at poll(2) time in case > of intel driver compared to chelsio (do at interrupt time)? Could be. While we are here, is it possible for you to try the patches in these two? https://reviews.freebsd.org/D17868 https://reviews.freebsd.org/D17869 > > > netmap_rx_irq is being called by an ithread or a taskqueue to figure out > > what driver does what. > > Can you explain some more? > I am not sure about dtrace probe to use and later evaluation # dtrace -n 'fbt::netmap_rx_irq:entry {stack()}' Take a look at the stack and see if it's an ithread or one of iflib's taskqueues that called netmap_rx_irq. Regards, Navdeep