Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'eth-fbnic-trivial-code-tweaks'

Jakub Kicinski says:

====================
eth: fbnic: trivial code tweaks

A handful of code cleanups. No functional changes.
====================

Link: https://patch.msgid.link/20250624142834.3275164-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+69 -78
+8 -14
drivers/net/ethernet/meta/fbnic/fbnic_csr.h
··· 493 493 494 494 #define FBNIC_PTP_ADD_VAL_NS 0x04806 /* 0x12018 */ 495 495 #define FBNIC_PTP_ADD_VAL_NS_MASK CSR_GENMASK(15, 0) 496 - #define FBNIC_PTP_ADD_VAL_SUBNS 0x04807 /* 0x1201c */ 496 + #define FBNIC_PTP_ADD_VAL_SUBNS 0x04807 /* 0x1201c */ 497 497 498 498 #define FBNIC_PTP_CTR_VAL_HI 0x04808 /* 0x12020 */ 499 499 #define FBNIC_PTP_CTR_VAL_LO 0x04809 /* 0x12024 */ ··· 816 816 #define FBNIC_CSR_START_MAC_STAT 0x11a00 817 817 #define FBNIC_MAC_STAT_RX_BYTE_COUNT_L 0x11a08 /* 0x46820 */ 818 818 #define FBNIC_MAC_STAT_RX_BYTE_COUNT_H 0x11a09 /* 0x46824 */ 819 - #define FBNIC_MAC_STAT_RX_ALIGN_ERROR_L \ 820 - 0x11a0a /* 0x46828 */ 821 - #define FBNIC_MAC_STAT_RX_ALIGN_ERROR_H \ 822 - 0x11a0b /* 0x4682c */ 819 + #define FBNIC_MAC_STAT_RX_ALIGN_ERROR_L 0x11a0a /* 0x46828 */ 820 + #define FBNIC_MAC_STAT_RX_ALIGN_ERROR_H 0x11a0b /* 0x4682c */ 823 821 #define FBNIC_MAC_STAT_RX_TOOLONG_L 0x11a0e /* 0x46838 */ 824 822 #define FBNIC_MAC_STAT_RX_TOOLONG_H 0x11a0f /* 0x4683c */ 825 - #define FBNIC_MAC_STAT_RX_RECEIVED_OK_L \ 826 - 0x11a12 /* 0x46848 */ 827 - #define FBNIC_MAC_STAT_RX_RECEIVED_OK_H \ 828 - 0x11a13 /* 0x4684c */ 823 + #define FBNIC_MAC_STAT_RX_RECEIVED_OK_L 0x11a12 /* 0x46848 */ 824 + #define FBNIC_MAC_STAT_RX_RECEIVED_OK_H 0x11a13 /* 0x4684c */ 829 825 #define FBNIC_MAC_STAT_RX_PACKET_BAD_FCS_L \ 830 826 0x11a14 /* 0x46850 */ 831 827 #define FBNIC_MAC_STAT_RX_PACKET_BAD_FCS_H \ ··· 878 882 0x11a42 /* 0x46908 */ 879 883 #define FBNIC_MAC_STAT_TX_TRANSMITTED_OK_H \ 880 884 0x11a43 /* 0x4690c */ 881 - #define FBNIC_MAC_STAT_TX_IFOUTERRORS_L \ 882 - 0x11a46 /* 0x46918 */ 883 - #define FBNIC_MAC_STAT_TX_IFOUTERRORS_H \ 884 - 0x11a47 /* 0x4691c */ 885 + #define FBNIC_MAC_STAT_TX_IFOUTERRORS_L 0x11a46 /* 0x46918 */ 886 + #define FBNIC_MAC_STAT_TX_IFOUTERRORS_H 0x11a47 /* 0x4691c */ 885 887 #define FBNIC_MAC_STAT_TX_MULTICAST_L 0x11a4a /* 0x46928 */ 886 888 #define FBNIC_MAC_STAT_TX_MULTICAST_H 0x11a4b /* 0x4692c */ 887 889 #define FBNIC_MAC_STAT_TX_BROADCAST_L 0x11a4c /* 0x46930 */ ··· 963 969 0x3107e /* 0xc41f8 */ 964 970 #define FBNIC_PUL_USER_OB_RD_DBG_CNT_NP_CRED_63_32 \ 965 971 0x3107f /* 0xc41fc */ 966 - #define FBNIC_CSR_END_PUL_USER 0x310ea /* CSR section delimiter */ 972 + #define FBNIC_CSR_END_PUL_USER 0x310ea /* CSR section delimiter */ 967 973 968 974 /* Queue Registers 969 975 *
+2 -2
drivers/net/ethernet/meta/fbnic/fbnic_devlink.c
··· 182 182 else 183 183 err = -ETIMEDOUT; 184 184 185 - fbnic_fw_clear_cmpl(fbd, cmpl); 185 + fbnic_mbx_clear_cmpl(fbd, cmpl); 186 186 cmpl_free: 187 187 fbnic_fw_put_cmpl(cmpl); 188 188 ··· 300 300 component_name, 0, 0); 301 301 } 302 302 303 - fbnic_fw_clear_cmpl(fbd, cmpl); 303 + fbnic_mbx_clear_cmpl(fbd, cmpl); 304 304 cmpl_free: 305 305 fbnic_fw_put_cmpl(cmpl); 306 306
+36 -37
drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
··· 1676 1676 } 1677 1677 1678 1678 static const struct ethtool_ops fbnic_ethtool_ops = { 1679 - .supported_coalesce_params = 1680 - ETHTOOL_COALESCE_USECS | 1681 - ETHTOOL_COALESCE_RX_MAX_FRAMES, 1682 - .rxfh_max_num_contexts = FBNIC_RPC_RSS_TBL_COUNT, 1683 - .get_drvinfo = fbnic_get_drvinfo, 1684 - .get_regs_len = fbnic_get_regs_len, 1685 - .get_regs = fbnic_get_regs, 1686 - .get_link = ethtool_op_get_link, 1687 - .get_coalesce = fbnic_get_coalesce, 1688 - .set_coalesce = fbnic_set_coalesce, 1689 - .get_ringparam = fbnic_get_ringparam, 1690 - .set_ringparam = fbnic_set_ringparam, 1691 - .get_pauseparam = fbnic_phylink_get_pauseparam, 1692 - .set_pauseparam = fbnic_phylink_set_pauseparam, 1693 - .get_strings = fbnic_get_strings, 1694 - .get_ethtool_stats = fbnic_get_ethtool_stats, 1695 - .get_sset_count = fbnic_get_sset_count, 1696 - .get_rxnfc = fbnic_get_rxnfc, 1697 - .set_rxnfc = fbnic_set_rxnfc, 1698 - .get_rxfh_key_size = fbnic_get_rxfh_key_size, 1699 - .get_rxfh_indir_size = fbnic_get_rxfh_indir_size, 1700 - .get_rxfh = fbnic_get_rxfh, 1701 - .set_rxfh = fbnic_set_rxfh, 1702 - .get_rxfh_fields = fbnic_get_rss_hash_opts, 1703 - .set_rxfh_fields = fbnic_set_rss_hash_opts, 1704 - .create_rxfh_context = fbnic_create_rxfh_context, 1705 - .modify_rxfh_context = fbnic_modify_rxfh_context, 1706 - .remove_rxfh_context = fbnic_remove_rxfh_context, 1707 - .get_channels = fbnic_get_channels, 1708 - .set_channels = fbnic_set_channels, 1709 - .get_ts_info = fbnic_get_ts_info, 1710 - .get_ts_stats = fbnic_get_ts_stats, 1711 - .get_link_ksettings = fbnic_phylink_ethtool_ksettings_get, 1712 - .get_fecparam = fbnic_phylink_get_fecparam, 1713 - .get_eth_mac_stats = fbnic_get_eth_mac_stats, 1714 - .get_eth_ctrl_stats = fbnic_get_eth_ctrl_stats, 1715 - .get_rmon_stats = fbnic_get_rmon_stats, 1679 + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | 1680 + ETHTOOL_COALESCE_RX_MAX_FRAMES, 1681 + .rxfh_max_num_contexts = FBNIC_RPC_RSS_TBL_COUNT, 1682 + .get_drvinfo = fbnic_get_drvinfo, 1683 + .get_regs_len = fbnic_get_regs_len, 1684 + .get_regs = fbnic_get_regs, 1685 + .get_link = ethtool_op_get_link, 1686 + .get_coalesce = fbnic_get_coalesce, 1687 + .set_coalesce = fbnic_set_coalesce, 1688 + .get_ringparam = fbnic_get_ringparam, 1689 + .set_ringparam = fbnic_set_ringparam, 1690 + .get_pauseparam = fbnic_phylink_get_pauseparam, 1691 + .set_pauseparam = fbnic_phylink_set_pauseparam, 1692 + .get_strings = fbnic_get_strings, 1693 + .get_ethtool_stats = fbnic_get_ethtool_stats, 1694 + .get_sset_count = fbnic_get_sset_count, 1695 + .get_rxnfc = fbnic_get_rxnfc, 1696 + .set_rxnfc = fbnic_set_rxnfc, 1697 + .get_rxfh_key_size = fbnic_get_rxfh_key_size, 1698 + .get_rxfh_indir_size = fbnic_get_rxfh_indir_size, 1699 + .get_rxfh = fbnic_get_rxfh, 1700 + .set_rxfh = fbnic_set_rxfh, 1701 + .get_rxfh_fields = fbnic_get_rss_hash_opts, 1702 + .set_rxfh_fields = fbnic_set_rss_hash_opts, 1703 + .create_rxfh_context = fbnic_create_rxfh_context, 1704 + .modify_rxfh_context = fbnic_modify_rxfh_context, 1705 + .remove_rxfh_context = fbnic_remove_rxfh_context, 1706 + .get_channels = fbnic_get_channels, 1707 + .set_channels = fbnic_set_channels, 1708 + .get_ts_info = fbnic_get_ts_info, 1709 + .get_ts_stats = fbnic_get_ts_stats, 1710 + .get_link_ksettings = fbnic_phylink_ethtool_ksettings_get, 1711 + .get_fecparam = fbnic_phylink_get_fecparam, 1712 + .get_eth_mac_stats = fbnic_get_eth_mac_stats, 1713 + .get_eth_ctrl_stats = fbnic_get_eth_ctrl_stats, 1714 + .get_rmon_stats = fbnic_get_rmon_stats, 1716 1715 }; 1717 1716 1718 1717 void fbnic_set_ethtool_ops(struct net_device *dev)
+15 -15
drivers/net/ethernet/meta/fbnic/fbnic_fw.c
··· 338 338 return err; 339 339 } 340 340 341 + void fbnic_mbx_clear_cmpl(struct fbnic_dev *fbd, 342 + struct fbnic_fw_completion *fw_cmpl) 343 + { 344 + unsigned long flags; 345 + 346 + spin_lock_irqsave(&fbd->fw_tx_lock, flags); 347 + fbnic_mbx_clear_cmpl_slot(fbd, fw_cmpl); 348 + spin_unlock_irqrestore(&fbd->fw_tx_lock, flags); 349 + } 350 + 341 351 static void fbnic_fw_release_cmpl_data(struct kref *kref) 342 352 { 343 353 struct fbnic_fw_completion *cmpl_data; ··· 386 376 * 387 377 * Return: 388 378 * One the following values: 389 - * -EOPNOTSUPP: Is not ASIC so mailbox is not supported 390 - * -ENODEV: Device I/O error 391 - * -ENOMEM: Failed to allocate message 392 - * -EBUSY: No space in mailbox 393 - * -ENOSPC: DMA mapping failed 379 + * -EOPNOTSUPP: Is not ASIC so mailbox is not supported 380 + * -ENODEV: Device I/O error 381 + * -ENOMEM: Failed to allocate message 382 + * -EBUSY: No space in mailbox 383 + * -ENOSPC: DMA mapping failed 394 384 * 395 385 * This function sends a single TLV header indicating the host wants to take 396 386 * some action. However there are no other side effects which means that any ··· 1271 1261 kref_init(&cmpl->ref_count); 1272 1262 1273 1263 return cmpl; 1274 - } 1275 - 1276 - void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd, 1277 - struct fbnic_fw_completion *fw_cmpl) 1278 - { 1279 - unsigned long flags; 1280 - 1281 - spin_lock_irqsave(&fbd->fw_tx_lock, flags); 1282 - fbnic_mbx_clear_cmpl_slot(fbd, fw_cmpl); 1283 - spin_unlock_irqrestore(&fbd->fw_tx_lock, flags); 1284 1264 } 1285 1265 1286 1266 void fbnic_fw_put_cmpl(struct fbnic_fw_completion *fw_cmpl)
+4 -4
drivers/net/ethernet/meta/fbnic/fbnic_fw.h
··· 19 19 }; 20 20 21 21 // FW_VER_MAX_SIZE must match ETHTOOL_FWVERS_LEN 22 - #define FBNIC_FW_VER_MAX_SIZE 32 22 + #define FBNIC_FW_VER_MAX_SIZE 32 23 23 // Formatted version is in the format XX.YY.ZZ_RRR_COMMIT 24 24 #define FBNIC_FW_CAP_RESP_COMMIT_MAX_SIZE (FBNIC_FW_VER_MAX_SIZE - 13) 25 - #define FBNIC_FW_LOG_MAX_SIZE 256 25 + #define FBNIC_FW_LOG_MAX_SIZE 256 26 26 27 27 struct fbnic_fw_ver { 28 28 u32 version; ··· 66 66 void fbnic_mbx_clean(struct fbnic_dev *fbd); 67 67 int fbnic_mbx_set_cmpl(struct fbnic_dev *fbd, 68 68 struct fbnic_fw_completion *cmpl_data); 69 + void fbnic_mbx_clear_cmpl(struct fbnic_dev *fbd, 70 + struct fbnic_fw_completion *cmpl_data); 69 71 void fbnic_mbx_poll(struct fbnic_dev *fbd); 70 72 int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd); 71 73 void fbnic_mbx_flush_tx(struct fbnic_dev *fbd); ··· 83 81 int fbnic_fw_xmit_tsene_read_msg(struct fbnic_dev *fbd, 84 82 struct fbnic_fw_completion *cmpl_data); 85 83 struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type); 86 - void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd, 87 - struct fbnic_fw_completion *cmpl_data); 88 84 void fbnic_fw_put_cmpl(struct fbnic_fw_completion *cmpl_data); 89 85 90 86 #define fbnic_mk_full_fw_ver_str(_rev_id, _delim, _commit, _str, _str_sz) \
+1 -1
drivers/net/ethernet/meta/fbnic/fbnic_mac.c
··· 796 796 797 797 *val = *sensor; 798 798 exit_cleanup: 799 - fbnic_fw_clear_cmpl(fbd, fw_cmpl); 799 + fbnic_mbx_clear_cmpl(fbd, fw_cmpl); 800 800 exit_free: 801 801 fbnic_fw_put_cmpl(fw_cmpl); 802 802
+3 -2
drivers/net/ethernet/meta/fbnic/fbnic_netdev.h
··· 4 4 #ifndef _FBNIC_NETDEV_H_ 5 5 #define _FBNIC_NETDEV_H_ 6 6 7 - #include <linux/types.h> 8 7 #include <linux/phylink.h> 8 + #include <linux/types.h> 9 9 10 10 #include "fbnic_csr.h" 11 11 #include "fbnic_rpc.h" ··· 66 66 struct fbnic_queue_stats rx_stats; 67 67 u64 link_down_events; 68 68 69 - /* Time stampinn filter config */ 69 + /* Time stamping filter config */ 70 70 struct kernel_hwtstamp_config hwtstamp_config; 71 71 }; 72 72 ··· 81 81 void fbnic_netdev_unregister(struct net_device *netdev); 82 82 void fbnic_reset_queues(struct fbnic_net *fbn, 83 83 unsigned int tx, unsigned int rx); 84 + 84 85 void fbnic_set_ethtool_ops(struct net_device *dev); 85 86 86 87 int fbnic_ptp_setup(struct fbnic_dev *fbd);
-3
drivers/net/ethernet/meta/fbnic/fbnic_txrx.h
··· 141 141 struct fbnic_q_triad qt[]; 142 142 }; 143 143 144 - #define FBNIC_MAX_TXQS 128u 145 - #define FBNIC_MAX_RXQS 128u 146 - 147 144 netdev_tx_t fbnic_xmit_frame(struct sk_buff *skb, struct net_device *dev); 148 145 netdev_features_t 149 146 fbnic_features_check(struct sk_buff *skb, struct net_device *dev,