#include "otx_zip.h"
-int octtx_zip_logtype_driver;
-
static const struct rte_compressdev_capabilities
octtx_zip_pmd_capabilities[] = {
{ .algo = RTE_COMP_ALGO_DEFLATE,
op->status = RTE_COMP_OP_STATUS_ERROR;
}
+#ifdef ZIP_DBG
ZIP_PMD_INFO("written %d\n", zresult->s.totalbyteswritten);
+#endif
/* Update op stats */
switch (op->status) {
if (qp != NULL) {
zipvf_q_term(qp);
- if (qp->processed_pkts)
- rte_ring_free(qp->processed_pkts);
+ rte_ring_free(qp->processed_pkts);
rte_free(qp);
dev->data->queue_pairs[qp_id] = NULL;
}
name = rte_malloc(NULL, RTE_COMPRESSDEV_NAME_MAX_LEN, 0);
+ if (name == NULL)
+ return (-ENOMEM);
snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN,
"zip_pmd_%u_qp_%u",
dev->data->dev_id, qp_id);
/* Allocate the queue pair data structure. */
qp = rte_zmalloc_socket(name, sizeof(*qp),
RTE_CACHE_LINE_SIZE, socket_id);
- if (qp == NULL)
+ if (qp == NULL) {
+ rte_free(name);
return (-ENOMEM);
+ }
qp->name = name;
return 0;
qp_setup_cleanup:
- if (qp->processed_pkts)
- rte_ring_free(qp->processed_pkts);
- if (qp)
- rte_free(qp);
+ rte_ring_free(qp->processed_pkts);
+ rte_free(qp);
return -1;
}
RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
PCI_DEVICE_ID_OCTEONTX_ZIPVF),
},
+ {
+ RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
+ PCI_DEVICE_ID_OCTEONTX2_ZIPVF),
+ },
{
.device_id = 0
},
RTE_PMD_REGISTER_PCI(COMPRESSDEV_NAME_ZIP_PMD, octtx_zip_pmd);
RTE_PMD_REGISTER_PCI_TABLE(COMPRESSDEV_NAME_ZIP_PMD, pci_id_octtx_zipvf_table);
-
-RTE_INIT(octtx_zip_init_log)
-{
- octtx_zip_logtype_driver = rte_log_register("pmd.compress.octeontx");
- if (octtx_zip_logtype_driver >= 0)
- rte_log_set_level(octtx_zip_logtype_driver, RTE_LOG_INFO);
-}
+RTE_LOG_REGISTER_DEFAULT(octtx_zip_logtype_driver, INFO);