From owner-freebsd-hackers@freebsd.org Tue Mar 5 11:11:13 2019 Return-Path: Delivered-To: freebsd-hackers@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 D14C615267E3 for ; Tue, 5 Mar 2019 11:11:13 +0000 (UTC) (envelope-from shreyankfbsd@gmail.com) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (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 BE48D8D2EB for ; Tue, 5 Mar 2019 11:11:12 +0000 (UTC) (envelope-from shreyankfbsd@gmail.com) Received: by mail-yw1-xc2b.google.com with SMTP id z191so6632624ywa.6 for ; Tue, 05 Mar 2019 03:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=ZJ2lKYolBUTkXCV9yzqz7A3os4X3qabD3/CzWVeXWX8=; b=hn+S3G75eJOWHQZdIv2XdsfL1SRHYkh4srRwzr3TnJWVK3DzU+6EKPapXwixmmuwVh Rv6vMGKKDX77QiqUzBDlIuUwzIXafU6wbtOaHrf9i/7GZaz7+d1+beGCgvvlVbQIr1As mrCP8hC///WdhQa7kLA0pNBijhLDmICOc/VMLs0G/2tVpAjV3nGcMEUSrVM4AGlirYqr 4Gi1Mh52ocejV8j4lBIjlFc9iXurdgWRHDrUyRWZ5VaVwZ+ezDaLXXYXRg1Xgq85XFRv NQa3daD/PQdhN/aK2PVTjkVP1TSW3N34La6efgE+sqhPosrAuV9FTi1xxpQB/yV01rHO kwaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=ZJ2lKYolBUTkXCV9yzqz7A3os4X3qabD3/CzWVeXWX8=; b=m6bNk5sNOEMz9RHr12nPY560/ULowdLn/cskWOj683razVuQVNpBPJhFinAH1gwMCl 4pzA4n8I56/dYGY9MOPgpgE7xzxkmvqw25ql89EmJ5YcB8bG1AEl4sVd8Xtc0pzXSqNo 4fFbad1SGFPXccdQ7cLkB9YtVyoQ18CTIaZjBH9KMBth/CHDT0NgWW5jwQ/Qso3au6oP FHBsoIbenG2eQiznNJYTv7dD4oQcs9O1M1DL+Oq77wPXcbQoj3BfO6RMdVeyGElHa9H2 LA6N+fcarUkyfVp66dVLp0b/OkVRCZZB1zfbqFacvMfME7JLZihN+hZRkm0wTCY0eHXE Gyqg== X-Gm-Message-State: APjAAAXXaPyTrbuSuMAeT3UAAvtC79MmBidyFf07ns/lqjlshcjJjSF3 LiK8gemjqFaKy4ALbA8QacmebeHAJ6WJ15j8PZJmI0E= X-Google-Smtp-Source: APXvYqzUpAsOYXeJkhqgflTjRdOPThVjIFZZmBYt1Uws4AL0oKoV+qjIbxkH0kBgZBHFrdx1a9ppKlLX9aYxfK4Jg+w= X-Received: by 2002:a0d:e082:: with SMTP id j124mr383939ywe.33.1551784272129; Tue, 05 Mar 2019 03:11:12 -0800 (PST) MIME-Version: 1.0 From: shreyank amartya Date: Tue, 5 Mar 2019 16:41:00 +0530 Message-ID: Subject: iflib MSI init To: mmacy@mattmacy.io Cc: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: BE48D8D2EB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=hn+S3G75; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of shreyankfbsd@gmail.com designates 2607:f8b0:4864:20::c2b as permitted sender) smtp.mailfrom=shreyankfbsd@gmail.com X-Spamd-Result: default: False [-6.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[b.2.c.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]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_SHORT(-0.51)[-0.515,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-2.88)[ip: (-9.66), ipnet: 2607:f8b0::/32(-2.66), asn: 15169(-2.00), country: US(-0.07)]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2019 11:11:14 -0000 Hi, I'm trying to initialize a network interface using iflib. While configuring MSI interrupts for the device, the number of vectors returned by the pci_msi_count is 32 (max supported) in my case due to which the condition (vectors == 1) fails and as a result legacy mode is selected. Is this intentional? In which case, how can I make sure number of MSI vectors is 1? /sys/net/iflib.c 6126 msi: 6127 vectors = pci_msi_count(dev); 6128 scctx->isc_nrxqsets = 1; 6129 scctx->isc_ntxqsets = 1; 6130 scctx->isc_vectors = vectors; 6131 if (vectors == 1 && pci_alloc_msi(dev, &vectors) == 0) { 6132 device_printf(dev,"Using an MSI interrupt\n"); 6133 scctx->isc_intr = IFLIB_INTR_MSI; 6134 } else { 6135 scctx->isc_vectors = 1; 6136 device_printf(dev,"Using a Legacy interrupt\n"); 6137 scctx->isc_intr = IFLIB_INTR_LEGACY; 6138 } 6139 6140 return (vectors); Thanks Shreyank Amartya