netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] qed*: SmartAN query support
@ 2019-02-07 14:20 Sudarsana Reddy Kalluru
  2019-02-07 14:20 ` [PATCH net-next 1/2] qed: Add API for SmartAN query Sudarsana Reddy Kalluru
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-02-07 14:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, aelior, mkalderon

SmartAN feature detects the peer/cable capabilities and establishes the
link in the best possible configuration.
The patch series adds support for querying the capability. Please consider
applying it net-next.

Sudarsana Reddy Kalluru (2):
  qed: Add API for SmartAN query.
  qede: Add ethtool interface for SmartAN query.

 drivers/net/ethernet/qlogic/qed/qed_hsi.h       |  1 +
 drivers/net/ethernet/qlogic/qed/qed_main.c      |  2 ++
 drivers/net/ethernet/qlogic/qed/qed_mcp.c       |  6 ++++++
 drivers/net/ethernet/qlogic/qed/qed_mcp.h       | 10 ++++++++++
 drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 11 ++++++++++-
 include/linux/qed/qed_if.h                      |  1 +
 6 files changed, 30 insertions(+), 1 deletion(-)

-- 
1.8.3.1


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

* [PATCH net-next 1/2] qed: Add API for SmartAN query.
  2019-02-07 14:20 [PATCH net-next 0/2] qed*: SmartAN query support Sudarsana Reddy Kalluru
@ 2019-02-07 14:20 ` Sudarsana Reddy Kalluru
  2019-02-07 14:20 ` [PATCH net-next 2/2] qede: Add ethtool interface " Sudarsana Reddy Kalluru
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-02-07 14:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, aelior, mkalderon

The patch adds driver interface to read the SmartAN capability from
management firmware.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
---
 drivers/net/ethernet/qlogic/qed/qed_hsi.h  |  1 +
 drivers/net/ethernet/qlogic/qed/qed_main.c |  2 ++
 drivers/net/ethernet/qlogic/qed/qed_mcp.c  |  6 ++++++
 drivers/net/ethernet/qlogic/qed/qed_mcp.h  | 10 ++++++++++
 include/linux/qed/qed_if.h                 |  1 +
 5 files changed, 20 insertions(+)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_hsi.h b/drivers/net/ethernet/qlogic/qed/qed_hsi.h
index 417121e..37edaa8 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_hsi.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_hsi.h
@@ -12796,6 +12796,7 @@ struct public_drv_mb {
 #define FW_MB_PARAM_GET_PF_RDMA_BOTH		0x3
 
 /* get MFW feature support response */
+#define FW_MB_PARAM_FEATURE_SUPPORT_SMARTLINQ	0x00000001
 #define FW_MB_PARAM_FEATURE_SUPPORT_EEE		0x00000002
 #define FW_MB_PARAM_FEATURE_SUPPORT_VLINK	0x00010000
 
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index b473526..f164d4a 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -281,6 +281,8 @@ int qed_fill_dev_info(struct qed_dev *cdev,
 		if (hw_info->b_wol_support == QED_WOL_SUPPORT_PME)
 			dev_info->wol_support = true;
 
+		dev_info->smart_an = qed_mcp_is_smart_an_supported(p_hwfn);
+
 		dev_info->abs_pf_id = QED_LEADING_HWFN(cdev)->abs_pf_id;
 	} else {
 		qed_vf_get_fw_version(&cdev->hwfns[0], &dev_info->fw_major,
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
index bb85418..cc27fd6 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
@@ -3654,6 +3654,12 @@ void qed_mcp_resc_lock_default_init(struct qed_resc_lock_params *p_lock,
 	}
 }
 
+bool qed_mcp_is_smart_an_supported(struct qed_hwfn *p_hwfn)
+{
+	return !!(p_hwfn->mcp_info->capabilities &
+		  FW_MB_PARAM_FEATURE_SUPPORT_SMARTLINQ);
+}
+
 int qed_mcp_get_capabilities(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 {
 	u32 mcp_resp;
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.h b/drivers/net/ethernet/qlogic/qed/qed_mcp.h
index 6e1d72a..2799e67 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.h
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.h
@@ -1148,6 +1148,16 @@ void qed_mcp_resc_lock_default_init(struct qed_resc_lock_params *p_lock,
 				    struct qed_resc_unlock_params *p_unlock,
 				    enum qed_resc_lock
 				    resource, bool b_is_permanent);
+
+/**
+ * @brief - Return whether management firmware support smart AN
+ *
+ * @param p_hwfn
+ *
+ * @return bool - true if feature is supported.
+ */
+bool qed_mcp_is_smart_an_supported(struct qed_hwfn *p_hwfn);
+
 /**
  * @brief Learn of supported MFW features; To be done during early init
  *
diff --git a/include/linux/qed/qed_if.h b/include/linux/qed/qed_if.h
index 35170f7..f6165d3 100644
--- a/include/linux/qed/qed_if.h
+++ b/include/linux/qed/qed_if.h
@@ -643,6 +643,7 @@ struct qed_dev_info {
 	u16		mtu;
 
 	bool wol_support;
+	bool smart_an;
 
 	/* MBI version */
 	u32 mbi_version;
-- 
1.8.3.1


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

* [PATCH net-next 2/2] qede: Add ethtool interface for SmartAN query.
  2019-02-07 14:20 [PATCH net-next 0/2] qed*: SmartAN query support Sudarsana Reddy Kalluru
  2019-02-07 14:20 ` [PATCH net-next 1/2] qed: Add API for SmartAN query Sudarsana Reddy Kalluru
