Introduce a helper function as a pre-step towards supporting offload multiple remote destinations.
Co-authored-by: Salem Sol <[email protected]> Signed-off-by: Noa Levy <[email protected]> Signed-off-by: Salem Sol <[email protected]> --- lib/netdev-offload-dpdk.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index e284cec90..0f6edf70e 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -447,6 +447,24 @@ dump_vxlan_encap(struct ds *s, const struct rte_flow_item *items) } } +static void +dump_raw_encap(struct ds *s, + struct ds *s_extra, + const struct rte_flow_action_raw_encap *raw_encap) +{ + int i; + + ds_put_cstr(s, "raw_encap index 0 / "); + if (raw_encap) { + ds_put_format(s_extra, "Raw-encap size=%ld set raw_encap 0 raw " + "pattern is ", raw_encap->size); + for (i = 0; i < raw_encap->size; i++) { + ds_put_format(s_extra, "%02x", raw_encap->data[i]); + } + ds_put_cstr(s_extra, " / end_set; "); + } +} + static void dump_port_id(struct ds *s, const void *conf) { @@ -583,15 +601,7 @@ dump_flow_action(struct ds *s, struct ds *s_extra, } else if (actions->type == RTE_FLOW_ACTION_TYPE_RAW_ENCAP) { const struct rte_flow_action_raw_encap *raw_encap = actions->conf; - ds_put_cstr(s, "raw_encap index 0 / "); - if (raw_encap) { - ds_put_format(s_extra, "Raw-encap size=%ld set raw_encap 0 raw " - "pattern is ", raw_encap->size); - for (int i = 0; i < raw_encap->size; i++) { - ds_put_format(s_extra, "%02x", raw_encap->data[i]); - } - ds_put_cstr(s_extra, " / end_set;"); - } + dump_raw_encap(s, s_extra, raw_encap); } else if (actions->type == RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP) { const struct rte_flow_action_vxlan_encap *vxlan_encap = actions->conf; const struct rte_flow_item *items = vxlan_encap->definition; -- 2.28.0.2311.g225365fb51 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
