Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107589247
D31576.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D31576.diff
View Options
diff --git a/sys/dev/cxgbe/cxgbei/cxgbei.c b/sys/dev/cxgbe/cxgbei/cxgbei.c
--- a/sys/dev/cxgbe/cxgbei/cxgbei.c
+++ b/sys/dev/cxgbe/cxgbei/cxgbei.c
@@ -98,7 +98,7 @@
static void
read_pdu_limits(struct adapter *sc, uint32_t *max_tx_data_len,
- uint32_t *max_rx_data_len)
+ uint32_t *max_rx_data_len, struct ppod_region *pr)
{
uint32_t tx_len, rx_len, r, v;
@@ -123,6 +123,14 @@
tx_len -= ISCSI_BHS_SIZE + ISCSI_HEADER_DIGEST_SIZE +
ISCSI_DATA_DIGEST_SIZE;
+ /*
+ * DDP can place only 4 pages for a single PDU. A single
+ * request might use larger pages than the smallest page size,
+ * but that cannot be guaranteed. Assume the smallest DDP
+ * page size for this limit.
+ */
+ rx_len = min(rx_len, 4 * (1U << pr->pr_page_shift[0]));
+
if (chip_id(sc) == CHELSIO_T5) {
rx_len = rounddown2(rx_len, 512);
tx_len = rounddown2(tx_len, 512);
@@ -149,8 +157,6 @@
MPASS(sc->vres.iscsi.size > 0);
MPASS(ci != NULL);
- read_pdu_limits(sc, &ci->max_tx_data_len, &ci->max_rx_data_len);
-
pr = &ci->pr;
r = t4_read_reg(sc, A_ULP_RX_ISCSI_PSZ);
rc = t4_init_ppod_region(pr, &sc->vres.iscsi, r, "iSCSI page pods");
@@ -176,6 +182,8 @@
V_ISCSITAGMASK(M_ISCSITAGMASK), pr->pr_tag_mask);
}
+ read_pdu_limits(sc, &ci->max_tx_data_len, &ci->max_rx_data_len, pr);
+
sysctl_ctx_init(&ci->ctx);
oid = device_get_sysctl_tree(sc->dev); /* dev.t5nex.X */
children = SYSCTL_CHILDREN(oid);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 17, 7:43 AM (20 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15835990
Default Alt Text
D31576.diff (1 KB)
Attached To
Mode
D31576: cxgbei: Restrict received PDUs to 4 DDP pages in length.
Attached
Detach File
Event Timeline
Log In to Comment