summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-11-08 18:56:55 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-11-08 18:56:55 +0000
commit80ef207a0f4678048cd4c10eef92dddf78e8c316 (patch)
tree7c72f35e13cd3a4795e815117c576f89faea5553
parent58b194e53e9fbbdd881b66d59bbb7c834d632f19 (diff)
hardware supports mtu values from 256 up to 9000;
figured out the hard way, linux driver agrees
-rw-r--r--sys/dev/pci/if_oce.c4
-rw-r--r--sys/dev/pci/if_ocevar.h9
2 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c
index c3aa8997b1c..b41cd3bf0a8 100644
--- a/sys/dev/pci/if_oce.c
+++ b/sys/dev/pci/if_oce.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_oce.c,v 1.47 2012/11/08 18:26:17 mikeb Exp $ */
+/* $OpenBSD: if_oce.c,v 1.48 2012/11/08 18:56:54 mikeb Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
@@ -471,7 +471,7 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
}
break;
case SIOCSIFMTU:
- if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu)
+ if (ifr->ifr_mtu < OCE_MIN_MTU || ifr->ifr_mtu > OCE_MAX_MTU)
error = EINVAL;
else if (ifp->if_mtu != ifr->ifr_mtu) {
ifp->if_mtu = ifr->ifr_mtu;
diff --git a/sys/dev/pci/if_ocevar.h b/sys/dev/pci/if_ocevar.h
index 8761fdba44c..0f4fba17a72 100644
--- a/sys/dev/pci/if_ocevar.h
+++ b/sys/dev/pci/if_ocevar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ocevar.h,v 1.6 2012/11/05 20:05:39 mikeb Exp $ */
+/* $OpenBSD: if_ocevar.h,v 1.7 2012/11/08 18:56:54 mikeb Exp $ */
/*-
* Copyright (C) 2012 Emulex
@@ -55,10 +55,9 @@
#define OCE_DEFAULT_EQD 80
#define OCE_RQ_BUF_SIZE 2048
#define OCE_LSO_MAX_SIZE (64 * 1024)
-#define OCE_MAX_JUMBO_FRAME_SIZE 16360
-#define OCE_MAX_MTU (OCE_MAX_JUMBO_FRAME_SIZE - \
- ETHER_VLAN_ENCAP_LEN - \
- ETHER_HDR_LEN - ETHER_CRC_LEN)
+
+#define OCE_MIN_MTU 256
+#define OCE_MAX_MTU 9000
#define OCE_MAX_TX_ELEMENTS 29
#define OCE_MAX_TX_DESC 1024