mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
dpif-linux: Rename dpif-netlink; change to compile with MSVC.
The patch contains the necessary modifications to compile and also to run under MSVC. Added the files to the build system and also changed dpif_linux to be under a more generic name dpif_windows. Added a TODO under the windows part in case we want to implement another counterpart for epoll functions. Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
committed by
Ben Pfaff
parent
1a9bb326d8
commit
93451a0a81
2
PORTING
2
PORTING
@@ -232,7 +232,7 @@ requirements are unclear, please report this as a bug.
|
||||
There are two existing dpif implementations that may serve as
|
||||
useful examples during a port:
|
||||
|
||||
* lib/dpif-linux.c is a Linux-specific dpif implementation that
|
||||
* lib/dpif-netlink.c is a Linux-specific dpif implementation that
|
||||
talks to an Open vSwitch-specific kernel module (whose sources
|
||||
are in the "datapath" directory). The kernel module performs
|
||||
all of the switching work, passing packets that do not match any
|
||||
|
@@ -307,8 +307,8 @@ endif
|
||||
|
||||
if LINUX
|
||||
lib_libopenvswitch_la_SOURCES += \
|
||||
lib/dpif-linux.c \
|
||||
lib/dpif-linux.h \
|
||||
lib/dpif-netlink.c \
|
||||
lib/dpif-netlink.h \
|
||||
lib/netdev-linux.c \
|
||||
lib/netdev-linux.h \
|
||||
lib/netlink-notifier.c \
|
||||
@@ -332,6 +332,8 @@ endif
|
||||
|
||||
if WIN32
|
||||
lib_libopenvswitch_la_SOURCES += \
|
||||
lib/dpif-netlink.c \
|
||||
lib/dpif-netlink.h \
|
||||
lib/netlink-notifier.c \
|
||||
lib/netlink-notifier.h \
|
||||
lib/netlink-protocol.h \
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef DPIF_LINUX_H
|
||||
#define DPIF_LINUX_H 1
|
||||
#ifndef DPIF_NETLINK_H
|
||||
#define DPIF_NETLINK_H 1
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
struct ofpbuf;
|
||||
|
||||
struct dpif_linux_vport {
|
||||
struct dpif_netlink_vport {
|
||||
/* Generic Netlink header. */
|
||||
uint8_t cmd;
|
||||
|
||||
@@ -48,14 +48,14 @@ struct dpif_linux_vport {
|
||||
size_t options_len;
|
||||
};
|
||||
|
||||
void dpif_linux_vport_init(struct dpif_linux_vport *);
|
||||
void dpif_netlink_vport_init(struct dpif_netlink_vport *);
|
||||
|
||||
int dpif_linux_vport_transact(const struct dpif_linux_vport *request,
|
||||
struct dpif_linux_vport *reply,
|
||||
int dpif_netlink_vport_transact(const struct dpif_netlink_vport *request,
|
||||
struct dpif_netlink_vport *reply,
|
||||
struct ofpbuf **bufp);
|
||||
int dpif_linux_vport_get(const char *name, struct dpif_linux_vport *reply,
|
||||
int dpif_netlink_vport_get(const char *name, struct dpif_netlink_vport *reply,
|
||||
struct ofpbuf **bufp);
|
||||
|
||||
bool dpif_linux_is_internal_device(const char *name);
|
||||
bool dpif_netlink_is_internal_device(const char *name);
|
||||
|
||||
#endif /* dpif-linux.h */
|
||||
#endif /* dpif-netlink.h */
|
@@ -358,7 +358,7 @@ struct dpif_class {
|
||||
void (*disable_upcall)(struct dpif *);
|
||||
};
|
||||
|
||||
extern const struct dpif_class dpif_linux_class;
|
||||
extern const struct dpif_class dpif_netlink_class;
|
||||
extern const struct dpif_class dpif_netdev_class;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -59,8 +59,8 @@ COVERAGE_DEFINE(dpif_purge);
|
||||
COVERAGE_DEFINE(dpif_execute_with_help);
|
||||
|
||||
static const struct dpif_class *base_dpif_classes[] = {
|
||||
#ifdef __linux__
|
||||
&dpif_linux_class,
|
||||
#if defined(__linux__) || defined(_WIN32)
|
||||
&dpif_netlink_class,
|
||||
#endif
|
||||
&dpif_netdev_class,
|
||||
};
|
||||
@@ -1524,7 +1524,7 @@ log_flow_del_message(struct dpif *dpif, const struct dpif_flow_del *del,
|
||||
* called after the dpif_provider's '->execute' function, which is allowed to
|
||||
* modify execute->packet and execute->md. In practice, though:
|
||||
*
|
||||
* - dpif-linux doesn't modify execute->packet or execute->md.
|
||||
* - dpif-netlink doesn't modify execute->packet or execute->md.
|
||||
*
|
||||
* - dpif-netdev does modify them but it is less likely to have problems
|
||||
* because it is built into ovs-vswitchd and cannot have version skew,
|
||||
|
@@ -83,8 +83,8 @@ const char *flow_tun_flag_to_string(uint32_t flags);
|
||||
*
|
||||
* The meaning of 'in_port' is context-dependent. In most cases, it is a
|
||||
* 16-bit OpenFlow 1.0 port number. In the software datapath interface (dpif)
|
||||
* layer and its implementations (e.g. dpif-linux, dpif-netdev), it is instead
|
||||
* a 32-bit datapath port number.
|
||||
* layer and its implementations (e.g. dpif-netlink, dpif-netdev), it is
|
||||
* instead a 32-bit datapath port number.
|
||||
*
|
||||
* The fields are organized in four segments to facilitate staged lookup, where
|
||||
* lower layer fields are first used to determine if the later fields need to
|
||||
|
@@ -48,7 +48,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "coverage.h"
|
||||
#include "dpif-linux.h"
|
||||
#include "dpif-netlink.h"
|
||||
#include "dpif-netdev.h"
|
||||
#include "dynamic-string.h"
|
||||
#include "fatal-signal.h"
|
||||
@@ -1523,11 +1523,11 @@ netdev_stats_from_ovs_vport_stats(struct netdev_stats *dst,
|
||||
static int
|
||||
get_stats_via_vport__(const struct netdev *netdev, struct netdev_stats *stats)
|
||||
{
|
||||
struct dpif_linux_vport reply;
|
||||
struct dpif_netlink_vport reply;
|
||||
struct ofpbuf *buf;
|
||||
int error;
|
||||
|
||||
error = dpif_linux_vport_get(netdev_get_name(netdev), &reply, &buf);
|
||||
error = dpif_netlink_vport_get(netdev_get_name(netdev), &reply, &buf);
|
||||
if (error) {
|
||||
return error;
|
||||
} else if (!reply.stats) {
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct dpif_linux_vport;
|
||||
struct dpif_netlink_vport;
|
||||
struct dpif_flow_stats;
|
||||
struct netdev;
|
||||
struct netdev_class;
|
||||
|
Reference in New Issue
Block a user