All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next PATCH] octeontx2-af: cn10k: Fixes CN10K RPM reference issue
@ 2021-02-15 17:54 Geetha sowjanya
  2021-02-15 18:15 ` Sunil Kovvuri
  0 siblings, 1 reply; 2+ messages in thread
From: Geetha sowjanya @ 2021-02-15 17:54 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: davem, kuba, sgoutham, lcherian, hkelam, sbhatta, jerinj,
	Geetha sowjanya

This patch fixes references to uninitialized variables and
debugfs entry name for CN10K platform and HW_TSO flag check. 

Signed-off-by: Geetha sowjanya <gakula@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>

This patch fixes the bug introduced by the commit
3ad3f8f93c81 ("octeontx2-af: cn10k: MAC internal loopback support".
These changes are not yet merged into net branch, hence submitting
to net-next.

---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c   |  2 ++
 .../net/ethernet/marvell/octeontx2/af/rvu_debugfs.c   |  2 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_txrx.c    | 11 ++++++-----
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
index 3a1809c28e83..e668e482383a 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
@@ -722,12 +722,14 @@ u32 rvu_cgx_get_fifolen(struct rvu *rvu)
 
 static int rvu_cgx_config_intlbk(struct rvu *rvu, u16 pcifunc, bool en)
 {
+	int pf = rvu_get_pf(pcifunc);
 	struct mac_ops *mac_ops;
 	u8 cgx_id, lmac_id;
 
 	if (!is_cgx_config_permitted(rvu, pcifunc))
 		return -EPERM;
 
+	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
 	mac_ops = get_mac_ops(rvu_cgx_pdata(cgx_id, rvu));
 
 	return mac_ops->mac_lmac_intl_lbk(rvu_cgx_pdata(cgx_id, rvu),
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
index 48a84c65804c..094124b695dc 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
@@ -2432,7 +2432,7 @@ void rvu_dbg_init(struct rvu *rvu)
 		debugfs_create_file("rvu_pf_cgx_map", 0444, rvu->rvu_dbg.root,
 				    rvu, &rvu_dbg_rvu_pf_cgx_map_fops);
 	else
-		debugfs_create_file("rvu_pf_cgx_map", 0444, rvu->rvu_dbg.root,
+		debugfs_create_file("rvu_pf_rpm_map", 0444, rvu->rvu_dbg.root,
 				    rvu, &rvu_dbg_rvu_pf_cgx_map_fops);
 
 create:
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
index 3f778fc054b5..22ec03a618b1 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
@@ -816,22 +816,23 @@ static bool is_hw_tso_supported(struct otx2_nic *pfvf,
 {
 	int payload_len, last_seg_size;
 
+	if (test_bit(HW_TSO, &pfvf->hw.cap_flag))
+		return true;
+
+	/* On 96xx A0, HW TSO not supported */
+	if (!is_96xx_B0(pfvf->pdev))
+		return false;
 
 	/* HW has an issue due to which when the payload of the last LSO
 	 * segment is shorter than 16 bytes, some header fields may not
 	 * be correctly modified, hence don't offload such TSO segments.
 	 */
-	if (!is_96xx_B0(pfvf->pdev))
-		return true;
 
 	payload_len = skb->len - (skb_transport_offset(skb) + tcp_hdrlen(skb));
 	last_seg_size = payload_len % skb_shinfo(skb)->gso_size;
 	if (last_seg_size && last_seg_size < 16)
 		return false;
 
-	if (!test_bit(HW_TSO, &pfvf->hw.cap_flag))
-		return false;
-
 	return true;
 }
 
-- 
2.17.1


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

* Re: [net-next PATCH] octeontx2-af: cn10k: Fixes CN10K RPM reference issue
  2021-02-15 17:54 [net-next PATCH] octeontx2-af: cn10k: Fixes CN10K RPM reference issue Geetha sowjanya
@ 2021-02-15 18:15 ` Sunil Kovvuri
  0 siblings, 0 replies; 2+ messages in thread
From: Sunil Kovvuri @ 2021-02-15 18:15 UTC (permalink / raw)
  To: Geetha sowjanya
  Cc: Linux Netdev List, LKML, David S. Miller, Jakub Kicinski,
	Sunil Goutham, Linu Cherian, hariprasad, Subbaraya Sundeep,
	Jerin Jacob

On Mon, Feb 15, 2021 at 11:27 PM Geetha sowjanya <gakula@marvell.com> wrote:
>
> This patch fixes references to uninitialized variables and
> debugfs entry name for CN10K platform and HW_TSO flag check.
>
> Signed-off-by: Geetha sowjanya <gakula@marvell.com>
> Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
>
> This patch fixes the bug introduced by the commit
> 3ad3f8f93c81 ("octeontx2-af: cn10k: MAC internal loopback support".
> These changes are not yet merged into net branch, hence submitting
> to net-next.
>
> ---
>  drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c   |  2 ++
>  .../net/ethernet/marvell/octeontx2/af/rvu_debugfs.c   |  2 +-
>  .../net/ethernet/marvell/octeontx2/nic/otx2_txrx.c    | 11 ++++++-----
>  3 files changed, 9 insertions(+), 6 deletions(-)
>

> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> index 3f778fc054b5..22ec03a618b1 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> @@ -816,22 +816,23 @@ static bool is_hw_tso_supported(struct otx2_nic *pfvf,
>  {
>         int payload_len, last_seg_size;
>
> +       if (test_bit(HW_TSO, &pfvf->hw.cap_flag))
> +               return true;
> +
> +       /* On 96xx A0, HW TSO not supported */
> +       if (!is_96xx_B0(pfvf->pdev))
> +               return false;
>
>         /* HW has an issue due to which when the payload of the last LSO
>          * segment is shorter than 16 bytes, some header fields may not
>          * be correctly modified, hence don't offload such TSO segments.
>          */
> -       if (!is_96xx_B0(pfvf->pdev))
> -               return true;
>
>         payload_len = skb->len - (skb_transport_offset(skb) + tcp_hdrlen(skb));
>         last_seg_size = payload_len % skb_shinfo(skb)->gso_size;
>         if (last_seg_size && last_seg_size < 16)
>                 return false;
>
> -       if (!test_bit(HW_TSO, &pfvf->hw.cap_flag))
> -               return false;
> -
>         return true;
>  }

The HW_TSO flag should not be set for B0 silicon as well, otherwise
the checks related to
HW issue mentioned above will not come into effect.

Thanks,
Sunil.

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

end of thread, other threads:[~2021-02-15 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 17:54 [net-next PATCH] octeontx2-af: cn10k: Fixes CN10K RPM reference issue Geetha sowjanya
2021-02-15 18:15 ` Sunil Kovvuri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.