Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12f7ac3e authored by Chaitanya Pratapa's avatar Chaitanya Pratapa Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: L2TP fixes



1) Make changes to get mtu of l2tp interface along with
other configuration parameters to install the MTU rule configured
by user.

2) In case of L2TP over UDP, there can be packets with frag extension
header which do not have offset or MF bit set. These packets will not
match with IS_FRAG equation which relies on frag offset and MF bit set.
Make changes to give provision to install next header matching the
protocol byte offset in IPv6 header.

Change-Id: I6ae99edecd0f2cdc692fdf1de7b57d346679d2f1
Signed-off-by: default avatarChaitanya Pratapa <cpratapa@codeaurora.org>
parent 6da2b3fa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -529,6 +529,9 @@ static int ipa3_attrib_dump(struct ipa_rule_attrib *attrib,
	if (attrib->attrib_mask & IPA_FLT_NEXT_HDR)
		pr_err("next_hdr:%d ", attrib->u.v6.next_hdr);

	if (attrib->ext_attrib_mask & IPA_FLT_EXT_NEXT_HDR)
		pr_err("next_hdr:%d ", attrib->u.v6.next_hdr);

	if (attrib->attrib_mask & IPA_FLT_META_DATA) {
		pr_err(
				   "metadata:%x metadata_mask:%x ",
+11 −0
Original line number Diff line number Diff line
@@ -1398,6 +1398,17 @@ static int ipa_fltrt_generate_hw_rule_bdy_ip6(u16 *en_rule,
		extra = ipa_write_8(attrib->u.v6.next_hdr, extra);
	}

	if (attrib->ext_attrib_mask & IPA_FLT_EXT_NEXT_HDR) {
		*en_rule |= IPA_GET_RULE_EQ_BIT_PTRN(
			ipa3_0_ihl_ofst_meq32[ihl_ofst_meq32]);
		/* 134  => offset of Next header after v6 header. */
		extra = ipa_write_8(134, extra);
		rest = ipa_write_32(0xFF000000, rest);
		rest = ipa_write_32(attrib->u.v6.next_hdr << 24, rest);
		extra = ipa_write_8(attrib->u.v6.next_hdr, extra);
		ihl_ofst_meq32++;
	}

	if (attrib->attrib_mask & IPA_FLT_TC) {
		*en_rule |= IPA_GET_RULE_EQ_BIT_PTRN(IPA_TC_EQ);
		extra = ipa_write_8(attrib->u.v6.tc, extra);
+3 −0
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@
#define IPA_FLT_EXT_L2TP_UDP_INNER_ETHER_TYPE       (1ul << 1)
#define IPA_FLT_EXT_MTU     (1ul << 2)
#define IPA_FLT_EXT_L2TP_UDP_INNER_NEXT_HDR		(1ul << 3)
#define IPA_FLT_EXT_NEXT_HDR				(1ul << 4)

/**
 * maximal number of NAT PDNs in the PDN config table
@@ -2286,6 +2287,7 @@ enum ipa_l2tp_tunnel_type {
 * @tunnel_type: l2tp tunnel type
 * @src_port: UDP source port
 * @dst_port: UDP destination port
 * @mtu: MTU of the L2TP interface
 */
struct ipa_ioc_l2tp_vlan_mapping_info {
	enum ipa_ip_type iptype;
@@ -2295,6 +2297,7 @@ struct ipa_ioc_l2tp_vlan_mapping_info {
	enum ipa_l2tp_tunnel_type tunnel_type;
	uint16_t src_port;
	uint16_t dst_port;
	uint16_t mtu;
};

/**