diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2013-12-26 02:57:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-26 13:38:21 -0500 |
commit | 858f4deb36a66aef25200b29b3074a51df6fd3fc (patch) | |
tree | 543b73681f8d1587f578e6c8790312503f781edc /drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |
parent | 0c757dee6af1bd9eb7ed615c97615202d4aeed09 (diff) |
bnx2x: add VF Multicast filters support
This patch adds the necessary support for configuring (and removing) multicast
filters to VFs.
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 | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 2e46c28fc601..25182765e4be 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
@@ -166,6 +166,7 @@ enum bnx2x_vfop_qteardown_state { | |||
166 | BNX2X_VFOP_QTEARDOWN_RXMODE, | 166 | BNX2X_VFOP_QTEARDOWN_RXMODE, |
167 | BNX2X_VFOP_QTEARDOWN_CLR_VLAN, | 167 | BNX2X_VFOP_QTEARDOWN_CLR_VLAN, |
168 | BNX2X_VFOP_QTEARDOWN_CLR_MAC, | 168 | BNX2X_VFOP_QTEARDOWN_CLR_MAC, |
169 | BNX2X_VFOP_QTEARDOWN_CLR_MCAST, | ||
169 | BNX2X_VFOP_QTEARDOWN_QDTOR, | 170 | BNX2X_VFOP_QTEARDOWN_QDTOR, |
170 | BNX2X_VFOP_QTEARDOWN_DONE | 171 | BNX2X_VFOP_QTEARDOWN_DONE |
171 | }; | 172 | }; |
@@ -1112,7 +1113,10 @@ static void bnx2x_vfop_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf) | |||
1112 | switch (state) { | 1113 | switch (state) { |
1113 | case BNX2X_VFOP_MCAST_DEL: | 1114 | case BNX2X_VFOP_MCAST_DEL: |
1114 | /* clear existing mcasts */ | 1115 | /* clear existing mcasts */ |
1115 | vfop->state = BNX2X_VFOP_MCAST_ADD; | 1116 | vfop->state = (args->mc_num) ? BNX2X_VFOP_MCAST_ADD |
1117 | : BNX2X_VFOP_MCAST_CHK_DONE; | ||
1118 | mcast->mcast_list_len = vf->mcast_list_len; | ||
1119 | vf->mcast_list_len = args->mc_num; | ||
1116 | vfop->rc = bnx2x_config_mcast(bp, mcast, BNX2X_MCAST_CMD_DEL); | 1120 | vfop->rc = bnx2x_config_mcast(bp, mcast, BNX2X_MCAST_CMD_DEL); |
1117 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT); | 1121 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT); |
1118 | 1122 | ||
@@ -1120,17 +1124,17 @@ static void bnx2x_vfop_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf) | |||
1120 | if (raw->check_pending(raw)) | 1124 | if (raw->check_pending(raw)) |
1121 | goto op_pending; | 1125 | goto op_pending; |
1122 | 1126 | ||
1123 | if (args->mc_num) { | 1127 | /* update mcast list on the ramrod params */ |
1124 | /* update mcast list on the ramrod params */ | 1128 | INIT_LIST_HEAD(&mcast->mcast_list); |
1125 | INIT_LIST_HEAD(&mcast->mcast_list); | 1129 | for (i = 0; i < args->mc_num; i++) |
1126 | for (i = 0; i < args->mc_num; i++) | 1130 | list_add_tail(&(args->mc[i].link), |
1127 | list_add_tail(&(args->mc[i].link), | 1131 | &mcast->mcast_list); |
1128 | &mcast->mcast_list); | 1132 | mcast->mcast_list_len = args->mc_num; |
1129 | /* add new mcasts */ | 1133 | |
1130 | vfop->state = BNX2X_VFOP_MCAST_CHK_DONE; | 1134 | /* add new mcasts */ |
1131 | vfop->rc = bnx2x_config_mcast(bp, mcast, | 1135 | vfop->state = BNX2X_VFOP_MCAST_CHK_DONE; |
1132 | BNX2X_MCAST_CMD_ADD); | 1136 | vfop->rc = bnx2x_config_mcast(bp, mcast, |
1133 | } | 1137 | BNX2X_MCAST_CMD_ADD); |
1134 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE); | 1138 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE); |
1135 | 1139 | ||
1136 | case BNX2X_VFOP_MCAST_CHK_DONE: | 1140 | case BNX2X_VFOP_MCAST_CHK_DONE: |
@@ -1303,12 +1307,19 @@ static void bnx2x_vfop_qdown(struct bnx2x *bp, struct bnx2x_virtf *vf) | |||
1303 | 1307 | ||
1304 | case BNX2X_VFOP_QTEARDOWN_CLR_MAC: | 1308 | case BNX2X_VFOP_QTEARDOWN_CLR_MAC: |
1305 | /* mac-clear-all: consume credit */ | 1309 | /* mac-clear-all: consume credit */ |
1306 | vfop->state = BNX2X_VFOP_QTEARDOWN_QDTOR; | 1310 | vfop->state = BNX2X_VFOP_QTEARDOWN_CLR_MCAST; |
1307 | vfop->rc = bnx2x_vfop_mac_delall_cmd(bp, vf, &cmd, qid, false); | 1311 | vfop->rc = bnx2x_vfop_mac_delall_cmd(bp, vf, &cmd, qid, false); |
1308 | if (vfop->rc) | 1312 | if (vfop->rc) |
1309 | goto op_err; | 1313 | goto op_err; |
1310 | return; | 1314 | return; |
1311 | 1315 | ||
1316 | case BNX2X_VFOP_QTEARDOWN_CLR_MCAST: | ||
1317 | vfop->state = BNX2X_VFOP_QTEARDOWN_QDTOR; | ||
1318 | vfop->rc = bnx2x_vfop_mcast_cmd(bp, vf, &cmd, NULL, 0, false); | ||
1319 | if (vfop->rc) | ||
1320 | goto op_err; | ||
1321 | return; | ||
1322 | |||
1312 | case BNX2X_VFOP_QTEARDOWN_QDTOR: | 1323 | case BNX2X_VFOP_QTEARDOWN_QDTOR: |
1313 | /* run the queue destruction flow */ | 1324 | /* run the queue destruction flow */ |
1314 | DP(BNX2X_MSG_IOV, "case: BNX2X_VFOP_QTEARDOWN_QDTOR\n"); | 1325 | DP(BNX2X_MSG_IOV, "case: BNX2X_VFOP_QTEARDOWN_QDTOR\n"); |
@@ -2188,6 +2199,7 @@ int bnx2x_iov_nic_init(struct bnx2x *bp) | |||
2188 | * It needs to be initialized here so that it can be safely | 2199 | * It needs to be initialized here so that it can be safely |
2189 | * handled by a subsequent FLR flow. | 2200 | * handled by a subsequent FLR flow. |
2190 | */ | 2201 | */ |
2202 | vf->mcast_list_len = 0; | ||
2191 | bnx2x_init_mcast_obj(bp, &vf->mcast_obj, 0xFF, | 2203 | bnx2x_init_mcast_obj(bp, &vf->mcast_obj, 0xFF, |
2192 | 0xFF, 0xFF, 0xFF, | 2204 | 0xFF, 0xFF, 0xFF, |
2193 | bnx2x_vf_sp(bp, vf, mcast_rdata), | 2205 | bnx2x_vf_sp(bp, vf, mcast_rdata), |
@@ -2848,13 +2860,9 @@ static void bnx2x_vfop_close(struct bnx2x *bp, struct bnx2x_virtf *vf) | |||
2848 | goto op_err; | 2860 | goto op_err; |
2849 | return; | 2861 | return; |
2850 | } | 2862 | } |
2851 | |||
2852 | /* remove multicasts */ | ||
2853 | vfop->state = BNX2X_VFOP_CLOSE_HW; | 2863 | vfop->state = BNX2X_VFOP_CLOSE_HW; |
2854 | vfop->rc = bnx2x_vfop_mcast_cmd(bp, vf, &cmd, NULL, 0, false); | 2864 | vfop->rc = 0; |
2855 | if (vfop->rc) | 2865 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT); |
2856 | goto op_err; | ||
2857 | return; | ||
2858 | 2866 | ||
2859 | case BNX2X_VFOP_CLOSE_HW: | 2867 | case BNX2X_VFOP_CLOSE_HW: |
2860 | 2868 | ||
@@ -2888,6 +2896,9 @@ op_done: | |||
2888 | 2896 | ||
2889 | DP(BNX2X_MSG_IOV, "set state to acquired\n"); | 2897 | DP(BNX2X_MSG_IOV, "set state to acquired\n"); |
2890 | bnx2x_vfop_end(bp, vf, vfop); | 2898 | bnx2x_vfop_end(bp, vf, vfop); |
2899 | op_pending: | ||
2900 | /* Not supported at the moment; Exists for macros only */ | ||
2901 | return; | ||
2891 | } | 2902 | } |
2892 | 2903 | ||
2893 | int bnx2x_vfop_close_cmd(struct bnx2x *bp, | 2904 | int bnx2x_vfop_close_cmd(struct bnx2x *bp, |