2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

treewide: Wider use of packet batch APIs.

This patch replaces most of direct accesses to the dp_packet_batch
internal components by appropriate APIs.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
This commit is contained in:
Ilya Maximets
2018-12-10 20:17:53 +03:00
committed by Ian Stokes
parent f916262832
commit 1270b6e52c
5 changed files with 11 additions and 13 deletions

View File

@@ -640,8 +640,7 @@ netdev_bsd_rxq_recv(struct netdev_rxq *rxq_, struct dp_packet_batch *batch,
if (retval) {
dp_packet_delete(packet);
} else {
batch->packets[0] = packet;
batch->count = 1;
dp_packet_batch_init_packet(batch, packet);
}
if (qfill) {
@@ -690,8 +689,8 @@ netdev_bsd_send(struct netdev *netdev_, int qid OVS_UNUSED,
{
struct netdev_bsd *dev = netdev_bsd_cast(netdev_);
const char *name = netdev_get_name(netdev_);
struct dp_packet *packet;
int error;
int i;
ovs_mutex_lock(&dev->mutex);
if (dev->tap_fd < 0 && !dev->pcap) {
@@ -700,9 +699,9 @@ netdev_bsd_send(struct netdev *netdev_, int qid OVS_UNUSED,
error = 0;
}
for (i = 0; i < batch->count; i++) {
const void *data = dp_packet_data(batch->packets[i]);
size_t size = dp_packet_size(batch->packets[i]);
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
const void *data = dp_packet_data(packet);
size_t size = dp_packet_size(packet);
while (!error) {
ssize_t retval;