Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932359AbcLZOhI (ORCPT ); Mon, 26 Dec 2016 09:37:08 -0500 Received: from mail-sn1nam02on0082.outbound.protection.outlook.com ([104.47.36.82]:24016 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752084AbcLZOhG (ORCPT ); Mon, 26 Dec 2016 09:37:06 -0500 From: "Koteshwar Rao, Satha" To: "Goutham, Sunil" , "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 Thread-Topic: [RFC PATCH 3/7] Enable pause frame support Thread-Index: AQHSW2b6hq4GiqNplEGKKaamnnjTMqESIBeAgAgvvAA= Date: Mon, 26 Dec 2016 14:21:57 +0000 Message-ID: References: <1482310011-1862-1-git-send-email-satha.rao@caviumnetworks.com>,<1482310011-1862-4-git-send-email-satha.rao@caviumnetworks.com> In-Reply-To: Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Satha.Rao@cavium.com; x-originating-ip: [111.93.218.67] x-microsoft-exchange-diagnostics: 1;DM5PR07MB2889;7:/ufwa+9DyAMDLdwC8/dlAK4lARElMgHy37cQYn3MWvEgvPJM5aY0cdi7C0Mmprj1eGCFCm73JTr4ODhvIazlU/AKvzM8FnSZjkx1pZL/jb2lenttwZmtLlszAnN4N4nJ/2w0NKaqZTckdtLfUVe1OgpQ8TR3kSF8z3IcQMKq46min+2h3txuY7VpNduQJsfHtIDMn2sc0RejY58pYgnKyObLDw3LicyO1fud5bkuT9PNNK464E1s11aufreUE9dOCjEXf6lvNh4dGLdtn1keHPiEb7YP3aFGl1Nx2J3KsvVtrRVKBisg7wOEagPmF/ach89Rwxa+QEKZezwM6e99ZmrdwG1nWdSdAbP53wsSkYHgIkBc7M90HmDJZKOV1mV9jlVkp77waiNnSnjv+AFtDiTBXWtsDfLWzML3BChg59kPWVPSsDoxFviTO81R0MlfkvDKCO0CU8VaEOPd1xyu1g== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39450400003)(377454003)(199003)(189002)(3900700001)(2501003)(106356001)(6506006)(6436002)(3280700002)(33656002)(25786008)(3660700001)(2950100002)(50986999)(76176999)(5660300001)(106116001)(54356999)(7696004)(76576001)(101416001)(99286002)(122556002)(97736004)(38730400001)(6116002)(3846002)(74316002)(102836003)(4326007)(105586002)(305945005)(68736007)(9686002)(5001770100001)(8936002)(8676002)(86362001)(81166006)(77096006)(229853002)(66066001)(7736002)(2906002)(189998001)(2900100001)(92566002)(81156014)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB2889;H:DM5PR07MB2842.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: e736baab-7158-47ed-4757-08d42d9a8c95 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR07MB2889; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(6072148);SRVR:DM5PR07MB2889;BCL:0;PCL:0;RULEID:;SRVR:DM5PR07MB2889; x-forefront-prvs: 016885DD9B spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Dec 2016 14:21:57.1308 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB2889 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uBQEconN011795 Content-Length: 4007 Lines: 97 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