qed: !main_ptt for tunnel configuration
authorManish Chopra <Manish.Chopra@cavium.com>
Tue, 23 May 2017 06:41:20 +0000 (09:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 May 2017 19:17:19 +0000 (15:17 -0400)
Flows configuring tunnel ports in HW use the main_ptt which should
be reserved for core-functionality.

Signed-off-by: Manish Chopra <Manish.Chopra@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_dev.c
drivers/net/ethernet/qlogic/qed/qed_l2.c
drivers/net/ethernet/qlogic/qed/qed_sp.h
drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
drivers/net/ethernet/qlogic/qed/qed_sriov.c

index 3fc3b2e03ef014f3987c57198b36a0f364338a1c..9dd28baba5a138047230f948225eed5b6bbbee68 100644 (file)
@@ -1513,7 +1513,8 @@ static int qed_hw_init_pf(struct qed_hwfn *p_hwfn,
                qed_int_igu_enable(p_hwfn, p_ptt, int_mode);
 
                /* send function start command */
-               rc = qed_sp_pf_start(p_hwfn, p_tunn, p_hwfn->cdev->mf_mode,
+               rc = qed_sp_pf_start(p_hwfn, p_ptt, p_tunn,
+                                    p_hwfn->cdev->mf_mode,
                                     allow_npar_tx_switch);
                if (rc) {
                        DP_NOTICE(p_hwfn, "Function start ramrod failed\n");
index fab6e697c3abb045c6c752927edadb7ef8ac3617..93dd781cf61d23463a8a7d267d7929f7961908dc 100644 (file)
@@ -2300,14 +2300,25 @@ static int qed_tunn_configure(struct qed_dev *cdev,
 
        for_each_hwfn(cdev, i) {
                struct qed_hwfn *hwfn = &cdev->hwfns[i];
+               struct qed_ptt *p_ptt;
                struct qed_tunnel_info *tun;
 
                tun = &hwfn->cdev->tunnel;
+               if (IS_PF(cdev)) {
+                       p_ptt = qed_ptt_acquire(hwfn);
+                       if (!p_ptt)
+                               return -EAGAIN;
+               } else {
+                       p_ptt = NULL;
+               }
 
-               rc = qed_sp_pf_update_tunn_cfg(hwfn, &tunn_info,
+               rc = qed_sp_pf_update_tunn_cfg(hwfn, p_ptt, &tunn_info,
                                               QED_SPQ_MODE_EBLOCK, NULL);
-               if (rc)
+               if (rc) {
+                       if (IS_PF(cdev))
+                               qed_ptt_release(hwfn, p_ptt);
                        return rc;
+               }
 
                if (IS_PF_SRIOV(hwfn)) {
                        u16 vxlan_port, geneve_port;
@@ -2324,6 +2335,8 @@ static int qed_tunn_configure(struct qed_dev *cdev,
 
                        qed_schedule_iov(hwfn, QED_IOV_WQ_BULLETIN_UPDATE_FLAG);
                }
+               if (IS_PF(cdev))
+                       qed_ptt_release(hwfn, p_ptt);
        }
 
        return 0;
index c0b56b98d2eaaed6964db0798e1b4e88e538b24f..ef77de4de5f27b8364f8c3b7a75f19b2d619db24 100644 (file)
@@ -391,6 +391,7 @@ int qed_sp_init_request(struct qed_hwfn *p_hwfn,
  * to the internal RAM of the UStorm by the Function Start Ramrod.
  *
  * @param p_hwfn
+ * @param p_ptt
  * @param p_tunn
  * @param mode
  * @param allow_npar_tx_switch
@@ -399,6 +400,7 @@ int qed_sp_init_request(struct qed_hwfn *p_hwfn,
  */
 
 int qed_sp_pf_start(struct qed_hwfn *p_hwfn,
+                   struct qed_ptt *p_ptt,
                    struct qed_tunnel_info *p_tunn,
                    enum qed_mf_mode mode, bool allow_npar_tx_switch);
 
@@ -432,6 +434,7 @@ int qed_sp_pf_update(struct qed_hwfn *p_hwfn);
 int qed_sp_pf_stop(struct qed_hwfn *p_hwfn);
 
 int qed_sp_pf_update_tunn_cfg(struct qed_hwfn *p_hwfn,
+                             struct qed_ptt *p_ptt,
                              struct qed_tunnel_info *p_tunn,
                              enum spq_mode comp_mode,
                              struct qed_spq_comp_cb *p_comp_data);
index 5abcac64d9694930713d4d18c83b334bbc52c2a0..ab09975343cb7ea884d8847bc03c95bc571c3e3e 100644 (file)
@@ -253,17 +253,18 @@ static void qed_set_hw_tunn_mode(struct qed_hwfn *p_hwfn,
 }
 
 static void qed_set_hw_tunn_mode_port(struct qed_hwfn *p_hwfn,
+                                     struct qed_ptt *p_ptt,
                                      struct qed_tunnel_info *p_tunn)
 {
        if (p_tunn->vxlan_port.b_update_port)
-               qed_set_vxlan_dest_port(p_hwfn, p_hwfn->p_main_ptt,
+               qed_set_vxlan_dest_port(p_hwfn, p_ptt,
                                        p_tunn->vxlan_port.port);
 
        if (p_tunn->geneve_port.b_update_port)
-               qed_set_geneve_dest_port(p_hwfn, p_hwfn->p_main_ptt,
+               qed_set_geneve_dest_port(p_hwfn, p_ptt,
                                         p_tunn->geneve_port.port);
 
-       qed_set_hw_tunn_mode(p_hwfn, p_hwfn->p_main_ptt, p_tunn);
+       qed_set_hw_tunn_mode(p_hwfn, p_ptt, p_tunn);
 }
 
 static void
@@ -303,6 +304,7 @@ qed_tunn_set_pf_start_params(struct qed_hwfn *p_hwfn,
 }
 
 int qed_sp_pf_start(struct qed_hwfn *p_hwfn,
+                   struct qed_ptt *p_ptt,
                    struct qed_tunnel_info *p_tunn,
                    enum qed_mf_mode mode, bool allow_npar_tx_switch)
 {
@@ -399,7 +401,8 @@ int qed_sp_pf_start(struct qed_hwfn *p_hwfn,
        rc = qed_spq_post(p_hwfn, p_ent, NULL);
 
        if (p_tunn)
-               qed_set_hw_tunn_mode_port(p_hwfn, &p_hwfn->cdev->tunnel);
+               qed_set_hw_tunn_mode_port(p_hwfn, p_ptt,
+                                         &p_hwfn->cdev->tunnel);
 
        return rc;
 }
@@ -430,6 +433,7 @@ int qed_sp_pf_update(struct qed_hwfn *p_hwfn)
 
 /* Set pf update ramrod command params */
 int qed_sp_pf_update_tunn_cfg(struct qed_hwfn *p_hwfn,
+                             struct qed_ptt *p_ptt,
                              struct qed_tunnel_info *p_tunn,
                              enum spq_mode comp_mode,
                              struct qed_spq_comp_cb *p_comp_data)
@@ -464,7 +468,7 @@ int qed_sp_pf_update_tunn_cfg(struct qed_hwfn *p_hwfn,
        if (rc)
                return rc;
 
-       qed_set_hw_tunn_mode_port(p_hwfn, &p_hwfn->cdev->tunnel);
+       qed_set_hw_tunn_mode_port(p_hwfn, p_ptt, &p_hwfn->cdev->tunnel);
 
        return rc;
 }
index f5ed54d611ec91ec07372fdaffca0bd18eb659b4..71e392fe1d976bed11275fa92e097d81a3c74bb7 100644 (file)
@@ -2209,7 +2209,7 @@ static void qed_iov_vf_mbx_update_tunn_param(struct qed_hwfn *p_hwfn,
        if (b_update_required) {
                u16 geneve_port;
 
-               rc = qed_sp_pf_update_tunn_cfg(p_hwfn, &tunn,
+               rc = qed_sp_pf_update_tunn_cfg(p_hwfn, p_ptt, &tunn,
                                               QED_SPQ_MODE_EBLOCK, NULL);
                if (rc)
                        status = PFVF_STATUS_FAILURE;