2 * Copyright (c) 2008, 2009, 2010 Nicira Networks.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "wdp-provider.h"
28 #include "dynamic-string.h"
31 #include "ofp-print.h"
34 #include "poll-loop.h"
40 #include "wdp-xflow.h"
43 #define THIS_MODULE VLM_wdp
47 /* The caller is responsible for initialization 'rule->cr'. */
49 wdp_rule_init(struct wdp_rule *rule, const union ofp_action *actions,
52 rule->actions = xmemdup(actions, n_actions * sizeof *actions);
53 rule->n_actions = n_actions;
54 rule->created = time_msec();
55 rule->idle_timeout = 0;
56 rule->hard_timeout = 0;
57 rule->client_data = NULL;
61 wdp_rule_uninit(struct wdp_rule *rule)
68 static const struct wdp_class *base_wdp_classes[] = {
72 struct registered_wdp_class {
73 const struct wdp_class *wdp_class;
77 static struct shash wdp_classes = SHASH_INITIALIZER(&wdp_classes);
79 /* Rate limit for individual messages going to or from the datapath, output at
80 * DBG level. This is very high because, if these are enabled, it is because
81 * we really need to see them. */
82 static struct vlog_rate_limit wdpmsg_rl = VLOG_RATE_LIMIT_INIT(600, 600);
84 /* Not really much point in logging many wdp errors. */
85 static struct vlog_rate_limit error_rl = VLOG_RATE_LIMIT_INIT(9999, 5);
87 static void log_operation(const struct wdp *, const char *operation,
93 static int status = -1;
99 for (i = 0; i < ARRAY_SIZE(base_wdp_classes); i++) {
100 wdp_register_provider(base_wdp_classes[i]);
102 wdp_xflow_register();
106 /* Performs periodic work needed by all the various kinds of wdps.
108 * If your program opens any wdps, it must call both this function and
109 * netdev_run() within its main poll loop. */
113 struct shash_node *node;
114 SHASH_FOR_EACH(node, &wdp_classes) {
115 const struct registered_wdp_class *registered_class = node->data;
116 if (registered_class->wdp_class->run) {
117 registered_class->wdp_class->run();
122 /* Arranges for poll_block() to wake up when wdp_run() needs to be called.
124 * If your program opens any wdps, it must call both this function and
125 * netdev_wait() within its main poll loop. */
129 struct shash_node *node;
130 SHASH_FOR_EACH(node, &wdp_classes) {
131 const struct registered_wdp_class *registered_class = node->data;
132 if (registered_class->wdp_class->wait) {
133 registered_class->wdp_class->wait();
138 /* Registers a new datapath provider. After successful registration, new
139 * datapaths of that type can be opened using wdp_open(). */
141 wdp_register_provider(const struct wdp_class *new_class)
143 struct registered_wdp_class *registered_class;
145 if (shash_find(&wdp_classes, new_class->type)) {
146 VLOG_WARN("attempted to register duplicate datapath provider: %s",
151 registered_class = xmalloc(sizeof *registered_class);
152 registered_class->wdp_class = new_class;
153 registered_class->refcount = 0;
155 shash_add(&wdp_classes, new_class->type, registered_class);
160 /* Unregisters a datapath provider. 'type' must have been previously
161 * registered and not currently be in use by any wdps. After unregistration
162 * new datapaths of that type cannot be opened using wdp_open(). */
164 wdp_unregister_provider(const char *type)
166 struct shash_node *node;
167 struct registered_wdp_class *registered_class;
169 node = shash_find(&wdp_classes, type);
171 VLOG_WARN("attempted to unregister a datapath provider that is not "
172 "registered: %s", type);
176 registered_class = node->data;
177 if (registered_class->refcount) {
178 VLOG_WARN("attempted to unregister in use datapath provider: %s", type);
182 shash_delete(&wdp_classes, node);
183 free(registered_class);
188 /* Clears 'types' and enumerates the types of all currently registered datapath
189 * providers into it. The caller must first initialize the svec. */
191 wdp_enumerate_types(struct svec *types)
193 struct shash_node *node;
198 SHASH_FOR_EACH(node, &wdp_classes) {
199 const struct registered_wdp_class *registered_class = node->data;
200 svec_add(types, registered_class->wdp_class->type);
204 /* Clears 'names' and enumerates the names of all known created datapaths with
205 * the given 'type'. The caller must first initialize the svec. Returns 0 if
206 * successful, otherwise a positive errno value.
208 * Some kinds of datapaths might not be practically enumerable. This is not
209 * considered an error. */
211 wdp_enumerate_names(const char *type, struct svec *names)
213 const struct registered_wdp_class *registered_class;
214 const struct wdp_class *wdp_class;
220 registered_class = shash_find_data(&wdp_classes, type);
221 if (!registered_class) {
222 VLOG_WARN("could not enumerate unknown type: %s", type);
226 wdp_class = registered_class->wdp_class;
227 error = (wdp_class->enumerate
228 ? wdp_class->enumerate(wdp_class, names)
232 VLOG_WARN("failed to enumerate %s datapaths: %s", wdp_class->type,
239 /* Parses 'datapath name', which is of the form type@name into its
240 * component pieces. 'name' and 'type' must be freed by the caller. */
242 wdp_parse_name(const char *datapath_name_, char **name, char **type)
244 char *datapath_name = xstrdup(datapath_name_);
247 separator = strchr(datapath_name, '@');
250 *type = datapath_name;
251 *name = xstrdup(separator + 1);
253 *name = datapath_name;
259 do_open(const char *name, const char *type, bool create, struct wdp **wdpp)
261 struct wdp *wdp = NULL;
263 struct registered_wdp_class *registered_class;
267 if (!type || *type == '\0') {
271 registered_class = shash_find_data(&wdp_classes, type);
272 if (!registered_class) {
273 VLOG_WARN("could not create datapath %s of unknown type %s", name,
275 error = EAFNOSUPPORT;
279 error = registered_class->wdp_class->open(registered_class->wdp_class,
282 registered_class->refcount++;
286 *wdpp = error ? NULL : wdp;
290 /* Tries to open an existing datapath named 'name' and type 'type'. Will fail
291 * if no datapath with 'name' and 'type' exists. 'type' may be either NULL or
292 * the empty string to specify the default system type. Returns 0 if
293 * successful, otherwise a positive errno value. On success stores a pointer
294 * to the datapath in '*wdpp', otherwise a null pointer. */
296 wdp_open(const char *name, const char *type, struct wdp **wdpp)
298 return do_open(name, type, false, wdpp);
301 /* Tries to create and open a new datapath with the given 'name' and 'type'.
302 * 'type' may be either NULL or the empty string to specify the default system
303 * type. Will fail if a datapath with 'name' and 'type' already exists.
304 * Returns 0 if successful, otherwise a positive errno value. On success
305 * stores a pointer to the datapath in '*wdpp', otherwise a null pointer. */
307 wdp_create(const char *name, const char *type, struct wdp **wdpp)
309 return do_open(name, type, true, wdpp);
312 /* Tries to open a datapath with the given 'name' and 'type', creating it if it
313 * does not exist. 'type' may be either NULL or the empty string to specify
314 * the default system type. Returns 0 if successful, otherwise a positive
315 * errno value. On success stores a pointer to the datapath in '*wdpp',
316 * otherwise a null pointer. */
318 wdp_create_and_open(const char *name, const char *type, struct wdp **wdpp)
322 error = wdp_create(name, type, wdpp);
323 if (error == EEXIST || error == EBUSY) {
324 error = wdp_open(name, type, wdpp);
326 VLOG_WARN("datapath %s already exists but cannot be opened: %s",
327 name, strerror(error));
330 VLOG_WARN("failed to create datapath %s: %s", name, strerror(error));
335 /* Closes and frees the connection to 'wdp'. Does not destroy the wdp
336 * itself; call wdp_delete() first, instead, if that is desirable. */
338 wdp_close(struct wdp *wdp)
341 struct registered_wdp_class *registered_class;
343 registered_class = shash_find_data(&wdp_classes,
344 wdp->wdp_class->type);
345 assert(registered_class);
346 assert(registered_class->refcount);
348 registered_class->refcount--;
349 wdp_uninit(wdp, true);
353 /* Returns the name of datapath 'wdp' prefixed with the type
354 * (for use in log messages). */
356 wdp_name(const struct wdp *wdp)
358 return wdp->full_name;
361 /* Returns the name of datapath 'wdp' without the type
362 * (for use in device names). */
364 wdp_base_name(const struct wdp *wdp)
366 return wdp->base_name;
369 /* Enumerates all names that may be used to open 'wdp' into 'all_names'. The
370 * Linux datapath, for example, supports opening a datapath both by number,
371 * e.g. "wdp0", and by the name of the datapath's local port. For some
372 * datapaths, this might be an infinite set (e.g. in a file name, slashes may
373 * be duplicated any number of times), in which case only the names most likely
374 * to be used will be enumerated.
376 * The caller must already have initialized 'all_names'. Any existing names in
377 * 'all_names' will not be disturbed. */
379 wdp_get_all_names(const struct wdp *wdp, struct svec *all_names)
381 if (wdp->wdp_class->get_all_names) {
382 int error = wdp->wdp_class->get_all_names(wdp, all_names);
384 VLOG_WARN_RL(&error_rl,
385 "failed to retrieve names for datpath %s: %s",
386 wdp_name(wdp), strerror(error));
390 svec_add(all_names, wdp_base_name(wdp));
395 /* Destroys the datapath that 'wdp' is connected to, first removing all of
396 * its ports. After calling this function, it does not make sense to pass
397 * 'wdp' to any functions other than wdp_name() or wdp_close(). */
399 wdp_delete(struct wdp *wdp)
403 COVERAGE_INC(wdp_destroy);
405 error = wdp->wdp_class->destroy(wdp);
406 log_operation(wdp, "delete", error);
411 wdp_get_features(const struct wdp *wdp, struct ofpbuf **featuresp)
413 int error = wdp->wdp_class->get_features(wdp, featuresp);
420 /* Retrieves statistics for 'wdp' into 'stats'. Returns 0 if successful,
421 * otherwise a positive errno value. */
423 wdp_get_wdp_stats(const struct wdp *wdp, struct wdp_stats *stats)
425 int error = wdp->wdp_class->get_stats(wdp, stats);
427 memset(stats, 0, sizeof *stats);
429 log_operation(wdp, "get_stats", error);
433 /* Retrieves the current IP fragment handling policy for 'wdp' into
434 * '*drop_frags': true indicates that fragments are dropped, false indicates
435 * that fragments are treated in the same way as other IP packets (except that
436 * the L4 header cannot be read). Returns 0 if successful, otherwise a
437 * positive errno value. */
439 wdp_get_drop_frags(const struct wdp *wdp, bool *drop_frags)
441 int error = wdp->wdp_class->get_drop_frags(wdp, drop_frags);
445 log_operation(wdp, "get_drop_frags", error);
449 /* Changes 'wdp''s treatment of IP fragments to 'drop_frags', whose meaning is
450 * the same as for the get_drop_frags member function. Returns 0 if
451 * successful, otherwise a positive errno value. */
453 wdp_set_drop_frags(struct wdp *wdp, bool drop_frags)
455 int error = wdp->wdp_class->set_drop_frags(wdp, drop_frags);
456 log_operation(wdp, "set_drop_frags", error);
460 /* Attempts to add 'devname' as a port on 'wdp'. If 'internal' is true,
461 * creates the port as an internal port. If successful, returns 0 and sets
462 * '*port_nop' to the new port's port number (if 'port_nop' is non-null). On
463 * failure, returns a positive errno value and sets '*port_nop' to UINT16_MAX
464 * (if 'port_nop' is non-null). */
466 wdp_port_add(struct wdp *wdp, const char *devname,
467 bool internal, uint16_t *port_nop)
472 COVERAGE_INC(wdp_port_add);
474 error = wdp->wdp_class->port_add(wdp, devname, internal, &port_no);
476 VLOG_DBG_RL(&wdpmsg_rl, "%s: added %s as port %"PRIu16,
477 wdp_name(wdp), devname, port_no);
479 VLOG_WARN_RL(&error_rl, "%s: failed to add %s as port: %s",
480 wdp_name(wdp), devname, strerror(error));
481 port_no = UINT16_MAX;
489 /* Attempts to remove 'wdp''s port number 'port_no'. Returns 0 if successful,
490 * otherwise a positive errno value. */
492 wdp_port_del(struct wdp *wdp, uint16_t port_no)
496 COVERAGE_INC(wdp_port_del);
498 error = wdp->wdp_class->port_del(wdp, port_no);
499 log_operation(wdp, "port_del", error);
503 /* Looks up port number 'port_no' in 'wdp'. On success, returns 0 and points
504 * '*portp' to a wdp_port representing the specified port. On failure, returns
505 * a positive errno value and sets '*portp' to NULL.
507 * The caller must not modify or free the returned wdp_port. Calling
508 * wdp_run() or wdp_port_poll() may free the returned wdp_port. */
510 wdp_port_query_by_number(const struct wdp *wdp, uint16_t port_no,
511 struct wdp_port **portp)
515 error = wdp->wdp_class->port_query_by_number(wdp, port_no, portp);
517 VLOG_DBG_RL(&wdpmsg_rl, "%s: port %"PRIu16" is device %s",
518 wdp_name(wdp), port_no, (*portp)->devname);
521 VLOG_WARN_RL(&error_rl, "%s: failed to query port %"PRIu16": %s",
522 wdp_name(wdp), port_no, strerror(error));
527 /* Same as wdp_port_query_by_number() except that it look for a port named
528 * 'devname' in 'wdp'. */
530 wdp_port_query_by_name(const struct wdp *wdp, const char *devname,
531 struct wdp_port **portp)
533 int error = wdp->wdp_class->port_query_by_name(wdp, devname, portp);
535 VLOG_DBG_RL(&wdpmsg_rl, "%s: device %s is on port %"PRIu16,
536 wdp_name(wdp), devname, (*portp)->opp.port_no);
540 /* Log level is DBG here because all the current callers are interested
541 * in whether 'wdp' actually has a port 'devname', so that it's not
542 * an issue worth logging if it doesn't. */
543 VLOG_DBG_RL(&error_rl, "%s: failed to query port %s: %s",
544 wdp_name(wdp), devname, strerror(error));
549 /* Looks up port number 'port_no' in 'wdp'. On success, returns 0 and stores
550 * a copy of the port's name in '*namep'. On failure, returns a positive errno
551 * value and stores NULL in '*namep'.
553 * The caller is responsible for freeing '*namep' (with free()). */
555 wdp_port_get_name(struct wdp *wdp, uint16_t port_no, char **namep)
557 struct wdp_port *port;
560 error = wdp_port_query_by_number(wdp, port_no, &port);
561 *namep = !error ? xstrdup(port->devname) : NULL;
565 /* Obtains a list of all the ports in 'wdp'.
567 * If successful, returns 0 and sets '*portsp' to point to an array of
568 * pointers to port structures and '*n_portsp' to the number of pointers in the
569 * array. On failure, returns a positive errno value and sets '*portsp' to
570 * NULL and '*n_portsp' to 0.
572 * The caller is responsible for freeing '*portsp' by calling free(). The
573 * caller must not free the individual wdp_port structures. Calling
574 * wdp_run() or wdp_port_poll() may free the returned wdp_ports. */
576 wdp_port_list(const struct wdp *wdp,
577 struct wdp_port ***portsp, size_t *n_portsp)
581 error = wdp->wdp_class->port_list(wdp, portsp, n_portsp);
586 log_operation(wdp, "port_list", error);
591 wdp_port_set_config(struct wdp *wdp, uint16_t port_no, uint32_t config)
593 return wdp->wdp_class->port_set_config(wdp, port_no, config);
596 /* Polls for changes in the set of ports in 'wdp'. If the set of ports in
597 * 'wdp' has changed, this function does one of the following:
599 * - Stores the name of the device that was added to or deleted from 'wdp' in
600 * '*devnamep' and returns 0. The caller is responsible for freeing
601 * '*devnamep' (with free()) when it no longer needs it.
603 * - Returns ENOBUFS and sets '*devnamep' to NULL.
605 * This function may also return 'false positives', where it returns 0 and
606 * '*devnamep' names a device that was not actually added or deleted or it
607 * returns ENOBUFS without any change.
609 * Returns EAGAIN if the set of ports in 'wdp' has not changed. May also
610 * return other positive errno values to indicate that something has gone
613 wdp_port_poll(const struct wdp *wdp, char **devnamep)
615 int error = wdp->wdp_class->port_poll(wdp, devnamep);
622 /* Arranges for the poll loop to wake up when port_poll(wdp) will return a
623 * value other than EAGAIN. */
625 wdp_port_poll_wait(const struct wdp *wdp)
627 wdp->wdp_class->port_poll_wait(wdp);
630 /* Deletes all flows from 'wdp'. Returns 0 if successful, otherwise a
631 * positive errno value. */
633 wdp_flow_flush(struct wdp *wdp)
637 COVERAGE_INC(wdp_flow_flush);
639 error = wdp->wdp_class->flow_flush(wdp);
640 log_operation(wdp, "flow_flush", error);
645 wdp_flow_get(struct wdp *wdp, const flow_t *flow)
647 return wdp->wdp_class->flow_get(wdp, flow);
651 wdp_flow_match(struct wdp *wdp, const flow_t *flow)
653 return wdp->wdp_class->flow_match(wdp, flow);
657 wdp_flow_for_each_match(const struct wdp *wdp, const flow_t *target,
658 int include, wdp_flow_cb_func *callback, void *aux)
660 wdp->wdp_class->flow_for_each_match(wdp, target, include,
665 wdp_flow_get_stats(const struct wdp *wdp, const struct wdp_rule *rule,
666 struct wdp_flow_stats *stats)
668 int error = wdp->wdp_class->flow_get_stats(wdp, rule, stats);
670 memset(stats, 0, sizeof *stats);
676 wdp_flow_overlaps(const struct wdp *wdp, const flow_t *flow)
678 return wdp->wdp_class->flow_overlaps(wdp, flow);
682 wdp_flow_put(struct wdp *wdp, struct wdp_flow_put *put,
683 struct wdp_flow_stats *old_stats, struct wdp_rule **rulep)
685 int error = wdp->wdp_class->flow_put(wdp, put, old_stats, rulep);
688 memset(old_stats, 0, sizeof *old_stats);
698 wdp_flow_delete(struct wdp *wdp, struct wdp_rule *rule,
699 struct wdp_flow_stats *final_stats)
701 int error = wdp->wdp_class->flow_delete(wdp, rule, final_stats);
702 if (error && final_stats) {
703 memset(final_stats, 0, sizeof *final_stats);
709 wdp_flow_inject(struct wdp *wdp, struct wdp_rule *rule,
710 uint16_t in_port, const struct ofpbuf *packet)
712 return wdp->wdp_class->flow_inject(wdp, rule, in_port, packet);
716 wdp_execute(struct wdp *wdp, uint16_t in_port,
717 const union ofp_action actions[], size_t n_actions,
718 const struct ofpbuf *buf)
722 COVERAGE_INC(wdp_execute);
724 error = wdp->wdp_class->execute(wdp, in_port, actions,
732 /* Retrieves 'wdp''s "listen mask" into '*listen_mask'. Each bit set in
733 * '*listen_mask' indicates that wdp_recv() will receive messages of the
734 * corresponding WDP_CHAN_* type. Returns 0 if successful, otherwise a
735 * positive errno value. */
737 wdp_recv_get_mask(const struct wdp *wdp, int *listen_mask)
739 int error = wdp->wdp_class->recv_get_mask(wdp, listen_mask);
743 log_operation(wdp, "recv_get_mask", error);
747 /* Sets 'wdp''s "listen mask" to 'listen_mask'. Each bit set in
748 * '*listen_mask' requests that wdp_recv() receive messages of the
749 * corresponding WDP_CHAN_* type. Returns 0 if successful, otherwise a
750 * positive errno value. */
752 wdp_recv_set_mask(struct wdp *wdp, int listen_mask)
754 int error = wdp->wdp_class->recv_set_mask(wdp, listen_mask);
755 log_operation(wdp, "recv_set_mask", error);
759 /* Retrieve the sFlow sampling probability. '*probability' is expressed as the
760 * number of packets out of UINT_MAX to sample, e.g. probability/UINT_MAX is
761 * the probability of sampling a given packet.
763 * Returns 0 if successful, otherwise a positive errno value. EOPNOTSUPP
764 * indicates that 'wdp' does not support sFlow sampling. */
766 wdp_get_sflow_probability(const struct wdp *wdp, uint32_t *probability)
768 int error = (wdp->wdp_class->get_sflow_probability
769 ? wdp->wdp_class->get_sflow_probability(wdp, probability)
774 log_operation(wdp, "get_sflow_probability", error);
778 /* Set the sFlow sampling probability. 'probability' is expressed as the
779 * number of packets out of UINT_MAX to sample, e.g. probability/UINT_MAX is
780 * the probability of sampling a given packet.
782 * Returns 0 if successful, otherwise a positive errno value. EOPNOTSUPP
783 * indicates that 'wdp' does not support sFlow sampling. */
785 wdp_set_sflow_probability(struct wdp *wdp, uint32_t probability)
787 int error = (wdp->wdp_class->set_sflow_probability
788 ? wdp->wdp_class->set_sflow_probability(wdp, probability)
790 log_operation(wdp, "set_sflow_probability", error);
794 /* Attempts to receive a message from 'wdp'. If successful, stores the
795 * message into '*packetp'. Only messages of the types selected with
796 * wdp_set_listen_mask() will ordinarily be received (but if a message type
797 * is enabled and then later disabled, some stragglers might pop up).
799 * Returns 0 if successful, otherwise a positive errno value. Returns EAGAIN
800 * if no message is immediately available. */
802 wdp_recv(struct wdp *wdp, struct wdp_packet *packet)
804 int error = wdp->wdp_class->recv(wdp, packet);
806 /* XXX vlog_dbg received packet */
808 memset(packet, 0, sizeof *packet);
809 packet->channel = -1;
814 /* Discards all messages that would otherwise be received by wdp_recv() on
815 * 'wdp'. Returns 0 if successful, otherwise a positive errno value. */
817 wdp_recv_purge(struct wdp *wdp)
819 struct wdp_stats stats;
823 COVERAGE_INC(wdp_purge);
825 error = wdp_get_wdp_stats(wdp, &stats);
830 for (i = 0; i < stats.max_miss_queue + stats.max_action_queue + stats.max_sflow_queue; i++) {
831 struct wdp_packet packet;
833 error = wdp_recv(wdp, &packet);
835 return error == EAGAIN ? 0 : error;
837 ofpbuf_delete(packet.payload);
842 /* Arranges for the poll loop to wake up when 'wdp' has a message queued to be
843 * received with wdp_recv(). */
845 wdp_recv_wait(struct wdp *wdp)
847 wdp->wdp_class->recv_wait(wdp);
850 /* Obtains the NetFlow engine type and engine ID for 'wdp' into '*engine_type'
851 * and '*engine_id', respectively. */
853 wdp_get_netflow_ids(const struct wdp *wdp,
854 uint8_t *engine_type, uint8_t *engine_id)
856 *engine_type = wdp->netflow_engine_type;
857 *engine_id = wdp->netflow_engine_id;
861 wdp_packet_destroy(struct wdp_packet *packet)
864 ofpbuf_delete(packet->payload);
870 wdp_init(struct wdp *wdp, const struct wdp_class *wdp_class,
872 uint8_t netflow_engine_type, uint8_t netflow_engine_id)
874 wdp->wdp_class = wdp_class;
875 wdp->base_name = xstrdup(name);
876 wdp->full_name = xasprintf("%s@%s", wdp_class->type, name);
877 wdp->netflow_engine_type = netflow_engine_type;
878 wdp->netflow_engine_id = netflow_engine_id;
881 /* Undoes the results of initialization.
883 * Normally this function only needs to be called from wdp_close().
884 * However, it may be called by providers due to an error on opening
885 * that occurs after initialization. It this case wdp_close() would
886 * never be called. */
888 wdp_uninit(struct wdp *wdp, bool close)
890 char *base_name = wdp->base_name;
891 char *full_name = wdp->full_name;
894 wdp->wdp_class->close(wdp);
902 log_operation(const struct wdp *wdp, const char *operation, int error)
905 VLOG_DBG_RL(&wdpmsg_rl, "%s: %s success", wdp_name(wdp), operation);
907 VLOG_WARN_RL(&error_rl, "%s: %s failed (%s)",
908 wdp_name(wdp), operation, strerror(error));