diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-03-25 10:56:10 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-03-25 10:56:10 +0000 |
commit | 7f3d3b19398fdc892d5fb40cddef491e2b038ec7 (patch) | |
tree | bb02bf7a2bd460f7aa39795e4794270e85451e65 | |
parent | da7dc9ab83ffd1753176346999a994818a7583ac (diff) | |
download | FreeBSD-src-7f3d3b19398fdc892d5fb40cddef491e2b038ec7.zip FreeBSD-src-7f3d3b19398fdc892d5fb40cddef491e2b038ec7.tar.gz |
MFC: 279077
sfxge: style fixes
Use nitem() to get number of array elements.
Remove unused define.
Use TAB to indent.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
-rw-r--r-- | sys/dev/sfxge/common/efx.h | 24 | ||||
-rw-r--r-- | sys/dev/sfxge/sfxge_rx.c | 4 | ||||
-rw-r--r-- | sys/dev/sfxge/sfxge_tx.c | 4 | ||||
-rw-r--r-- | sys/dev/sfxge/sfxge_tx.h | 8 |
4 files changed, 15 insertions, 25 deletions
diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h index b3110b5..92e271d 100644 --- a/sys/dev/sfxge/common/efx.h +++ b/sys/dev/sfxge/common/efx.h @@ -1614,14 +1614,14 @@ efx_rx_scale_toeplitz_ipv6_key_set( #endif /* EFSYS_OPT_RX_SCALE */ -#define EFX_RXQ_MAXNDESCS 4096 -#define EFX_RXQ_MINNDESCS 512 +#define EFX_RXQ_MAXNDESCS 4096 +#define EFX_RXQ_MINNDESCS 512 -#define EFX_RXQ_NDESCS_MASK EFX_MASK(EFX_RXQ_MAXNDESCS, EFX_RXQ_MINNDESCS) +#define EFX_RXQ_NDESCS_MASK EFX_MASK(EFX_RXQ_MAXNDESCS, EFX_RXQ_MINNDESCS) -#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) -#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) -#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) +#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE) +#define EFX_RXQ_LIMIT(_ndescs) ((_ndescs) - 16) typedef enum efx_rxq_type_e { EFX_RXQ_TYPE_DEFAULT, @@ -1700,14 +1700,14 @@ extern void efx_tx_fini( __in efx_nic_t *enp); -#define EFX_TXQ_MAXNDESCS 4096 -#define EFX_TXQ_MINNDESCS 512 +#define EFX_TXQ_MAXNDESCS 4096 +#define EFX_TXQ_MINNDESCS 512 -#define EFX_TXQ_NDESCS_MASK EFX_MASK(EFX_TXQ_MAXNDESCS, EFX_TXQ_MINNDESCS) +#define EFX_TXQ_NDESCS_MASK EFX_MASK(EFX_TXQ_MAXNDESCS, EFX_TXQ_MINNDESCS) -#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) -#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) -#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) +#define EFX_TXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t)) +#define EFX_TXQ_NBUFS(_ndescs) (EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE) +#define EFX_TXQ_LIMIT(_ndescs) ((_ndescs) - 16) extern __checkReturn int efx_tx_qcreate( diff --git a/sys/dev/sfxge/sfxge_rx.c b/sys/dev/sfxge/sfxge_rx.c index 66cb8b3..e8a84d4 100644 --- a/sys/dev/sfxge/sfxge_rx.c +++ b/sys/dev/sfxge/sfxge_rx.c @@ -1172,9 +1172,7 @@ sfxge_rx_stat_init(struct sfxge_softc *sc) stat_list = SYSCTL_CHILDREN(sc->stats_node); - for (id = 0; - id < sizeof(sfxge_rx_stats) / sizeof(sfxge_rx_stats[0]); - id++) { + for (id = 0; id < nitems(sfxge_rx_stats); id++) { SYSCTL_ADD_PROC( ctx, stat_list, OID_AUTO, sfxge_rx_stats[id].name, diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 77829ce..9e0aabe 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -1547,9 +1547,7 @@ sfxge_tx_stat_init(struct sfxge_softc *sc) stat_list = SYSCTL_CHILDREN(sc->stats_node); - for (id = 0; - id < sizeof(sfxge_tx_stats) / sizeof(sfxge_tx_stats[0]); - id++) { + for (id = 0; id < nitems(sfxge_tx_stats); id++) { SYSCTL_ADD_PROC( ctx, stat_list, OID_AUTO, sfxge_tx_stats[id].name, diff --git a/sys/dev/sfxge/sfxge_tx.h b/sys/dev/sfxge/sfxge_tx.h index ab001c1..b430288 100644 --- a/sys/dev/sfxge/sfxge_tx.h +++ b/sys/dev/sfxge/sfxge_tx.h @@ -41,13 +41,7 @@ * clusters. (The chain could be longer than this initially, but can * be shortened with m_collapse().) */ -#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) - -/* Maximum number of DMA segments needed to map an output packet. It - * could overlap all mbufs in the chain and also require an extra - * segment for a TSO header. - */ -#define SFXGE_TX_PACKET_MAX_SEG (SFXGE_TX_MAPPING_MAX_SEG + 1) +#define SFXGE_TX_MAPPING_MAX_SEG (64 / 2 + 1) /* * Buffer mapping flags. |