netlink-notifier: Rename rtnetlink code.
[sliver-openvswitch.git] / lib / dpif-linux.c
index 55d22b4..f22970d 100644 (file)
@@ -39,6 +39,7 @@
 #include "netdev.h"
 #include "netdev-linux.h"
 #include "netdev-vport.h"
+#include "netlink-notifier.h"
 #include "netlink-socket.h"
 #include "netlink.h"
 #include "odp-util.h"
@@ -46,7 +47,6 @@
 #include "openvswitch/tunnel.h"
 #include "packets.h"
 #include "poll-loop.h"
-#include "rtnetlink.h"
 #include "rtnetlink-link.h"
 #include "shash.h"
 #include "sset.h"
@@ -60,6 +60,10 @@ enum { LRU_MAX_PORTS = 1024 };
 enum { LRU_MASK = LRU_MAX_PORTS - 1};
 BUILD_ASSERT_DECL(IS_POW2(LRU_MAX_PORTS));
 
+/* This ethtool flag was introduced in Linux 2.6.24, so it might be
+ * missing if we have old headers. */
+#define ETH_FLAG_LRO      (1 << 15)    /* LRO is enabled */
+
 struct dpif_linux_dp {
     /* Generic Netlink header. */
     uint8_t cmd;
@@ -134,7 +138,7 @@ struct dpif_linux {
 
     /* Change notification. */
     struct sset changed_ports;  /* Ports that have changed. */
-    struct rtnetlink_notifier port_notifier;
+    struct nln_notifier port_notifier;
     bool change_error;
 
     /* Queue of unused ports. */
@@ -393,6 +397,10 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev,
         request.options_len = options->size;
     }
 
+    if (request.type == OVS_VPORT_TYPE_NETDEV) {
+        netdev_linux_ethtool_set_flag(netdev, ETH_FLAG_LRO, "LRO", false);
+    }
+
     /* Loop until we find a port that isn't used. */
     do {
         request.port_no = dpif_linux_pop_port(dpif);