diff mbox series

[net] nfp: checking parameter process for rx-usecs/tx-usecs is invalid

Message ID 20211119133803.28749-1-simon.horman@corigine.com (mailing list archive)
State Accepted
Commit 3bd6b2a838ba6a3b86d41b077f570b1b61174def
Delegated to: Netdev Maintainers
Headers show
Series [net] nfp: checking parameter process for rx-usecs/tx-usecs is invalid | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: dirk.vandermerwe@netronome.com; 4 maintainers not CCed: yinjun.zhang@corigine.com dirk.vandermerwe@netronome.com alexanderduyck@fb.com yu.xiao@corigine.com
netdev/build_clang success Errors and warnings before: 5 this patch: 5
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 23 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Simon Horman Nov. 19, 2021, 1:38 p.m. UTC
From: Diana Wang <na.wang@corigine.com>

Use nn->tlv_caps.me_freq_mhz instead of nn->me_freq_mhz to check whether
rx-usecs/tx-usecs is valid.

This is because nn->tlv_caps.me_freq_mhz represents the clock_freq (MHz) of
the flow processing cores (FPC) on the NIC. While nn->me_freq_mhz is not
be set.

Fixes: ce991ab6662a ("nfp: read ME frequency from vNIC ctrl memory")
Signed-off-by: Diana Wang <na.wang@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_net.h         | 3 ---
 drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

Jakub Kicinski Nov. 19, 2021, 2:55 p.m. UTC | #1
On Fri, 19 Nov 2021 14:38:03 +0100 Simon Horman wrote:
> From: Diana Wang <na.wang@corigine.com>
> 
> Use nn->tlv_caps.me_freq_mhz instead of nn->me_freq_mhz to check whether
> rx-usecs/tx-usecs is valid.
> 
> This is because nn->tlv_caps.me_freq_mhz represents the clock_freq (MHz) of
> the flow processing cores (FPC) on the NIC. While nn->me_freq_mhz is not
> be set.
> 
> Fixes: ce991ab6662a ("nfp: read ME frequency from vNIC ctrl memory")
> Signed-off-by: Diana Wang <na.wang@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
patchwork-bot+netdevbpf@kernel.org Nov. 22, 2021, 12:50 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 19 Nov 2021 14:38:03 +0100 you wrote:
> From: Diana Wang <na.wang@corigine.com>
> 
> Use nn->tlv_caps.me_freq_mhz instead of nn->me_freq_mhz to check whether
> rx-usecs/tx-usecs is valid.
> 
> This is because nn->tlv_caps.me_freq_mhz represents the clock_freq (MHz) of
> the flow processing cores (FPC) on the NIC. While nn->me_freq_mhz is not
> be set.
> 
> [...]

Here is the summary with links:
  - [net] nfp: checking parameter process for rx-usecs/tx-usecs is invalid
    https://git.kernel.org/netdev/net/c/3bd6b2a838ba

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net.h b/drivers/net/ethernet/netronome/nfp/nfp_net.h
index df203738511b..0b1865e9f0b5 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net.h
@@ -565,7 +565,6 @@  struct nfp_net_dp {
  * @exn_name:           Name for Exception interrupt
  * @shared_handler:     Handler for shared interrupts
  * @shared_name:        Name for shared interrupt
- * @me_freq_mhz:        ME clock_freq (MHz)
  * @reconfig_lock:	Protects @reconfig_posted, @reconfig_timer_active,
  *			@reconfig_sync_present and HW reconfiguration request
  *			regs/machinery from async requests (sync must take
@@ -650,8 +649,6 @@  struct nfp_net {
 	irq_handler_t shared_handler;
 	char shared_name[IFNAMSIZ + 8];
 
-	u32 me_freq_mhz;
-
 	bool link_up;
 	spinlock_t link_status_lock;
 
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
index 1de076f55740..cf7882933993 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
@@ -1344,7 +1344,7 @@  static int nfp_net_set_coalesce(struct net_device *netdev,
 	 * ME timestamp ticks.  There are 16 ME clock cycles for each timestamp
 	 * count.
 	 */
-	factor = nn->me_freq_mhz / 16;
+	factor = nn->tlv_caps.me_freq_mhz / 16;
 
 	/* Each pair of (usecs, max_frames) fields specifies that interrupts
 	 * should be coalesced until