/********************************************************************** * 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.
**********************************************************************/
/*! \file octeon_network.h * \brief Host NIC Driver: Structure and Macro definitions used by NIC Module.
*/
#define LIO_IFCFG_WAIT_TIME 3000 /* In milli seconds */ #define LIQUIDIO_NDEV_STATS_POLL_TIME_MS 200
/* Structure of a node in list of gather components maintained by * NIC driver for each network device.
*/ struct octnic_gather { /* List manipulation. Next and prev pointers. */ struct list_head list;
/* Size of the gather component at sg in bytes. */ int sg_size;
/* Number of bytes that sg was adjusted to make it 8B-aligned. */ int adjust;
/* Gather component that can accommodate max sized fragment list * received from the IP layer.
*/ struct octeon_sg_entry *sg;
/** LiquidIO per-interface network private data */ struct lio { /** State of the interface. Rx/Tx happens only in the RUNNING state. */
atomic_t ifstate;
/** Octeon Interface index number. This device will be represented as * oct<ifidx> in the system.
*/ int ifidx;
/** Octeon Input queue to use to transmit for this network interface. */ int txq;
/** Octeon Output queue from which pkts arrive * for this network interface.
*/ int rxq;
/** * \brief Link control command completion callback * @param nctrl_ptr pointer to control packet structure * * This routine is called by the callback function when a ctrl pkt sent to * core app completes. The nctrl_ptr contains a copy of the command type * and data sent to the core app. This routine is only called if the ctrl * pkt was sent successfully to the core app.
*/ void liquidio_link_ctrl_cmd_completion(void *nctrl_ptr);
int liquidio_setup_io_queues(struct octeon_device *octeon_dev, int ifidx,
u32 num_iqs, u32 num_oqs);
int lio_setup_glists(struct octeon_device *oct, struct lio *lio, int num_qs);
int liquidio_get_speed(struct lio *lio); int liquidio_set_speed(struct lio *lio, int speed); int liquidio_get_fec(struct lio *lio); int liquidio_set_fec(struct lio *lio, int on_off);
/** * \brief Net device change_mtu * @param netdev network device
*/ int liquidio_change_mtu(struct net_device *netdev, int new_mtu); #define LIO_CHANGE_MTU_SUCCESS 1 #define LIO_CHANGE_MTU_FAIL 2
/* Flip to other half of the buffer */ if (pg_info->page_offset == 0)
pg_info->page_offset = LIO_RXBUFFER_SZ; else
pg_info->page_offset = 0;
page_ref_inc(pg_info->page);
/* Get DMA info */
dma_addr = pg_info->dma; if (!pg_info->dma) {
pr_err("%s: ERROR it should be already available\n",
__func__);
WARN_ON(1);
}
dma_addr += pg_info->page_offset;
staticinlinevoid octeon_fast_packet_next(struct octeon_droq *droq, struct sk_buff *nicbuf, int copy_len, int idx)
{
skb_put_data(nicbuf, get_rbd(droq->recv_buf_list[idx].buffer),
copy_len);
}
/** * \brief check interface state * @param lio per-network private data * @param state_flag flag state to check
*/ staticinlineint ifstate_check(struct lio *lio, int state_flag)
{ return atomic_read(&lio->ifstate) & state_flag;
}
/** * \brief set interface state * @param lio per-network private data * @param state_flag flag state to set
*/ staticinlinevoid ifstate_set(struct lio *lio, int state_flag)
{
atomic_set(&lio->ifstate, (atomic_read(&lio->ifstate) | state_flag));
}
/** * \brief clear interface state * @param lio per-network private data * @param state_flag flag state to clear
*/ staticinlinevoid ifstate_reset(struct lio *lio, int state_flag)
{
atomic_set(&lio->ifstate, (atomic_read(&lio->ifstate) & ~(state_flag)));
}
/** * \brief wait for all pending requests to complete * @param oct Pointer to Octeon device * * Called during shutdown sequence
*/ staticinlineint wait_for_pending_requests(struct octeon_device *oct)
{ int i, pcount = 0;
for (i = 0; i < MAX_IO_PENDING_PKT_COUNT; i++) {
pcount = atomic_read(
&oct->response_list[OCTEON_ORDERED_SC_LIST]
.pending_req_count); if (pcount)
schedule_timeout_uninterruptible(HZ / 10); else break;
}
/** * Remove the node at the head of the list. The list would be empty at * the end of this call if there are no more nodes in the list.
*/ staticinlinestruct list_head *lio_list_delete_head(struct list_head *root)
{ struct list_head *node;
if (list_empty_careful(root))
node = NULL; else
node = root->next;
if (node)
list_del(node);
return node;
}
#endif
Messung V0.5
¤ Dauer der Verarbeitung: 0.17 Sekunden
(vorverarbeitet)
¤
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.