net/bnxt: add capability option for socket redirect
Added support for socket redirect feature capability so applications can enable or disable this feature. This patch contains the template changes. Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Mike Baucom <michael.baucom@broadcom.com> Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
parent
06d1a5d056
commit
be3af03f55
@ -154,6 +154,7 @@ New Features
|
||||
* Implement support for tunnel offload.
|
||||
* Updated HWRM API to version 1.10.2.68.
|
||||
* Added NAT support for dest IP and port combination.
|
||||
* Added support for socket redirection.
|
||||
|
||||
* **Updated Cisco enic driver.**
|
||||
|
||||
|
@ -301,13 +301,14 @@ bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx,
|
||||
}
|
||||
|
||||
int32_t
|
||||
bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,
|
||||
bnxt_ulp_cntxt_app_caps_init(struct bnxt *bp,
|
||||
uint8_t app_id, uint32_t dev_id)
|
||||
{
|
||||
struct bnxt_ulp_app_capabilities_info *info;
|
||||
uint32_t num = 0;
|
||||
uint16_t i;
|
||||
bool found = false;
|
||||
struct bnxt_ulp_context *ulp_ctx = bp->ulp_ctx;
|
||||
|
||||
if (ULP_APP_DEV_UNSUPPORTED_ENABLED(ulp_ctx->cfg_data->ulp_flags)) {
|
||||
BNXT_TF_DBG(ERR, "APP ID %d, Device ID: 0x%x not supported.\n",
|
||||
@ -334,6 +335,12 @@ bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,
|
||||
if (info[i].flags & BNXT_ULP_APP_CAP_UNICAST_ONLY)
|
||||
ulp_ctx->cfg_data->ulp_flags |=
|
||||
BNXT_ULP_APP_UNICAST_ONLY;
|
||||
if (info[i].flags & BNXT_ULP_APP_CAP_SOCKET_DIRECT) {
|
||||
/* Enable socket direction only if MR is enabled in fw*/
|
||||
if (BNXT_MULTIROOT_EN(bp))
|
||||
ulp_ctx->cfg_data->ulp_flags |=
|
||||
BNXT_ULP_APP_SOCKET_DIRECT;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
BNXT_TF_DBG(ERR, "APP ID %d, Device ID: 0x%x not supported.\n",
|
||||
@ -832,7 +839,7 @@ ulp_ctx_init(struct bnxt *bp,
|
||||
}
|
||||
BNXT_TF_DBG(DEBUG, "Ulp initialized with app id %d\n", bp->app_id);
|
||||
|
||||
rc = bnxt_ulp_cntxt_app_caps_init(bp->ulp_ctx, bp->app_id, devid);
|
||||
rc = bnxt_ulp_cntxt_app_caps_init(bp, bp->app_id, devid);
|
||||
if (rc) {
|
||||
BNXT_TF_DBG(ERR, "Unable to set caps for app(%x)/dev(%x)\n",
|
||||
bp->app_id, devid);
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "rte_version.h"
|
||||
#include "rte_ethdev.h"
|
||||
|
||||
#include "bnxt.h"
|
||||
#include "ulp_template_db_enum.h"
|
||||
#include "ulp_tun.h"
|
||||
#include "bnxt_tf_common.h"
|
||||
@ -33,12 +34,15 @@
|
||||
#define BNXT_ULP_APP_DEV_UNSUPPORTED 0x4
|
||||
#define BNXT_ULP_HIGH_AVAIL_ENABLED 0x8
|
||||
#define BNXT_ULP_APP_UNICAST_ONLY 0x10
|
||||
#define BNXT_ULP_APP_SOCKET_DIRECT 0x20
|
||||
|
||||
#define ULP_VF_REP_IS_ENABLED(flag) ((flag) & BNXT_ULP_VF_REP_ENABLED)
|
||||
#define ULP_SHARED_SESSION_IS_ENABLED(flag) ((flag) &\
|
||||
BNXT_ULP_SHARED_SESSION_ENABLED)
|
||||
#define ULP_APP_DEV_UNSUPPORTED_ENABLED(flag) ((flag) &\
|
||||
BNXT_ULP_APP_DEV_UNSUPPORTED)
|
||||
#define ULP_HIGH_AVAIL_IS_ENABLED(flag) ((flag) & BNXT_ULP_HIGH_AVAIL_ENABLED)
|
||||
#define ULP_SOCKET_DIRECT_IS_ENABLED(flag) ((flag) & BNXT_ULP_APP_SOCKET_DIRECT)
|
||||
|
||||
enum bnxt_ulp_flow_mem_type {
|
||||
BNXT_ULP_FLOW_MEM_TYPE_INT = 0,
|
||||
@ -287,7 +291,7 @@ struct bnxt_ulp_app_capabilities_info *
|
||||
bnxt_ulp_app_cap_list_get(uint32_t *num_entries);
|
||||
|
||||
int32_t
|
||||
bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,
|
||||
bnxt_ulp_cntxt_app_caps_init(struct bnxt *bp,
|
||||
uint8_t app_id, uint32_t dev_id);
|
||||
|
||||
struct bnxt_ulp_resource_resv_info *
|
||||
|
@ -115,9 +115,11 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
|
||||
ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_FLOW_SIG_ID,
|
||||
params->flow_sig_id);
|
||||
|
||||
if (bnxt_ulp_cntxt_ptr2_ulp_flags_get(params->ulp_ctx, &ulp_flags))
|
||||
return;
|
||||
|
||||
/* update the WC Priority flag */
|
||||
if (!bnxt_ulp_cntxt_ptr2_ulp_flags_get(params->ulp_ctx, &ulp_flags) &&
|
||||
ULP_HIGH_AVAIL_IS_ENABLED(ulp_flags)) {
|
||||
if (ULP_HIGH_AVAIL_IS_ENABLED(ulp_flags)) {
|
||||
enum ulp_ha_mgr_region region = ULP_HA_REGION_LOW;
|
||||
int32_t rc;
|
||||
|
||||
@ -129,6 +131,10 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
|
||||
BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG,
|
||||
1);
|
||||
}
|
||||
|
||||
/* Update the socket direct flag */
|
||||
if (ULP_SOCKET_DIRECT_IS_ENABLED(ulp_flags))
|
||||
ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_SOCKET_DIRECT, 1);
|
||||
}
|
||||
|
||||
/* Function to create the rte flow. */
|
||||
|
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/* date: Thu Aug 26 17:43:36 2021 */
|
||||
/* date: Thu Sep 9 11:11:05 2021 */
|
||||
|
||||
#ifndef ULP_TEMPLATE_DB_H_
|
||||
#define ULP_TEMPLATE_DB_H_
|
||||
@ -211,7 +211,8 @@ enum bnxt_ulp_cf_idx {
|
||||
BNXT_ULP_CF_IDX_OI_VLAN_FB_VID = 71,
|
||||
BNXT_ULP_CF_IDX_IO_VLAN_FB_VID = 72,
|
||||
BNXT_ULP_CF_IDX_II_VLAN_FB_VID = 73,
|
||||
BNXT_ULP_CF_IDX_LAST = 74
|
||||
BNXT_ULP_CF_IDX_SOCKET_DIRECT = 74,
|
||||
BNXT_ULP_CF_IDX_LAST = 75
|
||||
};
|
||||
|
||||
enum bnxt_ulp_cond_list_opc {
|
||||
@ -582,7 +583,8 @@ enum bnxt_ulp_template_type {
|
||||
enum bnxt_ulp_app_cap {
|
||||
BNXT_ULP_APP_CAP_SHARED_EN = 0x00000001,
|
||||
BNXT_ULP_APP_CAP_HOT_UPGRADE_EN = 0x00000002,
|
||||
BNXT_ULP_APP_CAP_UNICAST_ONLY = 0x00000004
|
||||
BNXT_ULP_APP_CAP_UNICAST_ONLY = 0x00000004,
|
||||
BNXT_ULP_APP_CAP_SOCKET_DIRECT = 0x00000008
|
||||
};
|
||||
|
||||
enum bnxt_ulp_fdb_resource_flags {
|
||||
|
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
/* date: Thu Aug 26 17:43:36 2021 */
|
||||
/* date: Thu Sep 9 11:11:05 2021 */
|
||||
|
||||
#include "ulp_template_db_enum.h"
|
||||
#include "ulp_template_db_field.h"
|
||||
@ -347,7 +347,8 @@ struct bnxt_ulp_app_capabilities_info ulp_app_cap_info_list[] = {
|
||||
.device_id = BNXT_ULP_DEVICE_ID_THOR,
|
||||
.flags = BNXT_ULP_APP_CAP_SHARED_EN |
|
||||
BNXT_ULP_APP_CAP_HOT_UPGRADE_EN |
|
||||
BNXT_ULP_APP_CAP_UNICAST_ONLY
|
||||
BNXT_ULP_APP_CAP_UNICAST_ONLY |
|
||||
BNXT_ULP_APP_CAP_SOCKET_DIRECT
|
||||
},
|
||||
{
|
||||
.app_id = 2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user