---
name: "rte_comp_op"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_comp_op"
---

# rte\_comp\_op(3)

## NAME

rte\_comp\_op

## SYNOPSIS

`#include <rte_comp.h>`

### Data Fields

struct **rte\_mempool** \* **mempool**\
 **rte\_iova\_t** **iova\_addr**\
 struct **rte\_mbuf** \* **m\_src**\
 struct **rte\_mbuf** \* **m\_dst**\
 enum **rte\_comp\_flush\_flag** **flush\_flag**\
 uint64\_t **input\_chksum**\
 uint64\_t **output\_chksum**\
 uint32\_t **consumed**\
 uint32\_t **produced**\
 uint64\_t **debug\_status**\
 uint8\_t **status**\

## Detailed Description

Compression Operation.

This structure contains data relating to performing a compression operation on the referenced mbuf data buffers.

Comp operations are enqueued and dequeued in comp PMDs using the **rte\_compressdev\_enqueue\_burst()** / **rte\_compressdev\_dequeue\_burst()** APIs

Definition at line **359** of file **rte\_comp.h**.

## Field Documentation

### void\* private\_xform

Stateless private PMD data derived from an **rte\_comp\_xform**. A handle returned by **rte\_compressdev\_private\_xform\_create()** must be attached to operations of op\_type RTE\_COMP\_STATELESS.

Definition at line **362** of file **rte\_comp.h**.

### void\* stream

Private PMD data derived initially from an **rte\_comp\_xform**, which holds state and history data and evolves as operations are processed. **rte\_compressdev\_stream\_create()** must be called on a device for all STATEFUL data streams and the resulting stream attached to the one or more operations associated with the data stream. All operations in a stream must be sent to the same device.

Definition at line **367** of file **rte\_comp.h**.

### struct rte\_mempool\* mempool

Pool from which operation is allocated

Definition at line **378** of file **rte\_comp.h**.

### rte\_iova\_t iova\_addr

IOVA address of this operation

IO address of the buffer

Definition at line **380** of file **rte\_comp.h**.

### struct rte\_mbuf\* m\_src

source mbuf The total size of the input buffer(s) can be retrieved using **rte\_pktmbuf\_pkt\_len(m\_src)**. The max data size which can fit in a single mbuf is limited by the uint16\_t **rte\_mbuf.data\_len** to 64k-1. If the input data is bigger than this it can be passed to the PMD in a chain of mbufs if the PMD's capabilities indicate it supports this.

Definition at line **382** of file **rte\_comp.h**.

### struct rte\_mbuf\* m\_dst

destination mbuf The total size of the output buffer(s) can be retrieved using **rte\_pktmbuf\_pkt\_len(m\_dst)**. The max data size which can fit in a single mbuf is limited by the uint16\_t **rte\_mbuf.data\_len** to 64k-1. If the output data is expected to be bigger than this a chain of mbufs can be passed to the PMD if the PMD's capabilities indicate it supports this.

**Note**

, if incompressible data is passed to an engine for compression using RTE\_COMP\_ALGO\_DEFLATE, it's possible for the output data to be larger than the uncompressed data, due to the inclusion of the DEFLATE header blocks. The size of m\_dst should accommodate this, else OUT\_OF\_SPACE errors can be expected in this case.

Definition at line **390** of file **rte\_comp.h**.

### uint32\_t offset

Starting point for compression or decompression, specified as number of bytes from start of packet in source buffer. This offset starts from the first segment of the buffer, in case the m\_src is a chain of mbufs. Starting point for checksum generation in compress direction.

Starting point for writing output data, specified as number of bytes from start of packet in dest buffer. This offset starts from the first segment of the buffer, in case the m\_dst is a chain of mbufs. Starting point for checksum generation in decompress direction.

Definition at line **407** of file **rte\_comp.h**.

### uint32\_t length

The length, in bytes, of the data in source buffer to be compressed or decompressed. Also the length of the data over which the checksum should be generated in compress direction

Definition at line **415** of file **rte\_comp.h**.

### uint8\_t\* digest

Output buffer to store hash output, if enabled in xform. Buffer would contain valid value only after an op with flush flag = RTE\_COMP\_FLUSH\_FULL/FLUSH\_FINAL is processed successfully.

Length of buffer should be contiguous and large enough to accommodate digest produced by specific hash algo.

Definition at line **434** of file **rte\_comp.h**.

### enum rte\_comp\_flush\_flag flush\_flag

Defines flush characteristics for the output data. Only applicable in compress direction

Definition at line **446** of file **rte\_comp.h**.

### uint64\_t input\_chksum

An input checksum can be provided to generate a cumulative checksum across sequential blocks in a STATELESS stream. Checksum type is as specified in xform chksum\_type

Definition at line **450** of file **rte\_comp.h**.

### uint64\_t output\_chksum

If a checksum is generated it will be written in here. Checksum type is as specified in xform chksum\_type.

Definition at line **455** of file **rte\_comp.h**.

### uint32\_t consumed

The number of bytes from the source buffer which were compressed/decompressed.

Definition at line **459** of file **rte\_comp.h**.

### uint32\_t produced

The number of bytes written to the destination buffer which were compressed/decompressed.

Definition at line **463** of file **rte\_comp.h**.

### uint64\_t debug\_status

Status of the operation is returned in the status param. This field allows the PMD to pass back extra pmd-specific debug information. Value is not defined on the API.

Definition at line **467** of file **rte\_comp.h**.

### uint8\_t status

Operation status - use values from enum rte\_comp\_status. This is reset to RTE\_COMP\_OP\_STATUS\_NOT\_PROCESSED on allocation from mempool and will be set to RTE\_COMP\_OP\_STATUS\_SUCCESS after operation is successfully processed by a PMD

Definition at line **473** of file **rte\_comp.h**.

## Author

Generated automatically by Doxygen for DPDK from the source code.
