net/bnxt: support NAT for dest IP and port combination
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_gen_tbl.c
index 5c94e2f..5279beb 100644 (file)
@@ -70,9 +70,9 @@ ulp_mapper_generic_tbl_list_init(struct bnxt_ulp_mapper_data *mapper_data)
                        entry->container.byte_data = &entry->mem_data[size];
                        entry->container.byte_order = tbl->result_byte_order;
                } else {
-                       BNXT_TF_DBG(ERR, "%s:Invalid gen table num of ent %d\n",
+                       BNXT_TF_DBG(DEBUG, "%s: Unused Gen tbl entry is %d\n",
                                    tbl->name, idx);
-                       return -EINVAL;
+                       /* return -EINVAL; */
                }
                if (tbl->hash_tbl_entries) {
                        cparams.key_size = tbl->key_num_bytes;
@@ -346,11 +346,15 @@ ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,
                return -EINVAL;
        }
        fid = tfp_be_to_cpu_32(fid);
-
-       /* Destroy the flow associated with the shared flow id */
-       if (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_RID,
-                                   fid))
-               BNXT_TF_DBG(ERR, "Error in deleting shared flow id %x\n", fid);
+       /* no need to del if fid is 0 since there is no associated resource */
+       if (fid) {
+               /* Destroy the flow associated with the shared flow id */
+               if (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_RID,
+                                           fid))
+                       BNXT_TF_DBG(ERR,
+                                   "Error in deleting shared flow id %x\n",
+                                   fid);
+       }
 
        /* Delete the entry from the hash table */
        if (gen_tbl_list->hash_tbl)