From: Hemant Agrawal Date: Mon, 15 Jan 2018 11:38:04 +0000 (+0530) Subject: net/dpaa2: change VLAN filter rule to be called on config X-Git-Tag: spdx-start~86 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c172f85ef2e5f3992ac32a2bbf6a9bc28bcc2261;p=dpdk.git net/dpaa2: change VLAN filter rule to be called on config Signed-off-by: Hemant Agrawal --- diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 5f24759492..9daba70f5b 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -147,6 +147,12 @@ dpaa2_vlan_offload_set(struct rte_eth_dev *dev, int mask) PMD_INIT_FUNC_TRACE(); if (mask & ETH_VLAN_FILTER_MASK) { + /* VLAN Filter not avaialble */ + if (!priv->max_vlan_filters) { + RTE_LOG(INFO, PMD, "VLAN filter not available\n"); + goto next_mask; + } + if (dev->data->dev_conf.rxmode.hw_vlan_filter) ret = dpni_enable_vlan_filter(dpni, CMD_PRI_LOW, priv->token, true); @@ -157,7 +163,7 @@ dpaa2_vlan_offload_set(struct rte_eth_dev *dev, int mask) RTE_LOG(ERR, PMD, "Unable to set vlan filter = %d\n", ret); } - +next_mask: if (mask & ETH_VLAN_EXTEND_MASK) { if (dev->data->dev_conf.rxmode.hw_vlan_extend) RTE_LOG(INFO, PMD, @@ -374,6 +380,9 @@ dpaa2_eth_dev_configure(struct rte_eth_dev *dev) return ret; } + if (eth_conf->rxmode.hw_vlan_filter) + dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK); + /* update the current status */ dpaa2_dev_link_update(dev, 0); @@ -764,16 +773,6 @@ dpaa2_dev_start(struct rte_eth_dev *dev) "code = %d\n", ret); return ret; } - /* VLAN Offload Settings */ - if (priv->max_vlan_filters) { - ret = dpaa2_vlan_offload_set(dev, ETH_VLAN_FILTER_MASK); - if (ret) { - PMD_INIT_LOG(ERR, "Error to dpaa2_vlan_offload_set:" - "code = %d\n", ret); - return ret; - } - } - /* if the interrupts were configured on this devices*/ if (intr_handle && (intr_handle->fd) &&