/* We can't allow the packet batching in the next loop to execute
* the actions. Otherwise, if there are any slow path actions,
* we'll send the packet up twice. */
- dp_netdev_execute_actions(pmd, &packets[i], 1, false, md,
+ dp_netdev_execute_actions(pmd, &packets[i], 1, true, md,
ofpbuf_data(&actions),
ofpbuf_size(&actions));
ofpbuf_uninit(&actions);
ofpbuf_uninit(&put_actions);
fat_rwlock_unlock(&dp->upcall_rwlock);
+ } else if (OVS_UNLIKELY(any_miss)) {
+ int dropped_cnt = 0;
+
+ for (i = 0; i < cnt; i++) {
+ if (OVS_UNLIKELY(!rules[i] && mfs[i])) {
+ dpif_packet_delete(packets[i]);
+ dropped_cnt++;
+ }
+ }
+
+ dp_netdev_count_packet(dp, DP_STAT_LOST, dropped_cnt);
}
n_batches = 0;
dp->upcall_cb = cb;
}
+static void
+dp_netdev_drop_packets(struct dpif_packet ** packets, int cnt, bool may_steal)
+{
+ int i;
+
+ if (may_steal) {
+ for (i = 0; i < cnt; i++) {
+ dpif_packet_delete(packets[i]);
+ }
+ }
+}
+
static void
dp_execute_cb(void *aux_, struct dpif_packet **packets, int cnt,
struct pkt_metadata *md,
p = dp_netdev_lookup_port(dp, u32_to_odp(nl_attr_get_u32(a)));
if (OVS_LIKELY(p)) {
netdev_send(p->netdev, pmd->core_id, packets, cnt, may_steal);
- } else if (may_steal) {
- for (i = 0; i < cnt; i++) {
- dpif_packet_delete(packets[i]);
- }
+ return;
}
break;
DPIF_UC_ACTION, userdata, &actions,
NULL);
if (!error || error == ENOSPC) {
- dp_netdev_execute_actions(pmd, &packets[i], 1, false, md,
- ofpbuf_data(&actions),
+ dp_netdev_execute_actions(pmd, &packets[i], 1, may_steal,
+ md, ofpbuf_data(&actions),
ofpbuf_size(&actions));
- }
-
- if (may_steal) {
+ } else if (may_steal) {
dpif_packet_delete(packets[i]);
}
}
ofpbuf_uninit(&actions);
fat_rwlock_unlock(&dp->upcall_rwlock);
- }
+ return;
+ }
break;
case OVS_ACTION_ATTR_HASH: {
}
dpif_packet_set_dp_hash(packets[i], hash);
}
- break;
+ return;
}
case OVS_ACTION_ATTR_RECIRC:
}
(*depth)--;
- break;
- } else {
- VLOG_WARN("Packet dropped. Max recirculation depth exceeded.");
- if (may_steal) {
- for (i = 0; i < cnt; i++) {
- dpif_packet_delete(packets[i]);
- }
- }
+ return;
}
+
+ VLOG_WARN("Packet dropped. Max recirculation depth exceeded.");
break;
case OVS_ACTION_ATTR_PUSH_VLAN:
case __OVS_ACTION_ATTR_MAX:
OVS_NOT_REACHED();
}
+
+ dp_netdev_drop_packets(packets, cnt, may_steal);
}
static void