From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3473A45B90; Mon, 21 Oct 2024 10:20:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3CFB3402E7; Mon, 21 Oct 2024 10:20:03 +0200 (CEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 092A84028C for ; Mon, 21 Oct 2024 10:20:02 +0200 (CEST) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-71e983487a1so2922128b3a.2 for ; Mon, 21 Oct 2024 01:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1729498801; x=1730103601; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tap2oW8GY/r9Lk+p4bezxIrlFIdNgZ2fmURtUUB+h8o=; b=YE1ZsYuVPWxwv5/vOyF0Q6HOjK/d21Z2DJe9LKstC6NzDVVBOEeu2SbhqLmzrC9S0D 0QhfRN4uYU+uGVmPwgfUDj2225nVtw+9JEU48HZxB5zYfkEis0czTFb2EZoUgAvBfyZa H5g9gQ1PgqHuw01BqQ5fW448ExpXGifeN6KOw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729498801; x=1730103601; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tap2oW8GY/r9Lk+p4bezxIrlFIdNgZ2fmURtUUB+h8o=; b=Xa8kehBykjjk6g/BsoHaptQOsgx8FTyu1YQ0S852Y62md70C4sanR8ZoCriYGTNFTW oX6Y9KpgErn9a+bbScfZo2uuuSZNj7o0pyIm7ob/M19nw1ztBOVqB4y5y6n30mrQrc2e pAcC3t7saDrU2BbN2Psj/2PRsfHLAbLkn7/Yw4YQbcxm9pVbZnGLwAv3ww+sBjMIyRRD YYVq6bO7QtpGVBFWqKOVr461XYg0MoXYLQ/cja/parcC2tbM7wNkFQVm52JGS95bPy6L PUGc6xDSrudaPx5sz+D/H0g/pWaQMbocVtNJk6H4K1zZjL/GU7ER16NzZQHwosZ0YoUR y4+Q== X-Gm-Message-State: AOJu0YzY83ioGEAuGtmQYNAuo9FqWaSL0K50CVqnJ3A+E4XZKLcDiDbL p/VJ3BzbhnVq/4jjVQgfy7YYtEYUy1uL4z7Q4hP9ERJwplH/TggbGwl2X6uULlvXV1KJqOfts40 wItvXlo6kVUiUOMRkUEzzs0d3u8a92mBBbCKQ6AwLrJ77uxoHF6Hf2XGypSu0LVYjKtgG7f+mj6 S9z+hTCS9//0gIjxTr+s5ve2laDSiKRxDh78k6VMGs7w== X-Google-Smtp-Source: AGHT+IElgraPqOqQ6bFUo78kk2VZstXFUly+hGUutwl8HAQAIDwH9GWhGGxbUiBzX9BR3AHNpe6QUA== X-Received: by 2002:a05:6a00:988:b0:71d:f4ef:6b3a with SMTP id d2e1a72fcca58-71ea3306e65mr15862639b3a.21.1729498800505; Mon, 21 Oct 2024 01:20:00 -0700 (PDT) Received: from dhcp-10-123-154-23.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec1313926sm2291631b3a.4.2024.10.21.01.19.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 01:20:00 -0700 (PDT) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Kishore Padmanabha , Sriharsha Basavapatna , Shahaji Bhosle , Ajit Khaparde Subject: [PATCH v6 44/47] net/bnxt: tf_ulp: enable support for truflow feature configuration Date: Mon, 21 Oct 2024 13:56:04 +0530 Message-Id: <20241021082607.232829-45-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 In-Reply-To: <20241021082607.232829-1-sriharsha.basavapatna@broadcom.com> References: <20241021082607.232829-1-sriharsha.basavapatna@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Kishore Padmanabha Added truflow feature bit meson configuration parameter to enable optional capability features of the appplication. Signed-off-by: Kishore Padmanabha Signed-off-by: Sriharsha Basavapatna Reviewed-by: Shahaji Bhosle Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c | 6 ++++- drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c | 6 ++++- drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h | 32 ++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c index c591f9327c..fa7e8fe000 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c @@ -476,7 +476,11 @@ ulp_tf_cntxt_app_caps_init(struct bnxt *bp, info[i].min_flow_priority); bnxt_ulp_max_flow_priority_set(ulp_ctx, info[i].max_flow_priority); - ulp_ctx->cfg_data->feature_bits = info[i].feature_bits; + /* Update the capability feature bits*/ + if (bnxt_ulp_cap_feat_process(info[i].feature_bits, + &ulp_ctx->cfg_data->feature_bits)) + return -EINVAL; + bnxt_ulp_cntxt_ptr2_default_class_bits_set(ulp_ctx, info[i].default_class_bits); bnxt_ulp_cntxt_ptr2_default_act_bits_set(ulp_ctx, diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c index ebbc5a85a9..d83f3df884 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c @@ -536,7 +536,11 @@ ulp_tfc_cntxt_app_caps_init(struct bnxt *bp, uint8_t app_id, uint32_t dev_id) "Socket Direct feature is enabled\n"); } } - ulp_ctx->cfg_data->feature_bits = info[i].feature_bits; + /* Update the capability feature bits*/ + if (bnxt_ulp_cap_feat_process(info[i].feature_bits, + &ulp_ctx->cfg_data->feature_bits)) + return -EINVAL; + bnxt_ulp_default_app_priority_set(ulp_ctx, info[i].default_priority); bnxt_ulp_max_def_priority_set(ulp_ctx, diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h b/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h index 26087526e8..edc75da05e 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h @@ -1035,4 +1035,36 @@ bnxt_ulp_vfr_session_fid_rem(struct bnxt_ulp_context *ulp_ctx, return rc; } +static inline int32_t +bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits) +{ +#ifdef RTE_BNXT_TF_FEAT_BITS + uint64_t bit = RTE_BNXT_TF_FEAT_BITS; +#else + uint64_t bit = 0; +#endif + + *out_bits = 0; + if ((feat_bits | bit) != feat_bits) { + BNXT_DRV_DBG(ERR, "Invalid TF feature bit is set %" PRIu64 "\n", + bit); + return -EINVAL; + } + if ((bit & BNXT_ULP_FEATURE_BIT_PARENT_DMAC) && + (bit & BNXT_ULP_FEATURE_BIT_PORT_DMAC)) { + BNXT_DRV_DBG(ERR, "Invalid both Port and Parent Mac set\n"); + return -EINVAL; + } + + if (bit & BNXT_ULP_FEATURE_BIT_PARENT_DMAC) + BNXT_DRV_DBG(ERR, "Parent Mac Address Feature is enabled\n"); + if (bit & BNXT_ULP_FEATURE_BIT_PORT_DMAC) + BNXT_DRV_DBG(ERR, "Port Mac Address Feature is enabled\n"); + if (bit & BNXT_ULP_FEATURE_BIT_MULTI_TUNNEL_FLOW) + BNXT_DRV_DBG(ERR, "Multi Tunnel Flow Feature is enabled\n"); + + *out_bits = bit; + return 0; +} + #endif /* _BNXT_ULP_UTILS_H_ */ -- 2.39.3