net/fm10k: fix promiscuous receive for VF

When app tries to change promisc/allmulti setting, fm10k will check if a
valid glort is acquired, and exit without doing anything if not.

For VFs, this glort value is not necessary, and so the check can be
removed. This saves having unnecessary failures of the API call, as well as
saving the time taken for the mailbox communication between VF and PF in
the case when the glort check passes.

Fixes: df02ba864695 ("fm10k: support promiscuous mode")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
This commit is contained in:
Xiao Wang 2016-06-06 17:00:47 +08:00 committed by Bruce Richardson
parent 5fdb4ada1c
commit 2d2d6e3720

View File

@ -947,7 +947,7 @@ fm10k_dev_promiscuous_enable(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
/* Return if it didn't acquire valid glort range */
if (!fm10k_glort_valid(hw))
if ((hw->mac.type == fm10k_mac_pf) && !fm10k_glort_valid(hw))
return;
fm10k_mbx_lock(hw);
@ -969,7 +969,7 @@ fm10k_dev_promiscuous_disable(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
/* Return if it didn't acquire valid glort range */
if (!fm10k_glort_valid(hw))
if ((hw->mac.type == fm10k_mac_pf) && !fm10k_glort_valid(hw))
return;
if (dev->data->all_multicast == 1)
@ -995,7 +995,7 @@ fm10k_dev_allmulticast_enable(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
/* Return if it didn't acquire valid glort range */
if (!fm10k_glort_valid(hw))
if ((hw->mac.type == fm10k_mac_pf) && !fm10k_glort_valid(hw))
return;
/* If promiscuous mode is enabled, it doesn't make sense to enable
@ -1026,7 +1026,7 @@ fm10k_dev_allmulticast_disable(struct rte_eth_dev *dev)
PMD_INIT_FUNC_TRACE();
/* Return if it didn't acquire valid glort range */
if (!fm10k_glort_valid(hw))
if ((hw->mac.type == fm10k_mac_pf) && !fm10k_glort_valid(hw))
return;
if (dev->data->promiscuous) {