Skip to content

Commit 0afcde8

Browse files
author
Paolo Abeni
committed
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/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents a8a3bdd + d42e524 commit 0afcde8

File tree

8 files changed

+69
-78
lines changed

8 files changed

+69
-78
lines changed

drivers/net/ethernet/meta/fbnic/fbnic_csr.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ enum {
493493

494494
#define FBNIC_PTP_ADD_VAL_NS 0x04806 /* 0x12018 */
495495
#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 */
497497

498498
#define FBNIC_PTP_CTR_VAL_HI 0x04808 /* 0x12020 */
499499
#define FBNIC_PTP_CTR_VAL_LO 0x04809 /* 0x12024 */
@@ -816,16 +816,12 @@ enum {
816816
#define FBNIC_CSR_START_MAC_STAT 0x11a00
817817
#define FBNIC_MAC_STAT_RX_BYTE_COUNT_L 0x11a08 /* 0x46820 */
818818
#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 */
823821
#define FBNIC_MAC_STAT_RX_TOOLONG_L 0x11a0e /* 0x46838 */
824822
#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 */
829825
#define FBNIC_MAC_STAT_RX_PACKET_BAD_FCS_L \
830826
0x11a14 /* 0x46850 */
831827
#define FBNIC_MAC_STAT_RX_PACKET_BAD_FCS_H \
@@ -882,10 +878,8 @@ enum {
882878
0x11a42 /* 0x46908 */
883879
#define FBNIC_MAC_STAT_TX_TRANSMITTED_OK_H \
884880
0x11a43 /* 0x4690c */
885-
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_L \
886-
0x11a46 /* 0x46918 */
887-
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_H \
888-
0x11a47 /* 0x4691c */
881+
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_L 0x11a46 /* 0x46918 */
882+
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_H 0x11a47 /* 0x4691c */
889883
#define FBNIC_MAC_STAT_TX_MULTICAST_L 0x11a4a /* 0x46928 */
890884
#define FBNIC_MAC_STAT_TX_MULTICAST_H 0x11a4b /* 0x4692c */
891885
#define FBNIC_MAC_STAT_TX_BROADCAST_L 0x11a4c /* 0x46930 */
@@ -969,7 +963,7 @@ enum {
969963
0x3107e /* 0xc41f8 */
970964
#define FBNIC_PUL_USER_OB_RD_DBG_CNT_NP_CRED_63_32 \
971965
0x3107f /* 0xc41fc */
972-
#define FBNIC_CSR_END_PUL_USER 0x310ea /* CSR section delimiter */
966+
#define FBNIC_CSR_END_PUL_USER 0x310ea /* CSR section delimiter */
973967

974968
/* Queue Registers
975969
*

drivers/net/ethernet/meta/fbnic/fbnic_devlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fbnic_flash_start(struct fbnic_dev *fbd, struct pldmfw_component *component)
182182
else
183183
err = -ETIMEDOUT;
184184

185-
fbnic_fw_clear_cmpl(fbd, cmpl);
185+
fbnic_mbx_clear_cmpl(fbd, cmpl);
186186
cmpl_free:
187187
fbnic_fw_put_cmpl(cmpl);
188188

@@ -300,7 +300,7 @@ fbnic_flash_component(struct pldmfw *context,
300300
component_name, 0, 0);
301301
}
302302

303-
fbnic_fw_clear_cmpl(fbd, cmpl);
303+
fbnic_mbx_clear_cmpl(fbd, cmpl);
304304
cmpl_free:
305305
fbnic_fw_put_cmpl(cmpl);
306306

drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,43 +1676,42 @@ fbnic_get_rmon_stats(struct net_device *netdev,
16761676
}
16771677

16781678
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,
17161715
};
17171716

17181717
void fbnic_set_ethtool_ops(struct net_device *dev)

drivers/net/ethernet/meta/fbnic/fbnic_fw.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@ static int fbnic_mbx_map_req_w_cmpl(struct fbnic_dev *fbd,
338338
return err;
339339
}
340340

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+
341351
static void fbnic_fw_release_cmpl_data(struct kref *kref)
342352
{
343353
struct fbnic_fw_completion *cmpl_data;
@@ -376,11 +386,11 @@ fbnic_fw_get_cmpl_by_type(struct fbnic_dev *fbd, u32 msg_type)
376386
*
377387
* Return:
378388
* One the following values:
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
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
384394
*
385395
* This function sends a single TLV header indicating the host wants to take
386396
* some action. However there are no other side effects which means that any
@@ -1263,16 +1273,6 @@ struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type)
12631273
return cmpl;
12641274
}
12651275

1266-
void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd,
1267-
struct fbnic_fw_completion *fw_cmpl)
1268-
{
1269-
unsigned long flags;
1270-
1271-
spin_lock_irqsave(&fbd->fw_tx_lock, flags);
1272-
fbnic_mbx_clear_cmpl_slot(fbd, fw_cmpl);
1273-
spin_unlock_irqrestore(&fbd->fw_tx_lock, flags);
1274-
}
1275-
12761276
void fbnic_fw_put_cmpl(struct fbnic_fw_completion *fw_cmpl)
12771277
{
12781278
kref_put(&fw_cmpl->ref_count, fbnic_fw_release_cmpl_data);

drivers/net/ethernet/meta/fbnic/fbnic_fw.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ struct fbnic_fw_mbx {
1919
};
2020

2121
// 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
2323
// Formatted version is in the format XX.YY.ZZ_RRR_COMMIT
2424
#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
2626

2727
struct fbnic_fw_ver {
2828
u32 version;
@@ -66,6 +66,8 @@ void fbnic_mbx_init(struct fbnic_dev *fbd);
6666
void fbnic_mbx_clean(struct fbnic_dev *fbd);
6767
int fbnic_mbx_set_cmpl(struct fbnic_dev *fbd,
6868
struct fbnic_fw_completion *cmpl_data);
69+
void fbnic_mbx_clear_cmpl(struct fbnic_dev *fbd,
70+
struct fbnic_fw_completion *cmpl_data);
6971
void fbnic_mbx_poll(struct fbnic_dev *fbd);
7072
int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd);
7173
void fbnic_mbx_flush_tx(struct fbnic_dev *fbd);
@@ -81,8 +83,6 @@ int fbnic_fw_xmit_fw_write_chunk(struct fbnic_dev *fbd,
8183
int fbnic_fw_xmit_tsene_read_msg(struct fbnic_dev *fbd,
8284
struct fbnic_fw_completion *cmpl_data);
8385
struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type);
84-
void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd,
85-
struct fbnic_fw_completion *cmpl_data);
8686
void fbnic_fw_put_cmpl(struct fbnic_fw_completion *cmpl_data);
8787

8888
#define fbnic_mk_full_fw_ver_str(_rev_id, _delim, _commit, _str, _str_sz) \

drivers/net/ethernet/meta/fbnic/fbnic_mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ static int fbnic_mac_get_sensor_asic(struct fbnic_dev *fbd, int id,
796796

797797
*val = *sensor;
798798
exit_cleanup:
799-
fbnic_fw_clear_cmpl(fbd, fw_cmpl);
799+
fbnic_mbx_clear_cmpl(fbd, fw_cmpl);
800800
exit_free:
801801
fbnic_fw_put_cmpl(fw_cmpl);
802802

drivers/net/ethernet/meta/fbnic/fbnic_netdev.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#ifndef _FBNIC_NETDEV_H_
55
#define _FBNIC_NETDEV_H_
66

7-
#include <linux/types.h>
87
#include <linux/phylink.h>
8+
#include <linux/types.h>
99

1010
#include "fbnic_csr.h"
1111
#include "fbnic_rpc.h"
@@ -66,7 +66,7 @@ struct fbnic_net {
6666
struct fbnic_queue_stats rx_stats;
6767
u64 link_down_events;
6868

69-
/* Time stampinn filter config */
69+
/* Time stamping filter config */
7070
struct kernel_hwtstamp_config hwtstamp_config;
7171
};
7272

@@ -81,6 +81,7 @@ int fbnic_netdev_register(struct net_device *netdev);
8181
void fbnic_netdev_unregister(struct net_device *netdev);
8282
void fbnic_reset_queues(struct fbnic_net *fbn,
8383
unsigned int tx, unsigned int rx);
84+
8485
void fbnic_set_ethtool_ops(struct net_device *dev);
8586

8687
int fbnic_ptp_setup(struct fbnic_dev *fbd);

drivers/net/ethernet/meta/fbnic/fbnic_txrx.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ struct fbnic_napi_vector {
141141
struct fbnic_q_triad qt[];
142142
};
143143

144-
#define FBNIC_MAX_TXQS 128u
145-
#define FBNIC_MAX_RXQS 128u
146-
147144
netdev_tx_t fbnic_xmit_frame(struct sk_buff *skb, struct net_device *dev);
148145
netdev_features_t
149146
fbnic_features_check(struct sk_buff *skb, struct net_device *dev,

0 commit comments

Comments
 (0)