Lines Matching refs:hdr

125     nxt_port_mmap_header_t **hdr, nxt_unit_read_buf_t *rbuf);
130 nxt_port_mmap_header_t *hdr, void *start, uint32_t size);
212 nxt_port_mmap_header_t *hdr; member
334 nxt_port_mmap_header_t *hdr; member
2474 mmap_buf->hdr = NULL; in nxt_unit_mmap_buf_get()
2643 nxt_port_mmap_header_t *hdr; in nxt_unit_mmap_buf_send() local
2650 hdr = mmap_buf->hdr; in nxt_unit_mmap_buf_send()
2659 m.msg.mmap = hdr != NULL && m.mmap_msg.size > 0; in nxt_unit_mmap_buf_send()
2666 m.mmap_msg.mmap_id = hdr->id; in nxt_unit_mmap_buf_send()
2667 m.mmap_msg.chunk_id = nxt_port_mmap_chunk_id(hdr, in nxt_unit_mmap_buf_send()
2683 first_free_chunk = nxt_port_mmap_chunk_id(hdr, last_used) + 1; in nxt_unit_mmap_buf_send()
2686 first_free = nxt_port_mmap_chunk_start(hdr, first_free_chunk); in nxt_unit_mmap_buf_send()
2700 mmap_buf->hdr = NULL; in nxt_unit_mmap_buf_send()
2765 if (mmap_buf->hdr != NULL) { in nxt_unit_free_outgoing_buf()
2767 mmap_buf->hdr, mmap_buf->buf.start, in nxt_unit_free_outgoing_buf()
2770 mmap_buf->hdr = NULL; in nxt_unit_free_outgoing_buf()
3183 mmap_buf->hdr = NULL; in nxt_unit_request_preread()
3450 if (ws_impl->buf->free_ptr != NULL || ws_impl->buf->hdr != NULL) { in nxt_unit_websocket_retain()
3499 nxt_port_mmap_header_t *hdr; in nxt_unit_mmap_get() local
3512 hdr = mm->hdr; in nxt_unit_mmap_get()
3514 if (hdr->sent_over != 0xFFFFu in nxt_unit_mmap_get()
3515 && (hdr->sent_over != port->id.id in nxt_unit_mmap_get()
3523 while (nxt_port_mmap_get_free_chunk(hdr->free_map, c)) { in nxt_unit_mmap_get()
3527 res = nxt_port_mmap_chk_set_chunk_busy(hdr->free_map, in nxt_unit_mmap_get()
3538 nxt_port_mmap_set_chunk_free(hdr->free_map, *c + i); in nxt_unit_mmap_get()
3556 hdr->oosm = 1; in nxt_unit_mmap_get()
3602 hdr = nxt_unit_new_mmap(ctx, port, *n); in nxt_unit_mmap_get()
3613 return hdr; in nxt_unit_mmap_get()
3729 e->hdr = NULL; in nxt_unit_mmap_at()
3751 nxt_port_mmap_header_t *hdr; in nxt_unit_new_mmap() local
3777 mm->hdr = mem; in nxt_unit_new_mmap()
3778 hdr = mem; in nxt_unit_new_mmap()
3780 memset(hdr->free_map, 0xFFU, sizeof(hdr->free_map)); in nxt_unit_new_mmap()
3781 memset(hdr->free_tracking_map, 0xFFU, sizeof(hdr->free_tracking_map)); in nxt_unit_new_mmap()
3783 hdr->id = lib->outgoing.size - 1; in nxt_unit_new_mmap()
3784 hdr->src_pid = lib->pid; in nxt_unit_new_mmap()
3785 hdr->dst_pid = port->id.pid; in nxt_unit_new_mmap()
3786 hdr->sent_over = port->id.id; in nxt_unit_new_mmap()
3791 nxt_port_mmap_set_chunk_busy(hdr->free_map, i); in nxt_unit_new_mmap()
3795 nxt_port_mmap_set_chunk_busy(hdr->free_map, PORT_MMAP_CHUNK_COUNT); in nxt_unit_new_mmap()
3796 nxt_port_mmap_set_chunk_busy(hdr->free_tracking_map, PORT_MMAP_CHUNK_COUNT); in nxt_unit_new_mmap()
3803 hdr = NULL; in nxt_unit_new_mmap()
3807 hdr->id, (int) lib->pid, (int) port->id.pid); in nxt_unit_new_mmap()
3814 if (nxt_fast_path(hdr != NULL)) { in nxt_unit_new_mmap()
3815 return hdr; in nxt_unit_new_mmap()
3937 nxt_port_mmap_header_t *hdr; in nxt_unit_get_outgoing_buf() local
3954 mmap_buf->hdr = NULL; in nxt_unit_get_outgoing_buf()
3968 hdr = nxt_unit_mmap_get(ctx, port, &c, &nchunks, min_nchunks); in nxt_unit_get_outgoing_buf()
3969 if (nxt_slow_path(hdr == NULL)) { in nxt_unit_get_outgoing_buf()
3971 mmap_buf->hdr = NULL; in nxt_unit_get_outgoing_buf()
3983 mmap_buf->hdr = hdr; in nxt_unit_get_outgoing_buf()
3984 mmap_buf->buf.start = (char *) nxt_port_mmap_chunk_start(hdr, c); in nxt_unit_get_outgoing_buf()
3991 (int) hdr->id, (int) c, in nxt_unit_get_outgoing_buf()
4009 nxt_port_mmap_header_t *hdr; in nxt_unit_incoming_mmap() local
4031 hdr = mem; in nxt_unit_incoming_mmap()
4033 if (nxt_slow_path(hdr->src_pid != pid)) { in nxt_unit_incoming_mmap()
4036 "detected: %d != %d or %d != %d", (int) hdr->src_pid, in nxt_unit_incoming_mmap()
4037 (int) pid, (int) hdr->dst_pid, (int) lib->pid); in nxt_unit_incoming_mmap()
4048 mm = nxt_unit_mmap_at(&lib->incoming, hdr->id); in nxt_unit_incoming_mmap()
4057 mm->hdr = hdr; in nxt_unit_incoming_mmap()
4059 hdr->sent_over = 0xFFFFu; in nxt_unit_incoming_mmap()
4158 munmap(mm->hdr, PORT_MMAP_SIZE); in nxt_unit_mmaps_destroy()
4170 pid_t pid, uint32_t id, nxt_port_mmap_header_t **hdr, in nxt_unit_check_rbuf_mmap() argument
4183 *hdr = NULL; in nxt_unit_check_rbuf_mmap()
4188 *hdr = mm->hdr; in nxt_unit_check_rbuf_mmap()
4190 if (nxt_fast_path(*hdr != NULL)) { in nxt_unit_check_rbuf_mmap()
4226 nxt_port_mmap_header_t *hdr; in nxt_unit_mmap_read() local
4270 &hdr, rbuf); in nxt_unit_mmap_read()
4280 start = nxt_port_mmap_chunk_start(hdr, mmap_msg->chunk_id); in nxt_unit_mmap_read()
4291 b->hdr = hdr; in nxt_unit_mmap_read()
4298 (int) hdr->src_pid, (int) hdr->dst_pid, in nxt_unit_mmap_read()
4299 (int) hdr->id, (int) mmap_msg->chunk_id, in nxt_unit_mmap_read()
4344 nxt_unit_mmap_release(nxt_unit_ctx_t *ctx, nxt_port_mmap_header_t *hdr, in nxt_unit_mmap_release() argument
4356 c = nxt_port_mmap_chunk_id(hdr, p); in nxt_unit_mmap_release()
4360 nxt_port_mmap_set_chunk_free(hdr->free_map, c); in nxt_unit_mmap_release()
4369 if (hdr->src_pid == lib->pid && freed_chunks != 0) { in nxt_unit_mmap_release()
4376 if (hdr->dst_pid == lib->pid in nxt_unit_mmap_release()
4378 && nxt_atomic_cmp_set(&hdr->oosm, 1, 0)) in nxt_unit_mmap_release()
4380 nxt_unit_send_shm_ack(ctx, hdr->src_pid); in nxt_unit_mmap_release()