net/mlx5: support keeping CRC on Windows
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_utils.c
index fc4f435..df3afaa 100644 (file)
@@ -882,7 +882,8 @@ ulp_blob_msb_block_merge(struct ulp_blob *dst, struct ulp_blob *src,
 
        for (i = 0; i < num;) {
                if (((dst->write_idx % block_size)  + (num - i)) > block_size)
-                       write_bytes = block_size - dst->write_idx;
+                       write_bytes = block_size -
+                               (dst->write_idx % block_size);
                else
                        write_bytes = num - i;
                for (k = 0; k < ULP_BITS_2_BYTE_NR(write_bytes); k++) {
@@ -964,8 +965,11 @@ ulp_blob_append(struct ulp_blob *dst, struct ulp_blob *src,
                ulp_bs_put_msb(dst->data, dst->write_idx,
                               ULP_BLOB_BYTE, bluff);
                dst->write_idx += remaining;
+               src_offset += remaining;
        }
 
+       src_buf += ULP_BITS_2_BYTE_NR(src_offset);
+
        /* Push the byte aligned pieces */
        for (k = 0; k < ULP_BITS_2_BYTE_NR(src_len); k++) {
                ulp_bs_put_msb(dst->data, dst->write_idx, ULP_BLOB_BYTE,