diff options
author | Michal Kalderon <michals@broadcom.com> | 2014-02-12 11:19:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-12 19:15:41 -0500 |
commit | 14a94ebd48c12f1aee7495c1a1518c33efd3647c (patch) | |
tree | a4d58048d32c0f771b4ead463adf24e55144653c /drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |
parent | ba72f32cb8ad1963ba55b30860971f4e2b0ec5e8 (diff) |
bnx2x: Add support in PF driver for RSC
This provides PF-side support for VFs assigned to a VM running windows
2012 with the RSC feature enabled.
Signed-off-by: Michal Kalderon <michals@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 5c4980c66417..a4a3d7e04df9 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
@@ -176,6 +176,11 @@ enum bnx2x_vfop_rss_state { | |||
176 | BNX2X_VFOP_RSS_DONE | 176 | BNX2X_VFOP_RSS_DONE |
177 | }; | 177 | }; |
178 | 178 | ||
179 | enum bnx2x_vfop_tpa_state { | ||
180 | BNX2X_VFOP_TPA_CONFIG, | ||
181 | BNX2X_VFOP_TPA_DONE | ||
182 | }; | ||
183 | |||
179 | #define bnx2x_vfop_reset_wq(vf) atomic_set(&vf->op_in_progress, 0) | 184 | #define bnx2x_vfop_reset_wq(vf) atomic_set(&vf->op_in_progress, 0) |
180 | 185 | ||
181 | void bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp, struct bnx2x_virtf *vf, | 186 | void bnx2x_vfop_qctor_dump_tx(struct bnx2x *bp, struct bnx2x_virtf *vf, |
@@ -3047,6 +3052,83 @@ int bnx2x_vfop_rss_cmd(struct bnx2x *bp, | |||
3047 | return -ENOMEM; | 3052 | return -ENOMEM; |
3048 | } | 3053 | } |
3049 | 3054 | ||
3055 | /* VFOP tpa update, send update on all queues */ | ||
3056 | static void bnx2x_vfop_tpa(struct bnx2x *bp, struct bnx2x_virtf *vf) | ||
3057 | { | ||
3058 | struct bnx2x_vfop *vfop = bnx2x_vfop_cur(bp, vf); | ||
3059 | struct bnx2x_vfop_args_tpa *tpa_args = &vfop->args.tpa; | ||
3060 | enum bnx2x_vfop_tpa_state state = vfop->state; | ||
3061 | |||
3062 | bnx2x_vfop_reset_wq(vf); | ||
3063 | |||
3064 | if (vfop->rc < 0) | ||
3065 | goto op_err; | ||
3066 | |||
3067 | DP(BNX2X_MSG_IOV, "vf[%d:%d] STATE: %d\n", | ||
3068 | vf->abs_vfid, tpa_args->qid, | ||
3069 | state); | ||
3070 | |||
3071 | switch (state) { | ||
3072 | case BNX2X_VFOP_TPA_CONFIG: | ||
3073 | |||
3074 | if (tpa_args->qid < vf_rxq_count(vf)) { | ||
3075 | struct bnx2x_queue_state_params *qstate = | ||
3076 | &vf->op_params.qstate; | ||
3077 | |||
3078 | qstate->q_obj = &bnx2x_vfq(vf, tpa_args->qid, sp_obj); | ||
3079 | |||
3080 | /* The only thing that changes for the ramrod params | ||
3081 | * between calls is the sge_map | ||
3082 | */ | ||
3083 | qstate->params.update_tpa.sge_map = | ||
3084 | tpa_args->sge_map[tpa_args->qid]; | ||
3085 | |||
3086 | DP(BNX2X_MSG_IOV, "sge_addr[%d] %08x:%08x\n", | ||
3087 | tpa_args->qid, | ||
3088 | U64_HI(qstate->params.update_tpa.sge_map), | ||
3089 | U64_LO(qstate->params.update_tpa.sge_map)); | ||
3090 | qstate->cmd = BNX2X_Q_CMD_UPDATE_TPA; | ||
3091 | vfop->rc = bnx2x_queue_state_change(bp, qstate); | ||
3092 | |||
3093 | tpa_args->qid++; | ||
3094 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT); | ||
3095 | } | ||
3096 | vfop->state = BNX2X_VFOP_TPA_DONE; | ||
3097 | vfop->rc = 0; | ||
3098 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE); | ||
3099 | op_err: | ||
3100 | BNX2X_ERR("TPA update error: rc %d\n", vfop->rc); | ||
3101 | op_done: | ||
3102 | case BNX2X_VFOP_TPA_DONE: | ||
3103 | bnx2x_vfop_end(bp, vf, vfop); | ||
3104 | return; | ||
3105 | default: | ||
3106 | bnx2x_vfop_default(state); | ||
3107 | } | ||
3108 | op_pending: | ||
3109 | return; | ||
3110 | } | ||
3111 | |||
3112 | int bnx2x_vfop_tpa_cmd(struct bnx2x *bp, | ||
3113 | struct bnx2x_virtf *vf, | ||
3114 | struct bnx2x_vfop_cmd *cmd, | ||
3115 | struct vfpf_tpa_tlv *tpa_tlv) | ||
3116 | { | ||
3117 | struct bnx2x_vfop *vfop = bnx2x_vfop_add(bp, vf); | ||
3118 | |||
3119 | if (vfop) { | ||
3120 | vfop->args.qx.qid = 0; /* loop */ | ||
3121 | memcpy(&vfop->args.tpa.sge_map, | ||
3122 | tpa_tlv->tpa_client_info.sge_addr, | ||
3123 | sizeof(vfop->args.tpa.sge_map)); | ||
3124 | bnx2x_vfop_opset(BNX2X_VFOP_TPA_CONFIG, | ||
3125 | bnx2x_vfop_tpa, cmd->done); | ||
3126 | return bnx2x_vfop_transition(bp, vf, bnx2x_vfop_tpa, | ||
3127 | cmd->block); | ||
3128 | } | ||
3129 | return -ENOMEM; | ||
3130 | } | ||
3131 | |||
3050 | /* VF release ~ VF close + VF release-resources | 3132 | /* VF release ~ VF close + VF release-resources |
3051 | * Release is the ultimate SW shutdown and is called whenever an | 3133 | * Release is the ultimate SW shutdown and is called whenever an |
3052 | * irrecoverable error is encountered. | 3134 | * irrecoverable error is encountered. |