aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
diff options
context:
space:
mode:
authorAriel Elior <ariele@broadcom.com>2013-01-01 00:22:41 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-02 04:45:07 -0500
commitf1929b016c2161c364e45c21788aaae938ae557c (patch)
tree040f0a388de8572f298e163b7859268a25748931 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
parent99e9d211a40cdd12bda7f50c2014c2fbb8f386f5 (diff)
bnx2x: Support of PF driver of a VF release request
The 'release' request is the opposite of the 'acquire' request. At release, all the resources allocated to the VF are reclaimed. The release flow applies the close flow if applicable. Note that there are actually two types of release: 1. The VF has been removed, and so issued a 'release' request over the VF <-> PF Channel. 2. The PF is going down and so has to release all of it's VFs. Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
index 73368aa28e26..ba8b95d016b0 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
@@ -228,7 +228,7 @@ static void bnx2x_vf_mbx_resp(struct bnx2x *bp, struct bnx2x_virtf *vf)
228 if (rc) { 228 if (rc) {
229 BNX2X_ERR("Failed to copy response body to VF %d\n", 229 BNX2X_ERR("Failed to copy response body to VF %d\n",
230 vf->abs_vfid); 230 vf->abs_vfid);
231 return; 231 goto mbx_error;
232 } 232 }
233 vf_addr -= sizeof(u64); 233 vf_addr -= sizeof(u64);
234 pf_addr -= sizeof(u64); 234 pf_addr -= sizeof(u64);
@@ -255,8 +255,12 @@ static void bnx2x_vf_mbx_resp(struct bnx2x *bp, struct bnx2x_virtf *vf)
255 if (rc) { 255 if (rc) {
256 BNX2X_ERR("Failed to copy response status to VF %d\n", 256 BNX2X_ERR("Failed to copy response status to VF %d\n",
257 vf->abs_vfid); 257 vf->abs_vfid);
258 goto mbx_error;
258 } 259 }
259 return; 260 return;
261
262mbx_error:
263 bnx2x_vf_release(bp, vf, false); /* non blocking */
260} 264}
261 265
262static void bnx2x_vf_mbx_acquire_resp(struct bnx2x *bp, struct bnx2x_virtf *vf, 266static void bnx2x_vf_mbx_acquire_resp(struct bnx2x *bp, struct bnx2x_virtf *vf,
@@ -819,6 +823,21 @@ static void bnx2x_vf_mbx_close_vf(struct bnx2x *bp, struct bnx2x_virtf *vf,
819 bnx2x_vf_mbx_resp(bp, vf); 823 bnx2x_vf_mbx_resp(bp, vf);
820} 824}
821 825
826static void bnx2x_vf_mbx_release_vf(struct bnx2x *bp, struct bnx2x_virtf *vf,
827 struct bnx2x_vf_mbx *mbx)
828{
829 struct bnx2x_vfop_cmd cmd = {
830 .done = bnx2x_vf_mbx_resp,
831 .block = false,
832 };
833
834 DP(BNX2X_MSG_IOV, "VF[%d] VF_RELEASE\n", vf->abs_vfid);
835
836 vf->op_rc = bnx2x_vfop_release_cmd(bp, vf, &cmd);
837 if (vf->op_rc)
838 bnx2x_vf_mbx_resp(bp, vf);
839}
840
822/* dispatch request */ 841/* dispatch request */
823static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, 842static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
824 struct bnx2x_vf_mbx *mbx) 843 struct bnx2x_vf_mbx *mbx)
@@ -852,6 +871,9 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
852 case CHANNEL_TLV_CLOSE: 871 case CHANNEL_TLV_CLOSE:
853 bnx2x_vf_mbx_close_vf(bp, vf, mbx); 872 bnx2x_vf_mbx_close_vf(bp, vf, mbx);
854 break; 873 break;
874 case CHANNEL_TLV_RELEASE:
875 bnx2x_vf_mbx_release_vf(bp, vf, mbx);
876 break;
855 } 877 }
856 878
857 } else { 879 } else {
@@ -942,6 +964,7 @@ void bnx2x_vf_mbx(struct bnx2x *bp, struct vf_pf_event_data *vfpf_event)
942 goto mbx_done; 964 goto mbx_done;
943 965
944mbx_error: 966mbx_error:
967 bnx2x_vf_release(bp, vf, false); /* non blocking */
945mbx_done: 968mbx_done:
946 return; 969 return;
947} 970}