Commit graph

563969 commits

Author SHA1 Message Date
Harout Hedeshian
8fcebfae02 net: rmnet_data: Optimize UL aggregation accumulation logic
Accumulation logic now respects max packet count as well as buffer size.
Additionally, packets will get shipped if they have been sitting around
for more than 1ms. This parameter is tunable from the module parameters
location.

CRs-Fixed: 772705
Change-Id: I1b5cb597ef6adfe19df590582f9a6cae091c5977
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:25 -07:00
Sivan Reinstein
af786e544f net: rmnet_data: add support to UL checksum offload for IPv6 over UDP
Set rmnet_data virtual network devices with NETIF_F_IPV6_UDP_CSUM
to support uplink checksum offloading to HW for IPv6 over UDP
packets.

CRs-fixed: 731693
Change-Id: I6c06fb4d137d4e96a813894802e3096c26e88da4
Signed-off-by: Sivan Reinstein <sivanr@codeaurora.org>
2016-03-22 11:05:24 -07:00
Sivan Reinstein
84914d32cb net: rmnet_data: add support for UL MAP based checksum offload
Add UL checksum offload routines for MAPv3. Can bypass checksum software
for IPv4/IPv6 TCP/UDP protocols.
Set rmnet_data VNDs hw_flags to NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM to
define the checksum offload abilities.
Add UL checksum meta-info header for IPv4/IPv6 TCP/UDP packets for which
UL checksum is being offloaded.

CRs-fixed: 731693
Change-Id: Ief139d357b528aead66acfe39a5227328b8fbf93
Signed-off-by: Sivan Reinstein <sivanr@codeaurora.org>
2016-03-22 11:05:23 -07:00
Harout Hedeshian
104da2c257 net: rmnet_data: Checksum offload handle IPv4 UDP frames with 0 checksum
Checksum offload routine should skip checksum fixup computation on
IPv4 UDP packets which have the checksum field set to 0 by the sender.
This is allowed by RFC768. Packets are marked as checksum unnecessary
and shipped up the stack as-is.

CRs-Fixed: 755544
Change-Id: I0432c3e1b25196134ecc8bbbe23c9cab46666d5c
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:22 -07:00
Harout Hedeshian
de93ca2180 net: rmnet_data: Add counters for downlink checksum offload return codes
Added counter array to /sys/module/rmnet_data/parameters/checksum_dl_stats
for non-realtime analysis of checksum offload.

Change-Id: I749c09147325fd0f871c34ff17e2546b68898faa
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:21 -07:00
Harout Hedeshian
c0e8ab74fe net: rmnet_data: Add documentation for configuration structures
Better document the configuration structures and the element usage.
Anticipating more elements being added in the near term.

Change-Id: I5ca90b7a776072d6b1ac4838782cada38f4fea3b
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:20 -07:00
Harout Hedeshian
fd9a8748f1 net: rmnet_data: Increase max mux IDs to 256
Support the full range of mux IDs for special channels which have large
ID numbers. Expected runtime memory impact is an increase of ~1.5KB per
attached physical network device.

Change-Id: Ic9db497708064c31fe7ed588a855311b50d55e19
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:19 -07:00
Sivan Reinstein
a7dc83bca9 net: rmnet_data: add support for DL MAP based checksum offload
Add DL checksum offload routines for MAPv3. Can bypass checksum software
for IPv4/IPv6 TCP/UDP protocols.

CRs-fixed: 692334
Change-Id: Ic13a5d9a1ebfdc57b6eb53ee93da92c3aee547b1
Signed-off-by: Sivan Reinstein <sivanr@codeaurora.org>
2016-03-22 11:05:18 -07:00
Subash Abhinov Kasiviswanathan
5b7b2ca176 net: rmnet_data: Fix potential memory corruption
Fix an out of bounds array access during virtual
net device creation

CRs-fixed: 695032
Change-Id: Ie8ae1f25122f685c22d139d1abf06acf55d46782
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:18 -07:00
Harout Hedeshian
4d6ec5cecc net: rmnet_data: Move MAP header definition to UAPI
Expose the MAP header to the rest of the kernel and user space. Useful for
making various parts of the kernel MAP aware. Keeping consistency with
other networking procols by exposing protocol headers to user space with
a header file in UAPI.

