summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* can: raw: add support for SO_MARKMarc Kleine-Budde2022-12-121-0/+1
| | | | | | | | | Add support for SO_MARK to the CAN_RAW protocol. This makes it possible to add traffic control filters based on the fwmark. Link: https://lore.kernel.org/all/20221210113653.170346-1-mkl@pengutronix.de Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: m_can: Call the RAM init directly from m_can_chip_configVivek Yadav2022-12-123-15/+26
| | | | | | | | | | | | | | | When we try to access the mcan message ram addresses during the probe, hclk is gated by any other drivers or disabled, because of that probe gets failed. Move the mram init functionality to mcan chip config called by m_can_start from mcan open function, by that time clocks are enabled. Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Vivek Yadav <vivek.2311@samsung.com> Link: https://lore.kernel.org/all/20221207100632.96200-2-vivek.2311@samsung.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Merge patch series "can: usb: remove pointers to struct usb_interface in ↵Marc Kleine-Budde2022-12-122-22/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | device's priv structures" Vincent Mailhol <mailhol.vincent@wanadoo.fr> says: The gs_can and ucan drivers keep a pointer to struct usb_interface in their private structure. This is not needed. For gs_can the only use is to retrieve struct usb_device, which is already available in gs_usb::udev. For ucan, the field is set but never used. Remove the struct usb_interface fields and clean up. Link: https://lore.kernel.org/all/20221208081142.16936-1-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: gs_usb: remove gs_can::ifaceVincent Mailhol2022-12-121-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | The iface field of struct gs_can is only used to retrieve the usb_device which is already available in gs_can::udev. Replace each occurrence of interface_to_usbdev(dev->iface) with dev->udev. This done, remove gs_can::iface. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20221208081142.16936-3-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: ucan: remove unused ucan_priv::intfVincent Mailhol2022-12-121-2/+0
|/ | | | | | | | Field intf of struct ucan_priv is set but never used. Remove it. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20221208081142.16936-2-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* net: af_can: remove useless parameter 'err' in 'can_rx_register()'Ye Bin2022-12-121-2/+1
| | | | | | | | | Since commit bdfb5765e45b remove NULL-ptr checks from users of can_dev_rcv_lists_find(). 'err' parameter is useless, so remove it. Signed-off-by: Ye Bin <yebin10@huawei.com> Link: https://lore.kernel.org/all/20221208090940.3695670-1-yebin@huaweicloud.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: ucan: use strscpy() to instead of strncpy()Xu Panda2022-12-121-3/+2
| | | | | | | | | | The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Xu Panda <xu.panda@zte.com.cn> Signed-off-by: Yang Yang <yang.yang29@zte.com> Link: https://lore.kernel.org/all/202212070909095189693@zte.com.cn Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Merge patch series "can: etas_es58x: report firmware, bootloader and ↵Marc Kleine-Budde2022-12-1212-61/+372
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hardware version" Vincent Mailhol <mailhol.vincent@wanadoo.fr> says: The goal of this series is to report the firmware version, the bootloader version and the hardware revision of ETAS ES58x devices. These are already reported in the kernel log but this isn't best practice. Remove the kernel log and instead export all these through devlink. The devlink core automatically exports the firmware and the bootloader version to ethtool, so no need to implement the ethtool_ops::get_drvinfo() callback anymore. Patch one and two implement the core support for devlink (at device level) and devlink port (at the network interface level). Patch three export usb_cache_string() and patch four add a new info attribute to devlink.h. Both are prerequisites for patch five. Patch five is the actual goal: it parses the product information from a custom usb string returned by the device and expose them through devlink. Patch six removes the product information from the kernel log. Finally, patch seven add a devlink documentation page with list all the information attributes reported by the driver. * Sample outputs following this series * | $ devlink dev info | usb/1-9:1.1: | serial_number 0108954 | versions: | fixed: | board.rev B012/000 | running: | fw 04.00.01 | fw.bootloader 02.00.00 | $ devlink port show can0 | usb/1-9:1.1/0: type eth netdev can0 flavour physical port 0 splittable false | $ ethtool -i can0 | driver: etas_es58x | version: 6.1.0-rc7+ | firmware-version: 04.00.01 02.00.00 | expansion-rom-version: | bus-info: 1-9:1.1 | supports-statistics: no | supports-test: no | supports-eeprom-access: no | supports-register-dump: no | supports-priv-flags: no * Changelog * v4 -> v5: https://lore.kernel.org/all/20221130174658.29282-1-mailhol.vincent@wanadoo.fr * [PATH 2/7] add devlink port support. This extends devlink to the network interface. * thanks to devlink port, 'ethtool -i' is now able to retrieve the firmware version from devlink. No need to implement the ethtool_ops::get_drvinfo() callback anymore: remove one patch from the series. * [PATCH 4/7] A new patch to add a new info attribute for the bootloader version in devlink.h. This patch was initially sent as a standalone patch here: https://lore.kernel.org/netdev/20221129031406.3849872-1-mailhol.vincent@wanadoo.fr Merging it to this series so that it is both added and used at the same time. * [PATCH 5/7] use the newly info attribute defined in patch 4/7 to report the bootloader version instead of the custom string "bl". * [PATCH 5/7] because the series does not implement ethtool_ops::get_drvinfo() anymore, the two helper functions es58x_sw_version_is_set() and es58x_hw_revision_is_set() are only used in devlink.c. Move them from es58x_core.h to es58x_devlink.c. * [PATCH 5/7] small rework of the helper function es58x_hw_revision_is_set(): it is OK to only check the letter (if the letter is '\0', it will not be possible to print the next numbers). * [PATCH 5/7 and 6/7] add reviewed-by Andrew Lunn tag. * [PATCH 7/7] Now, 'ethtool -i' reports both the firmware version and the bootloader version (this is how the core export the information from devlink to ethtool). Update the documentation to reflect this fact. * Reoder the patches. v3 -> v4: https://lore.kernel.org/all/20221126162211.93322-1-mailhol.vincent@wanadoo.fr * major rework to use devlink instead of sysfs following Andrew's comment. * split the series in 6 patches. * [PATCH 1/6] add Acked-by: Greg Kroah-Hartman v2 -> v3: https://lore.kernel.org/all/20221113040108.68249-1-mailhol.vincent@wanadoo.fr * patch 2/3: do not spam the kernel log anymore with the product number. Instead parse the product information string, extract the firmware version, the bootloadar version and the hardware revision and export them through sysfs. * patch 2/3: rework the parsing in order not to need additional fields in struct es58x_parameters. * patch 3/3: only populate ethtool_drvinfo::fw_version because since commit edaf5df22cb8 ("ethtool: ethtool_get_drvinfo: populate drvinfo fields even if callback exits"), there is no need to populate ethtool_drvinfo::driver and ethtool_drvinfo::bus_info in the driver. v1 -> v2: https://lore.kernel.org/all/20221104171604.24052-1-mailhol.vincent@wanadoo.fr * was a single patch. It is now a series of three patches. * add a first new patch to export usb_cache_string(). * add a second new patch to apply usb_cache_string() to existing code. * add missing check on product info string to prevent a buffer overflow. * add comma on the last entry of struct es58x_parameters. v1: https://lore.kernel.org/all/20221104073659.414147-1-mailhol.vincent@wanadoo.fr Link: https://lore.kernel.org/all/20221130174658.29282-1-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * Documentation: devlink: add devlink documentation for the etas_es58x driverVincent Mailhol2022-12-122-0/+37
| | | | | | | | | | | | | | | | | | | | List all the version information reported by the etas_es58x driver through devlink. Also, update MAINTAINERS with the newly created file. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20221130174658.29282-8-mailhol.vincent@wanadoo.fr [mkl: fixed version information table: "bl" -> "fw.bootloader" Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: etas_es58x: remove es58x_get_product_info()Vincent Mailhol2022-12-121-49/+3
| | | | | | | | | | | | | | | | | | | | Now that the product information are available under devlink, no more need to print them in the kernel log. Remove es58x_get_product_info(). Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/all/20221130174658.29282-7-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: etas_es58x: export product information through devlink_ops::info_get()Vincent Mailhol2022-12-123-0/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ES58x devices report below product information through a custom usb string: * the firmware version * the bootloader version * the hardware revision Parse this string, store the results in struct es58x_dev, export: * the firmware version through devlink's "fw" name * the bootloader version through devlink's "fw.bootloader" name * the hardware revisionthrough devlink's "board.rev" name Those devlink entries are not critical to use the device, if parsing fails, print an informative log message and continue to probe the device. In addition to that, use usb_device::serial to report the device serial number. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/all/20221130174658.29282-6-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * net: devlink: add DEVLINK_INFO_VERSION_GENERIC_FW_BOOTLOADERVincent Mailhol2022-12-122-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in [1], abbreviating the bootloader to "bl" might not be well understood. Instead, a bootloader technically being a firmware, name it "fw.bootloader". Add a new macro to devlink.h to formalize this new info attribute name and update the documentation. [1] https://lore.kernel.org/netdev/20221128142723.2f826d20@kernel.org/ Suggested-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20221130174658.29282-5-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * USB: core: export usb_cache_string()Vincent Mailhol2022-12-123-1/+2
| | | | | | | | | | | | | | | | | | usb_cache_string() can also be useful for the drivers so export it. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/all/20221130174658.29282-4-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: etas_es58x: add devlink port supportVincent Mailhol2022-12-122-8/+29
| | | | | | | | | | | | | | | | | | | | | | Add support for devlink port which extends the devlink support to the network interface level. For now, the etas_es58x driver will only rely on the default features that devlink port has to offer and not implement additional feature ones. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20221130174658.29282-3-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: etas_es58x: add devlink supportVincent Mailhol2022-12-125-4/+31
|/ | | | | | | | | Add basic support for devlink at the device level. The callbacks of struct devlink_ops will be implemented next. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20221130174658.29282-2-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: c_can: use devm_platform_get_and_ioremap_resource()Minghao Chi2022-12-121-2/+1
| | | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/all/202211111443005202576@zte.com.cn Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* dt-bindings: can: renesas,rcar-canfd: Document RZ/Five SoCLad Prabhakar2022-12-121-1/+1
| | | | | | | | | | | | | | | | The CANFD block on the RZ/Five SoC is identical to one found on the RZ/G2UL SoC. "renesas,r9a07g043-canfd" compatible string will be used on the RZ/Five SoC so to make this clear, update the comment to include RZ/Five SoC. No driver changes are required as generic compatible string "renesas,rzg2l-canfd" will be used as a fallback on RZ/Five SoC. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Rob Herring <robh@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/20221115123811.1182922-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* dt-bindings: can: fsl,flexcan: add imx93 compatibleHaibo Chen2022-12-121-0/+1
| | | | | | | | | Add a new compatible string for imx93. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/all/1669116752-4260-2-git-send-email-haibo.chen@nxp.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: flexcan: add auto stop mode for IMX93 to support wakeupHaibo Chen2022-12-122-3/+36
| | | | | | | | | | | | | | | | IMX93 do not contain a GPR to config the stop mode, it will set the flexcan into stop mode automatically once the ARM core go into low power mode (WFI instruct) and gate off the flexcan related clock automatically. But to let these logic work as expect, before ARM core go into low power mode, need to make sure the flexcan related clock keep on. To support stop mode and wakeup feature on imx93, this patch add a new fsl_imx93_devtype_data to separate from imx8mp. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Link: https://lore.kernel.org/all/1669116752-4260-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: etas_es58x: sort the includes by alphabetic orderVincent Mailhol2022-12-124-11/+11
| | | | | | | | | | Follow the best practices, reorder the includes. While doing so, bump up copyright year of each modified files. Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20221126160525.87036-1-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: ctucanfd: Drop obsolete dependency on COMPILE_TESTJean Delvare2022-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it is possible to test-build any driver which depends on OF on any architecture by explicitly selecting OF. Therefore depending on COMPILE_TEST as an alternative is no longer needed. It is actually better to always build such drivers with OF enabled, so that the test builds are closer to how each driver will actually be built on its intended target. Building them without OF may not test much as the compiler will optimize out potentially large parts of the code. In the worst case, this could even pop false positive warnings. Dropping COMPILE_TEST here improves the quality of our testing and avoids wasting time on non-existent issues. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Pavel Pisa <pisa@cmp.felk.cvut.cz> Cc: Ondrej Ille <ondrej.ille@gmail.com> Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz> Link: https://lore.kernel.org/all/20221124141604.4265225f@endymion.delvare Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Merge patch series "R-Car CAN FD driver enhancements"Marc Kleine-Budde2022-12-121-34/+51
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Biju Das <biju.das.jz@bp.renesas.com> says: The CAN FD IP found on RZ/G2L SoC has some HW features different to that of R-Car. For example, it has multiple resets, dedicated channel tx and error interrupts, separate global rx and error interrupts compared to shared irq for R-Car. it does not s ECC error flag registers and clk post divider present on R-Car. Similarly, R-Car V3U has 8 channels whereas other SoCs has only 2 channels. Currently all the HW differences are handled by comparing with chip_id enum. This patch series aims to replace chip_id with struct rcar_canfd_hw_info to handle the HW feature differences and driver data present on both IPs. The changes are trivial and tested on RZ/G2L SMARC EVK. This patch series depend upon [1]. [1] https://lore.kernel.org/all/20221025155657.1426948-1-biju.das.jz@bp.renesas.com changes since v2: https://lore.kernel.org/all/20221026131732.1843105-1-biju.das.jz@bp.renesas.com * Replaced data type of max_channels from unsigned int->u8 to save memory. * Replaced data type of postdiv from unsigned int->u8 to save memory. changes since v1: https://lore.kernel.org/all/20221022104357.1276740-1-biju.das.jz@bp.renesas.com * Updated commit description for R-Car V3U SoC detection using driver data. * Replaced data type of max_channels from u32->unsigned int. * Replaced multi_global_irqs->shared_global_irqs to make it positive checks. * Replaced clk_postdiv->postdiv driver data variable. * Simplified the calcualtion for fcan_freq. * Replaced info->has_gerfl to gpriv->info->has_gerfl and wrapped the ECC error flag checks inside a single if statement. * Added Rb tag from Geert patch#1,#2,#3 and #5 Link: https://lore.kernel.org/all/20221027082158.95895-1-biju.das.jz@bp.renesas.com [mkl: only take patches 1...5 to avoid merge conflict] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: rcar_canfd: Add multi_channel_irqs to struct rcar_canfd_hw_infoBiju Das2022-12-101-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RZ/G2L has separate IRQ lines for tx and error interrupt for each channel whereas R-Car has a combined IRQ line for all the channel specific tx and error interrupts. Add multi_channel_irqs to struct rcar_canfd_hw_info to select the driver to choose between combined and separate irq registration for channel interrupts. This patch also removes enum rcanfd_chip_id and chip_id from both struct rcar_canfd_hw_info, as it is unused. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/20221027082158.95895-6-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: rcar_canfd: Add postdiv to struct rcar_canfd_hw_infoBiju Das2022-12-101-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | R-Car has a clock divider for CAN FD clock within the IP, whereas it is not available on RZ/G2L. Add postdiv variable to struct rcar_canfd_hw_info to take care of this difference. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/20221027082158.95895-5-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: rcar_canfd: Add shared_global_irqs to struct rcar_canfd_hw_infoBiju Das2022-12-101-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RZ/G2L has separate IRQ lines for receive FIFO and global error interrupt whereas R-Car has shared IRQ line. Add shared_global_irqs to struct rcar_canfd_hw_info to select the driver to choose between shared and separate irq registration for global interrupts. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/20221027082158.95895-4-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: rcar_canfd: Add max_channels to struct rcar_canfd_hw_infoBiju Das2022-12-101-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | R-Car V3U supports a maximum of 8 channels whereas rest of the SoCs support 2 channels. Add max_channels variable to struct rcar_canfd_hw_info to handle this difference. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/20221027082158.95895-3-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: rcar_canfd: rcar_canfd_probe: Add struct rcar_canfd_hw_info to driver dataBiju Das2022-12-101-13/+30
|/ | | | | | | | | | | | | | | | | | | | | The CAN FD IP found on RZ/G2L SoC has some HW features different to that of R-Car. For example, it has multiple resets and multiple IRQs for global and channel interrupts. Also, it does not have ECC error flag registers and clk post divider present on R-Car. Similarly, R-Car V3U has 8 channels whereas other SoCs has only 2 channels. This patch adds the struct rcar_canfd_hw_info to take care of the HW feature differences and driver data present on both IPs. It also replaces the driver data chip type with struct rcar_canfd_hw_info by moving chip type to it. Whilst started using driver data instead of chip_id for detecting R-Car V3U SoCs. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/all/20221027082158.95895-2-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: m_can: sort header inclusion alphabeticallyVivek Yadav2022-12-103-13/+13
| | | | | | | | | Sort header inclusion alphabetically. Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Vivek Yadav <vivek.2311@samsung.com> Link: https://lore.kernel.org/all/20221104051617.21173-1-vivek.2311@samsung.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: kvaser_usb: kvaser_usb_set_{,data}bittiming(): remove empty lines in ↵Marc Kleine-Budde2022-12-101-2/+0
| | | | | | | | | | | | variable declaration Fix coding style by removing empty lines in variable declaration. Fixes: 39d3df6b0ea8 ("can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming") Cc: Jimmy Assarsson <extja@kvaser.com> Cc: Anssi Hannula <anssi.hannula@bitwise.fi> Link: https://lore.kernel.org/all/20221031114513.81214-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* can: kvaser_usb: kvaser_usb_set_bittiming(): fix redundant initialization ↵Marc Kleine-Budde2022-12-101-1/+1
| | | | | | | | | | | | | | warning for err The variable err is initialized, but the initialized value is Overwritten before it is read. Fix the warning by not initializing the variable err at all. Fixes: 39d3df6b0ea8 ("can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming") Cc: Jimmy Assarsson <extja@kvaser.com> Cc: Anssi Hannula <anssi.hannula@bitwise.fi> Link: https://lore.kernel.org/all/20221031114513.81214-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* Merge tag 'ipsec-next-2022-12-09' of ↵Jakub Kicinski2022-12-1030-512/+2141
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next Steffen Klassert says: ==================== ipsec-next 2022-12-09 1) Add xfrm packet offload core API. From Leon Romanovsky. 2) Add xfrm packet offload support for mlx5. From Leon Romanovsky and Raed Salem. 3) Fix a typto in a error message. From Colin Ian King. * tag 'ipsec-next-2022-12-09' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next: (38 commits) xfrm: Fix spelling mistake "oflload" -> "offload" net/mlx5e: Open mlx5 driver to accept IPsec packet offload net/mlx5e: Handle ESN update events net/mlx5e: Handle hardware IPsec limits events net/mlx5e: Update IPsec soft and hard limits net/mlx5e: Store all XFRM SAs in Xarray net/mlx5e: Provide intermediate pointer to access IPsec struct net/mlx5e: Skip IPsec encryption for TX path without matching policy net/mlx5e: Add statistics for Rx/Tx IPsec offloaded flows net/mlx5e: Improve IPsec flow steering autogroup net/mlx5e: Configure IPsec packet offload flow steering net/mlx5e: Use same coding pattern for Rx and Tx flows net/mlx5e: Add XFRM policy offload logic net/mlx5e: Create IPsec policy offload tables net/mlx5e: Generalize creation of default IPsec miss group and rule net/mlx5e: Group IPsec miss handles into separate struct net/mlx5e: Make clear what IPsec rx_err does net/mlx5e: Flatten the IPsec RX add rule path net/mlx5e: Refactor FTE setup code to be more clear net/mlx5e: Move IPsec flow table creation to separate function ... ==================== Link: https://lore.kernel.org/r/20221209093310.4018731-1-steffen.klassert@secunet.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| * xfrm: Fix spelling mistake "oflload" -> "offload"Colin Ian King2022-12-091-1/+1
| | | | | | | | | | | | | | There is a spelling mistake in a NL_SET_ERR_MSG message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| * Merge branch 'mlx5 IPsec packet offload support (Part II)'Steffen Klassert2022-12-0912-118/+1047
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Leon Romanovsky says: ============ This is second part with implementation of packet offload. ============ Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Open mlx5 driver to accept IPsec packet offloadLeon Romanovsky2022-12-081-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable configuration of IPsec packet offload through XFRM state add interface together with moving specific to IPsec packet mode limitations to specific switch-case section. Reviewed-by: Raed Salem <raeds@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Handle ESN update eventsLeon Romanovsky2022-12-083-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | Extend event logic to update ESN state (esn_msb, esn_overlap) for an IPsec Offload context. Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Handle hardware IPsec limits eventsLeon Romanovsky2022-12-084-5/+118
| | | | | | | | | | | | | | | | | | | | | | | | Enable object changed event to signal IPsec about hitting soft and hard limits. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Update IPsec soft and hard limitsLeon Romanovsky2022-12-084-0/+127
| | | | | | | | | | | | | | | | | | | | | Implement mlx5 IPsec callback to update current lifetime counters. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Store all XFRM SAs in XarrayLeon Romanovsky2022-12-083-74/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of performing custom hash calculations, rely on FW that returns unique identifier to every created SA. That identifier is Xarray ready, which provides better semantic with efficient access. In addition, store both TX and RX SAs to allow correlation between event generated by HW when limits are armed and XFRM states. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Provide intermediate pointer to access IPsec structLeon Romanovsky2022-12-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Improve readability by providing direct pointer to struct mlx5e_ipsec. Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Skip IPsec encryption for TX path without matching policyLeon Romanovsky2022-12-083-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Software implementation of IPsec skips encryption of packets in TX path if no matching policy is found. So align HW implementation to this behavior, by requiring matching reqid for offloaded policy and SA. Reviewed-by: Raed Salem <raeds@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Add statistics for Rx/Tx IPsec offloaded flowsRaed Salem2022-12-085-24/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the following statistics: RX successfully IPsec flows: ipsec_rx_pkts : Number of packets passed Rx IPsec flow ipsec_rx_bytes : Number of bytes passed Rx IPsec flow Rx dropped IPsec policy packets: ipsec_rx_drop_pkts: Number of packets dropped in Rx datapath due to IPsec drop policy ipsec_rx_drop_bytes: Number of bytes dropped in Rx datapath due to IPsec drop policy TX successfully encrypted and encapsulated IPsec packets: ipsec_tx_pkts : Number of packets encrypted and encapsulated successfully ipsec_tx_bytes : Number of bytes encrypted and encapsulated successfully Tx dropped IPsec policy packets: ipsec_tx_drop_pkts: Number of packets dropped in Tx datapath due to IPsec drop policy ipsec_tx_drop_bytes: Number of bytes dropped in Tx datapath due to IPsec drop policy The above can be seen using: ethtool -S <ifc> |grep ipsec Signed-off-by: Raed Salem <raeds@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Improve IPsec flow steering autogroupLeon Romanovsky2022-12-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flow steering API separates newly created rules based on their match criteria. Right now, all IPsec tables are created with one group and suffers from not-optimal FS performance. Count number of different match criteria for relevant tables, and set proper value at the table creation. Reviewed-by: Raed Salem <raeds@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Configure IPsec packet offload flow steeringLeon Romanovsky2022-12-083-10/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In packet offload mode, the HW is responsible to handle ESP headers, SPI numbers and trailers (ICV) together with different logic for RX and TX paths. In order to support packet offload mode, special logic is added to flow steering rules. Reviewed-by: Raed Salem <raeds@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Use same coding pattern for Rx and Tx flowsLeon Romanovsky2022-12-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove intermediate variable in favor of having similar coding style for Rx and Tx add rule functions. Reviewed-by: Raed Salem <raeds@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Add XFRM policy offload logicLeon Romanovsky2022-12-083-1/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement mlx5 flow steering logic and mlx5 IPsec code support XFRM policy offload. Reviewed-by: Raed Salem <raeds@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Create IPsec policy offload tablesLeon Romanovsky2022-12-083-6/+56
| |/ | | | | | | | | | | | | Add empty table to be used for IPsec policy offload. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| * Merge branch 'mlx5 IPsec packet offload support (Part I)'Steffen Klassert2022-12-089-356/+543
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Leon Romanovsky says: ============ This series follows previously sent "Extend XFRM core to allow packet offload configuration" series [1]. It is first part with refactoring to mlx5 allow us natively extend mlx5 IPsec logic to support both crypto and packet offloads. ============ Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Generalize creation of default IPsec miss group and ruleLeon Romanovsky2022-12-061-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create general function that sets miss group and rule to forward all not-matched traffic to the next table. Reviewed-by: Raed Salem <raeds@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Group IPsec miss handles into separate structLeon Romanovsky2022-12-061-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move miss handles into dedicated struct, so we can reuse it in next patch when creating IPsec policy flow table. Reviewed-by: Raed Salem <raeds@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
| | * net/mlx5e: Make clear what IPsec rx_err doesLeon Romanovsky2022-12-061-22/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reuse existing struct what holds all information about modify header pointer and rule. This helps to reduce ambiguity from the name _err_ that doesn't describe the real purpose of that flow table, rule and function - to copy status result from HW to the stack. Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>