summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2021-11-15 10:26:56 +0000
committerFlorin Coras <florin.coras@gmail.com>2021-11-15 17:42:30 +0000
commit2f09bfc8bedd7f5af3b336af43a2d515b61e6dae (patch)
tree3822d39b45579a1a57714fc5bfe9304d92e22885 /src/vcl
parent31f192434660a6fe71663fd62172cb82fc79ede1 (diff)
vcl: add DSCP support in VCL
Type: feature Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I835675267c997b5dc92a0aaccdb58648bc786bb9
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vcl_private.h1
-rw-r--r--src/vcl/vppcom.c13
-rw-r--r--src/vcl/vppcom.h1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 285985e6529..66d418084ee 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -168,6 +168,7 @@ typedef struct vcl_session_
u32 rcvbuf_size; // VPP-TBD: Hack until support setsockopt(SO_RCVBUF)
transport_endpt_ext_cfg_t *ext_config;
+ u8 dscp;
#if VCL_ELOG
elog_track_t elog_track;
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 207e208979c..107b109dc75 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -219,6 +219,7 @@ vcl_send_session_connect (vcl_worker_t * wrk, vcl_session_t * s)
memset (mp, 0, sizeof (*mp));
mp->client_index = wrk->api_client_handle;
mp->context = s->session_index;
+ mp->dscp = s->dscp;
mp->wrk_index = wrk->vpp_wrk_index;
mp->is_ip4 = s->transport.is_ip4;
mp->parent_handle = s->parent_handle;
@@ -3608,6 +3609,18 @@ vppcom_session_attr (uint32_t session_handle, uint32_t op,
rv = VPPCOM_EINVAL;
break;
+ case VPPCOM_ATTR_SET_DSCP:
+ if (buffer && buflen && (*buflen >= sizeof (u8)))
+ {
+ session->dscp = *(u8 *) buffer;
+
+ VDBG (2, "VPPCOM_ATTR_SET_DSCP: %u (0x%x), buflen %d,",
+ *(u8 *) buffer, *(u8 *) buffer, *buflen);
+ }
+ else
+ rv = VPPCOM_EINVAL;
+ break;
+
case VPPCOM_ATTR_SET_TX_FIFO_LEN:
if (buffer && buflen && (*buflen == sizeof (u32)))
{
diff --git a/src/vcl/vppcom.h b/src/vcl/vppcom.h
index 19a01c798b5..46517ad8c8c 100644
--- a/src/vcl/vppcom.h
+++ b/src/vcl/vppcom.h
@@ -145,6 +145,7 @@ typedef enum
VPPCOM_ATTR_GET_VRF,
VPPCOM_ATTR_GET_DOMAIN,
VPPCOM_ATTR_SET_ENDPT_EXT_CFG,
+ VPPCOM_ATTR_SET_DSCP,
} vppcom_attr_op_t;
typedef struct _vcl_poll