- 03 12月, 2021 16 次提交
-
-
由 Guangbin Huang 提交于
Function hclge_set_vlan_filter_hw() is a bit too long, so add a new function hclge_need_update_port_vlan() to simplify code and improve code readability. Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Yufeng Mo 提交于
hclge_cfg_common_loopback() is a bit too long, so encapsulate hclge_cfg_common_loopback_cmd_send() and hclge_cfg_common_loopback_wait() two functions to improve readability. Signed-off-by: NYufeng Mo <moyufeng@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Avihai Horon 提交于
The flow counters bulk query buffer is allocated once during mlx5_fc_init_stats(). For PFs and VFs this buffer usually takes a little more than 512KB of memory, which is aligned to the next power of 2, to 1MB. For SFs, this buffer is reduced and takes around 128 Bytes. The buffer size determines the maximum number of flow counters that can be queried at a time. Thus, having a bigger buffer can improve performance for users that need to query many flow counters. There are cases that don't use many flow counters and don't need a big buffer (e.g. SFs, VFs). Since this size is critical with large scale, in these cases the buffer size should be reduced. In order to reduce memory consumption while maintaining query performance, change the query buffer's allocation scheme to the following: - First allocate the buffer with small initial size. - If the number of counters surpasses the initial size, resize the buffer to the maximum size. The buffer only grows and isn't shrank, because users with many flow counters don't care about the buffer size and we don't want to add resize overhead if the current number of counters drops. This solution is preferable to the current one, which is less accurate and only addresses SFs. Signed-off-by: NAvihai Horon <avihaih@nvidia.com> Reviewed-by: NMark Bloch <mbloch@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Roi Dayan 提交于
Setting flow attr ip_version is not related to parsing tc flow actions. It needs to be set after parsing flower matches which changes the spec. So move it outside parse_tc_fdb_actions() and set it in __mlx5e_add_fdb_flow(). Signed-off-by: NRoi Dayan <roid@nvidia.com> Reviewed-by: NOz Shlomo <ozsh@nvidia.com> Reviewed-by: NMaor Dickman <maord@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Roi Dayan 提交于
Remove duplicate checks on flow_action by using common function. Signed-off-by: NRoi Dayan <roid@nvidia.com> Reviewed-by: NOz Shlomo <ozsh@nvidia.com> Reviewed-by: NMaor Dickman <maord@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Roi Dayan 提交于
Passing actions is redundant and can be retrieved from flow attr. Signed-off-by: NRoi Dayan <roid@nvidia.com> Reviewed-by: NOz Shlomo <ozsh@nvidia.com> Reviewed-by: NMaor Dickman <maord@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Roi Dayan 提交于
Passing actions is redundant and can be retrieved from flow. Signed-off-by: NRoi Dayan <roid@nvidia.com> Reviewed-by: NOz Shlomo <ozsh@nvidia.com> Reviewed-by: NMaor Dickman <maord@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Roi Dayan 提交于
Remove the action stack var from parse tc fdb actions and prase tc nic actions, use the flow attr action var directly. Signed-off-by: NRoi Dayan <roid@nvidia.com> Reviewed-by: NOz Shlomo <ozsh@nvidia.com> Reviewed-by: NMaor Dickman <maord@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Tariq Toukan 提交于
No calls for mlx5e_num_channels_changed() out of en_main.c, turn it static and remove from header. Keep the wrapper function mlx5e_num_channels_changed_ctx exposed. Signed-off-by: NTariq Toukan <tariqt@nvidia.com> Reviewed-by: NAya Levin <ayal@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Ben Ben-Ishay 提交于
This commit reduces unused variable from MLX5E_MAX_KLM_PER_WQE macro that introduced by commit d7b896ac ("net/mlx5e: Add support to klm_umr_wqe"). Signed-off-by: NBen Ben-Ishay <benishay@nvidia.com> Reviewed-by: NTariq Toukan <tariqt@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Saeed Mahameed 提交于
In case mlx5_pci_err_detected was called with state equals to pci_channel_io_perm_failure, the driver will never come back up. It is nice to know why the driver went to zombie land, so print some useful information on pci err handlers. Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com> Reviewed-by: NMoshe Shemesh <moshe@nvidia.com>
-
由 Dan Carpenter 提交于
This code sometimes calls mlx5_sf_hw_table_hwc_init() when "ext_base_id" is uninitialized. It's not used on that path, but it generates a static checker warning to pass uninitialized variables to another function. It may also generate runtime UBSan warnings depending on if the mlx5_sf_hw_table_hwc_init() function is inlined or not. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NLeon Romanovsky <leonro@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Christophe JAILLET 提交于
All the error handling paths of 'mlx5e_tc_add_fdb_flow()' end to 'err_out' where 'flow_flag_set(flow, FAILED);' is called. All but the new error handling paths added by the commits given in the Fixes tag below. Fix these error handling paths and branch to 'err_out'. Fixes: 166f431e ("net/mlx5e: Add indirect tc offload of ovs internal port") Fixes: b16eb3c8 ("net/mlx5: Support internal port as decap route device") Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: NRoi Dayan <roid@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Wei Yongjun 提交于
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 85c5f7c9 ("net/mlx5: E-switch, Create QoS on demand") Reported-by: NHulk Robot <hulkci@huawei.com> Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Arnd Bergmann 提交于
The mlx5e_sw_stats structure has grown to the point of triggering a warning when put on the stack of a function: mlx5/core/ipoib/ipoib.c: In function 'mlx5i_grp_sw_update_stats': mlx5/core/ipoib/ipoib.c:136:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] In this case, only five of the structure members are actually set, so it's sufficient to have those as separate local variables. As en_rep.c uses 'struct rtnl_link_stats64' for this, just use the same one here for consistency. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
由 Arnd Bergmann 提交于
When PSAMPLE is a loadable module, built-in drivers cannot use it: aarch64-linux-ld: drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.o: in function `mlx5e_tc_sample_skb': sample.c:(.text+0xd68): undefined reference to `psample_sample_packet' Add the same dependency here that is used for MLXSW Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
-
- 02 12月, 2021 24 次提交
-
-
由 Xu Wang 提交于
The 'if (dev)' statement already move into dev_{put , hold}, so remove redundant if statements. Signed-off-by: NXu Wang <vulab@iscas.ac.cn> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Florian Fainelli 提交于
Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding an id_table listing the SPI IDs for everything. Fixes: 96c8395e ("spi: Revert modalias changes") Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Horatiu Vultur 提交于
The lan966x is using the function 'packing' to create/extract the information for the IFH, that is used to be added in front of the frames when they are injected/extracted. Therefore update the Kconfig to select config option 'PACKING' whenever lan966x driver is enabled. Fixes: db8bcaad ("net: lan966x: add the basic lan966x driver") Reported-by: Nkernel test robot <lkp@intel.com> Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Prabhakar Kushwaha 提交于
Instead of printing numbers of protocol IDs and rammod commands, enhance debug prints to provide names. s_protocol_types[] and s_ramrod_cmd_ids arrays[] are added to support along with APIs. Signed-off-by: NAriel Elior <aelior@marvell.com> Signed-off-by: NAlok Prasad <palok@marvell.com> Signed-off-by: NPrabhakar Kushwaha <pkushwaha@marvell.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Horatiu Vultur 提交于
The blamed commit generates the following smatch static checker warning: drivers/net/ethernet/microchip/lan966x/lan966x_main.c:515 lan966x_xtr_irq_handler() warn: duplicate check 'sz < 0' (previous on line 502) This patch fixes this issue removing the duplicate check 'sz < 0' Fixes: d28d6d2e ("net: lan966x: add port module support") Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Sukadev Bhattiprolu 提交于
When trying to decide whether or not reuse existing rx/tx pools we tried to allow a range of values for the pool parameters rather than exact matches. This was intended to reuse the resources for instance when switching between two VIO servers with different default parameters. But this optimization is incomplete and breaks when we try to change the number of queues for instance. The optimization needs to be updated, so drop it for now and simplify the code. Fixes: bbd80930 ("ibmvnic: Reuse tx pools when possible") Reported-by: NDany Madden <drt@linux.ibm.com> Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.ibm.com> Reviewed-by: NDany Madden <drt@linux.ibm.com> Reviewed-by: NRick Lindsley <ricklind@linux.ibm.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Sukadev Bhattiprolu 提交于
When trying to decide whether or not reuse existing rx/tx pools we tried to allow a range of values for the pool parameters rather than exact matches. This was intended to reuse the resources for instance when switching between two VIO servers with different default parameters. But this optimization is incomplete and breaks when we try to change the number of queues for instance. The optimization needs to be updated, so drop it for now and simplify the code. Fixes: 489de956 ("ibmvnic: Reuse rx pools when possible") Reported-by: NDany Madden <drt@linux.ibm.com> Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.ibm.com> Reviewed-by: NDany Madden <drt@linux.ibm.com> Reviewed-by: NRick Lindsley <ricklind@linux.ibm.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Tianhao Chai 提交于
Apple M1 Mac minis (2020) with 10GE NICs do not have MAC address in the card, but instead need to obtain MAC addresses from the device tree. In this case the hardware will report an invalid MAC. Currently atlantic driver does not query the DT for MAC address and will randomly assign a MAC if the NIC doesn't have a permanent MAC burnt in. This patch causes the driver to perfer a valid MAC address from OF (if present) over HW self-reported MAC and only fall back to a random MAC address when neither of them is valid. Signed-off-by: NTianhao Chai <cth451@gmail.com> Reviewed-by: NIgor Russkikh <irusskikh@marvell.com> Reviewed-by: NHector Martin <marcan@marcan.st> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Jie Wang 提交于
Currently hns3_get_vector_ring_chain() is a bit long. Refactor it by extracting sub process to improve the readability. Signed-off-by: NJie Wang <wangjie125@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Jie Wang 提交于
Currently hclge_set_channels() is a bit long. Refactor it by extracting sub process to improve the readability. Signed-off-by: NJie Wang <wangjie125@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Jie Wang 提交于
Currently hclge_configure() is a bit long. Refactor it by extracting sub process to improve the readability. Signed-off-by: NJie Wang <wangjie125@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Jian Shen 提交于
Currently the function hclge_update_port_base_vlan_cfg() is a bit long. Split it to several small functions, to improve the readability. Signed-off-by: NJian Shen <shenjian15@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Yufeng Mo 提交于
Function hns3_nic_net_xmit() is a bit too long. So add a new function hns3_handle_skb_desc() to simplify code and improve code readability. Signed-off-by: NYufeng Mo <moyufeng@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Jian Shen 提交于
Currently the function hclge_get_fd_rule_info() is a bit long. Split it to several small functions, to improve readability. Signed-off-by: NJian Shen <shenjian15@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Jian Shen 提交于
Currently the function hclge_init_vlan_config() is a bit long. Split it to several small functions, to simplify code and improve code readability. Signed-off-by: NJian Shen <shenjian15@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Peng Li 提交于
The function hns3_fill_skb_desc is hard to read, this patch extract 2 functions and add new a struct data to simplify the code and Improve readability. Signed-off-by: NPeng Li <lipeng321@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Peng Li 提交于
As the code to update ring stats is alike for different ring stats type, this patch extract macro to simplify ring stats update code. Signed-off-by: NPeng Li <lipeng321@huawei.com> Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Zhou Qingyang 提交于
In rvu_mbox_init(), mbox_regions is not freed or passed out under the switch-default region, which could lead to a memory leak. Fix this bug by changing 'return err' to 'goto free_regions'. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_OCTEONTX2_AF=y show no new warnings, and our static analyzer no longer warns about this code. Fixes: 98c56111 (“octeontx2-af: cn10k: Add mbox support for CN10K platform”) Signed-off-by: NZhou Qingyang <zhou1615@umn.edu> Link: https://lore.kernel.org/r/20211130165039.192426-1-zhou1615@umn.eduSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Zhou Qingyang 提交于
In mlx4_en_try_alloc_resources(), mlx4_en_copy_priv() is called and tmp->tx_cq will be freed on the error path of mlx4_en_copy_priv(). After that mlx4_en_alloc_resources() is called and there is a dereference of &tmp->tx_cq[t][i] in mlx4_en_alloc_resources(), which could lead to a use after free problem on failure of mlx4_en_copy_priv(). Fix this bug by adding a check of mlx4_en_copy_priv() This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_MLX4_EN=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: ec25bc04 ("net/mlx4_en: Add resilience in low memory systems") Signed-off-by: NZhou Qingyang <zhou1615@umn.edu> Reviewed-by: NLeon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/20211130164438.190591-1-zhou1615@umn.eduSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Stephen Suryaputra 提交于
IPCB/IP6CB need to be initialized when processing outbound v4 or v6 pkts in the codepath of vrf device xmit function so that leftover garbage doesn't cause futher code that uses the CB to incorrectly process the pkt. One occasion of the issue might occur when MPLS route uses the vrf device as the outgoing device such as when the route is added using "ip -f mpls route add <label> dev <vrf>" command. The problems seems to exist since day one. Hence I put the day one commits on the Fixes tags. Fixes: 193125db ("net: Introduce VRF device driver") Fixes: 35402e31 ("net: Add IPv6 support to VRF device") Cc: stable@vger.kernel.org Signed-off-by: NStephen Suryaputra <ssuryaextr@gmail.com> Reviewed-by: NDavid Ahern <dsahern@kernel.org> Link: https://lore.kernel.org/r/20211130162637.3249-1-ssuryaextr@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Russell King 提交于
Program the 1ms autonegotiation clock divisor according to the clocking rate of neta - without this, the 1ms clock ticks at about 660us on Armada 38x configured for 250MHz. Bring this into correct specification. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Reviewed-by: NMarek Behún <kabel@kernel.org> Link: https://lore.kernel.org/r/E1ms4WD-00EKLK-Ld@rmk-PC.armlinux.org.ukSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Russell King 提交于
Tidy up the disable bit clearing where we clear a bit and then run the link resolver. Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk> Reviewed-by: NMarek Behún <kabel@kernel.org> Reviewed-by: NAndrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/E1ms4Rx-00EKEc-En@rmk-PC.armlinux.org.ukSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Russell King (Oracle) 提交于
Populate the supported interfaces and MAC capabilities for the Lantiq DSA switches and remove the old validate implementation to allow DSA to use phylink_generic_validate() for this switch driver. The exclusion of Gigabit linkmodes for MII, Reverse MII and Reduced MII links is handled within phylink_generic_validate() in phylink, so there is no need to make them conditional on the interface mode in the driver. Reviewed-by: NHauke Mehrtens <hauke@hauke-m.de> Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
由 Russell King (Oracle) 提交于
Populate the supported interfaces and MAC capabilities for the hellcreek DSA switch and remove the old validate implementation to allow DSA to use phylink_generic_validate() for this switch driver. The switch actually only supports MII and RGMII, but as phylib defaults to GMII, we need to include this interface mode to keep existing DT working. Reviewed-by: NKurt Kanzenbach <kurt@linutronix.de> Tested-by: NKurt Kanzenbach <kurt@linutronix.de> Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-