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)
This commit is contained in:
Andrew Rybchenko 2015-02-20 19:39:40 +00:00
parent 9bdc809c17
commit 612d8e2828
4 changed files with 15 additions and 25 deletions

View File

@ -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(

View File

@ -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,

View File

@ -1548,9 +1548,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,

View File

@ -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.