Skip to content

Commit 694d790

Browse files
committed
Merge branch 'qed-iWARP'
Michal Kalderon says: ==================== qed: iWARP - fix some syn related issues. This series fixes two bugs related to iWARP syn processing flow. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 8e29d23 + 8be3dad commit 694d790

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,15 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn,
16881688

16891689
eth_hlen = ETH_HLEN + (vlan_valid ? sizeof(u32) : 0);
16901690

1691+
if (!ether_addr_equal(ethh->h_dest,
1692+
p_hwfn->p_rdma_info->iwarp.mac_addr)) {
1693+
DP_VERBOSE(p_hwfn,
1694+
QED_MSG_RDMA,
1695+
"Got unexpected mac %pM instead of %pM\n",
1696+
ethh->h_dest, p_hwfn->p_rdma_info->iwarp.mac_addr);
1697+
return -EINVAL;
1698+
}
1699+
16911700
ether_addr_copy(remote_mac_addr, ethh->h_source);
16921701
ether_addr_copy(local_mac_addr, ethh->h_dest);
16931702

@@ -2605,7 +2614,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
26052614
struct qed_iwarp_info *iwarp_info;
26062615
struct qed_ll2_acquire_data data;
26072616
struct qed_ll2_cbs cbs;
2608-
u32 mpa_buff_size;
2617+
u32 buff_size;
26092618
u16 n_ooo_bufs;
26102619
int rc = 0;
26112620
int i;
@@ -2632,7 +2641,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
26322641

26332642
memset(&data, 0, sizeof(data));
26342643
data.input.conn_type = QED_LL2_TYPE_IWARP;
2635-
data.input.mtu = QED_IWARP_MAX_SYN_PKT_SIZE;
2644+
data.input.mtu = params->max_mtu;
26362645
data.input.rx_num_desc = QED_IWARP_LL2_SYN_RX_SIZE;
26372646
data.input.tx_num_desc = QED_IWARP_LL2_SYN_TX_SIZE;
26382647
data.input.tx_max_bds_per_packet = 1; /* will never be fragmented */
@@ -2654,9 +2663,10 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
26542663
goto err;
26552664
}
26562665

2666+
buff_size = QED_IWARP_MAX_BUF_SIZE(params->max_mtu);
26572667
rc = qed_iwarp_ll2_alloc_buffers(p_hwfn,
26582668
QED_IWARP_LL2_SYN_RX_SIZE,
2659-
QED_IWARP_MAX_SYN_PKT_SIZE,
2669+
buff_size,
26602670
iwarp_info->ll2_syn_handle);
26612671
if (rc)
26622672
goto err;
@@ -2710,10 +2720,9 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
27102720
if (rc)
27112721
goto err;
27122722

2713-
mpa_buff_size = QED_IWARP_MAX_BUF_SIZE(params->max_mtu);
27142723
rc = qed_iwarp_ll2_alloc_buffers(p_hwfn,
27152724
data.input.rx_num_desc,
2716-
mpa_buff_size,
2725+
buff_size,
27172726
iwarp_info->ll2_mpa_handle);
27182727
if (rc)
27192728
goto err;
@@ -2726,7 +2735,7 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
27262735

27272736
iwarp_info->max_num_partial_fpdus = (u16)p_hwfn->p_rdma_info->num_qps;
27282737

2729-
iwarp_info->mpa_intermediate_buf = kzalloc(mpa_buff_size, GFP_KERNEL);
2738+
iwarp_info->mpa_intermediate_buf = kzalloc(buff_size, GFP_KERNEL);
27302739
if (!iwarp_info->mpa_intermediate_buf)
27312740
goto err;
27322741

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ enum qed_iwarp_qp_state qed_roce2iwarp_state(enum qed_roce_qp_state state);
4646

4747
#define QED_IWARP_LL2_SYN_TX_SIZE (128)
4848
#define QED_IWARP_LL2_SYN_RX_SIZE (256)
49-
#define QED_IWARP_MAX_SYN_PKT_SIZE (128)
5049

5150
#define QED_IWARP_LL2_OOO_DEF_TX_SIZE (256)
5251
#define QED_IWARP_MAX_OOO (16)

0 commit comments

Comments
 (0)