Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fbcdbf3 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

rocker: move OF-DPA stuff into separate file



Carve out OF-DPA would specific code from the common file to the world
file. This change required struct rocker and struct rocker_port split
into world specific struct ofdpa and struct ofdpa_port. Along with this
the world specific functions and defines were renamed from prefix
"rocker_" to "ofdpa_".

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 53901cc0
Loading
Loading
Loading
Loading
+15 −38
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/hashtable.h>
#include <linux/if_vlan.h>
#include <linux/netdevice.h>
#include <net/neighbour.h>
#include <net/switchdev.h>
@@ -42,34 +40,12 @@ struct rocker_dma_ring_info {

struct rocker;

enum {
	ROCKER_CTRL_LINK_LOCAL_MCAST,
	ROCKER_CTRL_LOCAL_ARP,
	ROCKER_CTRL_IPV4_MCAST,
	ROCKER_CTRL_IPV6_MCAST,
	ROCKER_CTRL_DFLT_BRIDGING,
	ROCKER_CTRL_DFLT_OVS,
	ROCKER_CTRL_MAX,
};

#define ROCKER_INTERNAL_VLAN_ID_BASE	0x0f00
#define ROCKER_N_INTERNAL_VLANS		255
#define ROCKER_VLAN_BITMAP_LEN		BITS_TO_LONGS(VLAN_N_VID)
#define ROCKER_INTERNAL_VLAN_BITMAP_LEN	BITS_TO_LONGS(ROCKER_N_INTERNAL_VLANS)

struct rocker_port {
	struct net_device *dev;
	struct net_device *bridge_dev;
	struct rocker *rocker;
	void *wpriv;
	unsigned int port_number;
	u32 pport;
	__be16 internal_vlan_id;
	int stp_state;
	u32 brport_flags;
	unsigned long ageing_time;
	bool ctrls[ROCKER_CTRL_MAX];
	unsigned long vlan_bitmap[ROCKER_VLAN_BITMAP_LEN];
	struct napi_struct napi_tx;
	struct napi_struct napi_rx;
	struct rocker_dma_ring_info tx_ring;
@@ -92,22 +68,23 @@ struct rocker {
	struct rocker_dma_ring_info event_ring;
	struct rocker_world_ops *wops;
	void *wpriv;
	DECLARE_HASHTABLE(flow_tbl, 16);
	spinlock_t flow_tbl_lock;		/* for flow tbl accesses */
	u64 flow_tbl_next_cookie;
	DECLARE_HASHTABLE(group_tbl, 16);
	spinlock_t group_tbl_lock;		/* for group tbl accesses */
	struct timer_list fdb_cleanup_timer;
	DECLARE_HASHTABLE(fdb_tbl, 16);
	spinlock_t fdb_tbl_lock;		/* for fdb tbl accesses */
	unsigned long internal_vlan_bitmap[ROCKER_INTERNAL_VLAN_BITMAP_LEN];
	DECLARE_HASHTABLE(internal_vlan_tbl, 8);
	spinlock_t internal_vlan_tbl_lock;	/* for vlan tbl accesses */
	DECLARE_HASHTABLE(neigh_tbl, 16);
	spinlock_t neigh_tbl_lock;		/* for neigh tbl accesses */
	u32 neigh_tbl_next_index;
};

typedef int (*rocker_cmd_prep_cb_t)(const struct rocker_port *rocker_port,
				    struct rocker_desc_info *desc_info,
				    void *priv);

typedef int (*rocker_cmd_proc_cb_t)(const struct rocker_port *rocker_port,
				    const struct rocker_desc_info *desc_info,
				    void *priv);

int rocker_cmd_exec(struct rocker_port *rocker_port, bool nowait,
		    rocker_cmd_prep_cb_t prepare, void *prepare_priv,
		    rocker_cmd_proc_cb_t process, void *process_priv);

int rocker_port_set_learning(struct rocker_port *rocker_port,
			     bool learning);

struct rocker_world_ops {
	const char *kind;
	size_t priv_size;
+120 −2953

File changed.

Preview size limit exceeded, changes collapsed.

+2925 −0

File changed.

Preview size limit exceeded, changes collapsed.