CRs-Fixed: 681280
Change-Id: Ic7f414f926f68531418725f971ab2b44459f5ea1
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:17 -07:00
Subash Abhinov Kasiviswanathan
95106c070a net: rmnet_data: modify the packet logging
skb->tail and skb->end are defined as character pointers in 32 bit
environments and as integers in other environments. Fix compilation
issues seen in the packet logging functions as a result of the data
type mismtach in 64 bit environments.

CRs-fixed: 665364
Change-Id: Ie70e01ce0678947d9c8cd924fe99b89ce319d4e5
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:16 -07:00
Harout Hedeshian
7bca9efc31 net: rmnet_data: Catch empty MAP frames during de-aggregation
RmNet Data does not explicitly catch 0-length MAP frames when
de-aggregating frames. This causes the empty MAP frames to get dropped
at a later point in MAP processing, causing the drop counters to get
skewed with benign drops. This patch explicitly handles 0-length
MAP frames and adds a dedicated drop counter. This change is required
on hardware which generates 0-length MAP frames.

CRs-Fixed: 673296
Change-Id: I8e7210403d35018bffa8f45ea1b4b5752f3e30be
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:15 -07:00
Harout Hedeshian
e9f3f57cb4 net: rmnet_data: adding new trace points
Added new trace points for flow control events and
aggregation/deaggregation.

CRs-Fixed: 661459
Change-Id: I22e5b441f5bb8ff055b0577954cc9f6285b68a74
Acked-by: Sivan Reinstein <sivanr@qti.qualcomm.com>
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:14 -07:00
Subash Abhinov Kasiviswanathan
c183cadfd9 net: rmnet_data: add cleanup in rmnet_config_exit
Add a call to unregister_netdevice_notifier in rmnet_config_exit,
and fix some compilation warnings.

CRs-Fixed: 633585
Change-Id: I0e61c5460b927c3348f4e9815bbd9f842488f14d
Acked-by: Sivan Reinstein <sivanr@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:13 -07:00
Harout Hedeshian
6ab6a82ad7 net: rmnet_data: Support for NETLINK getters
Added support for RMNET_NETLINK_GET_LOGICAL_EP_CONFIG
and RMNET_NETLINK_GET_NETWORK_DEVICE_ASSOCIATED in the
rmnet_data configuration module.

CRs-fixed: 599231
Change-Id: Ib5eeb4a37f80a4df19cb3c1ef02ec477f5445740
Acked-by: David Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:12 -07:00
Harout Hedeshian
bfbf6cb3ad net: rmnet_data: Clear VNDs upon physical device unregistration
Clear out VNDs which have their egress device pointing to an interface
which is trying to unregister from the network stack. Required to prevent
systems hangs on unexpected shutdown/reboot of the device.

CRs-Fixed: 638324
Change-Id: I406270fee9feb1f9673b3391ce51c11e8e6c9d81
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:12 -07:00
Subash Abhinov Kasiviswanathan
2d06acfdbd net: rmnet_data: remove NOARP flags for the virtual net device
When IFF_NOARP flag is set for a device, the kernel automatically
sets the accept_dad flag to -1 even though autoconf is enabled.
As a result, nodes on that link were not receiving neighbour
solicitations. Removed the setting of IFF_NOARP during net device
setup.

CRs-Fixed: 629099
Change-Id: Ia8b5d1163196cc0518a20beba643930b4f439771
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:11 -07:00
Subash Abhinov Kasiviswanathan
b410fce77c net: rmnet_data: modify 8-byte QoS Header
Clients consuming the 8-byte QoS header expect the flowID
in a different position in the header thus causing random address
dereference and a potential crash. Update the 8-byte QoS header
format structure as specified in the mandated QOS specification

CRs-Fixed: 625709
Change-Id: I58c662ff2f3adfe9584d19891339ea31ce0c8bd3
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:10 -07:00
Harout Hedeshian
ce9d8001da net: rmnet_data: Add support for ftrace events
Adding initial support for ftrace events in order to help with
profiling and debugging. This initial set of events covers the
ingress and egress handlers.

