- 19 1月, 2023 3 次提交
-
-
由 Pavithra Sathyanarayanan 提交于
Add fixed_phy support at 1Gbps full duplex for the lan7431 device if a phy not found over MDIO. Tested with a MAC to MAC connection from LAN7431 to a KSZ9893 switch. This avoids the Driver open error in LAN743x. TX delay and internal CLK125 generation is already enabled in EEPROM. Signed-off-by: NPavithra Sathyanarayanan <Pavithra.Sathyanarayanan@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Pavithra Sathyanarayanan 提交于
Add logic to read the Phy interface from MAC_CR register for LAN743x driver. Checks for the LAN7430/31 or pci11x1x devices and the adapter interface is updated accordingly. For LAN7431, adapter interface is set based on Bit 19 of MAC_CR register as MII or RGMII which removes the forced RGMII/GMII configurations in lan743x_phy_open(). Signed-off-by: NPavithra Sathyanarayanan <Pavithra.Sathyanarayanan@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Pavithra Sathyanarayanan 提交于
Remove the MII/RGMII Selection settings in driver as it is preset by the EEPROM and has the required configurations before the driver loads for LAN743x. Signed-off-by: NPavithra Sathyanarayanan <Pavithra.Sathyanarayanan@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
- 18 1月, 2023 5 次提交
-
-
由 Steen Hegelund 提交于
Ensure that the KUNIT tests lock instance is initialized before the test is executed. Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
This improves the VCAP cache and the VCAP rule list protection against access from different sources. Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
This ensures that the admin lock is taken before the debugFS functions starts iterating the VCAP rules. It also adds a separate function to decode a rule, which expects the lock to have been taken before it is called. Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
Add a new function that just checks if the VCAP rule id is already used by an existing rule. Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
This adds support for TC clients to get the packet count for a TC filter identified by its cookie. Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 16 1月, 2023 8 次提交
-
-
由 Steen Hegelund 提交于
This supports that individual rules are enabled and disabled via chain information. This is done by keeping disabled rules in the VCAP list (cached) until they are enabled, and only at this time are the rules written to the VCAP HW. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
This allows a VCAP rule to be in one of 3 states: - permanently stored in the VCAP HW (for rules that must always be present) - enabled (stored in HW) when the corresponding lookup has been enabled - disabled (stored in SW) when the lookup is disabled This way important VCAP rules can be added even before the user enables the VCAP lookups using a TC matchall filter. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
This changes the way the chain information verified when adding a new tc flower filter. When adding a flower filter it is now checked that the filter contains a goto action to one of the IS2 VCAP lookups, except for the last lookup which may omit this goto action. It is also checked if you attempt to add multiple matchall filters to enable the same VCAP lookup. This will be rejected. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
This adds both the source and destination chain id to the information kept for enabled port lookups. This allows enabling and disabling a chain of lookups by walking the chain information for a port. This changes the way that VCAP lookups are enabled from userspace: instead of one matchall rule that enables all the 4 Sparx5 IS2 lookups, you need a matchall rule per lookup. In practice that is done by adding one matchall rule in chain 0 to goto IS2 Lookup 0, and then for each lookup you add a rule per lookup (low priority) that does a goto to the next lookup chain. Examples: If you want IS2 Lookup 0 to be enabled you add the same matchall filter as before: tc filter add dev eth12 ingress chain 0 prio 1000 handle 1000 matchall \ skip_sw action goto chain 8000000 If you also want to enable lookup 1 to 3 in IS2 and chain them you need to add the following matchall filters: tc filter add dev eth12 ingress chain 8000000 prio 1000 handle 1000 \ matchall skip_sw action goto chain 8100000 tc filter add dev eth12 ingress chain 8100000 prio 1000 handle 1000 \ matchall skip_sw action goto chain 8200000 tc filter add dev eth12 ingress chain 8200000 prio 1000 handle 1000 \ matchall skip_sw action goto chain 8300000 Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net> -
由 Steen Hegelund 提交于
The conversion to the platform specific multi-word format is moved from the key/action add functions to the encoding key/action. This allows rules that are disabled (not in VCAP HW) to use the same format for keys/actions as rules that have just been read from VCAP HW. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
This changes the VCAP lookups state to always be enabled so that it is possible to add "internal" VCAP rules that must be available even though the user has not yet enabled the VCAP chains via a TC matchall filter. The API callback to enable and disable VCAP lookups is therefore removed. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
When a rule counter is external to the VCAP such as the Sparx5 IS2 counters are, then this counter must be reset when a new rule is created. Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Steen Hegelund 提交于
For consistency the VCAP cache area is erased just before the new rule is being encoded. Signed-off-by: NSteen Hegelund <steen.hegelund@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 14 1月, 2023 1 次提交
-
-
由 Andrew Lunn 提交于
The microchip lan743x MDIO bus driver can perform both C22 and C45 transfers in some variants. Create separate functions for each and register the C45 versions using the new API calls where appropriate. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NMichael Walle <michael@walle.cc> Signed-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 11 1月, 2023 1 次提交
-
-
由 Clément Léger 提交于
If ptp was not enabled due to missing IRQ for instance, lan966x_ptp_deinit() will dereference NULL pointers. Fixes: d0964594 ("net: lan966x: Add support for ptp clocks") Signed-off-by: NClément Léger <clement.leger@bootlin.com> Reviewed-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: NJiri Pirko <jiri@nvidia.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 09 1月, 2023 1 次提交
-
-
由 Horatiu Vultur 提交于
The blamed commit implemented the vcap_operations to allow to add an entry in the TCAM. One of the callbacks is to validate the supported keysets. If the TCAM lookup was not enabled, then this will return failure so no entries could be added. This doesn't make much sense, as you can enable at a later point the TCAM. Therefore change it such to allow entries in TCAM even it is not enabled. Fixes: 4426b78c ("net: lan966x: Add port keyset config and callback interface") Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 02 1月, 2023 1 次提交
-
-
由 Horatiu Vultur 提交于
There is an issue with the checking of the return value of 'of_get_mac_address', which returns 0 on success and negative value on failure. The driver interpretated the result the opposite way. Therefore if there was a MAC address defined in the DT, then the driver was generating a random MAC address otherwise it would use address 0. Fix this by checking correctly the return value of 'of_get_mac_address' Fixes: b74ef9f9 ("net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe()") Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 22 12月, 2022 1 次提交
-
-
由 Horatiu Vultur 提交于
When the PCS was taken out of reset, we were changing by mistake also the speed to 100 Mbit. But in case the link was going down, the link up routine was setting correctly the link speed. If the link was not getting down then the speed was forced to run at 100 even if the speed was something else. On lan966x, to set the speed link to 1G or 2.5G a value of 1 needs to be written in DEV_CLOCK_CFG_LINK_SPEED. This is similar to the procedure in lan966x_port_init. The issue was reproduced using 1000base-x sfp module using the commands: ip link set dev eth2 up ip link addr add 10.97.10.2/24 dev eth2 ethtool -s eth2 speed 1000 autoneg off Fixes: d28d6d2e ("net: lan966x: add port module support") Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: NPiotr Raczynski <piotr.raczynski@intel.com> Link: https://lore.kernel.org/r/20221221093315.939133-1-horatiu.vultur@microchip.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
-
- 19 12月, 2022 1 次提交
-
-
由 Horatiu Vultur 提交于
Fix the following smatch warning: smatch warnings: drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:103 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'value'. drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:106 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'mask'. In case the vcap field was VCAP_FIELD_U128 and the key was different than IP6_S/DIP then the value and mask were not initialized, therefore initialize them. Fixes: 610c32b2 ("net: microchip: vcap: Add vcap_get_rule") Reported-by: Nkernel test robot <lkp@intel.com> Reported-by: NDan Carpenter <error27@gmail.com> Reviewed-by: NSaeed Mahameed <saeed@kernel.org> Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: NMichal Swiatkowski <michal.swiatkowski@linux.intel.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 13 12月, 2022 1 次提交
-
-
由 Christophe JAILLET 提交于
vcap_alloc_rule() can't return NULL. So remove some dead-code Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/27992ffcee47fc865ce87274d6dfcffe7a1e69e0.1670873784.git.christophe.jaillet@wanadoo.frSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 07 12月, 2022 1 次提交
-
-
由 zhang songyi 提交于
Semicolons after "}" are not needed. Signed-off-by: Nzhang songyi <zhang.songyi@zte.com.cn> Reviewed-by: NJiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/202212051422158113766@zte.com.cnSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 06 12月, 2022 5 次提交
-
-
由 Horatiu Vultur 提交于
Currently lan966x, doesn't allow to run PTP over interfaces that are part of the bridge. The reason is when the lan966x was receiving a PTP frame (regardless if L2/IPv4/IPv6) the HW it would flood this frame. Now that it is possible to add VCAP rules to the HW, such to trap these frames to the CPU, it is possible to run PTP also over interfaces that are part of the bridge. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Add the function vcap_rule_get_key_u32 which allows to get the value and the mask of a key that exist on the rule. If the key doesn't exist, it would return error. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Add the function vcap_mod_rule which allows to update an existing rule in the vcap. It is required for the rule to exist in the vcap to be able to modify it. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Add function vcap_get_rule which returns a rule based on the internal rule id. The entire functionality of reading and decoding the rule from the VCAP was inside vcap_api_debugfs file. So move the entire implementation in vcap_api as this is used also by vcap_get_rule. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Qiheng Lin 提交于
The mchp_sparx5_probe() won't destroy workqueue created by create_singlethread_workqueue() in sparx5_start() when later inits failed. Add destroy_workqueue in the cleanup_ports case, also add it in mchp_sparx5_remove() Fixes: b37a1bae ("net: sparx5: add mactable support") Signed-off-by: NQiheng Lin <linqiheng@huawei.com> Link: https://lore.kernel.org/r/20221203070259.19560-1-linqiheng@huawei.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
-
- 05 12月, 2022 3 次提交
-
-
由 Casper Andersson 提交于
consume_skb on transmitted, kfree_skb on dropped, do not free on TX_BUSY. Previously the xmit function could return -EBUSY without freeing, which supposedly is interpreted as a drop. And was using kfree on successfully transmitted packets. sparx5_fdma_xmit and sparx5_inject returns error code, where -EBUSY indicates TX_BUSY and any other error code indicates dropped. Fixes: f3cad261 ("net: sparx5: add hostmode with phylink support") Signed-off-by: NCasper Andersson <casper.casan@gmail.com> Reviewed-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Valentina Goncharenko 提交于
A loop for reading MISTAT register continues while regmap_read() fails and (mistat & BUSY), but if regmap_read() fails a value of mistat is undefined. The patch proposes to check for BUSY flag only when regmap_read() succeed. Compile test only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d70e5326 ("net: Microchip encx24j600 driver") Signed-off-by: NValentina Goncharenko <goncharenko.vp@ispras.ru> Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
由 Valentina Goncharenko 提交于
In functions regmap_encx24j600_phy_reg_read() and regmap_encx24j600_phy_reg_write() in the conditions of the waiting cycles for filling the variable 'ret' it is necessary to add parentheses to prevent wrong assignment due to logical operations precedence. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d70e5326 ("net: Microchip encx24j600 driver") Signed-off-by: NValentina Goncharenko <goncharenko.vp@ispras.ru> Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 01 12月, 2022 2 次提交
-
-
由 Dan Carpenter 提交于
If vcap_dup_rule() fails that leads to an error pointer dereference side the call to vcap_free_rule(). Also it only returns an error if the very last call to vcap_read_rule() fails and it returns success for other errors. I've changed it to just stop printing after the first error and return an error code. Fixes: 3a792156 ("net: microchip: sparx5: Add VCAP rule debugFS support for the VCAP API") Signed-off-by: NDan Carpenter <error27@gmail.com> Reviewed-by: NSteen Hegelund <Steen.Hegelund@microchip.com> Link: https://lore.kernel.org/r/Y4XUUx9kzurBN+BV@kiliSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Currently whenever a new rule id is generated, it picks up the next number bigger than previous id. So it would always be 1, 2, 3, etc. When the rule with id 1 will be deleted and a new rule will be added, it will have the id 4 and not id 1. In theory this can be a problem if at some point a rule will be added and removed ~0 times. Then no more rules can be added because there are no more ids. Change this such that when a new rule is added, search for an empty rule id starting with value of 1 as value 0 is reserved. Fixes: c9da1ac1 ("net: microchip: sparx5: Adding initial tc flower support for VCAP API") Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Link: https://lore.kernel.org/r/20221128142959.8325-1-horatiu.vultur@microchip.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
-
- 29 11月, 2022 6 次提交
-
-
由 Horatiu Vultur 提交于
On lan966x the layout of the vcap memory is different than on sparx5. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Implement vcap_operations and enable default port keyset configuration for each port. Now it is possible actually write/read/move entries in the VCAP. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Extend matchall with action goto. This is needed to enable the lookup in the VCAP. It is needed to connect chain 0 to a chain that is recognized by the HW. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Currently the only supported action is ACTION_TRAP and the only dissector is ETH_ADDRS. Others will be added in future patches. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
Add registers used to access vcap controller. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-
由 Horatiu Vultur 提交于
This provides the lan966x is2 model and adds it to the vcap control instance that will be provided to the vcap API. Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
-