@@ -41,6 +41,17 @@ rte_pmd_dpaa2_set_custom_hash(uint16_t port_id,
void *p_params;
int ret, tc_index = 0;
+ if (!rte_eth_dev_is_valid_port(port_id)) {
+ DPAA2_PMD_WARN("Invalid port id %u", port_id);
+ return -EINVAL;
+ }
+
+ if (strcmp(eth_dev->device->driver->name,
+ RTE_STR(NET_DPAA2_PMD_DRIVER_NAME))) {
+ DPAA2_PMD_WARN("Not a valid dpaa2 port");
+ return -EINVAL;
+ }
+
p_params = rte_zmalloc(
NULL, DIST_PARAM_IOVA_SIZE, RTE_CACHE_LINE_SIZE);
if (!p_params) {
@@ -2905,8 +2905,8 @@ static struct rte_dpaa2_driver rte_dpaa2_pmd = {
.remove = rte_dpaa2_remove,
};
-RTE_PMD_REGISTER_DPAA2(net_dpaa2, rte_dpaa2_pmd);
-RTE_PMD_REGISTER_PARAM_STRING(net_dpaa2,
+RTE_PMD_REGISTER_DPAA2(NET_DPAA2_PMD_DRIVER_NAME, rte_dpaa2_pmd);
+RTE_PMD_REGISTER_PARAM_STRING(NET_DPAA2_PMD_DRIVER_NAME,
DRIVER_LOOPBACK_MODE "=<int> "
DRIVER_NO_PREFETCH_MODE "=<int>"
DRIVER_TX_CONF "=<int>"
@@ -19,6 +19,7 @@
#define DPAA2_MIN_RX_BUF_SIZE 512
#define DPAA2_MAX_RX_PKT_LEN 10240 /*WRIOP support*/
+#define NET_DPAA2_PMD_DRIVER_NAME net_dpaa2
#define MAX_TCS DPNI_MAX_TC
#define MAX_RX_QUEUES 128
@@ -68,6 +68,9 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
int ret;
static int i;
+ if (!pattern || !actions || !pattern[0] || !actions[0])
+ return NULL;
+
/* Find the DPDMUX from dpdmux_id in our list */
dpdmux_dev = get_dpdmux_from_id(dpdmux_id);
if (!dpdmux_dev) {