{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
if (adapter->state == ENA_ADAPTER_STATE_RUNNING)
ena_stop(dev);
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
struct ena_com_dev *ena_dev = &adapter->ena_dev;
int rc, i;
u16 entry_value;
struct rte_eth_rss_reta_entry64 *reta_conf,
uint16_t reta_size)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
struct ena_com_dev *ena_dev = &adapter->ena_dev;
int rc;
int i;
__rte_unused int wait_to_complete)
{
struct rte_eth_link *link = &dev->data->dev_link;
- struct ena_adapter *adapter;
-
- adapter = (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
link->link_status = adapter->link_status ? ETH_LINK_UP : ETH_LINK_DOWN;
link->link_speed = ETH_SPEED_NUM_NONE;
static int ena_queue_start_all(struct rte_eth_dev *dev,
enum ena_ring_type ring_type)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
struct ena_ring *queues = NULL;
int nb_queues;
int i = 0;
static void ena_stats_restart(struct rte_eth_dev *dev)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
rte_atomic64_init(&adapter->drv_stats->ierrors);
rte_atomic64_init(&adapter->drv_stats->oerrors);
struct rte_eth_stats *stats)
{
struct ena_admin_basic_stats ena_stats;
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
struct ena_com_dev *ena_dev = &adapter->ena_dev;
int rc;
int i;
ena_assert_msg(dev->data != NULL, "Uninitialized device\n");
ena_assert_msg(dev->data->dev_private != NULL, "Uninitialized device\n");
- adapter = (struct ena_adapter *)(dev->data->dev_private);
+ adapter = dev->data->dev_private;
ena_dev = &adapter->ena_dev;
ena_assert_msg(ena_dev != NULL, "Uninitialized device\n");
static int ena_start(struct rte_eth_dev *dev)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
uint64_t ticks;
int rc = 0;
static void ena_stop(struct rte_eth_dev *dev)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
struct ena_com_dev *ena_dev = &adapter->ena_dev;
int rc;
static void ena_queue_stop_all(struct rte_eth_dev *dev,
enum ena_ring_type ring_type)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
struct ena_ring *queues = NULL;
uint16_t nb_queues, i;
const struct rte_eth_txconf *tx_conf)
{
struct ena_ring *txq = NULL;
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
unsigned int i;
txq = &adapter->tx_ring[queue_idx];
__rte_unused const struct rte_eth_rxconf *rx_conf,
struct rte_mempool *mp)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
struct ena_ring *rxq = NULL;
int i;
static void ena_interrupt_handler_rte(void *cb_arg)
{
- struct ena_adapter *adapter = (struct ena_adapter *)cb_arg;
+ struct ena_adapter *adapter = cb_arg;
struct ena_com_dev *ena_dev = &adapter->ena_dev;
ena_com_admin_q_comp_intr_handler(ena_dev);
static void ena_timer_wd_callback(__rte_unused struct rte_timer *timer,
void *arg)
{
- struct ena_adapter *adapter = (struct ena_adapter *)arg;
+ struct ena_adapter *adapter = arg;
struct rte_eth_dev *dev = adapter->rte_dev;
check_for_missing_keep_alive(adapter);
struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 };
struct rte_pci_device *pci_dev;
struct rte_intr_handle *intr_handle;
- struct ena_adapter *adapter =
- (struct ena_adapter *)(eth_dev->data->dev_private);
+ struct ena_adapter *adapter = eth_dev->data->dev_private;
struct ena_com_dev *ena_dev = &adapter->ena_dev;
struct ena_com_dev_get_features_ctx get_feat_ctx;
struct ena_llq_configurations llq_config;
static void ena_destroy_device(struct rte_eth_dev *eth_dev)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(eth_dev->data->dev_private);
+ struct ena_adapter *adapter = eth_dev->data->dev_private;
struct ena_com_dev *ena_dev = &adapter->ena_dev;
if (adapter->state == ENA_ADAPTER_STATE_FREE)
static int ena_dev_configure(struct rte_eth_dev *dev)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
adapter->state = ENA_ADAPTER_STATE_CONFIG;
ena_assert_msg(dev->data != NULL, "Uninitialized device\n");
ena_assert_msg(dev->data->dev_private != NULL, "Uninitialized device\n");
- adapter = (struct ena_adapter *)(dev->data->dev_private);
+ adapter = dev->data->dev_private;
ena_dev = &adapter->ena_dev;
ena_assert_msg(ena_dev != NULL, "Uninitialized device\n");
struct rte_eth_xstat *xstats,
unsigned int n)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
unsigned int xstats_count = ena_xstats_calc_num(dev);
unsigned int stat, i, count = 0;
int stat_offset;
uint64_t *values,
unsigned int n)
{
- struct ena_adapter *adapter =
- (struct ena_adapter *)(dev->data->dev_private);
+ struct ena_adapter *adapter = dev->data->dev_private;
uint64_t id;
uint64_t rx_entries, tx_entries;
unsigned int i;
struct ena_admin_aenq_link_change_desc *aenq_link_desc;
uint32_t status;
- adapter = (struct ena_adapter *)adapter_data;
+ adapter = adapter_data;
aenq_link_desc = (struct ena_admin_aenq_link_change_desc *)aenq_e;
eth_dev = adapter->rte_dev;
static void ena_notification(void *data,
struct ena_admin_aenq_entry *aenq_e)
{
- struct ena_adapter *adapter = (struct ena_adapter *)data;
+ struct ena_adapter *adapter = data;
struct ena_admin_ena_hw_hints *hints;
if (aenq_e->aenq_common_desc.group != ENA_ADMIN_NOTIFICATION)
static void ena_keep_alive(void *adapter_data,
__rte_unused struct ena_admin_aenq_entry *aenq_e)
{
- struct ena_adapter *adapter = (struct ena_adapter *)adapter_data;
+ struct ena_adapter *adapter = adapter_data;
struct ena_admin_aenq_keep_alive_desc *desc;
uint64_t rx_drops;