Page MenuHomeFreeBSD

D55470.id172545.diff
No OneTemporary

D55470.id172545.diff

diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -496,9 +496,6 @@
#define MIN_ISO_TX_CREDITS (howmany(sizeof(struct cpl_tx_data_iso), 16))
#define MIN_TX_CREDITS(iso) \
(MIN_OFLD_TX_CREDITS + ((iso) ? MIN_ISO_TX_CREDITS : 0))
-#define MIN_OFLD_TX_V2_CREDITS (howmany(sizeof(struct fw_ofld_tx_data_v2_wr) + 1, 16))
-#define MIN_TX_V2_CREDITS(iso) \
- (MIN_OFLD_TX_V2_CREDITS + ((iso) ? MIN_ISO_TX_CREDITS : 0))
_Static_assert(MAX_OFLD_TX_CREDITS <= MAX_OFLD_TX_SDESC_CREDITS,
"MAX_OFLD_TX_SDESC_CREDITS too small");
@@ -527,7 +524,7 @@
/* Maximum number of SGL entries we could stuff in a WR */
static inline int
-max_dsgl_nsegs(int tx_credits, int iso)
+max_dsgl_nsegs(int tx_credits, int iso, int imm_payload)
{
int nseg = 1; /* ulptx_sgl has room for 1, rest ulp_tx_sge_pair */
int sge_pair_credits = tx_credits - MIN_TX_CREDITS(iso);
@@ -536,45 +533,7 @@
tx_credits <= MAX_OFLD_TX_CREDITS,
("%s: %d credits", __func__, tx_credits));
- if (tx_credits < MIN_TX_CREDITS(iso))
- return (0);
-
- nseg += 2 * (sge_pair_credits * 16 / 24);
- if ((sge_pair_credits * 16) % 24 == 16)
- nseg++;
-
- return (nseg);
-}
-
-/* Maximum amount of immediate data we could stuff in a WR */
-static inline int
-max_imm_payload_v2(int tx_credits, int iso)
-{
- const int iso_cpl_size = iso ? sizeof(struct cpl_tx_data_iso) : 0;
-
- KASSERT(tx_credits >= 0 &&
- tx_credits <= MAX_OFLD_TX_CREDITS,
- ("%s: %d credits", __func__, tx_credits));
-
- if (tx_credits < MIN_TX_V2_CREDITS(iso))
- return (0);
-
- return (tx_credits * 16 - sizeof(struct fw_ofld_tx_data_v2_wr) -
- iso_cpl_size);
-}
-
-/* Maximum number of SGL entries we could stuff in a WR */
-static inline int
-max_dsgl_nsegs_v2(int tx_credits, int iso, int imm_payload)
-{
- int nseg = 1; /* ulptx_sgl has room for 1, rest ulp_tx_sge_pair */
- int sge_pair_credits = tx_credits - MIN_TX_V2_CREDITS(iso);
-
- KASSERT(tx_credits >= 0 &&
- tx_credits <= MAX_OFLD_TX_CREDITS,
- ("%s: %d credits", __func__, tx_credits));
-
- if (tx_credits < MIN_TX_V2_CREDITS(iso) ||
+ if (tx_credits < MIN_TX_CREDITS(iso) ||
sge_pair_credits <= howmany(imm_payload, 16))
return (0);
sge_pair_credits -= howmany(imm_payload, 16);
@@ -613,35 +572,6 @@
}
}
-static inline void
-write_tx_v2_wr(void *dst, struct toepcb *toep, int fw_wr_opcode,
- unsigned int immdlen, unsigned int plen, uint8_t credits, int shove,
- int ulp_submode)
-{
- struct fw_ofld_tx_data_v2_wr *txwr = dst;
- uint32_t flags;
-
- memset(txwr, 0, sizeof(*txwr));
- txwr->op_to_immdlen = htobe32(V_WR_OP(fw_wr_opcode) |
- V_FW_WR_IMMDLEN(immdlen));
- txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) |
- V_FW_WR_LEN16(credits));
- txwr->plen = htobe32(plen);
- flags = V_TX_ULP_MODE(ULP_MODE_NVMET) | V_TX_ULP_SUBMODE(ulp_submode) |
- V_TX_URG(0) | V_TX_SHOVE(shove);
-
- if (toep->params.tx_align > 0) {
- if (plen < 2 * toep->params.emss)
- flags |= F_FW_OFLD_TX_DATA_WR_LSODISABLE;
- else
- flags |= F_FW_OFLD_TX_DATA_WR_ALIGNPLD |
- (toep->params.nagle == 0 ? 0 :
- F_FW_OFLD_TX_DATA_WR_ALIGNPLDSHOVE);
- }
-
- txwr->lsodisable_to_flags = htobe32(flags);
-}
-
/*
* Generate a DSGL from a starting mbuf. The total number of segments and the
* maximum segments in any one mbuf are provided.
@@ -810,7 +740,7 @@
do {
tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS);
max_imm = max_imm_payload(tx_credits, 0);
- max_nsegs = max_dsgl_nsegs(tx_credits, 0);
+ max_nsegs = max_dsgl_nsegs(tx_credits, 0, 0);
if (__predict_false((sndptr = mbufq_first(pduq)) != NULL)) {
if (!t4_push_raw_wr(sc, toep, sndptr)) {
@@ -1134,7 +1064,7 @@
iso = mbuf_iscsi_iso(sndptr);
max_imm = max_imm_payload(tx_credits, iso);
- max_nsegs = max_dsgl_nsegs(tx_credits, iso);
+ max_nsegs = max_dsgl_nsegs(tx_credits, iso, 0);
iso_mss = mbuf_iscsi_iso_mss(sndptr);
plen = 0;
@@ -1300,7 +1230,7 @@
{
struct mbuf *m;
const struct nvme_tcp_common_pdu_hdr *hdr;
- struct fw_v2_nvmet_tx_data_wr *txwr;
+ struct fw_ofld_tx_data_wr *txwr;
struct cpl_tx_data_iso *cpl_iso;
void *p;
struct wrqe *wr;
@@ -1337,7 +1267,7 @@
imm_data = sndptr->m_len;
iso = mbuf_iscsi_iso(sndptr);
- max_imm = max_imm_payload_v2(tx_credits, iso);
+ max_imm = max_imm_payload(tx_credits, iso);
/*
* Not enough credits for the PDU header.
@@ -1345,7 +1275,7 @@
if (imm_data > max_imm)
return (NULL);
- max_nsegs = max_dsgl_nsegs_v2(tx_credits, iso, imm_data);
+ max_nsegs = max_dsgl_nsegs(tx_credits, iso, imm_data);
iso_mss = mbuf_iscsi_iso_mss(sndptr);
plen = imm_data;
@@ -1460,7 +1390,7 @@
credits = howmany(wr->wr_len, 16);
if (iso) {
- write_tx_v2_wr(txwr, toep, FW_V2_NVMET_TX_DATA_WR,
+ write_tx_wr(txwr, toep, FW_ISCSI_TX_DATA_WR,
imm_data + sizeof(struct cpl_tx_data_iso),
adjusted_plen, credits, shove, ulp_submode | ULP_ISO);
cpl_iso = (struct cpl_tx_data_iso *)(txwr + 1);
@@ -1470,7 +1400,7 @@
hdr->pdo);
p = cpl_iso + 1;
} else {
- write_tx_v2_wr(txwr, toep, FW_V2_NVMET_TX_DATA_WR, imm_data,
+ write_tx_wr(txwr, toep, FW_OFLD_TX_DATA_WR, imm_data,
adjusted_plen, credits, shove, ulp_submode);
p = txwr + 1;
}

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 21, 5:37 PM (1 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28978810
Default Alt Text
D55470.id172545.diff (5 KB)

Event Timeline