Lines Matching defs:iface

28 		     struct cifs_server_iface *iface);
32 struct cifs_server_iface *iface)
34 struct sockaddr_in *i4 = (struct sockaddr_in *)&iface->sockaddr;
35 struct sockaddr_in6 *i6 = (struct sockaddr_in6 *)&iface->sockaddr;
39 if (server->dstaddr.ss_family != iface->sockaddr.ss_family)
55 bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface)
61 if (ses->chans[i].iface == iface) {
173 return ses->chans[chan_index].iface &&
174 ses->chans[chan_index].iface->is_active;
186 struct cifs_server_iface *iface = NULL, *niface = NULL;
232 if (!iface)
233 iface = list_first_entry(&ses->iface_list, struct cifs_server_iface,
239 list_for_each_entry_safe_from(iface, niface, &ses->iface_list,
242 if (iface->rdma_capable != ses->server->rdma)
246 if (!iface->is_active ||
247 (is_ses_using_iface(ses, iface) &&
248 !iface->rss_capable))
252 iface_weight = iface->speed / iface_min_speed;
254 if (iface->weight_fulfilled >= iface_weight)
258 kref_get(&iface->refcount);
261 rc = cifs_ses_add_channel(ses, iface);
265 cifs_dbg(VFS, "failed to open extra channel on iface:%pIS rc=%d\n",
266 &iface->sockaddr,
268 kref_put(&iface->refcount, release_iface);
270 iface->weight_fulfilled++;
274 iface->num_channels++;
275 iface->weight_fulfilled++;
276 cifs_dbg(VFS, "successfully opened new channel on iface:%pIS\n",
277 &iface->sockaddr);
282 if (list_entry_is_head(iface, &ses->iface_list, iface_head)) {
283 list_for_each_entry(iface, &ses->iface_list, iface_head)
284 iface->weight_fulfilled = 0;
286 iface = NULL;
308 struct cifs_server_iface *iface;
321 iface = ses->chans[i].iface;
328 ses->chans[i].iface = NULL;
332 if (iface) {
334 kref_put(&iface->refcount, release_iface);
335 iface->num_channels--;
336 if (iface->weight_fulfilled)
337 iface->weight_fulfilled--;
357 * update the iface for the channel if necessary.
358 * will return 0 when iface is updated, 1 if removed, 2 otherwise
366 struct cifs_server_iface *iface = NULL;
379 if (ses->chans[chan_index].iface) {
380 old_iface = ses->chans[chan_index].iface;
404 list_for_each_entry(iface, &ses->iface_list, iface_head) {
406 /* if we're trying to get the updated iface for primary channel */
408 (struct sockaddr *) &iface->sockaddr))
411 kref_get(&iface->refcount);
416 if (iface->rdma_capable != server->rdma)
419 if (!iface->is_active ||
420 (is_ses_using_iface(ses, iface) &&
421 !iface->rss_capable)) {
426 iface_weight = iface->speed / iface_min_speed;
428 if (iface->weight_fulfilled >= iface_weight)
431 kref_get(&iface->refcount);
435 if (list_entry_is_head(iface, &ses->iface_list, iface_head)) {
437 iface = NULL;
438 cifs_dbg(FYI, "unable to find a suitable iface\n");
441 if (!chan_index && !iface) {
448 /* now drop the ref to the current iface */
449 if (old_iface && iface) {
450 cifs_dbg(FYI, "replacing iface: %pIS with %pIS\n",
452 &iface->sockaddr);
457 iface->num_channels++;
458 iface->weight_fulfilled++;
462 cifs_dbg(FYI, "releasing ref to iface: %pIS\n",
472 cifs_dbg(FYI, "referencing primary channel iface: %pIS\n",
473 &iface->sockaddr);
474 iface->num_channels++;
475 iface->weight_fulfilled++;
477 WARN_ON(!iface);
478 cifs_dbg(FYI, "adding new iface: %pIS\n", &iface->sockaddr);
489 ses->chans[chan_index].iface = iface;
491 /* No iface is found. if secondary chan, drop connection */
492 if (!iface && SERVER_IS_CHAN(server))
497 if (!iface && SERVER_IS_CHAN(server))
525 struct cifs_server_iface *iface)
531 struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr;
532 struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr;
537 if (iface->sockaddr.ss_family == AF_INET)
539 ses, iface->speed, iface->rdma_capable ? "yes" : "no",
543 ses, iface->speed, iface->rdma_capable ? "yes" : "no",
548 * session and overwrite it with the requested iface data.
606 ctx->rdma = iface->rdma_capable;
607 memcpy(&ctx->dstaddr, &iface->sockaddr, sizeof(ctx->dstaddr));
625 chan->iface = iface;