common/sfc_efx/base: do not validate MAE action COUNT order
authorIvan Malov <ivan.malov@oktetlabs.ru>
Thu, 29 Jul 2021 09:32:59 +0000 (12:32 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 30 Jul 2021 11:14:50 +0000 (13:14 +0200)
In DPDK + Open vSwitch use case, action COUNT is always the
first one to be added. In particular, it goes before action
DECAP in that use case. The current code enforces the right
order (DECAP goes before COUNT), and this provokes failures.
As an exception, do not validate the order for action COUNT.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/common/sfc_efx/base/efx.h
drivers/common/sfc_efx/base/efx_mae.c

index b2301b8..24e1314 100644 (file)
@@ -4310,6 +4310,18 @@ efx_mae_action_set_populate_encap(
 /*
  * Use efx_mae_action_set_fill_in_counter_id() to set ID of a counter
  * in the specification prior to action set allocation.
+ *
+ * NOTICE: the HW will conduct action COUNT after actions DECAP,
+ * VLAN_POP, VLAN_PUSH (if any) have been applied to the packet,
+ * but, as a workaround, this order is not validated by the API.
+ *
+ * The workaround helps to unblock DPDK + Open vSwitch use case.
+ * In Open vSwitch, this action is always the first to be added,
+ * in particular, it's known to be inserted before action DECAP,
+ * so enforcing the right order here would cause runtime errors.
+ * The existing behaviour in Open vSwitch is unlikely to change
+ * any time soon, and the workaround is a good solution because
+ * in fact the real COUNT order is a don't care to Open vSwitch.
  */
 LIBEFX_API
 extern __checkReturn                   efx_rc_t
index 47e809a..c22206e 100644 (file)
@@ -1547,6 +1547,7 @@ static const uint32_t efx_mae_action_ordered_map =
  * strictly ordered actions.
  */
 static const uint32_t efx_mae_action_nonstrict_map =
+       (1U << EFX_MAE_ACTION_COUNT) |
        (1U << EFX_MAE_ACTION_FLAG) |
        (1U << EFX_MAE_ACTION_MARK);