summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/netronome
Commit message (Collapse)AuthorAgeFilesLines
* nfp: freeing the wrong variableDan Carpenter2017-07-121-1/+1
| | | | | | | | | | We accidentally free a NULL pointer and leak the pointer we want to free. Also you can tell from the label name what was intended. :) Fixes: abfcdc1de9bf ("nfp: add a stats handler for flower offloads") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: flower: add missing clean up call to avoid memory leaksJakub Kicinski2017-07-071-0/+1
| | | | | | | | | | nfp_flower_metadata_cleanup() is defined but never invoked, not calling it will cause us to leak mask and statistics queue memory on the host. Fixes: 43f84b72c50d ("nfp: add metadata to each flow offload") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: default to chained metadata prepend formatJakub Kicinski2017-07-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | ABI 4.x introduced the chained metadata format and made it the only one possible. There are cases, however, where the old format is preferred - mostly to make interoperation with VFs using ABI 3.x easier for the datapath. In ABI 5.x we allowed for more flexibility by selecting the metadata format based on capabilities. The default was left to non-chained. In case of fallback traffic, there is no capability telling the driver there may be chained metadata. With a very stripped- -down FW the default old metadata format would be selected making the driver drop all fallback traffic. This patch changes the default selection in the driver. It should not hurt with old firmwares, because if they don't advertise RSS they will not produce metadata anyway. New firmwares advertising ABI 5.x, however, can depend on the driver defaulting to chained format. Fixes: f9380629fafc ("nfp: advertise support for NFD ABI 0.5") Suggested-by: Michael Rapson <michael.rapson@netronome.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: remove legacy MAC address lookupJakub Kicinski2017-07-054-34/+8Star
| | | | | | | | | | The legacy MAC address lookup doesn't work well with breakout cables. We are probably better off picking random addresses than the wrong ones in the theoretical scenario where management FW didn't tell us what the port config is. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: improve order of interfaces in breakout modeJakub Kicinski2017-07-053-14/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | For historical reasons we enumerate the vNICs in order. This means that if user configures breakout on a multiport card, the first interface of the second port will have its MAC address changed. What's worse, when moved from static information (HWInfo) to using management FW (NSP), more features started depending on the port ids. Right now in case of breakout first subport of the second port and second subport of the first port will have their link info swapped. Revise the ordering scheme so that first subport maintains its address. Side effect of this change is that we will use base lane ids in devlink (i.e. 40G ports will be 4 ids apart), e.g.: pci/0000:04:00.0/0: type eth netdev p6p1 pci/0000:04:00.0/4: type eth netdev p6p2 Note that behaviour of phys_port_id is not changed since there is a separate id number for the subport there. Fixes: ec8b1fbe682d ("nfp: support port splitting via devlink") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add control message passing capabilities to flower offloadsPieter Jansen van Vuuren2017-07-013-1/+70
| | | | | | | | | | | | | | | | | Previously the flower offloads never sends messages to the hardware, and never registers a handler for receiving messages from hardware. This patch enables the flower offloads to send control messages to hardware when adding and removing flow rules. Additionally it registers a control message rx handler for receiving stats updates from hardware for each offloaded flow. Additionally this patch adds 4 control message types; Add, modify and delete flow, as well as flow stats. It also allows nfp_flower_cmsg_get_data() to be used outside of cmsg.c. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add a stats handler for flower offloadsPieter Jansen van Vuuren2017-07-015-8/+171
| | | | | | | | | | | Previously there was no way of updating flow rule stats after they have been offloaded to hardware. This is solved by keeping track of stats received from hardware and providing this to the TC handler on request. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add metadata to each flow offloadPieter Jansen van Vuuren2017-07-015-13/+412
| | | | | | | | | | | | Adds metadata describing the mask id of each flow and keeps track of flows installed in hardware. Previously a flow could not be removed from hardware as there was no way of knowing if that a specific flow was installed. This is solved by storing the offloaded flows in a hash table. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add basic action capabilities to flower offloadsPieter Jansen van Vuuren2017-07-015-0/+271
| | | | | | | | | Adds push vlan, pop vlan, output and drop action capabilities to flower offloads. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: extend flower matching capabilitiesPieter Jansen van Vuuren2017-07-016-1/+316
| | | | | | | | | | Extends matching capabilities for flower offloads to include vlan, layer 2, layer 3 and layer 4 type matches. This includes both exact and wildcard matching. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: extend flower add flow offloadPieter Jansen van Vuuren2017-07-013-1/+325
| | | | | | | | | | Extends the flower flow add function by calculating which match fields are present in the flower offload structure and allocating the appropriate space to describe these. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: provide infrastructure for offloading flower based TC filtersPieter Jansen van Vuuren2017-07-018-14/+220
| | | | | | | | | | | | | Adds a flower based TC offload handler for representor devices, this is in addition to the bpf based offload handler. The changes in this patch will be used in a follow-up patch to add tc flower offload to the NFP. The flower app enables tc offloads on representors by default. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add phys_switch_id supportSimon Horman2017-07-014-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Add phys_switch_id support by allowing lookup of SWITCHDEV_ATTR_ID_PORT_PARENT_ID via the nfp_repr_port_attr_get switchdev operation. This is visible to user-space in the phys_switch_id attribute of a netdev. e.g. cd /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 find . -name phys_switch_id | xargs grep . ./net/eth3/phys_switch_id:00154d1300bd ./net/eth4/phys_switch_id:00154d1300bd ./net/eth2/phys_switch_id:00154d1300bd grep: ./net/eth5/phys_switch_id: Operation not supported In the above eth2 and eth3 and representor netdevs for the first and second physical port. eth4 is the representor for the PF. And eth5 is the PF netdev. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: flower: add Kconfig for flower appJakub Kicinski2017-06-273-2/+18
| | | | | | | | Give users an option not to build the flower-offload related code. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: allocate a private workqueue for driver workJakub Kicinski2017-06-273-1/+14
| | | | | | | | | | | Since we grab pf->lock around pci_enable_sriov() we can no longer safely queue work which may also grab that lock onto system workqueue. pci_enable_sriov() will flush system workqueue as part to wait for VF probing. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: reorder SR-IOV config and nfp_app SR-IOV callbacksJakub Kicinski2017-06-272-23/+27
| | | | | | | | | | | | | | | | We previously assumed that app callback can be guaranteed to be executed before SR-IOV is actually enabled. Given that we can't guarantee that SR-IOV will be disabled during probe or that we will be able to disable it on remove, we should reorder the callbacks. We should also call the app's sriov_enable if SR-IOV was enabled during probe. Application FW must be able to disable VFs internally and not depend on them being removed at PCIe level. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: handle SR-IOV already enabled when driver is probingJakub Kicinski2017-06-271-0/+8
| | | | | | | | | | | We assumed that when we probe number of enabled VFs will be at 0. This doesn't have to be the case for example if previous driver left SR-IOV enabled due to some VFs being assigned. Read the number of VFs enabled. Fail probe if it's above current FWs limit. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: wire get_phys_port_name on representorsJakub Kicinski2017-06-272-7/+24
| | | | | | | | | Make nfp_port_get_phys_port_name() support new port types and wire it up to representors' struct net_device_ops. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: allow converting representor's netdev into nfp_portJakub Kicinski2017-06-273-6/+21
| | | | | | | | | Based on struct net_device_ops figure out if netdev is a nfp_repr. Use this knowledge to convert netdev directly to nfp_port. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: move representors' struct net_device_ops to shared codeJakub Kicinski2017-06-276-39/+68
| | | | | | | | | | | Apps shouldn't declare their own struct net_device_ops for representors, this makes sharing code harder. Add necessary nfp_app callbacks and move the definition of representors' struct net_device_ops to common code. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: make the representor get stats app-independentJakub Kicinski2017-06-273-26/+22Star
| | | | | | | | | | Thanks to the fact that all representors will now have an nfp_port, we can depend on information there to provide a app-independent .ndo_get_stats64(). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: spawn nfp_ports for PF and VF portsJakub Kicinski2017-06-272-4/+35
| | | | | | | | | | nfp_port is an abstraction which is supposed to allow us sharing code between different netdev types (vNIC vs repr). Spawn ports for PFs and VFs to enable this sharing. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add nfp_app cleanup callback and make flower use itJakub Kicinski2017-06-273-14/+26
| | | | | | | | | | | | | Add a cleanup callback for undoing what app init callback did. Make flower allocate its private structure on init and free it from the new callback. While at it remember to set the app pointer to NULL on the error path to avoid any races while probe path unwinds. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: remove unused nfp_cpp_area_check_range()Jakub Kicinski2017-06-272-23/+0Star
| | | | | | | | Remove unused nfp_cpp_area_check_range() function. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add helper for mapping runtime symbolsJakub Kicinski2017-06-273-28/+39
| | | | | | | | | | | Move most of the helper for mapping RTsyms from nfp_net_main.c to nfpcore. Use the new helper directly for mapping MAC statistics, since they don't need to include the PCIe interface ID in the symbol name. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: move area mapping helper into nfpcoreJakub Kicinski2017-06-274-54/+84
| | | | | | | | | | | | nfp_net_map_area() is a helper for mapping areas of NFP memory defined in nfp_net_main.c. Move it to nfpcore to allow reuse and rename accordingly. Create an additional helper - nfp_cpp_area_alloc_acquire() the opposite of already existing nfp_cpp_area_release_free(). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: explicitly check if application FW is loadedJakub Kicinski2017-06-271-4/+7
| | | | | | | | | | | | | | | | | We support application FW being either loaded automatically at boot from flash or (more commonly) by the driver from disk. If FW is not found on disk and nothing is preloaded users are faced with this unintuitive error: nfp 0000:04:00.0: nfp: Failed to find PF symbol _pf0_net_bar0 We can do better. Since we rely on symbol table being present - check early if it could be correctly read out of from the device and if not print a more informative message. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add VF and PF representors to flower appSimon Horman2017-06-251-2/+83
| | | | | | | | | | | Initialise VF and PF representors in flower app. Based in part on work by Benjamin LaHaise, Bert van Leeuwen and Jakub Kicinski. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add flower appSimon Horman2017-06-254-0/+300
| | | | | | | | | | | | Add app for flower offload. At this point the PF netdev and phys port representor netdevs are initialised. Follow-up work will add support for VF and PF representors and beyond that offloading the flower classifier. Based in part on work by Benjamin LaHaise and Bert van Leeuwen. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add support for control messages for flower appSimon Horman2017-06-255-3/+281
| | | | | | | | | | | | In preparation for adding a new flower app - targeted at offloading the flower classifier - provide support for control message that it will use to communicate with the NFP. Based in part on work by Bert van Leeuwen. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add support for tx/rx with metadata portidSimon Horman2017-06-252-6/+52
| | | | | | | | | | Allow tx/rx with metadata port id. This will be used for tx/rx of representor netdevs acting as upper-devices while a pf netdev acts as a lower-device. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: provide nfp_port to of nfp_net_get_mac_addr()Simon Horman2017-06-253-15/+15
| | | | | | | | | | | Provide port rather than vNIC as parameter of nfp_net_get_mac_addr. This is to allow this function to be used by representor netdevs where a vNIC may have more than one physical port none of which are associated with the vNIC. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: app callbacks for SRIOVSimon Horman2017-06-252-5/+55
| | | | | | | | | | | | | | Add app-callbacks for app-specific initialisation of SRIOV. Disabling SRIOV is brought forward in nfp_pci_remove() so that nfp_app_sriov_disable is called while the app still exists. This is intended to be used to implement representor netdevs for virtual ports. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add stats and xmit helpers for representorsSimon Horman2017-06-252-1/+226
| | | | | | | | | | | Provide helpers for stats and xmit on representor netdevs. Parts based on work by Bert van Leeuwen, Benjamin LaHaise and Jakub Kicinski. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: general representor implementationSimon Horman2017-06-255-0/+287
| | | | | | | | | | | Provide infrastructure to create and destroy representors of a given type. Parts based on work by Bert van Leeuwen, Benjamin LaHaise, and Jakub Kicinski. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: map mac_stats and vf_cfg BARsSimon Horman2017-06-255-33/+164
| | | | | | | | | | | | | | If present map mac_stats and vf_cfg BARs. These will be used by representor netdevs to read statistics for phys port and vf representors. Also provide defines describing the layout of the mac_stats area. Similar defines are already present for the cf_cfg area. Based in part on work by Jakub Kicinski. Signed-off-by: Simon Horman <simon.horman@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: move physical port init into a helperJakub Kicinski2017-06-253-17/+34
| | | | | | | | | Move MAC/PHY port init into a helper to make it easier to reuse it in the representor code. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: devlink add support for getting eswitch modeJakub Kicinski2017-06-252-0/+33
| | | | | | | | | | Add app callback for reporting eswitch mode. Non-SRIOV apps should not implement this callback, nfp_app code will then respond with -EOPNOTSUPP. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: xdp: report if program is offloadedJakub Kicinski2017-06-231-0/+2
| | | | | | | Make use of just added XDP_ATTACHED_HW. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: bpf: add support for XDP_FLAGS_HW_MODEJakub Kicinski2017-06-231-3/+10
| | | | | | | | Respect the XDP_FLAGS_HW_MODE. When it's set install the program on the NIC and skip enabling XDP in the driver. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: bpf: release the reference on offloaded programsJakub Kicinski2017-06-232-21/+15Star
| | | | | | | | | | | | | | The xdp_prog member of the adapter's data path structure is used for XDP in driver mode. In case a XDP program is loaded with in HW-only mode, we need to store it somewhere else. Add a new XDP prog pointer in the main structure and use that when we need to know whether any XDP program is loaded, not only a driver mode one. Only release our reference on adapter free instead of immediately after netdev unregister to allow offload to be disabled first. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: bpf: don't offload XDP programs in DRV_MODEJakub Kicinski2017-06-232-3/+14
| | | | | | | | | | | | | | | DRV_MODE means that user space wants the program to be run in the driver. Do not try to offload. Only offload if no mode flags have been specified. Remember what the mode is when the program is installed and refuse new setup requests if there is already a program loaded in a different mode. This should leave it open for us to implement simultaneous loading of two programs - one in the drv path and another to the NIC later. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: xdp: move driver XDP setup into a separate functionJakub Kicinski2017-06-231-5/+18
| | | | | | | | | | | In preparation of XDP offload flags move the driver setup into a function. Otherwise the number of conditions in one function would make it slightly hard to follow. The offload handler may now be called with NULL prog, even if no offload is currently active, but that's fine, offload code can handle that. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: add VLAN filtering supportPablo Cascón2017-06-192-1/+100
| | | | | | | | | Add general use per-vNIC mailbox area and use it for VLAN filtering support. Initially proto is hardcoded to 802.1q. Signed-off-by: Pablo Cascón <pablo.cascon@netronome.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bpf: nfp: Report bpf_prog ID during XDP_QUERY_PROGMartin KaFai Lau2017-06-161-0/+1
| | | | | | | | | | | Add support to nfp to report bpf_prog ID during XDP_QUERY_PROG. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Cc: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Alexei Starovoitov <ast@fb.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: report application FW build name in ethtool -iJakub Kicinski2017-06-095-2/+19
| | | | | | | | Make sure application FW build name is NULL-terminated and print it as a part of ethtool's firmware version string. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: keep MIP object aroundJakub Kicinski2017-06-094-4/+22
| | | | | | | | | Microcode Information Page contains some useful information, like application firmware build name. Keep it around, similar to RTSym and HWInfo. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: remove automatic caching of HWInfoJakub Kicinski2017-06-098-79/+54Star
| | | | | | | Make callers take care of managing life time of HWInfo. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: remove automatic caching of RTsym tableJakub Kicinski2017-06-098-112/+63Star
| | | | | | | | | | | | | | The fact that RTsym table is cached inside nfp_cpp handle is a relic of old times when nfpcore was a library module. All the nfp_cpp "caches" are awkward to deal with because of concurrency and prone to keeping stale information. Make the run time symbol table be an object read out from the device and managed by whoever requested it. Since the driver loads FW at ->probe() and never reloads, we can hold onto the table for ever. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* nfp: make sure to cancel port refresh on the error pathJakub Kicinski2017-06-091-0/+1
| | | | | | | | | | | | | | If very last stages of netdev registering and init fail some other netdevs and devlink ports may have been visible to user space before we torn them back down. In this case there is a slight chance user may have triggered port refresh. We need to make sure the async work is cancelled. We have to cancel after releasing pf->lock, so we will always try to cancel, regardless of which part of probe has failed. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>