dev_dbg(ctrl->dev, "Got id for host route: %d\n", id);
r->attr.valid = false;
priv->r->host_route_write(id, r);
- clear_bit(r->id - MAX_ROUTES, priv->host_route_use_bm);
+ clear_bit(r->id - MAX_ROUTES, ctrl->host_route_use_bm);
} else {
/* If there is a HW representation of the route, delete it */
if (ctrl->cfg->route_lookup_hw) {
mutex_lock(&priv->reg_mutex);
- idx = find_first_zero_bit(priv->host_route_use_bm, MAX_HOST_ROUTES);
+ idx = find_first_zero_bit(ctrl->host_route_use_bm, MAX_HOST_ROUTES);
dev_dbg(ctrl->dev, "id: %d, ip %pI4\n", idx, &ip);
r = kzalloc(sizeof(*r), GFP_KERNEL);
goto out_free;
}
- set_bit(idx, priv->host_route_use_bm);
+ set_bit(idx, ctrl->host_route_use_bm);
mutex_unlock(&priv->reg_mutex);
#include "rtl-otto.h"
+#define MAX_HOST_ROUTES 1536
+
/* An entry in the RTL93XX SoC's ROUTER_MAC tables setting up a termination point
* for the L3 routing system. Packets arriving and matching an entry in this table
* will be considered for routing.
struct notifier_block fib_nb;
struct notifier_block ne_nb;
struct rhltable routes;
+ unsigned long host_route_use_bm[MAX_HOST_ROUTES / 32];
};
struct otto_l3_route_attr {
#define N_FIXED_FIELDS_RTL931X 14
#define MAX_COUNTERS 2048
#define MAX_ROUTES 512
-#define MAX_HOST_ROUTES 1536
#define MAX_INTF_MTUS 8
#define DEFAULT_MTU 1536
#define MAX_INTERFACES 100
unsigned long octet_cntr_use_bm[MAX_COUNTERS >> 5];
unsigned long packet_cntr_use_bm[MAX_COUNTERS >> 4];
unsigned long route_use_bm[MAX_ROUTES >> 5];
- unsigned long host_route_use_bm[MAX_HOST_ROUTES >> 5];
struct rtl838x_l3_intf *interfaces[MAX_INTERFACES];
u16 intf_mtus[MAX_INTF_MTUS];
int intf_mtu_count[MAX_INTF_MTUS];