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 9E9EF45C9F; Thu, 7 Nov 2024 14:47:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC53A42FB1; Thu, 7 Nov 2024 14:47:23 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id ECD7142F79 for ; Thu, 7 Nov 2024 14:47:21 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2e30db524c2so790872a91.1 for ; Thu, 07 Nov 2024 05:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1730987240; x=1731592040; 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=H1F/jvYWT5f2h4A7lmYgNGWw8TSi8y2gFfq3lSXocuM=; b=dmfY5aZnXXxMLxOe5XIgnKQk5VR51jUj6us3zkS73wcyQPcUwzMxEymrOiqwX0U5tt slK7ZesnsAConq3BMwEj38c0+Tb059t3xmGPT2iXw5FluZ0LxKOzkjwZ49KD1oQNDqiw dZaxzP+4yX/RGYfUYBF90GgExULIB4pklMmsw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730987240; x=1731592040; 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=H1F/jvYWT5f2h4A7lmYgNGWw8TSi8y2gFfq3lSXocuM=; b=nh2UF8+o13iiXJCOZzURfdvfmnCO76KKA9RZqngXvgaC4vEFFjEDBXZzgt5zQpsxVw 0t7ujhG0L5pUXgTko7zFkPUNe55Yqzb80VN8+0KHTgy1bdSz66i/pGAK+auPs571gTpS 5LIApCCvtDCr90O5gBj4THQLQ0pbfzMsDEUH8bf9vwilAQJOL83AyDS0nVupu28iWujY atIY/tBpSIjWChESAhyPO7AiCyAslCC+I4oi05zYDFUYUbjJ2i7V5RTvPaJmNzzX3/H7 RKIAkEPP9/Gf7AT7WolDROtmza/uu+aBaG2D7Ko4878aPW+4yYKn7SYOOKOwAC8rESR/ 5itA== X-Gm-Message-State: AOJu0YxqEWQOchUVZV3s5weBNXv4iBuo0B0WFwltSDSD6fmnDbtbSCJB +5VcL41Q0lscb+9QPLM7cYwUFbJH+9VlSnAEuPBxVQJoGZemENt/n3DMh3uWD8Zegbvs3V8y16m r0m+OBeRGBWJuQGjl4bUAwfyT4MJ+0NPr2OvGnDeYnGhyCkgrC23Bq9ZHuTGCzyO6hNjaHM3Prh diC43AbWjnNYjW8vUtZ0UHg7pDqWRozIAktd8IfglIdA== X-Google-Smtp-Source: AGHT+IHY032EHzR9W4MyknBLuoHD2KqAqCWcuM/SUozkWcWv3zHp85/dLpdl2c/MyacHn370fji/Ug== X-Received: by 2002:a17:90b:3c49:b0:2d8:8430:8a91 with SMTP id 98e67ed59e1d1-2e94c2b3825mr34768540a91.10.1730987240273; Thu, 07 Nov 2024 05:47:20 -0800 (PST) Received: from dhcp-10-123-154-23.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e9a5f52969sm1409878a91.2.2024.11.07.05.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 05:47:19 -0800 (PST) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Kishore Padmanabha , Sriharsha Basavapatna , Shahaji Bhosle , Ajit Khaparde Subject: [PATCH v8 44/47] net/bnxt: tf_ulp: enable support for truflow feature configuration Date: Thu, 7 Nov 2024 19:22:51 +0530 Message-Id: <20241107135254.1611676-45-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 In-Reply-To: <20241107135254.1611676-1-sriharsha.basavapatna@broadcom.com> References: <20241107135254.1611676-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 application. 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 a1fd00f002..5ca99780e2 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