From: Sony Chacko Date: Thu, 16 Jun 2016 05:47:10 +0000 (-0700) Subject: net/qede: enable VF-VF traffic with unmatched dest address X-Git-Tag: spdx-start~6419 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=40e9f6fc1558aa2c57c074c53065e3399edafe87;p=dpdk.git net/qede: enable VF-VF traffic with unmatched dest address This patch enables VF to VF traffic with unmatched destination addresses. The steps to enable this are: - Enable promiscuous mode filter settings. - Check for VF mode and enable promiscuous mode settings for VF. - Check filter configuration to ensure conflicting filter modes are not set. Signed-off-by: Sony Chacko --- diff --git a/drivers/net/qede/base/ecore_l2.c b/drivers/net/qede/base/ecore_l2.c index 8a1a26ab34..9e6ef5a4dc 100644 --- a/drivers/net/qede/base/ecore_l2.c +++ b/drivers/net/qede/base/ecore_l2.c @@ -227,11 +227,11 @@ ecore_sp_update_accept_mode(struct ecore_hwfn *p_hwfn, * SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_DROP_ALL, * !!(accept_filter & ECORE_ACCEPT_NONE)); */ -/* - * SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL, - * (!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) && - * !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); - */ + + SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL, + (!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) && + !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); + SET_FIELD(*state, ETH_VPORT_RX_MODE_UCAST_DROP_ALL, !(!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) || !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); @@ -275,6 +275,15 @@ ecore_sp_update_accept_mode(struct ecore_hwfn *p_hwfn, SET_FIELD(*state, ETH_VPORT_TX_MODE_BCAST_ACCEPT_ALL, !!(accept_filter & ECORE_ACCEPT_BCAST)); + /* @DPDK */ + /* ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL and + * ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL + * needs to be set for VF-VF communication to work + * when dest macaddr is unknown. + */ + SET_FIELD(*state, ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL, + (!!(accept_filter & ECORE_ACCEPT_UCAST_MATCHED) && + !!(accept_filter & ECORE_ACCEPT_UCAST_UNMATCHED))); DP_VERBOSE(p_hwfn, ECORE_MSG_SP, "p_ramrod->tx_mode.state = 0x%x\n", diff --git a/drivers/net/qede/qede_eth_if.c b/drivers/net/qede/qede_eth_if.c index fd07d8b3ee..b6f6487d73 100644 --- a/drivers/net/qede/qede_eth_if.c +++ b/drivers/net/qede/qede_eth_if.c @@ -377,33 +377,38 @@ qed_configure_filter_mcast(struct ecore_dev *edev, return ecore_filter_mcast_cmd(edev, &mcast, ECORE_SPQ_MODE_CB, NULL); } -int -qed_configure_filter_rx_mode(struct ecore_dev *edev, - enum qed_filter_rx_mode_type type) +int qed_configure_filter_rx_mode(struct ecore_dev *edev, + enum qed_filter_rx_mode_type type) { - struct ecore_filter_accept_flags accept_flags; + struct ecore_filter_accept_flags flags; - memset(&accept_flags, 0, sizeof(accept_flags)); + memset(&flags, 0, sizeof(flags)); - accept_flags.update_rx_mode_config = 1; - accept_flags.update_tx_mode_config = 1; - accept_flags.rx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | - ECORE_ACCEPT_MCAST_MATCHED | - ECORE_ACCEPT_BCAST; - accept_flags.tx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | + flags.update_rx_mode_config = 1; + flags.update_tx_mode_config = 1; + flags.rx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | ECORE_ACCEPT_MCAST_MATCHED | ECORE_ACCEPT_BCAST; - if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) - accept_flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED; - else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) - accept_flags.rx_accept_filter |= ECORE_ACCEPT_MCAST_UNMATCHED; - else if (type == (QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC | - QED_FILTER_RX_MODE_TYPE_PROMISC)) - accept_flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED | - ECORE_ACCEPT_MCAST_UNMATCHED; + flags.tx_accept_filter = ECORE_ACCEPT_UCAST_MATCHED | + ECORE_ACCEPT_MCAST_MATCHED | + ECORE_ACCEPT_BCAST; + + if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) { + flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED; + if (IS_VF(edev)) { + flags.tx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED; + DP_INFO(edev, "Enabling Tx unmatched flag for VF\n"); + } + } else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) { + flags.rx_accept_filter |= ECORE_ACCEPT_MCAST_UNMATCHED; + } else if (type == (QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC | + QED_FILTER_RX_MODE_TYPE_PROMISC)) { + flags.rx_accept_filter |= ECORE_ACCEPT_UCAST_UNMATCHED | + ECORE_ACCEPT_MCAST_UNMATCHED; + } - return ecore_filter_accept_cmd(edev, 0, accept_flags, false, false, + return ecore_filter_accept_cmd(edev, 0, flags, false, false, ECORE_SPQ_MODE_CB, NULL); }