aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-10net: phy: qcom: move more function to shared libraryChristian Marangi4-240/+244
Move more function to shared library in preparation for introduction of new PHY Family qca807x that will make use of both functions from at803x and qca808x as it's a transition PHY with some implementation of at803x and some from the new qca808x. Signed-off-by: Christian Marangi <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-10net: phy: add devm/of_phy_package_join helperChristian Marangi2-0/+102
Add devm/of_phy_package_join helper to join PHYs in a PHY package. These are variant of the manual phy_package_join with the difference that these will use DT nodes to derive the base_addr instead of manually passing an hardcoded value. An additional value is added in phy_package_shared, "np" to reference the PHY package node pointer in specific PHY driver probe_once and config_init_once functions to make use of additional specific properties defined in the PHY package node in DT. The np value is filled only with of_phy_package_join if a valid PHY package node is found. A valid PHY package node must have the node name set to "ethernet-phy-package". Signed-off-by: Christian Marangi <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-10net: phy: add support for scanning PHY in PHY packages nodesChristian Marangi2-31/+92
Add support for scanning PHY in PHY package nodes. PHY packages nodes are just container for actual PHY on the MDIO bus. Their PHY address defined in the PHY package node are absolute and reflect the address on the MDIO bus. mdio_bus.c and of_mdio.c is updated to now support and parse also PHY package subnode by checking if the node name match "ethernet-phy-package". As PHY package reg is mandatory and each PHY in the PHY package must have a reg, every invalid PHY Package node is ignored and will be skipped by the autoscan fallback. Signed-off-by: Christian Marangi <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-10dt-bindings: net: document ethernet PHY package nodesChristian Marangi1-0/+52
Document ethernet PHY package nodes used to describe PHY shipped in bundle of 2-5 PHY. The special node describe a container of PHY that share common properties. This is a generic schema and PHY package should create specialized version with the required additional shared properties. Example are PHY packages that have some regs only in one PHY of the package and will affect every other PHY in the package, for example related to PHY interface mode calibration or global PHY mode selection. The PHY package node MUST declare the base address used by the PHY driver for global configuration by calculating the offsets of the global PHY based on the base address of the PHY package. Each reg of the PHYs defined in the PHY package node is absolute and describe the real address of the Ethernet PHY on the bus. Signed-off-by: Christian Marangi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: phy: realtek: use generic MDIO helpers to simplify the codeHeiner Kallweit1-17/+3
Use generic MDIO helpers to simplify the code. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09Merge branch '1GbE' of ↵Jakub Kicinski3-13/+14
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== igc: ethtool: Flex filter cleanup Kurt Kanzenbach says: This series contains some cosmetics for the flex filter code. The fixes have been merged separately via -net already. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: igc: Unify filtering rule fields igc: Use netdev printing functions for flex filters igc: Use reverse xmas tree ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09selftests: udpgso: Pull up network setup into shell scriptJakub Sitnicki2-136/+47
udpgso regression test configures routing and device MTU directly through uAPI (Netlink, ioctl) to do its job. While there is nothing wrong with it, it takes more effort than doing it from shell. Looking forward, we would like to extend the udpgso regression tests to cover the EIO corner case [1], once it gets addressed. That will require a dummy device and device feature manipulation to set it up. Which means more Netlink code. So, in preparation, pull out network configuration into the shell script part of the test, so it is easily extendable in the future. Also, because it now easy to setup routing, add a second local IPv6 address. Because the second address is not managed by the kernel, we can "replace" the corresponding local route with a reduced-MTU one. This unblocks the disabled "ipv6 connected" test case. Add a similar setup for IPv4 for symmetry. [1] https://lore.kernel.org/netdev/[email protected]/ Reviewed-by: Willem de Bruijn <[email protected]> Signed-off-by: Jakub Sitnicki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09net: atlantic: convert EEE handling to use linkmode bitmapsHeiner Kallweit1-12/+9
Convert EEE handling to use linkmode bitmaps. This prepares for removing the legacy bitmaps from struct ethtool_keee. No functional change intended. Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Heiner Kallweit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnx2x: convert EEE handling to use linkmode bitmapsHeiner Kallweit1-23/+21
Convert EEE handling to use linkmode bitmaps. This prepares for removing the legacy bitmaps from struct ethtool_keee. No functional change intended. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09r8169: improve checking for valid LED modesHeiner Kallweit1-18/+20
After 3a2746320403 ("leds: trigger: netdev: Display only supported link speed attribute") the check for valid link modes can be simplified. In addition factor it out, so that it can be re-used by the upcoming LED support for RTL8125. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09selftests: net: include forwarding libPaolo Abeni1-0/+2
The altnames test uses the forwarding/lib.sh and that dependency currently causes failures when running the test after install: make -C tools/testing/selftests/ TARGETS=net install ./tools/testing/selftests/kselftest_install/run_kselftest.sh \ -t net:altnames.sh # ... # ./altnames.sh: line 8: ./forwarding/lib.sh: No such file or directory # RTNETLINK answers: Operation not permitted # ./altnames.sh: line 73: tests_run: command not found # ./altnames.sh: line 65: pre_cleanup: command not found Address the issue leveraging the TEST_INCLUDES infrastructure provided by commit 2a0683be5b4c ("selftests: Introduce Makefile variable to list shared bash scripts") Signed-off-by: Paolo Abeni <[email protected]> Link: https://lore.kernel.org/r/f7b1e9d468224cbc136d304362315499fe39848f.1707298927.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09Merge branch 'bnxt_en-ntuple-and-rss-updates'Jakub Kicinski4-210/+579
Michael Chan says: ==================== bnxt_en: Ntuple and RSS updates This patch series adds more ntuple and RSS features following recent patches to add support for user configured ntuple filters. Additional features include L2 ether filters, partial tuple masks, IP filters besides TCP/UDP, drop action, saving and re-applying user filters after driver reset, user configured RSS key, and RSS for IPSEC. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Add RSS support for IPSEC headersAjit Khaparde3-4/+49
IPSec uses two distinct protocols, Authentication Header (AH) and Encapsulating Security Payload (ESP). Add support to configure RSS based on AH and ESP headers. This functionality will be enabled based on the capabilities indicated by the firmware in HWRM_VNIC_QCAPS. Signed-off-by: Ajit Khaparde <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Invalidate user filters when neededPavan Chebbi3-1/+17
The cached user filters slated to be reapplied need to be cleared if configured MAC changes, RSS key changes, number of rings changes, or ntuple is disabled. Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Add support for user configured RSS keyPavan Chebbi3-4/+24
Store the user configured or generated Toeplitz key in bp->rss_hash_key. The key stays constant across ifdown/ifup unless updated by the user. Signed-off-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Restore all the user created L2 and ntuple filtersPavan Chebbi1-2/+38
Walk the usr_fltr_list and call firmware to add these filters when we open the NIC. This will restore all user created filters after reset. Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Retain user configured filters when closingPavan Chebbi1-3/+6
Driver should not free user created filters from its memory when closing since we are going to reconfigure them when we open again. If the "all" parameter is false, do not free user configured filters in bnxt_free_ntp_fltrs() and bnxt_free_l2_filters(). Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Save user configured filters in a lookup listPavan Chebbi2-0/+28
Driver needs to maintain a lookup list of all the user configured filters. This is required in order to reconfigure these filters upon interface toggle. We can look up this list to follow the order with which they should be re-applied. Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Add separate function to delete the filter structurePavan Chebbi2-10/+14
Since we are going to do filter deletion at multiple places in the upcoming patches, add a function that does the deletion. Future patches add more code into this function. Since we are passing the address of the filter base to free the entire filter structure, add a comment to make sure that the base is always at the beginning of the structure. Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Add drop action support for ntupleVikas Gupta2-4/+14
Add drop action for protocols TCP/UDP/ICMP 1) Drop action for TCP/UDP is supported via flow type tcp4/udp4/tcp6/udp6. 2) Drop action for ICMPV4/ICMPV6/wildcard is supported via flow type ipv4/ipv6. Reviewed-by: Andy Gospodarek <[email protected]> Signed-off-by: Vikas Gupta <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Enhance ethtool ntuple support for ip flows besides TCP/UDPVikas Gupta4-18/+113
Enable flow type ipv4/ipv6 1) for protocols ICMPV4 and ICMPV6. 2) for wildcard match. Wildcard matches to TCP/UDP/ICMP. Note that, IPPROTO_RAW(255) i.e. a reserved protocol considered for a wildcard. Reviewed-by: Andy Gospodarek <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: Vikas Gupta <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: implement fully specified 5-tuple masksEdwin Peer3-168/+134
Support subfield masking for IP addresses and ports. Previously, only entire fields could be included or excluded in NTUPLE filters. Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: Edwin Peer <[email protected]> Signed-off-by: Michael Chan <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Support ethtool -n to display ether filters.Michael Chan2-1/+38
Implement ETHTOOL_GRXCLSRULE for the user defined ether filters. Use the common functions to walk the L2 filter hash table. Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Add ethtool -N support for ether filters.Michael Chan3-3/+103
Add ETHTOOL_SRXCLSRLINS and ETHTOOL_SRXCLSRLDEL support for inserting and deleting L2 ether filter rules. Destination MAC address and optional VLAN are supported for each filter entry. This is currently only supported on older BCM573XX and BCM574XX chips only. Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09bnxt_en: Use firmware provided maximum filter counts.Michael Chan3-17/+26
While individual filter structures are allocated as needed, there is an array to keep track of the software filter IDs that we allocate ahead of time. Rather than relying on a fixed maximum filter count to allocate this array, get the maximum from the firmware when available. Move these filter related maximum counts queried from the firmware to the bnxt_hw_resc struct. If the firmware is not providing these maximum counts, fall back to the hard-coded constant. Reviewed-by: Pavan Chebbi <[email protected]> Signed-off-by: Michael Chan <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09selftests: tc-testing: add mirred to block tdc testsVictor Nogueira1-0/+396
Add 8 new mirred tdc tests that target mirred to block: - Add mirred mirror to egress block action - Add mirred mirror to ingress block action - Add mirred redirect to egress block action - Add mirred redirect to ingress block action - Try to add mirred action with both dev and block - Try to add mirred action without specifying neither dev nor block - Replace mirred redirect to dev action with redirect to block - Replace mirred redirect to block action with mirror to dev Signed-off-by: Victor Nogueira <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09net: emaclite: Use devm_platform_get_and_ioremap_resource() in ↵Markus Elfring1-2/+1
xemaclite_of_probe() A wrapper function is available since the commit 890cc39a8799 ("drivers: provide devm_platform_get_and_ioremap_resource()"). Thus reuse existing functionality instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09ethernet: wiznet: Use devm_platform_get_and_ioremap_resource() in ↵Markus Elfring1-2/+1
w5300_hw_probe() A wrapper function is available since the commit 890cc39a8799 ("drivers: provide devm_platform_get_and_ioremap_resource()"). Thus reuse existing functionality instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09selftests: forwarding: Add missing multicast routing config entriesIdo Schimmel1-0/+7
The two tests that make use of multicast routig (router.sh and router_multicast.sh) are currently failing in the netdev CI because the kernel is missing multicast routing support. Fix by adding the required config entries. Fixes: 6d4efada3b82 ("selftests: forwarding: Add multicast routing test") Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09Merge branch 'for-io_uring-add-napi-busy-polling-support'Jakub Kicinski2-14/+47
Merge netdev bits of io_uring busy polling support. Jens Axboe says: ==================== io_uring: add napi busy polling support I finally got around to testing this patchset in its current form, and results look fine to me. It Works. Using the basic ping/pong test that's part of the liburing addition, without enabling NAPI I get: Stock settings, no NAPI, 100k packets: rtt(us) min/avg/max/mdev = 31.730/37.006/87.960/0.497 and with -t10 -b enabled: rtt(us) min/avg/max/mdev = 23.250/29.795/63.511/1.203 In short, this patchset enables per io_uring NAPI enablement, rather than need to enable that globally. This allows targeted NAPI usage with io_uring. Here's Stefan's v15 posting, which predates this one: https://lore.kernel.org/io-uring/[email protected]/ ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09net: add napi_busy_loop_rcu()Stefan Roesch2-0/+19
This adds the napi_busy_loop_rcu() function. This function assumes that the calling function is already holding the rcu read lock and napi_busy_loop() does not need to take the rcu read lock. Add a NAPI_F_NO_SCHED flag, which tells __napi_busy_loop() to abort if we need to reschedule rather than drop the RCU read lock and reschedule. Signed-off-by: Stefan Roesch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09net: split off __napi_busy_poll from napi_busy_pollStefan Roesch1-14/+28
This splits off the key part of the napi_busy_poll function into its own function, __napi_busy_poll, and changes the prefer_busy_poll bool to be flag based to allow passing in more flags in the future. This is done in preparation for an additional napi_busy_poll() function, that doesn't take the rcu_read_lock(). The new function is introduced in the next patch. Signed-off-by: Stefan Roesch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-09Merge branch 'wan-t7x-fastboot'David S. Miller16-90/+553
Jinjian Song says: ==================== net: wwan: t7xx: Add fastboot interface Add support for t7xx WWAN device firmware flashing & coredump collection using fastboot interface. Using fastboot protocol command through /dev/wwan0fastboot0 WWAN port to support firmware flashing and coredump collection, userspace get device mode from /sys/bus/pci/devices/${bdf}/t7xx_mode. ==================== Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: wwan: t7xx: Add fastboot WWAN portJinjian Song4-26/+115
On early detection of wwan device in fastboot mode, driver sets up CLDMA0 HW tx/rx queues for raw data transfer and then create fastboot port to userspace. Application can use this port to flash firmware and collect core dump by fastboot protocol commands. E.g., flash firmware through fastboot port: - "download:%08x": write data to memory with the download size. - "flash:%s": write the previously downloaded image to the named partition. - "reboot": reboot the device. Link: https://android.googlesource.com/platform/system/core/+/refs/heads/main/fastboot/README.md Signed-off-by: Jinjian Song <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: wwan: t7xx: Infrastructure for early port configurationJinjian Song11-61/+290
To support cases such as FW update or Core dump, the t7xx device is capable of signaling the host that a special port needs to be created before the handshake phase. Adds the infrastructure required to create the early ports which also requires a different configuration of CLDMA queues. Base on the v5 patch version of follow series: 'net: wwan: t7xx: fw flashing & coredump support' (https://patchwork.kernel.org/project/netdevbpf/patch/3777bb382f4b0395cb594a602c5c79dbab86c9e0.1674307425.git.m.chetan.kumar@linux.intel.com/) Signed-off-by: Jinjian Song <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: wwan: t7xx: Add sysfs attribute for device state machineJinjian Song6-6/+145
Add support for userspace to get/set the device mode, device's state machine changes between (unknown/ready/reset/fastboot). Get the device state mode: - 'cat /sys/bus/pci/devices/${bdf}/t7xx_mode' Set the device state mode: - reset(cold reset): 'echo reset > /sys/bus/pci/devices/${bdf}/t7xx_mode' - fastboot: 'echo fastboot_switching > /sys/bus/pci/devices/${bdf}/t7xx_mode' Reload driver to get the new device state after setting operation. Signed-off-by: Jinjian Song <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09wwan: core: Add WWAN fastboot port typeJinjian Song2-0/+6
Add a new WWAN port that connects to the device fastboot protocol interface. Signed-off-by: Jinjian Song <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09Merge branch 'netconsole-userdata-append'David S. Miller2-55/+370
Matthew Wood says: ==================== netconsole: Add userdata append support Add the ability to add custom userdata to every outbound netconsole message as a collection of key/value pairs, allowing users to add metadata to every netconsole message which can be used for for tagging, filtering, and aggregating log messages. In a previous patch series the ability to prepend the uname release was added towards the goals above. This patch series builds on that idea to allow any userdata, keyed by a user provided name, to be included in netconsole messages. If CONFIG_NETCONSOLE_DYNAMIC is enabled an additional userdata directory will be presented in the netconsole configfs tree, allowing the addition of userdata entries. /sys/kernel/config/netconsole/ <target>/ enabled release dev_name local_port remote_port local_ip remote_ip local_mac remote_mac userdata/ <key>/ value <key>/ value ... v1->v2: * Updated netconsole_target docs, kdoc is now clean v2->v3: * Remove inline keyword from to_userdat* functions * Break up some lines that exceeded 80 chars * Replace typos and remove {} from single line if statement * Remove unused variable Testing for this series is as follows: Build every patch without CONFIG_NETCONSOLE_DYNAMIC, and also built with CONFIG_NETCONSOLE_DYNAMIC enabled for every patch after the config option was added Test Userdata configfs # Adding userdata cd /sys/kernel/config/netconsole/ && mkdir cmdline0 && cd cmdline0 mkdir userdata/release && echo hotfix1 > userdata/release/value preview=$(for f in `ls userdata`; do echo $f=$(cat userdata/$f/value); done) [[ "$preview" == $'release=hotfix1' ]] && echo pass || echo fail mkdir userdata/testing && echo something > userdata/testing/value preview=$(for f in `ls userdata`; do echo $f=$(cat userdata/$f/value); done) [[ "$preview" == $'release=hotfix1\ntesting=something' ]] && echo pass || echo fail # # Removing Userdata rmdir userdata/testing preview=$(for f in `ls userdata`; do echo $f=$(cat userdata/$f/value); done) [[ "$preview" == $'release=hotfix1' ]] && echo pass || echo fail rmdir userdata/release preview=$(for f in `ls userdata`; do echo $f=$(cat userdata/$f/value); done) [[ "$preview" == $'' ]] && echo pass || echo fail # # Adding userdata key with too large of 6.7.0-rc8-virtme,12,481,17954104,-directory name [<54 chars] mkdir userdata/testing12345678901234567890123456789012345678901234567890 [[ $? == 1 ]] && echo pass || echo fail # # Adding userdata value with too large of value [<200 chars] mkdir userdata/testing echo `for i in {1..201};do printf "%s" "v";done` > userdata/testing/value [[ $? == 1 ]] && echo pass || echo fail rmdir userdata/testing - Output: pass pass pass pass pass mkdir: cannot create directory ‘cmdline0/userdata/testing12345678901234567890123456789012345678901234567890’: File name too long pass bash: echo: write error: Message too long pass Test netconsole messages (w/ msg fragmentation) echo `for i in {1..996};do printf "%s" "v";done` > /dev/kmsg - Output: 6.7.0-rc8-virtme,12,484,84321212,-,ncfrag=0/997;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv6.7.0-rc8-virtme,12,484,84321212,-,ncfrag=952/997;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Test empty userdatum cd /sys/kernel/config/netconsole/ && mkdir cmdline0 mkdir cmdline0/userdata/empty echo test > /dev/kmsg rmdir cmdline0/userdata/empty - Output: Test netconsole messages (w/o userdata fragmentation) cd /sys/kernel/config/netconsole/ && mkdir cmdline0 mkdir cmdline0/userdata/release && echo hotfix1 > cmdline0/userdata/release/value mkdir cmdline0/userdata/testing && echo something > cmdline0/userdata/testing/value echo test > /dev/kmsg rmdir cmdline0/userdata/release rmdir cmdline0/userdata/testing ==================== Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: append userdata to fragmented netconsole messagesMatthew Wood1-13/+37
Regardless of whether the original message body or formatted userdata exceeds the MAX_PRINT_CHUNK, append userdata to the netconsole message starting with the first chunk that has available space after writing the body. Co-developed-by: Breno Leitao <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Signed-off-by: Matthew Wood <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: append userdata to netconsole messagesMatthew Wood1-2/+17
Append userdata to outgoing unfragmented (<1000 bytes) netconsole messages. When sending messages the userdata string is already formatted and stored in netconsole_target->userdata_complete. Always write the outgoing message to buf, so userdata can be appended in a standard fashion. This is a change from only using buf when the release needs to be prepended to the message. Co-developed-by: Breno Leitao <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Signed-off-by: Matthew Wood <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: cache userdata formatted string in netconsole_targetMatthew Wood1-0/+61
Store a formatted string for userdata that will be appended to netconsole messages. The string has a capacity of 4KB, as calculated by the userdatum entry length of 256 bytes and a max of 16 userdata entries. Update the stored netconsole_target->userdata_complete string with the new formatted userdata values when a userdatum is created, edited, or removed. Each userdata entry contains a trailing newline, which will be formatted as such in netconsole messages:: 6.7.0-rc8-virtme,12,500,1646292204,-;test release=foo something=bar 6.7.0-rc8-virtme,12,500,1646292204,-;another test release=foo something=bar Enforcement of MAX_USERDATA_ITEMS is done in userdatum_make_item; update_userdata will not check for this case but will skip any userdata children over the limit of MAX_USERDATA_ITEMs. If a userdata entry/dir is created but no value is provided, that entry will be skipped. This is in part because update_userdata() can't be called in userdatum_make_item() since the item will not have been added to the userdata config_group children yet. To preserve the experience of adding an empty userdata that doesn't show up in the netconsole messages, purposefully skip empty userdata items even when update_userdata() can be called. Co-developed-by: Breno Leitao <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Signed-off-by: Matthew Wood <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: add a userdata config_group member to netconsole_targetMatthew Wood1-5/+142
Create configfs machinery for netconsole userdata appending, which depends on CONFIG_NETCONSOLE_DYNAMIC (for configfs interface). Add a userdata config_group to netconsole_target for managing userdata entries as a tree under the netconsole configfs subsystem. Directory names created under the userdata directory become userdatum keys; the userdatum value is the content of the value file. Include the minimum-viable-changes for userdata configfs config_group. init_target_config_group() ties in the complete configfs machinery to avoid unused func/variable errors during build. Initializing the netconsole_target->group is moved to init_target_config_group, which will also init and add the userdata config_group. Each userdatum entry has a limit of 256 bytes (54 for the key/directory, 200 for the value, and 2 for '=' and '\n' characters), which is enforced by the configfs functions for updating the userdata config_group. When a new netconsole_target is created, initialize the userdata config_group and add it as a default group for netconsole_target config_group, allowing the userdata configfs sub-tree to be presented in the netconsole configfs tree under the userdata directory. Co-developed-by: Breno Leitao <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Signed-off-by: Matthew Wood <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: add docs for appending netconsole user dataMatthew Wood1-0/+66
Add a new User Data section to the netconsole docs to describe the appending of user data capability (for netconsole dynamic configuration) with usage and netconsole output examples. Co-developed-by: Breno Leitao <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Signed-off-by: Matthew Wood <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: move newline trimming to functionMatthew Wood1-6/+11
Move newline trimming logic from `dev_name_store()` to a new function (trim_newline()) for shared use in netconsole.c Signed-off-by: Matthew Wood <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: move netconsole_target config_item to config_groupMatthew Wood1-27/+31
In order to support a nested userdata config_group in later patches, use a config_group for netconsole_target instead of a config_item. It's a no-op functionality-wise, since config_group maintains all features of a config_item via the cg_item member. Signed-off-by: Matthew Wood <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-09net: netconsole: cleanup formatting lintsMatthew Wood1-5/+8
Address checkpatch lint suggestions in preparation for later changes Signed-off-by: Matthew Wood <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2024-02-08ethtool: do not use rtnl in ethnl_default_dumpit()Eric Dumazet1-9/+5
for_each_netdev_dump() can be used with RCU protection, no need for rtnl if we are going to use dev_hold()/dev_put(). Signed-off-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-08Merge branch '10GbE' of ↵Jakub Kicinski22-832/+808
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2024-02-06 (ixgbe) This series contains updates to ixgbe driver only. Jedrzej continues cleanup work from conversion away from ixgbe_status; s32 values are changed to int, various style issues are addressed, and some return statements refactored to address some smatch warnings. * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ixgbe: Clarify the values of the returning status ixgbe: Rearrange args to fix reverse Christmas tree ixgbe: Convert ret val type from s32 to int ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-08Merge branch 'add-hw-checksum-offload-support-for-rz-g2l-gbethernet-ip'Jakub Kicinski2-4/+179
Biju Das says: ==================== Add HW checksum offload support for RZ/G2L GbEthernet IP This patch series aims to add HW checksum offload supported by TOE module found on the RZ/G2L Gb ethernet IP. TOE has hardware support for calculating IP header and TCP/UDP/ICMP checksum for both IPv4 and IPv6. For Rx, the 4-byte result of checksum calculation is attached to the Ethernet frames.First 2-bytes is result of IPv4 header checksum and next 2-bytes is TCP/UDP/ICMP checksum. If a frame does not have checksum error, 0x0000 is attached as checksum calculation result. For unsupported frames 0xFFFF is attached as checksum calculation result. In case of an IPv6 packet, IPv4 checksum is always set to 0xFFFF. For Tx, the result of checksum calculation is set to the checksum field of each IPv4 Header/TCP/UDP/ICMP of ethernet frames. For the unsupported frames, those fields are not changed. If a transmission frame is an UDPv4 frame and its checksum value in the UDP header field is 0x0000, TOE does not calculate checksum for UDP part of this frame as it is optional function as per standards. Add Tx/Rx checksum offload supported by TOE for IPv4 and TCP/UDP protocols. Results of iperf3 in Mbps RZ/V2L: TCP(Tx/Rx) results with checksum offload Enabled: {921,932} TCP(Tx/Rx) results with checksum offload Disabled: {867,612} UDP(Tx/Rx) results with checksum offload Enabled: {950,946} UDP(Tx/Rx) results with checksum offload Disabled: {952,920} RZ/G2L: TCP(Tx/Rx) results with checksum offload Enabled: {920,936} TCP(Tx/Rx) results with checksum offload Disabled: {871,626} UDP(Tx/Rx) results with checksum offload Enabled: {953,950} UDP(Tx/Rx) results with checksum offload Disabled: {954,920} RZ/G2LC: TCP(Tx/Rx) results with checksum offload Enabled: {927,936} TCP(Tx/Rx) results with checksum offload Disabled: {889,626} UDP(Tx/Rx) results with checksum offload Enabled: {950,946} UDP(Tx/Rx) results with checksum offload Disabled: {949,944} ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2024-02-08ravb: Add Tx checksum offload support for GbEthBiju Das2-7/+79
TOE has hardware support for calculating IP header and TCP/UDP/ICMP checksum for both IPv4 and IPv6. Add Tx checksum offload supported by TOE for IPv4 and TCP/UDP. For Tx, the result of checksum calculation is set to the checksum field of each IPv4 Header/TCP/UDP/ICMP of ethernet frames. For the unsupported frames, those fields are not changed. If a transmission frame is an UDPv4 frame and its checksum value in the UDP header field is 0x0000, TOE does not calculate checksum for UDP part of this frame as it is optional function as per standards. We can test this functionality by the below commands ethtool -K eth0 tx on --> to turn on Tx checksum offload ethtool -K eth0 tx off --> to turn off Tx checksum offload Signed-off-by: Biju Das <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>