]> git.proxmox.com Git - mirror_ovs.git/commit - lib/dpif-netdev.c
treewide: Use packet batch APIs
authorPaul Chaignon <paul.chaignon@orange.com>
Sun, 1 Sep 2019 13:10:05 +0000 (15:10 +0200)
committerBen Pfaff <blp@ovn.org>
Wed, 25 Sep 2019 21:42:00 +0000 (14:42 -0700)
commit940ac2ce880349bf4d3bcb9c0571dbedadc8d769
tree9eb5c0c86f7d4e89d57a6778f3ed0b286ec2d8d8
parent6a1c98461b46c407b3513cb6968b02e814ed2f33
treewide: Use packet batch APIs

This patch replaces direct accesses to dp_packet_batch and dp_packet
internal components by the appropriate API calls.  It extends commit
1270b6e52 (treewide: Wider use of packet batch APIs).

This patch was generated using the following semantic patch (cf.
http://coccinelle.lip6.fr).

// <smpl>
@ dp_packet @
struct dp_packet_batch *b1;
struct dp_packet_batch b2;
struct dp_packet *p;
expression e;
@@

(
- b1->packets[b1->count++] = p;
+ dp_packet_batch_add(b1, p);
|
- b2.packets[b2.count++] = p;
+ dp_packet_batch_add(&b2, p);
|
- p->packet_type == htonl(PT_ETH)
+ dp_packet_is_eth(p)
|
- p->packet_type != htonl(PT_ETH)
+ !dp_packet_is_eth(p)
|
- b1->count == 0
+ dp_packet_batch_is_empty(b1)
|
- !b1->count
+ dp_packet_batch_is_empty(b1)
|
  b1->count = e;
|
  b1->count++
|
  b2.count = e;
|
  b2.count++
|
- b1->count
+ dp_packet_batch_size(b1)
|
- b2.count
+ dp_packet_batch_size(&b2)
)
// </smpl>

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/dpif-netdev.c
lib/flow.c
lib/netdev-afxdp.c
lib/netdev-dpdk.c
lib/netdev-dummy.c
lib/packets.c
lib/pcap-file.c