Compare commits

..
Author SHA1 Message Date
Michal Kubecek 3e4c733354 vmnet: use standard definition of PCI_VENDOR_ID_VMWARE_VMXNET3 if available
The PCI_DEVICE_ID_VMWARE_VMXNET3 macro is defined in mainline pci_ids.h
since commit b1226c7db1d9 ("vmxnet3: Move PCI Id to pci_ids.h") in
v4.10-rc1.
2017-09-30 20:35:12 +02:00
Michal Kubecek b6b6405b2c vmnet: use standard definition of PCI_VENDOR_ID_VMWARE if available
The PCI_VENDOR_ID_VMWARE macro is defined in mainline pci_ids.h since
commit 94e57fea6202 ("PCI: Move PCI_VENDOR_ID_VMWARE to pci_ids.h")
in v3.18-rc1.
2017-09-30 20:34:43 +02:00
5 changed files with 22 additions and 68 deletions

No files matched your search

+10 -27
View File
@@ -1516,35 +1516,18 @@ HostIF_EstimateLockedPageLimit(const VMDriver* vm, // IN
unsigned int reservedPages = MEMDEFAULTS_MIN_HOST_PAGES;
unsigned int hugePages = (vm == NULL) ? 0 :
BYTES_2_PAGES(vm->memInfo.hugePageBytes);
unsigned int lockedPages = hugePages + reservedPages;
unsigned int anonPages;
unsigned int lockedPages = global_page_state(NR_PAGETABLE) +
global_page_state(NR_SLAB_UNRECLAIMABLE) +
global_page_state(NR_UNEVICTABLE) +
hugePages + reservedPages;
unsigned int anonPages =
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
global_page_state(NR_ANON_MAPPED);
#else
global_page_state(NR_ANON_PAGES);
#endif
unsigned int swapPages = BYTES_2_PAGES(linuxState.swapSize);
/* global_page_state is global_zone_page_state in 4.14. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
lockedPages += global_zone_page_state(NR_PAGETABLE);
#else
lockedPages += global_page_state(NR_PAGETABLE);
#endif
/* NR_SLAB_* moved from zone to node in 4.13. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
lockedPages += global_node_page_state(NR_SLAB_UNRECLAIMABLE);
#else
lockedPages += global_page_state(NR_SLAB_UNRECLAIMABLE);
#endif
/* NR_UNEVICTABLE moved from global to node in 4.8. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
lockedPages += global_node_page_state(NR_UNEVICTABLE);
#else
lockedPages += global_page_state(NR_UNEVICTABLE);
#endif
/* NR_ANON_MAPPED moved & changed name in 4.8. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
anonPages = global_node_page_state(NR_ANON_MAPPED);
#else
anonPages = global_page_state(NR_ANON_PAGES);
#endif
if (anonPages > swapPages) {
lockedPages += anonPages - swapPages;
}
-1
View File
@@ -20,7 +20,6 @@
INCLUDE := -I$(SRCROOT)
EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/netif_trans_update.c,-DVMW_NETIF_TRANS_UPDATE, )
obj-m += $(DRIVER).o
+3 -1
View File
@@ -337,7 +337,9 @@ typedef netdev_features_t compat_netdev_features_t;
typedef u32 compat_netdev_features_t;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) || defined(VMW_NETIF_TRANS_UPDATE)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) || \
(defined(RHEL_RELEASE_CODE) && RHEL_RELEASE_CODE >= 0x0704) || \
(defined(CONFIG_SUSE_KERNEL) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 73))
#define compat_netif_trans_update(d) netif_trans_update(d)
#else
#define compat_netif_trans_update(d) do { (d)->trans_start = jiffies; } while (0)
-39
View File
@@ -1,39 +0,0 @@
/*********************************************************
* Copyright (C) 2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 and no later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*********************************************************/
/*
* Detect whether there is netif_trans_update, which got introduced from 4.7.0
* Older kernels may have this function backported by vendors.
*/
#include "compat_version.h"
#include "compat_autoconf.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
# error This compile test intentionally fails.
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)
#include <linux/netdevice.h>
void test_netif_trans_update(struct net_device *dev)
{
netif_trans_update(dev);
}
#endif
+9
View File
@@ -35,6 +35,8 @@
#endif
#endif
#include <linux/pci_ids.h>
/* LSILogic 53C1030 Parallel SCSI controller
* LSILogic SAS1068 SAS controller
*/
@@ -53,7 +55,10 @@
* VMware HD Audio codec
* VMware HD Audio controller
*/
#ifndef PCI_VENDOR_ID_VMWARE
#define PCI_VENDOR_ID_VMWARE 0x15AD
#endif
#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405
#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710
#define PCI_DEVICE_ID_VMWARE_VGA 0x0711
@@ -70,7 +75,11 @@
#define PCI_DEVICE_ID_VMWARE_1394 0x0780
#define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790
#define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0
#ifndef PCI_DEVICE_ID_VMWARE_VMXNET3
#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0
#endif
#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0
#define PCI_DEVICE_ID_VMWARE_82574 0x07D0
#define PCI_DEVICE_ID_VMWARE_AHCI 0x07E0