From patchwork Thu Jul 29 09:32:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 96390 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD19AA0C40; Thu, 29 Jul 2021 11:33:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 616B240687; Thu, 29 Jul 2021 11:33:15 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id EF96440041 for ; Thu, 29 Jul 2021 11:33:13 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.226]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 4E8AA7F510; Thu, 29 Jul 2021 12:33:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 4E8AA7F510 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1627551193; bh=CHfCLCN96jzNr9FFHm2gQMf6GIdO5nQKNgi9cgYWJJg=; h=From:To:Cc:Subject:Date; b=C7VNBcr8Qukf6xNbQPNAQRu6v51MPVRTPKhXj3cxmnJ5vt/8D/RFrprbCxzKtCLUP 1i4w/Fh/pEnUUvkdy/+fsb9Y+t9tGx9EmYkPVF0o3ThIRyFQrxnP8Lky91dgIpPTlX JSLjn//6gkjOwXUQVLgQhqsx5umF3odzeT6KjRb4= From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Andy Moreton Date: Thu, 29 Jul 2021 12:32:59 +0300 Message-Id: <20210729093259.14876-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] common/sfc_efx/base: do not validate MAE action COUNT order X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx.h | 12 ++++++++++++ drivers/common/sfc_efx/base/efx_mae.c | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index b2301b845a..24e1314cc3 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -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 diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index 47e809a22f..c22206e227 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -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);