summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Foster <tim.foster@joyent.com>2020-05-15 14:13:45 +0000
committerTim Foster <tim.foster@joyent.com>2020-05-15 14:13:45 +0000
commite41e23be063a6b1ea71cf487aa8adc4efbe89af6 (patch)
tree3ba64548832613177939cc1da09f3a8963389e5b
parent29076355133a612fb0488c303a3a3caadf5d8568 (diff)
parent836be2fe28b6fc20176de322440ef4bb1a5f37dd (diff)
downloadillumos-joyent-e41e23be063a6b1ea71cf487aa8adc4efbe89af6.tar.gz
[illumos-gate merge]
commit 836be2fe28b6fc20176de322440ef4bb1a5f37dd 12726 sbbc: smatch and NULL pointer errors commit 4a6e21349395bc68ce9ec2839d99f74b079861b5 12727 unix: 'zvp' is undeclared commit 97f11506b8e20d03ac8f60ff1b6c7e38a3326df3 12731 disable IPv6 LSO until emulation is available Conflicts: usr/src/uts/common/io/mac/mac_client.c
-rw-r--r--usr/src/uts/common/io/mac/mac_client.c23
-rw-r--r--usr/src/uts/sfmmu/vm/hat_sfmmu.c31
-rw-r--r--usr/src/uts/sun4u/io/sbbc.c36
-rw-r--r--usr/src/uts/sun4u/sbbc/Makefile21
4 files changed, 55 insertions, 56 deletions
diff --git a/usr/src/uts/common/io/mac/mac_client.c b/usr/src/uts/common/io/mac/mac_client.c
index 824cc89bac..1cb001fa6a 100644
--- a/usr/src/uts/common/io/mac/mac_client.c
+++ b/usr/src/uts/common/io/mac/mac_client.c
@@ -4352,12 +4352,27 @@ i_mac_capab_get(mac_handle_t mh, mac_capab_t cap, void *cap_data)
{
mac_impl_t *mip = (mac_impl_t *)mh;
- if (mip->mi_bridge_link != NULL && cap == MAC_CAPAB_NO_ZCOPY)
+ if (mip->mi_bridge_link != NULL && cap == MAC_CAPAB_NO_ZCOPY) {
return (B_TRUE);
- else if (mip->mi_callbacks->mc_callbacks & MC_GETCAPAB)
- return (mip->mi_getcapab(mip->mi_driver, cap, cap_data));
- else
+ } else if (mip->mi_callbacks->mc_callbacks & MC_GETCAPAB) {
+ boolean_t res;
+
+ res = mip->mi_getcapab(mip->mi_driver, cap, cap_data);
+ /*
+ * Until we have suppport for TSOv6 emulation in the MAC
+ * loopback path, do not allow the TSOv6 capability to be
+ * advertised to consumers.
+ */
+ if (res && cap == MAC_CAPAB_LSO) {
+ mac_capab_lso_t *cap_lso = cap_data;
+
+ cap_lso->lso_flags &= ~LSO_TX_BASIC_TCP_IPV6;
+ cap_lso->lso_basic_tcp_ipv6.lso_max = 0;
+ }
+ return (res);
+ } else {
return (B_FALSE);
+ }
}
/*
diff --git a/usr/src/uts/sfmmu/vm/hat_sfmmu.c b/usr/src/uts/sfmmu/vm/hat_sfmmu.c
index 3a290b1fd7..1f0ef11096 100644
--- a/usr/src/uts/sfmmu/vm/hat_sfmmu.c
+++ b/usr/src/uts/sfmmu/vm/hat_sfmmu.c
@@ -4411,10 +4411,11 @@ rehash:
if (flags & HAC_PAGELOCK) {
if (!page_trylock(pp, SE_SHARED)) {
/*
- * Somebody is holding SE_EXCL lock. Might
- * even be hat_page_relocate(). Drop all
- * our locks, lookup the page in &kvp, and
- * retry. If it doesn't exist in &kvp and &zvp,
+ * Somebody is holding SE_EXCL lock. Might even be
+ * hat_page_relocate().
+ * Drop all our locks, lookup the page in &kvp, and
+ * retry.
+ * If it doesn't exist in &kvp and &kvps[KV_ZVP],
* then we must be dealing with a kernel mapped
* page which doesn't actually belong to
* segkmem so we punt.
@@ -4423,10 +4424,10 @@ rehash:
SFMMU_HASH_UNLOCK(hmebp);
pp = page_lookup(&kvp, (u_offset_t)saddr, SE_SHARED);
- /* check zvp before giving up */
+ /* check &kvps[KV_ZVP] before giving up */
if (pp == NULL)
- pp = page_lookup(&zvp, (u_offset_t)saddr,
- SE_SHARED);
+ pp = page_lookup(&kvps[KV_ZVP],
+ (u_offset_t)saddr, SE_SHARED);
/* Okay, we didn't find it, give up */
if (pp == NULL) {
@@ -4590,10 +4591,11 @@ rehash:
if (flags & HAC_PAGELOCK) {
if (!page_trylock(pp, SE_SHARED)) {
/*
- * Somebody is holding SE_EXCL lock. Might
- * even be hat_page_relocate(). Drop all
- * our locks, lookup the page in &kvp, and
- * retry. If it doesn't exist in &kvp and &zvp,
+ * Somebody is holding SE_EXCL lock. Might even be
+ * hat_page_relocate().
+ * Drop all our locks, lookup the page in &kvp, and
+ * retry.
+ * If it doesn't exist in &kvp and &kvps[KV_ZVP],
* then we must be dealing with a kernel mapped
* page which doesn't actually belong to
* segkmem so we punt.
@@ -4601,10 +4603,11 @@ rehash:
sfmmu_mlist_exit(pml);
SFMMU_HASH_UNLOCK(hmebp);
pp = page_lookup(&kvp, (u_offset_t)saddr, SE_SHARED);
- /* check zvp before giving up */
+
+ /* check &kvps[KV_ZVP] before giving up */
if (pp == NULL)
- pp = page_lookup(&zvp, (u_offset_t)saddr,
- SE_SHARED);
+ pp = page_lookup(&kvps[KV_ZVP],
+ (u_offset_t)saddr, SE_SHARED);
if (pp == NULL) {
ASSERT(cookie == NULL);
diff --git a/usr/src/uts/sun4u/io/sbbc.c b/usr/src/uts/sun4u/io/sbbc.c
index 615ea8549e..10117ae4dd 100644
--- a/usr/src/uts/sun4u/io/sbbc.c
+++ b/usr/src/uts/sun4u/io/sbbc.c
@@ -172,15 +172,15 @@ static struct bus_ops sbbc_bus_ops = {
0,
0,
0,
- NULL, /* (*bus_map_fault)() */
+ NULL, /* (*bus_map_fault)() */
ddi_no_dma_map,
ddi_no_dma_allochdl,
- ddi_no_dma_freehdl, /* (*bus_dma_freehdl)() */
- ddi_no_dma_bindhdl, /* (*bus_dma_bindhdl)() */
- ddi_no_dma_unbindhdl, /* (*bus_dma_unbindhdl)() */
- ddi_no_dma_flush, /* (*bus_dma_flush)() */
- ddi_no_dma_win, /* (*bus_dma_win)() */
- ddi_no_dma_mctl, /* (*bus_dma_ctl)() */
+ ddi_no_dma_freehdl, /* (*bus_dma_freehdl)() */
+ ddi_no_dma_bindhdl, /* (*bus_dma_bindhdl)() */
+ ddi_no_dma_unbindhdl, /* (*bus_dma_unbindhdl)() */
+ ddi_no_dma_flush, /* (*bus_dma_flush)() */
+ ddi_no_dma_win, /* (*bus_dma_win)() */
+ ddi_no_dma_mctl, /* (*bus_dma_ctl)() */
sbbc_ctlops,
ddi_bus_prop_op,
0, /* (*bus_get_eventcookie)(); */
@@ -425,7 +425,7 @@ sbbc_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
(void) sprintf(name, "sbbc%d", instance);
if (ddi_create_minor_node(dip, name, S_IFCHR, instance, NULL,
- NULL) == DDI_FAILURE) {
+ 0) == DDI_FAILURE) {
ddi_remove_minor_node(dip, NULL);
goto failed;
}
@@ -510,7 +510,7 @@ sbbc_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
*/
static int
sbbc_busmap(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp,
- off_t off, off_t len, caddr_t *addrp)
+ off_t off, off_t len, caddr_t *addrp)
{
struct sbbcsoft *sbbcsoftp;
sbbc_child_regspec_t *child_rp, *child_regs;
@@ -690,7 +690,7 @@ sbbc_add_intr_impl(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
childintr->status = SBBC_INTR_STATE_DISABLE;
for (i = 0; i < MAX_SBBC_DEVICES; i++) {
- if (sbbcsoftp->child_intr[i] == 0) {
+ if (sbbcsoftp->child_intr[i] == NULL) {
sbbcsoftp->child_intr[i] = childintr;
break;
}
@@ -705,7 +705,8 @@ sbbc_add_intr_impl(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
cmn_err(CE_WARN, "sbbc%d: failed to add intr for %s",
instance, ddi_get_name(rdip));
kmem_free(childintr, sizeof (struct sbbc_child_intr));
- sbbcsoftp->child_intr[i] = NULL;
+ if (i < MAX_SBBC_DEVICES)
+ sbbcsoftp->child_intr[i] = NULL;
}
/*
@@ -817,7 +818,7 @@ sbbc_update_intr_state(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
*/
static int
sbbc_ctlops(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op,
- void *arg, void *result)
+ void *arg, void *result)
{
sbbc_child_regspec_t *child_rp;
int i, n;
@@ -1121,7 +1122,7 @@ sbbc_close(dev_t dev, int flag, int otype, cred_t *credp)
/*ARGSUSED2*/
static int
sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
- int *rvalp)
+ int *rvalp)
{
struct sbbcsoft *sbbcsoftp;
@@ -1144,7 +1145,7 @@ sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
return (EINVAL);
}
- if (arg == NULL) {
+ if (arg == (intptr_t)NULL) {
return (ENXIO);
}
@@ -1184,7 +1185,7 @@ sbbc_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
return (EINVAL);
}
- if (arg == NULL) {
+ if (arg == (intptr_t)NULL) {
return (ENXIO);
}
@@ -1372,7 +1373,8 @@ sbbc_intr_wrapper(caddr_t arg)
* used to crash the system.
*/
static int
-sbbc_offset_valid(uint32_t offset) {
+sbbc_offset_valid(uint32_t offset)
+{
/*
* Check for proper alignment first.
*/
@@ -1415,7 +1417,7 @@ sbbc_offset_valid(uint32_t offset) {
#ifdef DEBUG
void
sbbc_dbg(uint32_t flag, dev_info_t *dip, char *fmt,
- uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5)
+ uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5)
{
char *s = NULL;
diff --git a/usr/src/uts/sun4u/sbbc/Makefile b/usr/src/uts/sun4u/sbbc/Makefile
index fab5fa1d4b..69d3b24876 100644
--- a/usr/src/uts/sun4u/sbbc/Makefile
+++ b/usr/src/uts/sun4u/sbbc/Makefile
@@ -40,7 +40,6 @@ UTSBASE = ../..
#
MODULE = sbbc
OBJECTS = $(SBBC_OBJS:%=$(OBJS_DIR)/%)
-LINTS = $(SBBC_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(ROOT_PSM_DRV_DIR)/$(MODULE)
#
@@ -52,30 +51,16 @@ include $(UTSBASE)/sun4u/Makefile.sun4u
# Define targets
#
ALL_TARGET = $(BINARY)
-LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
# Turn this on once compiler understands v9 in it's backend
#INLINES += $(UTSBASE)/sun4u/io/sbbc.il
#
-# lint pass one enforcement
-#
-CFLAGS += $(CCVERBOSE)
-
-#
# Turn on doubleword alignment for 64 bit registers
#
CFLAGS += -dalign
-#
-# For now, disable these lint checks; maintainers should endeavor
-# to investigate and remove these for maximum lint coverage.
-# Please do not carry these forward to new Makefiles.
-#
-LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
-
CERRWARN += -_gcc=-Wno-switch
#
@@ -91,12 +76,6 @@ clean: $(CLEAN_DEPS)
clobber: $(CLOBBER_DEPS)
-lint: $(LINT_DEPS)
-
-modlintlib: $(MODLINTLIB_DEPS)
-
-clean.lint: $(CLEAN_LINT_DEPS)
-
install: $(INSTALL_DEPS)
#