From: Chris Packham To: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chris Packham , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Landen Chao , DENG Qingfang , Sean Wang , Daniel Golle Subject: [PATCH] dt-bindings: net: dsa: mediatek,mt7530: Minor grammar fixes Date: Mon, 24 Jun 2024 14:58:11 +1200 Message-ID: <20240624025812.1729229-1-chris.packham@alliedtelesis.co.nz> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=6678e0c8 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=Mc0CNVgLlbBwIVVfR90A:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256337 org.kernel.vger.netdev:354828 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.linux-devicetree,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Update the mt7530 binding with some minor updates that make the document easier to read. Signed-off-by: Chris Packham --- Notes: I was referring to this dt binding and found a couple of places where the wording could be improved. I'm not exactly a techical writer but hopefully I've made things a bit better. .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.ya= ml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index 1c2444121e60..6c0abb020631 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -22,16 +22,16 @@ description: | =20 The MT7988 SoC comes with a built-in switch similar to MT7531 as well = as four Gigabit Ethernet PHYs. The switch registers are directly mapped into t= he SoC's - memory map rather than using MDIO. The switch got an internally connec= ted 10G + memory map rather than using MDIO. The switch has an internally connec= ted 10G CPU port and 4 user ports connected to the built-in Gigabit Ethernet P= HYs. =20 - MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs has got 10/1= 00 PHYs + MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs have 10/100 = PHYs and the switch registers are directly mapped into SoC's memory map rat= her than using MDIO. The DSA driver currently doesn't support MT7620 variants. =20 There is only the standalone version of MT7531. =20 - Port 5 on MT7530 has got various ways of configuration: + Port 5 on MT7530 supports various configurations: =20 - Port 5 can be used as a CPU port. =20 --=20 2.45.2 . From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Tariq Toukan Subject: [PATCH net 0/7] mlx5 fixes 2024-06-24 Date: Mon, 24 Jun 2024 10:29:54 +0300 Message-ID: <20240624073001.1204974-1-tariqt@nvidia.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.netdev:354832 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hi, This patchset provides fixes from the team to the mlx5 core and EN drivers. The first 3 patches by Daniel replace a buggy cap field with a newly introduced one. Patch 4 by Chris de-couples ingress ACL creation from a specific flow, so it's invoked by other flows if needed. Patch 5 by Jianbo fixes a possible missing cleanup of QoS objects. Patches 6 and 7 by Leon fixes IPsec stats logic to better reflect the traffic. Series generated against: commit 02ea312055da ("octeontx2-pf: Fix coverity and klockwork issues in octeon PF driver") Regards, Tariq Chris Mi (1): net/mlx5: E-switch, Create ingress ACL when needed Daniel Jurgens (3): net/mlx5: IFC updates for changing max EQs net/mlx5: Use max_num_eqs_24b capability if set net/mlx5: Use max_num_eqs_24b when setting max_io_eqs Jianbo Liu (1): net/mlx5e: Add mqprio_rl cleanup and free in mlx5e_priv_cleanup() Leon Romanovsky (2): net/mlx5e: Present succeeded IPsec SA bytes and packet net/mlx5e: Approximate IPsec per-SA payload data bytes count .../mellanox/mlx5/core/en_accel/ipsec.c | 48 ++++++++++++++----- .../net/ethernet/mellanox/mlx5/core/en_main.c | 5 ++ drivers/net/ethernet/mellanox/mlx5/core/eq.c | 4 +- .../mellanox/mlx5/core/esw/acl/ingress_ofld.c | 37 ++++++++++---- .../mellanox/mlx5/core/eswitch_offloads.c | 22 +++++++-- .../ethernet/mellanox/mlx5/core/mlx5_core.h | 10 ++++ .../net/ethernet/mellanox/mlx5/core/pci_irq.c | 4 +- include/linux/mlx5/mlx5_ifc.h | 6 ++- 8 files changed, 103 insertions(+), 33 deletions(-) -- 2.31.1 . From: James Chapman To: netdev@vger.kernel.org Cc: dsahern@kernel.org, tparkin@katalix.com, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, James Chapman , kernel test robot Subject: [PATCH net-next] l2tp: remove incorrect __rcu attribute Date: Mon, 24 Jun 2024 09:29:45 +0100 Message-Id: <20240624082945.1925009-1-jchapman@katalix.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.netdev:354841 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This fixes a sparse warning. Fixes: d18d3f0a24fc ("l2tp: replace hlist with simple list for per-tunnel session list") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406220754.evK8Hrjw-lkp@intel.com/ Signed-off-by: James Chapman --- net/l2tp/l2tp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index be4bcbf291a1..64f446f0930b 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1290,7 +1290,7 @@ static void l2tp_session_unhash(struct l2tp_session *session) static void l2tp_tunnel_closeall(struct l2tp_tunnel *tunnel) { struct l2tp_session *session; - struct list_head __rcu *pos; + struct list_head *pos; struct list_head *tmp; spin_lock_bh(&tunnel->list_lock); -- 2.34.1 . From: To: , , , , CC: Edward Cree , , , , , , , , , , , , , , , , Subject: [PATCH v7 net-next 0/9] ethtool: track custom RSS contexts in the core Date: Mon, 24 Jun 2024 15:11:11 +0100 Message-ID: X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.netdev:354884 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Edward Cree Make the core responsible for tracking the set of custom RSS contexts, their IDs, indirection tables, hash keys, and hash functions; this lets us get rid of duplicative code in drivers, and will allow us to support netlink dumps later. This series only moves the sfc EF10 & EF100 driver over to the new API; other drivers (mvpp2, octeontx2, mlx5, sfc/siena) can be converted afterwards and the legacy API removed. Changes in v7: * ensure 'ret' is initialised in ethtool_get_rxfh (horms) Changes in v6: * fixed kdoc for renamed fields * always call setter in netdev_rss_contexts_free() * document that 'create' method should populate ctx for driver-chosen defaults * on 'ethtool -x', get info from the tracking xarray rather than calling the driver's get_rxfh method. This makes it easier to test that the tracking is correct, in the absence of future code like netlink dumps to use it. Changes in v5: * Rebased on top of Ahmed Zaki's struct ethtool_rxfh_param API * Moved rxfh_max_context_id to the ethtool ops struct Changes in v4: * replaced IDR with XArray * grouped initialisations together in patch 6 * dropped RFC tags Changes in v3: * Added WangXun ngbe to patch #1, not sure if they've added WoL support since v2 or if I just missed it last time around * Re-ordered struct ethtool_netdev_state to avoid hole (Andrew Lunn) * Fixed some resource leaks in error handling paths (kuba) * Added maintainers of other context-using drivers to CC Edward Cree (9): net: move ethtool-related netdev state into its own struct net: ethtool: attach an XArray of custom RSS contexts to a netdevice net: ethtool: record custom RSS contexts in the XArray net: ethtool: let the core choose RSS context IDs net: ethtool: add an extack parameter to new rxfh_context APIs net: ethtool: add a mutex protecting RSS contexts sfc: use new rxfh_context API net: ethtool: use the tracking array for get_rxfh on custom RSS contexts sfc: remove get_rxfh_context dead code drivers/net/ethernet/realtek/r8169_main.c | 4 +- drivers/net/ethernet/sfc/ef10.c | 2 +- drivers/net/ethernet/sfc/ef100_ethtool.c | 4 + drivers/net/ethernet/sfc/efx.c | 2 +- drivers/net/ethernet/sfc/efx.h | 2 +- drivers/net/ethernet/sfc/efx_common.c | 10 +- drivers/net/ethernet/sfc/ethtool.c | 4 + drivers/net/ethernet/sfc/ethtool_common.c | 168 ++++++++---------- drivers/net/ethernet/sfc/ethtool_common.h | 12 ++ drivers/net/ethernet/sfc/mcdi_filters.c | 135 +++++++------- drivers/net/ethernet/sfc/mcdi_filters.h | 8 +- drivers/net/ethernet/sfc/net_driver.h | 28 +-- drivers/net/ethernet/sfc/rx_common.c | 64 ++----- drivers/net/ethernet/sfc/rx_common.h | 8 +- .../net/ethernet/wangxun/ngbe/ngbe_ethtool.c | 4 +- drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 +- drivers/net/phy/phy.c | 2 +- drivers/net/phy/phy_device.c | 5 +- drivers/net/phy/phylink.c | 2 +- include/linux/ethtool.h | 110 ++++++++++++ include/linux/netdevice.h | 7 +- net/core/dev.c | 40 +++++ net/ethtool/ioctl.c | 136 +++++++++++++- net/ethtool/wol.c | 2 +- 24 files changed, 496 insertions(+), 265 deletions(-) . From: Mathis Marion To: "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= , Kylian Balan , Alexander Aring , Mathis Marion Subject: [PATCH v1 0/2] ipv6: always accept routing headers with 0 segments left Date: Mon, 24 Jun 2024 16:15:31 +0200 Message-ID: <20240624141602.206398-1-Mathis.Marion@silabs.com> Content-Transfer-Encoding: base64 Content-Type: text/plain X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1256978 org.kernel.vger.netdev:354896 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail RnJvbTogTWF0aGlzIE1hcmlvbiA8bWF0aGlzLm1hcmlvbkBzaWxhYnMuY29tPgoKSGVsbG8gbWFp bnRhaW5lcnMsCgpIZXJlIGlzIGEgYml0IG9mIGNvbnRleHQgZm9yIHRoaXMgc2VyaWVzOiBTaWxp Y29uIExhYnMgaXMgd29ya2luZwpvbiBpbXBsZW1lbnRpbmcgYSBXaS1TVU5bMV0gcm91dGluZyBk YWVtb24gZm9yIExpbnV4WzJdLiBXaS1TVU4gdXNlcwpSUExbM10gZm9yIHJvdXRpbmcsIHdoaWNo IHVzZXMgYSBzcGVjaWFsaXplZCBJUHY2IHJvdXRpbmcgaGVhZGVyWzRdLApzdXBwb3J0ZWQgYnkg YSBrZXJuZWwgbW9kdWxlWzVdLiBDdXJyZW50bHksIG91ciBib3JkZXIgcm91dGVyIGRhZW1vbgpk b2VzIG5vdCByZWx5IG9uIHRoYXQga2VybmVsIG1vZHVsZSBhbmQgaW5zdGVhZCBpbnNlcnRzIHRo ZSBTb3VyY2UKUm91dGluZyBIZWFkZXIgKFNSSCkgaW4gdXNlcnNwYWNlIGFmdGVyIHJlYWRpbmcg dGhlIElQdjYgcGFja2V0IGZyb20gYQpUVU4gZGV2aWNlLgoKRnV0dXJlIGRldmVsb3BtZW50IGlz IG5vdyBnZWFyZWQgdG93YXJkcyBhIHJvdXRlciBpbXBsZW1lbnRhdGlvbiAoYXMKb3Bwb3NlZCB0 byBhIGJvcmRlciByb3V0ZXIpLCB3aGljaCBkb2VzIG5vdCBpbnNlcnQgdGhlIFNSSCBidXQgaW5z dGVhZApwcm9jZXNzZXMgaXQuIFRoZSBmaXJzdCBzdGVwIHdhcyB0byBpbXBsZW1lbnQgYSBsZWFm IG5vZGUsIHdoaWNoIGFsd2F5cwpyZWNlaXZlIGEgU1JIIHdpdGggMCBzZWdtZW50cyBsZWZ0LiBF dmVuIHdpdGhvdXQgaGF2aW5nIHRoZSBSUEwga2VybmVsCm1vZHVsZSBlbmFibGVkLCBJIHdhcyBl eHBlY3RpbmcgdGhlIGtlcm5lbCB0byBwcm9wZXJseSByZWNlaXZlIHRoZXNlCnBhY2tldHMsIGJ1 dCB0aGV5IHdlcmUgaW5zdGVhZCBiZWluZyBkcm9wcGVkLiBMb29raW5nIGF0IHRoZSBrZXJuZWwK Y29kZSwgaXQgc2VlbXMgdGhhdCB0aGUgU1JIIHdvdWxkIGhhdmUgYmVlbiBhY2NlcHRlZCBiZWZv cmUKODYxMGM3YzZlM2JkICgibmV0OiBpcHY2OiBhZGQgc3VwcG9ydCBmb3IgcnBsIHNyIGV4dGhk ciIpLgoKWzFdOiBodHRwczovL3dpLXN1bi5vcmcvClsyXTogaHR0cHM6Ly9naXRodWIuY29tL1Np bGljb25MYWJzL3dpc3VuLWJyLWxpbnV4ClszXTogaHR0cHM6Ly93d3cucmZjLWVkaXRvci5vcmcv cmZjL3JmYzY1NTAuaHRtbApbNF06IGh0dHBzOi8vd3d3LnJmYy1lZGl0b3Iub3JnL3JmYy9yZmM2 NTU0Lmh0bWwKWzVdOiBodHRwczovL2VsaXhpci5ib290bGluLmNvbS9saW51eC92Ni45L3NvdXJj ZS9uZXQvaXB2Ni9LY29uZmlnI0wzMjIKCk1hdGhpcyBNYXJpb24gKDIpOgogIGlwdjY6IGludHJv ZHVjZSBpcHY2X3J0aGRyX3Jjdl9sYXN0KCkKICBpcHY2OiBhbHdheXMgYWNjZXB0IHJvdXRpbmcg aGVhZGVycyB3aXRoIDAgc2VnbWVudHMgbGVmdAoKIG5ldC9pcHY2L2V4dGhkcnMuYyB8IDEyNCAr KysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFu Z2VkLCA0OCBpbnNlcnRpb25zKCspLCA3NiBkZWxldGlvbnMoLSkKCi0tIAoyLjQzLjAKCg== . From: Danielle Ratson To: CC: , , , , , , , , , , , , , , , , , , , , , Danielle Ratson Subject: [PATCH net-next v7 0/9] Add ability to flash modules' firmware Date: Mon, 24 Jun 2024 20:51:50 +0300 Message-ID: <20240624175201.130522-1-danieller@nvidia.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1257234 org.kernel.vger.netdev:354901 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-doc,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail CMIS compliant modules such as QSFP-DD might be running a firmware that can be updated in a vendor-neutral way by exchanging messages between the host and the module as described in section 7.2.2 of revision 4.0 of the CMIS standard. According to the CMIS standard, the firmware update process is done using a CDB commands sequence. CDB (Command Data Block Message Communication) reads and writes are performed on memory map pages 9Fh-AFh according to the CMIS standard, section 8.12 of revision 4.0. Add a pair of new ethtool messages that allow: * User space to trigger firmware update of transceiver modules * The kernel to notify user space about the progress of the process The user interface is designed to be asynchronous in order to avoid RTNL being held for too long and to allow several modules to be updated simultaneously. The interface is designed with CMIS compliant modules in mind, but kept generic enough to accommodate future use cases, if these arise. The kernel interface that will implement the firmware update using CDB command will include 2 layers that will be added under ethtool: * The upper layer that will be triggered from the module layer, is cmis_ fw_update. * The lower one is cmis_cdb. In the future there might be more operations to implement using CDB commands. Therefore, the idea is to keep the cmis_cdb interface clean and the cmis_fw_update specific to the cdb commands handling it. The communication between the kernel and the driver will be done using two ethtool operations that enable reading and writing the transceiver module EEPROM. The operation ethtool_ops::get_module_eeprom_by_page, that is already implemented, will be used for reading from the EEPROM the CDB reply, e.g. reading module setting, state, etc. The operation ethtool_ops::set_module_eeprom_by_page, that is added in the current patchset, will be used for writing to the EEPROM the CDB command such as start firmware image, run firmware image, etc. Therefore in order for a driver to implement module flashing, that driver needs to implement the two functions mentioned above. Patchset overview: Patch #1-#2: Implement the EEPROM writing in mlxsw. Patch #3: Define the interface between the kernel and user space. Patch #4: Add ability to notify the flashing firmware progress. Patch #5: Veto operations during flashing. Patch #6: Add extended compliance codes. Patch #7: Add the cdb layer. Patch #8: Add the fw_update layer. Patch #9: Add ability to flash transceiver modules' firmware. v7: Patch #4: * Return -ENOMEM instead of PTR_ERR(attr) on ethnl_module_fw_flash_ntf_put_err(). Patch #9: * Fix Warning for not unlocking the spin_lock in the error flow on module_flash_fw_work_list_add(). * Avoid the fall-through on ethnl_sock_priv_destroy(). v6: * Squash some of the last patch to patch #5 and patch #9. Patch #3: * Add paragraph in .rst file. Patch #4: * Reserve '1' more place on SKB for NUL terminator in the error message string. * Add more prints on error flow, re-write the printing function and add ethnl_module_fw_flash_ntf_put_err(). * Change the communication method so notification will be sent in unicast instead of multicast. * Add new 'struct ethnl_module_fw_flash_ntf_params' that holds the relevant info for unicast communication and use it to send notification to the specific socket. * s/nla_put_u64_64bit/nla_put_uint/ Patch #7: * In ethtool_cmis_cdb_init(), Use 'const' for the 'params' parameter. Patch #8: * Add a list field to struct ethtool_module_fw_flash for module_fw_flash_work_list that will be presented in the next patch. * Move ethtool_cmis_fw_update() cleaning to a new function that will be represented in the next patch. * Move some of the fields in struct ethtool_module_fw_flash to a separate struct, so ethtool_cmis_fw_update() will get only the relevant parameters for it. * Edit the relevant functions to get the relevant params for them. * s/CMIS_MODULE_READY_MAX_DURATION_USEC/CMIS_MODULE_READY_MAX_DURATION_MSEC Patch #9: * Add a paragraph in the commit message. * Rename labels in module_flash_fw_schedule(). * Add info to genl_sk_priv_*() and implement the relevant callbacks, in order to handle properly a scenario of closing the socket from user space before the work item was ended. * Add a list the holds all the ethtool_module_fw_flash struct that corresponds to the in progress work items. * Add a new enum for the socket types. * Use both above to identify a flashing socket, add it to the list and when closing socket affect only the flashing type. * Create a new function that will get the work item instead of ethtool_cmis_fw_update(). * Edit the relevant functions to get the relevant params for them. * The new function will call the old ethtool_cmis_fw_update(), and do the cleaning, so the existence of the list should be completely isolated in module.c. Danielle Ratson (7): ethtool: Add an interface for flashing transceiver modules' firmware ethtool: Add flashing transceiver modules' firmware notifications ability ethtool: Veto some operations during firmware flashing process net: sfp: Add more extended compliance codes ethtool: cmis_cdb: Add a layer for supporting CDB commands ethtool: cmis_fw_update: add a layer for supporting firmware update using CDB ethtool: Add ability to flash transceiver modules' firmware Ido Schimmel (2): ethtool: Add ethtool operation to write to a transceiver module EEPROM mlxsw: Implement ethtool operation to write to a transceiver module EEPROM Documentation/netlink/specs/ethtool.yaml | 55 ++ Documentation/networking/ethtool-netlink.rst | 70 +++ .../net/ethernet/mellanox/mlxsw/core_env.c | 57 ++ .../net/ethernet/mellanox/mlxsw/core_env.h | 6 + drivers/net/ethernet/mellanox/mlxsw/minimal.c | 15 + .../mellanox/mlxsw/spectrum_ethtool.c | 15 + include/linux/ethtool.h | 20 +- include/linux/netdevice.h | 4 +- include/linux/sfp.h | 6 + include/uapi/linux/ethtool.h | 18 + include/uapi/linux/ethtool_netlink.h | 19 + net/ethtool/Makefile | 2 +- net/ethtool/cmis.h | 124 ++++ net/ethtool/cmis_cdb.c | 581 ++++++++++++++++++ net/ethtool/cmis_fw_update.c | 399 ++++++++++++ net/ethtool/eeprom.c | 6 + net/ethtool/ioctl.c | 12 + net/ethtool/module.c | 394 ++++++++++++ net/ethtool/module_fw.h | 75 +++ net/ethtool/netlink.c | 56 ++ net/ethtool/netlink.h | 16 + tools/net/ynl/Makefile.deps | 3 +- 22 files changed, 1942 insertions(+), 11 deletions(-) create mode 100644 net/ethtool/cmis.h create mode 100644 net/ethtool/cmis_cdb.c create mode 100644 net/ethtool/cmis_fw_update.c create mode 100644 net/ethtool/module_fw.h -- 2.45.0 . From: Shannon Nelson To: , , , , CC: , Shannon Nelson Subject: [PATCH v3 net] ionic: use dev_consume_skb_any outside of napi Date: Mon, 24 Jun 2024 10:50:15 -0700 Message-ID: <20240624175015.4520-1-shannon.nelson@amd.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.netdev:354910 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail If we're not in a NAPI softirq context, we need to be careful about how we call napi_consume_skb(), specifically we need to call it with budget==0 to signal to it that we're not in a safe context. This was found while running some configuration stress testing of traffic and a change queue config loop running, and this curious note popped out: [ 4371.402645] BUG: using smp_processor_id() in preemptible [00000000] code: ethtool/20545 [ 4371.402897] caller is napi_skb_cache_put+0x16/0x80 [ 4371.403120] CPU: 25 PID: 20545 Comm: ethtool Kdump: loaded Tainted: G OE 6.10.0-rc3-netnext+ #8 [ 4371.403302] Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 01/23/2021 [ 4371.403460] Call Trace: [ 4371.403613] [ 4371.403758] dump_stack_lvl+0x4f/0x70 [ 4371.403904] check_preemption_disabled+0xc1/0xe0 [ 4371.404051] napi_skb_cache_put+0x16/0x80 [ 4371.404199] ionic_tx_clean+0x18a/0x240 [ionic] [ 4371.404354] ionic_tx_cq_service+0xc4/0x200 [ionic] [ 4371.404505] ionic_tx_flush+0x15/0x70 [ionic] [ 4371.404653] ? ionic_lif_qcq_deinit.isra.23+0x5b/0x70 [ionic] [ 4371.404805] ionic_txrx_deinit+0x71/0x190 [ionic] [ 4371.404956] ionic_reconfigure_queues+0x5f5/0xff0 [ionic] [ 4371.405111] ionic_set_ringparam+0x2e8/0x3e0 [ionic] [ 4371.405265] ethnl_set_rings+0x1f1/0x300 [ 4371.405418] ethnl_default_set_doit+0xbb/0x160 [ 4371.405571] genl_family_rcv_msg_doit+0xff/0x130 [...] I found that ionic_tx_clean() calls napi_consume_skb() which calls napi_skb_cache_put(), but before that last call is the note /* Zero budget indicate non-NAPI context called us, like netpoll */ and DEBUG_NET_WARN_ON_ONCE(!in_softirq()); Those are pretty big hints that we're doing it wrong. We can pass a context hint down through the calls to let ionic_tx_clean() know what we're doing so it can call napi_consume_skb() correctly. Fixes: 386e69865311 ("ionic: Make use napi_consume_skb") Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_dev.h | 4 ++- .../net/ethernet/pensando/ionic/ionic_lif.c | 2 +- .../net/ethernet/pensando/ionic/ionic_txrx.c | 28 +++++++++++-------- 3 files changed, 21 insertions(+), 13 deletions(-) v3: use budget for the hint where we can (Jakub) v2: replace softirq_count() with a napi context hint (Jakub) https://lore.kernel.org/netdev/20240620192519.35395-1-shannon.nelson@amd.com/ v1: https://lore.kernel.org/netdev/20240619212022.30700-1-shannon.nelson@amd.com/ diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index f30eee4a5a80..b6c01a88098d 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -375,7 +375,9 @@ typedef void (*ionic_cq_done_cb)(void *done_arg); unsigned int ionic_cq_service(struct ionic_cq *cq, unsigned int work_to_do, ionic_cq_cb cb, ionic_cq_done_cb done_cb, void *done_arg); -unsigned int ionic_tx_cq_service(struct ionic_cq *cq, unsigned int work_to_do); +unsigned int ionic_tx_cq_service(struct ionic_cq *cq, + unsigned int work_to_do, + bool in_napi); int ionic_q_init(struct ionic_lif *lif, struct ionic_dev *idev, struct ionic_queue *q, unsigned int index, const char *name, diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 1934e9d6d9e4..1837a30ba08a 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1189,7 +1189,7 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget) ionic_rx_service, NULL, NULL); if (lif->hwstamp_txq) - tx_work = ionic_tx_cq_service(&lif->hwstamp_txq->cq, budget); + tx_work = ionic_tx_cq_service(&lif->hwstamp_txq->cq, budget, !!budget); work_done = max(max(n_work, a_work), max(rx_work, tx_work)); if (work_done < budget && napi_complete_done(napi, work_done)) { diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index 2427610f4306..995d7f7d96d0 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -23,7 +23,8 @@ static void ionic_tx_desc_unmap_bufs(struct ionic_queue *q, static void ionic_tx_clean(struct ionic_queue *q, struct ionic_tx_desc_info *desc_info, - struct ionic_txq_comp *comp); + struct ionic_txq_comp *comp, + bool in_napi); static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell) { @@ -935,7 +936,7 @@ int ionic_tx_napi(struct napi_struct *napi, int budget) u32 work_done = 0; u32 flags = 0; - work_done = ionic_tx_cq_service(cq, budget); + work_done = ionic_tx_cq_service(cq, budget, !!budget); if (unlikely(!budget)) return budget; @@ -1019,7 +1020,7 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget) txqcq = lif->txqcqs[qi]; txcq = &lif->txqcqs[qi]->cq; - tx_work_done = ionic_tx_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT); + tx_work_done = ionic_tx_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT, !!budget); if (unlikely(!budget)) return budget; @@ -1152,7 +1153,8 @@ static void ionic_tx_desc_unmap_bufs(struct ionic_queue *q, static void ionic_tx_clean(struct ionic_queue *q, struct ionic_tx_desc_info *desc_info, - struct ionic_txq_comp *comp) + struct ionic_txq_comp *comp, + bool in_napi) { struct ionic_tx_stats *stats = q_to_tx_stats(q); struct ionic_qcq *qcq = q_to_qcq(q); @@ -1204,11 +1206,13 @@ static void ionic_tx_clean(struct ionic_queue *q, desc_info->bytes = skb->len; stats->clean++; - napi_consume_skb(skb, 1); + napi_consume_skb(skb, likely(in_napi) ? 1 : 0); } static bool ionic_tx_service(struct ionic_cq *cq, - unsigned int *total_pkts, unsigned int *total_bytes) + unsigned int *total_pkts, + unsigned int *total_bytes, + bool in_napi) { struct ionic_tx_desc_info *desc_info; struct ionic_queue *q = cq->bound_q; @@ -1230,7 +1234,7 @@ static bool ionic_tx_service(struct ionic_cq *cq, desc_info->bytes = 0; index = q->tail_idx; q->tail_idx = (q->tail_idx + 1) & (q->num_descs - 1); - ionic_tx_clean(q, desc_info, comp); + ionic_tx_clean(q, desc_info, comp, in_napi); if (desc_info->skb) { pkts++; bytes += desc_info->bytes; @@ -1244,7 +1248,9 @@ static bool ionic_tx_service(struct ionic_cq *cq, return true; } -unsigned int ionic_tx_cq_service(struct ionic_cq *cq, unsigned int work_to_do) +unsigned int ionic_tx_cq_service(struct ionic_cq *cq, + unsigned int work_to_do, + bool in_napi) { unsigned int work_done = 0; unsigned int bytes = 0; @@ -1253,7 +1259,7 @@ unsigned int ionic_tx_cq_service(struct ionic_cq *cq, unsigned int work_to_do) if (work_to_do == 0) return 0; - while (ionic_tx_service(cq, &pkts, &bytes)) { + while (ionic_tx_service(cq, &pkts, &bytes, in_napi)) { if (cq->tail_idx == cq->num_descs - 1) cq->done_color = !cq->done_color; cq->tail_idx = (cq->tail_idx + 1) & (cq->num_descs - 1); @@ -1279,7 +1285,7 @@ void ionic_tx_flush(struct ionic_cq *cq) { u32 work_done; - work_done = ionic_tx_cq_service(cq, cq->num_descs); + work_done = ionic_tx_cq_service(cq, cq->num_descs, false); if (work_done) ionic_intr_credits(cq->idev->intr_ctrl, cq->bound_intr->index, work_done, IONIC_INTR_CRED_RESET_COALESCE); @@ -1296,7 +1302,7 @@ void ionic_tx_empty(struct ionic_queue *q) desc_info = &q->tx_info[q->tail_idx]; desc_info->bytes = 0; q->tail_idx = (q->tail_idx + 1) & (q->num_descs - 1); - ionic_tx_clean(q, desc_info, NULL); + ionic_tx_clean(q, desc_info, NULL, false); if (desc_info->skb) { pkts++; bytes += desc_info->bytes; -- 2.17.1 .