Commit 77a80e23 authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller

RDMA/cxgb4: Cleanup Filter related macros/register defines

This patch cleanups all filter related macros/register defines that are defined
in t4fw_api.h and the affected files.
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2f90ade6
...@@ -1762,10 +1762,10 @@ static void send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid) ...@@ -1762,10 +1762,10 @@ static void send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid)
req->le.pport = sin->sin_port; req->le.pport = sin->sin_port;
req->le.u.ipv4.pip = sin->sin_addr.s_addr; req->le.u.ipv4.pip = sin->sin_addr.s_addr;
req->tcb.t_state_to_astid = req->tcb.t_state_to_astid =
htonl(V_FW_OFLD_CONNECTION_WR_T_STATE(TCP_SYN_SENT) | htonl(FW_OFLD_CONNECTION_WR_T_STATE_V(TCP_SYN_SENT) |
V_FW_OFLD_CONNECTION_WR_ASTID(atid)); FW_OFLD_CONNECTION_WR_ASTID_V(atid));
req->tcb.cplrxdataack_cplpassacceptrpl = req->tcb.cplrxdataack_cplpassacceptrpl =
htons(F_FW_OFLD_CONNECTION_WR_CPLRXDATAACK); htons(FW_OFLD_CONNECTION_WR_CPLRXDATAACK_F);
req->tcb.tx_max = (__force __be32) jiffies; req->tcb.tx_max = (__force __be32) jiffies;
req->tcb.rcv_adv = htons(1); req->tcb.rcv_adv = htons(1);
best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx,
...@@ -3539,7 +3539,7 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb, ...@@ -3539,7 +3539,7 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb,
memset(req, 0, sizeof(*req)); memset(req, 0, sizeof(*req));
req->op_compl = htonl(V_WR_OP(FW_OFLD_CONNECTION_WR) | FW_WR_COMPL_F); req->op_compl = htonl(V_WR_OP(FW_OFLD_CONNECTION_WR) | FW_WR_COMPL_F);
req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16))); req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));
req->le.version_cpl = htonl(F_FW_OFLD_CONNECTION_WR_CPL); req->le.version_cpl = htonl(FW_OFLD_CONNECTION_WR_CPL_F);
req->le.filter = (__force __be32) filter; req->le.filter = (__force __be32) filter;
req->le.lport = lport; req->le.lport = lport;
req->le.pport = rport; req->le.pport = rport;
...@@ -3548,9 +3548,9 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb, ...@@ -3548,9 +3548,9 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb,
req->tcb.rcv_nxt = htonl(rcv_isn + 1); req->tcb.rcv_nxt = htonl(rcv_isn + 1);
req->tcb.rcv_adv = htons(window); req->tcb.rcv_adv = htons(window);
req->tcb.t_state_to_astid = req->tcb.t_state_to_astid =
htonl(V_FW_OFLD_CONNECTION_WR_T_STATE(TCP_SYN_RECV) | htonl(FW_OFLD_CONNECTION_WR_T_STATE_V(TCP_SYN_RECV) |
V_FW_OFLD_CONNECTION_WR_RCV_SCALE(cpl->tcpopt.wsf) | FW_OFLD_CONNECTION_WR_RCV_SCALE_V(cpl->tcpopt.wsf) |
V_FW_OFLD_CONNECTION_WR_ASTID( FW_OFLD_CONNECTION_WR_ASTID_V(
GET_PASS_OPEN_TID(ntohl(cpl->tos_stid)))); GET_PASS_OPEN_TID(ntohl(cpl->tos_stid))));
/* /*
......
...@@ -1342,49 +1342,49 @@ static int set_filter_wr(struct adapter *adapter, int fidx) ...@@ -1342,49 +1342,49 @@ static int set_filter_wr(struct adapter *adapter, int fidx)
fwr->op_pkd = htonl(FW_WR_OP_V(FW_FILTER_WR)); fwr->op_pkd = htonl(FW_WR_OP_V(FW_FILTER_WR));
fwr->len16_pkd = htonl(FW_WR_LEN16_V(sizeof(*fwr)/16)); fwr->len16_pkd = htonl(FW_WR_LEN16_V(sizeof(*fwr)/16));
fwr->tid_to_iq = fwr->tid_to_iq =
htonl(V_FW_FILTER_WR_TID(ftid) | htonl(FW_FILTER_WR_TID_V(ftid) |
V_FW_FILTER_WR_RQTYPE(f->fs.type) | FW_FILTER_WR_RQTYPE_V(f->fs.type) |
V_FW_FILTER_WR_NOREPLY(0) | FW_FILTER_WR_NOREPLY_V(0) |
V_FW_FILTER_WR_IQ(f->fs.iq)); FW_FILTER_WR_IQ_V(f->fs.iq));
fwr->del_filter_to_l2tix = fwr->del_filter_to_l2tix =
htonl(V_FW_FILTER_WR_RPTTID(f->fs.rpttid) | htonl(FW_FILTER_WR_RPTTID_V(f->fs.rpttid) |
V_FW_FILTER_WR_DROP(f->fs.action == FILTER_DROP) | FW_FILTER_WR_DROP_V(f->fs.action == FILTER_DROP) |
V_FW_FILTER_WR_DIRSTEER(f->fs.dirsteer) | FW_FILTER_WR_DIRSTEER_V(f->fs.dirsteer) |
V_FW_FILTER_WR_MASKHASH(f->fs.maskhash) | FW_FILTER_WR_MASKHASH_V(f->fs.maskhash) |
V_FW_FILTER_WR_DIRSTEERHASH(f->fs.dirsteerhash) | FW_FILTER_WR_DIRSTEERHASH_V(f->fs.dirsteerhash) |
V_FW_FILTER_WR_LPBK(f->fs.action == FILTER_SWITCH) | FW_FILTER_WR_LPBK_V(f->fs.action == FILTER_SWITCH) |
V_FW_FILTER_WR_DMAC(f->fs.newdmac) | FW_FILTER_WR_DMAC_V(f->fs.newdmac) |
V_FW_FILTER_WR_SMAC(f->fs.newsmac) | FW_FILTER_WR_SMAC_V(f->fs.newsmac) |
V_FW_FILTER_WR_INSVLAN(f->fs.newvlan == VLAN_INSERT || FW_FILTER_WR_INSVLAN_V(f->fs.newvlan == VLAN_INSERT ||
f->fs.newvlan == VLAN_REWRITE) | f->fs.newvlan == VLAN_REWRITE) |
V_FW_FILTER_WR_RMVLAN(f->fs.newvlan == VLAN_REMOVE || FW_FILTER_WR_RMVLAN_V(f->fs.newvlan == VLAN_REMOVE ||
f->fs.newvlan == VLAN_REWRITE) | f->fs.newvlan == VLAN_REWRITE) |
V_FW_FILTER_WR_HITCNTS(f->fs.hitcnts) | FW_FILTER_WR_HITCNTS_V(f->fs.hitcnts) |
V_FW_FILTER_WR_TXCHAN(f->fs.eport) | FW_FILTER_WR_TXCHAN_V(f->fs.eport) |
V_FW_FILTER_WR_PRIO(f->fs.prio) | FW_FILTER_WR_PRIO_V(f->fs.prio) |
V_FW_FILTER_WR_L2TIX(f->l2t ? f->l2t->idx : 0)); FW_FILTER_WR_L2TIX_V(f->l2t ? f->l2t->idx : 0));
fwr->ethtype = htons(f->fs.val.ethtype); fwr->ethtype = htons(f->fs.val.ethtype);
fwr->ethtypem = htons(f->fs.mask.ethtype); fwr->ethtypem = htons(f->fs.mask.ethtype);
fwr->frag_to_ovlan_vldm = fwr->frag_to_ovlan_vldm =
(V_FW_FILTER_WR_FRAG(f->fs.val.frag) | (FW_FILTER_WR_FRAG_V(f->fs.val.frag) |
V_FW_FILTER_WR_FRAGM(f->fs.mask.frag) | FW_FILTER_WR_FRAGM_V(f->fs.mask.frag) |
V_FW_FILTER_WR_IVLAN_VLD(f->fs.val.ivlan_vld) | FW_FILTER_WR_IVLAN_VLD_V(f->fs.val.ivlan_vld) |
V_FW_FILTER_WR_OVLAN_VLD(f->fs.val.ovlan_vld) | FW_FILTER_WR_OVLAN_VLD_V(f->fs.val.ovlan_vld) |
V_FW_FILTER_WR_IVLAN_VLDM(f->fs.mask.ivlan_vld) | FW_FILTER_WR_IVLAN_VLDM_V(f->fs.mask.ivlan_vld) |
V_FW_FILTER_WR_OVLAN_VLDM(f->fs.mask.ovlan_vld)); FW_FILTER_WR_OVLAN_VLDM_V(f->fs.mask.ovlan_vld));
fwr->smac_sel = 0; fwr->smac_sel = 0;
fwr->rx_chan_rx_rpl_iq = fwr->rx_chan_rx_rpl_iq =
htons(V_FW_FILTER_WR_RX_CHAN(0) | htons(FW_FILTER_WR_RX_CHAN_V(0) |
V_FW_FILTER_WR_RX_RPL_IQ(adapter->sge.fw_evtq.abs_id)); FW_FILTER_WR_RX_RPL_IQ_V(adapter->sge.fw_evtq.abs_id));
fwr->maci_to_matchtypem = fwr->maci_to_matchtypem =
htonl(V_FW_FILTER_WR_MACI(f->fs.val.macidx) | htonl(FW_FILTER_WR_MACI_V(f->fs.val.macidx) |
V_FW_FILTER_WR_MACIM(f->fs.mask.macidx) | FW_FILTER_WR_MACIM_V(f->fs.mask.macidx) |
V_FW_FILTER_WR_FCOE(f->fs.val.fcoe) | FW_FILTER_WR_FCOE_V(f->fs.val.fcoe) |
V_FW_FILTER_WR_FCOEM(f->fs.mask.fcoe) | FW_FILTER_WR_FCOEM_V(f->fs.mask.fcoe) |
V_FW_FILTER_WR_PORT(f->fs.val.iport) | FW_FILTER_WR_PORT_V(f->fs.val.iport) |
V_FW_FILTER_WR_PORTM(f->fs.mask.iport) | FW_FILTER_WR_PORTM_V(f->fs.mask.iport) |
V_FW_FILTER_WR_MATCHTYPE(f->fs.val.matchtype) | FW_FILTER_WR_MATCHTYPE_V(f->fs.val.matchtype) |
V_FW_FILTER_WR_MATCHTYPEM(f->fs.mask.matchtype)); FW_FILTER_WR_MATCHTYPEM_V(f->fs.mask.matchtype));
fwr->ptcl = f->fs.val.proto; fwr->ptcl = f->fs.val.proto;
fwr->ptclm = f->fs.mask.proto; fwr->ptclm = f->fs.mask.proto;
fwr->ttyp = f->fs.val.tos; fwr->ttyp = f->fs.val.tos;
......
...@@ -2556,11 +2556,11 @@ void t4_mk_filtdelwr(unsigned int ftid, struct fw_filter_wr *wr, int qid) ...@@ -2556,11 +2556,11 @@ void t4_mk_filtdelwr(unsigned int ftid, struct fw_filter_wr *wr, int qid)
memset(wr, 0, sizeof(*wr)); memset(wr, 0, sizeof(*wr));
wr->op_pkd = htonl(FW_WR_OP_V(FW_FILTER_WR)); wr->op_pkd = htonl(FW_WR_OP_V(FW_FILTER_WR));
wr->len16_pkd = htonl(FW_WR_LEN16_V(sizeof(*wr) / 16)); wr->len16_pkd = htonl(FW_WR_LEN16_V(sizeof(*wr) / 16));
wr->tid_to_iq = htonl(V_FW_FILTER_WR_TID(ftid) | wr->tid_to_iq = htonl(FW_FILTER_WR_TID_V(ftid) |
V_FW_FILTER_WR_NOREPLY(qid < 0)); FW_FILTER_WR_NOREPLY_V(qid < 0));
wr->del_filter_to_l2tix = htonl(F_FW_FILTER_WR_DEL_FILTER); wr->del_filter_to_l2tix = htonl(FW_FILTER_WR_DEL_FILTER_F);
if (qid >= 0) if (qid >= 0)
wr->rx_chan_rx_rpl_iq = htons(V_FW_FILTER_WR_RX_RPL_IQ(qid)); wr->rx_chan_rx_rpl_iq = htons(FW_FILTER_WR_RX_RPL_IQ_V(qid));
} }
#define INIT_CMD(var, cmd, rd_wr) do { \ #define INIT_CMD(var, cmd, rd_wr) do { \
......
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