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 AEB83458A8; Fri, 30 Aug 2024 15:56:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 486AA42EE2; Fri, 30 Aug 2024 15:55:43 +0200 (CEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 214D642EDB for ; Fri, 30 Aug 2024 15:55:42 +0200 (CEST) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-20536dcc6e9so3129935ad.2 for ; Fri, 30 Aug 2024 06:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725026141; x=1725630941; 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=9c8sZuxDUk97csj/BNXHTrypeAKMVndIuFwwfteK5RI=; b=c/nuGCwvV/vr2f/uByGRZ3MvIhq7Maz6FwMBsG9gixAgpfwwSvmU7OPR+m7C3/NM5n B46v5PbUMGS+/hZFD+BzqOfCPyspEUtJU+Uxb5MIPh1rUKhrqQEMcjVs1IHg2tBFA0kU 7HrO4Tn5iEQWy0JlbHuygD23CSCCHqE8KskxE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725026141; x=1725630941; 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=9c8sZuxDUk97csj/BNXHTrypeAKMVndIuFwwfteK5RI=; b=pamJ3E8oOnXqPYB3CfXErvA7HuBeQTV8btTlRNfQUHeM6bDUrPz2DDSOM9IK0EaGii zNTTGBGN7aNuSVpvKiNo5ZWtN71NZIE7LknZYqH1zGbC7xe5BMwhwCGNwA5edeqeE2ig DASdKVrHQyRu3om2tHfs7ogiv+ZWJ/JAHu1iD682cux8JXo527pz2QvwR8migu3H9TGs sPiFNdSvXv1TmLTkKi0wXeA7MxtZ1aZVaBNqUBFntsy9lDlnlLWG3/jtSZAyq2ypLjc7 wZ7CvofGnYNRsuIvVcxH3cFHEWaXnQxRZmNybg5g4q2vkD+gQ/uiGDCGtoPbBFCstsi5 l7Sw== X-Gm-Message-State: AOJu0YzbJZqdch1y/K9fkzC5Lq6L+ZOvVIIYSmnmlhRT9OLxebpQPCkY cMbXKBJJQ/W4cdTED3sLcAEitRr4AarQzViAx4AgAMdP65Ii5pwp8MuIQpcqSZ0cC3WtPombSLe IGLbZr0TZROIuJlRLEREXv1Xc+m7TK+lTtdM2riWfxqjqADFueR4prS+zlxv2sb0PrwChcy/ab4 5iVwjFy0XzwFNC3W0aZqhDEdI0sucALtCaS/z10iNk/mYo X-Google-Smtp-Source: AGHT+IHL6uDOoD4GD9+y2vkxNje4MIn+kZdUcPlaUeHRspJuvDqZoUPEwqfumuBWP1moh14MmbtPEw== X-Received: by 2002:a17:903:2350:b0:203:a114:2fd3 with SMTP id d9443c01a7336-2050c215a54mr79660765ad.13.1725026140780; Fri, 30 Aug 2024 06:55:40 -0700 (PDT) Received: from dhcp-10-123-154-23.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-205155658dfsm27067145ad.297.2024.08.30.06.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 06:55:40 -0700 (PDT) From: Sriharsha Basavapatna To: dev@dpdk.org Cc: Kishore Padmanabha , Shahaji Bhosle , Sriharsha Basavapatna Subject: [PATCH 44/47] net/bnxt: tf_ulp: enable support for truflow feature configuration Date: Fri, 30 Aug 2024 19:30:46 +0530 Message-Id: <20240830140049.1715230-45-sriharsha.basavapatna@broadcom.com> X-Mailer: git-send-email 2.39.0.189.g4dbebc36b0 In-Reply-To: <20240830140049.1715230-1-sriharsha.basavapatna@broadcom.com> References: <20240830140049.1715230-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 Reviewed-by: Shahaji Bhosle Signed-off-by: Sriharsha Basavapatna --- 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 31ab61b512..cc779826a5 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