summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-05-19 22:55:37 +0000
committerattilio <attilio@FreeBSD.org>2011-05-19 22:55:37 +0000
commit0372174d48f975382712625e72bc9b47e95be3ce (patch)
tree9ebe7c8a9563c1461d853d41f0017dc6c2cc81bd /sys
parentf8e98f8a14bc1430bfe19cc9d343cfb4c36c2c01 (diff)
parent6f33a79b0ac84a9dfb7c6ce665bde3cb866abefc (diff)
downloadFreeBSD-src-0372174d48f975382712625e72bc9b47e95be3ce.zip
FreeBSD-src-0372174d48f975382712625e72bc9b47e95be3ce.tar.gz
MFC
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/cxgbe/t4_main.c44
-rw-r--r--sys/dev/cxgbe/t4_sge.c24
-rw-r--r--sys/dev/puc/pucdata.c6
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c20
-rw-r--r--sys/kern/kern_conf.c3
-rw-r--r--sys/netinet/sctp_output.c2
-rw-r--r--sys/nfsclient/nfs_vfsops.c4
-rw-r--r--sys/sys/proc.h28
8 files changed, 66 insertions, 65 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index e336566..469af8d 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -366,7 +366,13 @@ t4_attach(device_t dev)
sc->mbox = sc->pf;
pci_enable_busmaster(dev);
- pci_set_max_read_req(dev, 4096);
+ if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) {
+ pci_set_max_read_req(dev, 4096);
+ v = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2);
+ v |= PCIM_EXP_CTL_RELAXED_ORD_ENABLE;
+ pci_write_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, v, 2);
+ }
+
snprintf(sc->lockname, sizeof(sc->lockname), "%s",
device_get_nameunit(dev));
mtx_init(&sc->sc_lock, sc->lockname, 0, MTX_DEF);
@@ -3209,41 +3215,9 @@ filter_rpl(struct adapter *sc, const struct cpl_set_tcb_rpl *rpl)
int
t4_os_find_pci_capability(struct adapter *sc, int cap)
{
- device_t dev;
- struct pci_devinfo *dinfo;
- pcicfgregs *cfg;
- uint32_t status;
- uint8_t ptr;
-
- dev = sc->dev;
- dinfo = device_get_ivars(dev);
- cfg = &dinfo->cfg;
-
- status = pci_read_config(dev, PCIR_STATUS, 2);
- if (!(status & PCIM_STATUS_CAPPRESENT))
- return (0);
-
- switch (cfg->hdrtype & PCIM_HDRTYPE) {
- case 0:
- case 1:
- ptr = PCIR_CAP_PTR;
- break;
- case 2:
- ptr = PCIR_CAP_PTR_2;
- break;
- default:
- return (0);
- break;
- }
- ptr = pci_read_config(dev, ptr, 1);
-
- while (ptr != 0) {
- if (pci_read_config(dev, ptr + PCICAP_ID, 1) == cap)
- return (ptr);
- ptr = pci_read_config(dev, ptr + PCICAP_NEXTPTR, 1);
- }
+ int i;
- return (0);
+ return (pci_find_cap(sc->dev, cap, &i) == 0 ? i : 0);
}
int
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index 5f59db6..a0ef172 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -100,7 +100,7 @@ static int alloc_ring(struct adapter *, size_t, bus_dma_tag_t *, bus_dmamap_t *,
static int free_ring(struct adapter *, bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
void *);
static int alloc_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *,
- int);
+ int, int);
static int free_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *);
static int alloc_iq(struct sge_iq *, int);
static int free_iq(struct sge_iq *);
@@ -1104,7 +1104,7 @@ free_ring(struct adapter *sc, bus_dma_tag_t tag, bus_dmamap_t map,
*/
static int
alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
- int intr_idx)
+ int intr_idx, int cong)
{
int rc, i, cntxt_id;
size_t len;
@@ -1155,6 +1155,8 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
V_FW_IQ_CMD_IQESIZE(ilog2(iq->esize) - 4));
c.iqsize = htobe16(iq->qsize);
c.iqaddr = htobe64(iq->ba);
+ if (cong >= 0)
+ c.iqns_to_fl0congen = htobe32(F_FW_IQ_CMD_IQFLINTCONGEN);
if (fl) {
mtx_init(&fl->fl_lock, fl->lockname, NULL, MTX_DEF);
@@ -1198,7 +1200,15 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
fl->needed = fl->cap;
c.iqns_to_fl0congen =
- htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE));
+ htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) |
+ F_FW_IQ_CMD_FL0FETCHRO | F_FW_IQ_CMD_FL0DATARO |
+ F_FW_IQ_CMD_FL0PADEN);
+ if (cong >= 0) {
+ c.iqns_to_fl0congen |=
+ htobe32(V_FW_IQ_CMD_FL0CNGCHMAP(cong) |
+ F_FW_IQ_CMD_FL0CONGCIF |
+ F_FW_IQ_CMD_FL0CONGEN);
+ }
c.fl0dcaen_to_fl0cidxfthresh =
htobe16(V_FW_IQ_CMD_FL0FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_IQ_CMD_FL0FBMAX(X_FETCHBURSTMAX_512B));
@@ -1325,7 +1335,7 @@ free_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl)
static int
alloc_iq(struct sge_iq *iq, int intr_idx)
{
- return alloc_iq_fl(NULL, iq, NULL, intr_idx);
+ return alloc_iq_fl(NULL, iq, NULL, intr_idx, -1);
}
static int
@@ -1342,7 +1352,7 @@ alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx)
struct sysctl_oid_list *children;
char name[16];
- rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx);
+ rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx, 1 << pi->tx_chan);
if (rc != 0)
return (rc);
@@ -1436,7 +1446,7 @@ alloc_ctrlq(struct adapter *sc, struct sge_ctrlq *ctrlq, int idx)
c.physeqid_pkd = htobe32(0);
c.fetchszm_to_iqid =
htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
- V_FW_EQ_CTRL_CMD_PCIECHN(idx) |
+ V_FW_EQ_CTRL_CMD_PCIECHN(idx) | F_FW_EQ_CTRL_CMD_FETCHRO |
V_FW_EQ_CTRL_CMD_IQID(eq->iqid));
c.dcaen_to_eqsize =
htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
@@ -1561,7 +1571,7 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx)
c.viid_pkd = htobe32(V_FW_EQ_ETH_CMD_VIID(pi->viid));
c.fetchszm_to_iqid =
htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
- V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) |
+ V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO |
V_FW_EQ_ETH_CMD_IQID(eq->iqid));
c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c
index 6b1deda..83b02ea 100644
--- a/sys/dev/puc/pucdata.c
+++ b/sys/dev/puc/pucdata.c
@@ -656,6 +656,12 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_4S, 0x10, 0, 8,
},
+ { 0x1415, 0x950a, 0x131f, 0x2030,
+ "SIIG Cyber 2S PCIe",
+ DEFAULT_RCLK * 10,
+ PUC_PORT_2S, 0x10, 0, 8,
+ },
+
{ 0x1415, 0x950a, 0xffff, 0,
"Oxford Semiconductor OX16PCI954 UARTs",
DEFAULT_RCLK,
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index b062d2c..8dc5b0b 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -1079,15 +1079,21 @@ nfs_mount(struct mount *mp)
dirpath[0] = '\0';
dirlen = strlen(dirpath);
- if (has_nfs_args_opt == 0 && vfs_getopt(mp->mnt_optnew, "addr",
- (void **)&args.addr, &args.addrlen) == 0) {
- if (args.addrlen > SOCK_MAXADDRLEN) {
- error = ENAMETOOLONG;
+ if (has_nfs_args_opt == 0) {
+ if (vfs_getopt(mp->mnt_optnew, "addr",
+ (void **)&args.addr, &args.addrlen) == 0) {
+ if (args.addrlen > SOCK_MAXADDRLEN) {
+ error = ENAMETOOLONG;
+ goto out;
+ }
+ nam = malloc(args.addrlen, M_SONAME, M_WAITOK);
+ bcopy(args.addr, nam, args.addrlen);
+ nam->sa_len = args.addrlen;
+ } else {
+ vfs_mount_error(mp, "No server address");
+ error = EINVAL;
goto out;
}
- nam = malloc(args.addrlen, M_SONAME, M_WAITOK);
- bcopy(args.addr, nam, args.addrlen);
- nam->sa_len = args.addrlen;
}
args.fh = nfh;
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index b2be5cc..59b876c 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -981,6 +981,8 @@ destroy_devl(struct cdev *dev)
/* Remove name marking */
dev->si_flags &= ~SI_NAMED;
+ dev->si_refcount++; /* Avoid race with dev_rel() */
+
/* If we are a child, remove us from the parents list */
if (dev->si_flags & SI_CHILD) {
LIST_REMOVE(dev, si_siblings);
@@ -997,7 +999,6 @@ destroy_devl(struct cdev *dev)
dev->si_flags &= ~SI_CLONELIST;
}
- dev->si_refcount++; /* Avoid race with dev_rel() */
csw = dev->si_devsw;
dev->si_devsw = NULL; /* already NULL for SI_ALIAS */
while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) {
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index aea43b2..a7d22bd 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -3129,8 +3129,8 @@ plan_d:
}
#endif
out:
- if (sifa) {
#ifdef INET
+ if (sifa) {
if (retried == 1) {
LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) {
if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) {
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 04fd375..79659d0 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -1149,6 +1149,10 @@ nfs_mount(struct mount *mp)
goto out;
}
}
+ } else if (has_addr_opt == 0) {
+ vfs_mount_error(mp, "No server address");
+ error = EINVAL;
+ goto out;
}
error = mountnfs(&args, mp, nam, args.hostname, &vp,
curthread->td_ucred, negnametimeo);
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index e74da83..4d7b540 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -157,21 +157,21 @@ struct pargs {
* either lock is sufficient for read access, but both locks must be held
* for write access.
*/
-struct racct;
+struct cpuset;
+struct kaioinfo;
struct kaudit_record;
-struct td_sched;
+struct kdtrace_proc;
+struct kdtrace_thread;
+struct mqueue_notifier;
struct nlminfo;
-struct kaioinfo;
struct p_sched;
struct proc;
+struct racct;
struct sleepqueue;
+struct td_sched;
struct thread;
struct trapframe;
struct turnstile;
-struct mqueue_notifier;
-struct kdtrace_proc;
-struct kdtrace_thread;
-struct cpuset;
/*
* XXX: Does this belong in resource.h or resourcevar.h instead?
@@ -185,13 +185,13 @@ struct cpuset;
* Locking for td_rux: (t) for all fields.
*/
struct rusage_ext {
- u_int64_t rux_runtime; /* (cj) Real time. */
- u_int64_t rux_uticks; /* (cj) Statclock hits in user mode. */
- u_int64_t rux_sticks; /* (cj) Statclock hits in sys mode. */
- u_int64_t rux_iticks; /* (cj) Statclock hits in intr mode. */
- u_int64_t rux_uu; /* (c) Previous user time in usec. */
- u_int64_t rux_su; /* (c) Previous sys time in usec. */
- u_int64_t rux_tu; /* (c) Previous total time in usec. */
+ uint64_t rux_runtime; /* (cj) Real time. */
+ uint64_t rux_uticks; /* (cj) Statclock hits in user mode. */
+ uint64_t rux_sticks; /* (cj) Statclock hits in sys mode. */
+ uint64_t rux_iticks; /* (cj) Statclock hits in intr mode. */
+ uint64_t rux_uu; /* (c) Previous user time in usec. */
+ uint64_t rux_su; /* (c) Previous sys time in usec. */
+ uint64_t rux_tu; /* (c) Previous total time in usec. */
};
/*
OpenPOWER on IntegriCloud