datapath: Remove vport MAC address configuration.
[sliver-openvswitch.git] / lib / dpif-linux.c
index 63d7afb..6863e08 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "dpif-linux.h"
 
-#include <assert.h>
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -475,9 +474,11 @@ dpif_linux_port_add(struct dpif *dpif_, struct netdev *netdev,
         *port_nop = reply.port_no;
         VLOG_DBG("%s: assigning port %"PRIu32" to netlink pid %"PRIu32,
                  dpif_name(dpif_), reply.port_no, upcall_pid);
-    } else if (error == EBUSY && *port_nop != UINT32_MAX) {
-        VLOG_INFO("%s: requested port %"PRIu32" is in use",
-                  dpif_name(dpif_), *port_nop);
+    } else {
+        if (error == EBUSY && *port_nop != UINT32_MAX) {
+            VLOG_INFO("%s: requested port %"PRIu32" is in use",
+                      dpif_name(dpif_), *port_nop);
+        }
         nl_sock_destroy(sock);
         ofpbuf_delete(buf);
         return error;
@@ -958,7 +959,7 @@ dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
     struct nl_transaction *txnsp[MAX_OPS];
     size_t i;
 
-    assert(n_ops <= MAX_OPS);
+    ovs_assert(n_ops <= MAX_OPS);
     for (i = 0; i < n_ops; i++) {
         struct op_auxdata *aux = &auxes[i];
         struct dpif_op *op = ops[i];
@@ -1464,10 +1465,6 @@ dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport *vport,
         [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NL_A_U32 },
         [OVS_VPORT_ATTR_STATS] = { NL_POLICY_FOR(struct ovs_vport_stats),
                                    .optional = true },
-        [OVS_VPORT_ATTR_ADDRESS] = { .type = NL_A_UNSPEC,
-                                     .min_len = ETH_ADDR_LEN,
-                                     .max_len = ETH_ADDR_LEN,
-                                     .optional = true },
         [OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = true },
     };
 
@@ -1501,9 +1498,6 @@ dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport *vport,
     if (a[OVS_VPORT_ATTR_STATS]) {
         vport->stats = nl_attr_get(a[OVS_VPORT_ATTR_STATS]);
     }
-    if (a[OVS_VPORT_ATTR_ADDRESS]) {
-        vport->address = nl_attr_get(a[OVS_VPORT_ATTR_ADDRESS]);
-    }
     if (a[OVS_VPORT_ATTR_OPTIONS]) {
         vport->options = nl_attr_get(a[OVS_VPORT_ATTR_OPTIONS]);
         vport->options_len = nl_attr_get_size(a[OVS_VPORT_ATTR_OPTIONS]);
@@ -1546,11 +1540,6 @@ dpif_linux_vport_to_ofpbuf(const struct dpif_linux_vport *vport,
                           vport->stats, sizeof *vport->stats);
     }
 
-    if (vport->address) {
-        nl_msg_put_unspec(buf, OVS_VPORT_ATTR_ADDRESS,
-                          vport->address, ETH_ADDR_LEN);
-    }
-
     if (vport->options) {
         nl_msg_put_nested(buf, OVS_VPORT_ATTR_OPTIONS,
                           vport->options, vport->options_len);
@@ -1579,7 +1568,7 @@ dpif_linux_vport_transact(const struct dpif_linux_vport *request,
     struct ofpbuf *request_buf;
     int error;
 
-    assert((reply != NULL) == (bufp != NULL));
+    ovs_assert((reply != NULL) == (bufp != NULL));
 
     error = dpif_linux_init();
     if (error) {
@@ -1730,7 +1719,7 @@ dpif_linux_dp_transact(const struct dpif_linux_dp *request,
     struct ofpbuf *request_buf;
     int error;
 
-    assert((reply != NULL) == (bufp != NULL));
+    ovs_assert((reply != NULL) == (bufp != NULL));
 
     request_buf = ofpbuf_new(1024);
     dpif_linux_dp_to_ofpbuf(request, request_buf);
@@ -1851,9 +1840,9 @@ dpif_linux_flow_to_ofpbuf(const struct dpif_linux_flow *flow,
     }
 
     /* We never need to send these to the kernel. */
-    assert(!flow->stats);
-    assert(!flow->tcp_flags);
-    assert(!flow->used);
+    ovs_assert(!flow->stats);
+    ovs_assert(!flow->tcp_flags);
+    ovs_assert(!flow->used);
 
     if (flow->clear) {
         nl_msg_put_flag(buf, OVS_FLOW_ATTR_CLEAR);
@@ -1880,7 +1869,7 @@ dpif_linux_flow_transact(struct dpif_linux_flow *request,
     struct ofpbuf *request_buf;
     int error;
 
-    assert((reply != NULL) == (bufp != NULL));
+    ovs_assert((reply != NULL) == (bufp != NULL));
 
     if (reply) {
         request->nlmsg_flags |= NLM_F_ECHO;
@@ -1928,7 +1917,7 @@ report_loss(struct dpif *dpif_, struct dpif_channel *ch)
     static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
     struct ds s;
 
-    if (VLOG_DROP_ERR(&rl)) {
+    if (VLOG_DROP_WARN(&rl)) {
         return;
     }