Print this page
MFV: illumos-gate@bbb9d5d65bf8372aae4b8821c80e218b8b832846
9994 cxgbe t4nex: Handle get_fl_payload() alloc failures
9995 cxgbe t4_devo_attach() should initialize ->sfl
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: John Levon <john.levon@joyent.com>
9484 cxgbe should clean TX descriptors in timely manner
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Ryan Zezeski <rpz@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>


 263         kmutex_t lock;
 264         ddi_dma_handle_t dhdl;
 265         ddi_acc_handle_t ahdl;
 266 
 267         __be64 *desc;           /* KVA of descriptor ring, ptr to addresses */
 268         uint64_t ba;            /* bus address of descriptor ring */
 269         struct fl_sdesc *sdesc; /* KVA of software descriptor ring */
 270         uint32_t cap;           /* max # of buffers, for convenience */
 271         uint16_t qsize;         /* size (# of entries) of the queue */
 272         uint16_t cntxt_id;      /* SGE context id for the freelist */
 273         uint32_t cidx;          /* consumer idx (buffer idx, NOT hw desc idx) */
 274         uint32_t pidx;          /* producer idx (buffer idx, NOT hw desc idx) */
 275         uint32_t needed;        /* # of buffers needed to fill up fl. */
 276         uint32_t lowat;         /* # of buffers <= this means fl needs help */
 277         uint32_t pending;       /* # of bufs allocated since last doorbell */
 278         uint32_t offset;        /* current packet within the larger buffer */
 279         uint16_t copy_threshold; /* anything this size or less is copied up */
 280 
 281         uint64_t copied_up;     /* # of frames copied into mblk and handed up */
 282         uint64_t passed_up;     /* # of frames wrapped in mblk and handed up */

 283 
 284         TAILQ_ENTRY(sge_fl) link; /* All starving freelists */
 285 };
 286 
 287 /* txq: SGE egress queue + miscellaneous items */
 288 struct sge_txq {
 289         struct sge_eq eq;       /* MUST be first */
 290 
 291         struct port_info *port; /* the port this txq belongs to */
 292         struct tx_sdesc *sdesc; /* KVA of software descriptor ring */
 293         mac_ring_handle_t ring_handle;
 294 
 295         /* DMA handles used for tx */
 296         ddi_dma_handle_t *tx_dhdl;
 297         uint32_t tx_dhdl_total; /* Total # of handles */
 298         uint32_t tx_dhdl_pidx;  /* next handle to be used */
 299         uint32_t tx_dhdl_cidx;  /* reclaimed up to this index */
 300         uint32_t tx_dhdl_avail; /* # of available handles */
 301 
 302         /* Copy buffers for tx */


 490         ddi_acc_handle_t regh;
 491         caddr_t regp;
 492         /* BAR1 register access handle */
 493         ddi_acc_handle_t reg1h;
 494         caddr_t reg1p;
 495 
 496         /* Interrupt information */
 497         int intr_type;
 498         int intr_count;
 499         int intr_cap;
 500         uint_t intr_pri;
 501         ddi_intr_handle_t *intr_handle;
 502 
 503         struct driver_properties props;
 504         kstat_t *ksp;
 505         kstat_t *ksp_stat;
 506 
 507         struct sge sge;
 508 
 509         struct port_info *port[MAX_NPORTS];

 510         uint8_t chan_map[NCHAN];
 511         uint32_t filter_mode;
 512 
 513         struct l2t_data *l2t;   /* L2 table */
 514         struct tid_info tids;
 515 
 516         int doorbells;
 517         int registered_device_map;
 518         int open_device_map;
 519         int flags;
 520 
 521         unsigned int cfcsum;
 522         struct adapter_params params;
 523         struct t4_virt_res vres;
 524 
 525 #ifdef TCP_OFFLOAD_ENABLE
 526         struct uld_softc tom;
 527         struct tom_tunables tt;
 528 #endif
 529 




 263         kmutex_t lock;
 264         ddi_dma_handle_t dhdl;
 265         ddi_acc_handle_t ahdl;
 266 
 267         __be64 *desc;           /* KVA of descriptor ring, ptr to addresses */
 268         uint64_t ba;            /* bus address of descriptor ring */
 269         struct fl_sdesc *sdesc; /* KVA of software descriptor ring */
 270         uint32_t cap;           /* max # of buffers, for convenience */
 271         uint16_t qsize;         /* size (# of entries) of the queue */
 272         uint16_t cntxt_id;      /* SGE context id for the freelist */
 273         uint32_t cidx;          /* consumer idx (buffer idx, NOT hw desc idx) */
 274         uint32_t pidx;          /* producer idx (buffer idx, NOT hw desc idx) */
 275         uint32_t needed;        /* # of buffers needed to fill up fl. */
 276         uint32_t lowat;         /* # of buffers <= this means fl needs help */
 277         uint32_t pending;       /* # of bufs allocated since last doorbell */
 278         uint32_t offset;        /* current packet within the larger buffer */
 279         uint16_t copy_threshold; /* anything this size or less is copied up */
 280 
 281         uint64_t copied_up;     /* # of frames copied into mblk and handed up */
 282         uint64_t passed_up;     /* # of frames wrapped in mblk and handed up */
 283         uint64_t allocb_fail;   /* # of mblk allocation failures */
 284 
 285         TAILQ_ENTRY(sge_fl) link; /* All starving freelists */
 286 };
 287 
 288 /* txq: SGE egress queue + miscellaneous items */
 289 struct sge_txq {
 290         struct sge_eq eq;       /* MUST be first */
 291 
 292         struct port_info *port; /* the port this txq belongs to */
 293         struct tx_sdesc *sdesc; /* KVA of software descriptor ring */
 294         mac_ring_handle_t ring_handle;
 295 
 296         /* DMA handles used for tx */
 297         ddi_dma_handle_t *tx_dhdl;
 298         uint32_t tx_dhdl_total; /* Total # of handles */
 299         uint32_t tx_dhdl_pidx;  /* next handle to be used */
 300         uint32_t tx_dhdl_cidx;  /* reclaimed up to this index */
 301         uint32_t tx_dhdl_avail; /* # of available handles */
 302 
 303         /* Copy buffers for tx */


 491         ddi_acc_handle_t regh;
 492         caddr_t regp;
 493         /* BAR1 register access handle */
 494         ddi_acc_handle_t reg1h;
 495         caddr_t reg1p;
 496 
 497         /* Interrupt information */
 498         int intr_type;
 499         int intr_count;
 500         int intr_cap;
 501         uint_t intr_pri;
 502         ddi_intr_handle_t *intr_handle;
 503 
 504         struct driver_properties props;
 505         kstat_t *ksp;
 506         kstat_t *ksp_stat;
 507 
 508         struct sge sge;
 509 
 510         struct port_info *port[MAX_NPORTS];
 511         ddi_taskq_t *tq[NCHAN];
 512         uint8_t chan_map[NCHAN];
 513         uint32_t filter_mode;
 514 
 515         struct l2t_data *l2t;   /* L2 table */
 516         struct tid_info tids;
 517 
 518         int doorbells;
 519         int registered_device_map;
 520         int open_device_map;
 521         int flags;
 522 
 523         unsigned int cfcsum;
 524         struct adapter_params params;
 525         struct t4_virt_res vres;
 526 
 527 #ifdef TCP_OFFLOAD_ENABLE
 528         struct uld_softc tom;
 529         struct tom_tunables tt;
 530 #endif
 531