@ 2019-02-07 14:20 ` Sudarsana Reddy Kalluru
  2019-02-07 19:54 ` [PATCH net-next 0/2] qed*: SmartAN query support Jakub Kicinski
  2019-02-07 21:22 ` David Miller
  3 siblings, 0 replies; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-02-07 14:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, aelior, mkalderon

The patch adds driver support to query SmartAN capability via ethtool.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Michal Kalderon <mkalderon@marvell.com>
---
 drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
index 16331c6..c623808 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
@@ -186,11 +186,13 @@
 
 enum {
 	QEDE_PRI_FLAG_CMT,
+	QEDE_PRI_FLAG_SMART_AN_SUPPORT, /* MFW supports SmartAN */
 	QEDE_PRI_FLAG_LEN,
 };
 
 static const char qede_private_arr[QEDE_PRI_FLAG_LEN][ETH_GSTRING_LEN] = {
 	"Coupled-Function",
+	"SmartAN capable",
 };
 
 enum qede_ethtool_tests {
@@ -404,8 +406,15 @@ static int qede_get_sset_count(struct net_device *dev, int stringset)
 static u32 qede_get_priv_flags(struct net_device *dev)
 {
 	struct qede_dev *edev = netdev_priv(dev);
+	u32 flags = 0;
 
-	return (!!(edev->dev_info.common.num_hwfns > 1)) << QEDE_PRI_FLAG_CMT;
+	if (edev->dev_info.common.num_hwfns > 1)
+		flags |= BIT(QEDE_PRI_FLAG_CMT);
+
+	if (edev->dev_info.common.smart_an)
+		flags |= BIT(QEDE_PRI_FLAG_SMART_AN_SUPPORT);
+
+	return flags;
 }
 
 struct qede_link_mode_mapping {
-- 
1.8.3.1


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

* Re: [PATCH net-next 0/2] qed*: SmartAN query support
  2019-02-07 14:20 [PATCH net-next 0/2] qed*: SmartAN query support Sudarsana Reddy Kalluru
  2019-02-07 14:20 ` [PATCH net-next 1/2] qed: Add API for SmartAN query Sudarsana Reddy Kalluru
  2019-02-07 14:20 ` [PATCH net-next 2/2] qede: Add ethtool interface " Sudarsana Reddy Kalluru
@ 2019-02-07 19:54 ` Jakub Kicinski
  2019-02-08 11:32   ` [EXT] " Sudarsana Reddy Kalluru
  2019-02-07 21:22 ` David Miller
  3 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2019-02-07 19:54 UTC (permalink / raw)
  To: Sudarsana Reddy Kalluru; +Cc: davem, netdev, aelior, mkalderon

