Introduce the rescan attribute as a device attribute to
synchronize the fsl-mc bus objects and the MC firmware.
To rescan the root dprc only, e.g.
echo 1 > /sys/bus/fsl-mc/devices/dprc.1/rescan
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Adding userspace support for the MC (Management Complex) means exporting
an ioctl capable device file representing the root resource container.
This new functionality in the fsl-mc bus driver intends to provide
userspace applications an interface to interact with the MC firmware.
Commands that are composed in userspace are sent to the MC firmware
through the FSL_MC_SEND_MC_COMMAND ioctl. By default the implicit MC
I/O portal is used for this operation, but if the implicit one is busy,
a dynamic portal is allocated and then freed upon execution.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
We met below build break due to new kernel change:
8842d285ba ("net: Convert skb_frag_t to bio_vec")
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c: In function ‘dpaa_errata_a010022_has_dma_issue’:
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2137:37: error: ‘skb_frag_t’ has no member named ‘page_offset’
if (CROSS_4K_BOUND((uintptr_t)frag->page_offset, frag->bv_len))
^
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2105:5: note: in definition of macro ‘CROSS_4K_BOUND’
(((start) + (size)) > (((start) + 0x1000) & ~0xFFF))
^
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2137:37: error: ‘skb_frag_t’ has no member named ‘page_offset’
if (CROSS_4K_BOUND((uintptr_t)frag->page_offset, frag->bv_len))
^
../drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2105:27: note: in definition of macro ‘CROSS_4K_BOUND’
(((start) + (size)) > (((start) + 0x1000) & ~0xFFF))
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
The ptp_qoriq driver could be used for both sdk version
dpaa driver and upstream version dpaa driver. So added
sdk dpaa dependency for ptp_qoriq driver.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Update for upstream data structure change similar to
commit b8b576a16f
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date: Mon Jul 22 20:08:30 2019 -0700
net: Rename skb_frag_t size to bv_len
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Explicitly mention the root source tree directory when building. This
allows the build process to start from a different location.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Maintain all timestamping fields when copying the skb.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Align to the following upstream patches:
8cb0817 netlink: make validation more configurable for future strictness
ae0be8d netlink: make nla_nest_start() add NLA_F_NESTED flag
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
The comparison for QMAN_REV31 was incorrect as it
would always fail due to the wrong mask.
This fixes the following error in newer GCC versions:
"error: bitwise comparison always evaluates to false
[-Werror=tautological-compare]"
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
As of Linux 5.0 variable length arrays on the stack are no
longer allowed. Change to a dynamic array and create a common
exit point in the function for cleanup.
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Apply fixes corresponding to the following upstream patches:
3c1bcc8 net: ethernet: Convert phydev advertize and supported from u32 to link mode
1e562c8 ptp_qoriq: make structure/function names more consistent
70814e8 net: ethernet: Add helper for set_pauseparam for Asym Pause
22b7d29 net: ethernet: Add helper to determine if pause configuration is supported
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Only a limited number of FQs can be in the cache, setting the
QM_FQCTRL_PREFERINCACHE flag for all FQs is not useful.
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Scatter/Gather frames are not support on LS1043A beacuse they trigger
the A010022 errata.
Even though we do not advertise S/G support to the stack, we need to
make sure that if S/G frames do reach the driver somehow, they trigger
the errata workaround.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Fix the platform device creation in QMan portals such that
dma mappings are done properly.
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Perform a verification of external buffer pools used which can cause array
overflow error in port init function SetExtBufferPools() if it was set to
value 1 via fman port API
Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
The wait_for_completion() call in qman_delete_cgr_safe()
was triggering a scheduling while atomic bug, replacing the
kthread with a smp_call_function_single() call to fix it.
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: Zhao Qiang <qiang.zhao@nxp.com>
The hardware timestamp value got didn't need to be multiplied
by nominal frequency since ptp_qoriq driver initialized the
counter to add clock period, not the clock tick.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
DPAA PTP timer was managed by ptp_qoriq driver in drivers/ptp/.
We will no longer manage it in sdk_fman driver and use related
APIs.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
The SCFG_FMCLKDPSLPCR register is present on PPC targets only. This
feature does not apply to ARM SoCs.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Save the current CPU ID on ingress, when FSL_DPAA_DBG_LOOP is set.
Use the skb_set_queue_mapping() call instead of skb_record_rx_queue()
because the stack isn't involved and won't compensate for the additional
offset.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
The driver relies on the no longer valid assumption that dma addresses
(iovas) are identical to physical addressees and uses phys_to_virt() to
make iova -> vaddr conversions. Fix this also for scatter-gather frames
using the iova -> phys conversion function added in the previous patch.
While at it, clean-up a redundant dpaa_bpid2pool() and pass the bp
as parameter.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
The driver relies on the no longer valid assumption that dma addresses
(iovas) are identical to physical addressees and uses phys_to_virt() to
make iova -> vaddr conversions. Fix this by adding a function that does
proper iova -> phys conversions using the iommu api and update the code
to use it.
Also, a dma_unmap_single() call had to be moved further down the code
because iova -> vaddr conversions were required before the unmap.
For now only the contiguous frame case is handled and the SG case is
split in a following patch.
While at it, clean-up a redundant dpaa_bpid2pool() and pass the bp
as parameter.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
The dma transactions initiator is the rx fman port so that's the device
that the dma mappings should be done. Previously the mappings were done
through the MAC device which makes no sense because it's neither dma-able
nor connected in any way to smmu.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
Enabling SMMU altered the order of device probing causing the dpaa1
ethernet driver to get probed before qbman and causing a boot crash.
Add predictability in the probing order by deferring the ethernet
driver probe after qbman and portals by using the recently introduced
qbman APIs.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
Add an API that retrieves the 'struct device' that the specified fman
port probed against. The new API will be used in a subsequent iommu
enablement related patch.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
During probing, FMAN is reset thus losing all its register
settings. Backup port ICID registers before reset and restore
them after, similarly to how it's done on powerpc / PAMU based
platforms.
This also has the side effect of disabling the old code path
(liodn backup/restore handling) that obviously make no sense
in the context of SMMU on ARMs.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
Remove FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE and record the
receive CPU in skb queue mapping to maintain the same CPU
for tx in forwarding scenarios.
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
The stack calls the destroy() callback when a qdisc init() fails.
We stop calling it ourselves and trust the stack do the cleanup.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
The current_kernel_time() call was removed in [1] in order to avoid
overflows in 2038. Use ktime_get_coarse_real_ts64() instead.
[1] 9765164 ("y2038: remove unused time interfaces")
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
The bootmem allocator was removed in [1]. The memblock allocator is
supposed to be used directly instead. We already include it.
[1] afd505b ("mm: remove include/linux/bootmem.h")
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
The congestion thresholds need to be set in such a way that:
a) the threshold is high enough so that frames aren't dropped
unnecessarily
b) the threshold is low enough so that the latency isn't too big
The current thresholds are set too high. In forwarding scenarios, the
latency is too large and frames are dropped on ingress due to a lack of
buffers.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>