Skip to contentSkip to conversation

net: dcbnl: remove redundant DCB_CAP_DCBX_STATIC bit

PATCH Applied John Fastabend 3 participants 9 messages Jan 22, 2011 – Jan 24, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: dcbnl: remove redundant DCB_CAP_DCBX_STATIC bit

Remove redundant DCB_CAP_DCBX_STATIC bit in DCB capabilities

Setting this bit indicates that no embedded DCBx engine is present and the hardware can not be configured. This is the same as having none of the DCB capability flags set or simply not implementing the dcbnl ops at all.

This patch removes this bit. The bit has not made a stable release yet so removing it should not be an issue with existing apps.

---

 include/linux/dcbnl.h |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
include/linux/dcbnl.h +0 -7
index 68cd248..ac9df34 100644
@@ -423,18 +423,11 @@ enum dcbnl_cap_attrs {
  *
  * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
  *                         supports the IEEE protocol flavor
- *
- * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
- *                       supports static configuration (i.e no actual
- *                       negotiation is performed negotiated parameters equal
- *                       the initial configuration)
- *
  */
 #define DCB_CAP_DCBX_HOST		0x01
 #define DCB_CAP_DCBX_LLD_MANAGED	0x02
 #define DCB_CAP_DCBX_VER_CEE		0x04
 #define DCB_CAP_DCBX_VER_IEEE		0x08
-#define DCB_CAP_DCBX_STATIC		0x10
 
 /**
  * enum dcbnl_numtcs_attrs - number of traffic classes
#1 lore raw

PATCH 2/2 dcbnl: make get_app handling symmetric for IEEE and CEE DCBx

The IEEE get/set app handlers use generic routines and do not require the net_device to implement the dcbnl_ops routines. This patch makes it symmetric so user space and drivers do not have to handle the CEE version and IEEE DCBx versions differently.

---

 net/dcb/dcbnl.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
net/dcb/dcbnl.c +11 -2
index d900ab9..6b03f56 100644
@@ -583,7 +583,7 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb,
 	u8 up, idtype;
 	int ret = -EINVAL;
 
-	if (!tb[DCB_ATTR_APP] || !netdev->dcbnl_ops->getapp)
+	if (!tb[DCB_ATTR_APP])
 		goto out;
 
 	ret = nla_parse_nested(app_tb, DCB_APP_ATTR_MAX, tb[DCB_ATTR_APP],
@@ -604,7 +604,16 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb,
 		goto out;
 
 	id = nla_get_u16(app_tb[DCB_APP_ATTR_ID]);
-	up = netdev->dcbnl_ops->getapp(netdev, idtype, id);
+
+	if (netdev->dcbnl_ops->getapp) {
+		up = netdev->dcbnl_ops->getapp(netdev, idtype, id);
+	} else {
+		struct dcb_app app = {
+					.selector = idtype,
+					.protocol = id,
+				     };
+		up = dcb_getapp(netdev, &app);
+	}
 
 	/* send this back */
 	dcbnl_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
maintainer Applied
#2 lore raw

Re: [net-2.6 PATCH 2/2] dcbnl: make get_app handling symmetric for IEEE and CEE DCBx

From: John Fastabend <[email protected]>
Date: Fri, 21 Jan 2011 18:35:18 -0800

Quoted 6 lines

The IEEE get/set app handlers use generic routines and do not require the net_device to implement the dcbnl_ops routines. This patch makes it symmetric so user space and drivers do not have to handle the CEE version and IEEE DCBx versions differently.

Applied, thanks John.

#3 lore raw
In reply to John Fastabend
Quoted 7 lines · John Fastabend

Remove redundant DCB_CAP_DCBX_STATIC bit in DCB capabilities

Setting this bit indicates that no embedded DCBx engine is present and the hardware can not be configured. This is the same as having none of the DCB capability flags set or simply not implementing the dcbnl ops at all.

Quoted 8 lines

This patch removes this bit. The bit has not made a stable release yet so removing it should not be an issue with existing apps.

---

Shmulik, could you ACK this because you added these bits? But I was adding support for this in lldpad and I see no reason that we need these?

Thanks,
John.

#4 lore raw
Quoted 12 lines · John Fastabend
Quoted 11 lines · John Fastabend

Remove redundant DCB_CAP_DCBX_STATIC bit in DCB capabilities

Setting this bit indicates that no embedded DCBx engine is present and the hardware can not be configured. This is the same as having none of the DCB capability flags set or simply not implementing the dcbnl ops at all.

This patch removes this bit. The bit has not made a stable release yet so removing it should not be an issue with existing apps.

Quoted 9 lines
Quoted 4 lines

---

Shmulik, could you ACK this because you added these bits? But I was adding support for this in lldpad and I see no reason that we need these?

DCB_CAP_DCBX_STATIC means that the embedded engine will turn the user configuration into the operational configuration without performing the actual negotiation, so it is not equivalent to not having an embedded DCBx engine. This is mostly a debug and integration option as it allows you to do DCB related or dependent testing and development without having a proper DCBx peer.

On second thought, I'm not sure this option is justified although we found it useful during our development. If you think it's not useful enough (or not at all) then by all means remove it.

Thanks,
Shmulik

#5 lore raw
Quoted 30 lines · Shmulik Ravid
Quoted 12 lines · John Fastabend
Quoted 11 lines · John Fastabend

Remove redundant DCB_CAP_DCBX_STATIC bit in DCB capabilities

Setting this bit indicates that no embedded DCBx engine is present and the hardware can not be configured. This is the same as having none of the DCB capability flags set or simply not implementing the dcbnl ops at all.

This patch removes this bit. The bit has not made a stable release yet so removing it should not be an issue with existing apps.

Quoted 9 lines
Quoted 4 lines

---

Shmulik, could you ACK this because you added these bits? But I was adding support for this in lldpad and I see no reason that we need these?

DCB_CAP_DCBX_STATIC means that the embedded engine will turn the user configuration into the operational configuration without performing the actual negotiation, so it is not equivalent to not having an embedded DCBx engine. This is mostly a debug and integration option as it allows you to do DCB related or dependent testing and development without having a proper DCBx peer.

Quoted 3 lines

On second thought, I'm not sure this option is justified although we found it useful during our development. If you think it's not useful enough (or not at all) then by all means remove it.

We have an advertise bit in userspace that can be set and cleared to do something similar for host based agents. I think for pg and application data you can get the same behavior by setting the device to not willing.

However for PFC it could potentially be useful. But how would the user set this mode? This is a capabilities bit indicating the device supports this. Is there a way to subsequently put the device in this mode?

--John

Quoted 6 lines

Thanks,
Shmulik

#6 lore raw
Quoted 31 lines · John Fastabend
Quoted 30 lines · Shmulik Ravid
Quoted 12 lines · John Fastabend
Quoted 11 lines · John Fastabend

Remove redundant DCB_CAP_DCBX_STATIC bit in DCB capabilities

Setting this bit indicates that no embedded DCBx engine is present and the hardware can not be configured. This is the same as having none of the DCB capability flags set or simply not implementing the dcbnl ops at all.

This patch removes this bit. The bit has not made a stable release yet so removing it should not be an issue with existing apps.

Quoted 9 lines
Quoted 4 lines

---

Shmulik, could you ACK this because you added these bits? But I was adding support for this in lldpad and I see no reason that we need these?

DCB_CAP_DCBX_STATIC means that the embedded engine will turn the user configuration into the operational configuration without performing the actual negotiation, so it is not equivalent to not having an embedded DCBx engine. This is mostly a debug and integration option as it allows you to do DCB related or dependent testing and development without having a proper DCBx peer.

Quoted 8 lines
Quoted 3 lines

On second thought, I'm not sure this option is justified although we found it useful during our development. If you think it's not useful enough (or not at all) then by all means remove it.

We have an advertise bit in userspace that can be set and cleared to do something similar for host based agents. I think for pg and application data you can get the same behavior by setting the device to not willing.

True, but this requires a proper DCBx peer. The STATIC option is a bit stronger.

Quoted 4 lines

However for PFC it could potentially be useful. But how would the user set this mode? This is a capabilities bit indicating the device supports this. Is there a way to subsequently put the device in this mode?

You can set this mode by specifying this attribute in the set_dcbx operation. The input to set_dcbx should be a subset of the advertised dcbx attributes.

Shmulik

#7 lore raw
Quoted 17 lines · Shmulik Ravid
Quoted 15 lines · John Fastabend
Quoted 14 lines · Shmulik Ravid
Quoted 12 lines · John Fastabend
Quoted 11 lines · John Fastabend

Remove redundant DCB_CAP_DCBX_STATIC bit in DCB capabilities

Setting this bit indicates that no embedded DCBx engine is present and the hardware can not be configured. This is the same as having none of the DCB capability flags set or simply not implementing the dcbnl ops at all.

This patch removes this bit. The bit has not made a stable release yet so removing it should not be an issue with existing apps.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

---

Dave, Please drop this patch sorry for the noise.

[...]

Quoted 6 lines
Quoted 4 lines

We have an advertise bit in userspace that can be set and cleared to do something similar for host based agents. I think for pg and application data you can get the same behavior by setting the device to not willing.

True, but this requires a proper DCBx peer. The STATIC option is a bit stronger.

At least in the PG case the CEE spec says the local configuration should be used[1]. Application is a bit more vague in my opinion[2].

Quoted 9 lines
Quoted 5 lines

However for PFC it could potentially be useful. But how would the user set this mode? This is a capabilities bit indicating the device supports this. Is there a way to subsequently put the device in this mode?

You can set this mode by specifying this attribute in the set_dcbx operation. The input to set_dcbx should be a subset of the advertised dcbx attributes.

OK This works for me Shmulik thanks for the explanation.

[1] 3.1.4. http://www.ieee802.org/1/files/public/docs2008/az-wadekar-dcbx-capability-exchange-discovery-protocol-1108-v1.01.pdf

[2] 3.3.2. http://www.ieee802.org/1/files/public/docs2008/az-wadekar-dcbx-capability-exchange-discovery-protocol-1108-v1.01.pdf

maintainer
#8 lore raw

From: John Fastabend <[email protected]>
Date: Mon, 24 Jan 2011 07:52:48 -0800

Quoted 18 lines · Shmulik Ravid
Quoted 17 lines · John Fastabend
Quoted 15 lines · Shmulik Ravid
Quoted 14 lines · John Fastabend
Quoted 12 lines · John Fastabend
Quoted 11 lines

Remove redundant DCB_CAP_DCBX_STATIC bit in DCB capabilities

Setting this bit indicates that no embedded DCBx engine is present and the hardware can not be configured. This is the same as having none of the DCB capability flags set or simply not implementing the dcbnl ops at all.

This patch removes this bit. The bit has not made a stable release yet so removing it should not be an issue with existing apps.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

---

Dave, Please drop this patch sorry for the noise.

OK.