All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ethdev: remove deprecated flow copy API
@ 2026-09-01 23:10 Stephen Hemminger
  2026-09-01 23:10 ` [PATCH 2/2] ethdev: remove deprecated shared flow action Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2026-09-01 23:10 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon, Andrew Rybchenko, Ori Kam

The rte_flow_copy() function and struct rte_flow_desc have been
deprecated since 18.05. The function was only a wrapper around
rte_flow_conv(), and struct rte_flow_desc uses a flexible array
member which makes it unusable from C++.

Remove the function, the structure and the associated trace point.
Users should call rte_flow_conv() with RTE_FLOW_CONV_OP_RULE instead.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/release_26_11.rst |  1 +
 lib/ethdev/ethdev_trace.h              | 15 -------
 lib/ethdev/ethdev_trace_points.c       |  3 --
 lib/ethdev/rte_flow.c                  | 56 --------------------------
 lib/ethdev/rte_flow.h                  | 45 ---------------------
 5 files changed, 1 insertion(+), 119 deletions(-)

diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index 760f49c496..591718253d 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -71,6 +71,7 @@ Removed Items
 * Removed deprecated symbols:
 
   * eal: ``__rte_packed``
+  * ethdev: ``rte_flow_copy``, ``struct rte_flow_desc``
   * fib: ``RTE_FIB6_IPV6_ADDR_SIZE``, ``RTE_FIB6_MAXDEPTH``
   * lpm: ``RTE_LPM6_IPV6_ADDR_SIZE``, ``RTE_LPM6_MAX_DEPTH``
   * net: ``RTE_IP_ICMP_ECHO_REPLY``, ``RTE_IP_ICMP_ECHO_REQUEST``
diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h
index 6554cc1a21..8cd95a2851 100644
--- a/lib/ethdev/ethdev_trace.h
+++ b/lib/ethdev/ethdev_trace.h
@@ -1402,21 +1402,6 @@ RTE_TRACE_POINT(
 	rte_trace_point_emit_int(ret);
 )
 
-RTE_TRACE_POINT(
-	rte_flow_trace_copy,
-	RTE_TRACE_POINT_ARGS(struct rte_flow_desc *fd, size_t len,
-		const struct rte_flow_attr *attr,
-		const struct rte_flow_item *items,
-		const struct rte_flow_action *actions, int ret),
-	rte_trace_point_emit_ptr(fd);
-	rte_trace_point_emit_size_t(len);
-	rte_trace_point_emit_u32(attr->group);
-	rte_trace_point_emit_u32(attr->priority);
-	rte_trace_point_emit_ptr(items);
-	rte_trace_point_emit_ptr(actions);
-	rte_trace_point_emit_int(ret);
-)
-
 RTE_TRACE_POINT(
 	rte_flow_trace_tunnel_decap_set,
 	RTE_TRACE_POINT_ARGS(uint16_t port_id,
diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c
index 0a28378a56..a81398893f 100644
--- a/lib/ethdev/ethdev_trace_points.c
+++ b/lib/ethdev/ethdev_trace_points.c
@@ -503,9 +503,6 @@ RTE_TRACE_POINT_REGISTER(rte_eth_trace_count_aggr_ports,
 RTE_TRACE_POINT_REGISTER(rte_eth_trace_map_aggr_tx_affinity,
 	lib.ethdev.map_aggr_tx_affinity)
 
-RTE_TRACE_POINT_REGISTER(rte_flow_trace_copy,
-	lib.ethdev.flow.copy)
-
 RTE_TRACE_POINT_REGISTER(rte_flow_trace_create,
 	lib.ethdev.flow.create)
 
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 1056cfd2c5..cc96190a71 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -1190,62 +1190,6 @@ rte_flow_conv(enum rte_flow_conv_op op,
 	return ret;
 }
 
-/** Store a full rte_flow description. */
-RTE_EXPORT_SYMBOL(rte_flow_copy)
-size_t
-rte_flow_copy(struct rte_flow_desc *desc, size_t len,
-	      const struct rte_flow_attr *attr,
-	      const struct rte_flow_item *items,
-	      const struct rte_flow_action *actions)
-{
-	/*
-	 * Overlap struct rte_flow_conv with struct rte_flow_desc in order
-	 * to convert the former to the latter without wasting space.
-	 */
-	struct rte_flow_conv_rule *dst =
-		len ?
-		(void *)((uintptr_t)desc +
-			 (offsetof(struct rte_flow_desc, actions) -
-			  offsetof(struct rte_flow_conv_rule, actions))) :
-		NULL;
-	size_t dst_size =
-		len > sizeof(*desc) - sizeof(*dst) ?
-		len - (sizeof(*desc) - sizeof(*dst)) :
-		0;
-	struct rte_flow_conv_rule src = {
-		.attr_ro = NULL,
-		.pattern_ro = items,
-		.actions_ro = actions,
-	};
-	int ret;
-
-	RTE_BUILD_BUG_ON(sizeof(struct rte_flow_desc) <
-			 sizeof(struct rte_flow_conv_rule));
-	if (dst_size &&
-	    (&dst->pattern != &desc->items ||
-	     &dst->actions != &desc->actions ||
-	     (uintptr_t)(dst + 1) != (uintptr_t)(desc + 1))) {
-		rte_errno = EINVAL;
-		return 0;
-	}
-	ret = rte_flow_conv(RTE_FLOW_CONV_OP_RULE, dst, dst_size, &src, NULL);
-	if (ret < 0)
-		return 0;
-	ret += sizeof(*desc) - sizeof(*dst);
-	rte_memcpy(desc,
-		   (&(struct rte_flow_desc){
-			.size = ret,
-			.attr = *attr,
-			.items = dst_size ? dst->pattern : NULL,
-			.actions = dst_size ? dst->actions : NULL,
-		   }),
-		   len > sizeof(*desc) ? sizeof(*desc) : len);
-
-	rte_flow_trace_copy(desc, len, attr, items, actions, ret);
-
-	return ret;
-}
-
 RTE_EXPORT_SYMBOL(rte_flow_dev_dump)
 int
 rte_flow_dev_dump(uint16_t port_id, struct rte_flow *flow,
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 1bfe1b3f61..dcd1dbf03e 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -4714,51 +4714,6 @@ rte_flow_error_set(struct rte_flow_error *error,
 		   const void *cause,
 		   const char *message);
 
-/**
- * @deprecated
- * @see rte_flow_copy()
- */
-struct rte_flow_desc {
-	size_t size; /**< Allocated space including data[]. */
-	struct rte_flow_attr attr; /**< Attributes. */
-	struct rte_flow_item *items; /**< Items. */
-	struct rte_flow_action *actions; /**< Actions. */
-	uint8_t data[]; /**< Storage for items/actions. */
-};
-
-/**
- * @deprecated
- * Copy an rte_flow rule description.
- *
- * This interface is kept for compatibility with older applications but is
- * implemented as a wrapper to rte_flow_conv(). It is deprecated due to its
- * lack of flexibility and reliance on a type unusable with C++ programs
- * (struct rte_flow_desc).
- *
- * @param[in] fd
- *   Flow rule description.
- * @param[in] len
- *   Total size of allocated data for the flow description.
- * @param[in] attr
- *   Flow rule attributes.
- * @param[in] items
- *   Pattern specification (list terminated by the END pattern item).
- * @param[in] actions
- *   Associated actions (list terminated by the END action).
- *
- * @return
- *   If len is greater or equal to the size of the flow, the total size of the
- *   flow description and its data.
- *   If len is lower than the size of the flow, the number of bytes that would
- *   have been written to desc had it been sufficient. Nothing is written.
- */
-__rte_deprecated
-size_t
-rte_flow_copy(struct rte_flow_desc *fd, size_t len,
-	      const struct rte_flow_attr *attr,
-	      const struct rte_flow_item *items,
-	      const struct rte_flow_action *actions);
-
 /**
  * Flow object conversion helper.
  *
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-01 23:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 23:10 [PATCH 1/2] ethdev: remove deprecated flow copy API Stephen Hemminger
2026-09-01 23:10 ` [PATCH 2/2] ethdev: remove deprecated shared flow action Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.