On Thu, 7 Feb 2019 06:20:10 -0800, Sudarsana Reddy Kalluru wrote:
> SmartAN feature detects the peer/cable capabilities and establishes the
> link in the best possible configuration.

It sounds familiar, I need to check with FW team, but I think we may be
doing a similar thing, and adding a common API rather than ethtool flag
would be preferable.

Could you please share a little bit more detail?  What are the
configurations this would choose between?

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

* Re: [PATCH net-next 0/2] qed*: SmartAN query support
  2019-02-07 14:20 [PATCH net-next 0/2] qed*: SmartAN query support Sudarsana Reddy Kalluru
                   ` (2 preceding siblings ...)
  2019-02-07 19:54 ` [PATCH net-next 0/2] qed*: SmartAN query support Jakub Kicinski
@ 2019-02-07 21:22 ` David Miller
  2019-02-07 21:32   ` David Miller
  3 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2019-02-07 21:22 UTC (permalink / raw)
  To: skalluru; +Cc: netdev, aelior, mkalderon

From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Date: Thu, 7 Feb 2019 06:20:10 -0800

> SmartAN feature detects the peer/cable capabilities and establishes the
> link in the best possible configuration.
> The patch series adds support for querying the capability. Please consider
> applying it net-next.

Series applied, thanks.

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

* Re: [PATCH net-next 0/2] qed*: SmartAN query support
  2019-02-07 21:22 ` David Miller
@ 2019-02-07 21:32   ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-02-07 21:32 UTC (permalink / raw)
  To: skalluru; +Cc: netdev, aelior, mkalderon

From: David Miller <davem@davemloft.net>
Date: Thu, 07 Feb 2019 13:22:35 -0800 (PST)

> From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
> Date: Thu, 7 Feb 2019 06:20:10 -0800
> 
>> SmartAN feature detects the peer/cable capabilities and establishes the
>> link in the best possible configuration.
>> The patch series adds support for querying the capability. Please consider
>> applying it net-next.
> 
> Series applied, thanks.

Nevermind, I reverted before pushing out as I see Jakub has some questions.

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

* RE: [EXT] Re: [PATCH net-next 0/2] qed*: SmartAN query support
  2019-02-07 19:54 ` [PATCH net-next 0/2] qed*: SmartAN query support Jakub Kicinski
@ 2019-02-08 11:32   ` Sudarsana Reddy Kalluru
  2019-02-08 16:04     ` Jakub Kicinski
  0 siblings, 1 reply; 9+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-02-08 11:32 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, Ariel Elior, Michal Kalderon

>-----Original Message-----
>From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
>Sent: 08 February 2019 01:24
>To: Sudarsana Reddy Kalluru <skalluru@marvell.com>
>Cc: davem@davemloft.net; netdev@vger.kernel.org; Ariel Elior
><aelior@marvell.com>; Michal Kalderon <mkalderon@marvell.com>
>Subject: [EXT] Re: [PATCH net-next 0/2] qed*: SmartAN query support
>
>External Email
>
>----------------------------------------------------------------------
>On Thu, 7 Feb 2019 06:20:10 -0800, Sudarsana Reddy Kalluru wrote:
>> SmartAN feature detects the peer/cable capabilities and establishes
>> the link in the best possible configuration.
>
>It sounds familiar, I need to check with FW team, but I think we may be doing
>a similar thing, and adding a common API rather than ethtool flag would be
>preferable.
>
>Could you please share a little bit more detail?  What are the configurations
>this would choose between?

Jakub,
  Following doc provides detailed information on this feature. We simply need a flag to display whether the feature is enabled in the hardware or not, hence adding it to "ethtool --show-priv-flags".
