net/bnxt: add computed header field in result opcode
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_mapper.c
index e60d9d5..5984bbb 100644 (file)
@@ -662,6 +662,22 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
                        return -EINVAL;
                }
                break;
+       case BNXT_ULP_RESULT_OPC_SET_TO_COMP_HDR_FIELD:
+               if (!ulp_operand_read(fld->result_operand,
+                                     (uint8_t *)&idx,
+                                     sizeof(uint16_t))) {
+                       BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name);
+                       return -EINVAL;
+               }
+               idx = tfp_be_to_cpu_16(idx);
+               if (idx < BNXT_ULP_CHF_IDX_LAST)
+                       val = ulp_blob_push_32(blob, &parms->comp_fld[idx],
+                                              fld->field_bit_size);
+               if (!val) {
+                       BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
+                       return -EINVAL;
+               }
+               break;
        default:
                return -EINVAL;
        }