msm: ipa: Add DSCP PCP mapping info ioctl

Adding DSCP PCP mapping ioctl support for easymesh R3.

Change-Id: I7a7fcc3fdc22cdf1970638e8163bda7ef74dc7b3
Signed-off-by: Michael Adisumarta <quic_madisuma@quicinc.com>
This commit is contained in:
Michael Adisumarta 2023-01-02 20:12:29 -08:00
parent 750af5fe9e
commit 27aade5827

View File

@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
/*
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef _UAPI_MSM_IPA_H_
@ -145,6 +145,7 @@
#define IPA_IOCTL_DEL_MACSEC_MAPPING 93
#define IPA_IOCTL_QUERY_CACHED_DRIVER_MSG 94
#define IPA_IOCTL_SET_EXT_ROUTER_MODE 95
#define IPA_IOCTL_ADD_DEL_DSCP_PCP_MAPPING 96
/**
* max size of the header to be inserted
*/
@ -210,6 +211,11 @@
#define IPA_MAX_IPPT_NUM_PORT_FLT 5
/**
* Max number of DSCP entries in uc
*/
#define IPA_UC_MAX_DSCP_VAL 64
/**
* New feature flag for CV2X config.
*/
@ -1400,6 +1406,7 @@ enum ipa_hdr_l2_type {
* IPA_HDR_PROC_SET_DSCP:
* IPA_HDR_PROC_EoGRE_HEADER_ADD: Add IPV[46] GRE header
* IPA_HDR_PROC_EoGRE_HEADER_REMOVE: Remove IPV[46] GRE header
* IPA_HDR_PROC_WWAN_TO_ETHII_EX: To update PCP value for E2E traffic.
*/
enum ipa_hdr_proc_type {
IPA_HDR_PROC_NONE,
@ -1415,8 +1422,9 @@ enum ipa_hdr_proc_type {
IPA_HDR_PROC_SET_DSCP,
IPA_HDR_PROC_EoGRE_HEADER_ADD,
IPA_HDR_PROC_EoGRE_HEADER_REMOVE,
IPA_HDR_PROC_WWAN_TO_ETHII_EX,
};
#define IPA_HDR_PROC_MAX (IPA_HDR_PROC_EoGRE_HEADER_REMOVE + 1)
#define IPA_HDR_PROC_MAX (IPA_HDR_PROC_WWAN_TO_ETHII_EX + 1)
/**
* struct ipa_rt_rule - attributes of a routing rule
@ -1655,12 +1663,34 @@ struct ipa_eogre_hdr_proc_ctx_params {
* (in bytes) from the start of the input IP hdr
* @output_ethhdr_negative_offset: Specifies where the ethernet hdr offset is
* (in bytes) from the end of the template hdr
* @output_dscp_pcp_update: Specifies if VLAN PCP needs to be updated based on
* DSCP<->PCP mapping table.
* @reserved: for future use
*/
struct ipa_eth_II_to_eth_II_ex_procparams {
uint32_t input_ethhdr_negative_offset : 8;
uint32_t output_ethhdr_negative_offset : 8;
uint32_t reserved : 16;
uint32_t output_dscp_pcp_update : 1;
uint32_t reserved : 15;
};
/**
* struct ipa_wwan_to_eth_II_ex_procparams -
* @input_ethhdr_negative_offset: Specifies where the ethernet hdr offset is
* (in bytes) from the start of the input IP hdr
* @output_ethhdr_negative_offset: Specifies where the ethernet hdr offset is
* (in bytes) from the end of the template hdr
* @output_dscp_pcp_update: Specifies if VLAN PCP needs to be updated based on
* DSCP<->PCP mapping table.
* @input_ethhdr_valid: Specifies whether input ethernet header is valid or not.
* @reserved: for future use
*/
struct ipa_wwan_to_eth_II_ex_procparams {
uint32_t input_ethhdr_negative_offset : 8;
uint32_t output_ethhdr_negative_offset : 8;
uint32_t output_dscp_pcp_update : 1;
uint32_t input_ethhdr_valid : 1;
uint32_t reserved : 14;
};
#define L2TP_USER_SPACE_SPECIFY_DST_PIPE
@ -1673,6 +1703,7 @@ struct ipa_eth_II_to_eth_II_ex_procparams {
* @l2tp_params: l2tp parameters
* @eogre_params: eogre parameters
* @generic_params: generic proc_ctx params
* @generic_params_v2: generic proc_ctx params for bridging
* @proc_ctx_hdl: out parameter, handle to proc_ctx, valid when status is 0
* @status: out parameter, status of header add operation,
* 0 for success,
@ -1686,6 +1717,7 @@ struct ipa_hdr_proc_ctx_add {
struct ipa_l2tp_hdr_proc_ctx_params l2tp_params;
struct ipa_eogre_hdr_proc_ctx_params eogre_params;
struct ipa_eth_II_to_eth_II_ex_procparams generic_params;
struct ipa_wwan_to_eth_II_ex_procparams generic_params_v2;
};
#define IPA_L2TP_HDR_PROC_SUPPORT
@ -3432,6 +3464,18 @@ struct ipa_ioc_ext_router_info {
uint32_t ipv6_mask[4];
};
/**
* struct ipa_ioc_dscp_pcp_map_info - provide dscp pcp mapping info to add/delete
* @add: Boolean to indicate add or delete the mapping
* @dscp_pcp_map: DSCP <6 bits> and PCP <3 bits>.
* Only 3 bits are valid(0-7) for PCP.
* DSCP is used as index (0-63).
*/
struct ipa_ioc_dscp_pcp_map_info {
uint32_t add;
uint8_t dscp_pcp_map[IPA_UC_MAX_DSCP_VAL];
};
/**
* actual IOCTLs supported by IPA driver
*/
@ -3745,6 +3789,9 @@ struct ipa_ioc_ext_router_info {
IPA_IOCTL_SET_EXT_ROUTER_MODE, \
struct ipa_ioc_ext_router_info)
#define IPA_IOC_ADD_DEL_DSCP_PCP_MAPPING _IOWR(IPA_IOC_MAGIC, \
IPA_IOCTL_ADD_DEL_DSCP_PCP_MAPPING, \
struct ipa_ioc_dscp_pcp_map_info)
/*
* unique magic number of the Tethering bridge ioctls