From: Xiao Wang Date: Mon, 6 Jun 2016 09:00:47 +0000 (+0800) Subject: net/fm10k: fix promiscuous receive for VF X-Git-Tag: spdx-start~6462 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2d2d6e37209fce3d78c0ea032ab6ecb7064afa03;p=dpdk.git 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 Acked-by: Jing Chen --- diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index ce053b03f3..6d6bbe3fe5 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -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) {