/** Information about packet DMA'ed by Octeon. *TheformatoftheinformationavailableatInfoPointerafterOcteon *haspostedapacket.Notalldescriptorshavevalidinformation.Only *theInfofieldofthefirstdescriptorforapackethasinformation *aboutthepacket.
*/ struct octeon_droq_info { /** The Length of the packet. */
u64 length;
/** The Output Receive Header. */ union octeon_rh rh;
};
/** Output Queue statistics. Each output queue has four stats fields. */ struct oct_droq_stats { /** Number of packets received in this queue. */
u64 pkts_received;
/** Bytes received by this queue. */
u64 bytes_received;
/** Packets dropped due to no dispatch function. */
u64 dropped_nodispatch;
/** Packets dropped due to no memory available. */
u64 dropped_nomem;
/** Packets dropped due to large number of pkts to process. */
u64 dropped_toomany;
/** Number of packets sent to stack from this queue. */
u64 rx_pkts_received;
/** Number of Bytes sent to stack from this queue. */
u64 rx_bytes_received;
/** Num of Packets dropped due to receive path failures. */
u64 rx_dropped;
u64 rx_vxlan;
/** Num of failures of recv_buffer_alloc() */
u64 rx_alloc_failure;
};
/* The maximum number of buffers that can be dispatched from the *output/dmaqueue.Setto64assuming1KbuffersinDROQandthefactthat *maxpacketsizefromDROQis64K.
*/ #define MAX_RECV_BUFS 64
/** Receive Packet format used when dispatching output queue packets *withnon-rawopcodes. *Thereceivedpacketwillbesenttotheupperlayersusingthis *structurewhichispassedasaparametertothedispatchfunction
*/ struct octeon_recv_pkt { /** Number of buffers in this received packet */
u16 buffer_count;
/** Id of the device that is sending the packet up */
u16 octeon_id;
/** Length of data in the packet buffer */
u32 length;
/** The receive header */ union octeon_rh rh;
/** Pointer to the OS-specific packet buffer */ void *buffer_ptr[MAX_RECV_BUFS];
/** Size of the buffers pointed to by ptr's in buffer_ptr */
u32 buffer_size[MAX_RECV_BUFS];
};
/** Used by NIC module to register packet handler and to get device *informationforeachocteondevice.
*/ struct octeon_droq_ops { /** This registered function will be called by the driver with *theocteonid,pointertobufferfromdroqandlengthof *datainthebuffer.Thereceiveheadergivestheport *numbertothecaller.Functionpointerissetbycaller.
*/ void (*fptr)(u32, void *, u32, union octeon_rh *, void *, void *); void *farg;
/* This function will be called by the driver for all NAPI related *events.Thefirstparamistheocteonid.Thesecondparamisthe *outputqueuenumber.ThethirdistheNAPIeventthatoccurred.
*/ void (*napi_fn)(void *);
u32 poll_mode;
/** Flag indicating if the DROQ handler should drop packets that *itcannothandleinoneiteration.Setbycaller.
*/
u32 drop_on_max;
};
/** The Descriptor Ring Output Queue structure. *Thisstructurehasalltheinformationrequiredtoimplementa *OcteonDROQ.
*/ struct octeon_droq {
u32 q_no;
u32 pkt_count;
struct octeon_droq_ops ops;
struct octeon_device *oct_dev;
/** The 8B aligned descriptor ring starts at this address. */ struct octeon_droq_desc *desc_ring;
/** Index in the ring where the driver should read the next packet */
u32 read_idx;
/** Index in the ring where Octeon will write the next packet */
u32 write_idx;
/** Index in the ring where the driver will refill the descriptor's *buffer
*/
u32 refill_idx;
/** Packets pending to be processed */
atomic_t pkts_pending;
/** Number of descriptors in this ring. */
u32 max_count;
/** The number of descriptors pending refill. */
u32 refill_count;
u32 pkts_per_intr;
u32 refill_threshold;
/** The max number of descriptors in DROQ without a buffer. *Thisfieldisusedtokeeptrackofemptyspacethreshold.Ifthe *refill_countreachesthisvalue,theDROQcannotacceptamax-sized *(64K)packet.
*/
u32 max_empty_descs;
/** The receive buffer list. This list has the virtual addresses of the *buffers.
*/ struct octeon_recv_buffer *recv_buf_list;
/** The size of each buffer pointed by the buffer pointer. */
u32 buffer_size;
/** Pointer to the mapped packet credit register. *Hostwritesnumberofinfo/bufferptrsavailabletothisregister
*/ void __iomem *pkts_credit_reg;
/** Pointer to the mapped packet sent register. *OcteonwritesthenumberofpacketsDMA'edtohostmemory *inthisregister.
*/ void __iomem *pkts_sent_reg;
struct list_head dispatch_list;
/** Statistics for this DROQ. */ struct oct_droq_stats stats;
/** DMA mapped address of the DROQ descriptor ring. */
size_t desc_ring_dma;
/** Register a change in droq operations. The ops field has a pointer to a *functionwhichwillcalledbytheDROQhandlerforallpacketsarriving *onoutputqueuesgivenbyq_noirrespectiveofthetypeofpacket. *TheopsfieldalsohasaflagwhichifsettellstheDROQhandlerto *droppacketsifitreceivesmorethanwhatitcanprocessinone *invocationofthehandler. *@paramoct-octeondevice *@paramq_no-octeonoutputqueuenumber(0<=q_no<=MAX_OCTEON_DROQ-1 *@paramops-thedroq_opssettingsforthisqueue *@return-0onsuccess,-ENODEVor-EINVALonerror.
*/ int
octeon_register_droq_ops(struct octeon_device *oct,
u32 q_no, struct octeon_droq_ops *ops);
/** Resets the function pointer and flag settings made by *octeon_register_droq_ops().Afterthisroutineiscalled,theDROQhandler *willlookupdispatchfunctionforeacharrivingpacketontheoutputqueue *givenbyq_no. *@paramoct-octeondevice *@paramq_no-octeonoutputqueuenumber(0<=q_no<=MAX_OCTEON_DROQ-1 *@return-0onsuccess,-ENODEVor-EINVALonerror.
*/ int octeon_unregister_droq_ops(struct octeon_device *oct, u32 q_no);
/** Register a dispatch function for a opcode/subcode. The driver will call *thisdispatchfunctionwhenitreceivesapacketwiththegiven *opcode/subcodeinitsoutputqueuesalongwiththeuserspecified *argument. *@paramoct-theocteondevicetoregisterwith. *@paramopcode-theopcodeforwhichthedispatchwillberegistered. *@paramsubcode-thesubcodeforwhichthedispatchwillberegistered *@paramfn-thedispatchfunction. *@paramfn_arg-userspecifiedthatwillbepassedalongwiththe *dispatchfunctionbythedriver. *@returnSuccess:0;Failure:1
*/ int octeon_register_dispatch_fn(struct octeon_device *oct,
u16 opcode,
u16 subcode,
octeon_dispatch_fn_t fn, void *fn_arg);
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.