unsigned short tx_zc_checked:1; /* Have I checked if I should ZC? */
unsigned short tx_nonblk:1; /* it's a non-blocking ACK */
struct bio_vec *tx_kiov; /* packet page frags */
- struct ksock_conn *tx_conn; /* owning conn */
- struct lnet_msg *tx_lnetmsg; /* lnet message for lnet_finalize() */
- time64_t tx_deadline; /* when (in secs) tx times out */
- struct ksock_msg tx_msg; /* socklnd message buffer */
- int tx_desc_size; /* size of this descriptor */
+ struct ksock_conn *tx_conn; /* owning conn */
+ struct lnet_msg *tx_lnetmsg; /* lnet message for lnet_finalize() */
+ time64_t tx_deadline; /* when (in secs) tx times out */
+ struct ksock_msg tx_msg; /* socklnd message buffer */
+ int tx_desc_size; /* size of this descriptor */
enum lnet_msg_hstatus tx_hstatus; /* health status of tx */
- union {
- struct {
- struct kvec iov; /* virt hdr */
- struct bio_vec kiov[0]; /* paged payload */
- } paged;
- struct {
- struct kvec iov[1]; /* virt hdr + payload */
- } virt;
- } tx_frags;
+ struct kvec tx_hdr; /* virt hdr */
+ struct bio_vec tx_payload[0]; /* paged payload */
};
-#define KSOCK_NOOP_TX_SIZE ((int)offsetof(struct ksock_tx, tx_frags.paged.kiov[0]))
+#define KSOCK_NOOP_TX_SIZE ((int)offsetof(struct ksock_tx, tx_payload[0]))
/* network zero copy callback descriptor embedded in struct ksock_tx */
{
struct ksock_tx *tx;
- tx = ksocknal_alloc_tx(KSOCK_MSG_NOOP, KSOCK_NOOP_TX_SIZE);
- if (tx == NULL) {
- CERROR("Can't allocate noop tx desc\n");
- return NULL;
- }
+ tx = ksocknal_alloc_tx(KSOCK_MSG_NOOP, KSOCK_NOOP_TX_SIZE);
+ if (tx == NULL) {
+ CERROR("Can't allocate noop tx desc\n");
+ return NULL;
+ }
- tx->tx_conn = NULL;
- tx->tx_lnetmsg = NULL;
- tx->tx_kiov = NULL;
- tx->tx_nkiov = 0;
- tx->tx_iov = tx->tx_frags.virt.iov;
- tx->tx_niov = 1;
- tx->tx_nonblk = nonblk;
+ tx->tx_conn = NULL;
+ tx->tx_lnetmsg = NULL;
+ tx->tx_kiov = NULL;
+ tx->tx_nkiov = 0;
+ tx->tx_iov = &tx->tx_hdr;
+ tx->tx_niov = 1;
+ tx->tx_nonblk = nonblk;
tx->tx_msg.ksm_csum = 0;
tx->tx_msg.ksm_type = KSOCK_MSG_NOOP;
tx->tx_msg.ksm_zc_cookies[0] = 0;
- tx->tx_msg.ksm_zc_cookies[1] = cookie;
+ tx->tx_msg.ksm_zc_cookies[1] = cookie;
- return tx;
+ return tx;
}
LASSERT (!in_interrupt ());
desc_size = offsetof(struct ksock_tx,
- tx_frags.paged.kiov[payload_niov]);
+ tx_payload[payload_niov]);
if (lntmsg->msg_vmflush)
mpflag = memalloc_noreclaim_save();
tx->tx_lnetmsg = lntmsg;
tx->tx_niov = 1;
- tx->tx_iov = &tx->tx_frags.paged.iov;
- tx->tx_kiov = tx->tx_frags.paged.kiov;
+ tx->tx_iov = &tx->tx_hdr;
+ tx->tx_kiov = tx->tx_payload;
tx->tx_nkiov = lnet_extract_kiov(payload_niov, tx->tx_kiov,
payload_niov, payload_kiov,
payload_offset, payload_nob);