odp_flow_key_from_flow(&buf, &netdev_flow->flow,
netdev_flow->flow.in_port.odp_port);
- *key = buf.data;
- *key_len = buf.size;
+ *key = ofpbuf_data(&buf);
+ *key_len = ofpbuf_size(&buf);
}
if (key && mask) {
odp_to_u32(wc.masks.in_port.odp_port),
SIZE_MAX);
- *mask = buf.data;
- *mask_len = buf.size;
+ *mask = ofpbuf_data(&buf);
+ *mask_len = ofpbuf_size(&buf);
}
if (actions || stats) {
struct pkt_metadata *md = &execute->md;
struct flow key;
- if (execute->packet->size < ETH_HEADER_LEN ||
- execute->packet->size > UINT16_MAX) {
+ if (ofpbuf_size(execute->packet) < ETH_HEADER_LEN ||
+ ofpbuf_size(execute->packet) > UINT16_MAX) {
return EINVAL;
}
}
\f
-inline static void
+static void
dp_netdev_process_rxq_port(struct dp_netdev *dp,
struct dp_netdev_port *port,
struct netdev_rxq *rxq)
ovs_mutex_lock(&bucket->mutex);
bucket->used = MAX(now, bucket->used);
bucket->packet_count++;
- bucket->byte_count += packet->size;
+ bucket->byte_count += ofpbuf_size(packet);
bucket->tcp_flags |= tcp_flags;
ovs_mutex_unlock(&bucket->mutex);
}
struct dp_netdev_flow *netdev_flow;
struct flow key;
- if (packet->size < ETH_HEADER_LEN) {
+ if (ofpbuf_size(packet) < ETH_HEADER_LEN) {
ofpbuf_delete(packet);
return;
}
if (userdata) {
buf_size += NLA_ALIGN(userdata->nla_len);
}
- buf_size += packet->size;
+ buf_size += ofpbuf_size(packet);
ofpbuf_init(buf, buf_size);
/* Put ODP flow. */
odp_flow_key_from_flow(buf, flow, flow->in_port.odp_port);
- upcall->key = buf->data;
- upcall->key_len = buf->size;
+ upcall->key = ofpbuf_data(buf);
+ upcall->key_len = ofpbuf_size(buf);
/* Put userdata. */
if (userdata) {
NLA_ALIGN(userdata->nla_len));
}
- upcall->packet.data = ofpbuf_put(buf, packet->data, packet->size);
- upcall->packet.size = packet->size;
+ ofpbuf_set_data(&upcall->packet,
+ ofpbuf_put(buf, ofpbuf_data(packet), ofpbuf_size(packet)));
+ ofpbuf_set_size(&upcall->packet, ofpbuf_size(packet));
seq_change(q->seq);