Commit 0afcde80 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

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: default avatarPaolo Abeni <pabeni@redhat.com>
parents a8a3bddb d42e5248
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -816,16 +816,12 @@ enum {
#define FBNIC_CSR_START_MAC_STAT	0x11a00
#define FBNIC_MAC_STAT_RX_BYTE_COUNT_L	0x11a08		/* 0x46820 */
#define FBNIC_MAC_STAT_RX_BYTE_COUNT_H	0x11a09		/* 0x46824 */
#define FBNIC_MAC_STAT_RX_ALIGN_ERROR_L \
					0x11a0a		/* 0x46828 */
#define FBNIC_MAC_STAT_RX_ALIGN_ERROR_H \
					0x11a0b		/* 0x4682c */
#define FBNIC_MAC_STAT_RX_ALIGN_ERROR_L	0x11a0a		/* 0x46828 */
#define FBNIC_MAC_STAT_RX_ALIGN_ERROR_H	0x11a0b		/* 0x4682c */
#define FBNIC_MAC_STAT_RX_TOOLONG_L	0x11a0e		/* 0x46838 */
#define FBNIC_MAC_STAT_RX_TOOLONG_H	0x11a0f		/* 0x4683c */
#define FBNIC_MAC_STAT_RX_RECEIVED_OK_L	\
					0x11a12		/* 0x46848 */
#define FBNIC_MAC_STAT_RX_RECEIVED_OK_H	\
					0x11a13		/* 0x4684c */
#define FBNIC_MAC_STAT_RX_RECEIVED_OK_L	0x11a12		/* 0x46848 */
#define FBNIC_MAC_STAT_RX_RECEIVED_OK_H	0x11a13		/* 0x4684c */
#define FBNIC_MAC_STAT_RX_PACKET_BAD_FCS_L \
					0x11a14		/* 0x46850 */
#define FBNIC_MAC_STAT_RX_PACKET_BAD_FCS_H \
@@ -882,10 +878,8 @@ enum {
					0x11a42		/* 0x46908 */
#define FBNIC_MAC_STAT_TX_TRANSMITTED_OK_H \
					0x11a43		/* 0x4690c */
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_L \
					0x11a46		/* 0x46918 */
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_H \
					0x11a47		/* 0x4691c */
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_L	0x11a46		/* 0x46918 */
#define FBNIC_MAC_STAT_TX_IFOUTERRORS_H	0x11a47		/* 0x4691c */
#define FBNIC_MAC_STAT_TX_MULTICAST_L	0x11a4a		/* 0x46928 */
#define FBNIC_MAC_STAT_TX_MULTICAST_H	0x11a4b		/* 0x4692c */
#define FBNIC_MAC_STAT_TX_BROADCAST_L	0x11a4c		/* 0x46930 */
+2 −2
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ fbnic_flash_start(struct fbnic_dev *fbd, struct pldmfw_component *component)
	else
		err = -ETIMEDOUT;

	fbnic_fw_clear_cmpl(fbd, cmpl);
	fbnic_mbx_clear_cmpl(fbd, cmpl);
cmpl_free:
	fbnic_fw_put_cmpl(cmpl);

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

	fbnic_fw_clear_cmpl(fbd, cmpl);
	fbnic_mbx_clear_cmpl(fbd, cmpl);
cmpl_free:
	fbnic_fw_put_cmpl(cmpl);

+36 −37
Original line number Diff line number Diff line
@@ -1676,8 +1676,7 @@ fbnic_get_rmon_stats(struct net_device *netdev,
}

static const struct ethtool_ops fbnic_ethtool_ops = {
	.supported_coalesce_params	=
				  ETHTOOL_COALESCE_USECS |
	.supported_coalesce_params	= ETHTOOL_COALESCE_USECS |
					  ETHTOOL_COALESCE_RX_MAX_FRAMES,
	.rxfh_max_num_contexts		= FBNIC_RPC_RSS_TBL_COUNT,
	.get_drvinfo			= fbnic_get_drvinfo,
+15 −15
Original line number Diff line number Diff line
@@ -338,6 +338,16 @@ static int fbnic_mbx_map_req_w_cmpl(struct fbnic_dev *fbd,
	return err;
}

void fbnic_mbx_clear_cmpl(struct fbnic_dev *fbd,
			  struct fbnic_fw_completion *fw_cmpl)
{
	unsigned long flags;

	spin_lock_irqsave(&fbd->fw_tx_lock, flags);
	fbnic_mbx_clear_cmpl_slot(fbd, fw_cmpl);
	spin_unlock_irqrestore(&fbd->fw_tx_lock, flags);
}

static void fbnic_fw_release_cmpl_data(struct kref *kref)
{
	struct fbnic_fw_completion *cmpl_data;
@@ -1263,16 +1273,6 @@ struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type)
	return cmpl;
}

void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd,
			 struct fbnic_fw_completion *fw_cmpl)
{
	unsigned long flags;

	spin_lock_irqsave(&fbd->fw_tx_lock, flags);
	fbnic_mbx_clear_cmpl_slot(fbd, fw_cmpl);
	spin_unlock_irqrestore(&fbd->fw_tx_lock, flags);
}

void fbnic_fw_put_cmpl(struct fbnic_fw_completion *fw_cmpl)
{
	kref_put(&fw_cmpl->ref_count, fbnic_fw_release_cmpl_data);
+4 −4
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ void fbnic_mbx_init(struct fbnic_dev *fbd);
void fbnic_mbx_clean(struct fbnic_dev *fbd);
int fbnic_mbx_set_cmpl(struct fbnic_dev *fbd,
		       struct fbnic_fw_completion *cmpl_data);
void fbnic_mbx_clear_cmpl(struct fbnic_dev *fbd,
			  struct fbnic_fw_completion *cmpl_data);
void fbnic_mbx_poll(struct fbnic_dev *fbd);
int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd);
void fbnic_mbx_flush_tx(struct fbnic_dev *fbd);
@@ -81,8 +83,6 @@ int fbnic_fw_xmit_fw_write_chunk(struct fbnic_dev *fbd,
int fbnic_fw_xmit_tsene_read_msg(struct fbnic_dev *fbd,
				 struct fbnic_fw_completion *cmpl_data);
struct fbnic_fw_completion *fbnic_fw_alloc_cmpl(u32 msg_type);
void fbnic_fw_clear_cmpl(struct fbnic_dev *fbd,
			 struct fbnic_fw_completion *cmpl_data);
void fbnic_fw_put_cmpl(struct fbnic_fw_completion *cmpl_data);

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