Change-Id: I296d6fb9d009d8fdc2061e17d25e1275ee0a8a12
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:09 -07:00
Harout Hedeshian
3988539fdd net: rmnet_data: new structure for rmnet ioctls
This patch modifies the rmnet ioctls RMNET_IOCTL_GET_LLP,
RMNET_IOCTL_GET_QOS, RMNET_IOCTL_GET_OPMODE, RMNET_IOCTL_FLOW_ENABLE
and RMNET_IOCTL_FLOW_DISABLE to avoid putting integral data in pointers
and avoid casting between 32 and 64 bits types.

CRs-Fixed: 601207
Change-Id: I66edb785f6204f38b6f0ecccb2ceab36d5e38188
Acked-by: Sivan Reinstein <sivanr@qti.qualcomm.com>
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: remove driver specific changes]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:08 -07:00
Subash Abhinov Kasiviswanathan
a207285d7f net: rmnet_data: Add default value for tx_queue_len
The default value of tx_queue_len was 0 which was causing packet
drops because of queueing in tc.
This patch sets a fixed value for the tx_queue_len

CRs-Fixed: 609873
Change-Id: I51739e63223b563f7cf8838d88908db7dcc9bf3e
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:05:07 -07:00
Harout Hedeshian
46fa5323ca net: rmnet_data: Add newline character debug packet dump
The lack of newline characters causes messy printouts over serial.
This patch corrects the problem for easier readability.

Change-Id: I38df34eb4a705d8c0fcd3243b7e756967bc7d5a9
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:06 -07:00
Harout Hedeshian
330c4cad0c net: rmnet_data: Enhanced counters
Added performance counters to various key places in RmNet Data
data path.

CRs-Fixed: 600629
Change-Id: Iba50c86665e181e09525e9538a540e09e526e16f
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:05 -07:00
Harout Hedeshian
8ae46d6442 net: rmnet_data: Enhance logging macros to remove duplicated code
Logging macros now enforce that function names are printed, and
newlines are inserted at the end. The start of log messages are
now standardize.

CRs-Fixed: 600629
Change-Id: I91dae00c331af80954b93eba1f7be2889c569276
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:04 -07:00
Harout Hedeshian
7ce58413a8 net: rmnet_data: Add support for guaranteed padding
Added new parameter tail_spacing to
RMNET_NETLINK_SET_LINK_INGRESS_DATA_FORMAT in order to support
an additional fixed padding on packets. Required to support RNDIS
tethering.

CRs-Fixed: 579184
Change-Id: I58bbbfbaa68a28b25a96f52b04165285de9c24ef
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:03 -07:00
Harout Hedeshian
ea8b2b766f net: rmnet_data: Modifying the ingress handler to support MAP bridging
This patch modified the main ingress handler to not drop MAP packets
when in bridge mode. This is required to support bridging of MAP
packets between two endpoints.

CRs-Fixed: 590888
Change-Id: If0b6f6434ec95c36e0f46bbe70ea65fa50b03b15
Acked-by: David Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: Harout Hadeshian <harouth@codeaurora.org>
2016-03-22 11:05:03 -07:00
Harout Hedeshian
693208f66d net: rmnet_data: Handle device unregister notifications
Gracefully handle device unregister notifications. Cleans
up any logical endpoints configured on a physical devices
and then unassociates it. Required to prevent crash if
references are held too long.

CRs-Fixed: 596227
Change-Id: I02d08e07e74510b7a8dffbefa99e651e0100db23
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:02 -07:00
Harout Hedeshian
20bcb202e3 net: rmnet_data: Enhancements to support SSR
Cleaned up refcount on get_dev_by_name.
Added new APIs to support cleanup of configuration and virtual devices.
Added explicit reference managment in association/un-association
and when setting/unsetting logical EP.

CRs-Fixed: 596227
Change-Id: Ic67bb649b0f0420d9a1e4bf5664ed63c0ff7d8bf
Signed-off-by: Harout Hadeshian <harouth@codeaurora.org>
2016-03-22 11:05:01 -07:00
Harout Hedeshian
e618b5e2a8 net: rmnet_data: 8-byte QoS Header Support
Implement 8-byte QoS header support in order to fix alignment
issues on HSIC transport and increase throughput

