diff options
author | 2016-10-31 01:38:57 +0000 | |
---|---|---|
committer | 2016-10-31 01:38:57 +0000 | |
commit | e890ea3c3011fd92f59235e5e55c9f9857d31ea3 (patch) | |
tree | 6be4120221a765814ab07f7e6a337ca8f9f696e7 | |
parent | revert 1.97 where i moved myx to using the system pools (diff) | |
download | wireguard-openbsd-e890ea3c3011fd92f59235e5e55c9f9857d31ea3.tar.xz wireguard-openbsd-e890ea3c3011fd92f59235e5e55c9f9857d31ea3.zip |
turns out these chips can handle buffers up to 9400 bytes in length.
raise the mtu to 9380 bytes so we can take advantage of the extra space.
i need to revisit the macro names at some point.
-rw-r--r-- | sys/dev/pci/if_myx.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/if_myxreg.h | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index ea797fcd720..7d39f418961 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.98 2016/10/31 01:23:46 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.99 2016/10/31 01:38:57 dlg Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -159,7 +159,8 @@ struct myx_softc { }; #define MYX_RXSMALL_SIZE MCLBYTES -#define MYX_RXBIG_SIZE (9 * 1024) +#define MYX_RXBIG_SIZE (MYX_MTU - \ + (ETHER_ALIGN + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)) int myx_match(struct device *, void *, void *); void myx_attach(struct device *, struct device *, void *); @@ -511,7 +512,7 @@ myx_attachhook(struct device *self) ifp->if_ioctl = myx_ioctl; ifp->if_start = myx_start; ifp->if_watchdog = myx_watchdog; - ifp->if_hardmtu = 9000; + ifp->if_hardmtu = MYX_RXBIG_SIZE; strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ); IFQ_SET_MAXLEN(&ifp->if_snd, 1); diff --git a/sys/dev/pci/if_myxreg.h b/sys/dev/pci/if_myxreg.h index 756cf25dbcc..89f3efee8ab 100644 --- a/sys/dev/pci/if_myxreg.h +++ b/sys/dev/pci/if_myxreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myxreg.h,v 1.8 2015/02/18 23:58:34 dlg Exp $ */ +/* $OpenBSD: if_myxreg.h,v 1.9 2016/10/31 01:38:57 dlg Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -37,6 +37,7 @@ #define MYXALIGN_CMD 64 #define MYXALIGN_DATA PAGE_SIZE #define MYX_BOUNDARY 4096 +#define MYX_MTU 9400 #define MYX_ADDRHIGH(_v) (((u_int64_t)_v >> 32) & 0xffffffff) #define MYX_ADDRLOW(_v) ((u_int64_t)_v & 0xffffffff) |