From owner-svn-src-all@FreeBSD.ORG Mon Jan 21 08:12:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E770C242; Mon, 21 Jan 2013 08:12:59 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CFE4E1D9; Mon, 21 Jan 2013 08:12:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0L8Cxw5022658; Mon, 21 Jan 2013 08:12:59 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0L8Cxb4022656; Mon, 21 Jan 2013 08:12:59 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301210812.r0L8Cxb4022656@svn.freebsd.org> From: Neel Natu Date: Mon, 21 Jan 2013 08:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245740 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 21 Jan 2013 08:13:00 -0000 Author: neel Date: Mon Jan 21 08:12:59 2013 New Revision: 245740 URL: http://svnweb.freebsd.org/changeset/base/245740 Log: Get rid of redundant 'table_size' field in struct pi_msix. If needed it can always be calculated from the number of entries in the MSI-X table. Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_passthru.c Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Mon Jan 21 07:50:38 2013 (r245739) +++ head/usr.sbin/bhyve/pci_emul.h Mon Jan 21 08:12:59 2013 (r245740) @@ -119,7 +119,6 @@ struct pci_devinst { int table_bar; int pba_bar; size_t table_offset; - size_t table_size; int table_count; size_t pba_offset; struct msix_table_entry table[MAX_MSIX_TABLE_SIZE]; Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Mon Jan 21 07:50:38 2013 (r245739) +++ head/usr.sbin/bhyve/pci_passthru.c Mon Jan 21 08:12:59 2013 (r245740) @@ -362,11 +362,10 @@ init_msix_table(struct vmctx *ctx, struc * XXX for now, assume that the table is not in the middle */ table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; - pi->pi_msix.table_size = table_size; idx = pi->pi_msix.table_bar; /* Round up to page size */ - table_size = (table_size + 0x1000) & ~0xFFF; + table_size = roundup2(table_size, 4096); if (pi->pi_msix.table_offset == 0) { /* Map everything after the MSI-X table */ start = pi->pi_bar[idx].addr + table_size;