CRs-Fixed: 579132
Change-Id: I3e53571d36bd71705abcb1473290929f8227e6f3
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:05:00 -07:00
Harout Hedeshian
35a95f1d3f net: msm_rmnet.h: Fix IOCTL numbering for newly introduced IOCTLs
Fix IOCTLs with invalid numbers. Addresses limitation in network
IOCTL code which prevents more than 16 user defined IOCTLs. All new
IOCTLs have been multiplexed into a single user defined ioctl. Required
to support RmNet Data features.

CRs-Fixed: 554883
Change-Id: Ic33bdf068f7e4014272d3b47ed7b07f5d4a6be2c
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:04:59 -07:00
Harout Hedeshian
3a9fa2aa80 net: rmnet_data: In-band flow control
Implement MAP based in-band flow control. Added 2 new configuration
messages to allow adding and deleting flow handles. Added handlers
in VND for flow control events. Added flow control command handler
in rmnet_map_commands.

CRs-fixed: 568534
Change-Id: Ica52e4ad89430c9fa5e2b38e389ee6bc91de2e9b
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:04:58 -07:00
Harout Hedeshian
162318ea3e net: rmnet_data: Set SKB protocol for outbound MAP packets
Set the skb->protocol field to ETH_P_MAP for egress packets which
have MAP enabled. Required for lower level drivers to ensure that
only MAP packets are being transmitted.

CRs-Fixed: 554883
Change-Id: I6fa852344ef36e079cc610cbed152555aae9d6f2
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:04:57 -07:00
Harout Hedeshian
c514dd5ef4 net: rmnet_data: Change aggregation copy mode for compat
Change SKB copy and delivery mode to fix certain error
modes when running ingress deaggregation

CRs-Fixed: 565123
Change-Id: If23cee6a0de6b189b2c528423df52555e1879bc3
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:04:56 -07:00
Harout Hedeshian
0f789efb3a net: rmnet_data: Add support for user defined device name prefix
Run-time user space components can now specify virtual network device
name prefix at device creation. This will be used to support legacy
data services.

CRs-Fixed: 555507
Change-Id: Id34c2761f2060e66b05c521304d5151620ba5665
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:04:56 -07:00
Harout Hedeshian
5b65821191 net: rmnet_data: Fix compiler macro comments
Removed incorrect compiler macro comments in MAP header file.
Comments are now up fixed up to standards.

CRs-Fixed: 553399
Change-Id: I6373753e644f3801b7a25184e4cff5772f365a02
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
2016-03-22 11:04:55 -07:00
Harout Hedeshian
658fd52bad RmNet Data: Initial release
RmNet Data driver provides a transport agnostic MAP (multiplexing and
aggregation protocol) support in embedded and bridge modes. Module
provides virtual network devices which can be attached to any IP-mode
physical device. This will be used to provide all MAP functionality
on future hardware in a single consistent location.

