mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
nvmf_tcp: Correct padding calculation
PDU data alignment (PDA) isn't necessarily a power of 2, just a multiple of 4, so use roundup() instead of roundup2() to compute the PDU data offset (PDO). Sponsored by: Chelsio Communications
This commit is contained in:
parent
7b8dd078ea
commit
06b2ed7a3a
@ -432,7 +432,7 @@ nvmf_tcp_construct_pdu(struct nvmf_tcp_qpair *qp, void *hdr, size_t hlen,
|
||||
if (qp->header_digests)
|
||||
plen += sizeof(header_digest);
|
||||
if (data_len != 0) {
|
||||
pdo = roundup2(plen, qp->txpda);
|
||||
pdo = roundup(plen, qp->txpda);
|
||||
pad = pdo - plen;
|
||||
plen = pdo + data_len;
|
||||
if (qp->data_digests)
|
||||
|
@ -442,7 +442,7 @@ nvmf_tcp_construct_pdu(struct nvmf_tcp_qpair *qp, void *hdr, size_t hlen,
|
||||
plen += sizeof(digest);
|
||||
if (data_len != 0) {
|
||||
KASSERT(m_length(data, NULL) == data_len, ("length mismatch"));
|
||||
pdo = roundup2(plen, qp->txpda);
|
||||
pdo = roundup(plen, qp->txpda);
|
||||
pad = pdo - plen;
|
||||
plen = pdo + data_len;
|
||||
if (qp->data_digests)
|
||||
|
Loading…
Reference in New Issue
Block a user