netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] nfp: fix TLV offset calculation
@ 2018-02-02  3:41 Jakub Kicinski
  2018-02-03  0:18 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2018-02-02  3:41 UTC (permalink / raw)
  To: davem; +Cc: netdev, oss-drivers, Edwin Peer

From: Edwin Peer <edwin.peer@netronome.com>

The data pointer in the config space TLV parser already includes
NFP_NET_CFG_TLV_BASE, it should not be added again. Incorrect
offset values were only used in printed user output, rendering
the bug merely cosmetic.

Fixes: 73a0329b057e ("nfp: add TLV capabilities to the BAR")
Signed-off-by: Edwin Peer <edwin.peer@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c
index ffb402746ad4..1f9149bb2ae6 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c
@@ -65,7 +65,7 @@ int nfp_net_tlv_caps_parse(struct device *dev, u8 __iomem *ctrl_mem,
 		u32 hdr = readl(data);
 
 		length = FIELD_GET(NFP_NET_CFG_TLV_HEADER_LENGTH, hdr);
-		offset = data - ctrl_mem + NFP_NET_CFG_TLV_BASE;
+		offset = data - ctrl_mem;
 
 		/* Advance past the header */
 		data += 4;
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] nfp: fix TLV offset calculation
  2018-02-02  3:41 [PATCH net] nfp: fix TLV offset calculation Jakub Kicinski
@ 2018-02-03  0:18 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-02-03  0:18 UTC (permalink / raw)
  To: jakub.kicinski; +Cc: netdev, oss-drivers, edwin.peer

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Thu,  1 Feb 2018 19:41:43 -0800

> From: Edwin Peer <edwin.peer@netronome.com>
> 
> The data pointer in the config space TLV parser already includes
> NFP_NET_CFG_TLV_BASE, it should not be added again. Incorrect
> offset values were only used in printed user output, rendering
> the bug merely cosmetic.
> 
> Fixes: 73a0329b057e ("nfp: add TLV capabilities to the BAR")
> Signed-off-by: Edwin Peer <edwin.peer@netronome.com>
> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Applied, thanks Jakub.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-03  0:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02  3:41 [PATCH net] nfp: fix TLV offset calculation Jakub Kicinski
2018-02-03  0:18 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).