aboutsummaryrefslogtreecommitdiffstats
path: root/net/ncsi
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-12-15 00:16:40 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-18 14:50:11 -0500
commit75e8e15635e08f2598ecd20f4f71f4d043dd6e68 (patch)
tree328d75bf43e0f9f403fca2323e8d827cac200b43 /net/ncsi
parent27e9f4b3e55a8b869493970d01f48685bfd54834 (diff)
net/ncsi: Don't take any action on HNCDSC AEN
The current HNCDSC handler takes the status flag from the AEN packet and will update or change the current channel based on this flag and the current channel status. However the flag from the HNCDSC packet merely represents the host link state. While the state of the host interface is potentially interesting information it should not affect the state of the NCSI link. Indeed the NCSI specification makes no mention of any recommended action related to the host network controller driver state. Update the HNCDSC handler to record the host network driver status but take no other action. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ncsi')
-rw-r--r--net/ncsi/ncsi-aen.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/net/ncsi/ncsi-aen.c b/net/ncsi/ncsi-aen.c
index 67e708e98ccf..e7b05de1e6d1 100644
--- a/net/ncsi/ncsi-aen.c
+++ b/net/ncsi/ncsi-aen.c
@@ -143,43 +143,14 @@ static int ncsi_aen_handler_hncdsc(struct ncsi_dev_priv *ndp,
143 if (!nc) 143 if (!nc)
144 return -ENODEV; 144 return -ENODEV;
145 145
146 /* If the channel is active one, we need reconfigure it */
147 spin_lock_irqsave(&nc->lock, flags); 146 spin_lock_irqsave(&nc->lock, flags);
148 ncm = &nc->modes[NCSI_MODE_LINK]; 147 ncm = &nc->modes[NCSI_MODE_LINK];
149 hncdsc = (struct ncsi_aen_hncdsc_pkt *)h; 148 hncdsc = (struct ncsi_aen_hncdsc_pkt *)h;
150 ncm->data[3] = ntohl(hncdsc->status); 149 ncm->data[3] = ntohl(hncdsc->status);
151 netdev_info(ndp->ndev.dev, "NCSI: HNCDSC AEN - channel %u state %s\n",
152 nc->id, ncm->data[3] & 0x3 ? "up" : "down");
153 if (!list_empty(&nc->link) ||
154 nc->state != NCSI_CHANNEL_ACTIVE) {
155 spin_unlock_irqrestore(&nc->lock, flags);
156 return 0;
157 }
158
159 spin_unlock_irqrestore(&nc->lock, flags);
160 if (!(ndp->flags & NCSI_DEV_HWA) && !(ncm->data[3] & 0x1))
161 ndp->flags |= NCSI_DEV_RESHUFFLE;
162
163 /* If this channel is the active one and the link doesn't
164 * work, we have to choose another channel to be active one.
165 * The logic here is exactly similar to what we do when link
166 * is down on the active channel.
167 *
168 * On the other hand, we need configure it when host driver
169 * state on the active channel becomes ready.
170 */
171 ncsi_stop_channel_monitor(nc);
172
173 spin_lock_irqsave(&nc->lock, flags);
174 nc->state = (ncm->data[3] & 0x1) ? NCSI_CHANNEL_INACTIVE :
175 NCSI_CHANNEL_ACTIVE;
176 spin_unlock_irqrestore(&nc->lock, flags); 150 spin_unlock_irqrestore(&nc->lock, flags);
177 151 netdev_printk(KERN_DEBUG, ndp->ndev.dev,
178 spin_lock_irqsave(&ndp->lock, flags); 152 "NCSI: host driver %srunning on channel %u\n",
179 list_add_tail_rcu(&nc->link, &ndp->channel_queue); 153 ncm->data[3] & 0x1 ? "" : "not ", nc->id);
180 spin_unlock_irqrestore(&ndp->lock, flags);
181
182 ncsi_process_next_channel(ndp);
183 154
184 return 0; 155 return 0;
185} 156}