summaryrefslogtreecommitdiff
path: root/drivers/staging
AgeCommit message (Collapse)Author
2017-12-12staging: fsl_ppfe/eth: Avoid packet drop at TMU queuesKavi Akhila-B46177
Added flow control between TMU queues and PFE Linux driver, based on TMU credits availability. Added tx_qos module parameter to control this behavior. Use queue-0 as default queue to transmit packets. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Akhila Kavi <akhila.kavi@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12staging: fsl_ppfe/eth: add function to update tmu creditsCalvin Johnson
__hif_lib_update_credit function is used to update the tmu credits. If tx_qos is set, tmu credit is updated based on the number of packets transmitted by tmu. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12staging: fsl_ppfe/eth: Disable autonegotiation for 2.5G SGMIIBhaskar Upadhaya
PCS initialization sequence for 2.5G SGMII interface governs auto negotiation to be in disabled mode Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
2017-12-12staging: fsl_ppfe/eth: Enable PFE in clause 45 modeBhaskar Upadhaya
when we opearate in clause 45 mode, we need to call the function get_phy_device() with its 3rd argument as "true" and then the resultant phy device needs to be register with phy layer via phy_device_register() Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
2017-12-12staging: fsl-dpaa2/mac: Free phydev on unbindBogdan Purcareata
Stop polling and unregister / disconnect the phydev structure on DPAA2 mac driver unbind. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/mac: Cleanup codeBogdan Purcareata
- move dpaa2_mac_open and dpaa2_mac_stop out of CONFIG_FSL_DPAA2_MAC_NETDEVS, since their implementation is necessary regardless of it - reorder ndo ops to match function implementation order - update comment to describe the phy connection mode that's to be used - it no longer depends on DPC, but on the device tree Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/mac: Remove redundant freeBogdan Purcareata
free_netdev (put_device) already handles freeing the private data structure, and KASAN will complain due to a free after free if we explicitly do the same afterwards. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add DCB KconfigIoana Radulescu
Add a Kconfig option for enabling Data Center Bridging (DCB) support in the Ethernet driver. This is needed for priority flow control support. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: defer probe if no mc portal is foundNipun Gupta
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Remove unused FD fieldIoana Radulescu
According to the hardware ArchDef, the PTV1 field in FD[CTRL] is ignored by WRIOP, so setting it for Tx FDs is pointless. Remove all references to it from the code. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Use napi_consume_skb()Ioana Radulescu
While in NAPI context, free skbs by calling napi_consume_skb() instead of dev_kfree_skb(), to take advantage of the bulk freeing mechanism. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Don't yield the cpu unless necessaryIoana Radulescu
When releasing buffers to the hardware pool, don't call cpu_relax() unless we are actually waiting for the QBMan portal to finish the previous command. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Don't include HH_DATA_MOD in needed_headroomBogdan Purcareata
The network stack will take care to reserve space for HH_DATA_MOD when building the skb, so there's no need to account for it in the netdevice needed headroom. Based on that, decrease the frame buffer headroom for ingress frames. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Update Rx headroom computationBogdan Purcareata
Instead of the old opaque value, define the Rx buffer headroom size based on other frame buffer fields, in accordance to how we expect them to be configured by MC. Based on DPNI_BUF_LAYOUT_OPT_TIMESTAMP, MC will enable an additional field in the Tx hardware annotation area, increasing its size to 128. Update the driver value to reflect this. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Don't account SWA in tx_data_offsetBogdan Purcareata
When configuring the Tx buffer layout, the software annotation size is mentioned, and MC accounts for it when configuring the frame tx_data_offset. No need to handle it in the driver as well. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add buffer count to channel statsBogdan Purcareata
Since adding support for multiple buffer thresholds (taildrop, flow control pause frames, PFC pause frames), it's useful to have the per-channel buffer count available in the debug stats. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Fix NAPI initializationIoana Radulescu
Make sure the NAPI instances are enabled only after all other device initialization is done, to avoid accessing uninit vars. Mirror that change on device remove routine. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Account for Rx FD buffers on error pathIoana Radulescu
On Rx path, if we fail to build an skb from the incoming FD, we still need to update the channel buffer count accordingly, otherwise we risk depleting the pool while the software counter still sees available buffers. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Fix potential endless loopIoana Radulescu
We incorrectly assumed that dpaa2_io_release() can only return -EBUSY as an error code, when in fact it can also fail in case some of its arguments don't have valid values. Make sure we only retry the operation while the portal is busy and abort for all other error cases, otherwise we risk entering an endless loop. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Integrated-by: Guanhua Gao <guanhua.gao@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Fix compiling errors for backporting dash-ltsGuanhua Gao
Fix compiling errors for backporting dash-lts. Signed-off-by: Guanhua Gao <guanhua.gao>
2017-12-12staging: fsl-dpaa2/eth: Get PFC config from HWBogdan Purcareata
The dpaa2-eth PFC configuration is kept in a private driver variable. When getting PFC configuration via ieee_getpfc, get it straight from the Management Complex based on the Rx congestion notification setup. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add dpni_get_congestion_notif APIBogdan Purcareata
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Configure PFC in MCBogdan Purcareata
Implement the following: - Enable PFC in DPNI options. - Set queue taildrops for priorities (traffic classes) that are not PFC enabled (pause frames are not sent in case of congestion). Since the buffer pool is shared, we can't risk other traffic to consume all available buffers. - Configure Rx congestion notifications for PFC enabled priorities. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Refactor fq taildrop setupBogdan Purcareata
With the introduction of PFC support, there are multiple ways taildrop is configured, based on the DPNI pause frame configuration: - no pause frames - per-queue taildrop thresholds. - pause frames - no taildrop thresholds (pause frames sent based on buffer depletion). - PFC pause frames - per-group (traffic class) taildrop thresholds for non-PFC enabled priorities (pause frames sent based on Rx congestion notifications). Refactor the fq taildrop setup area. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add ingress classificationBogdan Purcareata
Configure static ingress classification based on VLAN PCP, required by PFC. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add DCB supportBogdan Purcareata
Add initial DCB ops in the DPAA2 Ethernet driver. Currently they are dummy calls. Tested integration with userspace lldpad: - lldpad daemon running - bring interface up - lldptool -L -i niX adminStatus=rxtx - lldptool -T -i niX -V PFC -c enabled={prio comma separated list} - lldptool -t -i niX -V PFC -c enabled Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Switch to v2 dpni_set_pools cmdBogdan Purcareata
The v2 dpni_set_pools command format allows sending an additional parameter, the priority mask for the buffer pool. This can be used to configure multiple buffer pools for the same dpni, to serve different priorities. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Add fs entries for all tcsBogdan Purcareata
The current MC (10.3.1) design uses a separate flow steering table for each traffic class. When adding a flow steering rule, add it for each traffic class. The location of the rule is the same in all tables. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl-dpaa2/eth: Handle multiple traffic classesBogdan Purcareata
The driver only handles frame workqueues associated with traffic class 0. Add support for multiple traffic classes for the same flowid, based on the tc field in the fq struct, and the num_tcs parameter in the dpni atttributes. Create a separate fq for each tc x flowid. Display the information in debugfs. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-12-12staging: fsl_ppfe/eth: Make phy_ethtool_ksettings_get return voidCalvin Johnson
Make return value void since function never return meaningful value Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12fsl_qbman/usdpaa: Invalidate software portals before useRoy Pledge
Invalidate the cache for the software portals before using them since the portals are non coherent. This ensures that the core using the portal is seeing the most up to date information in case the cache contained older data. This is important during the cleanup phase if cleanup occurs on a differnt core than what the application was using. Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2017-12-12staging/fsl_qbman: Calculate valid bit from MC-RRRoy Pledge
Use the management commmand response registers to determine the next expected valid bit when initializing a software portal. This avoids using the wrong valid bit in cases where a command was partially written but then not completed. Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2017-12-12staging: fsl_ppfe/eth: fix read/write/ack idx issueCalvin Johnson
While fixing checkpatch errors some of the index increments were commented out. They are enabled. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12staging: fsl_ppfe/eth: remove unused functionsCalvin Johnson
Remove unused functions hif_xmit_pkt & hif_lib_xmit_pkt. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12staging: fsl_ppfe/eth: fix RGMII tx delay issueCalvin Johnson
Recently logic to enable RGMII tx delay was changed by below patch. https://patchwork.kernel.org/patch/9447581/ Based on the patch, appropriate change is made in PFE driver. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12change _nfct to nfct for linux 4.9Calvin Johnson
Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
2017-12-12staging: fsl_ppfe/eth: introduce pfe driverCalvin Johnson
[pfe part] This patch introduces Linux support for NXP's LS1012A Packet Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding engine to provide high performance Ethernet interfaces. The device includes two Ethernet ports. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com> Integrated-by: Zhao Qiang <qiang.zhao@nxp.com>
2017-12-12staging: fsl_ppfe/eth: header files for pfe driverCalvin Johnson
This patch has all pfe header files. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
2017-12-12staging: fsl_ppfe/eth: introduce pfe driverZhao Qiang
[config part] This patch introduces Linux support for NXP's LS1012A Packet Forwarding Engine (pfe_eth). LS1012A uses hardware packet forwarding engine to provide high performance Ethernet interfaces. The device includes two Ethernet ports. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com> Integrated-by: Zhao Qiang <qiang.zhao@nxp.com>
2017-09-28DPIO: Prefer the CPU affine DPIORoy Pledge
Use the cpu affine DPIO unless there isn't one which can happen if less DPIOs than cores are assign to the kernel. Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
2017-09-28staging: fsl-mc/dpio: Fix incorrect comparisonIoana Radulescu
For some dpio functions, a negative cpu id parameter value is valid and means "any". But when trying to validate this param value against an upper limit, in this case num_possible_cpus(), we risk obtaining the wrong result due to an implicit cast. Avoid an incorrect check result when cpu id is negative, by explicitly stating the comparison is between signed values. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: Add generic FD defines to DPIOHoria Geantă
Previous commits: 6e2387e8f19e ("staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver") 39163c0ce0f4 ("staging: fsl-dpaa2/eth: Errors checking update") have added bits that are not specific to the WRIOP accelerator. Move these where they belong (in DPIO) such that other accelerators can make use of them. While here, fix the values of FD_CTRL_FSE and FD_CTRL_FAERR, which were shifted off by one bit. Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: move generic FD defines to DPIOHoria Geantă
Previous commits: 6e2387e8f19e ("staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver") 39163c0ce0f4 ("staging: fsl-dpaa2/eth: Errors checking update") have added bits that are not specific to the WRIOP accelerator. Move these where they belong (in DPIO) such that other accelerators can make use of them. While here, fix the values of FD_CTRL_FSE and FD_CTRL_FAERR, which were shifted off by one bit. Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: Set Tx timestamp support correctlyIoana Radulescu
We used to set pass_timestamp parameter only for Tx confirmation buffer layout config, when in fact MC also looks at the Tx buffer layout when deciding whether to enable Tx timestamping support or not. Older versions of MC (< MC.1.x) enabled this support regardless of user config, so the issue was hidden. Copy the pass_timestamp setting to Tx buffer layout configuration. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: Fix access to CSCN memoryIoana Radulescu
Make sure the memory area where the hardware writes the congestion state is properly synchronized before reading it. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: Fix NULL pointer accessIoana Radulescu
If build_frag_skb() fails, we risk accessing the skb pointer before checking it's not NULL. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: Fix adding FS rule at specific locationIoana Radulescu
When inserting a flow steering rule through ethtool, the user may specify a location index. Ethtool manual says the expected behaviour is to overwrite any rule present in that location. What currently happens is that the driver passes on the location to MC with no further verifications and if there's already a rule present at that index, MC returns an error. Fix this by making sure the location is available, and if not free the current entry before inserting the new one. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: Fix skb use after freeBogdan Purcareata
Once a Tx frame descriptor is enqueued, an interrupt might be triggered to process the Tx confirmation and free the skb, hitting a memory use after free when updating the tx_bytes statistic based on skb->len. Use the frame descriptor length instead. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
2017-09-25staging: fsl-dpaa2/eth: Fix use of uninitialized priv fieldsIoana Radulescu
Private structure fields "hash_fields" and "num_hash_fields" were used in check_cls_support() even though they were initialized later. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
2017-09-25Added missing fields to dprc_rsp_get_obj_region structureCristian Sovaiala
'type' and 'flags' fields were missing from dprc_rsp_get_obj_region structure therefore the MC Bus driver was not receiving proper flags from MC like DPRC_REGION_CACHEABLE. Signed-off-by: Cristian Sovaiala <cristian.sovaiala@freescale.com>