linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Koteshwar Rao, Satha" <Satha.Rao@cavium.com>
To: "Goutham, Sunil" <Sunil.Goutham@cavium.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "rric@kernel.org" <rric@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"Daney, David" <David.Daney@cavium.com>,
	"Vatsavayi, Raghu" <Raghu.Vatsavayi@cavium.com>,
	"Chickles, Derek" <Derek.Chickles@cavium.com>,
	"Romanov, Philip" <Philip.Romanov@cavium.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [RFC PATCH 3/7] Enable pause frame support
Date: Mon, 26 Dec 2016 14:21:57 +0000	[thread overview]
Message-ID: <DM5PR07MB28423DB384D388B4B9F9C6FB8D960@DM5PR07MB2842.namprd07.prod.outlook.com> (raw)
In-Reply-To: <DM5PR07MB2889471E0668C95BD2A266709E930@DM5PR07MB2889.namprd07.prod.outlook.com>

Thanks Sunil, will fix this in next version

Thanks,
Satha

From: Goutham, Sunil 
Sent: Wednesday, December 21, 2016 1:20 AM
To: Koteshwar Rao, Satha; linux-kernel@vger.kernel.org
Cc: rric@kernel.org; davem@davemloft.net; Daney, David; Vatsavayi, Raghu; Chickles, Derek; Romanov, Philip; netdev@vger.kernel.org; linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH 3/7] Enable pause frame support

>>+#define  BGX_SMUX_CBFC_CTL             0x20218

These macros are already defined.

if you check 'net-next ' branch pause frame support has already been
added. You should send patch on top it if you have further changes
to the existing.

Thanks,
Sunil.

________________________________________
From: Koteshwar Rao, Satha
Sent: Wednesday, December 21, 2016 2:16 PM
To: linux-kernel@vger.kernel.org
Cc: Goutham, Sunil; rric@kernel.org; davem@davemloft.net; Daney, David; Vatsavayi, Raghu; Chickles, Derek; Koteshwar Rao, Satha; Romanov, Philip; netdev@vger.kernel.org; linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 3/7] Enable pause frame support 
 
---
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 25 +++++++++++++++++++++++
 drivers/net/ethernet/cavium/thunder/thunder_bgx.h |  7 +++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 050e21f..92d7e04 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -121,6 +121,31 @@ static int bgx_poll_reg(struct bgx *bgx, u8 lmac, u64 reg, u64 mask, bool zero)
         return 1;
 }
 
