Skip to content

Commit dc0e90d

Browse files
authored
Merge pull request systemd#16929 from ssahani/network-bare-udp
network: introduce Bare UDP Tunnelling
2 parents dd3b0e2 + 1306047 commit dc0e90d

28 files changed

+730
-55
lines changed

man/systemd.netdev.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@
183183
<row><entry><varname>ifb</varname></entry>
184184
<entry> The Intermediate Functional Block (ifb) pseudo network interface acts as a QoS concentrator for multiple different sources of traffic.</entry></row>
185185

186+
<row><entry><varname>bareudp</varname></entry>
187+
<entry> Bare UDP tunnels provide a generic L3 encapsulation support for tunnelling different L3 protocols like MPLS, IP etc. inside of an UDP tunnel.</entry></row>
186188
</tbody>
187189
</tgroup>
188190
</table>
@@ -829,6 +831,31 @@
829831
</variablelist>
830832
</refsect1>
831833

834+
<refsect1>
835+
<title>[BareUDP] Section Options</title>
836+
837+
<para>The [BareUDP] section only applies for
838+
netdevs of kind <literal>bareudp</literal>, and accepts the
839+
following keys:</para>
840+
841+
<variablelist class='network-directives'>
842+
<varlistentry>
843+
<term><varname>DestinationPort=</varname></term>
844+
<listitem>
845+
<para>Specifies the destination UDP port (in range 1…65535). This is mandatory.</para>
846+
</listitem>
847+
</varlistentry>
848+
849+
<varlistentry>
850+
<term><varname>EtherType=</varname></term>
851+
<listitem>
852+
<para>Specifies the L3 protocol. Takes one of <literal>ipv4</literal>, <literal>ipv6</literal>, <literal>mpls-uc</literal>
853+
or <literal>mpls-mc</literal>. This is mandatory.</para>
854+
</listitem>
855+
</varlistentry>
856+
</variablelist>
857+
</refsect1>
858+
832859
<refsect1>
833860
<title>[L2TP] Section Options</title>
834861

