summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDarrell Ball <dlu998@gmail.com>2018-05-16 19:24:46 -0700
committerBen Pfaff <blp@ovn.org>2018-05-23 11:36:47 -0700
commit7d7ded7af727e287def386537ca3998b30573d85 (patch)
treea989b19ce4103695652f4b8d26bc75c922774846 /lib
parenta8ab5889361109204a28c3af72a6bf6c5a376403 (diff)
downloadopenvswitch-7d7ded7af727e287def386537ca3998b30573d85.tar.gz
odp-execute: Rename 'may_steal' to 'should_steal'.
Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/dp-packet.h4
-rw-r--r--lib/dpif-netdev.c27
-rw-r--r--lib/dpif.c6
-rw-r--r--lib/netdev-dpdk.c18
-rw-r--r--lib/odp-execute.c4
-rw-r--r--lib/odp-execute.h2
6 files changed, 31 insertions, 30 deletions
diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index 21c8ca525..596cfe691 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -792,9 +792,9 @@ dp_packet_batch_clone(struct dp_packet_batch *dst,
}
static inline void
-dp_packet_delete_batch(struct dp_packet_batch *batch, bool may_steal)
+dp_packet_delete_batch(struct dp_packet_batch *batch, bool should_steal)
{
- if (may_steal) {
+ if (should_steal) {
struct dp_packet *packet;
DP_PACKET_BATCH_FOR_EACH (i, packet, batch) {
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index f86ed2aba..68f2a2975 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -647,7 +647,8 @@ static int dpif_netdev_open(const struct dpif_class *, const char *name,
bool create, struct dpif **);
static void dp_netdev_execute_actions(struct dp_netdev_pmd_thread *pmd,
struct dp_packet_batch *,
- bool may_steal, const struct flow *flow,
+ bool should_steal,
+ const struct flow *flow,
const struct nlattr *actions,
size_t actions_len);
static void dp_netdev_input(struct dp_netdev_pmd_thread *,
@@ -5594,7 +5595,7 @@ error:
static void
dp_execute_userspace_action(struct dp_netdev_pmd_thread *pmd,
- struct dp_packet *packet, bool may_steal,
+ struct dp_packet *packet, bool should_steal,
struct flow *flow, ovs_u128 *ufid,
struct ofpbuf *actions,
const struct nlattr *userdata)
@@ -5609,16 +5610,16 @@ dp_execute_userspace_action(struct dp_netdev_pmd_thread *pmd,
NULL);
if (!error || error == ENOSPC) {
dp_packet_batch_init_packet(&b, packet);
- dp_netdev_execute_actions(pmd, &b, may_steal, flow,
+ dp_netdev_execute_actions(pmd, &b, should_steal, flow,
actions->data, actions->size);
- } else if (may_steal) {
+ } else if (should_steal) {
dp_packet_delete(packet);
}
}
static void
dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
- const struct nlattr *a, bool may_steal)
+ const struct nlattr *a, bool should_steal)
OVS_NO_THREAD_SAFETY_ANALYSIS
{
struct dp_netdev_execute_aux *aux = aux_;
@@ -5635,7 +5636,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
struct dp_packet *packet;
struct dp_packet_batch out;
- if (!may_steal) {
+ if (!should_steal) {
dp_packet_batch_clone(&out, packets_);
dp_packet_batch_reset_cutlen(packets_);
packets_ = &out;
@@ -5688,7 +5689,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
if (p) {
struct dp_packet_batch tnl_pkt;
- if (!may_steal) {
+ if (!should_steal) {
dp_packet_batch_clone(&tnl_pkt, packets_);
packets_ = &tnl_pkt;
dp_packet_batch_reset_cutlen(orig_packets_);
@@ -5728,7 +5729,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
ofpbuf_init(&actions, 0);
if (packets_->trunc) {
- if (!may_steal) {
+ if (!should_steal) {
dp_packet_batch_clone(&usr_pkt, packets_);
packets_ = &usr_pkt;
clone = true;
@@ -5742,7 +5743,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
DP_PACKET_BATCH_FOR_EACH (i, packet, packets_) {
flow_extract(packet, &flow);
dpif_flow_hash(dp->dpif, &flow, sizeof flow, &ufid);
- dp_execute_userspace_action(pmd, packet, may_steal, &flow,
+ dp_execute_userspace_action(pmd, packet, should_steal, &flow,
&ufid, &actions, userdata);
}
@@ -5761,7 +5762,7 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
if (*depth < MAX_RECIRC_DEPTH) {
struct dp_packet_batch recirc_pkts;
- if (!may_steal) {
+ if (!should_steal) {
dp_packet_batch_clone(&recirc_pkts, packets_);
packets_ = &recirc_pkts;
}
@@ -5934,18 +5935,18 @@ dp_execute_cb(void *aux_, struct dp_packet_batch *packets_,
OVS_NOT_REACHED();
}
- dp_packet_delete_batch(packets_, may_steal);
+ dp_packet_delete_batch(packets_, should_steal);
}
static void
dp_netdev_execute_actions(struct dp_netdev_pmd_thread *pmd,
struct dp_packet_batch *packets,
- bool may_steal, const struct flow *flow,
+ bool should_steal, const struct flow *flow,
const struct nlattr *actions, size_t actions_len)
{
struct dp_netdev_execute_aux aux = { pmd, flow };
- odp_execute_actions(&aux, packets, may_steal, actions,
+ odp_execute_actions(&aux, packets, should_steal, actions,
actions_len, dp_execute_cb);
}
diff --git a/lib/dpif.c b/lib/dpif.c
index b098a4c9e..1f5929c62 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -1162,7 +1162,7 @@ struct dpif_execute_helper_aux {
* meaningful. */
static void
dpif_execute_helper_cb(void *aux_, struct dp_packet_batch *packets_,
- const struct nlattr *action, bool may_steal)
+ const struct nlattr *action, bool should_steal)
{
struct dpif_execute_helper_aux *aux = aux_;
int type = nl_attr_type(action);
@@ -1234,7 +1234,7 @@ dpif_execute_helper_cb(void *aux_, struct dp_packet_batch *packets_,
|| type == OVS_ACTION_ATTR_TUNNEL_POP
|| type == OVS_ACTION_ATTR_USERSPACE)) {
dp_packet_reset_cutlen(packet);
- if (!may_steal) {
+ if (!should_steal) {
packet = clone = dp_packet_clone(packet);
}
dp_packet_set_size(packet, dp_packet_size(packet) - cutlen);
@@ -1279,7 +1279,7 @@ dpif_execute_helper_cb(void *aux_, struct dp_packet_batch *packets_,
case __OVS_ACTION_ATTR_MAX:
OVS_NOT_REACHED();
}
- dp_packet_delete_batch(packets_, may_steal);
+ dp_packet_delete_batch(packets_, should_steal);
}
/* Executes 'execute' by performing most of the actions in userspace and
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 87152a7b9..46f32a91e 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -272,7 +272,7 @@ struct dpdk_qos_ops {
* For all QoS implementations it should always be non-null.
*/
int (*qos_run)(struct qos_conf *qos_conf, struct rte_mbuf **pkts,
- int pkt_cnt, bool may_steal);
+ int pkt_cnt, bool should_steal);
};
/* dpdk_qos_ops for each type of user space QoS implementation */
@@ -1803,7 +1803,7 @@ netdev_dpdk_policer_pkt_handle(struct rte_meter_srtcm *meter,
static int
netdev_dpdk_policer_run(struct rte_meter_srtcm *meter,
struct rte_mbuf **pkts, int pkt_cnt,
- bool may_steal)
+ bool should_steal)
{
int i = 0;
int cnt = 0;
@@ -1819,7 +1819,7 @@ netdev_dpdk_policer_run(struct rte_meter_srtcm *meter,
}
cnt++;
} else {
- if (may_steal) {
+ if (should_steal) {
rte_pktmbuf_free(pkt);
}
}
@@ -1830,13 +1830,13 @@ netdev_dpdk_policer_run(struct rte_meter_srtcm *meter,
static int
ingress_policer_run(struct ingress_policer *policer, struct rte_mbuf **pkts,
- int pkt_cnt, bool may_steal)
+ int pkt_cnt, bool should_steal)
{
int cnt = 0;
rte_spinlock_lock(&policer->policer_lock);
cnt = netdev_dpdk_policer_run(&policer->in_policer, pkts,
- pkt_cnt, may_steal);
+ pkt_cnt, should_steal);
rte_spinlock_unlock(&policer->policer_lock);
return cnt;
@@ -2016,13 +2016,13 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq, struct dp_packet_batch *batch,
static inline int
netdev_dpdk_qos_run(struct netdev_dpdk *dev, struct rte_mbuf **pkts,
- int cnt, bool may_steal)
+ int cnt, bool should_steal)
{
struct qos_conf *qos_conf = ovsrcu_get(struct qos_conf *, &dev->qos_conf);
if (qos_conf) {
rte_spinlock_lock(&qos_conf->lock);
- cnt = qos_conf->ops->qos_run(qos_conf, pkts, cnt, may_steal);
+ cnt = qos_conf->ops->qos_run(qos_conf, pkts, cnt, should_steal);
rte_spinlock_unlock(&qos_conf->lock);
}
@@ -3655,14 +3655,14 @@ egress_policer_qos_is_equal(const struct qos_conf *conf,
static int
egress_policer_run(struct qos_conf *conf, struct rte_mbuf **pkts, int pkt_cnt,
- bool may_steal)
+ bool should_steal)
{
int cnt = 0;
struct egress_policer *policer =
CONTAINER_OF(conf, struct egress_policer, qos_conf);
cnt = netdev_dpdk_policer_run(&policer->egress_meter, pkts,
- pkt_cnt, may_steal);
+ pkt_cnt, should_steal);
return cnt;
}
diff --git a/lib/odp-execute.c b/lib/odp-execute.c
index 919d04ec4..c5080ea16 100644
--- a/lib/odp-execute.c
+++ b/lib/odp-execute.c
@@ -713,9 +713,9 @@ odp_execute_actions(void *dp, struct dp_packet_batch *batch, bool steal,
if (dp_execute_action) {
/* Allow 'dp_execute_action' to steal the packet data if we do
* not need it any more. */
- bool may_steal = steal && last_action;
+ bool should_steal = steal && last_action;
- dp_execute_action(dp, batch, a, may_steal);
+ dp_execute_action(dp, batch, a, should_steal);
if (last_action || batch->count == 0) {
/* We do not need to free the packets.
diff --git a/lib/odp-execute.h b/lib/odp-execute.h
index 7223fe82e..a3578a575 100644
--- a/lib/odp-execute.h
+++ b/lib/odp-execute.h
@@ -29,7 +29,7 @@ struct pkt_metadata;
struct dp_packet_batch;
typedef void (*odp_execute_cb)(void *dp, struct dp_packet_batch *batch,
- const struct nlattr *action, bool may_steal);
+ const struct nlattr *action, bool should_steal);
/* Actions that need to be executed in the context of a datapath are handed
* to 'dp_execute_action', if non-NULL. Currently this is called only for