Skip to contentSkip to conversation

net: add error return for dcb setstate

PATCH Applied Jeff Kirsher 2 participants 4 messages Dec 12, 2008 – Dec 15, 2008

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

PATCH 1/2 net: add error return for dcb setstate

From: Don Skidmore <[email protected]>

DCB had no way to know if setstate had failed in the driver. This patch enables dcb netlink code to handle the status for the DCB setstate interface.

---

 include/net/dcbnl.h |    2 +-
 net/dcb/dcbnl.c     |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
include/net/dcbnl.h +1 -1
index 91e0a3d..775cfc8 100644
@@ -26,7 +26,7 @@
  */
 struct dcbnl_rtnl_ops {
 	u8   (*getstate)(struct net_device *);
-	void (*setstate)(struct net_device *, u8);
+	u8   (*setstate)(struct net_device *, u8);
 	void (*getpermhwaddr)(struct net_device *, u8 *);
 	void (*setpgtccfgtx)(struct net_device *, int, u8, u8, u8, u8);
 	void (*setpgbwgcfgtx)(struct net_device *, int, u8);
net/dcb/dcbnl.c +2 -3
index 79a351d..d0c12f0 100644
@@ -714,9 +714,8 @@ static int dcbnl_setstate(struct net_device *netdev, struct nlattr **tb,
 
 	value = nla_get_u8(tb[DCB_ATTR_STATE]);
 
-	netdev->dcbnl_ops->setstate(netdev, value);
-
-	ret = dcbnl_reply(0, RTM_SETDCB, DCB_CMD_SSTATE, DCB_ATTR_STATE,
+	ret = dcbnl_reply(netdev->dcbnl_ops->setstate(netdev, value),
+	                  RTM_SETDCB, DCB_CMD_SSTATE, DCB_ATTR_STATE,
 	                  pid, seq, flags);
 
 	return ret;
#1 lore raw

PATCH 2/2 net: fix dcbnl_setnumtcs operation check

From: Don Skidmore <[email protected]>

dcbml_setnumtcs wasn't checking for the presence of the setnumtcs function. Instead, it was checking for setstate which was a bug.

---

 net/dcb/dcbnl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/dcb/dcbnl.c +1 -1
index d0c12f0..fc88fc4 100644
@@ -469,7 +469,7 @@ static int dcbnl_setnumtcs(struct net_device *netdev, struct nlattr **tb,
 	u8 value;
 	int i;
 
-	if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->setstate)
+	if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->setnumtcs)
 		return ret;
 
 	ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS],
maintainer Applied
#2 lore raw

Re: [NET-NEXT PATCH 2/2] net: fix dcbnl_setnumtcs operation check

From: Jeff Kirsher <[email protected]>
Date: Fri, 12 Dec 2008 01:52:45 -0800

Quoted 7 lines

dcbml_setnumtcs wasn't checking for the presence of the setnumtcs function. Instead, it was checking for setstate which was a bug.

Applied.

maintainer
#3 lore raw
In reply to Jeff Kirsher

From: Jeff Kirsher <[email protected]>
Date: Fri, 12 Dec 2008 01:52:21 -0800

Quoted 8 lines

DCB had no way to know if setstate had failed in the driver. This patch enables dcb netlink code to handle the status for the DCB setstate interface.

How can this build if you don't also update ixgbe_dcbnl_set_state() et al. to have a "u8" instead of a "void" return value too?

Oh I see, you send the update two patches later.

Don't do that, it breaks GIT bisect.

If you change the prototype for a method function, you must also change all implementations of that method to match at the same time.

I've dropped both changes.