target/cxgbit: use cxgb4_tp_smt_idx() to get smt idx
authorVarun Prakash <varun@chelsio.com>
Fri, 13 Jan 2017 15:23:22 +0000 (20:53 +0530)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 19 Feb 2017 05:24:19 +0000 (21:24 -0800)
cxgb4_tp_smt_idx() returns smt idx for T4,T5,T6 adapters.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/cxgbit/cxgbit_cm.c

index 35aaa36e9af50ae351c697b46b0d3e911e7cc1ea..845a7de39b9c4d08522a55ff4834f74c30aacdfe 100644 (file)
@@ -872,7 +872,8 @@ cxgbit_offload_init(struct cxgbit_sock *csk, int iptype, __u8 *peer_ip,
                        goto out;
                csk->mtu = ndev->mtu;
                csk->tx_chan = cxgb4_port_chan(ndev);
-               csk->smac_idx = (cxgb4_port_viid(ndev) & 0x7F) << 1;
+               csk->smac_idx = cxgb4_tp_smt_idx(cdev->lldi.adapter_type,
+                                                cxgb4_port_viid(ndev));
                step = cdev->lldi.ntxq /
                        cdev->lldi.nchan;
                csk->txq_idx = cxgb4_port_idx(ndev) * step;
@@ -907,7 +908,8 @@ cxgbit_offload_init(struct cxgbit_sock *csk, int iptype, __u8 *peer_ip,
                port_id = cxgb4_port_idx(ndev);
                csk->mtu = dst_mtu(dst);
                csk->tx_chan = cxgb4_port_chan(ndev);
-               csk->smac_idx = (cxgb4_port_viid(ndev) & 0x7F) << 1;
+               csk->smac_idx = cxgb4_tp_smt_idx(cdev->lldi.adapter_type,
+                                                cxgb4_port_viid(ndev));
                step = cdev->lldi.ntxq /
                        cdev->lldi.nports;
                csk->txq_idx = (port_id * step) +