All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07
@ 2013-04-07 13:44 Or Gerlitz
  2013-04-07 13:44 ` [PATCH V1 net-next 1/3] net/mlx4_core: Added proper description for two device capabilities Or Gerlitz
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Or Gerlitz @ 2013-04-07 13:44 UTC (permalink / raw)
  To: davem; +Cc: netdev, amirv, sagig, john.r.fastabend, Or Gerlitz

Hi Dave,

Here's V1 of this batch of mlx4 driver updates for 3.10, mostly DCB related. 

Series done against the net-next tree as of commit a210576c "Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net"

changes from V0: 

  - in patch #2 advertize getdcbx/setdcbx callbacks also for devices that support only PFC

  - per feedback from John, dropeed patch #3 which turned to be work-around for user space 
    bug in open-lldp. John posted a user space patch to fix the bug

  - per feedback from John, added small a patch under which we advertize DCB_CAP_DCBX_HOST in getdcbx

Or.


Or Gerlitz (3):
  net/mlx4_core: Added proper description for two device capabilities
  net/mlx4_en: Enable DCB ETS ops only when supported by the firmware
  net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx

 drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c |   10 +++++++++-
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |   10 ++++++++--
 drivers/net/ethernet/mellanox/mlx4/fw.c        |    4 +++-
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h   |    1 +
 include/linux/mlx4/device.h                    |    1 +
 5 files changed, 22 insertions(+), 4 deletions(-)

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

* [PATCH V1 net-next 1/3] net/mlx4_core: Added proper description for two device capabilities
  2013-04-07 13:44 [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 Or Gerlitz
@ 2013-04-07 13:44 ` Or Gerlitz
  2013-04-07 13:44 ` [PATCH V1 net-next 2/3] net/mlx4_en: Enable DCB ETS ops only when supported by the firmware Or Gerlitz
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Or Gerlitz @ 2013-04-07 13:44 UTC (permalink / raw)
  To: davem; +Cc: netdev, amirv, sagig, john.r.fastabend, Or Gerlitz

Added readable description for the DPDP and port sensing device capabilities.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/fw.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index f624557..8764397 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -91,7 +91,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[ 8] = "P_Key violation counter",
 		[ 9] = "Q_Key violation counter",
 		[10] = "VMM",
-		[12] = "DPDP",
+		[12] = "Dual Port Different Protocol (DPDP) support",
 		[15] = "Big LSO headers",
 		[16] = "MW support",
 		[17] = "APM support",
@@ -109,6 +109,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[41] = "Unicast VEP steering support",
 		[42] = "Multicast VEP steering support",
 		[48] = "Counters support",
+		[55] = "Port link type sensing support",
 		[59] = "Port management change event support",
 		[61] = "64 byte EQE support",
 		[62] = "64 byte CQE support",
-- 
1.7.1

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

* [PATCH V1 net-next 2/3] net/mlx4_en: Enable DCB ETS ops only when supported by the firmware
  2013-04-07 13:44 [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 Or Gerlitz
  2013-04-07 13:44 ` [PATCH V1 net-next 1/3] net/mlx4_core: Added proper description for two device capabilities Or Gerlitz
