Skip to content

Commit 1e99c49

Browse files
mkalderondavem330
authored andcommitted
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: Michal Kalderon <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 471115a commit 1e99c49

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

drivers/net/ethernet/qlogic/qed/qed_iwarp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,14 @@ qed_iwarp_ll2_comp_syn_pkt(void *cxt, struct qed_ll2_comp_rx_data *data)
17331733

17341734
memset(&cm_info, 0, sizeof(cm_info));
17351735
ll2_syn_handle = p_hwfn->p_rdma_info->iwarp.ll2_syn_handle;
1736+
1737+
/* Check if packet was received with errors... */
1738+
if (data->err_flags) {
1739+
DP_NOTICE(p_hwfn, "Error received on SYN packet: 0x%x\n",
1740+
data->err_flags);
1741+
goto err;
1742+
}
1743+
17361744
if (GET_FIELD(data->parse_flags,
17371745
PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED) &&
17381746
GET_FIELD(data->parse_flags, PARSING_AND_ERR_FLAGS_L4CHKSMERROR)) {

drivers/net/ethernet/qlogic/qed/qed_ll2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ static void qed_ll2_rxq_parse_reg(struct qed_hwfn *p_hwfn,
413413
struct qed_ll2_comp_rx_data *data)
414414
{
415415
data->parse_flags = le16_to_cpu(p_cqe->rx_cqe_fp.parse_flags.flags);
416+
data->err_flags = le16_to_cpu(p_cqe->rx_cqe_fp.err_flags.flags);
416417
data->length.packet_length =
417418
le16_to_cpu(p_cqe->rx_cqe_fp.packet_length);
418419
data->vlan = le16_to_cpu(p_cqe->rx_cqe_fp.vlan);

include/linux/qed/qed_ll2_if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ struct qed_ll2_comp_rx_data {
101101
void *cookie;
102102
dma_addr_t rx_buf_addr;
103103
u16 parse_flags;
104+
u16 err_flags;
104105
u16 vlan;
105106
bool b_last_packet;
106107
u8 connection_handle;

0 commit comments

Comments
 (0)