On Thursday 19 February 2009 01:35:43 Dominique Leuenberger wrote:
> >>> On 2/19/2009 at 10:06 AM, "Dominique Leuenberger"
>
> <dominique.leuenber...@tmf-group.com> wrote:
> > Hi,
> >
> > Just downloaded the latest tarball and trying to build the new rpms for
> > openSUSE. So far no luck. the vmxnet module seems not to be building
> > anymore:
> >
> > Build error:
> > + make -C /usr/src/linux-obj/i586/debug modules
> > M=/usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet VM_CCVER=4.3
> > HEADER_DIR=/usr/src/linux-obj/i386/default/include
> > SRCROOT=/usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet
> > make: Entering directory `/usr/src/linux-2.6.29-rc5-1-obj/i386/debug'
> > make -C ../../../linux-2.6.29-rc5-1
> > O=/usr/src/linux-2.6.29-rc5-1-obj/i386/debug/. modules
> > Using 2.6.x kernel build system.
> >   CC [M]  /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet/vmxnet.o
>
> Skipping vmxnet and testing what else happens, I also run into issues
> compiling vmxnet3:
>
> make: Entering directory `/usr/src/linux-2.6.29-rc5-1-obj/i386/debug'
> make -C ../../../linux-2.6.29-rc5-1
> O=/usr/src/linux-2.6.29-rc5-1-obj/i386/debug/. modules Using 2.6.x kernel
> build system.
>   CC [M]  /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.o
> /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.c: In
> function 'vmxnet3_poll':
> /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.c:389:
> warning: passing argument 1 of 'netif_rx_complete' from incompatible
> pointer type
> /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.c:389:
> error: too many arguments to function 'netif_rx_complete'
> /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.c: In
> function 'vmxnet3_intr':
> /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.c:455:
> error: 'struct net_device' has no member named 'priv'
> /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.c:471:
> warning: passing argument 1 of 'netif_rx_schedule' from incompatible
> pointer type
> /usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.c:471:
> error: too many arguments to function 'netif_rx_schedule' make[3]: ***
> [/usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3/vmxnet3.o] Error 1
> make[2]: ***
> [_module_/usr/src/packages/BUILD/obj/debug/modules/linux/vmxnet3] Error 2
> make[1]: *** [sub-make] Error 2
> make: *** [all] Error 2
> make: Leaving directory `/usr/src/linux-2.6.29-rc5-1-obj/i386/debug'
> error: Bad exit status from /var/tmp/rpm-tmp.49505 (%build)
>

Dominique,

The following patch should help with vmxnet3 compilation. I rediffed it 
against the 2009.02.18 release so it should apply better than the vmxnet 
patch.

-- 
Dmitry

diff -urN a/modules/linux/vmxnet3/autoconf/netif_num_params.c 
b/modules/linux/vmxnet3/autoconf/netif_num_params.c
--- a/modules/linux/vmxnet3/autoconf/netif_num_params.c 1969-12-31 
16:00:00.000000000 -0800
+++ b/modules/linux/vmxnet3/autoconf/netif_num_params.c 2009-02-23 
11:24:00.000000000 -0800
@@ -0,0 +1,37 @@
+/*********************************************************
+ * Copyright (C) 2009 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 netif_rx_complete (and netif_rx_schedule) take a single
+ * napi_struct argument. The foundation was laid whith introducing Generic
+ * Receive Offload infrastructure but sropping unneeded net_device argument
+ * did not happen till few commits later so we can't simply test for presence
+ * of NETIF_F_GRO.
+ */
+
+#include <linux/autoconf.h>
+#include <linux/netdevice.h>
+
+#ifndef NETIF_F_GRO
+#   error This compile test intentionally fails.
+#endif
+
+void test_netif_rx_complete(struct napi_struct *napi)
+{
+   netif_rx_complete(napi);
+}
diff -urN a/modules/linux/vmxnet3/compat_netdevice.h 
b/modules/linux/vmxnet3/compat_netdevice.h
--- a/modules/linux/vmxnet3/compat_netdevice.h  2009-02-18 00:02:40.000000000 
-0800
+++ b/modules/linux/vmxnet3/compat_netdevice.h  2009-02-23 11:24:00.000000000 
-0800
@@ -178,6 +178,23 @@
 #   define compat_netdev_priv(netdev)   netdev_priv(netdev)
 #endif
 
+/*
+ * All compat_* business is good but when we can we should just provide
+ * missing implementation to ease upstreaming task.
+ */
+#ifndef HAVE_ALLOC_NETDEV
+#define alloc_netdev(sz, name, setup)  compat_alloc_netdev(sz, name, setup)
+#define alloc_etherdev(sz)             compat_alloc_etherdev(sz)
+#endif
+
+#ifndef HAVE_FREE_NETDEV
+#define free_netdev(dev)               kfree(dev)
+#endif
+
+#ifndef HAVE_NETDEV_PRIV
+#define netdev_priv(dev)               ((dev)->priv)
+#endif
+
 #if defined(NETDEV_TX_OK)
 #   define COMPAT_NETDEV_TX_OK    NETDEV_TX_OK
 #   define COMPAT_NETDEV_TX_BUSY  NETDEV_TX_BUSY
@@ -186,55 +203,56 @@
 #   define COMPAT_NETDEV_TX_BUSY  1
 #endif
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43))
+#ifndef HAVE_NETIF_QUEUE
 static inline void
-compat_netif_start_queue(struct device *dev)
+netif_start_queue(struct device *dev)
 {
    clear_bit(0, &dev->tbusy);
 }
 
 static inline void
-compat_netif_stop_queue(struct device *dev)
+netif_stop_queue(struct device *dev)
 {
    set_bit(0, &dev->tbusy);
 }
 
 static inline int
-compat_netif_queue_stopped(struct device *dev)
+netif_queue_stopped(struct device *dev)
 {
    return test_bit(0, &dev->tbusy);
 }
 
 static inline void
-compat_netif_wake_queue(struct device *dev)
+netif_wake_queue(struct device *dev)
 {
    clear_bit(0, &dev->tbusy);
    mark_bh(NET_BH);
 }
 
 static inline int
-compat_netif_running(struct device *dev)
+netif_running(struct device *dev)
 {
    return dev->start == 0;
 }
 
 static inline int
-compat_netif_carrier_ok(struct device *dev)
+netif_carrier_ok(struct device *dev)
 {
    return 1;
 }
 
 static inline void
-compat_netif_carrier_on(struct device *dev)
+netif_carrier_on(struct device *dev)
 {
 }
 
 static inline void
-compat_netif_carrier_off(struct device *dev)
+netif_carrier_off(struct device *dev)
 {
 }
+#endif
 
-#else
+/* Keep compat_* defines for now */
 #define compat_netif_start_queue(dev)   netif_start_queue(dev)
 #define compat_netif_stop_queue(dev)    netif_stop_queue(dev)
 #define compat_netif_queue_stopped(dev) netif_queue_stopped(dev)
@@ -243,7 +261,6 @@
 #define compat_netif_carrier_ok(dev)    netif_carrier_ok(dev)
 #define compat_netif_carrier_on(dev)    netif_carrier_on(dev)
 #define compat_netif_carrier_off(dev)   netif_carrier_off(dev)
-#endif
 
 /* unregister_netdevice_notifier was not safe prior to 2.6.17 */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) && \
@@ -266,7 +283,15 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
 #define compat_netif_napi_add(dev, napi, poll, quota) \
    netif_napi_add(dev, napi, poll, quota)
+
+#ifdef VMW_NETIF_SINGLE_NAPI_PARM
+#define compat_netif_rx_complete(dev, napi) netif_rx_complete(napi)
+#define compat_netif_rx_schedule(dev, napi) netif_rx_schedule(napi)
+#else
+#define compat_netif_rx_complete(dev, napi) netif_rx_complete(dev, napi)
 #define compat_netif_rx_schedule(dev, napi) netif_rx_schedule(dev, napi)
+#endif
+
 #define compat_napi_enable(dev, napi)       napi_enable(napi)
 #define compat_napi_disable(dev, napi)      napi_disable(napi)
 #else
diff -urN a/modules/linux/vmxnet3/Makefile.kernel 
b/modules/linux/vmxnet3/Makefile.kernel
--- a/modules/linux/vmxnet3/Makefile.kernel     2009-02-18 00:02:40.000000000 
-0800
+++ b/modules/linux/vmxnet3/Makefile.kernel     2009-02-23 11:24:00.000000000 
-0800
@@ -26,6 +26,7 @@
 EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
 
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/skblin.c, 
-DVMW_SKB_LINEARIZE_2618, )
+EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/netif_num_params.c, 
-DVMW_NETIF_SINGLE_NAPI_PARM, )
 
 obj-m += $(DRIVER).o
 
diff -urN a/modules/linux/vmxnet3/Makefile.normal 
b/modules/linux/vmxnet3/Makefile.normal
--- a/modules/linux/vmxnet3/Makefile.normal     2009-02-18 00:02:40.000000000 
-0800
+++ b/modules/linux/vmxnet3/Makefile.normal     2009-02-23 11:24:00.000000000 
-0800
@@ -61,6 +61,7 @@
           | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p')
 
 CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/skblin.c, 
-DVMW_SKB_LINEARIZE_2618, )
+CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/netif_num_params.c, 
-DVMW_NETIF_SINGLE_NAPI_PARM, )
 
 OBJS := vmxnet3.o
 
diff -urN a/modules/linux/vmxnet3/vmxnet3.c b/modules/linux/vmxnet3/vmxnet3.c
--- a/modules/linux/vmxnet3/vmxnet3.c   2009-02-18 00:02:40.000000000 -0800
+++ b/modules/linux/vmxnet3/vmxnet3.c   2009-02-23 11:24:00.000000000 -0800
@@ -155,7 +155,7 @@
 #endif
 };
 
-static int disable_lro = 0;
+static int disable_lro;
 
 /*
  *----------------------------------------------------------------------------
@@ -381,12 +381,11 @@
 {
    struct vmxnet3_adapter *adapter = container_of(napi, struct 
vmxnet3_adapter, napi);
    int rxd_done, txd_done;
-   struct net_device *netdev = adapter->netdev;
 
    vmxnet3_do_poll(adapter, budget, &txd_done, &rxd_done);
 
    if (rxd_done < budget) {
-      netif_rx_complete(netdev, napi);
+      compat_netif_rx_complete(adapter->netdev, napi);
       vmxnet3_enable_intr(adapter, 0);
    }
    return rxd_done;
@@ -410,7 +409,7 @@
 vmxnet3_poll(struct net_device *poll_dev, int *budget)
 {
    int rxd_done, txd_done, quota;
-   struct vmxnet3_adapter *adapter = poll_dev->priv;
+   struct vmxnet3_adapter *adapter = netdev_priv(poll_dev);
 
    quota = min(*budget, poll_dev->quota);
 
@@ -452,7 +451,7 @@
 #endif
 {
    struct net_device *dev = dev_id;
-   struct vmxnet3_adapter *adapter = dev->priv;
+   struct vmxnet3_adapter *adapter = netdev_priv(dev);
 
    if (UNLIKELY(adapter->intr.type == VMXNET3_IT_INTX)) {
       uint32 icr = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_ICR);
@@ -468,7 +467,7 @@
       vmxnet3_disable_intr(adapter, 0);
    }
 
-   compat_netif_rx_schedule(dev, &adapter->napi); 
+   compat_netif_rx_schedule(dev, &adapter->napi);
 
 #else
    vmxnet3_tq_tx_complete(&adapter->tx_queue, adapter);
diff -urN a/modules/linux/vmxnet3/vmxnet3_version.h 
b/modules/linux/vmxnet3/vmxnet3_version.h
--- a/modules/linux/vmxnet3/vmxnet3_version.h   2009-02-18 00:02:40.000000000 
-0800
+++ b/modules/linux/vmxnet3/vmxnet3_version.h   2009-02-23 11:23:59.000000000 
-0800
@@ -25,11 +25,11 @@
 #ifndef _VMXNET3_VERSION_H_
 #define _VMXNET3_VERSION_H_
 
-#define VMXNET3_DRIVER_VERSION          1.0.0.32
-#define VMXNET3_DRIVER_VERSION_COMMAS   1,0,0,32
-#define VMXNET3_DRIVER_VERSION_STRING   "1.0.0.32"
+#define VMXNET3_DRIVER_VERSION          1.0.0.33
+#define VMXNET3_DRIVER_VERSION_COMMAS   1,0,0,33
+#define VMXNET3_DRIVER_VERSION_STRING   "1.0.0.33"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01000020
+#define VMXNET3_DRIVER_VERSION_NUM      0x01000021
 
 #endif /* _VMXNET3_VERSION_H_ */



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
open-vm-tools-devel mailing list
open-vm-tools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-vm-tools-devel

Reply via email to