#include "bnxt_nvm_defs.h"
#include "bnxt_tf_common.h"
#include "ulp_flow_db.h"
+#include "rte_pmd_bnxt.h"
#define DRV_MODULE_NAME "bnxt"
static const char bnxt_version[] =
*/
#define BNXT_DEVARG_REP_FC_F2R_INVALID(rep_fc_f2r) ((rep_fc_f2r) > 1)
+int bnxt_cfa_code_dynfield_offset = -1;
+
/*
* max_num_kflows must be >= 32
* and must be a power-of-2 supported value
if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) {
PMD_DRV_LOG(ERR,
- "RxQ cnt %d > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n",
+ "RxQ cnt %d > RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n",
bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
}
.tx_burst_mode_get = bnxt_tx_burst_mode_get,
.dev_led_on = bnxt_dev_led_on_op,
.dev_led_off = bnxt_dev_led_off_op,
- .xstats_get_by_id = bnxt_dev_xstats_get_by_id_op,
- .xstats_get_names_by_id = bnxt_dev_xstats_get_names_by_id_op,
.rx_queue_start = bnxt_rx_queue_start,
.rx_queue_stop = bnxt_rx_queue_stop,
.tx_queue_start = bnxt_tx_queue_start,
pci_dev->id.device_id == BROADCOM_DEV_ID_58802_VF)
bp->flags |= BNXT_FLAG_STINGRAY;
+ if (BNXT_TRUFLOW_EN(bp)) {
+ /* extra mbuf field is required to store CFA code from mark */
+ static const struct rte_mbuf_dynfield bnxt_cfa_code_dynfield_desc = {
+ .name = RTE_PMD_BNXT_CFA_CODE_DYNFIELD_NAME,
+ .size = sizeof(bnxt_cfa_code_dynfield_t),
+ .align = __alignof__(bnxt_cfa_code_dynfield_t),
+ };
+ bnxt_cfa_code_dynfield_offset =
+ rte_mbuf_dynfield_register(&bnxt_cfa_code_dynfield_desc);
+ if (bnxt_cfa_code_dynfield_offset < 0) {
+ PMD_DRV_LOG(ERR,
+ "Failed to register mbuf field for TruFlow mark\n");
+ return -rte_errno;
+ }
+ }
+
rc = bnxt_init_board(eth_dev);
if (rc) {
PMD_DRV_LOG(ERR,
struct bnxt *backing_bp;
uint16_t num_rep;
int i, ret = 0;
- struct rte_kvargs *kvlist;
+ struct rte_kvargs *kvlist = NULL;
num_rep = eth_da.nb_representor_ports;
if (num_rep > BNXT_MAX_VF_REPS) {
* Invoked as for ex: "-w 000:00:0d.0,
* rep-based-pf=<pf index> rep-is-pf=<VF=0 or PF=1>"
*/
- rte_kvargs_process(kvlist, BNXT_DEVARG_REP_IS_PF,
- bnxt_parse_devarg_rep_is_pf,
- (void *)&representor);
+ ret = rte_kvargs_process(kvlist, BNXT_DEVARG_REP_IS_PF,
+ bnxt_parse_devarg_rep_is_pf,
+ (void *)&representor);
+ if (ret) {
+ ret = -EINVAL;
+ goto err;
+ }
/*
* Handler for "rep_based_pf" devarg.
* Invoked as for ex: "-w 000:00:0d.0,
* rep-based-pf=<pf index> rep-is-pf=<VF=0 or PF=1>"
*/
- rte_kvargs_process(kvlist, BNXT_DEVARG_REP_BASED_PF,
- bnxt_parse_devarg_rep_based_pf,
- (void *)&representor);
+ ret = rte_kvargs_process(kvlist,
+ BNXT_DEVARG_REP_BASED_PF,
+ bnxt_parse_devarg_rep_based_pf,
+ (void *)&representor);
+ if (ret) {
+ ret = -EINVAL;
+ goto err;
+ }
/*
* Handler for "rep_based_pf" devarg.
* Invoked as for ex: "-w 000:00:0d.0,
* rep-based-pf=<pf index> rep-is-pf=<VF=0 or PF=1>"
*/
- rte_kvargs_process(kvlist, BNXT_DEVARG_REP_Q_R2F,
- bnxt_parse_devarg_rep_q_r2f,
- (void *)&representor);
+ ret = rte_kvargs_process(kvlist, BNXT_DEVARG_REP_Q_R2F,
+ bnxt_parse_devarg_rep_q_r2f,
+ (void *)&representor);
+ if (ret) {
+ ret = -EINVAL;
+ goto err;
+ }
/*
* Handler for "rep_based_pf" devarg.
* Invoked as for ex: "-w 000:00:0d.0,
* rep-based-pf=<pf index> rep-is-pf=<VF=0 or PF=1>"
*/
- rte_kvargs_process(kvlist, BNXT_DEVARG_REP_Q_F2R,
- bnxt_parse_devarg_rep_q_f2r,
- (void *)&representor);
+ ret = rte_kvargs_process(kvlist, BNXT_DEVARG_REP_Q_F2R,
+ bnxt_parse_devarg_rep_q_f2r,
+ (void *)&representor);
+ if (ret) {
+ ret = -EINVAL;
+ goto err;
+ }
/*
* Handler for "rep_based_pf" devarg.
* Invoked as for ex: "-w 000:00:0d.0,
* rep-based-pf=<pf index> rep-is-pf=<VF=0 or PF=1>"
*/
- rte_kvargs_process(kvlist, BNXT_DEVARG_REP_FC_R2F,
- bnxt_parse_devarg_rep_fc_r2f,
- (void *)&representor);
+ ret = rte_kvargs_process(kvlist, BNXT_DEVARG_REP_FC_R2F,
+ bnxt_parse_devarg_rep_fc_r2f,
+ (void *)&representor);
+ if (ret) {
+ ret = -EINVAL;
+ goto err;
+ }
/*
* Handler for "rep_based_pf" devarg.
* Invoked as for ex: "-w 000:00:0d.0,
* rep-based-pf=<pf index> rep-is-pf=<VF=0 or PF=1>"
*/
- rte_kvargs_process(kvlist, BNXT_DEVARG_REP_FC_F2R,
- bnxt_parse_devarg_rep_fc_f2r,
- (void *)&representor);
+ ret = rte_kvargs_process(kvlist, BNXT_DEVARG_REP_FC_F2R,
+ bnxt_parse_devarg_rep_fc_f2r,
+ (void *)&representor);
+ if (ret) {
+ ret = -EINVAL;
+ goto err;
+ }
}
ret = rte_eth_dev_create(&pci_dev->device, name,
}
+ rte_kvargs_free(kvlist);
return 0;
err:
*/
if (num_rep > 1)
bnxt_pci_remove_dev_with_reps(backing_eth_dev);
+ rte_errno = -ret;
+ rte_kvargs_free(kvlist);
return ret;
}