net/qede: enable VF-VF traffic with unmatched dest address
authorSony Chacko <sony.chacko@qlogic.com>
Thu, 16 Jun 2016 05:47:10 +0000 (22:47 -0700)
committerBruce Richardson <bruce.richardson@intel.com>
Thu, 23 Jun 2016 15:47:18 +0000 (17:47 +0200)
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 <sony.chacko@qlogic.com>
drivers/net/qede/base/ecore_l2.c
drivers/net/qede/qede_eth_if.c

index 8a1a26a..9e6ef5a 100644 (file)
@@ -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",
index fd07d8b..b6f6487 100644 (file)
@@ -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);
 }