Commit b7bd024e authored by Vikram Narayanan's avatar Vikram Narayanan

lcds/smp: Make NUM_LCDS passable via cflags

parent 942dc675
subdir-ccflags-y += -DNUM_LCDS="1"
obj-$(LCD_CONFIG_BUILD_IXGBE_BOOT) += boot/
obj-$(LCD_CONFIG_BUILD_IXGBE_IXGBE_LCD) += ixgbe_lcd/
......
......@@ -20,7 +20,7 @@
/* for multiple child LCDs */
int num_lcds = 1; /* including the parent LCDs */
int num_lcds = NUM_LCDS; /* including the parent LCDs */
int i;
struct lcd_create_ctx **ixgbe_ctxs;
cptr_t *ixgbe_lcds;
......
subdir-ccflags-y += -DNUM_LCDS="2"
obj-$(LCD_CONFIG_BUILD_NULLNET_BOOT) += boot/
obj-$(LCD_CONFIG_BUILD_NULLNET_DUMMY_LCD) += dummy_lcd/
......
......@@ -22,7 +22,7 @@ struct lcd_create_ctx **dummy_ctxs;
cptr_t *dummy_lcds;
cptr_t net_chnl;
cptr_t net_chnl_domain_cptr, dummy_chnl_domain_cptr;
int num_lcds = 2;
int num_lcds = NUM_LCDS;
cptr_t *dummy_chnl_domain_cptrs;
static int boot_main(void)
......
......@@ -13,8 +13,10 @@
struct cptr sync_ep;
static struct glue_cspace *c_cspace;
extern struct thc_channel *net_asyncs[2];
extern struct thc_channel_group ch_grp[2];
extern struct thc_channel *net_asyncs[NUM_LCDS];
extern struct thc_channel_group ch_grp[NUM_LCDS];
extern cptr_t nullnet_sync_endpoints[NUM_LCDS];
extern cptr_t nullnet_register_channels[NUM_LCDS];
struct rtnl_link_ops *g_rtnl_link_ops;
void *data_pool;
......@@ -396,9 +398,6 @@ fail1:
return;
}
extern cptr_t nullnet_sync_endpoints[2];
extern cptr_t nullnet_register_channels[2];
int create_async_channel(void)
{
int ret;
......
......@@ -14,14 +14,14 @@
#include <lcd_config/post_hook.h>
cptr_t nullnet_register_channel;
cptr_t nullnet_register_channels[2];
struct thc_channel *net_asyncs[2];
cptr_t nullnet_register_channels[NUM_LCDS];
struct thc_channel *net_asyncs[NUM_LCDS];
struct glue_cspace *nullnet_cspace;
cptr_t nullnet_sync_endpoints[2];
cptr_t nullnet_sync_endpoints[NUM_LCDS];
int dummy_done = 0;
int dummy_init_module(void);
void dummy_cleanup_module(void);
struct thc_channel_group ch_grp[2];
struct thc_channel_group ch_grp[NUM_LCDS];
bool tdiff_valid = false;
u64 tdiff_disp = 0ull;
......
......@@ -73,8 +73,8 @@ struct rtnl_link_stats64 pkt_stats;
struct glue_cspace *c_cspace;
struct thc_channel *net_async;
struct cptr sync_ep;
cptr_t new_sync_eps[2];
struct thc_channel *lcd_channels[2];
cptr_t new_sync_eps[NUM_LCDS];
struct thc_channel *lcd_channels[NUM_LCDS];
extern struct cspace *klcd_cspace;
struct rtnl_link_ops_container *g_ops_container;
DEFINE_MUTEX(hash_lock);
......@@ -2117,8 +2117,8 @@ int netif_carrier_on_callee(struct fipc_message *request, struct thc_channel *ch
LIBLCD_ERR("error getting response msg");
return -EIO;
}
;
thc_ipc_reply(channel, request_cookie, response);
thc_ipc_reply(channel, request_cookie, response);
fail_lookup:
return ret;
}
......@@ -2159,8 +2159,9 @@ int register_child(void)
__func__, lcd_r1());
lcd_channels[lcd_r1()] = chnl;
g_ndo_start_xmit_hidden_args->lcds[1].lcd_async_chnl = lcd_channels[1];
g_ndo_start_xmit_hidden_args->lcds[1].lcd_sync_ep = new_sync_eps[1];
g_ndo_start_xmit_hidden_args->lcds[lcd_r1()].lcd_async_chnl = lcd_channels[lcd_r1()];
g_ndo_start_xmit_hidden_args->lcds[lcd_r1()].lcd_sync_ep = new_sync_eps[lcd_r1()];
goto out;
......@@ -2428,8 +2429,8 @@ int prep_channel(struct trampoline_hidden_args *hidden_args, int queue)
}
if (queue) {
from_sync_end = hidden_args->lcds[1].lcd_sync_ep;
async_chnl = hidden_args->lcds[1].lcd_async_chnl;
from_sync_end = hidden_args->lcds[queue].lcd_sync_ep;
async_chnl = hidden_args->lcds[queue].lcd_async_chnl;
} else {
from_sync_end = hidden_args->sync_ep;
async_chnl = hidden_args->async_chnl;
......
......@@ -26,7 +26,7 @@ struct trampoline_hidden_args {
struct {
struct thc_channel *lcd_async_chnl;
struct cptr lcd_sync_ep;
} lcds[2];
} lcds[NUM_LCDS];
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment