/** The dispatch list entry. *Thedriverkeepsarecordoffunctionsregisteredforeach *responseheaderopcodeinthisstructure.Sincetheopcodeis *hashedtoindexintothedriver'slist,morethanoneopcode *canhashtothesameentry,inwhichcasethelistfieldpoints *toalinkedlistwiththeotherentries.
*/ struct octeon_dispatch { /** List head for this entry */ struct list_head list;
/** The opcode for which the dispatch function & arg should be used */
u16 opcode;
/** The function to be called for a packet received by the driver */
octeon_dispatch_fn_t dispatch_fn;
/* The application specified argument to be passed to the above *functionalongwiththereceivedpacket
*/ void *arg;
};
/** The dispatch list structure. */ struct octeon_dispatch_list { /** access to dispatch list must be atomic */
spinlock_t lock;
/** Count of dispatch functions currently registered */
u32 count;
/** The list of dispatch functions */ struct octeon_dispatch *dlist;
};
/*----------------------- THE OCTEON DEVICE ---------------------------*/
#define OCT_MEM_REGIONS 3 /** PCI address space mapping information. *Eachofthe3addressspacesgivenbyBAR0,BAR2andBAR4of *Octeongetsmappedtodifferentphysicaladdressspacesin *thekernel.
*/ struct octeon_mmio { /** PCI address to which the BAR is mapped. */
u64 start;
/** Length of this PCI address space. */
u32 len;
/** Length that has been mapped to phys. address space. */
u32 mapped_len;
/** The physical address to which the PCI address space is mapped. */
u8 __iomem *hw_addr;
/** Flag indicating the mapping was successful. */
u32 done;
};
int (*enable_io_queues)(struct octeon_device *); void (*disable_io_queues)(struct octeon_device *);
};
/* Must be multiple of 8, changing breaks ABI */ #define CVMX_BOOTMEM_NAME_LEN 128
/* Structure for named memory blocks *Numberofdescriptors *availablecanbechangedwithoutaffectingcompatibility, *butnamelengthchangesrequireabumpinthebootmem *descriptorversion *Note:Thisstructuremustbenaturally64bitaligned,asasingle *memoryimagewillbeusedbyboth32and64bitprograms.
*/ struct cvmx_bootmem_named_block_desc { /** Base address of named block */
u64 base_addr;
/** Size actually allocated for named block */
u64 size;
/** name of named block */ char name[CVMX_BOOTMEM_NAME_LEN];
};
struct oct_fw_info {
u32 max_nic_ports; /** max nic ports for the device */
u32 num_gmx_ports; /** num gmx ports */
u64 app_cap_flags; /** firmware cap flags */
/** The core application is running in this mode. *Seeocteon-drv-opcodes.hforvalues.
*/
u32 app_mode; char liquidio_firmware_version[32]; /* Fields extracted from legacy string 'liquidio_firmware_version' */ struct {
u8 maj;
u8 min;
u8 rev;
} ver;
};
struct octdev_props { /* Each interface in the Octeon device has a network *devicepointer(usedforOSspecificcalls).
*/ int rx_on; int fec; int fec_boot; int napi_enabled; int gmxport; struct net_device *netdev;
};
/** PKIND value assigned for the DPI interface */
u64 pkind : 8; #endif
};
struct octeon_sriov_info { /* Number of rings assigned to VF */
u32 rings_per_vf;
/** Max Number of VF devices that can be enabled. This variable can *specifiedduringloadtimeoritwillbederivedafterallocating *PFqueues.Whenmax_vfsisderivedtheneachVFwillgetonequeue
**/
u32 max_vfs;
/** Number of VF devices enabled using sysfs. */
u32 num_vfs_alloced;
/* Actual rings left for PF device */
u32 num_pf_rings;
/* SRN of PF usable IO queues */
u32 pf_srn;
/* total pf rings */
u32 trs;
u32 sriov_enabled;
struct lio_trusted_vf trusted_vf;
/*lookup table that maps DPI ring number to VF pci_dev struct pointer*/ struct pci_dev *dpiring_to_vfpcidev_lut[MAX_POSSIBLE_VFS];
u64 vf_macaddr[MAX_POSSIBLE_VFS];
u16 vf_vlantci[MAX_POSSIBLE_VFS];
int vf_linkstate[MAX_POSSIBLE_VFS];
bool vf_spoofchk[MAX_POSSIBLE_VFS];
u64 vf_drv_loaded_mask;
};
struct octeon_ioq_vector { struct octeon_device *oct_dev; int iq_index; int droq_index; int vector; struct octeon_mbox *mbox; struct cpumask affinity_mask;
u32 ioq_num;
};
struct lio_vf_rep_list { int num_vfs; struct net_device *ndev[CN23XX_MAX_VFS_PER_PF];
};
/*------------------ Function Prototypes ----------------------*/
/** Initialize device list memory */ void octeon_init_device_list(int conf_type);
/** Free memory for Input and Output queue structures for a octeon device */ void octeon_free_device_mem(struct octeon_device *oct);
/* Look up a free entry in the octeon_device table and allocate resources *fortheocteon_devicestructureforanocteondevice.Calledatinit *time.
*/ struct octeon_device *octeon_allocate_device(u32 pci_id,
u32 priv_size);
/** Register a device's bus location at initialization time. *@paramocteon_dev-pointertotheocteondevicestructure. *@parambus-PCIebus# *@paramdev-PCIedevice# *@paramfunc-PCIefunction# *@paramis_pf-TRUEforPF,FALSEforVF *@returnreferencecountofdevice'sadapter
*/ int octeon_register_device(struct octeon_device *oct, int bus, int dev, int func, int is_pf);
/** Deregister a device at de-initialization time. *@paramocteon_dev-pointertotheocteondevicestructure. *@returnreferencecountofdevice'sadapter
*/ int octeon_deregister_device(struct octeon_device *oct);
/** Initialize the driver's dispatch list which is a mix of a hash table *andalinkedlist.Thisisdoneatdriverloadtime. *@paramocteon_dev-pointertotheocteondevicestructure. *@return0onsuccess,else-veerrorvalue
*/ int octeon_init_dispatch_list(struct octeon_device *octeon_dev);
/** Delete the driver's dispatch list and all registered entries. *Thisisdoneatdriverunloadtime. *@paramocteon_dev-pointertotheocteondevicestructure.
*/ void octeon_delete_dispatch_list(struct octeon_device *octeon_dev);
/** Initialize the core device fields with the info returned by the FW. *@paramrecv_info-Receiveinfostructure *@parambuf-Receivebuffer
*/ int octeon_core_drv_init(struct octeon_recv_info *recv_info, void *buf);
/** Gets the dispatch function registered to receive packets with a *givenopcode/subcode. *@paramocteon_dev-theocteondevicepointer. *@paramopcode-theopcodeforwhichthedispatchfunction *istochecked. *@paramsubcode-thesubcodeforwhichthedispatchfunction *istochecked. * *@returnSuccess:octeon_dispatch_fn_t(dispatchfunctionpointer) *@returnFailure:NULL * *Looksupthedispatchlisttogetthedispatchfunctionfora *givenopcode.
*/
octeon_dispatch_fn_t
octeon_get_dispatch(struct octeon_device *octeon_dev, u16 opcode,
u16 subcode);
/** Get the octeon device pointer. *@paramocteon_id-Theidforwhichtheocteondevicepointerisrequired. *@returnSuccess:Octeondevicepointer. *@returnFailure:NULL.
*/ struct octeon_device *lio_get_device(u32 octeon_id);
/** Parses, validates, and downloads firmware, then boots associated cores. *@paramoctwhichocteontodownloadfirmwareto *@paramdata-Thecompletefirmwarefileimage *@paramsize-Thesizeofthedata * *@return0ifsuccess. *-EINVALiffileisincompatibleorbadlyformatted. *-ENODEVifnohandlerwasfoundfortheapplicationtypeoran *invalidocteonidwaspassed.
*/ int octeon_download_firmware(struct octeon_device *oct, const u8 *data,
size_t size);
char *lio_get_state_string(atomic_t *state_ptr);
/** Sets up instruction queues for the device *@paramoctwhichocteontosetup * *@return0ifsuccess.1iffails
*/ int octeon_setup_instr_queues(struct octeon_device *oct);
/** Sets up output queues for the device *@paramoctwhichocteontosetup * *@return0ifsuccess.1iffails
*/ int octeon_setup_output_queues(struct octeon_device *oct);
int octeon_get_tx_qsize(struct octeon_device *oct, u32 q_no);
int octeon_get_rx_qsize(struct octeon_device *oct, u32 q_no);
/** Turns off the input and output queues for the device *@paramoctwhichocteontodisable
*/ int octeon_set_io_queues_off(struct octeon_device *oct);
/** Turns on or off the given output queue for the device *@paramoctwhichocteontochange *@paramq_nowhichqueue *@paramenable1toenable,0todisable
*/ void octeon_set_droq_pkt_op(struct octeon_device *oct, u32 q_no, u32 enable);
/** Retrieve the config for the device *@paramoctwhichocteon *@paramcard_typetypeofcard * *@returnspointertoconfiguration
*/ void *oct_get_config_info(struct octeon_device *oct, u16 card_type);
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.