* Re: [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap num_rx_queues at init time
From: Ben Hutchings @ 2010-10-05 16:34 UTC (permalink / raw)
To: John Fastabend; +Cc: Eric Dumazet, netdev@vger.kernel.org, therbert@google.com
In-Reply-To: <4CAB4D8F.8080108@intel.com>
On Tue, 2010-10-05 at 09:08 -0700, John Fastabend wrote:
> On 10/4/2010 10:35 PM, Eric Dumazet wrote:
> > Le lundi 04 octobre 2010 à 15:00 -0700, John Fastabend a écrit :
> >> The logic for netif_set_real_num_rx_queues is the following,
> >>
> >> netif_set_real_num_rx_queues(dev, rxq)
> >> {
> >> ...
> >> if (dev->reg_state == NETREG_REGISTERED) {
> >> ...
> >> } else {
> >> dev->num_rx_queues = rxq;
> >> }
> >>
> >> dev->real_num_rx_queues = rxq;
> >> return 0;
> >> }
> >>
> >> Some drivers init path looks like the following,
> >>
> >> alloc_etherdev_mq(priv_sz, max_num_queues_ever);
> >> ...
> >> netif_set_real_num_rx_queues(dev, queues_to_use_now);
> >> ...
> >> register_netdev(dev);
> >> ...
> >>
> >> Because netif_set_real_num_rx_queues sets num_rx_queues if the
> >> reg state is not NETREG_REGISTERED we end up with the incorrect
> >> max number of rx queues. This patch proposes to remove the else
> >> clause above so this does not occur. Also just reading the
> >> function set_real_num it seems a bit unexpected that num_rx_queues
> >> gets set.
> >>
> >
> > You dont tell why its "incorrect".
> >
>
> OK that is a poor description.
>
> > Why should we keep num_rx_queues > real_num_rx_queues ?
> >
>
> If we do not ever need them then we should not keep them I agree.
> But having netif_set_real_num_rx_queues set something other then
> 'real_num_rx_queues' does not seem right to me at least. Also
> netif_set_real_num_tx_queues and netif_set_real_num_rx_queues have
> different behavior. It would be nice if this weren't the case but
> they allocate queues in two places.
[...]
I only did this to satisfy Eric's desire to reduce memory usage.
However, I believe that there are currently no drivers that dynamically
increase numbers of RX or TX queues. Until there are, there is not much
point in removing this assignment to num_rx_queues.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* [patch] isdn: strcpy() => strlcpy()
From: Dan Carpenter @ 2010-10-05 16:34 UTC (permalink / raw)
To: Karsten Keil; +Cc: netdev, kernel-janitors
setup.phone and setup.eazmsn are 32 character buffers.
rcvmsg.msg_data.byte_array is a 48 character buffer.
sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn is 50 chars.
I changed the strcpy() so strlcpy() because that's safest.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c
index 485be8b..288073e 100644
--- a/drivers/isdn/sc/interrupt.c
+++ b/drivers/isdn/sc/interrupt.c
@@ -114,9 +114,11 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
{
pr_debug("%s: Got Incoming Call\n",
sc_adapter[card]->devicename);
- strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4]));
- strcpy(setup.eazmsn,
- sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn);
+ strlcpy(setup.phone, &(rcvmsg.msg_data.byte_array[4]),
+ sizeof(setup.phone));
+ strlcpy(setup.eazmsn,
+ sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
+ sizeof(setup.eazmsn));
setup.si1 = 7;
setup.si2 = 0;
setup.plan = 0;
@@ -176,7 +178,9 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
* Handle a GetMyNumber Rsp
*/
if (IS_CE_MESSAGE(rcvmsg,Call,0,GetMyNumber)){
- strcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn,rcvmsg.msg_data.byte_array);
+ strlcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
+ rcvmsg.msg_data.byte_array,
+ sizeof(rcvmsg.msg_data.byte_array));
continue;
}
^ permalink raw reply related
* RE: [RFC] bna: cleanup dead code and namespace issues
From: Debashis Dutt @ 2010-10-05 16:42 UTC (permalink / raw)
To: Stephen Hemminger, Rasesh Mody, David S. Miller; +Cc: netdev@vger.kernel.org
In-Reply-To: <20101005192019.0066e116@s6510>
Stephen,
We are working on your suggestions. We are going through internal review of some of the
cleanups that you suggested.
We will soon submit a patch towards that.
However, converting all the prefixes to the same one, or having some uniformity
may take longer. BTW, the disparity in name-space is because of the fact this code
is for CNA and is shared with the FCoE also.
We are working on addressing this also, by having a common module as suggested
by David earlier.
Thanks
--Debashis
-----Original Message-----
From: Stephen Hemminger [mailto:shemminger@vyatta.com]
Sent: Tuesday, October 05, 2010 3:20 AM
To: Rasesh Mody; Debashis Dutt; David S. Miller
Cc: netdev@vger.kernel.org
Subject: [RFC] bna: cleanup dead code and namespace issues
The new bna driver is full of issues that I found by running
some namespace checks:
1. Lots of dead code relating to RSS and stats clearing
2. Some functions which should be local, especially ones
that risk namespace collision with other code.
3. The table for interrupt control should be declared const.
The driver still is sloppy about namespace prefixes. It uses
bna_, bnad_, bfa_, rxf_, __rxf and cna_ prefixes. Please convert it
to have all variables and functions that are global use only
one prefix.
Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
Patch against net-next-2.6 tree.
drivers/net/bna/bfa_ioc.c | 8
drivers/net/bna/bfa_ioc.h | 1
drivers/net/bna/bfa_ioc_ct.c | 2
drivers/net/bna/bfa_sm.h | 2
drivers/net/bna/bna.h | 108 ----------
drivers/net/bna/bna_ctrl.c | 427 ++++---------------------------------------
drivers/net/bna/bna_hw.h | 1
drivers/net/bna/bna_txrx.c | 108 +++-------
drivers/net/bna/bnad.c | 13 -
drivers/net/bna/cna_fwimg.c | 2
10 files changed, 90 insertions(+), 582 deletions(-)
--- a/drivers/net/bna/bfa_ioc.c 2010-10-05 18:28:08.081647186 +0900
+++ b/drivers/net/bna/bfa_ioc.c 2010-10-05 18:55:15.241670954 +0900
@@ -65,7 +65,7 @@
(!list_empty(&((__ioc)->mbox_mod.cmd_q)) || \
readl((__ioc)->ioc_regs.hfn_mbox_cmd))
-bool bfa_nw_auto_recover = true;
+static bool bfa_nw_auto_recover = true;
/*
* forward declarations
@@ -1276,12 +1276,6 @@ bfa_nw_ioc_auto_recover(bool auto_recove
bfa_nw_auto_recover = auto_recover;
}
-bool
-bfa_nw_ioc_is_operational(struct bfa_ioc *ioc)
-{
- return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_op);
-}
-
static void
bfa_ioc_msgget(struct bfa_ioc *ioc, void *mbmsg)
{
--- a/drivers/net/bna/bfa_ioc_ct.c 2010-10-05 18:28:08.105640040 +0900
+++ b/drivers/net/bna/bfa_ioc_ct.c 2010-10-05 18:35:37.373640864 +0900
@@ -34,7 +34,7 @@ static void bfa_ioc_ct_notify_hbfail(str
static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode);
-struct bfa_ioc_hwif nw_hwif_ct;
+static struct bfa_ioc_hwif nw_hwif_ct;
/**
* Called from bfa_ioc_attach() to map asic specific calls.
--- a/drivers/net/bna/bna.h 2010-10-05 18:33:24.969649777 +0900
+++ b/drivers/net/bna/bna.h 2010-10-05 19:14:12.306169796 +0900
@@ -19,8 +19,7 @@
#include "bfi_ll.h"
#include "bna_types.h"
-extern u32 bna_dim_vector[][BNA_BIAS_T_MAX];
-extern u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];
+extern const u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];
/**
*
@@ -344,9 +343,6 @@ do { \
* BNA
*/
-/* Internal APIs */
-void bna_adv_res_req(struct bna_res_info *res_info);
-
/* APIs for BNAD */
void bna_res_req(struct bna_res_info *res_info);
void bna_init(struct bna *bna, struct bnad *bnad,
@@ -354,7 +350,6 @@ void bna_init(struct bna *bna, struct bn
struct bna_res_info *res_info);
void bna_uninit(struct bna *bna);
void bna_stats_get(struct bna *bna);
-void bna_stats_clr(struct bna *bna);
void bna_get_perm_mac(struct bna *bna, u8 *mac);
/* APIs for Rx */
@@ -376,18 +371,6 @@ void bna_rit_mod_seg_put(struct bna_rit_
* DEVICE
*/
-/* Interanl APIs */
-void bna_adv_device_init(struct bna_device *device, struct bna *bna,
- struct bna_res_info *res_info);
-
-/* APIs for BNA */
-void bna_device_init(struct bna_device *device, struct bna *bna,
- struct bna_res_info *res_info);
-void bna_device_uninit(struct bna_device *device);
-void bna_device_cb_port_stopped(void *arg, enum bna_cb_status status);
-int bna_device_status_get(struct bna_device *device);
-int bna_device_state_get(struct bna_device *device);
-
/* APIs for BNAD */
void bna_device_enable(struct bna_device *device);
void bna_device_disable(struct bna_device *device,
@@ -397,12 +380,6 @@ void bna_device_disable(struct bna_devic
* MBOX
*/
-/* APIs for DEVICE */
-void bna_mbox_mod_init(struct bna_mbox_mod *mbox_mod, struct bna *bna);
-void bna_mbox_mod_uninit(struct bna_mbox_mod *mbox_mod);
-void bna_mbox_mod_start(struct bna_mbox_mod *mbox_mod);
-void bna_mbox_mod_stop(struct bna_mbox_mod *mbox_mod);
-
/* APIs for PORT, TX, RX */
void bna_mbox_handler(struct bna *bna, u32 intr_status);
void bna_mbox_send(struct bna *bna, struct bna_mbox_qe *mbox_qe);
@@ -411,17 +388,6 @@ void bna_mbox_send(struct bna *bna, stru
* PORT
*/
-/* APIs for BNA */
-void bna_port_init(struct bna_port *port, struct bna *bna);
-void bna_port_uninit(struct bna_port *port);
-int bna_port_state_get(struct bna_port *port);
-int bna_llport_state_get(struct bna_llport *llport);
-
-/* APIs for DEVICE */
-void bna_port_start(struct bna_port *port);
-void bna_port_stop(struct bna_port *port);
-void bna_port_fail(struct bna_port *port);
-
/* API for RX */
int bna_port_mtu_get(struct bna_port *port);
void bna_llport_admin_up(struct bna_llport *llport);
@@ -437,12 +403,6 @@ void bna_port_pause_config(struct bna_po
void bna_port_mtu_set(struct bna_port *port, int mtu,
void (*cbfn)(struct bnad *, enum bna_cb_status));
void bna_port_mac_get(struct bna_port *port, mac_t *mac);
-void bna_port_type_set(struct bna_port *port, enum bna_port_type type);
-void bna_port_linkcbfn_set(struct bna_port *port,
- void (*linkcbfn)(struct bnad *,
- enum bna_link_status));
-void bna_port_admin_up(struct bna_port *port);
-void bna_port_admin_down(struct bna_port *port);
/* Callbacks for TX, RX */
void bna_port_cb_tx_stopped(struct bna_port *port,
@@ -450,11 +410,6 @@ void bna_port_cb_tx_stopped(struct bna_p
void bna_port_cb_rx_stopped(struct bna_port *port,
enum bna_cb_status status);
-/* Callbacks for MBOX */
-void bna_port_cb_link_up(struct bna_port *port, struct bfi_ll_aen *aen,
- int status);
-void bna_port_cb_link_down(struct bna_port *port, int status);
-
/**
* IB
*/
@@ -464,25 +419,10 @@ void bna_ib_mod_init(struct bna_ib_mod *
struct bna_res_info *res_info);
void bna_ib_mod_uninit(struct bna_ib_mod *ib_mod);
-/* APIs for TX, RX */
-struct bna_ib *bna_ib_get(struct bna_ib_mod *ib_mod,
- enum bna_intr_type intr_type, int vector);
-void bna_ib_put(struct bna_ib_mod *ib_mod, struct bna_ib *ib);
-int bna_ib_reserve_idx(struct bna_ib *ib);
-void bna_ib_release_idx(struct bna_ib *ib, int idx);
-int bna_ib_config(struct bna_ib *ib, struct bna_ib_config *ib_config);
-void bna_ib_start(struct bna_ib *ib);
-void bna_ib_stop(struct bna_ib *ib);
-void bna_ib_fail(struct bna_ib *ib);
-void bna_ib_coalescing_timeo_set(struct bna_ib *ib, u8 coalescing_timeo);
-
/**
* TX MODULE AND TX
*/
-/* Internal APIs */
-void bna_tx_prio_changed(struct bna_tx *tx, int prio);
-
/* APIs for BNA */
void bna_tx_mod_init(struct bna_tx_mod *tx_mod, struct bna *bna,
struct bna_res_info *res_info);
@@ -508,10 +448,6 @@ void bna_tx_enable(struct bna_tx *tx);
void bna_tx_disable(struct bna_tx *tx, enum bna_cleanup_type type,
void (*cbfn)(void *, struct bna_tx *,
enum bna_cb_status));
-enum bna_cb_status
-bna_tx_prio_set(struct bna_tx *tx, int prio,
- void (*cbfn)(struct bnad *, struct bna_tx *,
- enum bna_cb_status));
void bna_tx_coalescing_timeo_set(struct bna_tx *tx, int coalescing_timeo);
/**
@@ -564,35 +500,20 @@ void bna_rx_disable(struct bna_rx *rx, e
void (*cbfn)(void *, struct bna_rx *,
enum bna_cb_status));
void bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo);
-void bna_rx_dim_reconfig(struct bna *bna, u32 vector[][BNA_BIAS_T_MAX]);
+void bna_rx_dim_reconfig(struct bna *bna, const u32 vector[][BNA_BIAS_T_MAX]);
void bna_rx_dim_update(struct bna_ccb *ccb);
enum bna_cb_status
bna_rx_ucast_set(struct bna_rx *rx, u8 *ucmac,
void (*cbfn)(struct bnad *, struct bna_rx *,
enum bna_cb_status));
enum bna_cb_status
-bna_rx_ucast_add(struct bna_rx *rx, u8* ucmac,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status));
-enum bna_cb_status
-bna_rx_ucast_del(struct bna_rx *rx, u8 *ucmac,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status));
-enum bna_cb_status
bna_rx_mcast_add(struct bna_rx *rx, u8 *mcmac,
void (*cbfn)(struct bnad *, struct bna_rx *,
enum bna_cb_status));
enum bna_cb_status
-bna_rx_mcast_del(struct bna_rx *rx, u8 *mcmac,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status));
-enum bna_cb_status
bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mcmac,
void (*cbfn)(struct bnad *, struct bna_rx *,
enum bna_cb_status));
-void bna_rx_mcast_delall(struct bna_rx *rx,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status));
enum bna_cb_status
bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode rxmode,
enum bna_rxmode bitmask,
@@ -601,37 +522,12 @@ bna_rx_mode_set(struct bna_rx *rx, enum
void bna_rx_vlan_add(struct bna_rx *rx, int vlan_id);
void bna_rx_vlan_del(struct bna_rx *rx, int vlan_id);
void bna_rx_vlanfilter_enable(struct bna_rx *rx);
-void bna_rx_vlanfilter_disable(struct bna_rx *rx);
-void bna_rx_rss_enable(struct bna_rx *rx);
-void bna_rx_rss_disable(struct bna_rx *rx);
-void bna_rx_rss_reconfig(struct bna_rx *rx, struct bna_rxf_rss *rss_config);
-void bna_rx_rss_rit_set(struct bna_rx *rx, unsigned int *vectors,
- int nvectors);
void bna_rx_hds_enable(struct bna_rx *rx, struct bna_rxf_hds *hds_config,
void (*cbfn)(struct bnad *, struct bna_rx *,
enum bna_cb_status));
void bna_rx_hds_disable(struct bna_rx *rx,
void (*cbfn)(struct bnad *, struct bna_rx *,
enum bna_cb_status));
-void bna_rx_receive_pause(struct bna_rx *rx,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status));
-void bna_rx_receive_resume(struct bna_rx *rx,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status));
-
-/* RxF APIs for RX */
-void bna_rxf_start(struct bna_rxf *rxf);
-void bna_rxf_stop(struct bna_rxf *rxf);
-void bna_rxf_fail(struct bna_rxf *rxf);
-void bna_rxf_init(struct bna_rxf *rxf, struct bna_rx *rx,
- struct bna_rx_config *q_config);
-void bna_rxf_uninit(struct bna_rxf *rxf);
-
-/* Callback from RXF to RX */
-void bna_rx_cb_rxf_stopped(struct bna_rx *rx, enum bna_cb_status);
-void bna_rx_cb_rxf_started(struct bna_rx *rx, enum bna_cb_status);
-
/**
* BNAD
*/
--- a/drivers/net/bna/bna_ctrl.c 2010-10-05 18:28:08.125665071 +0900
+++ b/drivers/net/bna/bna_ctrl.c 2010-10-05 19:17:51.037641382 +0900
@@ -19,6 +19,13 @@
#include "bfa_sm.h"
#include "bfa_wc.h"
+static void bna_device_cb_port_stopped(void *arg, enum bna_cb_status status);
+static void bna_adv_device_init(struct bna_device *device, struct bna *bna,
+ struct bna_res_info *res_info);
+static void bna_port_cb_link_up(struct bna_port *port, struct bfi_ll_aen *aen,
+ int status);
+static void bna_port_cb_link_down(struct bna_port *port, int status);
+
/**
* MBOX
*/
@@ -96,7 +103,7 @@ bna_ll_isr(void *llarg, struct bfi_mbmsg
bna_mbox_aen_callback(bna, msg);
}
-void
+static void
bna_err_handler(struct bna *bna, u32 intr_status)
{
u32 init_halt;
@@ -140,7 +147,7 @@ bna_mbox_send(struct bna *bna, struct bn
}
}
-void
+static void
bna_mbox_flush_q(struct bna *bna, struct list_head *q)
{
struct bna_mbox_qe *mb_qe = NULL;
@@ -166,18 +173,18 @@ bna_mbox_flush_q(struct bna *bna, struct
bna->mbox_mod.state = BNA_MBOX_FREE;
}
-void
+static void
bna_mbox_mod_start(struct bna_mbox_mod *mbox_mod)
{
}
-void
+static void
bna_mbox_mod_stop(struct bna_mbox_mod *mbox_mod)
{
bna_mbox_flush_q(mbox_mod->bna, &mbox_mod->posted_q);
}
-void
+static void
bna_mbox_mod_init(struct bna_mbox_mod *mbox_mod, struct bna *bna)
{
bfa_nw_ioc_mbox_regisr(&bna->device.ioc, BFI_MC_LL, bna_ll_isr, bna);
@@ -187,7 +194,7 @@ bna_mbox_mod_init(struct bna_mbox_mod *m
mbox_mod->bna = bna;
}
-void
+static void
bna_mbox_mod_uninit(struct bna_mbox_mod *mbox_mod)
{
mbox_mod->bna = NULL;
@@ -538,7 +545,7 @@ bna_fw_cb_llport_down(void *arg, int sta
bfa_fsm_send_event(llport, LLPORT_E_FWRESP_DOWN);
}
-void
+static void
bna_port_cb_llport_stopped(struct bna_port *port,
enum bna_cb_status status)
{
@@ -591,7 +598,7 @@ bna_llport_fail(struct bna_llport *llpor
bfa_fsm_send_event(llport, LLPORT_E_FAIL);
}
-int
+static int
bna_llport_state_get(struct bna_llport *llport)
{
return bfa_sm_to_state(llport_sm_table, llport->fsm);
@@ -1109,7 +1116,7 @@ bna_port_cb_chld_stopped(void *arg)
bfa_fsm_send_event(port, PORT_E_CHLD_STOPPED);
}
-void
+static void
bna_port_init(struct bna_port *port, struct bna *bna)
{
port->bna = bna;
@@ -1137,7 +1144,7 @@ bna_port_init(struct bna_port *port, str
bna_llport_init(&port->llport, bna);
}
-void
+static void
bna_port_uninit(struct bna_port *port)
{
bna_llport_uninit(&port->llport);
@@ -1147,13 +1154,13 @@ bna_port_uninit(struct bna_port *port)
port->bna = NULL;
}
-int
+static int
bna_port_state_get(struct bna_port *port)
{
return bfa_sm_to_state(port_sm_table, port->fsm);
}
-void
+static void
bna_port_start(struct bna_port *port)
{
port->flags |= BNA_PORT_F_DEVICE_READY;
@@ -1161,7 +1168,7 @@ bna_port_start(struct bna_port *port)
bfa_fsm_send_event(port, PORT_E_START);
}
-void
+static void
bna_port_stop(struct bna_port *port)
{
port->stop_cbfn = bna_device_cb_port_stopped;
@@ -1171,7 +1178,7 @@ bna_port_stop(struct bna_port *port)
bfa_fsm_send_event(port, PORT_E_STOP);
}
-void
+static void
bna_port_fail(struct bna_port *port)
{
port->flags &= ~BNA_PORT_F_DEVICE_READY;
@@ -1190,7 +1197,7 @@ bna_port_cb_rx_stopped(struct bna_port *
bfa_wc_down(&port->chld_stop_wc);
}
-void
+static void
bna_port_cb_link_up(struct bna_port *port, struct bfi_ll_aen *aen,
int status)
{
@@ -1218,7 +1225,7 @@ bna_port_cb_link_up(struct bna_port *por
port->link_cbfn(port->bna->bnad, port->llport.link_status);
}
-void
+static void
bna_port_cb_link_down(struct bna_port *port, int status)
{
port->llport.link_status = BNA_LINK_DOWN;
@@ -1293,54 +1300,6 @@ bna_port_mac_get(struct bna_port *port,
}
/**
- * Should be called only when port is disabled
- */
-void
-bna_port_type_set(struct bna_port *port, enum bna_port_type type)
-{
- port->type = type;
- port->llport.type = type;
-}
-
-/**
- * Should be called only when port is disabled
- */
-void
-bna_port_linkcbfn_set(struct bna_port *port,
- void (*linkcbfn)(struct bnad *, enum bna_link_status))
-{
- port->link_cbfn = linkcbfn;
-}
-
-void
-bna_port_admin_up(struct bna_port *port)
-{
- struct bna_llport *llport = &port->llport;
-
- if (llport->flags & BNA_LLPORT_F_ENABLED)
- return;
-
- llport->flags |= BNA_LLPORT_F_ENABLED;
-
- if (llport->flags & BNA_LLPORT_F_RX_ENABLED)
- bfa_fsm_send_event(llport, LLPORT_E_UP);
-}
-
-void
-bna_port_admin_down(struct bna_port *port)
-{
- struct bna_llport *llport = &port->llport;
-
- if (!(llport->flags & BNA_LLPORT_F_ENABLED))
- return;
-
- llport->flags &= ~BNA_LLPORT_F_ENABLED;
-
- if (llport->flags & BNA_LLPORT_F_RX_ENABLED)
- bfa_fsm_send_event(llport, LLPORT_E_DOWN);
-}
-
-/**
* DEVICE
*/
#define enable_mbox_intr(_device)\
@@ -1357,7 +1316,7 @@ do {\
bnad_cb_device_disable_mbox_intr((_device)->bna->bnad);\
} while (0)
-const struct bna_chip_regs_offset reg_offset[] =
+static const struct bna_chip_regs_offset reg_offset[] =
{{HOST_PAGE_NUM_FN0, HOSTFN0_INT_STATUS,
HOSTFN0_INT_MASK, HOST_MSIX_ERR_INDEX_FN0},
{HOST_PAGE_NUM_FN1, HOSTFN1_INT_STATUS,
@@ -1642,7 +1601,7 @@ static struct bfa_ioc_cbfn bfa_iocll_cbf
bna_device_cb_iocll_reset
};
-void
+static void
bna_device_init(struct bna_device *device, struct bna *bna,
struct bna_res_info *res_info)
{
@@ -1681,7 +1640,7 @@ bna_device_init(struct bna_device *devic
bfa_fsm_set_state(device, bna_device_sm_stopped);
}
-void
+static void
bna_device_uninit(struct bna_device *device)
{
bna_mbox_mod_uninit(&device->bna->mbox_mod);
@@ -1691,7 +1650,7 @@ bna_device_uninit(struct bna_device *dev
device->bna = NULL;
}
-void
+static void
bna_device_cb_port_stopped(void *arg, enum bna_cb_status status)
{
struct bna_device *device = (struct bna_device *)arg;
@@ -1699,7 +1658,7 @@ bna_device_cb_port_stopped(void *arg, en
bfa_fsm_send_event(device, DEVICE_E_PORT_STOPPED);
}
-int
+static int
bna_device_status_get(struct bna_device *device)
{
return device->fsm == (bfa_fsm_t)bna_device_sm_ready;
@@ -1733,13 +1692,13 @@ bna_device_disable(struct bna_device *de
bfa_fsm_send_event(device, DEVICE_E_DISABLE);
}
-int
+static int
bna_device_state_get(struct bna_device *device)
{
return bfa_sm_to_state(device_sm_table, device->fsm);
}
-u32 bna_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
+static const u32 bna_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
{12, 20},
{10, 18},
{8, 16},
@@ -1750,7 +1709,7 @@ u32 bna_dim_vector[BNA_LOAD_T_MAX][BNA_B
{1, 2},
};
-u32 bna_napi_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
+const u32 bna_napi_dim_vector[BNA_LOAD_T_MAX][BNA_BIAS_T_MAX] = {
{12, 12},
{6, 10},
{5, 10},
@@ -1762,7 +1721,7 @@ u32 bna_napi_dim_vector[BNA_LOAD_T_MAX][
};
/* device */
-void
+static void
bna_adv_device_init(struct bna_device *device, struct bna *bna,
struct bna_res_info *res_info)
{
@@ -1790,7 +1749,7 @@ bna_adv_device_init(struct bna_device *d
/* utils */
-void
+static void
bna_adv_res_req(struct bna_res_info *res_info)
{
/* DMA memory for COMMON_MODULE */
@@ -2044,36 +2003,6 @@ bna_fw_stats_get(struct bna *bna)
bna->stats.txf_bmap[1] = bna->tx_mod.txf_bmap[1];
}
-static void
-bna_fw_cb_stats_clr(void *arg, int status)
-{
- struct bna *bna = (struct bna *)arg;
-
- bfa_q_qe_init(&bna->mbox_qe.qe);
-
- memset(bna->stats.sw_stats, 0, sizeof(struct bna_sw_stats));
- memset(bna->stats.hw_stats, 0, sizeof(struct bfi_ll_stats));
-
- bnad_cb_stats_clr(bna->bnad);
-}
-
-static void
-bna_fw_stats_clr(struct bna *bna)
-{
- struct bfi_ll_stats_req ll_req;
-
- bfi_h2i_set(ll_req.mh, BFI_MC_LL, BFI_LL_H2I_STATS_CLEAR_REQ, 0);
- ll_req.stats_mask = htons(BFI_LL_STATS_ALL);
- ll_req.rxf_id_mask[0] = htonl(0xffffffff);
- ll_req.rxf_id_mask[1] = htonl(0xffffffff);
- ll_req.txf_id_mask[0] = htonl(0xffffffff);
- ll_req.txf_id_mask[1] = htonl(0xffffffff);
-
- bna_mbox_qe_fill(&bna->mbox_qe, &ll_req, sizeof(ll_req),
- bna_fw_cb_stats_clr, bna);
- bna_mbox_send(bna, &bna->mbox_qe);
-}
-
void
bna_stats_get(struct bna *bna)
{
@@ -2083,22 +2012,8 @@ bna_stats_get(struct bna *bna)
bnad_cb_stats_get(bna->bnad, BNA_CB_FAIL, &bna->stats);
}
-void
-bna_stats_clr(struct bna *bna)
-{
- if (bna_device_status_get(&bna->device))
- bna_fw_stats_clr(bna);
- else {
- memset(&bna->stats.sw_stats, 0,
- sizeof(struct bna_sw_stats));
- memset(bna->stats.hw_stats, 0,
- sizeof(struct bfi_ll_stats));
- bnad_cb_stats_clr(bna->bnad);
- }
-}
-
/* IB */
-void
+static void
bna_ib_coalescing_timeo_set(struct bna_ib *ib, u8 coalescing_timeo)
{
ib->ib_config.coalescing_timeo = coalescing_timeo;
@@ -2157,7 +2072,7 @@ rxf_fltr_mbox_cmd(struct bna_rxf *rxf, u
bna_mbox_send(rxf->rx->bna, &rxf->mbox_qe);
}
-void
+static void
__rxf_default_function_config(struct bna_rxf *rxf, enum bna_status status)
{
struct bna_rx_fndb_ram *rx_fndb_ram;
@@ -2553,7 +2468,7 @@ rxf_reset_packet_filter_allmulti(struct
* 0 = no h/w change
* 1 = need h/w change
*/
-int
+static int
rxf_promisc_enable(struct bna_rxf *rxf)
{
struct bna *bna = rxf->rx->bna;
@@ -2584,7 +2499,7 @@ rxf_promisc_enable(struct bna_rxf *rxf)
* 0 = no h/w change
* 1 = need h/w change
*/
-int
+static int
rxf_promisc_disable(struct bna_rxf *rxf)
{
struct bna *bna = rxf->rx->bna;
@@ -2623,7 +2538,7 @@ rxf_promisc_disable(struct bna_rxf *rxf)
* 0 = no h/w change
* 1 = need h/w change
*/
-int
+static int
rxf_default_enable(struct bna_rxf *rxf)
{
struct bna *bna = rxf->rx->bna;
@@ -2654,7 +2569,7 @@ rxf_default_enable(struct bna_rxf *rxf)
* 0 = no h/w change
* 1 = need h/w change
*/
-int
+static int
rxf_default_disable(struct bna_rxf *rxf)
{
struct bna *bna = rxf->rx->bna;
@@ -2693,7 +2608,7 @@ rxf_default_disable(struct bna_rxf *rxf)
* 0 = no h/w change
* 1 = need h/w change
*/
-int
+static int
rxf_allmulti_enable(struct bna_rxf *rxf)
{
int ret = 0;
@@ -2721,7 +2636,7 @@ rxf_allmulti_enable(struct bna_rxf *rxf)
* 0 = no h/w change
* 1 = need h/w change
*/
-int
+static int
rxf_allmulti_disable(struct bna_rxf *rxf)
{
int ret = 0;
@@ -2745,158 +2660,7 @@ rxf_allmulti_disable(struct bna_rxf *rxf
return ret;
}
-/* RxF <- bnad */
-void
-bna_rx_mcast_delall(struct bna_rx *rx,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status))
-{
- struct bna_rxf *rxf = &rx->rxf;
- struct list_head *qe;
- struct bna_mac *mac;
- int need_hw_config = 0;
- /* Purge all entries from pending_add_q */
- while (!list_empty(&rxf->mcast_pending_add_q)) {
- bfa_q_deq(&rxf->mcast_pending_add_q, &qe);
- mac = (struct bna_mac *)qe;
- bfa_q_qe_init(&mac->qe);
- bna_mcam_mod_mac_put(&rxf->rx->bna->mcam_mod, mac);
- }
-
- /* Schedule all entries in active_q for deletion */
- while (!list_empty(&rxf->mcast_active_q)) {
- bfa_q_deq(&rxf->mcast_active_q, &qe);
- mac = (struct bna_mac *)qe;
- bfa_q_qe_init(&mac->qe);
- list_add_tail(&mac->qe, &rxf->mcast_pending_del_q);
- need_hw_config = 1;
- }
-
- if (need_hw_config) {
- rxf->cam_fltr_cbfn = cbfn;
- rxf->cam_fltr_cbarg = rx->bna->bnad;
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
- return;
- }
-
- if (cbfn)
- (*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-}
-
-/* RxF <- Rx */
-void
-bna_rx_receive_resume(struct bna_rx *rx,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status))
-{
- struct bna_rxf *rxf = &rx->rxf;
-
- if (rxf->rxf_oper_state == BNA_RXF_OPER_STATE_PAUSED) {
- rxf->oper_state_cbfn = cbfn;
- rxf->oper_state_cbarg = rx->bna->bnad;
- bfa_fsm_send_event(rxf, RXF_E_RESUME);
- } else if (cbfn)
- (*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-}
-
-void
-bna_rx_receive_pause(struct bna_rx *rx,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status))
-{
- struct bna_rxf *rxf = &rx->rxf;
-
- if (rxf->rxf_oper_state == BNA_RXF_OPER_STATE_RUNNING) {
- rxf->oper_state_cbfn = cbfn;
- rxf->oper_state_cbarg = rx->bna->bnad;
- bfa_fsm_send_event(rxf, RXF_E_PAUSE);
- } else if (cbfn)
- (*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
-}
-
-/* RxF <- bnad */
-enum bna_cb_status
-bna_rx_ucast_add(struct bna_rx *rx, u8 *addr,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status))
-{
- struct bna_rxf *rxf = &rx->rxf;
- struct list_head *qe;
- struct bna_mac *mac;
-
- /* Check if already added */
- list_for_each(qe, &rxf->ucast_active_q) {
- mac = (struct bna_mac *)qe;
- if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
- if (cbfn)
- (*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
- return BNA_CB_SUCCESS;
- }
- }
-
- /* Check if pending addition */
- list_for_each(qe, &rxf->ucast_pending_add_q) {
- mac = (struct bna_mac *)qe;
- if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
- if (cbfn)
- (*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
- return BNA_CB_SUCCESS;
- }
- }
-
- mac = bna_ucam_mod_mac_get(&rxf->rx->bna->ucam_mod);
- if (mac == NULL)
- return BNA_CB_UCAST_CAM_FULL;
- bfa_q_qe_init(&mac->qe);
- memcpy(mac->addr, addr, ETH_ALEN);
- list_add_tail(&mac->qe, &rxf->ucast_pending_add_q);
-
- rxf->cam_fltr_cbfn = cbfn;
- rxf->cam_fltr_cbarg = rx->bna->bnad;
-
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-
- return BNA_CB_SUCCESS;
-}
-
-/* RxF <- bnad */
-enum bna_cb_status
-bna_rx_ucast_del(struct bna_rx *rx, u8 *addr,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status))
-{
- struct bna_rxf *rxf = &rx->rxf;
- struct list_head *qe;
- struct bna_mac *mac;
-
- list_for_each(qe, &rxf->ucast_pending_add_q) {
- mac = (struct bna_mac *)qe;
- if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
- list_del(qe);
- bfa_q_qe_init(qe);
- bna_ucam_mod_mac_put(&rxf->rx->bna->ucam_mod, mac);
- if (cbfn)
- (*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
- return BNA_CB_SUCCESS;
- }
- }
-
- list_for_each(qe, &rxf->ucast_active_q) {
- mac = (struct bna_mac *)qe;
- if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
- list_del(qe);
- bfa_q_qe_init(qe);
- list_add_tail(qe, &rxf->ucast_pending_del_q);
- rxf->cam_fltr_cbfn = cbfn;
- rxf->cam_fltr_cbarg = rx->bna->bnad;
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
- return BNA_CB_SUCCESS;
- }
- }
-
- return BNA_CB_INVALID_MAC;
-}
/* RxF <- bnad */
enum bna_cb_status
@@ -2978,38 +2742,6 @@ err_return:
return BNA_CB_FAIL;
}
-/* RxF <- bnad */
-void
-bna_rx_rss_enable(struct bna_rx *rx)
-{
- struct bna_rxf *rxf = &rx->rxf;
-
- rxf->rxf_flags |= BNA_RXF_FL_RSS_CONFIG_PENDING;
- rxf->rss_status = BNA_STATUS_T_ENABLED;
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-}
-
-/* RxF <- bnad */
-void
-bna_rx_rss_disable(struct bna_rx *rx)
-{
- struct bna_rxf *rxf = &rx->rxf;
-
- rxf->rxf_flags |= BNA_RXF_FL_RSS_CONFIG_PENDING;
- rxf->rss_status = BNA_STATUS_T_DISABLED;
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-}
-
-/* RxF <- bnad */
-void
-bna_rx_rss_reconfig(struct bna_rx *rx, struct bna_rxf_rss *rss_config)
-{
- struct bna_rxf *rxf = &rx->rxf;
- rxf->rxf_flags |= BNA_RXF_FL_RSS_CONFIG_PENDING;
- rxf->rss_status = BNA_STATUS_T_ENABLED;
- rxf->rss_cfg = *rss_config;
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
-}
void
/* RxF <- bnad */
@@ -3024,68 +2756,8 @@ bna_rx_vlanfilter_enable(struct bna_rx *
}
}
-/* RxF <- bnad */
-void
-bna_rx_vlanfilter_disable(struct bna_rx *rx)
-{
- struct bna_rxf *rxf = &rx->rxf;
-
- if (rxf->vlan_filter_status == BNA_STATUS_T_ENABLED) {
- rxf->rxf_flags |= BNA_RXF_FL_VLAN_CONFIG_PENDING;
- rxf->vlan_filter_status = BNA_STATUS_T_DISABLED;
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
- }
-}
-
/* Rx */
-struct bna_rxp *
-bna_rx_get_rxp(struct bna_rx *rx, int vector)
-{
- struct bna_rxp *rxp;
- struct list_head *qe;
-
- list_for_each(qe, &rx->rxp_q) {
- rxp = (struct bna_rxp *)qe;
- if (rxp->vector == vector)
- return rxp;
- }
- return NULL;
-}
-
-/*
- * bna_rx_rss_rit_set()
- * Sets the Q ids for the specified msi-x vectors in the RIT.
- * Maximum rit size supported is 64, which should be the max size of the
- * vectors array.
- */
-
-void
-bna_rx_rss_rit_set(struct bna_rx *rx, unsigned int *vectors, int nvectors)
-{
- int i;
- struct bna_rxp *rxp;
- struct bna_rxq *q0 = NULL, *q1 = NULL;
- struct bna *bna;
- struct bna_rxf *rxf;
-
- /* Build the RIT contents for this RX */
- bna = rx->bna;
-
- rxf = &rx->rxf;
- for (i = 0; i < nvectors; i++) {
- rxp = bna_rx_get_rxp(rx, vectors[i]);
-
- GET_RXQS(rxp, q0, q1);
- rxf->rit_segment->rit[i].large_rxq_id = q0->rxq_id;
- rxf->rit_segment->rit[i].small_rxq_id = (q1 ? q1->rxq_id : 0);
- }
-
- rxf->rit_segment->rit_size = nvectors;
-
- /* Subsequent call to enable/reconfig RSS will update the RIT in h/w */
-}
-
/* Rx <- bnad */
void
bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo)
@@ -3102,7 +2774,7 @@ bna_rx_coalescing_timeo_set(struct bna_r
/* Rx <- bnad */
void
-bna_rx_dim_reconfig(struct bna *bna, u32 vector[][BNA_BIAS_T_MAX])
+bna_rx_dim_reconfig(struct bna *bna, const u32 vector[][BNA_BIAS_T_MAX])
{
int i, j;
@@ -3164,21 +2836,6 @@ bna_rx_dim_update(struct bna_ccb *ccb)
}
/* Tx */
-/* TX <- bnad */
-enum bna_cb_status
-bna_tx_prio_set(struct bna_tx *tx, int prio,
- void (*cbfn)(struct bnad *, struct bna_tx *,
- enum bna_cb_status))
-{
- if (tx->flags & BNA_TX_F_PRIO_LOCK)
- return BNA_CB_FAIL;
- else {
- tx->prio_change_cbfn = cbfn;
- bna_tx_prio_changed(tx, prio);
- }
-
- return BNA_CB_SUCCESS;
-}
/* TX <- bnad */
void
--- a/drivers/net/bna/bna_hw.h 2010-10-05 18:45:27.577646257 +0900
+++ b/drivers/net/bna/bna_hw.h 2010-10-05 18:45:32.957640709 +0900
@@ -1282,7 +1282,6 @@ struct bna_chip_regs_offset {
u32 fn_int_mask;
u32 msix_idx;
};
-extern const struct bna_chip_regs_offset reg_offset[];
struct bna_chip_regs {
void __iomem *page_addr;
--- a/drivers/net/bna/bna_txrx.c 2010-10-05 18:28:08.141648599 +0900
+++ b/drivers/net/bna/bna_txrx.c 2010-10-05 19:17:57.785641486 +0900
@@ -59,6 +59,10 @@ struct bna_ibidx_pool {
};
init_ibidx_pool(ibidx_pool);
+/* Callback from RXF to RX */
+static void bna_rx_cb_rxf_stopped(struct bna_rx *rx, enum bna_cb_status);
+static void bna_rx_cb_rxf_started(struct bna_rx *rx, enum bna_cb_status);
+
static struct bna_intr *
bna_intr_get(struct bna_ib_mod *ib_mod, enum bna_intr_type intr_type,
int vector)
@@ -195,7 +199,7 @@ bna_ib_mod_uninit(struct bna_ib_mod *ib_
ib_mod->bna = NULL;
}
-struct bna_ib *
+static struct bna_ib *
bna_ib_get(struct bna_ib_mod *ib_mod,
enum bna_intr_type intr_type,
int vector)
@@ -240,7 +244,7 @@ bna_ib_get(struct bna_ib_mod *ib_mod,
return ib;
}
-void
+static void
bna_ib_put(struct bna_ib_mod *ib_mod, struct bna_ib *ib)
{
bna_intr_put(ib_mod, ib->intr);
@@ -255,7 +259,7 @@ bna_ib_put(struct bna_ib_mod *ib_mod, st
}
/* Returns index offset - starting from 0 */
-int
+static int
bna_ib_reserve_idx(struct bna_ib *ib)
{
struct bna_ib_mod *ib_mod = &ib->bna->ib_mod;
@@ -309,7 +313,7 @@ bna_ib_reserve_idx(struct bna_ib *ib)
return idx;
}
-void
+static void
bna_ib_release_idx(struct bna_ib *ib, int idx)
{
struct bna_ib_mod *ib_mod = &ib->bna->ib_mod;
@@ -356,7 +360,7 @@ bna_ib_release_idx(struct bna_ib *ib, in
}
}
-int
+static int
bna_ib_config(struct bna_ib *ib, struct bna_ib_config *ib_config)
{
if (ib->start_count)
@@ -374,7 +378,7 @@ bna_ib_config(struct bna_ib *ib, struct
return 0;
}
-void
+static void
bna_ib_start(struct bna_ib *ib)
{
struct bna_ib_blk_mem ib_cfg;
@@ -450,7 +454,7 @@ bna_ib_start(struct bna_ib *ib)
}
}
-void
+static void
bna_ib_stop(struct bna_ib *ib)
{
u32 intx_mask;
@@ -468,7 +472,7 @@ bna_ib_stop(struct bna_ib *ib)
}
}
-void
+static void
bna_ib_fail(struct bna_ib *ib)
{
ib->start_count = 0;
@@ -1394,7 +1398,7 @@ rxf_reset_packet_filter(struct bna_rxf *
rxf_reset_packet_filter_allmulti(rxf);
}
-void
+static void
bna_rxf_init(struct bna_rxf *rxf,
struct bna_rx *rx,
struct bna_rx_config *q_config)
@@ -1444,7 +1448,7 @@ bna_rxf_init(struct bna_rxf *rxf,
bfa_fsm_set_state(rxf, bna_rxf_sm_stopped);
}
-void
+static void
bna_rxf_uninit(struct bna_rxf *rxf)
{
struct bna_mac *mac;
@@ -1476,7 +1480,7 @@ bna_rxf_uninit(struct bna_rxf *rxf)
rxf->rx = NULL;
}
-void
+static void
bna_rxf_start(struct bna_rxf *rxf)
{
rxf->start_cbfn = bna_rx_cb_rxf_started;
@@ -1485,7 +1489,7 @@ bna_rxf_start(struct bna_rxf *rxf)
bfa_fsm_send_event(rxf, RXF_E_START);
}
-void
+static void
bna_rxf_stop(struct bna_rxf *rxf)
{
rxf->stop_cbfn = bna_rx_cb_rxf_stopped;
@@ -1493,7 +1497,7 @@ bna_rxf_stop(struct bna_rxf *rxf)
bfa_fsm_send_event(rxf, RXF_E_STOP);
}
-void
+static void
bna_rxf_fail(struct bna_rxf *rxf)
{
rxf->rxf_flags |= BNA_RXF_FL_FAILED;
@@ -1575,42 +1579,6 @@ bna_rx_mcast_add(struct bna_rx *rx, u8 *
return BNA_CB_SUCCESS;
}
-enum bna_cb_status
-bna_rx_mcast_del(struct bna_rx *rx, u8 *addr,
- void (*cbfn)(struct bnad *, struct bna_rx *,
- enum bna_cb_status))
-{
- struct bna_rxf *rxf = &rx->rxf;
- struct list_head *qe;
- struct bna_mac *mac;
-
- list_for_each(qe, &rxf->mcast_pending_add_q) {
- mac = (struct bna_mac *)qe;
- if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
- list_del(qe);
- bfa_q_qe_init(qe);
- bna_mcam_mod_mac_put(&rxf->rx->bna->mcam_mod, mac);
- if (cbfn)
- (*cbfn)(rx->bna->bnad, rx, BNA_CB_SUCCESS);
- return BNA_CB_SUCCESS;
- }
- }
-
- list_for_each(qe, &rxf->mcast_active_q) {
- mac = (struct bna_mac *)qe;
- if (BNA_MAC_IS_EQUAL(mac->addr, addr)) {
- list_del(qe);
- bfa_q_qe_init(qe);
- list_add_tail(qe, &rxf->mcast_pending_del_q);
- rxf->cam_fltr_cbfn = cbfn;
- rxf->cam_fltr_cbarg = rx->bna->bnad;
- bfa_fsm_send_event(rxf, RXF_E_CAM_FLTR_MOD);
- return BNA_CB_SUCCESS;
- }
- }
-
- return BNA_CB_INVALID_MAC;
-}
enum bna_cb_status
bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mclist,
@@ -1862,7 +1830,7 @@ bfa_fsm_state_decl(bna_rx, rxf_stop_wait
bfa_fsm_state_decl(bna_rx, rxq_stop_wait,
struct bna_rx, enum bna_rx_event);
-static struct bfa_sm_table rx_sm_table[] = {
+static const struct bfa_sm_table rx_sm_table[] = {
{BFA_SM(bna_rx_sm_stopped), BNA_RX_STOPPED},
{BFA_SM(bna_rx_sm_rxf_start_wait), BNA_RX_RXF_START_WAIT},
{BFA_SM(bna_rx_sm_started), BNA_RX_STARTED},
@@ -2247,7 +2215,7 @@ bna_rit_create(struct bna_rx *rx)
}
}
-int
+static int
_rx_can_satisfy(struct bna_rx_mod *rx_mod,
struct bna_rx_config *rx_cfg)
{
@@ -2272,7 +2240,7 @@ _rx_can_satisfy(struct bna_rx_mod *rx_mo
return 1;
}
-struct bna_rxq *
+static struct bna_rxq *
_get_free_rxq(struct bna_rx_mod *rx_mod)
{
struct bna_rxq *rxq = NULL;
@@ -2286,7 +2254,7 @@ _get_free_rxq(struct bna_rx_mod *rx_mod)
return rxq;
}
-void
+static void
_put_free_rxq(struct bna_rx_mod *rx_mod, struct bna_rxq *rxq)
{
bfa_q_qe_init(&rxq->qe);
@@ -2294,7 +2262,7 @@ _put_free_rxq(struct bna_rx_mod *rx_mod,
rx_mod->rxq_free_count++;
}
-struct bna_rxp *
+static struct bna_rxp *
_get_free_rxp(struct bna_rx_mod *rx_mod)
{
struct list_head *qe = NULL;
@@ -2310,7 +2278,7 @@ _get_free_rxp(struct bna_rx_mod *rx_mod)
return rxp;
}
-void
+static void
_put_free_rxp(struct bna_rx_mod *rx_mod, struct bna_rxp *rxp)
{
bfa_q_qe_init(&rxp->qe);
@@ -2318,7 +2286,7 @@ _put_free_rxp(struct bna_rx_mod *rx_mod,
rx_mod->rxp_free_count++;
}
-struct bna_rx *
+static struct bna_rx *
_get_free_rx(struct bna_rx_mod *rx_mod)
{
struct list_head *qe = NULL;
@@ -2336,7 +2304,7 @@ _get_free_rx(struct bna_rx_mod *rx_mod)
return rx;
}
-void
+static void
_put_free_rx(struct bna_rx_mod *rx_mod, struct bna_rx *rx)
{
bfa_q_qe_init(&rx->qe);
@@ -2344,7 +2312,7 @@ _put_free_rx(struct bna_rx_mod *rx_mod,
rx_mod->rx_free_count++;
}
-void
+static void
_rx_init(struct bna_rx *rx, struct bna *bna)
{
rx->bna = bna;
@@ -2360,7 +2328,7 @@ _rx_init(struct bna_rx *rx, struct bna *
rx->stop_cbarg = NULL;
}
-void
+static void
_rxp_add_rxqs(struct bna_rxp *rxp,
struct bna_rxq *q0,
struct bna_rxq *q1)
@@ -2383,7 +2351,7 @@ _rxp_add_rxqs(struct bna_rxp *rxp,
}
}
-void
+static void
_rxq_qpt_init(struct bna_rxq *rxq,
struct bna_rxp *rxp,
u32 page_count,
@@ -2412,7 +2380,7 @@ _rxq_qpt_init(struct bna_rxq *rxq,
}
}
-void
+static void
_rxp_cqpt_setup(struct bna_rxp *rxp,
u32 page_count,
u32 page_size,
@@ -2441,13 +2409,13 @@ _rxp_cqpt_setup(struct bna_rxp *rxp,
}
}
-void
+static void
_rx_add_rxp(struct bna_rx *rx, struct bna_rxp *rxp)
{
list_add_tail(&rxp->qe, &rx->rxp_q);
}
-void
+static void
_init_rxmod_queues(struct bna_rx_mod *rx_mod)
{
INIT_LIST_HEAD(&rx_mod->rx_free_q);
@@ -2460,7 +2428,7 @@ _init_rxmod_queues(struct bna_rx_mod *rx
rx_mod->rxp_free_count = 0;
}
-void
+static void
_rx_ctor(struct bna_rx *rx, int id)
{
bfa_q_qe_init(&rx->qe);
@@ -2492,7 +2460,7 @@ bna_rx_cb_rxq_stopped_all(void *arg)
bfa_fsm_send_event(rx, RX_E_RXQ_STOPPED);
}
-void
+static void
bna_rx_mod_cb_rx_stopped(void *arg, struct bna_rx *rx,
enum bna_cb_status status)
{
@@ -2501,7 +2469,7 @@ bna_rx_mod_cb_rx_stopped(void *arg, stru
bfa_wc_down(&rx_mod->rx_stop_wc);
}
-void
+static void
bna_rx_mod_cb_rx_stopped_all(void *arg)
{
struct bna_rx_mod *rx_mod = (struct bna_rx_mod *)arg;
@@ -2511,7 +2479,7 @@ bna_rx_mod_cb_rx_stopped_all(void *arg)
rx_mod->stop_cbfn = NULL;
}
-void
+static void
bna_rx_start(struct bna_rx *rx)
{
rx->rx_flags |= BNA_RX_F_PORT_ENABLED;
@@ -2519,7 +2487,7 @@ bna_rx_start(struct bna_rx *rx)
bfa_fsm_send_event(rx, RX_E_START);
}
-void
+static void
bna_rx_stop(struct bna_rx *rx)
{
rx->rx_flags &= ~BNA_RX_F_PORT_ENABLED;
@@ -2532,7 +2500,7 @@ bna_rx_stop(struct bna_rx *rx)
}
}
-void
+static void
bna_rx_fail(struct bna_rx *rx)
{
/* Indicate port is not enabled, and failed */
@@ -3731,7 +3699,7 @@ bna_tx_fail(struct bna_tx *tx)
bfa_fsm_send_event(tx, TX_E_FAIL);
}
-void
+static void
bna_tx_prio_changed(struct bna_tx *tx, int prio)
{
struct bna_txq *txq;
--- a/drivers/net/bna/bnad.c 2010-10-05 18:28:08.157640648 +0900
+++ b/drivers/net/bna/bnad.c 2010-10-05 19:11:35.125672896 +0900
@@ -28,7 +28,7 @@
#include "bna.h"
#include "cna.h"
-DEFINE_MUTEX(bnad_fwimg_mutex);
+static DEFINE_MUTEX(bnad_fwimg_mutex);
/*
* Module params
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(bnad_ioc_auto_recover,
*/
u32 bnad_rxqs_per_cq = 2;
-const u8 bnad_bcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+static const u8 bnad_bcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
/*
* Local MACROS
@@ -684,7 +684,7 @@ bnad_enable_mbox_irq(struct bnad *bnad)
* Called with bnad->bna_lock held b'cos of
* bnad->cfg_flags access.
*/
-void
+static void
bnad_disable_mbox_irq(struct bnad *bnad)
{
int irq = BNAD_GET_MBOX_IRQ(bnad);
@@ -953,11 +953,6 @@ bnad_cb_stats_get(struct bnad *bnad, enu
jiffies + msecs_to_jiffies(BNAD_STATS_TIMER_FREQ));
}
-void
-bnad_cb_stats_clr(struct bnad *bnad)
-{
-}
-
/* Resource allocation, free functions */
static void
@@ -3211,7 +3206,7 @@ bnad_pci_remove(struct pci_dev *pdev)
free_netdev(netdev);
}
-const struct pci_device_id bnad_pci_id_table[] = {
+static const struct pci_device_id bnad_pci_id_table[] = {
{
PCI_DEVICE(PCI_VENDOR_ID_BROCADE,
PCI_DEVICE_ID_BROCADE_CT),
--- a/drivers/net/bna/cna_fwimg.c 2010-10-05 18:28:08.173646664 +0900
+++ b/drivers/net/bna/cna_fwimg.c 2010-10-05 18:29:06.225688125 +0900
@@ -22,7 +22,7 @@ const struct firmware *bfi_fw;
static u32 *bfi_image_ct_cna;
static u32 bfi_image_ct_cna_size;
-u32 *
+static u32 *
cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
u32 *bfi_image_size, char *fw_name)
{
--- a/drivers/net/bna/bfa_ioc.h 2010-10-05 18:54:23.662672433 +0900
+++ b/drivers/net/bna/bfa_ioc.h 2010-10-05 18:54:30.857688208 +0900
@@ -271,7 +271,6 @@ void bfa_nw_ioc_enable(struct bfa_ioc *i
void bfa_nw_ioc_disable(struct bfa_ioc *ioc);
void bfa_nw_ioc_error_isr(struct bfa_ioc *ioc);
-bool bfa_nw_ioc_is_operational(struct bfa_ioc *ioc);
void bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr);
void bfa_nw_ioc_hbfail_register(struct bfa_ioc *ioc,
--- a/drivers/net/bna/bfa_sm.h 2010-10-05 19:12:40.405663296 +0900
+++ b/drivers/net/bna/bfa_sm.h 2010-10-05 19:12:48.897641119 +0900
@@ -77,7 +77,7 @@ typedef void (*bfa_fsm_t)(void *fsm, int
((_fsm)->fsm == (bfa_fsm_t)(_state))
static inline int
-bfa_sm_to_state(struct bfa_sm_table *smt, bfa_sm_t sm)
+bfa_sm_to_state(const struct bfa_sm_table *smt, bfa_sm_t sm)
{
int i = 0;
^ permalink raw reply
* Fwd: Regarding to your linux kernel CL
From: Chung-Yih Wang (王崇懿) @ 2010-10-05 16:42 UTC (permalink / raw)
To: netdev
In-Reply-To: <AANLkTikdcL0JQgkR6u0qtmDu-phMZ6-Juq91B1N5GfiY@mail.gmail.com>
Hi,
We have an issue with the CL
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d11a4dc18bf41719c9f0d7ed494d295dd2973b92.
Please see the original mail below. Any comment?
Thanks,
Chung-yih
---------- Forwarded message ----------
From: Chung-Yih Wang (王崇懿) <cywang@google.com>
Date: Mon, Oct 4, 2010 at 6:23 PM
Subject: Regarding to your linux kernel CL
To: timo.teras@iki.fi
Cc: herbert@gondor.apana.org.au, davem@davemloft.net
Hi Timo,
I encountered an issue with your CL
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d11a4dc18bf41719c9f0d7ed494d295dd2973b92.
The cause is that we use a connected UDP socket for building the
l2tp/ipsec vpn connection. However, when the ipsec tunnel is built,
your CL made the sk_dst_check useless(since it always return the
'freed' dst_entry and can not reset the dst entry for the socket).
What is your comment to conquer this issue?
Solution 1. We could add a CL to change it to (dst && dst->obsolete &&
(dst->obsolete>0 || dst->ops->check(...)==NULL) in sk_dst_check()) ?
Solution 2. Revert the change?
Any comment?
Thanks,
Chung-yih
^ permalink raw reply
* Re: [patch] isdn: strcpy() => strlcpy()
From: Al Viro @ 2010-10-05 16:43 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Karsten Keil, netdev, kernel-janitors
In-Reply-To: <20101005163448.GH5692@bicker>
On Tue, Oct 05, 2010 at 06:34:48PM +0200, Dan Carpenter wrote:
> setup.phone and setup.eazmsn are 32 character buffers.
> rcvmsg.msg_data.byte_array is a 48 character buffer.
> sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn is 50 chars.
>
> I changed the strcpy() so strlcpy() because that's safest.
ITYM "I papered it over, so potentially broken behaviour is harder to
find now"...
> - strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4]));
> - strcpy(setup.eazmsn,
> - sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn);
> + strlcpy(setup.phone, &(rcvmsg.msg_data.byte_array[4]),
> + sizeof(setup.phone));
OK, so what should be done if the damn array contents _is_ longer than that?
> + strlcpy(setup.eazmsn,
> + sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
> + sizeof(setup.eazmsn));
Ditto.
> - strcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn,rcvmsg.msg_data.byte_array);
> + strlcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
> + rcvmsg.msg_data.byte_array,
> + sizeof(rcvmsg.msg_data.byte_array));
Huh? Is it or is it not NUL-terminated? If it is, then change is pure
cargo-culting; if it is not, you are asking for nasal daemons to fly.
^ permalink raw reply
* pull-request: bluetooth-2.6 2010-10-05
From: Gustavo F. Padovan @ 2010-10-05 17:13 UTC (permalink / raw)
To: David Miller
Cc: linville-2XuSBdqkA4R54TAoqtyWWQ, marcel-kz+m5ild9QBg9hUCZPvPmw,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
Hi Dave,
In this patch set we have two fixes for regressions in L2CAP due to ERTM code
we added in L2CAP for 2.6.36, a bugfix in the L2CAP Streaming Mode that was
making the kernel crash. And a fix for a deadlock issue between the sk_sndbuf
and the backlog queue in ERTM. The rest are also needed bug fixes.
For -next pull request things go back to normal and patches go through John.
Thanks!
The following changes since commit 899611ee7d373e5eeda08e9a8632684e1ebbbf00:
Linux 2.6.36-rc6 (2010-09-28 18:01:22 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6.git master
Andrei Emeltchenko (1):
Bluetooth: fix MTU L2CAP configuration parameter
Gustavo F. Padovan (5):
Bluetooth: Simplify L2CAP Streaming mode sending
Bluetooth: Fix inconsistent lock state with RFCOMM
Revert "Bluetooth: Don't accept ConfigReq if we aren't in the BT_CONFIG state"
Bluetooth: Fix deadlock in the ERTM logic
Bluetooth: Disallow to change L2CAP_OPTIONS values when connected
Mat Martineau (1):
Bluetooth: Only enable L2CAP FCS for ERTM or streaming
include/net/bluetooth/bluetooth.h | 18 +++++++++++
net/bluetooth/l2cap.c | 62 +++++++++++++++++-------------------
net/bluetooth/rfcomm/sock.c | 4 ++
3 files changed, 51 insertions(+), 33 deletions(-)
--
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi
^ permalink raw reply
* Re: [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap num_rx_queues at init time
From: John Fastabend @ 2010-10-05 17:45 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Eric Dumazet, netdev@vger.kernel.org, therbert@google.com
In-Reply-To: <1286296476.2307.5.camel@achroite.uk.solarflarecom.com>
On 10/5/2010 9:34 AM, Ben Hutchings wrote:
> On Tue, 2010-10-05 at 09:08 -0700, John Fastabend wrote:
>> On 10/4/2010 10:35 PM, Eric Dumazet wrote:
>>> Le lundi 04 octobre 2010 à 15:00 -0700, John Fastabend a écrit :
>>>> The logic for netif_set_real_num_rx_queues is the following,
>>>>
>>>> netif_set_real_num_rx_queues(dev, rxq)
>>>> {
>>>> ...
>>>> if (dev->reg_state == NETREG_REGISTERED) {
>>>> ...
>>>> } else {
>>>> dev->num_rx_queues = rxq;
>>>> }
>>>>
>>>> dev->real_num_rx_queues = rxq;
>>>> return 0;
>>>> }
>>>>
>>>> Some drivers init path looks like the following,
>>>>
>>>> alloc_etherdev_mq(priv_sz, max_num_queues_ever);
>>>> ...
>>>> netif_set_real_num_rx_queues(dev, queues_to_use_now);
>>>> ...
>>>> register_netdev(dev);
>>>> ...
>>>>
>>>> Because netif_set_real_num_rx_queues sets num_rx_queues if the
>>>> reg state is not NETREG_REGISTERED we end up with the incorrect
>>>> max number of rx queues. This patch proposes to remove the else
>>>> clause above so this does not occur. Also just reading the
>>>> function set_real_num it seems a bit unexpected that num_rx_queues
>>>> gets set.
>>>>
>>>
>>> You dont tell why its "incorrect".
>>>
>>
>> OK that is a poor description.
>>
>>> Why should we keep num_rx_queues > real_num_rx_queues ?
>>>
>>
>> If we do not ever need them then we should not keep them I agree.
>> But having netif_set_real_num_rx_queues set something other then
>> 'real_num_rx_queues' does not seem right to me at least. Also
>> netif_set_real_num_tx_queues and netif_set_real_num_rx_queues have
>> different behavior. It would be nice if this weren't the case but
>> they allocate queues in two places.
> [...]
>
> I only did this to satisfy Eric's desire to reduce memory usage.
> However, I believe that there are currently no drivers that dynamically
> increase numbers of RX or TX queues. Until there are, there is not much
> point in removing this assignment to num_rx_queues.
>
> Ben.
>
ixgbe increases the real_num_[rx|tx]_queues when FCoE or DCB is enabled.
Also many of the drivers could increase the number of queues if they were
given more interrupt vectors at some point.
But, it is easy enough to patch ixgbe to not set the number of RX queues
currently in use until after the device is registered. Which brings it
inline with many of the other drivers. And then the drivers that are using
it to explicitly set num_rx_queues do not need to change.
Thanks,
John
^ permalink raw reply
* [GIT PULL net-next-2.6] vhost-net patchset for 2.6.37
From: Michael S. Tsirkin @ 2010-10-05 18:27 UTC (permalink / raw)
To: David Miller; +Cc: kvm, virtualization, netdev, linux-kernel, Jason Wang
It looks like it was a quiet cycle for vhost-net:
probably because most of energy was spent on bugfixes
that went in for 2.6.36.
People are working on multiqueue, tracing but I'm not
sure it'll get done in time for 2.6.37 - so here's
a tree with a single patch that helps windows guests
which we definitely want in the next kernel.
Please merge for 2.6.37.
Thanks!
The following changes since commit a00eac0c459abecb539fb2a2abd3122dd7ca5d4a:
ppp: Use a real SKB control block in fragmentation engine. (2010-10-05 01:36:52 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-net-next
Jason Wang (1):
vhost: max s/g to match qemu
drivers/vhost/net.c | 2 +-
drivers/vhost/vhost.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
drivers/vhost/vhost.h | 18 ++++++++----------
3 files changed, 57 insertions(+), 12 deletions(-)
^ permalink raw reply
* Re: [v2 RFC PATCH 0/4] Implement multiqueue virtio-net
From: Michael S. Tsirkin @ 2010-10-05 18:23 UTC (permalink / raw)
To: Krishna Kumar2; +Cc: anthony, arnd, avi, davem, kvm, netdev, rusty
In-Reply-To: <OF13594229.1A55A20C-ON652577B3.00393C8D-652577B3.003A54C9@in.ibm.com>
On Tue, Oct 05, 2010 at 04:10:00PM +0530, Krishna Kumar2 wrote:
> "Michael S. Tsirkin" <mst@redhat.com> wrote on 09/19/2010 06:14:43 PM:
>
> > Could you document how exactly do you measure multistream bandwidth:
> > netperf flags, etc?
>
> All results were without any netperf flags or system tuning:
> for i in $list
> do
> netperf -c -C -l 60 -H 192.168.122.1 > /tmp/netperf.$$.$i &
> done
> wait
> Another script processes the result files. It also displays the
> start time/end time of each iteration to make sure skew due to
> parallel netperfs is minimal.
>
> I changed the vhost functionality once more to try to get the
> best model, the new model being:
> 1. #numtxqs=1 -> #vhosts=1, this thread handles both RX/TX.
> 2. #numtxqs>1 -> vhost[0] handles RX and vhost[1-MAX] handles
> TX[0-n], where MAX is 4. Beyond numtxqs=4, the remaining TX
> queues are handled by vhost threads in round-robin fashion.
>
> Results from here on are with these changes, and only "tuning" is
> to set each vhost's affinity to CPUs[0-3] ("taskset -p f <vhost-pids>").
>
> > Any idea where does this come from?
> > Do you see more TX interrupts? RX interrupts? Exits?
> > Do interrupts bounce more between guest CPUs?
> > 4. Identify reasons for single netperf BW regression.
>
> After testing various combinations of #txqs, #vhosts, #netperf
> sessions, I think the drop for 1 stream is due to TX and RX for
> a flow being processed on different cpus.
Right. Can we fix it?
> I did two more tests:
> 1. Pin vhosts to same CPU:
> - BW drop is much lower for 1 stream case (- 5 to -8% range)
> - But performance is not so high for more sessions.
> 2. Changed vhost to be single threaded:
> - No degradation for 1 session, and improvement for upto
> 8, sometimes 16 streams (5-12%).
> - BW degrades after that, all the way till 128 netperf sessions.
> - But overall CPU utilization improves.
> Summary of the entire run (for 1-128 sessions):
> txq=4: BW: (-2.3) CPU: (-16.5) RCPU: (-5.3)
> txq=16: BW: (-1.9) CPU: (-24.9) RCPU: (-9.6)
>
> I don't see any reasons mentioned above. However, for higher
> number of netperf sessions, I see a big increase in retransmissions:
Hmm, ok, and do you see any errors?
> _______________________________________
> #netperf ORG NEW
> BW (#retr) BW (#retr)
> _______________________________________
> 1 70244 (0) 64102 (0)
> 4 21421 (0) 36570 (416)
> 8 21746 (0) 38604 (148)
> 16 21783 (0) 40632 (464)
> 32 22677 (0) 37163 (1053)
> 64 23648 (4) 36449 (2197)
> 128 23251 (2) 31676 (3185)
> _______________________________________
>
> Single netperf case didn't have any retransmissions so that is not
> the cause for drop. I tested ixgbe (MQ):
> ___________________________________________________________
> #netperf ixgbe ixgbe (pin intrs to cpu#0 on
> both server/client)
> BW (#retr) BW (#retr)
> ___________________________________________________________
> 1 3567 (117) 6000 (251)
> 2 4406 (477) 6298 (725)
> 4 6119 (1085) 7208 (3387)
> 8 6595 (4276) 7381 (15296)
> 16 6651 (11651) 6856 (30394)
Interesting.
You are saying we get much more retransmissions with physical nic as
well?
> ___________________________________________________________
>
> > 5. Test perf in more scenarious:
> > small packets
>
> 512 byte packets - BW drop for upto 8 (sometimes 16) netperf sessions,
> but increases with #sessions:
> _______________________________________________________________________________
> # BW1 BW2 (%) CPU1 CPU2 (%) RCPU1 RCPU2 (%)
> _______________________________________________________________________________
> 1 4043 3800 (-6.0) 50 50 (0) 86 98 (13.9)
> 2 8358 7485 (-10.4) 153 178 (16.3) 230 264 (14.7)
> 4 20664 13567 (-34.3) 448 490 (9.3) 530 624 (17.7)
> 8 25198 17590 (-30.1) 967 1021 (5.5) 1085 1257 (15.8)
> 16 23791 24057 (1.1) 1904 2220 (16.5) 2156 2578 (19.5)
> 24 23055 26378 (14.4) 2807 3378 (20.3) 3225 3901 (20.9)
> 32 22873 27116 (18.5) 3748 4525 (20.7) 4307 5239 (21.6)
> 40 22876 29106 (27.2) 4705 5717 (21.5) 5388 6591 (22.3)
> 48 23099 31352 (35.7) 5642 6986 (23.8) 6475 8085 (24.8)
> 64 22645 30563 (34.9) 7527 9027 (19.9) 8619 10656 (23.6)
> 80 22497 31922 (41.8) 9375 11390 (21.4) 10736 13485 (25.6)
> 96 22509 32718 (45.3) 11271 13710 (21.6) 12927 16269 (25.8)
> 128 22255 32397 (45.5) 15036 18093 (20.3) 17144 21608 (26.0)
> _______________________________________________________________________________
> SUM: BW: (16.7) CPU: (20.6) RCPU: (24.3)
> _______________________________________________________________________________
>
> > host -> guest
> _______________________________________________________________________________
> # BW1 BW2 (%) CPU1 CPU2 (%) RCPU1 RCPU2 (%)
> _______________________________________________________________________________
> *1 70706 90398 (27.8) 300 327 (9.0) 140 175 (25.0)
> 2 20951 21937 (4.7) 188 196 (4.2) 93 103 (10.7)
> 4 19952 25281 (26.7) 397 496 (24.9) 210 304 (44.7)
> 8 18559 24992 (34.6) 802 1010 (25.9) 439 659 (50.1)
> 16 18882 25608 (35.6) 1642 2082 (26.7) 953 1454 (52.5)
> 24 19012 26955 (41.7) 2465 3153 (27.9) 1452 2254 (55.2)
> 32 19846 26894 (35.5) 3278 4238 (29.2) 1914 3081 (60.9)
> 40 19704 27034 (37.2) 4104 5303 (29.2) 2409 3866 (60.4)
> 48 19721 26832 (36.0) 4924 6418 (30.3) 2898 4701 (62.2)
> 64 19650 26849 (36.6) 6595 8611 (30.5) 3975 6433 (61.8)
> 80 19432 26823 (38.0) 8244 10817 (31.2) 4985 8165 (63.7)
> 96 20347 27886 (37.0) 9913 13017 (31.3) 5982 9860 (64.8)
> 128 19108 27715 (45.0) 13254 17546 (32.3) 8153 13589 (66.6)
> _______________________________________________________________________________
> SUM: BW: (32.4) CPU: (30.4) RCPU: (62.6)
> _______________________________________________________________________________
> *: Sum over 7 iterations, remaining test cases are sum over 2 iterations
>
> > guest <-> external
>
> I haven't done this right now since I don't have a setup. I guess
> it would be limited by wire speed and gains may not be there. I
> will try to do this later when I get the setup.
OK but at least need to check that it does not hurt things.
> > in last case:
> > find some other way to measure host CPU utilization,
> > try multiqueue and single queue devices
> > 6. Use above to figure out what is a sane default for numtxqs
>
> A. Summary for default I/O (16K):
> #txqs=2 (#vhost=3): BW: (37.6) CPU: (69.2) RCPU: (40.8)
> #txqs=4 (#vhost=5): BW: (36.9) CPU: (60.9) RCPU: (25.2)
> #txqs=8 (#vhost=5): BW: (41.8) CPU: (50.0) RCPU: (15.2)
> #txqs=16 (#vhost=5): BW: (40.4) CPU: (49.9) RCPU: (10.0)
>
> B. Summary for 512 byte I/O:
> #txqs=2 (#vhost=3): BW: (31.6) CPU: (35.7) RCPU: (28.6)
> #txqs=4 (#vhost=5): BW: (5.7) CPU: (27.2) RCPU: (22.7)
> #txqs=8 (#vhost=5): BW: (-.6) CPU: (25.1) RCPU: (22.5)
> #txqs=16 (#vhost=5): BW: (-6.6) CPU: (24.7) RCPU: (21.7)
>
> Summary:
>
> 1. Average BW increase for regular I/O is best for #txq=16 with the
> least CPU utilization increase.
> 2. The average BW for 512 byte I/O is best for lower #txq=2. For higher
> #txqs, BW increased only after a particular #netperf sessions - in
> my testing that limit was 32 netperf sessions.
> 3. Multiple txq for guest by itself doesn't seem to have any issues.
> Guest CPU% increase is slightly higher than BW improvement. I
> think it is true for all mq drivers since more paths run in parallel
> upto the device instead of sleeping and allowing one thread to send
> all packets via qdisc_restart.
> 4. Having high number of txqs gives better gains and reduces cpu util
> on the guest and the host.
> 5. MQ is intended for server loads. MQ should probably not be explicitly
> specified for client systems.
> 6. No regression with numtxqs=1 (or if mq option is not used) in any
> testing scenario.
Of course txq=1 can be considered a kind of fix, but if we know the
issue is TX/RX flows getting bounced between CPUs, can we fix this?
Workload-specific optimizations can only get us this far.
>
> I will send the v3 patch within a day after some more testing.
>
> Thanks,
>
> - KK
^ permalink raw reply
* Re: [patch 2/2] drivers/net/stmmac/: add HAS_IOMEM dependency
From: David Miller @ 2010-10-05 18:41 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: akpm, netdev, schwidefsky, heiko.carstens
In-Reply-To: <4CAB0219.40007@st.com>
From: Peppe CAVALLARO <peppe.cavallaro@st.com>
Date: Tue, 5 Oct 2010 12:46:49 +0200
> This dependency was removed in driver included in net-next Git (because
> the CPU_SUBTYPE_ST40 is a dead option).
Oh yes, I missed that. Thanks for noticing.
> I've seen that other drivers depend on HAS_IOMEM that is always defined
> for STM and ARM targets (where the I know the stmmac is used); No
> problem for me to add this new dependency to in HAS_IOMEM the stmmac's
> Kconfig if actually needed.
I'll add the patch Andrew posted, it is needed now.
Thanks again.
^ permalink raw reply
* Re: [MeeGo-Dev][PATCH v3] Topcliff: Update PCH_CAN driver to 2.6.35
From: David Miller @ 2010-10-05 18:45 UTC (permalink / raw)
To: masa-korg-ECg8zkTtlr0C6LszWs/t0g
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w,
sameo-VuQAYsv1563Yd54FQh9/CA,
margie.foster-ral2JQCrhuEAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, wg-5Yr1BZd7O62+XT7JhA+gdA,
yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w, mkl-bIcnvbaLZ9MEGnE8C9+IrQ,
chripell-VaTbYqLCNhc, morinaga526-ECg8zkTtlr0C6LszWs/t0g,
meego-dev-WXzIur8shnEAvxtiuMwx3w,
kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
joel.clark-ral2JQCrhuEAvxtiuMwx3w, qi.wang-ral2JQCrhuEAvxtiuMwx3w
In-Reply-To: <002e01cb6486$2ed72cc0$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
From: "Masayuki Ohtake" <masa-korg-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
Date: Tue, 5 Oct 2010 21:09:30 +0900
> On Tuesday, October 05, 2010 8:08 PM, Marc Kleine-Budde wrote:
>> If FIFO is working you might also think about NAPI.
>
> I think NAPI isn't necessary for our CAN driver.
> NAPI is for high-speed networking.
> CAN is NOT high-speed.
>
> In fact, some accepted CAN drivers don't have NAPI.
NAPI is not just for performance concerns.
It greatly simplifies the locking since all packet processing paths
run only in software interrupt context, never in hardware interrupt
context.
We encourage all new drivers that can use NAPI to do so, just because
recent driver submissions do not do this doesn't mean we should
continue such a mistake ;-)
^ permalink raw reply
* Re: [PATCH] bonding: fix to rejoin multicast groups immediately
From: David Miller @ 2010-10-05 20:25 UTC (permalink / raw)
To: fbl; +Cc: netdev
In-Reply-To: <20101005143430.GA13811@redhat.com>
From: Flavio Leitner <fbl@redhat.com>
Date: Tue, 5 Oct 2010 11:34:30 -0300
> On Tue, Oct 05, 2010 at 12:13:38AM -0700, David Miller wrote:
>> From: Flavio Leitner <fleitner@redhat.com>
>> Date: Wed, 29 Sep 2010 04:12:07 -0300
>>
>> > It should rejoin multicast groups immediately when
>> > the failover happens to restore the multicast traffic.
>> >
>> > Signed-off-by: Flavio Leitner <fleitner@redhat.com>
>>
>> I suspect the IGMPv3 handling via a delayed action, as is currently
>> implemented, is on purpose and is done so to follow the specification
>> of the IGMPv3 RFCs.
>>
>> Therefore you have to explain why your new behavior is so desirable
>> and in particular why something as undesirable as violating the RFCs
>> is therefore warranted.
>
> That patch only changes the behavior for bonding during a link
> failure, so if we have a bonding in active-backup or any other mode
> with current-active-slave, the initialization will happen just fine
> following IGMP specs.
>
> However, neither the backup slave interface nor the backup switch
> connected to backup slave knows about mcast. Thus when a link failure
> happens, we shouldn't rely on timers to not stay out of the mcast
> group losing traffic.
>
> E.g. The V1 specs says that we shouldn't send any membership report
> if it has been one in the last minute because that means the switch
> is notified and the system will receive mcast traffic for that group.
> Therefore, if it sees one and a link failure happens right after that,
> the backup slave will send another membership report only one minute
> later. During this time the system loses traffic.
All of this valuable information belongs in the commit log message.
Please resubmit your patch with all of the necessary contextual
information and reasoning explaining in the commit message.
Thanks.
^ permalink raw reply
* Re: [net-2.6 PATCH] MAINTAINERS: update Intel LAN Ethernet info
From: David Miller @ 2010-10-05 20:25 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, linux-kernel, gospo, bphilips
In-Reply-To: <20101005111438.22968.15130.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 05 Oct 2010 04:15:17 -0700
> - Add ixgbevf and docs files to the maintainers file
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/3] ixgbevf.txt: Update ixgbevf documentation
From: David Miller @ 2010-10-05 20:28 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: rdunlap, netdev, linux-doc, gospo, bphilips
In-Reply-To: <20101005111643.23000.38976.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 05 Oct 2010 04:16:44 -0700
> Update the documentation for the ixgbevf (ixgbe virtual
> function driver).
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/3] e1000.txt: Update e1000 documentation
From: David Miller @ 2010-10-05 20:28 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: rdunlap, netdev, linux-doc, gospo, bphilips
In-Reply-To: <20101005111704.23000.60972.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 05 Oct 2010 04:17:05 -0700
> Updated the e1000 networking driver documentation.
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* Re: [PATCH 3/3] e1000e.txt: Add e1000e documentation
From: David Miller @ 2010-10-05 20:28 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: rdunlap, netdev, linux-doc, gospo, bphilips
In-Reply-To: <20101005111726.23000.73997.stgit@localhost.localdomain>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 05 Oct 2010 04:17:27 -0700
> Adds documentation for the e1000e networking driver.
>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply
* [PATCH net-next] fib: RCU conversion of fib_lookup()
From: Eric Dumazet @ 2010-10-05 20:41 UTC (permalink / raw)
To: David Miller; +Cc: netdev
fib_lookup() converted to be called in RCU protected context, no
reference taken and released on a contended cache line (fib_clntref)
fib_table_lookup() and fib_semantic_match() get an additional parameter.
struct fib_info gets an rcu_head field, and is freed after an rcu grace
period.
Stress test :
(Sending 160.000.000 UDP frames on same neighbour,
IP route cache disabled, dual E5540 @2.53GHz,
32bit kernel, FIB_HASH) (about same results for FIB_TRIE)
Before patch :
real 1m31.199s
user 0m13.761s
sys 23m24.780s
After patch:
real 1m5.375s
user 0m14.997s
sys 15m50.115s
Before patch Profile :
13044.00 15.4% __ip_route_output_key vmlinux
8438.00 10.0% dst_destroy vmlinux
5983.00 7.1% fib_semantic_match vmlinux
5410.00 6.4% fib_rules_lookup vmlinux
4803.00 5.7% neigh_lookup vmlinux
4420.00 5.2% _raw_spin_lock vmlinux
3883.00 4.6% rt_set_nexthop vmlinux
3261.00 3.9% _raw_read_lock vmlinux
2794.00 3.3% fib_table_lookup vmlinux
2374.00 2.8% neigh_resolve_output vmlinux
2153.00 2.5% dst_alloc vmlinux
1502.00 1.8% _raw_read_lock_bh vmlinux
1484.00 1.8% kmem_cache_alloc vmlinux
1407.00 1.7% eth_header vmlinux
1406.00 1.7% ipv4_dst_destroy vmlinux
1298.00 1.5% __copy_from_user_ll vmlinux
1174.00 1.4% dev_queue_xmit vmlinux
1000.00 1.2% ip_output vmlinux
After patch Profile :
13712.00 15.8% dst_destroy vmlinux
8548.00 9.9% __ip_route_output_key vmlinux
7017.00 8.1% neigh_lookup vmlinux
4554.00 5.3% fib_semantic_match vmlinux
4067.00 4.7% _raw_read_lock vmlinux
3491.00 4.0% dst_alloc vmlinux
3186.00 3.7% neigh_resolve_output vmlinux
3103.00 3.6% fib_table_lookup vmlinux
2098.00 2.4% _raw_read_lock_bh vmlinux
2081.00 2.4% kmem_cache_alloc vmlinux
2013.00 2.3% _raw_spin_lock vmlinux
1763.00 2.0% __copy_from_user_ll vmlinux
1763.00 2.0% ip_output vmlinux
1761.00 2.0% ipv4_dst_destroy vmlinux
1631.00 1.9% eth_header vmlinux
1440.00 1.7% _raw_read_unlock_bh vmlinux
Reference results, if IP route cache is enabled :
real 0m29.718s
user 0m10.845s
sys 7m37.341s
25213.00 29.5% __ip_route_output_key vmlinux
9011.00 10.5% dst_release vmlinux
4817.00 5.6% ip_push_pending_frames vmlinux
4232.00 5.0% ip_finish_output vmlinux
3940.00 4.6% udp_sendmsg vmlinux
3730.00 4.4% __copy_from_user_ll vmlinux
3716.00 4.4% ip_route_output_flow vmlinux
2451.00 2.9% __xfrm_lookup vmlinux
2221.00 2.6% ip_append_data vmlinux
1718.00 2.0% _raw_spin_lock_bh vmlinux
1655.00 1.9% __alloc_skb vmlinux
1572.00 1.8% sock_wfree vmlinux
1345.00 1.6% kfree vmlinux
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/net/fib_rules.h | 2 +
include/net/ip_fib.h | 17 ++--------
net/core/fib_rules.c | 3 +
net/ipv4/fib_frontend.c | 27 ++++++++--------
net/ipv4/fib_hash.c | 5 +--
net/ipv4/fib_lookup.h | 2 -
net/ipv4/fib_rules.c | 3 +
net/ipv4/fib_semantics.c | 21 ++++++++++---
net/ipv4/fib_trie.c | 10 +++---
net/ipv4/route.c | 59 +++++++++++++++----------------------
10 files changed, 72 insertions(+), 77 deletions(-)
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index ac2fd00..106f309 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -31,6 +31,8 @@ struct fib_lookup_arg {
void *lookup_ptr;
void *result;
struct fib_rule *rule;
+ int flags;
+#define FIB_LOOKUP_NOREF 1
};
struct fib_rules_ops {
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index c93f94e..ba3666d 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -86,6 +86,7 @@ struct fib_info {
#ifdef CONFIG_IP_ROUTE_MULTIPATH
int fib_power;
#endif
+ struct rcu_head rcu;
struct fib_nh fib_nh[0];
#define fib_dev fib_nh[0].nh_dev
};
@@ -148,7 +149,7 @@ struct fib_table {
};
extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
- struct fib_result *res);
+ struct fib_result *res, int fib_flags);
extern int fib_table_insert(struct fib_table *, struct fib_config *);
extern int fib_table_delete(struct fib_table *, struct fib_config *);
extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb,
@@ -185,11 +186,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp,
struct fib_table *table;
table = fib_get_table(net, RT_TABLE_LOCAL);
- if (!fib_table_lookup(table, flp, res))
+ if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF))
return 0;
table = fib_get_table(net, RT_TABLE_MAIN);
- if (!fib_table_lookup(table, flp, res))
+ if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF))
return 0;
return -ENETUNREACH;
}
@@ -254,16 +255,6 @@ static inline void fib_info_put(struct fib_info *fi)
free_fib_info(fi);
}
-static inline void fib_res_put(struct fib_result *res)
-{
- if (res->fi)
- fib_info_put(res->fi);
-#ifdef CONFIG_IP_MULTIPLE_TABLES
- if (res->r)
- fib_rule_put(res->r);
-#endif
-}
-
#ifdef CONFIG_PROC_FS
extern int __net_init fib_proc_init(struct net *net);
extern void __net_exit fib_proc_exit(struct net *net);
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index cfb7d25..21698f8 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -225,7 +225,8 @@ jumped:
err = ops->action(rule, fl, flags, arg);
if (err != -EAGAIN) {
- if (likely(atomic_inc_not_zero(&rule->refcnt))) {
+ if ((arg->flags & FIB_LOOKUP_NOREF) ||
+ likely(atomic_inc_not_zero(&rule->refcnt))) {
arg->rule = rule;
goto out;
}
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index b05c23b..919f2ad 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -168,8 +168,11 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
struct fib_result res = { 0 };
struct net_device *dev = NULL;
- if (fib_lookup(net, &fl, &res))
+ rcu_read_lock();
+ if (fib_lookup(net, &fl, &res)) {
+ rcu_read_unlock();
return NULL;
+ }
if (res.type != RTN_LOCAL)
goto out;
dev = FIB_RES_DEV(res);
@@ -177,7 +180,7 @@ struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref)
if (dev && devref)
dev_hold(dev);
out:
- fib_res_put(&res);
+ rcu_read_unlock();
return dev;
}
EXPORT_SYMBOL(__ip_dev_find);
@@ -207,11 +210,12 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
local_table = fib_get_table(net, RT_TABLE_LOCAL);
if (local_table) {
ret = RTN_UNICAST;
- if (!fib_table_lookup(local_table, &fl, &res)) {
+ rcu_read_lock();
+ if (!fib_table_lookup(local_table, &fl, &res, FIB_LOOKUP_NOREF)) {
if (!dev || dev == res.fi->fib_dev)
ret = res.type;
- fib_res_put(&res);
}
+ rcu_read_unlock();
}
return ret;
}
@@ -235,6 +239,7 @@ EXPORT_SYMBOL(inet_dev_addr_type);
* - figure out what "logical" interface this packet arrived
* and calculate "specific destination" address.
* - check, that packet arrived from expected physical interface.
+ * called with rcu_read_lock()
*/
int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
struct net_device *dev, __be32 *spec_dst,
@@ -259,7 +264,6 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
struct net *net;
no_addr = rpf = accept_local = 0;
- rcu_read_lock();
in_dev = __in_dev_get_rcu(dev);
if (in_dev) {
no_addr = in_dev->ifa_list == NULL;
@@ -268,7 +272,6 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
if (mark && !IN_DEV_SRC_VMARK(in_dev))
fl.mark = 0;
}
- rcu_read_unlock();
if (in_dev == NULL)
goto e_inval;
@@ -278,7 +281,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
goto last_resort;
if (res.type != RTN_UNICAST) {
if (res.type != RTN_LOCAL || !accept_local)
- goto e_inval_res;
+ goto e_inval;
}
*spec_dst = FIB_RES_PREFSRC(res);
fib_combine_itag(itag, &res);
@@ -299,10 +302,8 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
#endif
if (dev_match) {
ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
- fib_res_put(&res);
return ret;
}
- fib_res_put(&res);
if (no_addr)
goto last_resort;
if (rpf == 1)
@@ -315,7 +316,6 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
*spec_dst = FIB_RES_PREFSRC(res);
ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
}
- fib_res_put(&res);
}
return ret;
@@ -326,8 +326,6 @@ last_resort:
*itag = 0;
return 0;
-e_inval_res:
- fib_res_put(&res);
e_inval:
return -EINVAL;
e_rpf:
@@ -873,15 +871,16 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
local_bh_disable();
frn->tb_id = tb->tb_id;
- frn->err = fib_table_lookup(tb, &fl, &res);
+ rcu_read_lock();
+ frn->err = fib_table_lookup(tb, &fl, &res, FIB_LOOKUP_NOREF);
if (!frn->err) {
frn->prefixlen = res.prefixlen;
frn->nh_sel = res.nh_sel;
frn->type = res.type;
frn->scope = res.scope;
- fib_res_put(&res);
}
+ rcu_read_unlock();
local_bh_enable();
}
}
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 4ed7e0d..83cca68 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -244,7 +244,8 @@ fn_new_zone(struct fn_hash *table, int z)
}
int fib_table_lookup(struct fib_table *tb,
- const struct flowi *flp, struct fib_result *res)
+ const struct flowi *flp, struct fib_result *res,
+ int fib_flags)
{
int err;
struct fn_zone *fz;
@@ -264,7 +265,7 @@ int fib_table_lookup(struct fib_table *tb,
err = fib_semantic_match(&f->fn_alias,
flp, res,
- fz->fz_order);
+ fz->fz_order, fib_flags);
if (err <= 0)
goto out;
}
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h
index 637b133..b9c9a9f 100644
--- a/net/ipv4/fib_lookup.h
+++ b/net/ipv4/fib_lookup.h
@@ -22,7 +22,7 @@ struct fib_alias {
/* Exported by fib_semantics.c */
extern int fib_semantic_match(struct list_head *head,
const struct flowi *flp,
- struct fib_result *res, int prefixlen);
+ struct fib_result *res, int prefixlen, int fib_flags);
extern void fib_release_info(struct fib_info *);
extern struct fib_info *fib_create_info(struct fib_config *cfg);
extern int fib_nh_match(struct fib_config *cfg, struct fib_info *fi);
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index 3230052..7981a24 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -57,6 +57,7 @@ int fib_lookup(struct net *net, struct flowi *flp, struct fib_result *res)
{
struct fib_lookup_arg arg = {
.result = res,
+ .flags = FIB_LOOKUP_NOREF,
};
int err;
@@ -94,7 +95,7 @@ static int fib4_rule_action(struct fib_rule *rule, struct flowi *flp,
if (!tbl)
goto errout;
- err = fib_table_lookup(tbl, flp, (struct fib_result *) arg->result);
+ err = fib_table_lookup(tbl, flp, (struct fib_result *) arg->result, arg->flags);
if (err > 0)
err = -EAGAIN;
errout:
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index ba52f39..0f80dfc 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -148,6 +148,13 @@ static const struct
/* Release a nexthop info record */
+static void free_fib_info_rcu(struct rcu_head *head)
+{
+ struct fib_info *fi = container_of(head, struct fib_info, rcu);
+
+ kfree(fi);
+}
+
void free_fib_info(struct fib_info *fi)
{
if (fi->fib_dead == 0) {
@@ -161,7 +168,7 @@ void free_fib_info(struct fib_info *fi)
} endfor_nexthops(fi);
fib_info_cnt--;
release_net(fi->fib_net);
- kfree(fi);
+ call_rcu(&fi->rcu, free_fib_info_rcu);
}
void fib_release_info(struct fib_info *fi)
@@ -553,6 +560,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
nh->nh_scope = RT_SCOPE_LINK;
return 0;
}
+ rcu_read_lock();
{
struct flowi fl = {
.nl_u = {
@@ -568,8 +576,10 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
if (fl.fl4_scope < RT_SCOPE_LINK)
fl.fl4_scope = RT_SCOPE_LINK;
err = fib_lookup(net, &fl, &res);
- if (err)
+ if (err) {
+ rcu_read_unlock();
return err;
+ }
}
err = -EINVAL;
if (res.type != RTN_UNICAST && res.type != RTN_LOCAL)
@@ -585,7 +595,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
goto out;
err = 0;
out:
- fib_res_put(&res);
+ rcu_read_unlock();
return err;
} else {
struct in_device *in_dev;
@@ -879,7 +889,7 @@ failure:
/* Note! fib_semantic_match intentionally uses RCU list functions. */
int fib_semantic_match(struct list_head *head, const struct flowi *flp,
- struct fib_result *res, int prefixlen)
+ struct fib_result *res, int prefixlen, int fib_flags)
{
struct fib_alias *fa;
int nh_sel = 0;
@@ -943,7 +953,8 @@ out_fill_res:
res->type = fa->fa_type;
res->scope = fa->fa_scope;
res->fi = fa->fa_info;
- atomic_inc(&res->fi->fib_clntref);
+ if (!(fib_flags & FIB_LOOKUP_NOREF))
+ atomic_inc(&res->fi->fib_clntref);
return 0;
}
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index a96e5ec..271c89b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1342,7 +1342,7 @@ err:
/* should be called with rcu_read_lock */
static int check_leaf(struct trie *t, struct leaf *l,
t_key key, const struct flowi *flp,
- struct fib_result *res)
+ struct fib_result *res, int fib_flags)
{
struct leaf_info *li;
struct hlist_head *hhead = &l->list;
@@ -1356,7 +1356,7 @@ static int check_leaf(struct trie *t, struct leaf *l,
if (l->key != (key & ntohl(mask)))
continue;
- err = fib_semantic_match(&li->falh, flp, res, plen);
+ err = fib_semantic_match(&li->falh, flp, res, plen, fib_flags);
#ifdef CONFIG_IP_FIB_TRIE_STATS
if (err <= 0)
@@ -1372,7 +1372,7 @@ static int check_leaf(struct trie *t, struct leaf *l,
}
int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
- struct fib_result *res)
+ struct fib_result *res, int fib_flags)
{
struct trie *t = (struct trie *) tb->tb_data;
int ret;
@@ -1399,7 +1399,7 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
/* Just a leaf? */
if (IS_LEAF(n)) {
- ret = check_leaf(t, (struct leaf *)n, key, flp, res);
+ ret = check_leaf(t, (struct leaf *)n, key, flp, res, fib_flags);
goto found;
}
@@ -1424,7 +1424,7 @@ int fib_table_lookup(struct fib_table *tb, const struct flowi *flp,
}
if (IS_LEAF(n)) {
- ret = check_leaf(t, (struct leaf *)n, key, flp, res);
+ ret = check_leaf(t, (struct leaf *)n, key, flp, res, fib_flags);
if (ret > 0)
goto backtrace;
goto found;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 04e0df8..7864d0c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1773,12 +1773,15 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)
if (rt->fl.iif == 0)
src = rt->rt_src;
- else if (fib_lookup(dev_net(rt->dst.dev), &rt->fl, &res) == 0) {
- src = FIB_RES_PREFSRC(res);
- fib_res_put(&res);
- } else
- src = inet_select_addr(rt->dst.dev, rt->rt_gateway,
+ else {
+ rcu_read_lock();
+ if (fib_lookup(dev_net(rt->dst.dev), &rt->fl, &res) == 0)
+ src = FIB_RES_PREFSRC(res);
+ else
+ src = inet_select_addr(rt->dst.dev, rt->rt_gateway,
RT_SCOPE_UNIVERSE);
+ rcu_read_unlock();
+ }
memcpy(addr, &src, 4);
}
@@ -2081,6 +2084,7 @@ static int ip_mkroute_input(struct sk_buff *skb,
* Such approach solves two big problems:
* 1. Not simplex devices are handled properly.
* 2. IP spoofing attempts are filtered with 100% of guarantee.
+ * called with rcu_read_lock()
*/
static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
@@ -2102,7 +2106,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
unsigned hash;
__be32 spec_dst;
int err = -EINVAL;
- int free_res = 0;
struct net * net = dev_net(dev);
/* IP on this device is disabled. */
@@ -2134,12 +2137,12 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
/*
* Now we are ready to route packet.
*/
- if ((err = fib_lookup(net, &fl, &res)) != 0) {
+ err = fib_lookup(net, &fl, &res);
+ if (err != 0) {
if (!IN_DEV_FORWARD(in_dev))
goto e_hostunreach;
goto no_route;
}
- free_res = 1;
RT_CACHE_STAT_INC(in_slow_tot);
@@ -2148,8 +2151,8 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (res.type == RTN_LOCAL) {
err = fib_validate_source(saddr, daddr, tos,
- net->loopback_dev->ifindex,
- dev, &spec_dst, &itag, skb->mark);
+ net->loopback_dev->ifindex,
+ dev, &spec_dst, &itag, skb->mark);
if (err < 0)
goto martian_source_keep_err;
if (err)
@@ -2164,9 +2167,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
goto martian_destination;
err = ip_mkroute_input(skb, &res, &fl, in_dev, daddr, saddr, tos);
-done:
- if (free_res)
- fib_res_put(&res);
out: return err;
brd_input:
@@ -2226,7 +2226,7 @@ local_input:
rth->rt_type = res.type;
hash = rt_hash(daddr, saddr, fl.iif, rt_genid(net));
err = rt_intern_hash(hash, rth, NULL, skb, fl.iif);
- goto done;
+ goto out;
no_route:
RT_CACHE_STAT_INC(in_no_route);
@@ -2249,21 +2249,21 @@ martian_destination:
e_hostunreach:
err = -EHOSTUNREACH;
- goto done;
+ goto out;
e_inval:
err = -EINVAL;
- goto done;
+ goto out;
e_nobufs:
err = -ENOBUFS;
- goto done;
+ goto out;
martian_source:
err = -EINVAL;
martian_source_keep_err:
ip_handle_martian_source(dev, in_dev, skb, daddr, saddr);
- goto done;
+ goto out;
}
int ip_route_input_common(struct sk_buff *skb, __be32 daddr, __be32 saddr,
@@ -2349,6 +2349,7 @@ skip_cache:
}
EXPORT_SYMBOL(ip_route_input_common);
+/* called with rcu_read_lock() */
static int __mkroute_output(struct rtable **result,
struct fib_result *res,
const struct flowi *fl,
@@ -2373,18 +2374,13 @@ static int __mkroute_output(struct rtable **result,
if (dev_out->flags & IFF_LOOPBACK)
flags |= RTCF_LOCAL;
- rcu_read_lock();
in_dev = __in_dev_get_rcu(dev_out);
- if (!in_dev) {
- rcu_read_unlock();
+ if (!in_dev)
return -EINVAL;
- }
+
if (res->type == RTN_BROADCAST) {
flags |= RTCF_BROADCAST | RTCF_LOCAL;
- if (res->fi) {
- fib_info_put(res->fi);
- res->fi = NULL;
- }
+ res->fi = NULL;
} else if (res->type == RTN_MULTICAST) {
flags |= RTCF_MULTICAST | RTCF_LOCAL;
if (!ip_check_mc(in_dev, oldflp->fl4_dst, oldflp->fl4_src,
@@ -2394,10 +2390,8 @@ static int __mkroute_output(struct rtable **result,
* default one, but do not gateway in this case.
* Yes, it is hack.
*/
- if (res->fi && res->prefixlen < 4) {
- fib_info_put(res->fi);
+ if (res->fi && res->prefixlen < 4)
res->fi = NULL;
- }
}
@@ -2467,6 +2461,7 @@ static int __mkroute_output(struct rtable **result,
return 0;
}
+/* called with rcu_read_lock() */
static int ip_mkroute_output(struct rtable **rp,
struct fib_result *res,
const struct flowi *fl,
@@ -2509,7 +2504,6 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
struct fib_result res;
unsigned int flags = 0;
struct net_device *dev_out = NULL;
- int free_res = 0;
int err;
@@ -2636,15 +2630,12 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
err = -ENETUNREACH;
goto out;
}
- free_res = 1;
if (res.type == RTN_LOCAL) {
if (!fl.fl4_src)
fl.fl4_src = fl.fl4_dst;
dev_out = net->loopback_dev;
fl.oif = dev_out->ifindex;
- if (res.fi)
- fib_info_put(res.fi);
res.fi = NULL;
flags |= RTCF_LOCAL;
goto make_route;
@@ -2668,8 +2659,6 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
make_route:
err = ip_mkroute_output(rp, &res, &fl, oldflp, dev_out, flags);
- if (free_res)
- fib_res_put(&res);
out: return err;
}
^ permalink raw reply related
* Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: Eric Dumazet @ 2010-10-05 21:01 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: David S. Miller, netdev, Jeff Kirsher
In-Reply-To: <1286291947.2796.387.camel@edumazet-laptop>
Le mardi 05 octobre 2010 à 17:19 +0200, Eric Dumazet a écrit :
> Le mardi 05 octobre 2010 à 16:53 +0200, Jesper Dangaard Brouer a écrit :
>
> > Its already racy, because "ethtool -S" reads out the stats immediately,
> > and thus races with the timer.
> >
> > See: igb_ethtool.c
> > igb_get_ethtool_stats() invoke igb_update_stats(adapter);
> >
>
> You would be surprised how many bugs are waiting to be found and
> fixed ;)
>
>
I took a look at igb stats, and it appears they also are racy on 32bit
arches. igb uses u64 counters, with no synchronization between
producers(writers) and consumers(readers).
Some fixes are needed ;)
^ permalink raw reply
* Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: Jesper Dangaard Brouer @ 2010-10-05 21:16 UTC (permalink / raw)
To: Eric Dumazet, Alexander Duyck
Cc: Jesper Dangaard Brouer, David S. Miller, netdev, Jeff Kirsher
In-Reply-To: <1286312479.2593.35.camel@edumazet-laptop>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1133 bytes --]
On Tue, 5 Oct 2010, Eric Dumazet wrote:
> Le mardi 05 octobre 2010 à 17:19 +0200, Eric Dumazet a écrit :
>> Le mardi 05 octobre 2010 à 16:53 +0200, Jesper Dangaard Brouer a écrit :
>>
>>> Its already racy, because "ethtool -S" reads out the stats immediately,
>>> and thus races with the timer.
>>>
>>> See: igb_ethtool.c
>>> igb_get_ethtool_stats() invoke igb_update_stats(adapter);
>>>
>>
>> You would be surprised how many bugs are waiting to be found and
>> fixed ;)
>
> I took a look at igb stats, and it appears they also are racy on 32bit
> arches. igb uses u64 counters, with no synchronization between
> producers(writers) and consumers(readers).
Are you saying, that we need more than a simple mutex in
igb_update_stats()?
> Some fixes are needed ;)
The question is then if Intel wants to fix it, or let it be up to you or
me?
Cheers,
Jesper Brouer
--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------
^ permalink raw reply
* Re: BUG - qdev - partial loss of network connectivity
From: Leszek Urbanski @ 2010-10-05 21:29 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Anthony Liguori, qemu-devel-qX2TKyscuCcdnm+yROfE0A,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
In-Reply-To: <20100927213203.GA28089-4cL5GMJPxME@public.gmane.org>
<20100927213203.GA28089-4cL5GMJPxME@public.gmane.org>; from Leszek Urbanski on Mon, Sep 27, 2010 at 23:32:03 +0200
> > > > >It's vanilla 2.6.32.22, but I also reproduced this on Debian's 2.6.32-23
> > > > >(based on 2.6.32.21).
> > > > >
> > > > >If offload is the only difference, I'll play with different offload
> > > > >options and check which one causes it.
> > > > >
> > > >
> > > > It's not technically the only difference but it's the most likely
> > > > culprit IMHO.
> > >
> > > udp fragmentation offload is definitely the culprit.
> >
> > I see. Most likely guest bug - won't be the first bug around UFO.
> > If so pls copy netdev linux-nfs and virtualization.
> > Do you see anything in dmesg? Can try 2.6.36-rc5?
>
> (for reference: first post is at:
> http://lists.nongnu.org/archive/html/qemu-devel/2010-09/msg01685.html )
>
> I can't reproduce it on 2.6.36-rc5. Do you have an idea which patch may have
This one definitely fixes it: http://patchwork.ozlabs.org/patch/55643/
(Herbert Xu: udp: Fix bogus UFO packet generation)
The patch works with 2.6.32.24 too - it should probably be backported to
2.6.32.x.
--
Leszek "Tygrys" Urbanski, SCSA, SCNA
"Unix-to-Unix Copy Program;" said PDP-1. "You will never find a more
wretched hive of bugs and flamers. We must be cautious." -- DECWARS
http://cygnus.moo.pl/ -- Cygnus High Altitude Balloon
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next] net: add a core netdev->rx_dropped counter
From: David Miller @ 2010-10-05 21:48 UTC (permalink / raw)
To: eric.dumazet; +Cc: jesse, rl, netdev, kaber
In-Reply-To: <1285916815.2705.152.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 01 Oct 2010 09:06:55 +0200
> [PATCH net-next] net: add a core netdev->rx_dropped counter
>
> In various situations, a device provides a packet to our stack and we
> drop it before it enters protocol stack :
> - softnet backlog full (accounted in /proc/net/softnet_stat)
> - bad vlan tag (not accounted)
> - unknown/unregistered protocol (not accounted)
>
> We can handle a per-device counter of such dropped frames at core level,
> and automatically adds it to the device provided stats (rx_dropped), so
> that standard tools can be used (ifconfig, ip link, cat /proc/net/dev)
>
> This is a generalization of commit 8990f468a (net: rx_dropped
> accounting), thus reverting it.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Looks good to me, applied, thanks.
^ permalink raw reply
* Re: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
From: David Miller @ 2010-10-05 21:50 UTC (permalink / raw)
To: holt; +Cc: w, linux-kernel, netdev, kuznet, pekkas, jmorris, yoshfuji, kaber
In-Reply-To: <20101002112419.248437367@gulag1.americas.sgi.com>
From: Robin Holt <holt@sgi.com>
Date: Sat, 02 Oct 2010 06:24:06 -0500
> Subject: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
>
> On a 16TB x86_64 machine, sysctl_tcp_mem[2], sysctl_udp_mem[2], and
> sysctl_sctp_mem[2] can integer overflow. Set limit such that they are
> maximized without overflowing.
>
> Signed-off-by: Robin Holt <holt@sgi.com>
Robin please resubmit this with the SCTP bits included.
^ permalink raw reply
* Re: [Patch] Limit sysctl_tcp_mem and sysctl_udp_mem initializers to prevent integer overflows.
From: David Miller @ 2010-10-05 21:50 UTC (permalink / raw)
To: eric.dumazet
Cc: holt, akpm, w, linux-kernel, netdev, kuznet, pekkas, jmorris,
yoshfuji, kaber
In-Reply-To: <1286025736.2582.1827.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 02 Oct 2010 15:22:16 +0200
> [PATCH] net: avoid limits overflow
>
> Robin Holt tried to boot a 16TB machine and found some limits were
> reached : sysctl_tcp_mem[2], sysctl_udp_mem[2]
>
> We can switch infrastructure to use long "instead" of "int", now
> atomic_long_t primitives are available for free.
>
> Reported-by: Robin Holt <holt@sgi.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Eric please resubmit this when the sysctl fix is resolved.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next] net neigh: neigh_delete() and neigh_add() changes
From: David Miller @ 2010-10-05 21:55 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1286202456.18293.293.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 04 Oct 2010 16:27:36 +0200
> neigh_delete() and neigh_add() dont need to touch device refcount,
> we hold RTNL when calling them, so device cannot disappear under us.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net neigh: RCU conversion of neigh hash table
From: David Miller @ 2010-10-05 21:55 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1286208944.18293.349.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 04 Oct 2010 18:15:44 +0200
> [PATCH net-next] net neigh: RCU conversion of neigh hash table
>
> Instead of storing hash_buckets, hash_mask and hash_rnd in "struct
> neigh_table", a new structure is defined :
>
> struct neigh_hash_table {
> struct neighbour **hash_buckets;
> unsigned int hash_mask;
> __u32 hash_rnd;
> struct rcu_head rcu;
> };
>
> And "struct neigh_table" has an RCU protected pointer to such a
> neigh_hash_table.
>
> This means the signature of (*hash)() function changed: We need to add a
> third parameter with the actual hash_rnd value, since this is not
> anymore a neigh_table field.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Also applied.
Looking good so far! :)
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox