X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fdpaa2%2Fbase%2Fdpaa2_hw_dpni.c;h=641e7027f12e9ddd121923cfe8ba8a70d7082f4e;hb=b37ed6def36798342172f298516c5fc6d0d8e070;hp=9d1565369d5076d615229817a9ee480d1ff9f309;hpb=1832bc8ee8d412b1cf8e5a07c385c083d1417e58;p=dpdk.git diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 9d1565369d..641e7027f1 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -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) { @@ -203,7 +214,7 @@ dpaa2_distset_to_dpkg_profile_cfg( memset(kg_cfg, 0, sizeof(struct dpkg_profile_cfg)); while (req_dist_set) { if (req_dist_set % 2 != 0) { - dist_field = 1U << loop; + dist_field = 1ULL << loop; switch (dist_field) { case ETH_RSS_L2_PAYLOAD: