ena: Align names of constants
Most of the constants in ena.h file were prefixed with ENA_*, while others did not have this prefix. Align the constants by prefixing the remaining constants with ENA. Obtained from: Semihalf MFC after: 2 weeks Sponsored by: Amazon, Inc.
This commit is contained in:
parent
d5d5ea8723
commit
8f15f8a72b
@ -170,7 +170,8 @@ static void unimplemented_aenq_handler(void *, struct ena_admin_aenq_entry *);
|
||||
static int ena_copy_eni_metrics(struct ena_adapter *);
|
||||
static void ena_timer_service(void *);
|
||||
|
||||
static char ena_version[] = DEVICE_NAME DRV_MODULE_NAME " v" DRV_MODULE_VERSION;
|
||||
static char ena_version[] = ENA_DEVICE_NAME ENA_DRV_MODULE_NAME
|
||||
" v" ENA_DRV_MODULE_VERSION;
|
||||
|
||||
static ena_vendor_info_t ena_vendor_info_array[] = {
|
||||
{ PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_PF, 0 },
|
||||
@ -307,7 +308,7 @@ ena_probe(device_t dev)
|
||||
ena_log_raw(DBG, "vendor=%x device=%x\n", pci_vendor_id,
|
||||
pci_device_id);
|
||||
|
||||
device_set_desc(dev, DEVICE_DESC);
|
||||
device_set_desc(dev, ENA_DEVICE_DESC);
|
||||
return (BUS_PROBE_DEFAULT);
|
||||
}
|
||||
|
||||
@ -2736,9 +2737,9 @@ ena_config_host_info(struct ena_com_dev *ena_dev, device_t dev)
|
||||
strncpy(host_info->os_dist_str, osrelease,
|
||||
sizeof(host_info->os_dist_str) - 1);
|
||||
|
||||
host_info->driver_version = (DRV_MODULE_VER_MAJOR) |
|
||||
(DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
|
||||
(DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT);
|
||||
host_info->driver_version = (ENA_DRV_MODULE_VER_MAJOR) |
|
||||
(ENA_DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
|
||||
(ENA_DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT);
|
||||
host_info->num_cpus = mp_ncpus;
|
||||
host_info->driver_supported_features =
|
||||
ENA_ADMIN_HOST_INFO_RX_OFFSET_MASK |
|
||||
@ -3504,10 +3505,10 @@ ena_attach(device_t pdev)
|
||||
* concurrency, as the callout won't be using any locking inside.
|
||||
*/
|
||||
ENA_TIMER_INIT(adapter);
|
||||
adapter->keep_alive_timeout = DEFAULT_KEEP_ALIVE_TO;
|
||||
adapter->missing_tx_timeout = DEFAULT_TX_CMP_TO;
|
||||
adapter->missing_tx_max_queues = DEFAULT_TX_MONITORED_QUEUES;
|
||||
adapter->missing_tx_threshold = DEFAULT_TX_CMP_THRESHOLD;
|
||||
adapter->keep_alive_timeout = ENA_DEFAULT_KEEP_ALIVE_TO;
|
||||
adapter->missing_tx_timeout = ENA_DEFAULT_TX_CMP_TO;
|
||||
adapter->missing_tx_max_queues = ENA_DEFAULT_TX_MONITORED_QUEUES;
|
||||
adapter->missing_tx_threshold = ENA_DEFAULT_TX_CMP_THRESHOLD;
|
||||
|
||||
if (version_printed++ == 0)
|
||||
ena_log(pdev, INFO, "%s\n", ena_version);
|
||||
|
@ -39,20 +39,20 @@
|
||||
#include "ena-com/ena_com.h"
|
||||
#include "ena-com/ena_eth_com.h"
|
||||
|
||||
#define DRV_MODULE_VER_MAJOR 2
|
||||
#define DRV_MODULE_VER_MINOR 5
|
||||
#define DRV_MODULE_VER_SUBMINOR 0
|
||||
#define ENA_DRV_MODULE_VER_MAJOR 2
|
||||
#define ENA_DRV_MODULE_VER_MINOR 5
|
||||
#define ENA_DRV_MODULE_VER_SUBMINOR 0
|
||||
|
||||
#define DRV_MODULE_NAME "ena"
|
||||
#define ENA_DRV_MODULE_NAME "ena"
|
||||
|
||||
#ifndef DRV_MODULE_VERSION
|
||||
#define DRV_MODULE_VERSION \
|
||||
__XSTRING(DRV_MODULE_VER_MAJOR) "." \
|
||||
__XSTRING(DRV_MODULE_VER_MINOR) "." \
|
||||
__XSTRING(DRV_MODULE_VER_SUBMINOR)
|
||||
#ifndef ENA_DRV_MODULE_VERSION
|
||||
#define ENA_DRV_MODULE_VERSION \
|
||||
__XSTRING(ENA_DRV_MODULE_VER_MAJOR) "." \
|
||||
__XSTRING(ENA_DRV_MODULE_VER_MINOR) "." \
|
||||
__XSTRING(ENA_DRV_MODULE_VER_SUBMINOR)
|
||||
#endif
|
||||
#define DEVICE_NAME "Elastic Network Adapter (ENA)"
|
||||
#define DEVICE_DESC "ENA adapter"
|
||||
#define ENA_DEVICE_NAME "Elastic Network Adapter (ENA)"
|
||||
#define ENA_DEVICE_DESC "ENA adapter"
|
||||
|
||||
/* Calculate DMA mask - width for ena cannot exceed 48, so it is safe */
|
||||
#define ENA_DMA_BIT_MASK(x) ((1ULL << (x)) - 1ULL)
|
||||
@ -92,24 +92,24 @@
|
||||
|
||||
#define ENA_TX_RESUME_THRESH (ENA_PKT_MAX_BUFS + 2)
|
||||
|
||||
#define DB_THRESHOLD 64
|
||||
#define ENA_DB_THRESHOLD 64
|
||||
|
||||
#define TX_COMMIT 32
|
||||
#define ENA_TX_COMMIT 32
|
||||
/*
|
||||
* TX budget for cleaning. It should be half of the RX budget to reduce amount
|
||||
* of TCP retransmissions.
|
||||
*/
|
||||
#define TX_BUDGET 128
|
||||
#define ENA_TX_BUDGET 128
|
||||
/* RX cleanup budget. -1 stands for infinity. */
|
||||
#define RX_BUDGET 256
|
||||
#define ENA_RX_BUDGET 256
|
||||
/*
|
||||
* How many times we can repeat cleanup in the io irq handling routine if the
|
||||
* RX or TX budget was depleted.
|
||||
*/
|
||||
#define CLEAN_BUDGET 8
|
||||
#define ENA_CLEAN_BUDGET 8
|
||||
|
||||
#define RX_IRQ_INTERVAL 20
|
||||
#define TX_IRQ_INTERVAL 50
|
||||
#define ENA_RX_IRQ_INTERVAL 20
|
||||
#define ENA_TX_IRQ_INTERVAL 50
|
||||
|
||||
#define ENA_MIN_MTU 128
|
||||
|
||||
@ -136,16 +136,16 @@
|
||||
* ENA device should send keep alive msg every 1 sec.
|
||||
* We wait for 6 sec just to be on the safe side.
|
||||
*/
|
||||
#define DEFAULT_KEEP_ALIVE_TO (SBT_1S * 6)
|
||||
#define ENA_DEFAULT_KEEP_ALIVE_TO (SBT_1S * 6)
|
||||
|
||||
/* Time in jiffies before concluding the transmitter is hung. */
|
||||
#define DEFAULT_TX_CMP_TO (SBT_1S * 5)
|
||||
#define ENA_DEFAULT_TX_CMP_TO (SBT_1S * 5)
|
||||
|
||||
/* Number of queues to check for missing queues per timer tick */
|
||||
#define DEFAULT_TX_MONITORED_QUEUES (4)
|
||||
#define ENA_DEFAULT_TX_MONITORED_QUEUES (4)
|
||||
|
||||
/* Max number of timeouted packets before device reset */
|
||||
#define DEFAULT_TX_CMP_THRESHOLD (128)
|
||||
#define ENA_DEFAULT_TX_CMP_THRESHOLD (128)
|
||||
|
||||
/*
|
||||
* Supported PCI vendor and devices IDs
|
||||
|
@ -93,20 +93,20 @@ ena_cleanup(void *arg, int pending)
|
||||
atomic_store_8(&tx_ring->first_interrupt, true);
|
||||
atomic_store_8(&rx_ring->first_interrupt, true);
|
||||
|
||||
for (i = 0; i < CLEAN_BUDGET; ++i) {
|
||||
for (i = 0; i < ENA_CLEAN_BUDGET; ++i) {
|
||||
rxc = ena_rx_cleanup(rx_ring);
|
||||
txc = ena_tx_cleanup(tx_ring);
|
||||
|
||||
if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0))
|
||||
return;
|
||||
|
||||
if ((txc != TX_BUDGET) && (rxc != RX_BUDGET))
|
||||
if ((txc != ENA_TX_BUDGET) && (rxc != ENA_RX_BUDGET))
|
||||
break;
|
||||
}
|
||||
|
||||
/* Signal that work is done and unmask interrupt */
|
||||
ena_com_update_intr_reg(&intr_reg, RX_IRQ_INTERVAL, TX_IRQ_INTERVAL,
|
||||
true);
|
||||
ena_com_update_intr_reg(&intr_reg, ENA_RX_IRQ_INTERVAL,
|
||||
ENA_TX_IRQ_INTERVAL, true);
|
||||
counter_u64_add(tx_ring->tx_stats.unmask_interrupt_num, 1);
|
||||
ena_com_unmask_intr(io_cq, &intr_reg);
|
||||
}
|
||||
@ -248,8 +248,8 @@ ena_tx_cleanup(struct ena_ring *tx_ring)
|
||||
uint16_t ena_qid;
|
||||
unsigned int total_done = 0;
|
||||
int rc;
|
||||
int commit = TX_COMMIT;
|
||||
int budget = TX_BUDGET;
|
||||
int commit = ENA_TX_COMMIT;
|
||||
int budget = ENA_TX_BUDGET;
|
||||
int work_done;
|
||||
bool above_thresh;
|
||||
|
||||
@ -294,8 +294,8 @@ ena_tx_cleanup(struct ena_ring *tx_ring)
|
||||
tx_ring->ring_size);
|
||||
|
||||
if (unlikely(--commit == 0)) {
|
||||
commit = TX_COMMIT;
|
||||
/* update ring state every TX_COMMIT descriptor */
|
||||
commit = ENA_TX_COMMIT;
|
||||
/* update ring state every ENA_TX_COMMIT descriptor */
|
||||
tx_ring->next_to_clean = next_to_clean;
|
||||
ena_com_comp_ack(
|
||||
&adapter->ena_dev->io_sq_queues[ena_qid],
|
||||
@ -305,13 +305,13 @@ ena_tx_cleanup(struct ena_ring *tx_ring)
|
||||
}
|
||||
} while (likely(--budget));
|
||||
|
||||
work_done = TX_BUDGET - budget;
|
||||
work_done = ENA_TX_BUDGET - budget;
|
||||
|
||||
ena_log_io(adapter->pdev, DBG, "tx: q %d done. total pkts: %d\n",
|
||||
tx_ring->qid, work_done);
|
||||
|
||||
/* If there is still something to commit update ring state */
|
||||
if (likely(commit != TX_COMMIT)) {
|
||||
if (likely(commit != ENA_TX_COMMIT)) {
|
||||
tx_ring->next_to_clean = next_to_clean;
|
||||
ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid],
|
||||
total_done);
|
||||
@ -575,7 +575,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring)
|
||||
uint32_t do_if_input = 0;
|
||||
unsigned int qid;
|
||||
int rc, i;
|
||||
int budget = RX_BUDGET;
|
||||
int budget = ENA_RX_BUDGET;
|
||||
#ifdef DEV_NETMAP
|
||||
int done;
|
||||
#endif /* DEV_NETMAP */
|
||||
@ -698,7 +698,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring)
|
||||
|
||||
tcp_lro_flush_all(&rx_ring->lro);
|
||||
|
||||
return (RX_BUDGET - budget);
|
||||
return (ENA_RX_BUDGET - budget);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1016,7 +1016,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf)
|
||||
/* Set flags and meta data */
|
||||
ena_tx_csum(&ena_tx_ctx, *mbuf, adapter->disable_meta_caching);
|
||||
|
||||
if (tx_ring->acum_pkts == DB_THRESHOLD ||
|
||||
if (tx_ring->acum_pkts == ENA_DB_THRESHOLD ||
|
||||
ena_com_is_doorbell_needed(tx_ring->ena_com_io_sq, &ena_tx_ctx)) {
|
||||
ena_log_io(pdev, DBG,
|
||||
"llq tx max burst size of queue %d achieved, writing doorbell to send burst\n",
|
||||
|
@ -428,7 +428,7 @@ ena_netmap_tx_frame(struct ena_netmap_ctx *ctx)
|
||||
|
||||
/* There are no any offloads, as the netmap doesn't support them */
|
||||
|
||||
if (tx_ring->acum_pkts == DB_THRESHOLD ||
|
||||
if (tx_ring->acum_pkts == ENA_DB_THRESHOLD ||
|
||||
ena_com_is_doorbell_needed(ctx->io_sq, &ena_tx_ctx))
|
||||
ena_ring_tx_doorbell(tx_ring);
|
||||
|
||||
|
@ -68,7 +68,7 @@ SYSCTL_INT(_hw_ena, OID_AUTO, log_level, CTLFLAG_RWTUN, &ena_log_level, 0,
|
||||
"Logging level indicating verbosity of the logs");
|
||||
|
||||
SYSCTL_CONST_STRING(_hw_ena, OID_AUTO, driver_version, CTLFLAG_RD,
|
||||
DRV_MODULE_VERSION, "ENA driver version");
|
||||
ENA_DRV_MODULE_VERSION, "ENA driver version");
|
||||
|
||||
/*
|
||||
* Use 9k mbufs for the Rx buffers. Default to 0 (use page size mbufs instead).
|
||||
|
Loading…
Reference in New Issue
Block a user