Commit 858f4deb authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

bnx2x: add VF Multicast filters support

This patch adds the necessary support for configuring (and removing) multicast
filters to VFs.
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c757dee
...@@ -166,6 +166,7 @@ enum bnx2x_vfop_qteardown_state { ...@@ -166,6 +166,7 @@ enum bnx2x_vfop_qteardown_state {
BNX2X_VFOP_QTEARDOWN_RXMODE, BNX2X_VFOP_QTEARDOWN_RXMODE,
BNX2X_VFOP_QTEARDOWN_CLR_VLAN, BNX2X_VFOP_QTEARDOWN_CLR_VLAN,
BNX2X_VFOP_QTEARDOWN_CLR_MAC, BNX2X_VFOP_QTEARDOWN_CLR_MAC,
BNX2X_VFOP_QTEARDOWN_CLR_MCAST,
BNX2X_VFOP_QTEARDOWN_QDTOR, BNX2X_VFOP_QTEARDOWN_QDTOR,
BNX2X_VFOP_QTEARDOWN_DONE BNX2X_VFOP_QTEARDOWN_DONE
}; };
...@@ -1112,7 +1113,10 @@ static void bnx2x_vfop_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf) ...@@ -1112,7 +1113,10 @@ static void bnx2x_vfop_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf)
switch (state) { switch (state) {
case BNX2X_VFOP_MCAST_DEL: case BNX2X_VFOP_MCAST_DEL:
/* clear existing mcasts */ /* clear existing mcasts */
vfop->state = BNX2X_VFOP_MCAST_ADD; vfop->state = (args->mc_num) ? BNX2X_VFOP_MCAST_ADD
: BNX2X_VFOP_MCAST_CHK_DONE;
mcast->mcast_list_len = vf->mcast_list_len;
vf->mcast_list_len = args->mc_num;
vfop->rc = bnx2x_config_mcast(bp, mcast, BNX2X_MCAST_CMD_DEL); vfop->rc = bnx2x_config_mcast(bp, mcast, BNX2X_MCAST_CMD_DEL);
bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT); bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT);
...@@ -1120,17 +1124,17 @@ static void bnx2x_vfop_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf) ...@@ -1120,17 +1124,17 @@ static void bnx2x_vfop_mcast(struct bnx2x *bp, struct bnx2x_virtf *vf)
if (raw->check_pending(raw)) if (raw->check_pending(raw))
goto op_pending; goto op_pending;
if (args->mc_num) {
/* update mcast list on the ramrod params */ /* update mcast list on the ramrod params */
INIT_LIST_HEAD(&mcast->mcast_list); INIT_LIST_HEAD(&mcast->mcast_list);
for (i = 0; i < args->mc_num; i++) for (i = 0; i < args->mc_num; i++)
list_add_tail(&(args->mc[i].link), list_add_tail(&(args->mc[i].link),
&mcast->mcast_list); &mcast->mcast_list);
mcast->mcast_list_len = args->mc_num;
/* add new mcasts */ /* add new mcasts */
vfop->state = BNX2X_VFOP_MCAST_CHK_DONE; vfop->state = BNX2X_VFOP_MCAST_CHK_DONE;
vfop->rc = bnx2x_config_mcast(bp, mcast, vfop->rc = bnx2x_config_mcast(bp, mcast,
BNX2X_MCAST_CMD_ADD); BNX2X_MCAST_CMD_ADD);
}
bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE); bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE);
case BNX2X_VFOP_MCAST_CHK_DONE: case BNX2X_VFOP_MCAST_CHK_DONE:
...@@ -1303,12 +1307,19 @@ static void bnx2x_vfop_qdown(struct bnx2x *bp, struct bnx2x_virtf *vf) ...@@ -1303,12 +1307,19 @@ static void bnx2x_vfop_qdown(struct bnx2x *bp, struct bnx2x_virtf *vf)
case BNX2X_VFOP_QTEARDOWN_CLR_MAC: case BNX2X_VFOP_QTEARDOWN_CLR_MAC:
/* mac-clear-all: consume credit */ /* mac-clear-all: consume credit */
vfop->state = BNX2X_VFOP_QTEARDOWN_QDTOR; vfop->state = BNX2X_VFOP_QTEARDOWN_CLR_MCAST;
vfop->rc = bnx2x_vfop_mac_delall_cmd(bp, vf, &cmd, qid, false); vfop->rc = bnx2x_vfop_mac_delall_cmd(bp, vf, &cmd, qid, false);
if (vfop->rc) if (vfop->rc)
goto op_err; goto op_err;
return; return;
case BNX2X_VFOP_QTEARDOWN_CLR_MCAST:
vfop->state = BNX2X_VFOP_QTEARDOWN_QDTOR;
vfop->rc = bnx2x_vfop_mcast_cmd(bp, vf, &cmd, NULL, 0, false);
if (vfop->rc)
goto op_err;
return;
case BNX2X_VFOP_QTEARDOWN_QDTOR: case BNX2X_VFOP_QTEARDOWN_QDTOR:
/* run the queue destruction flow */ /* run the queue destruction flow */
DP(BNX2X_MSG_IOV, "case: BNX2X_VFOP_QTEARDOWN_QDTOR\n"); DP(BNX2X_MSG_IOV, "case: BNX2X_VFOP_QTEARDOWN_QDTOR\n");
...@@ -2188,6 +2199,7 @@ int bnx2x_iov_nic_init(struct bnx2x *bp) ...@@ -2188,6 +2199,7 @@ int bnx2x_iov_nic_init(struct bnx2x *bp)
* It needs to be initialized here so that it can be safely * It needs to be initialized here so that it can be safely
* handled by a subsequent FLR flow. * handled by a subsequent FLR flow.
*/ */
vf->mcast_list_len = 0;
bnx2x_init_mcast_obj(bp, &vf->mcast_obj, 0xFF, bnx2x_init_mcast_obj(bp, &vf->mcast_obj, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
bnx2x_vf_sp(bp, vf, mcast_rdata), bnx2x_vf_sp(bp, vf, mcast_rdata),
...@@ -2848,13 +2860,9 @@ static void bnx2x_vfop_close(struct bnx2x *bp, struct bnx2x_virtf *vf) ...@@ -2848,13 +2860,9 @@ static void bnx2x_vfop_close(struct bnx2x *bp, struct bnx2x_virtf *vf)
goto op_err; goto op_err;
return; return;
} }
/* remove multicasts */
vfop->state = BNX2X_VFOP_CLOSE_HW; vfop->state = BNX2X_VFOP_CLOSE_HW;
vfop->rc = bnx2x_vfop_mcast_cmd(bp, vf, &cmd, NULL, 0, false); vfop->rc = 0;
if (vfop->rc) bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT);
goto op_err;
return;
case BNX2X_VFOP_CLOSE_HW: case BNX2X_VFOP_CLOSE_HW:
...@@ -2888,6 +2896,9 @@ static void bnx2x_vfop_close(struct bnx2x *bp, struct bnx2x_virtf *vf) ...@@ -2888,6 +2896,9 @@ static void bnx2x_vfop_close(struct bnx2x *bp, struct bnx2x_virtf *vf)
DP(BNX2X_MSG_IOV, "set state to acquired\n"); DP(BNX2X_MSG_IOV, "set state to acquired\n");
bnx2x_vfop_end(bp, vf, vfop); bnx2x_vfop_end(bp, vf, vfop);
op_pending:
/* Not supported at the moment; Exists for macros only */
return;
} }
int bnx2x_vfop_close_cmd(struct bnx2x *bp, int bnx2x_vfop_close_cmd(struct bnx2x *bp,
......
...@@ -268,6 +268,7 @@ struct bnx2x_virtf { ...@@ -268,6 +268,7 @@ struct bnx2x_virtf {
int leading_rss; int leading_rss;
/* MCAST object */ /* MCAST object */
int mcast_list_len;
struct bnx2x_mcast_obj mcast_obj; struct bnx2x_mcast_obj mcast_obj;
/* RSS configuration object */ /* RSS configuration object */
......
...@@ -1420,6 +1420,14 @@ static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf, ...@@ -1420,6 +1420,14 @@ static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf,
setup_q->rxq.cache_line_log; setup_q->rxq.cache_line_log;
rxq_params->sb_cq_index = setup_q->rxq.sb_index; rxq_params->sb_cq_index = setup_q->rxq.sb_index;
/* rx setup - multicast engine */
if (bnx2x_vfq_is_leading(q)) {
u8 mcast_id = FW_VF_HANDLE(vf->abs_vfid);
rxq_params->mcast_engine_id = mcast_id;
__set_bit(BNX2X_Q_FLG_MCAST, &setup_p->flags);
}
bnx2x_vfop_qctor_dump_rx(bp, vf, init_p, setup_p, bnx2x_vfop_qctor_dump_rx(bp, vf, init_p, setup_p,
q->index, q->sb_idx); q->index, q->sb_idx);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment