net/bnxt: fix L2 filter allocation
[dpdk.git] / drivers / net / bnxt / bnxt_hwrm.c
index 643dd98..b269526 100644 (file)
@@ -530,6 +530,9 @@ int bnxt_hwrm_set_l2_filter(struct bnxt *bp,
 
        HWRM_PREP(&req, HWRM_CFA_L2_FILTER_ALLOC, BNXT_USE_CHIMP_MB);
 
+       /* PMD does not support XDP and RoCE */
+       filter->flags |= HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_XDP_DISABLE |
+                       HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_TRAFFIC_L2;
        req.flags = rte_cpu_to_le_32(filter->flags);
 
        enables = filter->enables |
@@ -711,8 +714,12 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
                if (new_max_vfs != bp->pf->max_vfs) {
                        if (bp->pf->vf_info)
                                bnxt_hwrm_free_vf_info(bp);
-                       bp->pf->vf_info = rte_malloc("bnxt_vf_info",
+                       bp->pf->vf_info = rte_zmalloc("bnxt_vf_info",
                            sizeof(bp->pf->vf_info[0]) * new_max_vfs, 0);
+                       if (bp->pf->vf_info == NULL) {
+                               PMD_DRV_LOG(ERR, "Alloc vf info fail\n");
+                               return -ENOMEM;
+                       }
                        bp->pf->max_vfs = new_max_vfs;
                        for (i = 0; i < new_max_vfs; i++) {
                                bp->pf->vf_info[i].fid =
@@ -932,6 +939,10 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp)
                req.async_event_fwd[1] |=
                        rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DBG_NOTIFICATION);
 
+       if (BNXT_VF_IS_TRUSTED(bp))
+               req.async_event_fwd[1] |=
+               rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE);
+
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
 
        HWRM_CHECK_RESULT();
@@ -2256,8 +2267,8 @@ int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
                                HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO |
                                HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN |
                        HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ);
-               req.max_agg_segs = rte_cpu_to_le_16(BNXT_TPA_MAX_AGGS(bp));
-               req.max_aggs = rte_cpu_to_le_16(BNXT_TPA_MAX_SEGS(bp));
+               req.max_aggs = rte_cpu_to_le_16(BNXT_TPA_MAX_AGGS(bp));
+               req.max_agg_segs = rte_cpu_to_le_16(BNXT_TPA_MAX_SEGS(bp));
                req.min_agg_len = rte_cpu_to_le_32(512);
        }
        req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
@@ -3612,17 +3623,19 @@ int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port,
 
        HWRM_PREP(&req, HWRM_TUNNEL_DST_PORT_ALLOC, BNXT_USE_CHIMP_MB);
        req.tunnel_type = tunnel_type;
-       req.tunnel_dst_port_val = port;
+       req.tunnel_dst_port_val = rte_cpu_to_be_16(port);
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
        HWRM_CHECK_RESULT();
 
        switch (tunnel_type) {
        case HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_VXLAN:
-               bp->vxlan_fw_dst_port_id = resp->tunnel_dst_port_id;
+               bp->vxlan_fw_dst_port_id =
+                       rte_le_to_cpu_16(resp->tunnel_dst_port_id);
                bp->vxlan_port = port;
                break;
        case HWRM_TUNNEL_DST_PORT_ALLOC_INPUT_TUNNEL_TYPE_GENEVE:
-               bp->geneve_fw_dst_port_id = resp->tunnel_dst_port_id;
+               bp->geneve_fw_dst_port_id =
+                       rte_le_to_cpu_16(resp->tunnel_dst_port_id);
                bp->geneve_port = port;
                break;
        default: