$DIR/prom_plugin.so \
$DIR/tlsopenssl_plugin.so \
$DIR/mactime_plugin.so \
+ $DIR/arping_plugin.so \
/usr/lib/$OS_ARCH-linux-gnu/vpp_plugins/
COPY vpp-data/bin/vpp /usr/bin/
plugin ping_plugin.so { enable }
plugin nsim_plugin.so { enable }
plugin mactime_plugin.so { enable }
+ plugin arping_plugin.so { enable }
}
logging {
func init() {
RegisterVethTests(XEchoVclClientUdpTest, XEchoVclClientTcpTest, XEchoVclServerUdpTest,
- XEchoVclServerTcpTest, VclEchoTcpTest, VclEchoUdpTest, VclHttpPostTest)
+ XEchoVclServerTcpTest, VclEchoTcpTest, VclEchoUdpTest, VclHttpPostTest, VclClUdpDscpTest)
RegisterSoloVethTests(VclRetryAttachTest)
}
s.AssertNil(err, o)
s.Log("Done.")
}
+
+func VclClUdpDscpTest(s *VethsSuite) {
+ srvVppCont := s.Containers.ServerVpp
+ srvAppCont := s.Containers.ServerApp
+ srvAppCont.CreateFile("/vcl.conf", getVclConfig(srvVppCont))
+ srvAppCont.AddEnvVar("VCL_CONFIG", "/vcl.conf")
+ serverVethAddress := s.Interfaces.Server.Ip4AddressString()
+
+ // DSCP 40 - Class selector 5 - Signalling
+ vclSrvCmd := fmt.Sprintf("vcl_test_cl_udp -s %s -d 40", serverVethAddress)
+ srvAppCont.ExecServer(true, vclSrvCmd)
+
+ cliVppCont := s.Containers.ClientVpp
+ cliAppCont := s.Containers.ClientApp
+ cliAppCont.CreateFile("/vcl.conf", getVclConfig(cliVppCont))
+ cliAppCont.AddEnvVar("VCL_CONFIG", "/vcl.conf")
+ cliVppCont.VppInstance.Vppctl("arping %s host-%s", serverVethAddress, s.Interfaces.Client.Name())
+
+ cliVppCont.VppInstance.Vppctl("trace add af-packet-input 10")
+ srvVppCont.VppInstance.Vppctl("trace add af-packet-input 10")
+
+ // DSCP 16 - Class selector 2 - Network operations
+ cliSrvCmd := fmt.Sprintf("vcl_test_cl_udp -c %s -d 16", serverVethAddress)
+ o, err := cliAppCont.Exec(true, cliSrvCmd)
+ s.AssertNil(err, o)
+
+ o = srvVppCont.VppInstance.Vppctl("show trace")
+ s.AssertContains(o, "dscp CS2")
+ o = cliVppCont.VppInstance.Vppctl("show trace")
+ s.AssertContains(o, "dscp CS5")
+}
struct sockaddr_storage clnt_addr;
};
uint16_t port;
+ uint8_t dscp;
int num_workers;
pthread_t *worker_threads;
int thread_id_counter;
} vt_clu_main_t;
static vt_clu_main_t vt_clu_main;
+static const uint32_t dscplen = 1;
typedef struct vtclu_worker_args_
{
vt_clu_parse_args (vt_clu_main_t *vclum, int argc, char **argv)
{
int c;
+ int temp;
memset (vclum, 0, sizeof (*vclum));
vclum->port = VCL_TEST_SERVER_PORT;
vclum->num_workers = 1;
+ vclum->dscp = 0;
opterr = 0;
- while ((c = getopt (argc, argv, "s:c:w:")) != -1)
+ while ((c = getopt (argc, argv, "s:c:w:d:")) != -1)
switch (c)
{
case 's':
vclum->num_workers = 1;
}
break;
+ case 'd':
+ temp = atoi (optarg);
+ if (temp <= 0 || temp > 63)
+ {
+ vtwrn ("invalid dscp value %s", optarg);
+ vclum->dscp = 0;
+ }
+ vclum->dscp = temp;
+ break;
}
if (vclum->app_type == VT_CLU_TYPE_NONE)
return NULL;
}
+ if (vclum->dscp)
+ vppcom_session_attr (vcl_sh, VPPCOM_ATTR_SET_DSCP, &vclum->dscp,
+ (uint32_t *) &dscplen);
+
/* Bind to the same endpoint as main thread */
rv = vppcom_session_bind (vcl_sh, &vclum->endpt);
if (rv < 0)
vterr ("vppcom_session_create()", vcl_sh);
return NULL;
}
+ if (vclum->dscp)
+ vppcom_session_attr (vcl_sh, VPPCOM_ATTR_SET_DSCP, &vclum->dscp,
+ (uint32_t *) &dscplen);
char message[buflen];
int msg_len =
mp->port = s->transport.lcl_port;
mp->proto = s->session_type;
mp->vrf = s->vrf;
+ mp->dscp = s->dscp;
if (s->flags & VCL_SESSION_F_CONNECTED)
mp->flags = TRANSPORT_CFG_F_CONNECTED;
if (s->ext_config)
ip46_address_t ip;
u8 flags;
uword ext_config;
+ u8 dscp;
} __clib_packed session_listen_msg_t;
STATIC_ASSERT (sizeof (session_listen_msg_t) <= SESSION_CTRL_MSG_MAX_SIZE,
a->sep.fib_index = mp->vrf;
a->sep.sw_if_index = ENDPOINT_INVALID_INDEX;
a->sep.transport_proto = mp->proto;
+ a->sep.dscp = mp->dscp;
a->app_index = app->app_index;
a->wrk_map_index = mp->wrk_index;
a->sep_ext.transport_flags = mp->flags;
listener->c_proto = TRANSPORT_PROTO_UDP;
listener->c_s_index = session_index;
listener->c_fib_index = lcl->fib_index;
+ listener->c_dscp = lcl->dscp;
listener->mss =
lcl->mss ? lcl->mss : udp_default_mtu (um, listener->c_is_ip4);
listener->flags |= UDP_CONN_F_OWNS_PORT | UDP_CONN_F_LISTEN;