Commit 1e99c497 authored by Michal Kalderon's avatar Michal Kalderon Committed by David S. Miller

qed: iWARP - Add check for errors on a SYN packet

A SYN packet which arrives with errors from FW should be dropped.
This required adding an additional field to the ll2
rx completion data.
Signed-off-by: default avatarMichal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: default avatarAriel Elior <Ariel.Elior@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 471115ab
...@@ -1733,6 +1733,14 @@ qed_iwarp_ll2_comp_syn_pkt(void *cxt, struct qed_ll2_comp_rx_data *data) ...@@ -1733,6 +1733,14 @@ qed_iwarp_ll2_comp_syn_pkt(void *cxt, struct qed_ll2_comp_rx_data *data)
memset(&cm_info, 0, sizeof(cm_info)); memset(&cm_info, 0, sizeof(cm_info));
ll2_syn_handle = p_hwfn->p_rdma_info->iwarp.ll2_syn_handle; ll2_syn_handle = p_hwfn->p_rdma_info->iwarp.ll2_syn_handle;
/* Check if packet was received with errors... */
if (data->err_flags) {
DP_NOTICE(p_hwfn, "Error received on SYN packet: 0x%x\n",
data->err_flags);
goto err;
}
if (GET_FIELD(data->parse_flags, if (GET_FIELD(data->parse_flags,
PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED) && PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED) &&
GET_FIELD(data->parse_flags, PARSING_AND_ERR_FLAGS_L4CHKSMERROR)) { GET_FIELD(data->parse_flags, PARSING_AND_ERR_FLAGS_L4CHKSMERROR)) {
......
...@@ -413,6 +413,7 @@ static void qed_ll2_rxq_parse_reg(struct qed_hwfn *p_hwfn, ...@@ -413,6 +413,7 @@ static void qed_ll2_rxq_parse_reg(struct qed_hwfn *p_hwfn,
struct qed_ll2_comp_rx_data *data) struct qed_ll2_comp_rx_data *data)
{ {
data->parse_flags = le16_to_cpu(p_cqe->rx_cqe_fp.parse_flags.flags); data->parse_flags = le16_to_cpu(p_cqe->rx_cqe_fp.parse_flags.flags);
data->err_flags = le16_to_cpu(p_cqe->rx_cqe_fp.err_flags.flags);
data->length.packet_length = data->length.packet_length =
le16_to_cpu(p_cqe->rx_cqe_fp.packet_length); le16_to_cpu(p_cqe->rx_cqe_fp.packet_length);
data->vlan = le16_to_cpu(p_cqe->rx_cqe_fp.vlan); data->vlan = le16_to_cpu(p_cqe->rx_cqe_fp.vlan);
......
...@@ -101,6 +101,7 @@ struct qed_ll2_comp_rx_data { ...@@ -101,6 +101,7 @@ struct qed_ll2_comp_rx_data {
void *cookie; void *cookie;
dma_addr_t rx_buf_addr; dma_addr_t rx_buf_addr;
u16 parse_flags; u16 parse_flags;
u16 err_flags;
u16 vlan; u16 vlan;
bool b_last_packet; bool b_last_packet;
u8 connection_handle; u8 connection_handle;
......
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