16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * This file contains code imported from the OFED rds source file ib_stats.c
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * Oracle elects to have and use the contents of ib_stats.c under and governed
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * by the OpenIB.org BSD license (see below for full license text). However,
16e76cdd6e3cfaac7d91c3b0644ee1bc6cf52347agiri * the following notice accompanied the original version of this file:
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Copyright (c) 2006 Oracle. All rights reserved.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * This software is available to you under a choice of one of two
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * licenses. You may choose to be licensed under the terms of the GNU
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * General Public License (GPL) Version 2, available from the file
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * COPYING in the main directory of this source tree, or the
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * OpenIB.org BSD license below:
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Redistribution and use in source and binary forms, with or
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * without modification, are permitted provided that the following
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * conditions are met:
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * - Redistributions of source code must retain the above
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * copyright notice, this list of conditions and the following
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * disclaimer.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * - Redistributions in binary form must reproduce the above
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * copyright notice, this list of conditions and the following
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * disclaimer in the documentation and/or other materials
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * provided with the distribution.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * SOFTWARE.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_connect_raced",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_listen_closed_stale",
5e12ddada2833f3aa285210603ce9aaeb8be35ccEiji Ota "ib_evt_handler_call",
5e12ddada2833f3aa285210603ce9aaeb8be35ccEiji Ota "ib_tasklet_call",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_tx_cq_event",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_tx_ring_full",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_tx_throttle",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_tx_sg_mapping_failure",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_tx_stalled",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_tx_credit_updates",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rx_cq_event",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rx_ring_empty",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rx_refill_from_cq",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rx_refill_from_thread",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rx_alloc_limit",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rx_credit_updates",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_ack_sent",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_ack_send_failure",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_ack_send_delayed",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_ack_send_piggybacked",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_ack_received",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rdma_mr_alloc",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rdma_mr_free",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rdma_mr_used",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rdma_mr_pool_flush",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rdma_mr_pool_wait",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota "ib_rdma_mr_pool_depleted",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otaunsigned int
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otardsv3_ib_stats_info_copy(struct rdsv3_info_iterator *iter,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota unsigned int avail)
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota RDSV3_DPRINTF4("rdsv3_ib_stats_info_copy", "iter: %p, avail: %d",
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota src = (uint64_t *)&(rdsv3_per_cpu(rdsv3_ib_stats, cpu));
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota for (i = 0; i < sizeof (stats) / sizeof (uint64_t); i++)