Update RX default queue FQID for shared mac in T4/B4 device trees

 - RX default FQID must match with the queue base in default
distribution in the policy file.
 - RX error queue FQIDs are also updated for shared mac node.

Signed-off-by: Kuldip Giroh <kuldip.giroh@freescale.com>
Change-Id: I85231f2b04203bdf6cdc5b37945db6314077ab68
Reviewed-on: http://git.am.freescale.net:8181/2837
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Garg Vakul-B16394 <vakul@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Update RX default queue FQID for shared mac in T4/B4 device trees

 - RX default FQID must match with the queue base in default
distribution in the policy file.
 - RX error queue FQIDs are also updated for shared mac node.

Signed-off-by: Kuldip Giroh <kuldip.giroh@freescale.com>
Change-Id: If404811a621a97ef113685b608077e9a2c54f160
Reviewed-on: http://git.am.freescale.net:8181/2848
Reviewed-by: Garg Vakul-B16394 <vakul@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpa_offload: Add required interfaces for IPsec offloading USDPAA use-case

The ipsec_offload application needs 2 Mac-less interfaces and 2 physical
Ethernet interfaces in usdpaa.

Signed-off-by: Alexandru Badicioiu <b15898@freescale.com>
Signed-off-by: Marian Chereji <marian.chereji@freescale.com>
Change-Id: I7da4a92f72faa78cd4fb2d2cbaf2ab56b3aaf88c
Reviewed-on: http://git.am.freescale.net:8181/2864
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpaa_eth: Fix Tx/TxConfirm initialization bug

Due to a bad iterator, the Txq initialization logic mangled the Tx
queues settings and their respective Tx Confirmation FQs assignments.

Aside from the obvious structural problem, this created a nasty
imbalance in transmit and confirmation FD processing, resulting in
sustained degradation of termination use-cases.

Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Change-Id: Id28a8499c16405d7d4df5d2e66f1ece241409144
Reviewed-on: http://git.am.freescale.net:8181/2861
Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
KVM: PPC: use pr_debug not printk for KVM debug prints

the printk always executes whenever a vcpu is moved
to a new physical cpu, which adds unnessary overhead
to context switches...switch to pr_debug which only
executes when enabled at compile time

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Change-Id: I9856ddcdb061ee6818e2b5ec090728ee1841c8f4
Reviewed-on: http://git.am.freescale.net:8181/2872
Reviewed-by: Wood Scott-B07421 <scottwood@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
fmd: B4/T4: Changed allocation of liodnBase to the Host Command

Changed allocation of liodnBase to the Host Command.
For Fmanv3 platforms the first (index 1) Offline Port is not used
therefore the liodnBase should be set starting with index 2 not 1

CR:ENGR00261726

Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com>
powerpc/bsc9132: dts: Add tbi handle to enet1 node

Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
Change-Id: If1dcb88515b720a82d4193cbd11814c296cd1ed9
Reviewed-on: http://git.am.freescale.net:8181/2896
Reviewed-by: Burmi Naveen-B16502 <NaveenBurmi@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
crypto: caam - Implement QI driver context update

On a crypto transform, a setkey() operation can be performed multiple
times e.g. when keys are changed. These requires updation of shared
descriptor in caam_qi driver. The shared descriptor in case of QI driver
is maintained inside driver context and it is prefixed with pre-header.
When shared descriptor is updated by the driver application, it needs to
be copied again into driver context and pre-header should also be
updated. With this patch, the caam_qi driver provides new api
caam_drv_ctx_update(). The caam_qi driver application has been updated
to call this api when setkey() operation changes shared descriptor.

Change-Id: Ice6065ac9461e2d7af2e19a8a8c6d2ad8b5394b8
Signed-off-by: Vakul Garg <vakul@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/2847
Reviewed-by: Varvara Andrei-B21317 <andrei.varvara@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpaa_eth: Fix computation of cache padding

When computing the padding between the beginning of a FD buffer and
the head of the skb associated to it, we wrongly assume that this
padding is always lower than PAGE_SIZE.

In ip forward scenarios with jumbo frames support enabled and Rx
extra headroom not zero, the above assumption is proven incorrect.

Properly compute the padding size in order to avoid skb corruption.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com>
Change-Id: I24f08e3cc782a73cbd12d99445c326c530e3d8f2
Reviewed-on: http://git.am.freescale.net:8181/2898
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Hamciuc Bogdan-BHAMCIU1 <bogdan.hamciuc@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpaa_eth: Set a fixed upper limit for recycleable buffer size

Until now we considered a buffer recycleable if its size didn't
exceed the buffer pool size by more than a certain amount.

Recent changes in the stack however allow the allocation of skb
buffers much larger than the requested size, which impacts our
ability to recycle forwarded frames, especially when jumbo frame
support is enabled.

Make the recycling size upper limit a fixed and sufficiently large
value, regardless of the default size of the buffer pool, in order
to simplify recycling logic and guard against unfavourable cases.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com>
Change-Id: I311903357335492e821f51fac8a448d67fd73433
Reviewed-on: http://git.am.freescale.net:8181/2899
Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Hamciuc Bogdan-BHAMCIU1 <bogdan.hamciuc@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Fix RaidEngine error status 3000000 issue.

When multi flows get into fsl_re_jr_dequeue(...),
there is race condition issue about the hardware register writing.

Move it into the locked area.