https://www.cavium.com/Dell/Documents/Converged/TB_Establishing_Adaptive_Links_with_SmartAN_Dell.pdf
****
When an administrator first plugs a device (discrete optical module or Active Optical Cable assembly or DAC) into the Cavium FastLinQ adapter SFP/QSFP interface, the Cavium SmartAN technology reads the device type (discrete optics or AOC or DAC), what its speed rating is, special optics data (such as what FEC mode is required or if it is multi-speed capable), DAC CA-x type, and DAC length.
Armed with this information, the FastLinQ adapter attempts each possible mode (supported by that device) until it secures a link with the connected link partner (switch), without input from the end user.
****

Thanks,
Sudarsana

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

* Re: [EXT] Re: [PATCH net-next 0/2] qed*: SmartAN query support
  2019-02-08 11:32   ` [EXT] " Sudarsana Reddy Kalluru
@ 2019-02-08 16:04     ` Jakub Kicinski
  2019-02-09  6:55       ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2019-02-08 16:04 UTC (permalink / raw)
  To: Sudarsana Reddy Kalluru
  Cc: davem, netdev, Ariel Elior, Michal Kalderon, Michal Kubecek

On Fri, 8 Feb 2019 11:32:14 +0000, Sudarsana Reddy Kalluru wrote:
> >On Thu, 7 Feb 2019 06:20:10 -0800, Sudarsana Reddy Kalluru wrote:  
> >> SmartAN feature detects the peer/cable capabilities and establishes
> >> the link in the best possible configuration.  
> >
> >It sounds familiar, I need to check with FW team, but I think we may be doing
> >a similar thing, and adding a common API rather than ethtool flag would be
> >preferable.
> >
> >Could you please share a little bit more detail?  What are the configurations
> >this would choose between?  
> 
> Jakub,
>   Following doc provides detailed information on this feature. We simply need a flag to display whether the feature is enabled in the hardware or not, hence adding it to "ethtool --show-priv-flags".
> https://www.cavium.com/Dell/Documents/Converged/TB_Establishing_Adaptive_Links_with_SmartAN_Dell.pdf

Thanks!  Yes, that's exactly the same thing.  In a nutshell trying
different serdes and FEC speeds.  I guess I'll just put adding an API
for this down as a TODO, and add it once we have ethtool netlink.  And
keep IOCTL ethtool frozen until then.

So I think the priv flag is fine for now.

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

* Re: [EXT] Re: [PATCH net-next 0/2] qed*: SmartAN query support
  2019-02-08 16:04     ` Jakub Kicinski
@ 2019-02-09  6:55       ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-02-09  6:55 UTC (permalink / raw)
  To: jakub.kicinski; +Cc: skalluru, netdev, aelior, mkalderon, mkubecek

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Fri, 8 Feb 2019 08:04:29 -0800

> Thanks!  Yes, that's exactly the same thing.  In a nutshell trying
> different serdes and FEC speeds.  I guess I'll just put adding an API
> for this down as a TODO, and add it once we have ethtool netlink.  And
> keep IOCTL ethtool frozen until then.
> 
> So I think the priv flag is fine for now.

Series applied to net-next.

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

end of thread, other threads:[~2019-02-09  6:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 14:20 [PATCH net-next 0/2] qed*: SmartAN query support Sudarsana Reddy Kalluru
2019-02-07 14:20 ` [PATCH net-next 1/2] qed: Add API for SmartAN query Sudarsana Reddy Kalluru
2019-02-07 14:20 ` [PATCH net-next 2/2] qede: Add ethtool interface " Sudarsana Reddy Kalluru
2019-02-07 19:54 ` [PATCH net-next 0/2] qed*: SmartAN query support Jakub Kicinski
2019-02-08 11:32   ` [EXT] " Sudarsana Reddy Kalluru
2019-02-08 16:04     ` Jakub Kicinski
2019-02-09  6:55       ` David Miller
2019-02-07 21:22 ` David Miller
2019-02-07 21:32   ` 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).