@@ -22,7 +22,7 @@ use crate::filters::FilterFactory;
2222
2323use crate :: signal:: ShutdownRx ;
2424
25- pub use crate :: components:: proxy:: Ready ;
25+ pub use crate :: { cli :: service :: XdpOptions , components:: proxy:: Ready } ;
2626
2727define_port ! ( 7777 ) ;
2828
@@ -65,55 +65,6 @@ pub struct Proxy {
6565 pub xdp_opts : XdpOptions ,
6666}
6767
68- /// XDP (eXpress Data Path) options
69- #[ derive( clap:: Args , Clone , Debug ) ]
70- pub struct XdpOptions {
71- /// The name of the network interface to bind the XDP socket(s) to.
72- ///
73- /// If not specified quilkin will attempt to determine the most appropriate
74- /// network interface to use. Quilkin will exit with an error if the network
75- /// interface does not exist, or a suitable default cannot be determined.
76- #[ clap( long = "publish.udp.xdp.network-interface" ) ]
77- pub network_interface : Option < String > ,
78- /// Forces the use of XDP.
79- ///
80- /// If XDP is not available on the chosen NIC, Quilkin exits with an error.
81- /// If false, io-uring will be used as the fallback implementation.
82- #[ clap( long = "publish.udp.xdp" ) ]
83- pub force_xdp : bool ,
84- /// Forces the use of [`XDP_ZEROCOPY`](https://www.kernel.org/doc/html/latest/networking/af_xdp.html#xdp-copy-and-xdp-zerocopy-bind-flags)
85- ///
86- /// If zero copy is not available on the chosen NIC, Quilkin exits with an error
87- #[ clap( long = "publish.udp.xdp.zerocopy" ) ]
88- pub force_zerocopy : bool ,
89- /// Forces the use of [TX checksum offload](https://docs.kernel.org/6.8/networking/xsk-tx-metadata.html)
90- ///
91- /// TX checksum offload is an optional feature allowing the data portion of
92- /// a packet to have its internet checksum calculation offloaded to the NIC,
93- /// as otherwise this is done in software
94- #[ clap( long = "publish.udp.xdp.tco" ) ]
95- pub force_tx_checksum_offload : bool ,
96- /// The maximum amount of memory mapped for packet buffers, in bytes
97- ///
98- /// If not specified, this defaults to 4MiB (2k allocated packets of 2k each at a time)
99- /// per NIC queue, ie 128MiB on a 32 queue NIC
100- #[ clap( long = "publish.udp.xdp.memory-limit" ) ]
101- pub maximum_memory : Option < u64 > ,
102- }
103-
104- #[ allow( clippy:: derivable_impls) ]
105- impl Default for XdpOptions {
106- fn default ( ) -> Self {
107- Self {
108- network_interface : None ,
109- force_xdp : false ,
110- force_zerocopy : false ,
111- force_tx_checksum_offload : false ,
112- maximum_memory : None ,
113- }
114- }
115- }
116-
11768impl Default for Proxy {
11869 fn default ( ) -> Self {
11970 Self {
0 commit comments