CRs-Fixed: 525675
Change-Id: I739947c9c3de008974dd485a74e9953ba2cbb75e
Signed-off-by: Harout Hedeshian <harouth@codeaurora.org>
[subashab@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-03-22 11:04:54 -07:00
Rohit Vaswani
50de92cd6d ARM64: Enable APPENDED_DTB in Makefile and defconfig
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2016-03-22 11:04:53 -07:00
Laura Abbott
c75946685b ion: Export ion headers to userspace
Ion headers need to go to userspace. Export them via the staging tree

Change-Id: I9b622efaae3d0ed764ce064da228112c363c066d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2016-03-22 11:04:52 -07:00
Jeremy Gebben
93bfd6dbac uapi: export android staging headers
There are several uapi headers required for android that are
in drivers/staging/android/uapi. Create symlinks for these files
in include/uapi/linux so that we can export them without messing
up Kbuild.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2016-03-22 11:04:51 -07:00
Neeti Desai
a20c28af03 msm: Add secure vmid for msa
For sharing the memory between hlos and modem,
a new secure vmid is needed to be used in the
assign api. Define that.

Change-Id: Ibcddbafeb1fc430aae3fcda7c609bca4d81e57a9
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
2016-03-22 11:04:50 -07:00
Mitchel Humpherys
51adc0956b msm: secure_buffer: Ensure shared buffers are cache-aligned
Buffers shared with hypervisor might undergo some cache maintenance on
the hypervisor side.  Currently, we're passing a buffer that might not
be cache-aligned (source_vm_list), so when the hypervisor does some
cache maintenance on it they might be corrupting data.  Fix this by
ensuring that all buffers being shared with the hypervisor are
cache-aligned by kmalloc'ing and memcpy'ing the source_vm_list before
sending it across.

Change-Id: I661f8ca852ade159e3432904086b060be8bfb806
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-03-22 11:04:50 -07:00
Mitchel Humpherys
8a9d07bc98 msm: secure_buffer: Add helper function to convert VMIDs into strings
It can be useful to convert secure VMID values into strings.  Provide a
helper function to do so.

Change-Id: If907a0bac92c5d164154c0e5dfe67933115163c8
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-03-22 11:04:49 -07:00
Neeti Desai
a04defd9b7 msm: secure_buffer: Update the hyp_assign_phys() api
The hyp_assign_phys() api can be called by different
usecases where it is not guaranteed that the source vm is
always VMID_HLOS.

Pass the responsibility of setting the source_vm to
caller of the function.

Change-Id: I3851a6681f49d4bb6fa5b7a889a16a158497e9e6
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
2016-03-22 11:04:48 -07:00
Rohit Vaswani
a3f96ffb79 defconfig: msm_defconfig: Enable ION and IOMMU defconfigs. Also cleanup the defconfigs
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2016-03-22 11:04:47 -07:00
Laura Abbott
65899d855f mm: highmem: Add definitions for kmap_atomic_flush_unused
kmap_flush_unused does not flush kmap_atomic mappings which
are handled separately. Architectures may have use cases to require
these to be flushed. Add an option to let architectures define
kmap_atomic flushing to get rid of extra mappings.

Change-Id: I5a338ed9e215f0f0ad3ab58a3066d2f4c8ce3ba7
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2016-03-22 11:04:46 -07:00
Shrenuj Bansal
40eb383998 msm: kgsl: Add EXEC permission to the unassign call
When calling hyp_assign to free a secure buffer we need to pass
in RWX permissions so that when the Hypervisor unmaps the buffer
and maps it back to HLOS, the HLOS is able to use the same
memory for data and instructions.

Change-Id: I71e06a81df85891fecb11c5f197acd54979d2887
Signed-off-by: Shrenuj Bansal <shrenujb@codeaurora.org>
2016-03-22 11:04:45 -07:00
Shiraz Hashim
1b043ecc99 ion: unmap ion buffer before free
Buffers must be unmapped first and then freed. Without
this sequence, specifically for secure buffers, TZ throws
error on free if it finds persisting mapping. Fix this.

Change-Id: Iba09cb998b4f87da3e9eb1c2bc186453be02a278
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
2016-03-22 11:04:44 -07:00
Shiraz Hashim
7d769009f7 msm: ion: fix ion cache maintenance issue with highmem
ion cache maintenance code while doing cache maintenance
on each sg is only considering page length which may not
always be correct. An sg node can have more than page
length contiguous pages.

Update the code to properly take care of any length sg.

Change-Id: Ifdf8a8fa26abfa5bd47185a1039880306246d587
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
2016-03-22 11:04:44 -07:00
Vinayak Menon
275f276110 ion: fix compile time error with !CONFIG_CMA
Let ION compile when CONFIG_CMA is not defined.

Change-Id: I6f3cf19a94e3f966c0973c9f8d765ecb752b7a48
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2016-03-22 11:04:43 -07:00
Neeti Desai
63be0380dc msm: ion: Fix NULL pointer dereference in error path
If the hypervisor fails to assign the correct vmids to the
memory allocated, we should free the allocated memory. However
the free path depends on certain parameters of the ion_buffer
structure which have not yet been populated.

Update the function definition to accept the scatter gather list
instead of the ion buffer, since we are zero'ing the list
and not the buffer.

Change-Id: I68bef3af6c1b7e8092fbc0e878d3c825580f438e
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
2016-03-22 11:04:42 -07:00