Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Reorganizing all Chelsio 10 gig files into separ...
details: https://anonhg.NetBSD.org/src/rev/a3689dc64fe6
branches: trunk
changeset: 753259:a3689dc64fe6
user: jklos <jklos%NetBSD.org@localhost>
date: Sun Mar 21 21:11:13 2010 +0000
description:
Reorganizing all Chelsio 10 gig files into separate directory.
diffstat:
sys/dev/pci/cxgb/cxgb_adapter.h | 582 ++
sys/dev/pci/cxgb/cxgb_ael1002.c | 333 +
sys/dev/pci/cxgb/cxgb_common.h | 785 +++
sys/dev/pci/cxgb/cxgb_config.h | 37 +
sys/dev/pci/cxgb/cxgb_ctl_defs.h | 158 +
sys/dev/pci/cxgb/cxgb_firmware_exports.h | 175 +
sys/dev/pci/cxgb/cxgb_include.h | 22 +
sys/dev/pci/cxgb/cxgb_ioctl.h | 261 +
sys/dev/pci/cxgb/cxgb_jhash.h | 138 +
sys/dev/pci/cxgb/cxgb_l2t.c | 651 ++
sys/dev/pci/cxgb/cxgb_l2t.h | 157 +
sys/dev/pci/cxgb/cxgb_lro.c | 386 +
sys/dev/pci/cxgb/cxgb_main.c | 1684 ++++++
sys/dev/pci/cxgb/cxgb_mbuf.h | 91 +
sys/dev/pci/cxgb/cxgb_mc5.c | 487 +
sys/dev/pci/cxgb/cxgb_mv88e1xxx.c | 302 +
sys/dev/pci/cxgb/cxgb_mvec.h | 149 +
sys/dev/pci/cxgb/cxgb_offload.c | 1632 ++++++
sys/dev/pci/cxgb/cxgb_offload.h | 259 +
sys/dev/pci/cxgb/cxgb_osdep.c | 207 +
sys/dev/pci/cxgb/cxgb_osdep.h | 427 +
sys/dev/pci/cxgb/cxgb_regs.h | 7639 ++++++++++++++++++++++++++++++
sys/dev/pci/cxgb/cxgb_sge.c | 2661 ++++++++++
sys/dev/pci/cxgb/cxgb_sge_defs.h | 287 +
sys/dev/pci/cxgb/cxgb_t3_cpl.h | 1548 ++++++
sys/dev/pci/cxgb/cxgb_t3_hw.c | 3828 +++++++++++++++
sys/dev/pci/cxgb/cxgb_tcb.h | 672 ++
sys/dev/pci/cxgb/cxgb_toedev.h | 171 +
sys/dev/pci/cxgb/cxgb_version.h | 39 +
sys/dev/pci/cxgb/cxgb_vsc7323.c | 365 +
sys/dev/pci/cxgb/cxgb_vsc8211.c | 252 +
sys/dev/pci/cxgb/cxgb_xgmac.c | 693 ++
sys/dev/pci/files.pci | 28 +-
33 files changed, 27092 insertions(+), 14 deletions(-)
diffs (truncated from 27248 to 300 lines):
diff -r ae0fb754216f -r a3689dc64fe6 sys/dev/pci/cxgb/cxgb_adapter.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/cxgb/cxgb_adapter.h Sun Mar 21 21:11:13 2010 +0000
@@ -0,0 +1,582 @@
+/**************************************************************************
+
+Copyright (c) 2007, Chelsio Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Neither the name of the Chelsio Corporation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+***************************************************************************/
+
+
+
+#ifndef _CXGB_ADAPTER_H_
+#define _CXGB_ADAPTER_H_
+
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/mbuf.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
+
+#include <net/if.h>
+#include <net/if_ether.h>
+#include <net/if_media.h>
+
+#include <machine/bus.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#ifdef CONFIG_DEFINED
+#include <cxgb_osdep.h>
+#include <ulp/toecore/toedev.h>
+#include <sys/mbufq.h>
+#else
+#include "cxgb_osdep.h"
+#include "cxgb_mbuf.h"
+#include "cxgb_toedev.h"
+#endif
+
+struct adapter;
+struct sge_qset;
+extern int cxgb_debug;
+
+#ifdef DEBUG_LOCKING
+#define MTX_INIT(lock, lockname, class, flags) \
+ do { \
+ printf("initializing %s at %s:%d\n", lockname, __FILE__, __LINE__); \
+ mtx_init((lock), lockname, class, flags); \
+ } while (0)
+
+#define MTX_DESTROY(lock) \
+ do { \
+ printf("destroying %s at %s:%d\n", (lock)->lock_object.lo_name, __FILE__, __LINE__); \
+ mtx_destroy((lock)); \
+ } while (0)
+
+#define SX_INIT(lock, lockname) \
+ do { \
+ printf("initializing %s at %s:%d\n", lockname, __FILE__, __LINE__); \
+ sx_init((lock), lockname); \
+ } while (0)
+
+#define SX_DESTROY(lock) \
+ do { \
+ printf("destroying %s at %s:%d\n", (lock)->lock_object.lo_name, __FILE__, __LINE__); \
+ sx_destroy((lock)); \
+ } while (0)
+#else
+#define MTX_INIT mtx_init
+#define MTX_DESTROY mtx_destroy
+#define SX_INIT sx_init
+#define SX_DESTROY sx_destroy
+#endif
+
+struct port_device {
+ struct device original;
+ device_t dev;
+ struct adapter *parent;
+ int port_number;
+};
+
+struct port_info {
+ struct adapter *adapter;
+ struct ifnet *ifp;
+ struct port_device *pd;
+ int port;
+ int if_flags;
+ const struct port_type_info *port_type;
+ struct cphy phy;
+ struct cmac mac;
+ struct link_config link_config;
+ struct ifmedia media;
+#ifdef USE_SX
+ struct sx lock;
+#else
+ struct mtx lock;
+#endif
+ uint8_t port_id;
+ uint8_t tx_chan;
+ uint8_t txpkt_intf;
+ uint8_t nqsets;
+ uint8_t first_qset;
+
+ uint8_t hw_addr[ETHER_ADDR_LEN];
+ struct cxgb_task start_task;
+ struct cxgb_task timer_reclaim_task;
+ struct cdev *port_cdev;
+
+#define PORT_NAME_LEN 32
+#define TASKQ_NAME_LEN 32
+ char lockbuf[PORT_NAME_LEN];
+ char taskqbuf[TASKQ_NAME_LEN];
+};
+
+enum { /* adapter flags */
+ FULL_INIT_DONE = (1 << 0),
+ USING_MSI = (1 << 1),
+ USING_MSIX = (1 << 2),
+ QUEUES_BOUND = (1 << 3),
+ FW_UPTODATE = (1 << 4),
+ TPS_UPTODATE = (1 << 5),
+};
+
+
+#define FL_Q_SIZE 4096
+#define JUMBO_Q_SIZE 512
+#define RSPQ_Q_SIZE 1024
+#define TX_ETH_Q_SIZE 1024
+
+
+
+/*
+ * Types of Tx queues in each queue set. Order here matters, do not change.
+ * XXX TOE is not implemented yet, so the extra queues are just placeholders.
+ */
+enum { TXQ_ETH, TXQ_OFLD, TXQ_CTRL };
+
+
+/* careful, the following are set on priv_flags and must not collide with
+ * IFF_ flags!
+ */
+enum {
+ LRO_ACTIVE = (1 << 8),
+};
+
+/* Max concurrent LRO sessions per queue set */
+#define MAX_LRO_SES 8
+
+struct t3_lro_session {
+ struct mbuf *head;
+ struct mbuf *tail;
+ uint32_t seq;
+ uint16_t ip_len;
+ uint16_t mss;
+ uint16_t vtag;
+ uint8_t npkts;
+};
+
+struct lro_state {
+ unsigned short enabled;
+ unsigned short active_idx;
+ unsigned int nactive;
+ struct t3_lro_session sess[MAX_LRO_SES];
+};
+
+#define RX_BUNDLE_SIZE 8
+
+struct rsp_desc;
+
+struct sge_rspq {
+ uint32_t credits;
+ uint32_t size;
+ uint32_t cidx;
+ uint32_t gen;
+ uint32_t polling;
+ uint32_t holdoff_tmr;
+ uint32_t next_holdoff;
+ uint32_t imm_data;
+ struct rsp_desc *desc;
+ uint32_t cntxt_id;
+ struct mtx lock;
+ struct mbuf *rx_head; /* offload packet receive queue head */
+ struct mbuf *rx_tail; /* offload packet receive queue tail */
+
+ uint32_t offload_pkts;
+ uint32_t offload_bundles;
+ uint32_t pure_rsps;
+ uint32_t unhandled_irqs;
+
+ bus_addr_t phys_addr;
+ bus_dma_tag_t desc_tag;
+ bus_dmamap_t desc_map;
+
+ struct t3_mbuf_hdr rspq_mh;
+#define RSPQ_NAME_LEN 32
+ char lockbuf[RSPQ_NAME_LEN];
+
+};
+
+#ifndef DISABLE_MBUF_IOVEC
+#define rspq_mbuf rspq_mh.mh_head
+#endif
+
+struct rx_desc;
+struct rx_sw_desc;
+
+struct sge_fl {
+ uint32_t buf_size;
+ uint32_t credits;
+ uint32_t size;
+ uint32_t cidx;
+ uint32_t pidx;
+ uint32_t gen;
+ struct rx_desc *desc;
+ struct rx_sw_desc *sdesc;
+ bus_addr_t phys_addr;
+ uint32_t cntxt_id;
+ uint64_t empty;
+ bus_dma_tag_t desc_tag;
+ bus_dmamap_t desc_map;
+ bus_dma_tag_t entry_tag;
+ int type;
+};
+
+struct tx_desc;
+struct tx_sw_desc;
+
+#define TXQ_TRANSMITTING 0x1
+
+struct sge_txq {
+ uint64_t flags;
+ uint32_t in_use;
+ uint32_t size;
+ uint32_t processed;
+ uint32_t cleaned;
+ uint32_t stop_thres;
+ uint32_t cidx;
+ uint32_t pidx;
+ uint32_t gen;
+ uint32_t unacked;
+ struct tx_desc *desc;
+ struct tx_sw_desc *sdesc;
+ uint32_t token;
+ bus_addr_t phys_addr;
+ struct cxgb_task qresume_task;
+ struct cxgb_task qreclaim_task;
+ struct port_info *port;
+ uint32_t cntxt_id;
+ uint64_t stops;
+ uint64_t restarts;
+ bus_dma_tag_t desc_tag;
+ bus_dmamap_t desc_map;
+ bus_dma_tag_t entry_tag;
+ struct mbuf_head sendq;
+ struct mtx lock;
+#define TXQ_NAME_LEN 32
+ char lockbuf[TXQ_NAME_LEN];
+};
+
+
+enum {
+ SGE_PSTAT_TSO, /* # of TSO requests */
+ SGE_PSTAT_RX_CSUM_GOOD, /* # of successful RX csum offloads */
+ SGE_PSTAT_TX_CSUM, /* # of TX checksum offloads */
+ SGE_PSTAT_VLANEX, /* # of VLAN tag extractions */
+ SGE_PSTAT_VLANINS, /* # of VLAN tag insertions */
+ SGE_PSTATS_LRO_QUEUED, /* # of LRO appended packets */
+ SGE_PSTATS_LRO_FLUSHED, /* # of LRO flushed packets */
+ SGE_PSTATS_LRO_X_STREAMS, /* # of exceeded LRO contexts */
+};
+
+#define SGE_PSTAT_MAX (SGE_PSTATS_LRO_X_STREAMS+1)
+
+struct sge_qset {
+ struct sge_rspq rspq;
+ struct sge_fl fl[SGE_RXQ_PER_SET];
Home |
Main Index |
Thread Index |
Old Index