New upstream version 17.11.4
[deb_dpdk.git] / drivers / net / qede / base / ecore_vf.c
index 8a08911..334db6b 100644 (file)
@@ -1628,6 +1628,39 @@ exit:
        return rc;
 }
 
+enum _ecore_status_t
+ecore_vf_pf_update_mtu(struct ecore_hwfn *p_hwfn, u16 mtu)
+{
+       struct ecore_vf_iov *p_iov = p_hwfn->vf_iov_info;
+       struct vfpf_update_mtu_tlv *p_req;
+       struct pfvf_def_resp_tlv *p_resp;
+       enum _ecore_status_t rc;
+
+       if (!mtu)
+               return ECORE_INVAL;
+
+       /* clear mailbox and prep header tlv */
+       p_req = ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_UPDATE_MTU,
+                                sizeof(*p_req));
+       p_req->mtu = mtu;
+       DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
+                  "Requesting MTU update to %d\n", mtu);
+
+       /* add list termination tlv */
+       ecore_add_tlv(&p_iov->offset,
+                     CHANNEL_TLV_LIST_END,
+                     sizeof(struct channel_list_end_tlv));
+
+       p_resp = &p_iov->pf2vf_reply->default_resp;
+       rc = ecore_send_msg2pf(p_hwfn, &p_resp->hdr.status, sizeof(*p_resp));
+       if (p_resp->hdr.status == PFVF_STATUS_NOT_SUPPORTED)
+               rc = ECORE_INVAL;
+
+       ecore_vf_pf_req_end(p_hwfn, rc);
+
+       return rc;
+}
+
 u16 ecore_vf_get_igu_sb_id(struct ecore_hwfn *p_hwfn,
                           u16               sb_id)
 {