Skip to content

Commit

Permalink
rocker: move OF-DPA stuff into separate file
Browse files Browse the repository at this point in the history
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: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Feb 18, 2016
1 parent 53901cc commit 3fbcdbf
Show file tree
Hide file tree
Showing 3 changed files with 3,060 additions and 2,991 deletions.
53 changes: 15 additions & 38 deletions drivers/net/ethernet/rocker/rocker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Loading

0 comments on commit 3fbcdbf

Please sign in to comment.