Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci msk(4): don't keep array of pointers to each rin...
details: https://anonhg.NetBSD.org/src/rev/7c38d5893893
branches: trunk
changeset: 1009641:7c38d5893893
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Wed Apr 29 18:52:03 2020 +0000
description:
msk(4): don't keep array of pointers to each ring descriptor
With 512 descriptors each in 2 rings this saves 4KiB (LP32) or 8KiB (LP64)
per interface.
diffstat:
sys/dev/pci/if_msk.c | 18 ++++--------------
sys/dev/pci/if_mskvar.h | 3 +--
2 files changed, 5 insertions(+), 16 deletions(-)
diffs (84 lines):
diff -r 6f5e5f399761 -r 7c38d5893893 sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c Wed Apr 29 11:08:40 2020 +0000
+++ b/sys/dev/pci/if_msk.c Wed Apr 29 18:52:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.103 2020/04/28 17:26:01 jakllsch Exp $ */
+/* $NetBSD: if_msk.c,v 1.104 2020/04/29 18:52:03 jakllsch Exp $ */
/* $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $ */
/*
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.103 2020/04/28 17:26:01 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.104 2020/04/29 18:52:03 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -418,14 +418,9 @@
struct msk_chain_data *cd = &sc_if->sk_cdata;
struct msk_ring_data *rd = sc_if->sk_rdata;
struct msk_rx_desc *r;
- int i;
memset(rd->sk_rx_ring, 0, sizeof(struct msk_rx_desc) * MSK_RX_RING_CNT);
- for (i = 0; i < MSK_RX_RING_CNT; i++) {
- cd->sk_rx_chain[i].sk_le = &rd->sk_rx_ring[i];
- }
-
sc_if->sk_cdata.sk_rx_prod = 0;
sc_if->sk_cdata.sk_rx_cons = 0;
sc_if->sk_cdata.sk_rx_cnt = 0;
@@ -453,14 +448,9 @@
struct msk_chain_data *cd = &sc_if->sk_cdata;
struct msk_ring_data *rd = sc_if->sk_rdata;
struct msk_tx_desc *t;
- int i;
memset(rd->sk_tx_ring, 0, sizeof(struct msk_tx_desc) * MSK_TX_RING_CNT);
- for (i = 0; i < MSK_TX_RING_CNT; i++) {
- cd->sk_tx_chain[i].sk_le = &rd->sk_tx_ring[i];
- }
-
sc_if->sk_cdata.sk_tx_prod = 0;
sc_if->sk_cdata.sk_tx_cons = 0;
sc_if->sk_cdata.sk_tx_cnt = 0;
@@ -515,7 +505,7 @@
if (sc_if->sk_cdata.sk_rx_hiaddr != MSK_ADDR_HI(addr)) {
c = &sc_if->sk_cdata.sk_rx_chain[sc_if->sk_cdata.sk_rx_prod];
- r = c->sk_le;
+ r = &sc_if->sk_rdata->sk_rx_ring[sc_if->sk_cdata.sk_rx_prod];
c->sk_mbuf = NULL;
r->sk_addr = htole32(MSK_ADDR_HI(addr));
r->sk_len = 0;
@@ -535,7 +525,7 @@
}
c = &sc_if->sk_cdata.sk_rx_chain[sc_if->sk_cdata.sk_rx_prod];
- r = c->sk_le;
+ r = &sc_if->sk_rdata->sk_rx_ring[sc_if->sk_cdata.sk_rx_prod];
c->sk_mbuf = m_new;
r->sk_addr = htole32(MSK_ADDR_LO(addr));
r->sk_len = htole16(SK_JLEN);
diff -r 6f5e5f399761 -r 7c38d5893893 sys/dev/pci/if_mskvar.h
--- a/sys/dev/pci/if_mskvar.h Wed Apr 29 11:08:40 2020 +0000
+++ b/sys/dev/pci/if_mskvar.h Wed Apr 29 18:52:03 2020 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: if_mskvar.h,v 1.3 2006/12/28 16:34:42 kettenis Exp $ */
-/* $NetBSD: if_mskvar.h,v 1.23 2020/04/26 16:14:14 jakllsch Exp $ */
+/* $NetBSD: if_mskvar.h,v 1.24 2020/04/29 18:52:03 jakllsch Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -89,7 +89,6 @@
};
struct sk_chain {
- void *sk_le;
struct mbuf *sk_mbuf;
};
Home |
Main Index |
Thread Index |
Old Index