public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
2c2d11abb26fc5955f2bd106882edc5ff79cfc28 blob 1845 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
/* SPDX-License-Identifier: GPL-2.0-or-later
 * Copyright Red Hat
 * Author: Laurent Vivier <lvivier@redhat.com>
 *
 * vhost-user common UDP and TCP functions
 */

#ifndef VU_COMMON_H
#define VU_COMMON_H
#include <linux/virtio_net.h>

#define IOV_PER_ELEM	(2)

static inline void *vu_eth(void *base)
{
	return ((char *)base + VNET_HLEN);
}

static inline void *vu_ip(void *base)
{
	return (struct ethhdr *)vu_eth(base) + 1;
}

static inline void *vu_payloadv4(void *base)
{
	return (struct iphdr *)vu_ip(base) + 1;
}

static inline void *vu_payloadv6(void *base)
{
	return (struct ipv6hdr *)vu_ip(base) + 1;
}

/**
 * vu_set_element() - Initialize a vu_virtq_element
 * @elem:	Element to initialize
 * @out_num:	Number of outgoing iovec buffers
 * @out_sg:	Out iovec entry to set in elem
 * @in_num:	Number of incoming iovec buffers
 * @in_sg:	In iovec entry to set in elem
 */
static inline void vu_set_element(struct vu_virtq_element *elem,
				  unsigned int out_num, struct iovec *out_sg,
				  unsigned int in_num, struct iovec *in_sg)
{
	elem->out_num = out_num;
	elem->out_sg = out_sg;
	elem->in_num = in_num;
	elem->in_sg = in_sg;
}

void vu_init_elem(struct vu_virtq_element *elem, struct iovec *iov,
		  int elem_cnt, int iov_per_elem);
int vu_collect(const struct vu_dev *vdev, struct vu_virtq *vq,
	       struct vu_virtq_element *elem, int max_elem, size_t size,
	       size_t *collected);
void vu_set_vnethdr(const struct vu_dev *vdev, struct iov_tail *data,
		    int num_buffers);
void vu_flush(const struct vu_dev *vdev, struct vu_virtq *vq,
	      struct vu_virtq_element *elem, int elem_cnt);
void vu_kick_cb(struct vu_dev *vdev, union epoll_ref ref,
		const struct timespec *now);
int vu_send_single(const struct ctx *c, const void *buf, size_t size);
void vu_pad(struct iovec *iov, size_t l2len);

#endif /* VU_COMMON_H */
debug log:

solving 2c2d11abb26f ...
found 2c2d11abb26f in https://archives.passt.top/passt-dev/20260227140330.2216753-12-lvivier@redhat.com/
found 51639c04df14 in https://archives.passt.top/passt-dev/20260227140330.2216753-11-lvivier@redhat.com/
found c1d2ce888f12 in https://archives.passt.top/passt-dev/20260227140330.2216753-10-lvivier@redhat.com/
found 41cf18936300 in https://archives.passt.top/passt-dev/20260227140330.2216753-9-lvivier@redhat.com/
found 052aff710502 in https://passt.top/passt
preparing index
index prepared:
100644 052aff710502c00fa63bd99046e23904fdfe1918	vu_common.h

applying [1/4] https://archives.passt.top/passt-dev/20260227140330.2216753-9-lvivier@redhat.com/
diff --git a/vu_common.h b/vu_common.h
index 052aff710502..41cf18936300 100644


applying [2/4] https://archives.passt.top/passt-dev/20260227140330.2216753-10-lvivier@redhat.com/
diff --git a/vu_common.h b/vu_common.h
index 41cf18936300..c1d2ce888f12 100644


applying [3/4] https://archives.passt.top/passt-dev/20260227140330.2216753-11-lvivier@redhat.com/
diff --git a/vu_common.h b/vu_common.h
index c1d2ce888f12..51639c04df14 100644


applying [4/4] https://archives.passt.top/passt-dev/20260227140330.2216753-12-lvivier@redhat.com/
diff --git a/vu_common.h b/vu_common.h
index 51639c04df14..2c2d11abb26f 100644

Checking patch vu_common.h...
Applied patch vu_common.h cleanly.
Checking patch vu_common.h...
Applied patch vu_common.h cleanly.
Checking patch vu_common.h...
Applied patch vu_common.h cleanly.
Checking patch vu_common.h...
Applied patch vu_common.h cleanly.

index at:
100644 2c2d11abb26fc5955f2bd106882edc5ff79cfc28	vu_common.h

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).