#include "netlink.h"
#include "ofpbuf.h"
#include "openflow/openflow.h"
-#include "openvswitch/gre.h"
#include "packets.h"
#include "poll-loop.h"
#include "port-array.h"
#include "socket-util.h"
#include "shash.h"
#include "svec.h"
-
-#define THIS_MODULE VLM_netdev_linux
#include "vlog.h"
+
+VLOG_DEFINE_THIS_MODULE(netdev_linux)
\f
/* These were introduced in Linux 2.6.14, so they might be missing if we have
* old headers. */
if (!(netdev_dev->cache_valid & VALID_IS_PSEUDO)) {
const char *name = netdev_dev_get_name(&netdev_dev->netdev_dev);
const char *type = netdev_dev_get_type(&netdev_dev->netdev_dev);
-
+
netdev_dev->is_tap = !strcmp(type, "tap");
netdev_dev->is_internal = false;
if (!netdev_dev->is_tap) {
iface, &dest, &gateway, &flags, &refcnt,
&use, &metric, &mask, &mtu, &window, &irtt) != 11) {
- VLOG_WARN_RL(&rl, "%s: could not parse line %d: %s",
+ VLOG_WARN_RL(&rl, "%s: could not parse line %d: %s",
fn, ln, line);
continue;
}
}
/* The output of 'dest', 'mask', and 'gateway' were given in
- * network byte order, so we don't need need any endian
+ * network byte order, so we don't need need any endian
* conversions here. */
if ((dest & mask) == (host->s_addr & mask)) {
if (!gateway) {
const char *priority_s = shash_find_data(details, "priority");
int mtu;
- /* min-rate */
+ /* min-rate. Don't allow a min-rate below 1500 bytes/s. */
if (!min_rate_s) {
/* min-rate is required. */
return EINVAL;
}
hc->min_rate = strtoull(min_rate_s, NULL, 10) / 8;
- hc->min_rate = MAX(hc->min_rate, 0);
+ hc->min_rate = MAX(hc->min_rate, 1500);
hc->min_rate = MIN(hc->min_rate, htb->max_rate);
/* max-rate */
major = tc_get_major(handle);
minor = tc_get_minor(handle);
if (major == 1 && minor > 0 && minor <= HTB_N_QUEUES) {
- (*cb)(tc_get_minor(handle), &stats, aux);
+ (*cb)(minor - 1, &stats, aux);
}
return 0;
}
if (!buffer_hz) {
read_psched();
}
- return ((unsigned long long int) ticks_per_s * size) / rate;
+ return rate ? ((unsigned long long int) ticks_per_s * size) / rate : 0;
}
/* Returns the number of bytes that need to be reserved for qdisc buffering at
/* Calculates the proper value of 'buffer' or 'cbuffer' in HTB options given a
* rate of 'Bps' bytes per second, the specified 'mtu', and a user-requested
* burst size of 'burst_bytes'. (If no value was requested, a 'burst_bytes' of
- * 0 is fine.)
- *
- * This */
+ * 0 is fine.) */
static int
tc_calc_buffer(unsigned int Bps, int mtu, uint64_t burst_bytes)
{