aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome
AgeCommit message (Collapse)AuthorFilesLines
2022-03-21nfp: calculate ring masks without conditionalsJakub Kicinski1-4/+4
Ring enable masks are 64bit long. Replace mask calculation from: block_cnt == 64 ? 0xffffffffffffffffULL : (1 << block_cnt) - 1 with: (U64_MAX >> (64 - block_cnt)) to simplify the code. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-03-16devlink: pass devlink_port to port_split / port_unsplit callbacksJakub Kicinski3-28/+7
Now that devlink ports are protected by the instance lock it seems natural to pass devlink_port as an argument to the port_split / port_unsplit callbacks. This should save the drivers from doing a lookup. In theory drivers may have supported unsplitting ports which were not registered prior to this change. Reviewed-by: Ido Schimmel <[email protected]> Tested-by: Ido Schimmel <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-16devlink: hold the instance lock in port_split / port_unsplit callbacksJakub Kicinski1-24/+8
Let the core take the devlink instance lock around port splitting and remove the now redundant locking in the drivers. Reviewed-by: Ido Schimmel <[email protected]> Tested-by: Ido Schimmel <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-16eth: nfp: replace driver's "pf" lock with devlink instance lockJakub Kicinski6-41/+48
The whole reason for existence of the pf mutex is that we could not lock the devlink instance around port splitting. There are more types of reconfig which can make ports appear or disappear. Now that the devlink instance lock is exposed to drivers and "locked" helpers exist we can switch to using the devlink lock directly. Next patches will move the locking inside .port_(un)split to the core. Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-16eth: nfp: wrap locking assertions in helpersJakub Kicinski4-5/+14
We can replace the PF lock with devlink instance lock in subsequent changes. To make the patches easier to comprehend and limit line lengths - factor out the existing locking assertions. No functional changes. Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-14nfp: flower: avoid newline at the end of message in NL_SET_ERR_MSG_MODNiklas Söderlund1-1/+1
Fix the following coccicheck warning: drivers/net/ethernet/netronome/nfp/flower/action.c:959:7-69: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: add support for NFP3800/NFP3803 PCIe devicesDirk van der Merwe5-4/+29
Enable binding the nfp driver to NFP3800 and NFP3803 devices. The PCIE_SRAM offset is different for the NFP3800 device, which also only supports a single explicit group. Changes to Dirk's work: * 48-bit dma addressing is not ready yet. Keep 40-bit dma addressing for NFP3800. Signed-off-by: Dirk van der Merwe <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: take chip version into account for ring sizesJakub Kicinski4-10/+16
NFP3800 has slightly different queue controller range bounds. Use the static chip data instead of defines. This commit still assumes unchanged descriptor format. Later datapath changes will allow adjusting for descriptor accounting. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: parametrize QCP offset/size using dev_infoJakub Kicinski6-9/+32
The queue controller (QCP) is accessed based on a device specific offset. The NFP3800 device also supports more queues. Furthermore, the NFP3800 VFs also access the QCP differently to how the NFP6000 VFs accesses it, though still indirectly. Fortunately, we can remove the offset all together for both VF types. This is safe for NFP6000 VFs since the offset was effectively a wrap around and only used for convenience to have it set the same as the NFP6000 PF. Use nfp_dev_info to store queue controller parameters. Signed-off-by: Dirk van der Merwe <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: use dev_info for the DMA maskJakub Kicinski5-7/+6
In preparation for new chips instead of defines use dev_info constants to store DMA mask length. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: use dev_info for PCIe config space BAR offsetsJakub Kicinski3-12/+12
NFP3800 uses a different PCIe configuration to CPP expansion BAR offsets. We don't need to differentiate between the NFP4000, NFP5000 and NFP6000 since they all use the same offsets. Signed-off-by: Dirk van der Merwe <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: introduce dev_info static chip dataJakub Kicinski11-13/+68
In preparation for supporting new chip add a driver data structure which will hold per-chip-version information such as register offsets. Plumb it through to the relevant functions (nfpcore and nfp_net). For now only a very simple member holding chip names is added, following commits will add more. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: sort the device ID tablesJakub Kicinski1-2/+2
Make sure the device ID tables are in ascending order. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: use PluDevice register for model for non-NFP6000 chipsDirk van der Merwe1-2/+7
The model number for NFP3800 and newer devices can be completely derived from PluDevice register without subtracting 0x10. Signed-off-by: Dirk van der Merwe <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: use PCI_DEVICE_ID_NETRONOME_NFP6000_VF for VFs insteadDirk van der Merwe1-2/+1
The PCI_DEVICE_ID_NETRONOME_NFP6000_VF is available for use and should be used instead of the PCI_DEVICE_NFP6000VF. Meanwhile, PCI_DEVICE_NFP6000VF PCI ID is removed for not being used. Signed-off-by: Dirk van der Merwe <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: remove pessimistic NFP_QCP_MAX_ADD limitsChristo du Toit1-30/+2
Multiple writes cause intermediate pointer values that do not end on complete TX descriptors. The QCP peripheral on the NFP provides a number of access modes. In some access modes, the maximum amount to add must be restricted to a 6bit value. The particular access mode used by _nfp_qcp_ptr_add() has no such restrictions, so the "< NFP_QCP_MAX_ADD" test is unnecessary. Note that trying to add more that the configured ring size in a single add will cause a QCP overflow, caught and handled by the QCP peripheral. Signed-off-by: Christo du Toit <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-11nfp: remove define for an unused control bitJakub Kicinski1-1/+0
NFP driver ABI contains a bit for ring prioritization which was never implemented in the initially envisioned form. Remove it, and open up the possibility of reclaiming for other uses. Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Dirk van der Merwe <[email protected]> Signed-off-by: Fei Qin <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-10nfp: xsk: fix a warning when allocating rx ringsYinjun Zhang1-4/+5
Previous commits introduced AF_XDP zero-copy support, in which we need register different mem model for xdp_rxq when AF_XDP zero-copy is enabled or not. And this should be done after xdp_rxq info is registered, which is not needed for ctrl port, otherwise there complaints warnings: "Missing register, driver bug". Fix this by not registering mem model for ctrl port, just like we don't register xdp_rxq info for ctrl port. Fixes: 6402528b7a0b ("nfp: xsk: add AF_XDP zero-copy Rx and Tx support") Signed-off-by: Yinjun Zhang <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Signed-off-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-07nfp: xsk: avoid newline at the end of message in NL_SET_ERR_MSG_MODGuo Zhengkui1-1/+1
Fix the following coccicheck warning: drivers/net/ethernet/netronome/nfp/nfp_net_common.c:3434:8-48: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Guo Zhengkui <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-03-04nfp: xsk: add AF_XDP zero-copy Rx and Tx supportNiklas Söderlund6-28/+756
This patch adds zero-copy Rx and Tx support for AF_XDP sockets. It do so by adding a separate NAPI poll function that is attached to a each channel when the XSK socket is attached with XDP_SETUP_XSK_POOL, and restored when the XSK socket is terminated, this is done per channel. Support for XDP_TX is implemented and the XDP buffer can safely be moved from the Rx to the Tx queue and correctly freed and returned to the XSK pool once it's transmitted. Note that when AF_XDP zero-copy is enabled, the XDP action XDP_PASS will allocate a new buffer and copy the zero-copy frame prior passing it to the kernel stack. This patch is based on previous work by Jakub Kicinski. Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-03-04nfp: xsk: add configuration check for XSK socket chunk sizeNiklas Söderlund1-4/+38
In preparation for adding AF_XDP support add a configuration check to make sure the buffer size can not be set to a larger value then the XSK socket chunk size. Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-03-04nfp: xsk: add an array of xsk buffer pools to each data pathNiklas Söderlund2-2/+21
Each data path needs an array of xsk pools to track if an xsk socket is in use. Add this array and make sure it's handled correctly when the data path is duplicated. Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-03-04nfp: wrap napi add/del logicJakub Kicinski1-16/+22
There will be more NAPI register logic once AF_XDP support is added, wrap our already conditional napi add/del into helpers. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-03-04nfp: expose common functions to be used for AF_XDPNiklas Söderlund2-8/+22
There are some common functionality that can be reused in the upcoming AF_XDP support. Expose those functions in the header. While at it mark some arguments of nfp_net_rx_csum() as const. Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-03-02nfp: flower: Remove usage of the deprecated ida_simple_xxx APIChristophe JAILLET1-5/+5
Use ida_alloc_xxx()/ida_free() instead to ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-03-01nfp: avoid newline at end of message in NL_SET_ERR_MSG_MODWan Jiabing1-1/+1
Fix the following coccicheck warning: ./drivers/net/ethernet/netronome/nfp/flower/qos_conf.c:750:7-55: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Wan Jiabing <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-28flow_offload: reject offload for all drivers with invalid police parametersJianbo Liu1-0/+40
As more police parameters are passed to flow_offload, driver can check them to make sure hardware handles packets in the way indicated by tc. The conform-exceed control should be drop/pipe or drop/ok. Besides, for drop/ok, the police should be the last action. As hardware can't configure peakrate/avrate/overhead, offload should not be supported if any of them is configured. Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-02-24nfp: add NFP_FL_FEATS_QOS_METER to host features to enable meter offloadBaowen Zheng1-1/+2
Add NFP_FL_FEATS_QOS_METER to host features to enable meter offload in driver. Before adding this feature, we will not offload any police action since we will check the host features before offloading any police action. Signed-off-by: Baowen Zheng <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-24nfp: add support to offload police action from flower tableBaowen Zheng4-1/+68
Offload flow table if the action is already offloaded to hardware when flow table uses this action. Change meter id to type of u32 to support all the action index. Signed-off-by: Baowen Zheng <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-24nfp: add process to get action stats from hardwareBaowen Zheng2-5/+114
Add a process to update action stats from hardware. This stats data will be updated to tc action when dumping actions or filters. Signed-off-by: Baowen Zheng <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-24nfp: add hash table to store meter tableBaowen Zheng2-1/+176
Add a hash table to store meter table. This meter table will also be used by flower action. Signed-off-by: Baowen Zheng <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-24nfp: add support to offload tc action to hardwareBaowen Zheng3-1/+121
Add process to offload tc action to hardware. Currently we only support to offload police action. Add meter capability to check if firmware supports meter offload. Signed-off-by: Baowen Zheng <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-24nfp: refactor policer config to support ingress/egress meterBaowen Zheng2-20/+56
Add an policer API to support ingress/egress meter. Change ingress police to compatible with the new API. Signed-off-by: Baowen Zheng <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski1-2/+2
tools/testing/selftests/net/mptcp/mptcp_join.sh 34aa6e3bccd8 ("selftests: mptcp: add ip mptcp wrappers") 857898eb4b28 ("selftests: mptcp: add missing join check") 6ef84b1517e0 ("selftests: mptcp: more robust signal race test") https://lore.kernel.org/all/[email protected]/ drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c fb7e76ea3f3b6 ("net/mlx5e: TC, Skip redundant ct clear actions") c63741b426e11 ("net/mlx5e: Fix MPLSoUDP encap to use MPLS action information") 09bf97923224f ("net/mlx5e: TC, Move pedit_headers_action to parse_attr") 84ba8062e383 ("net/mlx5e: Test CT and SAMPLE on flow attr") efe6f961cd2e ("net/mlx5e: CT, Don't set flow flag CT for ct clear flow") 3b49a7edec1d ("net/mlx5e: TC, Reject rules with multiple CT actions") Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-18nfp: flower: Fix a potential leak in nfp_tunnel_add_shared_mac()Christophe JAILLET1-2/+2
ida_simple_get() returns an id between min (0) and max (NFP_MAX_MAC_INDEX) inclusive. So NFP_MAX_MAC_INDEX (0xff) is a valid id. In order for the error handling path to work correctly, the 'invalid' value for 'ida_idx' should not be in the 0..NFP_MAX_MAC_INDEX range, inclusive. So set it to -1. Fixes: 20cce8865098 ("nfp: flower: enable MAC address sharing for offloadable devs") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-17Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski1-0/+2
No conflicts. Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-17nfp: flower: netdev offload check for ip6gretapDanie du Toit1-0/+2
IPv6 GRE tunnels are not being offloaded, this is caused by a missing netdev offload check. The functionality of IPv6 GRE tunnel offloading was previously added but this check was not included. Adding the ip6gretap check allows IPv6 GRE tunnels to be offloaded correctly. Fixes: f7536ffb0986 ("nfp: flower: Allow ipv6gretap interface for offloading") Signed-off-by: Danie du Toit <[email protected]> Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-10Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski1-4/+8
No conflicts. Signed-off-by: Jakub Kicinski <[email protected]>
2022-02-08nfp: flower: fix ida_idx not being releasedLouis Peens1-4/+8
When looking for a global mac index the extra NFP_TUN_PRE_TUN_IDX_BIT that gets set if nfp_flower_is_supported_bridge is true is not taken into account. Consequently the path that should release the ida_index in cleanup is never triggered, causing messages like: nfp 0000:02:00.0: nfp: Failed to offload MAC on br-ex. nfp 0000:02:00.0: nfp: Failed to offload MAC on br-ex. nfp 0000:02:00.0: nfp: Failed to offload MAC on br-ex. after NFP_MAX_MAC_INDEX number of reconfigs. Ultimately this lead to new tunnel flows not being offloaded. Fix this by unsetting the NFP_TUN_PRE_TUN_IDX_BIT before checking if the port is of type OTHER. Fixes: 2e0bc7f3cb55 ("nfp: flower: encode mac indexes with pre-tunnel rule check") Signed-off-by: Louis Peens <[email protected]> Signed-off-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-01-27nfp: Simplify array allocationRobin Murphy1-1/+1
Prefer kcalloc() to kzalloc(array_size()) for allocating an array. Signed-off-by: Robin Murphy <[email protected]> Acked-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2022-01-26nfp: only use kdoc style comments for kdocSimon Horman3-59/+28
Update comments to only use kdoc style comments, starting with '/**', for kdoc. Flagged by ./scripts/kernel-doc Signed-off-by: Simon Horman <[email protected]> Acked-by: Randy Dunlap <[email protected]> Tested-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2022-01-26nfp: flower: Use struct_size() helper in kmalloc()Gustavo A. R. Silva1-1/+1
Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worst scenario, could lead to heap overflows. Also, address the following sparse warnings: drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c:359:25: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva <[email protected]> Acked-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-12-31Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-nextDavid S. Miller1-1/+1
Alexei Starovoitov says: ==================== pull-request: bpf-next 2021-12-30 The following pull-request contains BPF updates for your *net-next* tree. We've added 72 non-merge commits during the last 20 day(s) which contain a total of 223 files changed, 3510 insertions(+), 1591 deletions(-). The main changes are: 1) Automatic setrlimit in libbpf when bpf is memcg's in the kernel, from Andrii. 2) Beautify and de-verbose verifier logs, from Christy. 3) Composable verifier types, from Hao. 4) bpf_strncmp helper, from Hou. 5) bpf.h header dependency cleanup, from Jakub. 6) get_func_[arg|ret|arg_cnt] helpers, from Jiri. 7) Sleepable local storage, from KP. 8) Extend kfunc with PTR_TO_CTX, PTR_TO_MEM argument support, from Kumar. ==================== Signed-off-by: David S. Miller <[email protected]>
2021-12-19flow_offload: reject to offload tc actions in offload driversBaowen Zheng1-0/+3
A follow-up patch will allow users to offload tc actions independent of classifier in the software datapath. In preparation for this, teach all drivers that support offload of the flow tables to reject such configuration as currently none of them support it. Signed-off-by: Baowen Zheng <[email protected]> Signed-off-by: Simon Horman <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2021-12-16nfp: flower: refine the use of circular bufferYinjun Zhang1-19/+31
The current use of circular buffer to manage stats_context_id is very obscure, and it will cause problem if its element size is not power of two. So change the use more straightforward and scalable, and also change that for mask_id to keep consistency. Signed-off-by: Yinjun Zhang <[email protected]> Signed-off-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2021-12-13bpf: Let bpf_warn_invalid_xdp_action() report more infoPaolo Abeni1-1/+1
In non trivial scenarios, the action id alone is not sufficient to identify the program causing the warning. Before the previous patch, the generated stack-trace pointed out at least the involved device driver. Let's additionally include the program name and id, and the relevant device name. If the user needs additional infos, he can fetch them via a kernel probe, leveraging the arguments added here. Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Link: https://lore.kernel.org/bpf/ddb96bb975cbfddb1546cf5da60e77d5100b533c.1638189075.git.pabeni@redhat.com
2021-12-09Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski1-1/+3
No conflicts. Signed-off-by: Jakub Kicinski <[email protected]>
2021-12-09nfp: Fix memory leak in nfp_cpp_area_cache_add()Jianglei Nie1-1/+3
In line 800 (#1), nfp_cpp_area_alloc() allocates and initializes a CPP area structure. But in line 807 (#2), when the cache is allocated failed, this CPP area structure is not freed, which will result in memory leak. We can fix it by freeing the CPP area when the cache is allocated failed (#2). 792 int nfp_cpp_area_cache_add(struct nfp_cpp *cpp, size_t size) 793 { 794 struct nfp_cpp_area_cache *cache; 795 struct nfp_cpp_area *area; 800 area = nfp_cpp_area_alloc(cpp, NFP_CPP_ID(7, NFP_CPP_ACTION_RW, 0), 801 0, size); // #1: allocates and initializes 802 if (!area) 803 return -ENOMEM; 805 cache = kzalloc(sizeof(*cache), GFP_KERNEL); 806 if (!cache) 807 return -ENOMEM; // #2: missing free 817 return 0; 818 } Fixes: 4cb584e0ee7d ("nfp: add CPP access core") Signed-off-by: Jianglei Nie <[email protected]> Acked-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2021-11-26Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski2-4/+1
drivers/net/ipa/ipa_main.c 8afc7e471ad3 ("net: ipa: separate disabling setup from modem stop") 76b5fbcd6b47 ("net: ipa: kill ipa_modem_init()") Duplicated include, drop one. Signed-off-by: Jakub Kicinski <[email protected]>
2021-11-22net: annotate accesses to dev->gso_max_segsEric Dumazet2-3/+3
dev->gso_max_segs is written under RTNL protection, or when the device is not yet visible, but is read locklessly. Add netif_set_gso_max_segs() helper. Add the READ_ONCE()/WRITE_ONCE() pairs, and use netif_set_gso_max_segs() where we can to better document what is going on. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>