@ 2013-04-07 13:44 ` Or Gerlitz
  2013-04-07 13:44 ` [PATCH V1 net-next 3/3] net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx Or Gerlitz
  2013-04-07 20:56 ` [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 David Miller
  3 siblings, 0 replies; 7+ messages in thread
From: Or Gerlitz @ 2013-04-07 13:44 UTC (permalink / raw)
  To: davem
  Cc: netdev, amirv, sagig, john.r.fastabend, Or Gerlitz, Eugenia Emantayev

Enable the DCB ETS ops only when supported by the firmware. For older firmware/cards
which don't support ETS, advertize only PFC DCB ops.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c |    8 ++++++++
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |   10 ++++++++--
 drivers/net/ethernet/mellanox/mlx4/fw.c        |    1 +
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h   |    1 +
 include/linux/mlx4/device.h                    |    1 +
 5 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
index b799ab1..321553f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
@@ -253,3 +253,11 @@ const struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops = {
 	.getdcbx	= mlx4_en_dcbnl_getdcbx,
 	.setdcbx	= mlx4_en_dcbnl_setdcbx,
 };
+
+const struct dcbnl_rtnl_ops mlx4_en_dcbnl_pfc_ops = {
+	.ieee_getpfc	= mlx4_en_dcbnl_ieee_getpfc,
+	.ieee_setpfc	= mlx4_en_dcbnl_ieee_setpfc,
+
+	.getdcbx	= mlx4_en_dcbnl_getdcbx,
+	.setdcbx	= mlx4_en_dcbnl_setdcbx,
+};
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 61b5678..62795b5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2013,8 +2013,14 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 	INIT_WORK(&priv->linkstate_task, mlx4_en_linkstate);
 	INIT_DELAYED_WORK(&priv->stats_task, mlx4_en_do_get_stats);
 #ifdef CONFIG_MLX4_EN_DCB
-	if (!mlx4_is_slave(priv->mdev->dev))
-		dev->dcbnl_ops = &mlx4_en_dcbnl_ops;
+	if (!mlx4_is_slave(priv->mdev->dev)) {
+		if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) {
+			dev->dcbnl_ops = &mlx4_en_dcbnl_ops;
+		} else {
+			en_info(priv, "enabling only PFC DCB ops\n");
+			dev->dcbnl_ops = &mlx4_en_dcbnl_pfc_ops;
+		}
+	}
 #endif
 
 	for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i)
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
index 8764397..ab470d9 100644
--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
@@ -109,6 +109,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags)
 		[41] = "Unicast VEP steering support",
 		[42] = "Multicast VEP steering support",
 		[48] = "Counters support",
+		[53] = "Port ETS Scheduler support",
 		[55] = "Port link type sensing support",
 		[59] = "Port management change event support",
 		[61] = "64 byte EQE support",
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index f710b7c..d4cb5d3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -624,6 +624,7 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port);
 
 #ifdef CONFIG_MLX4_EN_DCB
 extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops;
+extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_pfc_ops;
 #endif
 
 int mlx4_en_setup_tc(struct net_device *dev, u8 up);
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 811f91c..1bc5a75 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -140,6 +140,7 @@ enum {
 	MLX4_DEV_CAP_FLAG_VEP_UC_STEER	= 1LL << 41,
 	MLX4_DEV_CAP_FLAG_VEP_MC_STEER	= 1LL << 42,
 	MLX4_DEV_CAP_FLAG_COUNTERS	= 1LL << 48,
+	MLX4_DEV_CAP_FLAG_SET_ETH_SCHED = 1LL << 53,
 	MLX4_DEV_CAP_FLAG_SENSE_SUPPORT	= 1LL << 55,
 	MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59,
 	MLX4_DEV_CAP_FLAG_64B_EQE	= 1LL << 61,
-- 
1.7.1

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

* [PATCH V1 net-next 3/3] net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx
  2013-04-07 13:44 [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 Or Gerlitz
  2013-04-07 13:44 ` [PATCH V1 net-next 1/3] net/mlx4_core: Added proper description for two device capabilities Or Gerlitz
  2013-04-07 13:44 ` [PATCH V1 net-next 2/3] net/mlx4_en: Enable DCB ETS ops only when supported by the firmware Or Gerlitz
@ 2013-04-07 13:44 ` Or Gerlitz
  2013-04-07 15:31   ` Sergei Shtylyov
  2013-04-07 20:56 ` [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 David Miller
  3 siblings, 1 reply; 7+ messages in thread
From: Or Gerlitz @ 2013-04-07 13:44 UTC (permalink / raw)
  To: davem; +Cc: netdev, amirv, sagig, john.r.fastabend, Or Gerlitz

When our getdcbx entry is called, DCB_CAP_DCBX_HOST should be advertized too.

Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
index 321553f..9199aed 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
@@ -186,7 +186,7 @@ static int mlx4_en_dcbnl_ieee_setpfc(struct net_device *dev,
 
 static u8 mlx4_en_dcbnl_getdcbx(struct net_device *dev)
 {
-	return DCB_CAP_DCBX_VER_IEEE;
+	return (DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE);
 }
 
 static u8 mlx4_en_dcbnl_setdcbx(struct net_device *dev, u8 mode)
-- 
1.7.1

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

* Re: [PATCH V1 net-next 3/3] net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx
  2013-04-07 13:44 ` [PATCH V1 net-next 3/3] net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx Or Gerlitz
@ 2013-04-07 15:31   ` Sergei Shtylyov
  2013-04-07 20:56     ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2013-04-07 15:31 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: davem, netdev, amirv, sagig, john.r.fastabend

Hello.

On 07-04-2013 17:44, Or Gerlitz wrote:

> When our getdcbx entry is called, DCB_CAP_DCBX_HOST should be advertized too.

> Cc: John Fastabend <john.r.fastabend@intel.com>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
[...]

> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> index 321553f..9199aed 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
> @@ -186,7 +186,7 @@ static int mlx4_en_dcbnl_ieee_setpfc(struct net_device *dev,
>
>   static u8 mlx4_en_dcbnl_getdcbx(struct net_device *dev)
>   {
> -	return DCB_CAP_DCBX_VER_IEEE;
> +	return (DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE);

    Nit: parens not needed here.

WBR, Sergei

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

* Re: [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07
  2013-04-07 13:44 [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 Or Gerlitz
                   ` (2 preceding siblings ...)
  2013-04-07 13:44 ` [PATCH V1 net-next 3/3] net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx Or Gerlitz
@ 2013-04-07 20:56 ` David Miller
  3 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2013-04-07 20:56 UTC (permalink / raw)
  To: ogerlitz; +Cc: netdev, amirv, sagig, john.r.fastabend

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Sun,  7 Apr 2013 16:44:05 +0300

> Hi Dave,
> 
> Here's V1 of this batch of mlx4 driver updates for 3.10, mostly DCB related. 
> 
> Series done against the net-next tree as of commit a210576c "Merge 
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net"
> 
> changes from V0: 
> 
>   - in patch #2 advertize getdcbx/setdcbx callbacks also for devices that support only PFC
> 
>   - per feedback from John, dropeed patch #3 which turned to be work-around for user space 
>     bug in open-lldp. John posted a user space patch to fix the bug
> 
>   - per feedback from John, added small a patch under which we advertize DCB_CAP_DCBX_HOST in getdcbx

All applied, thanks.

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

* Re: [PATCH V1 net-next 3/3] net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx
  2013-04-07 15:31   ` Sergei Shtylyov
@ 2013-04-07 20:56     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2013-04-07 20:56 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: ogerlitz, netdev, amirv, sagig, john.r.fastabend

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 07 Apr 2013 19:31:27 +0400

>> @@ -186,7 +186,7 @@ static int mlx4_en_dcbnl_ieee_setpfc(struct
>> net_device *dev,
>>
>>   static u8 mlx4_en_dcbnl_getdcbx(struct net_device *dev)
>>   {
>> -	return DCB_CAP_DCBX_VER_IEEE;
>> +	return (DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE);
> 
>    Nit: parens not needed here.

I made this simplification when I applied this patch, thanks.

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

end of thread, other threads:[~2013-04-07 20:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-07 13:44 [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 Or Gerlitz
2013-04-07 13:44 ` [PATCH V1 net-next 1/3] net/mlx4_core: Added proper description for two device capabilities Or Gerlitz
2013-04-07 13:44 ` [PATCH V1 net-next 2/3] net/mlx4_en: Enable DCB ETS ops only when supported by the firmware Or Gerlitz
2013-04-07 13:44 ` [PATCH V1 net-next 3/3] net/mlx4_en: Advertize DCB_CAP_DCBX_HOST in getdcbx Or Gerlitz
2013-04-07 15:31   ` Sergei Shtylyov
2013-04-07 20:56     ` David Miller
2013-04-07 20:56 ` [PATCH V1 net-next 0/3] Mellanox Core and Ethernet driver updates 2013-04-07 David Miller

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.