src/dpdk/drivers/net/bnxt/tf_ulp/ulp_utils.c
void
ulp_blob_perform_encap_swap(struct ulp_blob *blob)
{
	uint32_t i, idx = 0, end_idx = 0, roundoff;
	uint8_t temp_val_1, temp_val_2;

	/* validate the arguments */
	if (!blob) {
		BNXT_TF_DBG(ERR, "invalid argument\n");
		return; /* failure */
	}
	idx = ULP_BITS_2_BYTE_NR(blob->encap_swap_idx);
	end_idx = ULP_BITS_2_BYTE(blob->write_idx);
	roundoff = ULP_BYTE_2_BITS(ULP_BITS_2_BYTE(end_idx));
	if (roundoff > end_idx) {
		blob->write_idx += ULP_BYTE_2_BITS(roundoff - end_idx);
		end_idx = roundoff;
	}
	while (idx <= end_idx) {
		for (i = 0; i < 4; i = i + 2) {
			temp_val_1 = blob->data[idx + i];
			temp_val_2 = blob->data[idx + i + 1];
			blob->data[idx + i] = blob->data[idx + 6 - i];
			blob->data[idx + i + 1] = blob->data[idx + 7 - i];
			blob->data[idx + 7 - i] = temp_val_2;
			blob->data[idx + 6 - i] = temp_val_1;
		}
		idx += 8;
	}
}
/*
 * Perform the encap buffer swap to 64 bit reversal.
 *
 * blob [in] The blob's data to be used for swap.
 *
 * returns void.
 */
Perform the encap buffer swap to 64 bit reversal.
blob [in] The blob's data to be used for swap.

returns void.
Perform the encap buffer swap to 64 bit reversal . blob [ in ] The blob ' s data to be used for swap . returns void .
void
ulp_blob_perform_encap_swap(struct ulp_blob *blob)
{
	uint32_t i, idx = 0, end_idx = 0, roundoff;
	uint8_t temp_val_1, temp_val_2;
	if (!blob) {
		BNXT_TF_DBG(ERR, "invalid argument\n");
		return; 
	}
	idx = ULP_BITS_2_BYTE_NR(blob->encap_swap_idx);
	end_idx = ULP_BITS_2_BYTE(blob->write_idx);
	roundoff = ULP_BYTE_2_BITS(ULP_BITS_2_BYTE(end_idx));
	if (roundoff > end_idx) {
		blob->write_idx += ULP_BYTE_2_BITS(roundoff - end_idx);
		end_idx = roundoff;
	}
	while (idx <= end_idx) {
		for (i = 0; i < 4; i = i + 2) {
			temp_val_1 = blob->data[idx + i];
			temp_val_2 = blob->data[idx + i + 1];
			blob->data[idx + i] = blob->data[idx + 6 - i];
			blob->data[idx + i + 1] = blob->data[idx + 7 - i];
			blob->data[idx + 7 - i] = temp_val_2;
			blob->data[idx + 6 - i] = temp_val_1;
		}
		idx += 8;
	}
}
void ulp_blob_perform_encap_swap ( struct ulp_blob * blob ) { uint32_t i , idx = 0 , end_idx = 0 , roundoff ; uint8_t temp_val_1 , temp_val_2 ; if ( ! blob ) { BNXT_TF_DBG ( ERR , " \n " ) ; return ; } idx = ULP_BITS_2_BYTE_NR ( blob -> encap_swap_idx ) ; end_idx = ULP_BITS_2_BYTE ( blob -> write_idx ) ; roundoff = ULP_BYTE_2_BITS ( ULP_BITS_2_BYTE ( end_idx ) ) ; if ( roundoff > end_idx ) { blob -> write_idx += ULP_BYTE_2_BITS ( roundoff - end_idx ) ; end_idx = roundoff ; } while ( idx <= end_idx ) { for ( i = 0 ; i < 4 ; i = i + 2 ) { temp_val_1 = blob -> data [ idx + i ] ; temp_val_2 = blob -> data [ idx + i + 1 ] ; blob -> data [ idx + i ] = blob -> data [ idx + 6 - i ] ; blob -> data [ idx + i + 1 ] = blob -> data [ idx + 7 - i ] ; blob -> data [ idx + 7 - i ] = temp_val_2 ; blob -> data [ idx + 6 - i ] = temp_val_1 ; } idx += 8 ; } }
Perform the encap buffer swap to 64 bit reversal.
Perform the encap buffer swap to 64 bit reversal .
/* validate the arguments */ /* failure */