1 From: John Ronciak <john.ronciak@intel.com>
2 Subject: Bugfix for ixgbe and kernel DCB netlink code
3 Acked-by: Karsten Keil <kkeil@novell.com>
6 The patch file ixgbe-dcb-setstate.patch, created against the SLES11 Beta6
7 kernel source, contains the following fixes:
10 - Fix the DCB setstate operation function to check and not attempt to
11 enable DCB if MSI-X is not enabled. Return a success/failure status to the DCB
14 Change to DCB netlink in kernel:
15 - Accept a success/failure status from the DCB setstate operation
18 - Fix the dcbnl_setnumtcs routine to check for the presence of the
19 setnumtcs operation function (instead of setstate)
21 We are in the process of pushing these changes to the upstream kernel as well.
23 diff -Naurp linux-2.6.27.7-4/drivers/net/ixgbe/ixgbe_dcb_nl.c linux-2.6.27.7-4-new/drivers/net/ixgbe/ixgbe_dcb_nl.c
24 --- linux-2.6.27.7-4/drivers/net/ixgbe/ixgbe_dcb_nl.c 2008-12-10 14:12:15.000000000 -0800
25 +++ linux-2.6.27.7-4-new/drivers/net/ixgbe/ixgbe_dcb_nl.c 2008-12-09 15:50:21.000000000 -0800
26 @@ -126,7 +126,7 @@ static u16 ixgbe_dcb_select_queue(struct
30 -static void ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
31 +static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
33 struct ixgbe_adapter *adapter = netdev_priv(netdev);
35 @@ -135,25 +135,30 @@ static void ixgbe_dcbnl_set_state(struct
38 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
41 - if (netif_running(netdev))
42 - netdev->stop(netdev);
43 - ixgbe_reset_interrupt_capability(adapter);
44 - ixgbe_napi_del_all(adapter);
45 - kfree(adapter->tx_ring);
46 - kfree(adapter->rx_ring);
47 - adapter->tx_ring = NULL;
48 - adapter->rx_ring = NULL;
49 - netdev->select_queue = &ixgbe_dcb_select_queue;
53 - adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
54 - adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
55 - ixgbe_init_interrupt_scheme(adapter);
56 - ixgbe_napi_add_all(adapter);
57 - if (netif_running(netdev))
58 - netdev->open(netdev);
60 + if (!(adapter->flags & IXGBE_FLAG_MSIX_ENABLED)) {
61 + DPRINTK(DRV, ERR, "Enable Failed, needs MSI-X\n");
65 + if (netif_running(netdev))
66 + netdev->stop(netdev);
67 + ixgbe_reset_interrupt_capability(adapter);
68 + ixgbe_napi_del_all(adapter);
69 + kfree(adapter->tx_ring);
70 + kfree(adapter->rx_ring);
71 + adapter->tx_ring = NULL;
72 + adapter->rx_ring = NULL;
73 + netdev->select_queue = &ixgbe_dcb_select_queue;
75 + adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
76 + adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
77 + ixgbe_init_interrupt_scheme(adapter);
78 + ixgbe_napi_add_all(adapter);
79 + if (netif_running(netdev))
80 + netdev->open(netdev);
83 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
84 @@ -173,10 +178,9 @@ static void ixgbe_dcbnl_set_state(struct
85 ixgbe_napi_add_all(adapter);
86 if (netif_running(netdev))
95 static void ixgbe_dcbnl_get_perm_hw_addr(struct net_device *netdev,
96 diff -Naurp linux-2.6.27.7-4/include/net/dcbnl.h linux-2.6.27.7-4-new/include/net/dcbnl.h
97 --- linux-2.6.27.7-4/include/net/dcbnl.h 2008-12-10 14:00:13.000000000 -0800
98 +++ linux-2.6.27.7-4-new/include/net/dcbnl.h 2008-12-10 14:22:03.000000000 -0800
101 struct dcbnl_rtnl_ops {
102 u8 (*getstate)(struct net_device *);
103 - void (*setstate)(struct net_device *, u8);
104 + u8 (*setstate)(struct net_device *, u8);
105 void (*getpermhwaddr)(struct net_device *, u8 *);
106 void (*setpgtccfgtx)(struct net_device *, int, u8, u8, u8, u8);
107 void (*setpgbwgcfgtx)(struct net_device *, int, u8);
108 diff -Naurp linux-2.6.27.7-4/net/dcb/dcbnl.c linux-2.6.27.7-4-new/net/dcb/dcbnl.c
109 --- linux-2.6.27.7-4/net/dcb/dcbnl.c 2008-12-10 13:59:34.000000000 -0800
110 +++ linux-2.6.27.7-4-new/net/dcb/dcbnl.c 2008-12-10 14:26:41.000000000 -0800
111 @@ -437,7 +437,7 @@ static int dcbnl_setnumtcs(struct net_de
115 - if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->setstate)
116 + if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->setnumtcs)
119 ret = nla_parse_nested(data, DCB_NUMTCS_ATTR_MAX, tb[DCB_ATTR_NUMTCS],
120 @@ -682,10 +682,8 @@ static int dcbnl_setstate(struct net_dev
122 value = nla_get_u8(tb[DCB_ATTR_STATE]);
124 - netdev->dcbnl_ops->setstate(netdev, value);
126 - ret = dcbnl_reply(0, RTM_SETDCB, DCB_CMD_SSTATE, DCB_ATTR_STATE,
128 + ret = dcbnl_reply(netdev->dcbnl_ops->setstate(netdev, value),
129 + RTM_SETDCB, DCB_CMD_SSTATE, DCB_ATTR_STATE, pid, seq, flags);