linux/drivers/net/ethernet/sfc/tc_counters.c

// SPDX-License-Identifier: GPL-2.0-only
/****************************************************************************
 * Driver for Solarflare network controllers and boards
 * Copyright 2022 Advanced Micro Devices, Inc.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published
 * by the Free Software Foundation, incorporated herein by reference.
 */

#include "tc_counters.h"
#include "tc_encap_actions.h"
#include "mae_counter_format.h"
#include "mae.h"
#include "rx_common.h"

/* Counter-management hashtables */

static const struct rhashtable_params efx_tc_counter_id_ht_params =;

static const struct rhashtable_params efx_tc_counter_ht_params =;

static void efx_tc_counter_free(void *ptr, void *__unused)
{}

static void efx_tc_counter_id_free(void *ptr, void *__unused)
{}

int efx_tc_init_counters(struct efx_nic *efx)
{}

/* Only call this in init failure teardown.
 * Normal exit should fini instead as there may be entries in the table.
 */
void efx_tc_destroy_counters(struct efx_nic *efx)
{}

void efx_tc_fini_counters(struct efx_nic *efx)
{}

static void efx_tc_counter_work(struct work_struct *work)
{}

/* Counter allocation */

struct efx_tc_counter *efx_tc_flower_allocate_counter(struct efx_nic *efx,
						      int type)
{}

void efx_tc_flower_release_counter(struct efx_nic *efx,
				   struct efx_tc_counter *cnt)
{}

static struct efx_tc_counter *efx_tc_flower_find_counter_by_fw_id(
				struct efx_nic *efx, int type, u32 fw_id)
{}

/* TC cookie to counter mapping */

void efx_tc_flower_put_counter_index(struct efx_nic *efx,
				     struct efx_tc_counter_index *ctr)
{}

struct efx_tc_counter_index *efx_tc_flower_get_counter_index(
				struct efx_nic *efx, unsigned long cookie,
				enum efx_tc_counter_type type)
{}

struct efx_tc_counter_index *efx_tc_flower_find_counter_index(
				struct efx_nic *efx, unsigned long cookie)
{}

/* TC Channel.  Counter updates are delivered on this channel's RXQ. */

static void efx_tc_handle_no_channel(struct efx_nic *efx)
{}

static int efx_tc_probe_channel(struct efx_channel *channel)
{}

static int efx_tc_start_channel(struct efx_channel *channel)
{}

static void efx_tc_stop_channel(struct efx_channel *channel)
{}

static void efx_tc_remove_channel(struct efx_channel *channel)
{}

static void efx_tc_get_channel_name(struct efx_channel *channel,
				    char *buf, size_t len)
{}

static void efx_tc_counter_update(struct efx_nic *efx,
				  enum efx_tc_counter_type counter_type,
				  u32 counter_idx, u64 packets, u64 bytes,
				  u32 mark)
{}

static void efx_tc_rx_version_1(struct efx_nic *efx, const u8 *data, u32 mark)
{}

#define TCV2_HDR_PTR(pkt, field)
#define TCV2_HDR_BYTE(pkt, field)
#define TCV2_HDR_WORD(pkt, field)
#define TCV2_PKT_PTR(pkt, poff, i, field)

/* Read a little-endian 48-bit field with 16-bit alignment */
static u64 efx_tc_read48(const __le16 *field)
{}

static enum efx_tc_counter_type efx_tc_rx_version_2(struct efx_nic *efx,
						    const u8 *data, u32 mark)
{}

/* We always swallow the packet, whether successful or not, since it's not
 * a network packet and shouldn't ever be forwarded to the stack.
 * @mark is the generation count for counter allocations.
 */
static bool efx_tc_rx(struct efx_rx_queue *rx_queue, u32 mark)
{}

const struct efx_channel_type efx_tc_channel_type =;