dpif_packet_delete(packet);
} else {
dp_packet_pad(buffer);
+ dpif_packet_set_dp_hash(packet, 0);
packets[0] = packet;
*c = 1;
}
* The kernel maintains a packet transmission queue, so the caller is not
* expected to do additional queuing of packets. */
static int
-netdev_linux_send(struct netdev *netdev_, struct dpif_packet **pkts, int cnt,
- bool may_steal)
+netdev_linux_send(struct netdev *netdev_, int qid OVS_UNUSED,
+ struct dpif_packet **pkts, int cnt, bool may_steal)
{
int i;
int error = 0;
* expected to do additional queuing of packets. Thus, this function is
* unlikely to ever be used. It is included for completeness. */
static void
-netdev_linux_send_wait(struct netdev *netdev)
+netdev_linux_send_wait(struct netdev *netdev, int qid OVS_UNUSED)
{
if (is_tap_netdev(netdev)) {
/* TAP device always accepts packets.*/
return error;
}
-static int
-netdev_internal_set_stats(struct netdev *netdev,
- const struct netdev_stats *stats)
-{
- struct ovs_vport_stats vport_stats;
- struct dpif_linux_vport vport;
- int err;
-
- put_32aligned_u64(&vport_stats.rx_packets, stats->rx_packets);
- put_32aligned_u64(&vport_stats.tx_packets, stats->tx_packets);
- put_32aligned_u64(&vport_stats.rx_bytes, stats->rx_bytes);
- put_32aligned_u64(&vport_stats.tx_bytes, stats->tx_bytes);
- put_32aligned_u64(&vport_stats.rx_errors, stats->rx_errors);
- put_32aligned_u64(&vport_stats.tx_errors, stats->tx_errors);
- put_32aligned_u64(&vport_stats.rx_dropped, stats->rx_dropped);
- put_32aligned_u64(&vport_stats.tx_dropped, stats->tx_dropped);
-
- dpif_linux_vport_init(&vport);
- vport.cmd = OVS_VPORT_CMD_SET;
- vport.name = netdev_get_name(netdev);
- vport.stats = &vport_stats;
-
- err = dpif_linux_vport_transact(&vport, NULL, NULL);
-
- /* If the vport layer doesn't know about the device, that doesn't mean it
- * doesn't exist (after all were able to open it when netdev_open() was
- * called), it just means that it isn't attached and we'll be getting
- * stats a different way. */
- if (err == ENODEV) {
- err = EOPNOTSUPP;
- }
-
- return err;
-}
-
static void
netdev_linux_read_features(struct netdev_linux *netdev)
{
return error;
}
-#define NETDEV_LINUX_CLASS(NAME, CONSTRUCT, GET_STATS, SET_STATS, \
+#define NETDEV_LINUX_CLASS(NAME, CONSTRUCT, GET_STATS, \
GET_FEATURES, GET_STATUS) \
{ \
NAME, \
NULL, /* get_config */ \
NULL, /* set_config */ \
NULL, /* get_tunnel_config */ \
+ NULL, /* get_numa_id */ \
\
netdev_linux_send, \
netdev_linux_send_wait, \
netdev_linux_get_carrier_resets, \
netdev_linux_set_miimon_interval, \
GET_STATS, \
- SET_STATS, \
\
GET_FEATURES, \
netdev_linux_set_advertisements, \
"system",
netdev_linux_construct,
netdev_linux_get_stats,
- NULL, /* set_stats */
netdev_linux_get_features,
netdev_linux_get_status);
"tap",
netdev_linux_construct_tap,
netdev_tap_get_stats,
- NULL, /* set_stats */
netdev_linux_get_features,
netdev_linux_get_status);
"internal",
netdev_linux_construct,
netdev_internal_get_stats,
- netdev_internal_set_stats,
NULL, /* get_features */
netdev_internal_get_status);
\f
memset(&tc_police, 0, sizeof tc_police);
tc_police.action = TC_POLICE_SHOT;
tc_police.mtu = mtu;
- tc_fill_rate(&tc_police.rate, (kbits_rate * 1000)/8, mtu);
+ tc_fill_rate(&tc_police.rate, ((uint64_t) kbits_rate * 1000)/8, mtu);
tc_police.burst = tc_bytes_to_ticks(tc_police.rate.rate,
kbits_burst * 1024);