git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/bnxt: fix out of bound access in bit handling
[dpdk.git]
/
drivers
/
net
/
bnxt
/
tf_core
/
tf_msg.c
diff --git
a/drivers/net/bnxt/tf_core/tf_msg.c
b/drivers/net/bnxt/tf_core/tf_msg.c
index
2e2d426
..
7c2ad17
100644
(file)
--- a/
drivers/net/bnxt/tf_core/tf_msg.c
+++ b/
drivers/net/bnxt/tf_core/tf_msg.c
@@
-28,7
+28,6
@@
*/
#define TF_MSG_SET_GLOBAL_CFG_DATA_SIZE 16
#define TF_MSG_EM_INSERT_KEY_SIZE 64
*/
#define TF_MSG_SET_GLOBAL_CFG_DATA_SIZE 16
#define TF_MSG_EM_INSERT_KEY_SIZE 64
-#define TF_MSG_TCAM_SET_DEV_DATA_SIZE 88
#define TF_MSG_TBL_TYPE_SET_DATA_SIZE 88
/* Compile check - Catch any msg changes that we depend on, like the
#define TF_MSG_TBL_TYPE_SET_DATA_SIZE 88
/* Compile check - Catch any msg changes that we depend on, like the
@@
-1251,8
+1250,8
@@
tf_msg_get_if_tbl_entry(struct tf *tfp,
{
int rc = 0;
struct tfp_send_msg_parms parms = { 0 };
{
int rc = 0;
struct tfp_send_msg_parms parms = { 0 };
-
tf_if_tbl_get_input_
t req = { 0 };
-
tf_if_tbl_get_output_t resp
;
+
struct hwrm_tf_if_tbl_get_inpu
t req = { 0 };
+
struct hwrm_tf_if_tbl_get_output resp = { 0 }
;
uint32_t flags = 0;
struct tf_session *tfs;
uint32_t flags = 0;
struct tf_session *tfs;
@@
-1266,25
+1265,26
@@
tf_msg_get_if_tbl_entry(struct tf *tfp,
return rc;
}
return rc;
}
- flags = (params->dir == TF_DIR_TX ? TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX :
- TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX);
+ flags = (params->dir == TF_DIR_TX ?
+ HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX :
+ HWRM_TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX);
/* Populate the request */
req.fw_session_id =
tfp_cpu_to_le_32(tfs->session_id.internal.fw_session_id);
req.flags = flags;
/* Populate the request */
req.fw_session_id =
tfp_cpu_to_le_32(tfs->session_id.internal.fw_session_id);
req.flags = flags;
- req.t
f_if_tbl_t
ype = params->hcapi_type;
- req.i
d
x = tfp_cpu_to_le_16(params->idx);
- req.
data_sz_in_bytes
= tfp_cpu_to_le_16(params->data_sz_in_bytes);
+ req.type = params->hcapi_type;
+ req.i
nde
x = tfp_cpu_to_le_16(params->idx);
+ req.
size
= tfp_cpu_to_le_16(params->data_sz_in_bytes);
- MSG_PREP(parms,
- TF_KONG_MB,
- HWRM_TF,
- HWRM_TFT_IF_TBL_GET,
- req,
-
resp)
;
+ parms.tf_type = HWRM_TF_IF_TBL_GET;
+ parms.req_data = (uint32_t *)&req;
+ parms.req_size = sizeof(req);
+ parms.resp_data = (uint32_t *)&resp;
+ parms.resp_size = sizeof(resp);
+
parms.mailbox = TF_KONG_MB
;
- rc = tfp_send_msg_
tunneled
(tfp, &parms);
+ rc = tfp_send_msg_
direct
(tfp, &parms);
if (rc != 0)
return rc;
if (rc != 0)
return rc;
@@
-1292,7
+1292,7
@@
tf_msg_get_if_tbl_entry(struct tf *tfp,
if (parms.tf_resp_code != 0)
return tfp_le_to_cpu_32(parms.tf_resp_code);
if (parms.tf_resp_code != 0)
return tfp_le_to_cpu_32(parms.tf_resp_code);
- tfp_memcpy(¶ms->data[0], resp.data, req.
data_sz_in_bytes
);
+ tfp_memcpy(¶ms->data[0], resp.data, req.
size
);
return tfp_le_to_cpu_32(parms.tf_resp_code);
}
return tfp_le_to_cpu_32(parms.tf_resp_code);
}
@@
-1303,7
+1303,8
@@
tf_msg_set_if_tbl_entry(struct tf *tfp,
{
int rc = 0;
struct tfp_send_msg_parms parms = { 0 };
{
int rc = 0;
struct tfp_send_msg_parms parms = { 0 };
- tf_if_tbl_set_input_t req = { 0 };
+ struct hwrm_tf_if_tbl_set_input req = { 0 };
+ struct hwrm_tf_if_tbl_get_output resp = { 0 };
uint32_t flags = 0;
struct tf_session *tfs;
uint32_t flags = 0;
struct tf_session *tfs;
@@
-1318,25
+1319,27
@@
tf_msg_set_if_tbl_entry(struct tf *tfp,
}
}
- flags = (params->dir == TF_DIR_TX ? TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX :
- TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX);
+ flags = (params->dir == TF_DIR_TX ?
+ HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX :
+ HWRM_TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX);
/* Populate the request */
req.fw_session_id =
tfp_cpu_to_le_32(tfs->session_id.internal.fw_session_id);
req.flags = flags;
/* Populate the request */
req.fw_session_id =
tfp_cpu_to_le_32(tfs->session_id.internal.fw_session_id);
req.flags = flags;
- req.t
f_if_tbl_t
ype = params->hcapi_type;
- req.i
d
x = tfp_cpu_to_le_32(params->idx);
- req.
data_sz_in_bytes
= tfp_cpu_to_le_32(params->data_sz_in_bytes);
+ req.type = params->hcapi_type;
+ req.i
nde
x = tfp_cpu_to_le_32(params->idx);
+ req.
size
= tfp_cpu_to_le_32(params->data_sz_in_bytes);
tfp_memcpy(&req.data[0], params->data, params->data_sz_in_bytes);
tfp_memcpy(&req.data[0], params->data, params->data_sz_in_bytes);
- MSG_PREP_NO_RESP(parms,
- TF_KONG_MB,
- HWRM_TF,
- HWRM_TFT_IF_TBL_SET,
- req);
+ parms.tf_type = HWRM_TF_IF_TBL_SET;
+ parms.req_data = (uint32_t *)&req;
+ parms.req_size = sizeof(req);
+ parms.resp_data = (uint32_t *)&resp;
+ parms.resp_size = sizeof(resp);
+ parms.mailbox = TF_KONG_MB;
- rc = tfp_send_msg_
tunneled
(tfp, &parms);
+ rc = tfp_send_msg_
direct
(tfp, &parms);
if (rc != 0)
return rc;
if (rc != 0)
return rc;