src/basic/linux/btrfs.h

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,22 @@ struct btrfs_ioctl_vol_args {
3636
#define BTRFS_DEVICE_PATH_NAME_MAX 1024
3737
#define BTRFS_SUBVOL_NAME_MAX 4039
3838

39-
#define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
39+
#ifndef __KERNEL__
40+
/* Deprecated since 5.7 */
41+
# define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
42+
#endif
4043
#define BTRFS_SUBVOL_RDONLY (1ULL << 1)
4144
#define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
4245

4346
#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
4447

48+
#define BTRFS_SUBVOL_SPEC_BY_ID (1ULL << 4)
49+
4550
#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
46-
(BTRFS_SUBVOL_CREATE_ASYNC | \
47-
BTRFS_SUBVOL_RDONLY | \
51+
(BTRFS_SUBVOL_RDONLY | \
4852
BTRFS_SUBVOL_QGROUP_INHERIT | \
49-
BTRFS_DEVICE_SPEC_BY_ID)
53+
BTRFS_DEVICE_SPEC_BY_ID | \
54+
BTRFS_SUBVOL_SPEC_BY_ID)
5055

5156
#define BTRFS_FSID_SIZE 16
5257
#define BTRFS_UUID_SIZE 16
@@ -97,16 +102,29 @@ struct btrfs_ioctl_qgroup_limit_args {
97102
};
98103

99104
/*
100-
* flags for subvolumes
105+
* Arguments for specification of subvolumes or devices, supporting by-name or
106+
* by-id and flags
101107
*
102-
* Used by:
103-
* struct btrfs_ioctl_vol_args_v2.flags
108+
* The set of supported flags depends on the ioctl
104109
*
105110
* BTRFS_SUBVOL_RDONLY is also provided/consumed by the following ioctls:
106111
* - BTRFS_IOC_SUBVOL_GETFLAGS
107112
* - BTRFS_IOC_SUBVOL_SETFLAGS
108113
*/
109114

115+
/* Supported flags for BTRFS_IOC_RM_DEV_V2 */
116+
#define BTRFS_DEVICE_REMOVE_ARGS_MASK \
117+
(BTRFS_DEVICE_SPEC_BY_ID)
118+
119+
/* Supported flags for BTRFS_IOC_SNAP_CREATE_V2 and BTRFS_IOC_SUBVOL_CREATE_V2 */
120+
#define BTRFS_SUBVOL_CREATE_ARGS_MASK \
121+
(BTRFS_SUBVOL_RDONLY | \
122+
BTRFS_SUBVOL_QGROUP_INHERIT)
123+
124+
/* Supported flags for BTRFS_IOC_SNAP_DESTROY_V2 */
125+
#define BTRFS_SUBVOL_DELETE_ARGS_MASK \
126+
(BTRFS_SUBVOL_SPEC_BY_ID)
127+
110128
struct btrfs_ioctl_vol_args_v2 {
111129
__s64 fd;
112130
__u64 transid;
@@ -121,6 +139,7 @@ struct btrfs_ioctl_vol_args_v2 {
121139
union {
122140
char name[BTRFS_SUBVOL_NAME_MAX + 1];
123141
__u64 devid;
142+
__u64 subvolid;
124143
};
125144
};
126145

@@ -224,15 +243,32 @@ struct btrfs_ioctl_dev_info_args {
224243
__u8 path[BTRFS_DEVICE_PATH_NAME_MAX]; /* out */
225244
};
226245

246+
/*
247+
* Retrieve information about the filesystem
248+
*/
249+
250+
/* Request information about checksum type and size */
251+
#define BTRFS_FS_INFO_FLAG_CSUM_INFO (1 << 0)
252+
253+
/* Request information about filesystem generation */
254+
#define BTRFS_FS_INFO_FLAG_GENERATION (1 << 1)
255+
/* Request information about filesystem metadata UUID */
256+
#define BTRFS_FS_INFO_FLAG_METADATA_UUID (1 << 2)
257+
227258
struct btrfs_ioctl_fs_info_args {
228259
__u64 max_id; /* out */
229260
__u64 num_devices; /* out */
230261
__u8 fsid[BTRFS_FSID_SIZE]; /* out */
231262
__u32 nodesize; /* out */
232263
__u32 sectorsize; /* out */
233264
__u32 clone_alignment; /* out */
234-
__u32 reserved32;
235-
__u64 reserved[122]; /* pad to 1k */
265+
/* See BTRFS_FS_INFO_FLAG_* */
266+
__u16 csum_type; /* out */
267+
__u16 csum_size; /* out */
268+
__u64 flags; /* in/out */
269+
__u64 generation; /* out */
270+
__u8 metadata_uuid[BTRFS_FSID_SIZE]; /* out */
271+
__u8 reserved[944]; /* pad to 1k */
236272
};
237273

238274
/*
@@ -949,5 +985,7 @@ enum btrfs_err_code {
949985
struct btrfs_ioctl_get_subvol_rootref_args)
950986
#define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 62, \
951987
struct btrfs_ioctl_ino_lookup_user_args)
988+
#define BTRFS_IOC_SNAP_DESTROY_V2 _IOW(BTRFS_IOCTL_MAGIC, 63, \
989+
struct btrfs_ioctl_vol_args_v2)
952990

953991
#endif /* _UAPI_LINUX_BTRFS_H */

src/basic/linux/btrfs_tree.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,6 @@ struct btrfs_extent_inline_ref {
519519
__le64 offset;
520520
} __attribute__ ((__packed__));
521521

522-
/* old style backrefs item */
523-
struct btrfs_extent_ref_v0 {
524-
__le64 root;
525-
__le64 generation;
526-
__le64 objectid;
527-
__le32 count;
528-
} __attribute__ ((__packed__));
529-
530-
531522
/* dev extents record free space on individual devices. The owner
532523
* field points back to the chunk allocation mapping tree that allocated
533524
* the extent. The chunk tree uuid field is a way to double check the owner
@@ -922,9 +913,9 @@ struct btrfs_free_space_info {
922913
#define BTRFS_FREE_SPACE_USING_BITMAPS (1ULL << 0)
923914

924915
#define BTRFS_QGROUP_LEVEL_SHIFT 48
925-
static inline __u64 btrfs_qgroup_level(__u64 qgroupid)
916+
static inline __u16 btrfs_qgroup_level(__u64 qgroupid)
926917
{
927-
return qgroupid >> BTRFS_QGROUP_LEVEL_SHIFT;
918+
return (__u16)(qgroupid >> BTRFS_QGROUP_LEVEL_SHIFT);
928919
}
929920

930921
/*

src/basic/linux/if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ enum {
177177
enum {
178178
IF_LINK_MODE_DEFAULT,
179179
IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
180+
IF_LINK_MODE_TESTING, /* limit upward transition to testing */
180181
};
181182

182183
/*

0 commit comments

Comments
 (0)