/********************************************************************** * Author: Cavium, Inc. * * Contact: support@cavium.com * Please include "LiquidIO" in the subject. * * Copyright (c) 2003-2016 Cavium, Inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, Version 2, as * published by the Free Software Foundation. * * This file is distributed in the hope that it will be useful, but * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or * NONINFRINGEMENT. See the GNU General Public License for more details.
***********************************************************************/ #include <linux/pci.h> #include <linux/netdevice.h> #include"liquidio_common.h" #include"octeon_droq.h" #include"octeon_iq.h" #include"response_manager.h" #include"octeon_device.h" #include"octeon_main.h" #include"octeon_mailbox.h" #include"cn23xx_pf_device.h"
/** * octeon_mbox_read: * @mbox: Pointer mailbox * * Reads the 8-bytes of data from the mbox register * Writes back the acknowldgement inidcating completion of read
*/ int octeon_mbox_read(struct octeon_mbox *mbox)
{ union octeon_mbox_message msg; int ret = 0;
staticvoid get_vf_stats(struct octeon_device *oct, struct oct_vf_stats *stats)
{ int i;
for (i = 0; i < oct->num_iqs; i++) { if (!oct->instr_queue[i]) continue;
stats->tx_packets += oct->instr_queue[i]->stats.tx_done;
stats->tx_bytes += oct->instr_queue[i]->stats.tx_tot_bytes;
}
for (i = 0; i < oct->num_oqs; i++) { if (!oct->droq[i]) continue;
stats->rx_packets += oct->droq[i]->stats.rx_pkts_received;
stats->rx_bytes += oct->droq[i]->stats.rx_bytes_received;
}
}
/** * octeon_mbox_process_cmd: * @mbox: Pointer mailbox * @mbox_cmd: Pointer to command received * * Process the cmd received in mbox
*/ staticint octeon_mbox_process_cmd(struct octeon_mbox *mbox, struct octeon_mbox_cmd *mbox_cmd)
{ struct octeon_device *oct = mbox->oct_dev;
switch (mbox_cmd->msg.s.cmd) { case OCTEON_VF_ACTIVE:
dev_dbg(&oct->pci_dev->dev, "got vfactive sending data back\n");
mbox_cmd->msg.s.type = OCTEON_MBOX_RESPONSE;
mbox_cmd->msg.s.resp_needed = 1;
mbox_cmd->msg.s.len = 2;
mbox_cmd->data[0] = 0; /* VF version is in mbox_cmd->data[0] */
((struct lio_version *)&mbox_cmd->data[0])->major =
LIQUIDIO_BASE_MAJOR_VERSION;
((struct lio_version *)&mbox_cmd->data[0])->minor =
LIQUIDIO_BASE_MINOR_VERSION;
((struct lio_version *)&mbox_cmd->data[0])->micro =
LIQUIDIO_BASE_MICRO_VERSION;
memcpy(mbox_cmd->msg.s.params, (uint8_t *)&oct->pfvf_hsword, 6); /* Sending core cofig info to the corresponding active VF.*/
octeon_mbox_write(oct, mbox_cmd); break;
case OCTEON_VF_FLR_REQUEST:
dev_info(&oct->pci_dev->dev, "got a request for FLR from VF that owns DPI ring %u\n",
mbox->q_no);
pcie_flr(oct->sriov_info.dpiring_to_vfpcidev_lut[mbox->q_no]); break;
case OCTEON_PF_CHANGED_VF_MACADDR: if (OCTEON_CN23XX_VF(oct))
octeon_pf_changed_vf_macaddr(oct,
mbox_cmd->msg.s.params); break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.