+void enable_pause_frames(int node, int bgx_idx, int lmac)
+{
+       u64 reg_value = 0;
+       struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
+
+       reg_value =  bgx_reg_read(bgx, lmac, BGX_SMUX_TX_CTL);
+       /* Enable BGX()_SMU()_TX_CTL */
+       if (!(reg_value & L2P_BP_CONV))
+               bgx_reg_write(bgx, lmac, BGX_SMUX_TX_CTL,
+                             (reg_value | (L2P_BP_CONV)));
+
+       reg_value =  bgx_reg_read(bgx, lmac, BGX_SMUX_HG2_CTL);
+       /* Clear if BGX()_SMU()_HG2_CONTROL[HG2TX_EN] is set */
+       if (reg_value & SMUX_HG2_CTL_HG2TX_EN)
+               bgx_reg_write(bgx, lmac, BGX_SMUX_HG2_CTL,
+                             (reg_value & (~SMUX_HG2_CTL_HG2TX_EN)));
+
+       reg_value =  bgx_reg_read(bgx, lmac, BGX_SMUX_CBFC_CTL);
+       /* Clear if BGX()_SMU()_CBFC_CTL[TX_EN] is set */
+       if (reg_value & CBFC_CTL_TX_EN)
+               bgx_reg_write(bgx, lmac, BGX_SMUX_CBFC_CTL,
+                             (reg_value & (~CBFC_CTL_TX_EN)));
+}
+EXPORT_SYMBOL(enable_pause_frames);
+
 /* Return number of BGX present in HW */
 unsigned bgx_get_map(int node)
 {
diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
index 01cc7c8..5b57bd1 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.h
@@ -131,6 +131,11 @@
 #define BGX_SMUX_TX_CTL                 0x20178
 #define  SMU_TX_CTL_DIC_EN                      BIT_ULL(0)
 #define  SMU_TX_CTL_UNI_EN                      BIT_ULL(1)
+#define  L2P_BP_CONV                           BIT_ULL(7)
+#define  BGX_SMUX_CBFC_CTL             0x20218
+#define  CBFC_CTL_TX_EN                                BIT_ULL(1)
+#define  BGX_SMUX_HG2_CTL              0x20210
+#define SMUX_HG2_CTL_HG2TX_EN                  BIT_ULL(18)
 #define  SMU_TX_CTL_LNK_STATUS                  (3ull << 4)
 #define BGX_SMUX_TX_THRESH              0x20180
 #define BGX_SMUX_CTL                    0x20200
@@ -212,6 +217,8 @@ void bgx_lmac_internal_loopback(int node, int bgx_idx,
 
 u64 bgx_get_rx_stats(int node, int bgx_idx, int lmac, int idx);
 u64 bgx_get_tx_stats(int node, int bgx_idx, int lmac, int idx);
+void enable_pause_frames(int node, int bgx_idx, int lmac);
+
 #define BGX_RX_STATS_COUNT 11
 #define BGX_TX_STATS_COUNT 18
 
-- 
1.8.3.1

  parent reply	other threads:[~2016-12-26 14:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21  8:46 [RFC PATCH 0/7] ThunderX Embedded switch support Satha Koteswara Rao
2016-12-21  8:46 ` [RFC PATCH 1/7] PF driver modified to enable HW filter support, changes works in backward compatibility mode Enable required things in Makefile Enable LZ4 dependecy inside config file Satha Koteswara Rao
2016-12-21 13:05   ` Sunil Kovvuri
2016-12-26 14:20     ` Koteshwar Rao, Satha
2016-12-27  4:19       ` Sunil Kovvuri
2016-12-21  8:46 ` [RFC PATCH 2/7] VF driver changes to enable hooks to get kernel notifications Satha Koteswara Rao
2016-12-21  8:46 ` [RFC PATCH 3/7] Enable pause frame support Satha Koteswara Rao
     [not found]   ` <DM5PR07MB2889471E0668C95BD2A266709E930@DM5PR07MB2889.namprd07.prod.outlook.com>
2016-12-26 14:21     ` Koteshwar Rao, Satha [this message]
2016-12-21  8:46 ` [RFC PATCH 4/7] HW Filter Initialization code and register access APIs Satha Koteswara Rao
2016-12-21 12:36   ` Sunil Kovvuri
2016-12-26 14:13     ` Koteshwar Rao, Satha
2016-12-21  8:46 ` [RFC PATCH 5/7] Multiple VF's grouped together under single physical port called PF group PF Group maintainance API's Satha Koteswara Rao
2016-12-21 12:43   ` Sunil Kovvuri
2016-12-26 14:16     ` Koteshwar Rao, Satha
2016-12-21  8:46 ` [RFC PATCH 6/7] HW Filter Table access API's Satha Koteswara Rao
2016-12-21  8:46 ` [RFC PATCH 7/7] Get notifications from PF driver and configure filter block based on request data Satha Koteswara Rao
2016-12-21 12:03 ` [RFC PATCH 0/7] ThunderX Embedded switch support Sunil Kovvuri
2016-12-26 14:04   ` Koteshwar Rao, Satha
2016-12-26 14:55     ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR07MB28423DB384D388B4B9F9C6FB8D960@DM5PR07MB2842.namprd07.prod.outlook.com \
    --to=satha.rao@cavium.com \
    --cc=David.Daney@cavium.com \
    --cc=Derek.Chickles@cavium.com \
    --cc=Philip.Romanov@cavium.com \
    --cc=Raghu.Vatsavayi@cavium.com \
    --cc=Sunil.Goutham@cavium.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rric@kernel.org \
    --subject='RE: [RFC PATCH 3/7] Enable pause frame support' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).