Signed-off-by: Xuelin Shi <b29237@freescale.com>
Change-Id: I8eb019b4433eab05cf96261326f7e4c1790ff6c6
Reviewed-on: http://git.am.freescale.net:8181/2901
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Li Yang-R58472 <LeoLi@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpaa_eth: Fix endless loop in case of memory depletion

Check the return value from the buffer-allocating function, in order to
prevent looping forever if memory depletes.

Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Change-Id: Ia321b33ebb38012679248ae4905d4dafaa8efd7d
Reviewed-on: http://git.am.freescale.net:8181/2928
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Radulescu Ruxandra Ioana-B05472 <ruxandra.radulescu@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
fmd,dpaa_eth: Selectively reenable FMan allocation algorithm

On P3/P4/P5 platforms, as well as on P1023, FMan's default resource
allocation values are not enough to enable jumbo frame forwarding in the
absence of SG support. Enable the (previously deselected) FMan dynamic
resource allocation algorithm on those platforms, if the legacy
DPAA-Ethernet driver (missing SG support) is used.

Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Change-Id: I6dfc9e2c624c123febfc4d2cbe8fe1fda660525d
Reviewed-on: http://git.am.freescale.net:8181/2929
Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Lavi Mandy-R52568 <Mandy.Lavi@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpaa_eth: Switch compile-time default optimization

Move back to the "optimize for IPFWD" compile-time choice.
This effectively reverts commit id 692f5140.

Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Change-Id: I9735f489789b7568ae6f6137387d01a92bec9ee2
Reviewed-on: http://git.am.freescale.net:8181/2972
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Schmitt Richard-B43082 <B43082@freescale.com>
Tested-by: Schmitt Richard-B43082 <B43082@freescale.com>
Revert "fmd: Conditionally set default MAX_FRAME_SIZE"

The initial patch was meant to allow the user to set any MTU she desires
without rebooting the system and changing the kernel bootargs.
This however led to problems when the user would manually choose
FSL_DPAA_ETH_OPTIMIZE_FOR_IPFWD, because the default MAX_FRAME_SIZE=9600
would remain selected and this wasn't all that obvious.

Reverting to the previous config selection is the best choice now.

This reverts commit 68dbabbdb1e28169a372530ca3712c3b63296322.

Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Change-Id: I71499e9b86f8909d049ff4347c4fe035e67d704a
Reviewed-on: http://git.am.freescale.net:8181/2971
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Schmitt Richard-B43082 <B43082@freescale.com>
Tested-by: Schmitt Richard-B43082 <B43082@freescale.com>
powerpc/hibernate: PPC64 fix user threads access to kernel space

If PID is used in the TLB, after hibernation resume, the user
threads will access to kernel space.

We must restore PID register, because TLB will use PID. The
hibernation suspend flow is trapped from user space to kernel
space, the PID register is user thread pid.

The hibernation resume is begin in kernel start flow, the PID
alway 0. After the kernel thread back to user thread, there is
not have context switch and the pid can not update, because the
kernel thread is trapped form user space. So if we did't restore
PID the user space of thread will be addressing in the kernel
space.

There are two ways to restore PID:
1/ In swsusp_arch_suspend/swsusp_arch_resume, save/resotre PID register.
2/ Form restore_processor_state to restore. this function will
   do context switch.
   switch_mmu_context(current->active_mm, current->active_mm)

PPC32 Using the second method. For consistency reason, PPC64 using
the same way.

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Change-Id: I0563be5cc5da67877e0083256c7425096cbc95e6
Reviewed-on: http://git.am.freescale.net:8181/2908
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Li Yang-R58472 <LeoLi@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpa_offload: Fix l2_hdr_size correct usage

Function build_extended_encap_shared_descriptor had the fourth
parameter as an uint8_t, but it must be uint32_t in order to
store the l2_hdr_size.

Signed-off-by: Anca Jeanina FLOAREA <anca.floarea@freescale.com>
Change-Id: Iabcdc3f80aa372a695385d3d39f1759647651792
Reviewed-on: http://git.am.freescale.net:8181/2969
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Varvara Andrei-B21317 <andrei.varvara@freescale.com>
Reviewed-by: Chereji Marian-Cornel-R27762 <marian.chereji@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpa_offload: Add support for udev in DPA IPsec Wrapper

the device file for ipsec character device is now
created by udev deamon.

Change-Id: I3ec41cbe2347c6f2b1d5e9e30c45d77e76dc9a38
Signed-off-by: Andrei Varvara <andrei.varvara@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/3016
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpa_offload: Add udev support for dpa_classifier

Added udev support so that the device file /dev/dpa_classifier
gets created automatically at boot up instead of the user
needing to create it manually using mknod commands.

Change-Id: Icb2212a3232fe7eddba750617059f8d8b0ba87b5
Signed-off-by: Marian Chereji <marian.chereji@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/3009
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Varvara Andrei-B21317 <andrei.varvara@freescale.com>
Reviewed-by: Zanoschi Aurelian-B43522 <Aurelian.Zanoschi@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
dpa_offload: Improved error messages with runtime information in DPA Stats

Updated all error messages from dpa_stats component by using the new
macro's (log_err and log_warn) defined in dpa_offload. Added additional
runtime information related to the counters that reported the error like
counter id or member index for class counters

Change-Id: Ib13652905bbbcb1da37385aa750d361452d7c09d
Signed-off-by: Aurelian Zanoschi <Aurelian.Zanoschi@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/2875
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Chereji Marian-Cornel-R27762 <marian.chereji@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>