Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163457105
D31457.id93393.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D31457.id93393.diff
View Options
Index: sys/dev/e1000/if_em.c
===================================================================
--- sys/dev/e1000/if_em.c
+++ sys/dev/e1000/if_em.c
@@ -3170,6 +3170,7 @@
* Enable receive unit.
*
**********************************************************************/
+#define BSIZEPKT_ROUNDUP ((1<<E1000_SRRCTL_BSIZEPKT_SHIFT)-1)
static void
em_initialize_receive_unit(if_ctx_t ctx)
@@ -3323,24 +3324,17 @@
u32 psize, srrctl = 0;
if (if_getmtu(ifp) > ETHERMTU) {
- /* Set maximum packet len */
- if (adapter->rx_mbuf_sz <= 4096) {
- srrctl |= 4096 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
- rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX;
- } else if (adapter->rx_mbuf_sz > 4096) {
- srrctl |= 8192 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
- rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX;
- }
psize = scctx->isc_max_frame_size;
/* are we on a vlan? */
if (ifp->if_vlantrunk != NULL)
psize += VLAN_TAG_SIZE;
E1000_WRITE_REG(hw, E1000_RLPML, psize);
- } else {
- srrctl |= 2048 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
- rctl |= E1000_RCTL_SZ_2048;
}
+ /* Set maximum packet buffer len */
+ srrctl |= (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >>
+ E1000_SRRCTL_BSIZEPKT_SHIFT;
+
/*
* If TX flow control is disabled and there's >1 queue defined,
* enable DROP.
@@ -3391,17 +3385,21 @@
/* Make sure VLAN Filters are off */
rctl &= ~E1000_RCTL_VFE;
- if (hw->mac.type < igb_mac_min) {
- if (adapter->rx_mbuf_sz == MCLBYTES)
- rctl |= E1000_RCTL_SZ_2048;
- else if (adapter->rx_mbuf_sz == MJUMPAGESIZE)
- rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX;
- else if (adapter->rx_mbuf_sz > MJUMPAGESIZE)
- rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX;
+ /* Set up packet buffer size, overridden by per queue srrctl on igb */
+ if (adapter->rx_mbuf_sz > 2048 && adapter->rx_mbuf_sz <= 4096)
+ rctl |= E1000_RCTL_SZ_4096 | E1000_RCTL_BSEX;
+ else if (adapter->rx_mbuf_sz > 4096)
+ rctl |= E1000_RCTL_SZ_8192 | E1000_RCTL_BSEX;
+ else
+ rctl |= E1000_RCTL_SZ_2048;
- /* ensure we clear use DTYPE of 00 here */
- rctl &= ~0x00000C00;
- }
+ /* rctl bits 11:10 are as follows
+ * lem: reserved
+ * em: DTYPE
+ * igb: reserved
+ * and should be 00 on all of the above
+ */
+ rctl &= ~0x00000C00;
/* Write out the settings */
E1000_WRITE_REG(hw, E1000_RCTL, rctl);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 24, 8:49 AM (11 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35439474
Default Alt Text
D31457.id93393.diff (2 KB)
Attached To
Mode
D31457: e1000: Simplify rctl/srrctl buffer size init
Attached
Detach File
Event Timeline
Log In to Comment