net/qede: fix default config option
[dpdk.git] / drivers / net / qede / qede_ethdev.c
index 43562bc..6f5ba2a 100644 (file)
@@ -457,6 +457,7 @@ int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)
        if (IS_VF(edev)) {
                params.update_tx_switching_flg = 1;
                params.tx_switching_flg = !flg;
+               DP_INFO(edev, "VF tx-switching is disabled\n");
        }
 #endif
        for_each_hwfn(edev, i) {
@@ -469,8 +470,8 @@ int qede_activate_vport(struct rte_eth_dev *eth_dev, bool flg)
                        break;
                }
        }
-       DP_INFO(edev, "vport %s VF tx-switch %s\n", flg ? "activated" : "deactivated",
-                       params.tx_switching_flg ? "enabled" : "disabled");
+       DP_INFO(edev, "vport is %s\n", flg ? "activated" : "deactivated");
+
        return rc;
 }
 
@@ -631,12 +632,20 @@ qede_vxlan_enable(struct rte_eth_dev *eth_dev, uint8_t clss,
 
        for_each_hwfn(edev, i) {
                p_hwfn = &edev->hwfns[i];
-               p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL;
+               if (IS_PF(edev)) {
+                       p_ptt = ecore_ptt_acquire(p_hwfn);
+                       if (!p_ptt)
+                               return -EAGAIN;
+               } else {
+                       p_ptt = NULL;
+               }
                rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt,
                                &tunn, ECORE_SPQ_MODE_CB, NULL);
                if (rc != ECORE_SUCCESS) {
                        DP_ERR(edev, "Failed to update tunn_clss %u\n",
                                        tunn.vxlan.tun_cls);
+                       if (IS_PF(edev))
+                               ecore_ptt_release(p_hwfn, p_ptt);
                        break;
                }
        }
@@ -1159,6 +1168,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev)
        /* Bring-up the link */
        qede_dev_set_link_state(eth_dev, true);
 
+       /* Update link status */
+       qede_link_update(eth_dev, 0);
+
        /* Start/resume traffic */
        qede_fastpath_start(edev);
 
@@ -1367,7 +1379,7 @@ qede_dev_info_get(struct rte_eth_dev *eth_dev,
 }
 
 /* return 0 means link status changed, -1 means not changed */
-static int
+int
 qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
 {
        struct qede_dev *qdev = eth_dev->data->dev_private;
@@ -2253,7 +2265,13 @@ qede_conf_udp_dst_port(struct rte_eth_dev *eth_dev,
                tunn.vxlan_port.port = udp_port;
                for_each_hwfn(edev, i) {
                        p_hwfn = &edev->hwfns[i];
-                       p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL;
+                       if (IS_PF(edev)) {
+                               p_ptt = ecore_ptt_acquire(p_hwfn);
+                               if (!p_ptt)
+                                       return -EAGAIN;
+                       } else {
+                               p_ptt = NULL;
+                       }
                        rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt, &tunn,
                                                ECORE_SPQ_MODE_CB, NULL);
                        if (rc != ECORE_SUCCESS) {
@@ -2625,6 +2643,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
        /* Extract key data structures */
        adapter = eth_dev->data->dev_private;
+       adapter->ethdev = eth_dev;
        edev = &adapter->edev;
        pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
        pci_addr = pci_dev->addr;