linux/drivers/net/ethernet/marvell/prestera/prestera_devlink.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/* Copyright (c) 2019-2020 Marvell International Ltd. All rights reserved */

#include <net/devlink.h>

#include "prestera_devlink.h"
#include "prestera_hw.h"

/* All driver-specific traps must be documented in
 * Documentation/networking/devlink/prestera.rst
 */
enum {};

#define DEVLINK_PRESTERA_TRAP_NAME_ARP_BC
#define DEVLINK_PRESTERA_TRAP_NAME_IS_IS
#define DEVLINK_PRESTERA_TRAP_NAME_OSPF
#define DEVLINK_PRESTERA_TRAP_NAME_IP_BC_MAC
#define DEVLINK_PRESTERA_TRAP_NAME_ROUTER_MC
#define DEVLINK_PRESTERA_TRAP_NAME_VRRP
#define DEVLINK_PRESTERA_TRAP_NAME_DHCP
#define DEVLINK_PRESTERA_TRAP_NAME_MAC_TO_ME
#define DEVLINK_PRESTERA_TRAP_NAME_IPV4_OPTIONS
#define DEVLINK_PRESTERA_TRAP_NAME_IP_DEFAULT_ROUTE
#define DEVLINK_PRESTERA_TRAP_NAME_IP_TO_ME
#define DEVLINK_PRESTERA_TRAP_NAME_IPV4_ICMP_REDIRECT
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_0
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_1
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_2
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_3
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_4
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_5
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_6
#define DEVLINK_PRESTERA_TRAP_NAME_ACL_CODE_7
#define DEVLINK_PRESTERA_TRAP_NAME_BGP
#define DEVLINK_PRESTERA_TRAP_NAME_SSH
#define DEVLINK_PRESTERA_TRAP_NAME_TELNET
#define DEVLINK_PRESTERA_TRAP_NAME_ICMP
#define DEVLINK_PRESTERA_TRAP_NAME_RXDMA_DROP
#define DEVLINK_PRESTERA_TRAP_NAME_PORT_NO_VLAN
#define DEVLINK_PRESTERA_TRAP_NAME_LOCAL_PORT
#define DEVLINK_PRESTERA_TRAP_NAME_INVALID_SA
#define DEVLINK_PRESTERA_TRAP_NAME_ILLEGAL_IP_ADDR
#define DEVLINK_PRESTERA_TRAP_NAME_ILLEGAL_IPV4_HDR
#define DEVLINK_PRESTERA_TRAP_NAME_IP_UC_DIP_DA_MISMATCH
#define DEVLINK_PRESTERA_TRAP_NAME_IP_SIP_IS_ZERO
#define DEVLINK_PRESTERA_TRAP_NAME_MET_RED

struct prestera_trap {};

struct prestera_trap_item {};

struct prestera_trap_data {};

#define PRESTERA_TRAP_METADATA

#define PRESTERA_TRAP_CONTROL(_id, _group_id, _action)

#define PRESTERA_TRAP_DRIVER_CONTROL(_id, _group_id)

#define PRESTERA_TRAP_EXCEPTION(_id, _group_id)

#define PRESTERA_TRAP_DRIVER_EXCEPTION(_id, _group_id)

#define PRESTERA_TRAP_DRIVER_DROP(_id, _group_id)

static const struct devlink_trap_group prestera_trap_groups_arr[] =;

/* Initialize trap list, as well as associate CPU code with them. */
static struct prestera_trap prestera_trap_items_arr[] =;

static int prestera_drop_counter_get(struct devlink *devlink,
				     const struct devlink_trap *trap,
				     u64 *p_drops);

static int prestera_dl_info_get(struct devlink *dl,
				struct devlink_info_req *req,
				struct netlink_ext_ack *extack)
{}

static int prestera_trap_init(struct devlink *devlink,
			      const struct devlink_trap *trap, void *trap_ctx);

static int prestera_trap_action_set(struct devlink *devlink,
				    const struct devlink_trap *trap,
				    enum devlink_trap_action action,
				    struct netlink_ext_ack *extack);

static const struct devlink_ops prestera_dl_ops =;

struct prestera_switch *prestera_devlink_alloc(struct prestera_device *dev)
{}

void prestera_devlink_free(struct prestera_switch *sw)
{}

void prestera_devlink_register(struct prestera_switch *sw)
{}

void prestera_devlink_unregister(struct prestera_switch *sw)
{}

int prestera_devlink_port_register(struct prestera_port *port)
{}

void prestera_devlink_port_unregister(struct prestera_port *port)
{}

int prestera_devlink_traps_register(struct prestera_switch *sw)
{}

static struct prestera_trap_item *
prestera_get_trap_item_by_cpu_code(struct prestera_switch *sw, u8 cpu_code)
{}

void prestera_devlink_trap_report(struct prestera_port *port,
				  struct sk_buff *skb, u8 cpu_code)
{}

static struct prestera_trap_item *
prestera_devlink_trap_item_lookup(struct prestera_switch *sw, u16 trap_id)
{}

static int prestera_trap_init(struct devlink *devlink,
			      const struct devlink_trap *trap, void *trap_ctx)
{}

static int prestera_trap_action_set(struct devlink *devlink,
				    const struct devlink_trap *trap,
				    enum devlink_trap_action action,
				    struct netlink_ext_ack *extack)
{}

static int prestera_drop_counter_get(struct devlink *devlink,
				     const struct devlink_trap *trap,
				     u64 *p_drops)
{}

void prestera_devlink_traps_unregister(struct prestera_switch *sw)
{}