* 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
* 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: [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
* 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: [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
* [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: [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
* Re: [PATCH] SIW: Module initialization
From: Jason Gunthorpe @ 2010-10-05 16:24 UTC (permalink / raw)
To: Bernard Metzler
Cc: Bart Van Assche, bart.vanassche-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <OFFB26426A.EB2C13FD-ONC12577B3.00488392-C12577B3.004895E4-Xeyd2O9EBijQT0dZR+AlfA@public.gmane.org>
On Tue, Oct 05, 2010 at 03:12:48PM +0200, Bernard Metzler wrote:
> good point. do you have a suggestion here - would you like to see
> siw to be enabled more selectively?
> iwarp is a protocol on top of TCP, explicitly defining the
> semantics of data fetching and placement. end-to-end connectivity
> and efficient data shipping is provided by TCP/IP. not taking into
> account dedicated RDMA hardware, any TCP stream may carry iwarp
> traffic. from that point of view, binding a software based
> rdma stack to dedicated devices is a concession to the
> given environment, in particular to the given rdma
> connection management. therefore, we started with binding to all
> available network devices.
Considering the possibility for security issues with code like this it
would be much nicer to have an 'opt in' mechanism.. Ie a
/sys/class/net/eth0/enable_iwarp
type of file.. You can track the add/remove of netdevices weth netevents.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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] SIW: iWARP Protocol headers
From: Bart Van Assche @ 2010-10-05 16:10 UTC (permalink / raw)
To: Bernard Metzler
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1286261630-5085-1-git-send-email-bmt-OA+xvbQnYDHMbYB6QlFGEg@public.gmane.org>
On Tue, Oct 5, 2010 at 8:53 AM, Bernard Metzler <bmt-OA+xvbQnYDHMbYB6QlFGEg@public.gmane.org> wrote:
> +} __attribute__((__packed__));
Apparently you make extensive use of the packed attribute. Please read
this blog entry, in which it is explained why this is harmful:
http://digitalvampire.org/blog/index.php/2006/07/31/why-you-shouldnt-use-__attribute__packed/
Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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: [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 16:08 UTC (permalink / raw)
To: Eric Dumazet
Cc: bhutchings@solarflare.com, netdev@vger.kernel.org,
therbert@google.com
In-Reply-To: <1286256926.2457.2.camel@edumazet-laptop>
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.
The drivers Ben modified seem to be split between these two flows
alloc_etherdev_mq(priv_sz, max_num_queues_ever);
register_netdev(dev);
netif_set_real_num_rx_queues(dev, queues_to_use_now);
and
alloc_etherdev_mq(priv_sz, max_num_queues_ever);
netif_set_real_num_rx_queues(dev, queues_to_use_now);
register_netdev(dev);
In the first case we never set 'num_rx_queues' because its after
the register so that leaves the second case. All the remaining
drivers except ixgbe, igb, and myri10ge know or could easily find
out the number of rx queues at alloc_etherdev_mq and are really trying
to explicitly set the num_rx_queues. Adding a num_rx_queues param to
alloc_etherdev_mq might make more sense in this case.
The myri10ge is querying the firmware which seems to be tangled up with
the netdev priv space, but otherwise isn't using any new knowledge. And
ixgbe/igb may end up capping the max number of queues because it is
trying to set the number of queues it intends to use now not the max it
will ever consume.
My point with this patch is I do not see any cases where we really do
not know the max number rx queues until after alloc_etherdev_mq() but before
register_netdev(). The piece I missed is if a driver wants to set rx queues
and tx queues separately they either need to explicitly set rx_num_queues or
use netif_set_real_num_rx_queues before registering the netdev. This syntax
seems error prone to me, and it would be better to set this in alloc_etherdev_mq().
But, maybe you disagree?
So I can either go rework the ixgbe/igb init flow so it does what I want.
Or add a parameter to alloc_etherdev_mq for rx queues, remove the
netif_set_real_num_rx_queues where it is not needed and modify the drivers
to use this interface. I like the second case because it makes the
netif_set_real_num_[rx|tx}_queues() behave the same but could do the first
just as easily.
Thanks,
John
> It creates /sys files, and Qdisc stuff for nothing...
>
>
>
>> CC: Ben Hutchings <bhutchings@solarflare.com>
>>
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>> ---
>>
>> net/core/dev.c | 2 --
>> 1 files changed, 0 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index a313bab..f78d996 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -1592,8 +1592,6 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
>> rxq);
>> if (rc)
>> return rc;
>> - } else {
>> - dev->num_rx_queues = rxq;
>> }
>>
>> dev->real_num_rx_queues = rxq;
>>
>> --
>
>
^ permalink raw reply
* Re: [PATCH] SIW: iWARP Protocol headers
From: Bernard Metzler @ 2010-10-05 16:06 UTC (permalink / raw)
To: Steve Wise; +Cc: linux-rdma, linux-rdma-owner, netdev
In-Reply-To: <4CAB2DDA.1020207@opengridcomputing.com>
<snip>
> > + */
> > +struct iwarp_ctrl_tagged {
> > + struct iwarp_ctrl ctrl;
> > + __u32 ddp_stag;
> > + __u64 ddp_to;
> > +} __attribute__((__packed__));
> > +
> >
>
> All of the above header structures should use __beXX types since the
> fields are all in Network Byte Order.
>
right. will get fixed.
> Also, did you run sparse on the patches (Documentation/sparse.txt)?
>
>
frankly, i was not aware. sorry. will do.
bernard.
^ permalink raw reply
* Re: [PATCH] SIW: Object management
From: Steve Wise @ 2010-10-05 15:37 UTC (permalink / raw)
To: Bernard Metzler; +Cc: linux-rdma, netdev, Roland Dreier
In-Reply-To: <OFFCB10B70.3E1CC39D-ONC12577B3.0053113C-C12577B3.0054C076@ch.ibm.com>
On 10/05/2010 10:25 AM, Bernard Metzler wrote:
> Steve Wise<swise@opengridcomputing.com> wrote on 10/05/2010 05:02:37 PM:
>
>
>> Steve Wise<swise@opengridcomputing.com>
>> 10/05/2010 05:02 PM
>>
>> To
>>
>> Bernard Metzler<BMT@zurich.ibm.com>
>>
>> cc
>>
>> linux-rdma@vger.kernel.org, netdev@vger.kernel.org
>>
>> Subject
>>
>> Re: [PATCH] SIW: Object management
>>
>> On 10/05/2010 09:56 AM, Bernard Metzler wrote:
>>
>>> Steve Wise<swise@opengridcomputing.com> wrote on 10/05/2010 04:26:48
>>>
> PM:
>
>>>
>>>
>>>> Steve Wise<swise@opengridcomputing.com>
>>>> 10/05/2010 04:26 PM
>>>>
>>>> To
>>>>
>>>> Bernard Metzler<bmt@zurich.ibm.com>
>>>>
>>>> cc
>>>>
>>>> netdev@vger.kernel.org, linux-rdma@vger.kernel.org
>>>>
>>>> Subject
>>>>
>>>> Re: [PATCH] SIW: Object management
>>>>
>>>> On 10/05/2010 01:54 AM, Bernard Metzler wrote:
>>>>
>>>> <snip>+
>>>>
>>>>
>>>>> +
>>>>> +/***** routines for WQE handling ***/
>>>>> +
>>>>> +/*
>>>>> + * siw_wqe_get()
>>>>> + *
>>>>> + * Get new WQE. For READ RESPONSE, take it from the free list which
>>>>> + * has a maximum size of maximum inbound READs. All other WQE are
>>>>> + * malloc'ed which creates some overhead. Consider change to
>>>>> + *
>>>>> + * 1. malloc WR only if it cannot be synchonously completed, or
>>>>> + * 2. operate own cache of reuseable WQE's.
>>>>> + *
>>>>> + * Current code trusts on malloc efficiency.
>>>>> + */
>>>>> +inline struct siw_wqe *siw_wqe_get(struct siw_qp *qp, enum
>>>>>
>>>>>
>>>> siw_wr_opcode op)
>>>>
>>>>
>>>>> +{
>>>>> + struct siw_wqe *wqe;
>>>>> +
>>>>> + if (op == SIW_WR_RDMA_READ_RESP) {
>>>>> + spin_lock(&qp->freelist_lock);
>>>>> + if (!(list_empty(&qp->wqe_freelist))) {
>>>>> + wqe = list_entry(qp->wqe_freelist.next,
>>>>> + struct siw_wqe, list);
>>>>> + list_del(&wqe->list);
>>>>> + spin_unlock(&qp->freelist_lock);
>>>>> + wqe->processed = 0;
>>>>> + dprint(DBG_OBJ|DBG_WR,
>>>>> + "(QP%d): WQE from FreeList p: %p\n",
>>>>> + QP_ID(qp), wqe);
>>>>> + } else {
>>>>> + spin_unlock(&qp->freelist_lock);
>>>>> + wqe = NULL;
>>>>> + dprint(DBG_ON|DBG_OBJ|DBG_WR,
>>>>> + "(QP%d): FreeList empty!\n", QP_ID(qp));
>>>>> + }
>>>>> + } else {
>>>>> + wqe = kzalloc(sizeof(struct siw_wqe), GFP_KERNEL);
>>>>> + dprint(DBG_OBJ|DBG_WR, "(QP%d): New WQE p: %p\n",
>>>>> + QP_ID(qp), wqe);
>>>>> + }
>>>>>
>>>>>
>>>>>
>>>> I think you can't allocate at GFP_KERNEL here if this is called from
>>>>
> the
>
>>>>
>>>
>>>> post_ functions. I think you might want to pre-allocate these when
>>>>
> you
>
>>>> create the QP...
>>>>
>>>>
>>>>
>>> the idea was to keep the memory footprint small and flexible
>>> while using the linux/list.h routines to manipulate all queues
>>> (no ring buffers etc, just lists). at the same time we
>>> decided to take the provided uverbs_cmd-syscall path down to
>>> the driver even for the post_-functions (since we would have to ring a
>>> doorbell on the send path anyway, which in software, is a syscall).
>>> in that path, even ib_uverbs_post_send() does one kmalloc() per wr
>>> (it would be helpful if the provider could keep and reuse that wr of
>>> known size, freeing it later at its own premises. that would avoid
>>> the second kmalloc here.)
>>>
>>> currently only work queue elements which are needed to satisfy
>>> inbound read requests are pre-allocated (amount corresponding
>>> to inbound read queue depth), since the read response is
>>> scheduled in network softirq context which must not sleep.
>>>
>>> that discussion may relate to the spinlock at the entrance to the
>>> post_ verbs. going down the uverbs_cmd path may sleep anyway...?
>>>
>>>
>>>
>>
>> The uverb calls may sleep, but certain kernel verbs must not. Remember,
>>
>
>> the post_send/recv and other functions in your driver are called
>> directly (almost) by kernel users like NFSRDMA. These users may be
>> calling in an interrupt context and thus you cannot block/sleep.
>>
>>
> OK, very convincing. not a big change since siw_wqe_get/_put()
> already maintain a list of pre-allocated wqe's (currently for
> the read.responses).
> but, would it be ok if the code distinguishes between user
> land and in-kernel consumers? i would be very happy if we could
> keep the pre-allocations per user land connection to its very
> minimum...
>
>
I think that's ok, but its bending the core locking rules a little I
guess. But the intent is that kernel users can definitely
send/recv/poll in interrupt context, so possibly blocking for user mode
QPs in on-kernel-bypass operations is probably ok...
What do you think Roland?
Steve.
^ permalink raw reply
* Re: [PATCH] SIW: Object management
From: Bernard Metzler @ 2010-10-05 15:25 UTC (permalink / raw)
To: Steve Wise; +Cc: linux-rdma, netdev
In-Reply-To: <4CAB3E0D.8050609@opengridcomputing.com>
Steve Wise <swise@opengridcomputing.com> wrote on 10/05/2010 05:02:37 PM:
> Steve Wise <swise@opengridcomputing.com>
> 10/05/2010 05:02 PM
>
> To
>
> Bernard Metzler <BMT@zurich.ibm.com>
>
> cc
>
> linux-rdma@vger.kernel.org, netdev@vger.kernel.org
>
> Subject
>
> Re: [PATCH] SIW: Object management
>
> On 10/05/2010 09:56 AM, Bernard Metzler wrote:
> > Steve Wise<swise@opengridcomputing.com> wrote on 10/05/2010 04:26:48
PM:
> >
> >
> >> Steve Wise<swise@opengridcomputing.com>
> >> 10/05/2010 04:26 PM
> >>
> >> To
> >>
> >> Bernard Metzler<bmt@zurich.ibm.com>
> >>
> >> cc
> >>
> >> netdev@vger.kernel.org, linux-rdma@vger.kernel.org
> >>
> >> Subject
> >>
> >> Re: [PATCH] SIW: Object management
> >>
> >> On 10/05/2010 01:54 AM, Bernard Metzler wrote:
> >>
> >> <snip>+
> >>
> >>> +
> >>> +/***** routines for WQE handling ***/
> >>> +
> >>> +/*
> >>> + * siw_wqe_get()
> >>> + *
> >>> + * Get new WQE. For READ RESPONSE, take it from the free list which
> >>> + * has a maximum size of maximum inbound READs. All other WQE are
> >>> + * malloc'ed which creates some overhead. Consider change to
> >>> + *
> >>> + * 1. malloc WR only if it cannot be synchonously completed, or
> >>> + * 2. operate own cache of reuseable WQE's.
> >>> + *
> >>> + * Current code trusts on malloc efficiency.
> >>> + */
> >>> +inline struct siw_wqe *siw_wqe_get(struct siw_qp *qp, enum
> >>>
> >> siw_wr_opcode op)
> >>
> >>> +{
> >>> + struct siw_wqe *wqe;
> >>> +
> >>> + if (op == SIW_WR_RDMA_READ_RESP) {
> >>> + spin_lock(&qp->freelist_lock);
> >>> + if (!(list_empty(&qp->wqe_freelist))) {
> >>> + wqe = list_entry(qp->wqe_freelist.next,
> >>> + struct siw_wqe, list);
> >>> + list_del(&wqe->list);
> >>> + spin_unlock(&qp->freelist_lock);
> >>> + wqe->processed = 0;
> >>> + dprint(DBG_OBJ|DBG_WR,
> >>> + "(QP%d): WQE from FreeList p: %p\n",
> >>> + QP_ID(qp), wqe);
> >>> + } else {
> >>> + spin_unlock(&qp->freelist_lock);
> >>> + wqe = NULL;
> >>> + dprint(DBG_ON|DBG_OBJ|DBG_WR,
> >>> + "(QP%d): FreeList empty!\n", QP_ID(qp));
> >>> + }
> >>> + } else {
> >>> + wqe = kzalloc(sizeof(struct siw_wqe), GFP_KERNEL);
> >>> + dprint(DBG_OBJ|DBG_WR, "(QP%d): New WQE p: %p\n",
> >>> + QP_ID(qp), wqe);
> >>> + }
> >>>
> >>>
> >> I think you can't allocate at GFP_KERNEL here if this is called from
the
> >>
> >
> >> post_ functions. I think you might want to pre-allocate these when
you
> >> create the QP...
> >>
> >>
> > the idea was to keep the memory footprint small and flexible
> > while using the linux/list.h routines to manipulate all queues
> > (no ring buffers etc, just lists). at the same time we
> > decided to take the provided uverbs_cmd-syscall path down to
> > the driver even for the post_-functions (since we would have to ring a
> > doorbell on the send path anyway, which in software, is a syscall).
> > in that path, even ib_uverbs_post_send() does one kmalloc() per wr
> > (it would be helpful if the provider could keep and reuse that wr of
> > known size, freeing it later at its own premises. that would avoid
> > the second kmalloc here.)
> >
> > currently only work queue elements which are needed to satisfy
> > inbound read requests are pre-allocated (amount corresponding
> > to inbound read queue depth), since the read response is
> > scheduled in network softirq context which must not sleep.
> >
> > that discussion may relate to the spinlock at the entrance to the
> > post_ verbs. going down the uverbs_cmd path may sleep anyway...?
> >
> >
>
>
> The uverb calls may sleep, but certain kernel verbs must not. Remember,
> the post_send/recv and other functions in your driver are called
> directly (almost) by kernel users like NFSRDMA. These users may be
> calling in an interrupt context and thus you cannot block/sleep.
>
OK, very convincing. not a big change since siw_wqe_get/_put()
already maintain a list of pre-allocated wqe's (currently for
the read.responses).
but, would it be ok if the code distinguishes between user
land and in-kernel consumers? i would be very happy if we could
keep the pre-allocations per user land connection to its very
minimum...
thanks,
bernard.
> Steve.
^ permalink raw reply
* Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: Eric Dumazet @ 2010-10-05 15:19 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: David S. Miller, netdev, Jeff Kirsher
In-Reply-To: <1286290393.7071.38.camel@firesoul.comx.local>
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 ;)
^ permalink raw reply
* Re: [RFC] bonding: fix workqueue re-arming races
From: Narendra_K @ 2010-10-05 15:03 UTC (permalink / raw)
To: jbohac; +Cc: fubar, bonding-devel, markine, jarkao2, chavey, netdev
In-Reply-To: <20101001182232.GB25971@midget.suse.cz>
On Fri, Oct 01, 2010 at 11:52:32PM +0530, Jiri Bohac wrote:
> On Fri, Sep 24, 2010 at 06:23:53AM -0500, Narendra K wrote:
> > On Fri, Sep 17, 2010 at 04:14:33AM +0530, Jay Vosburgh wrote:
> > > Jay Vosburgh <fubar@us.ibm.com> wrote:
> > The follwing call trace was seen -
> >
> > 2.6.35.with.upstream.patch-next-20100811-0.7-default+
> > [14602.945876] ------------[ cut here ]------------
> > [14602.950474] kernel BUG at kernel/workqueue.c:2844!
> > [14602.955242] invalid opcode: 0000 [#1] SMP
> > [14602.959341] last sysfs file: /sys/class/net/bonding_masters
> > [14602.964888] CPU 1
> > [14602.966714] Modules linked in: af_packet bonding ipv6
> cpufreq_conservative cpufreq_userspace cpufreq_powersave acpi_cpufreq
> mperf microcode fuse loop dm_mod joydev usbhid hid bnx2 tpm_tis tpm
> tpm_bios rtc_cmos iTCO_wdt iTCO_vendor_support sr_mod power_meter cdrom sg
> serio_raw mptctl pcspkr rtc_core usb_storage dcdbas rtc_lib button
> uhci_hcd ehci_hcd usbcore sd_mod crc_t10dif edd ext3 mbcache jbd fan
> processor ide_pci_generic ide_core ata_generic ata_piix libata mptsas
> mptscsih mptbase scsi_transport_sas scsi_mod thermal thermal_sys hwmon
> > [14603.015002]
> > [14603.016524] Pid: 4006, comm: ifdown-bonding Not tainted
> 2.6.35.with.upstream.patch-next-20100811-0.7-default+ #2 0M233H/PowerEdge
> R710
> > [14603.028554] RIP: 0010:[<ffffffff81067b50>] [<ffffffff81067b50>]
> destroy_workqueue+0x1d0/0x1e0
> > [14603.037144] RSP: 0018:ffff88022a379d88 EFLAGS: 00010286
> > [14603.042432] RAX: 000000000000003c RBX: ffff880228674240 RCX:
> ffff880228f0e800
> > [14603.049534] RDX: 0000000000001000 RSI: 0000000000000002 RDI:
> 000000000000001a
> > [14603.056638] RBP: ffff88022a379da8 R08: ffff88022a379cf8 R09:
> 0000000000000000
> > [14603.063741] R10: 00000000ffffffff R11: 0000000000000000 R12:
> 0000000000000002
> > [14603.070842] R13: ffffffff817b8560 R14: ffff8802299d1480 R15:
> ffff8802299d1488
> > [14603.077944] FS: 00007f8e6a28f700(0000) GS:ffff880001c00000(0000)
> knlGS:0000000000000000
> > [14603.085999] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> > [14603.091719] CR2: 00007f8e6a2c2000 CR3: 0000000127d1c000 CR4:
> 00000000000006e0
> > [14603.098822] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> > [14603.105924] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
> 0000000000000400
> > [14603.113026] Process ifdown-bonding (pid: 4006, threadinfo
> ffff88022a378000, task ffff8802299b0080)
> > [14603.121944] Stack:
> > [14603.123944] ffff88022a379da8 ffff8802299d1000 ffff8802299d1000
> 000000010036b6a4
> > [14603.131182] <0> ffff88022a379dc8 ffffffffa030a91d ffff8802299d1000
> 000000010036b6a4
> > [14603.138857] <0> ffff88022a379e28 ffffffff812e0a08 ffff88022a379e38
> ffff88022a379de8
> > [14603.146718] Call Trace:
> > [14603.149158] [<ffffffffa030a91d>] bond_destructor+0x1d/0x30 [bonding]
> > [14603.155572] [<ffffffff812e0a08>] netdev_run_todo+0x1a8/0x270
> > [14603.161293] [<ffffffff812ee859>] rtnl_unlock+0x9/0x10
> > [14603.166411] [<ffffffffa0317824>] bonding_store_bonds+0x1c4/0x1f0
> [bonding]
> > [14603.173342] [<ffffffff810f26be>] ? alloc_pages_current+0x9e/0x110
> > [14603.179497] [<ffffffff81285c9e>] class_attr_store+0x1e/0x20
> > [14603.185132] [<ffffffff8116e365>] sysfs_write_file+0xc5/0x140
> > [14603.190853] [<ffffffff8110a68f>] vfs_write+0xcf/0x190
> > [14603.195967] [<ffffffff8110a840>] sys_write+0x50/0x90
> > [14603.200996] [<ffffffff81002ec2>] system_call_fastpath+0x16/0x1b
> > [14603.206974] Code: 00 7f 14 8b 3b eb 91 3d 00 10 00 00 89 c2 77 10 8b
> 3b e9 07 ff ff ff 3d 00 10 00 00 89 c2 76 f0 8b 3b e9 a9 fe ff ff 0f 0b eb
> fe <0f> 0b eb fe 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 8b 3d 00
> > [14603.226419] RIP [<ffffffff81067b50>] destroy_workqueue+0x1d0/0x1e0
> > [14603.232669] RSP <ffff88022a379d88>
> > [ 0.000000] Initializing cgroup subsys cpuset
> > [ 0.000000] Initializing cgroup subsys cpu
>
> This should be the BUG_ON(cwq->nr_active) in
> destroy_workqueue()
>
> This is really strange. bondng_store_bonds() can do two things:
> create or delete a bonding device.
>
> I checked the delete path, where I would normally expect such a
> problem, but I can't find a way it could fail in this way.
> bondng_store_bonds() calls unregister_netdevice(), which
> - calls rollback_registered() -> bond_close()
> - puts the device on the net_todo_list.
> On rtnl_unlock() netdev_run_todo() gets called and that calls
> bond_destructor().
>
> bond_close() now makes sure the rearming work items are not
> pending, thus, the only work items that may still be pending on
> the workqueue are the non-rearming "commit" work items.
> flush_workqueue(), called at the beginning of destroy_workqueue()
> should have waited for these to finish.
> If all of the above is correct, this BUG_ON should never trigger.
>
> Maybe I am overlooking something, or it may be some kind of
> failure/race condition in the create path, resulting in
> bond_destructor() being called as well.
>
> Narendra, any chance to capture the dmesg lines preceeding the
> BUG message? This should show which of the above cases it is.
Jiri, I will try to reproduce the issue with ignore_loglevel to capture
more data on the serial console and share it shortly.
>
> I will try to come up with a debug patch that will tell us which
> work remains active on the work queue.
>
> --
> Jiri Bohac <jbohac@suse.cz>
> SUSE Labs, SUSE CZ
--
With regards,
Narendra K
^ permalink raw reply
* Re: [PATCH] SIW: Object management
From: Steve Wise @ 2010-10-05 15:02 UTC (permalink / raw)
To: Bernard Metzler; +Cc: linux-rdma, netdev
In-Reply-To: <OF706D1D5F.5849676F-ONC12577B3.004FB763-C12577B3.00521572@ch.ibm.com>
On 10/05/2010 09:56 AM, Bernard Metzler wrote:
> Steve Wise<swise@opengridcomputing.com> wrote on 10/05/2010 04:26:48 PM:
>
>
>> Steve Wise<swise@opengridcomputing.com>
>> 10/05/2010 04:26 PM
>>
>> To
>>
>> Bernard Metzler<bmt@zurich.ibm.com>
>>
>> cc
>>
>> netdev@vger.kernel.org, linux-rdma@vger.kernel.org
>>
>> Subject
>>
>> Re: [PATCH] SIW: Object management
>>
>> On 10/05/2010 01:54 AM, Bernard Metzler wrote:
>>
>> <snip>+
>>
>>> +
>>> +/***** routines for WQE handling ***/
>>> +
>>> +/*
>>> + * siw_wqe_get()
>>> + *
>>> + * Get new WQE. For READ RESPONSE, take it from the free list which
>>> + * has a maximum size of maximum inbound READs. All other WQE are
>>> + * malloc'ed which creates some overhead. Consider change to
>>> + *
>>> + * 1. malloc WR only if it cannot be synchonously completed, or
>>> + * 2. operate own cache of reuseable WQE's.
>>> + *
>>> + * Current code trusts on malloc efficiency.
>>> + */
>>> +inline struct siw_wqe *siw_wqe_get(struct siw_qp *qp, enum
>>>
>> siw_wr_opcode op)
>>
>>> +{
>>> + struct siw_wqe *wqe;
>>> +
>>> + if (op == SIW_WR_RDMA_READ_RESP) {
>>> + spin_lock(&qp->freelist_lock);
>>> + if (!(list_empty(&qp->wqe_freelist))) {
>>> + wqe = list_entry(qp->wqe_freelist.next,
>>> + struct siw_wqe, list);
>>> + list_del(&wqe->list);
>>> + spin_unlock(&qp->freelist_lock);
>>> + wqe->processed = 0;
>>> + dprint(DBG_OBJ|DBG_WR,
>>> + "(QP%d): WQE from FreeList p: %p\n",
>>> + QP_ID(qp), wqe);
>>> + } else {
>>> + spin_unlock(&qp->freelist_lock);
>>> + wqe = NULL;
>>> + dprint(DBG_ON|DBG_OBJ|DBG_WR,
>>> + "(QP%d): FreeList empty!\n", QP_ID(qp));
>>> + }
>>> + } else {
>>> + wqe = kzalloc(sizeof(struct siw_wqe), GFP_KERNEL);
>>> + dprint(DBG_OBJ|DBG_WR, "(QP%d): New WQE p: %p\n",
>>> + QP_ID(qp), wqe);
>>> + }
>>>
>>>
>> I think you can't allocate at GFP_KERNEL here if this is called from the
>>
>
>> post_ functions. I think you might want to pre-allocate these when you
>> create the QP...
>>
>>
> the idea was to keep the memory footprint small and flexible
> while using the linux/list.h routines to manipulate all queues
> (no ring buffers etc, just lists). at the same time we
> decided to take the provided uverbs_cmd-syscall path down to
> the driver even for the post_-functions (since we would have to ring a
> doorbell on the send path anyway, which in software, is a syscall).
> in that path, even ib_uverbs_post_send() does one kmalloc() per wr
> (it would be helpful if the provider could keep and reuse that wr of
> known size, freeing it later at its own premises. that would avoid
> the second kmalloc here.)
>
> currently only work queue elements which are needed to satisfy
> inbound read requests are pre-allocated (amount corresponding
> to inbound read queue depth), since the read response is
> scheduled in network softirq context which must not sleep.
>
> that discussion may relate to the spinlock at the entrance to the
> post_ verbs. going down the uverbs_cmd path may sleep anyway...?
>
>
The uverb calls may sleep, but certain kernel verbs must not. Remember,
the post_send/recv and other functions in your driver are called
directly (almost) by kernel users like NFSRDMA. These users may be
calling in an interrupt context and thus you cannot block/sleep.
Steve.
^ permalink raw reply
* Re: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: Jesper Dangaard Brouer @ 2010-10-05 14:53 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David S. Miller, netdev, Jeff Kirsher
In-Reply-To: <1286289703.2796.292.camel@edumazet-laptop>
On Tue, 2010-10-05 at 16:41 +0200, Eric Dumazet wrote:
> Le mardi 05 octobre 2010 à 16:18 +0200, Jesper Dangaard Brouer a écrit :
> > Network driver igb: Improve the accuracy of stats in /proc/net/dev, by
> > updating the adapter stats when reading /proc/net/dev. Currently the
> > stats are updated by the watchdog timer every 2 sec, or when getting
> > stats via ethtool -S.
> >
> > A number of userspace apps read these /proc/net/dev stats every second,
> > e.g. ifstat, which then gives a perceived very bursty traffic pattern,
> > which is actually false.
> >
> > Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
>
> Unfortunately this is racy with igb_watchdog_task()
>
> igb_update_stats() must be called under protection of a lock.
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);
--
Med venlig hilsen / Best regards
Jesper Brouer
ComX Networks A/S
Linux Network Kernel Developer
Cand. Scient Datalog / MSc.CS
Author of http://adsl-optimizer.dk
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH] SIW: Object management
From: Bernard Metzler @ 2010-10-05 14:56 UTC (permalink / raw)
To: Steve Wise
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4CAB35A8.6080906-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org> wrote on 10/05/2010 04:26:48 PM:
> Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> 10/05/2010 04:26 PM
>
> To
>
> Bernard Metzler <bmt-OA+xvbQnYDHMbYB6QlFGEg@public.gmane.org>
>
> cc
>
> netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>
> Subject
>
> Re: [PATCH] SIW: Object management
>
> On 10/05/2010 01:54 AM, Bernard Metzler wrote:
>
> <snip>+
> > +
> > +/***** routines for WQE handling ***/
> > +
> > +/*
> > + * siw_wqe_get()
> > + *
> > + * Get new WQE. For READ RESPONSE, take it from the free list which
> > + * has a maximum size of maximum inbound READs. All other WQE are
> > + * malloc'ed which creates some overhead. Consider change to
> > + *
> > + * 1. malloc WR only if it cannot be synchonously completed, or
> > + * 2. operate own cache of reuseable WQE's.
> > + *
> > + * Current code trusts on malloc efficiency.
> > + */
> > +inline struct siw_wqe *siw_wqe_get(struct siw_qp *qp, enum
> siw_wr_opcode op)
> > +{
> > + struct siw_wqe *wqe;
> > +
> > + if (op == SIW_WR_RDMA_READ_RESP) {
> > + spin_lock(&qp->freelist_lock);
> > + if (!(list_empty(&qp->wqe_freelist))) {
> > + wqe = list_entry(qp->wqe_freelist.next,
> > + struct siw_wqe, list);
> > + list_del(&wqe->list);
> > + spin_unlock(&qp->freelist_lock);
> > + wqe->processed = 0;
> > + dprint(DBG_OBJ|DBG_WR,
> > + "(QP%d): WQE from FreeList p: %p\n",
> > + QP_ID(qp), wqe);
> > + } else {
> > + spin_unlock(&qp->freelist_lock);
> > + wqe = NULL;
> > + dprint(DBG_ON|DBG_OBJ|DBG_WR,
> > + "(QP%d): FreeList empty!\n", QP_ID(qp));
> > + }
> > + } else {
> > + wqe = kzalloc(sizeof(struct siw_wqe), GFP_KERNEL);
> > + dprint(DBG_OBJ|DBG_WR, "(QP%d): New WQE p: %p\n",
> > + QP_ID(qp), wqe);
> > + }
> >
>
> I think you can't allocate at GFP_KERNEL here if this is called from the
> post_ functions. I think you might want to pre-allocate these when you
> create the QP...
>
the idea was to keep the memory footprint small and flexible
while using the linux/list.h routines to manipulate all queues
(no ring buffers etc, just lists). at the same time we
decided to take the provided uverbs_cmd-syscall path down to
the driver even for the post_-functions (since we would have to ring a
doorbell on the send path anyway, which in software, is a syscall).
in that path, even ib_uverbs_post_send() does one kmalloc() per wr
(it would be helpful if the provider could keep and reuse that wr of
known size, freeing it later at its own premises. that would avoid
the second kmalloc here.)
currently only work queue elements which are needed to satisfy
inbound read requests are pre-allocated (amount corresponding
to inbound read queue depth), since the read response is
scheduled in network softirq context which must not sleep.
that discussion may relate to the spinlock at the entrance to the
post_ verbs. going down the uverbs_cmd path may sleep anyway...?
thanks,
bernard.
>
> Steve.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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: [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: Eric Dumazet @ 2010-10-05 14:41 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: David S. Miller, netdev, Jeff Kirsher
In-Reply-To: <20101005141833.20929.10943.stgit@localhost>
Le mardi 05 octobre 2010 à 16:18 +0200, Jesper Dangaard Brouer a écrit :
> Network driver igb: Improve the accuracy of stats in /proc/net/dev, by
> updating the adapter stats when reading /proc/net/dev. Currently the
> stats are updated by the watchdog timer every 2 sec, or when getting
> stats via ethtool -S.
>
> A number of userspace apps read these /proc/net/dev stats every second,
> e.g. ifstat, which then gives a perceived very bursty traffic pattern,
> which is actually false.
>
> Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Unfortunately this is racy with igb_watchdog_task()
igb_update_stats() must be called under protection of a lock.
^ permalink raw reply
* Re: [PATCH] bonding: fix to rejoin multicast groups immediately
From: Flavio Leitner @ 2010-10-05 14:34 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20101005.001338.52208103.davem@davemloft.net>
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.
--
Flavio
^ permalink raw reply
* Re: [PATCH] SIW: User interface
From: Steve Wise @ 2010-10-05 14:32 UTC (permalink / raw)
To: Bernard Metzler; +Cc: linux-rdma, netdev
In-Reply-To: <OF07B553EF.B746D69E-ONC12577B3.004EAD6A-C12577B3.004F92B0@ch.ibm.com>
On 10/05/2010 09:29 AM, Bernard Metzler wrote:
> Steve Wise<swise@opengridcomputing.com> wrote on 10/05/2010 04:17:34 PM:
>
>
>> Steve Wise<swise@opengridcomputing.com>
>> 10/05/2010 04:17 PM
>>
>> To
>>
>> Bernard Metzler<bmt@zurich.ibm.com>
>>
>> cc
>>
>> netdev@vger.kernel.org, linux-rdma@vger.kernel.org
>>
>> Subject
>>
>> Re: [PATCH] SIW: User interface
>>
>> On 10/05/2010 01:54 AM, Bernard Metzler wrote:
>>
>>
>> <snip>
>>
>>
>>> +
>>> +/*
>>> + * siw_post_send()
>>> + *
>>> + * Post a list of S-WR's to a SQ.
>>> + *
>>> + * @ofa_qp: OFA QP contained in siw QP
>>> + * @wr: Null terminated list of user WR's
>>> + * @bad_wr: Points to failing WR in case of synchronous failure.
>>> + */
>>> +int siw_post_send(struct ib_qp *ofa_qp, struct ib_send_wr *wr,
>>> + struct ib_send_wr **bad_wr)
>>> +{
>>> + struct siw_wqe *wqe = NULL;
>>> + struct siw_qp *qp = siw_qp_ofa2siw(ofa_qp);
>>> +
>>> + unsigned long flags;
>>> + int rv = 0;
>>> +
>>> + dprint(DBG_WR|DBG_TX, "(QP%d): state=%d\n",
>>> + QP_ID(qp), qp->attrs.state);
>>> +
>>> + /*
>>> + * Acquire QP state lock for reading. The idea is that a
>>> + * user cannot move the QP out of RTS during TX/RX processing.
>>> + */
>>> + down_read(&qp->state_lock);
>>> +
>>>
>>>
>> I don't think you can use a rw_semaphore here because it potentially can
>>
>
>> block. You cannot block/sleep in the post_send/post_recv (and some
>> other) RDMA provider functions. See
>> Documentation/infiniband/core_locking.txt.
>>
>>
>>
> ah, ok.
> with that, a down_read_trylock() would solve the issue...?
> given the limited set of errno values - what would you suggest
> as a meaningful return value? EBUSY, EINVAL, ...?
>
>
I think it is expected that you should implement this without requiring
the blocking semaphore. Returning an error will cause the application
to bail.
Steve.
^ permalink raw reply
* Re: [PATCH] SIW: User interface
From: Bernard Metzler @ 2010-10-05 14:29 UTC (permalink / raw)
To: Steve Wise; +Cc: linux-rdma, netdev
In-Reply-To: <4CAB337E.1040205@opengridcomputing.com>
Steve Wise <swise@opengridcomputing.com> wrote on 10/05/2010 04:17:34 PM:
> Steve Wise <swise@opengridcomputing.com>
> 10/05/2010 04:17 PM
>
> To
>
> Bernard Metzler <bmt@zurich.ibm.com>
>
> cc
>
> netdev@vger.kernel.org, linux-rdma@vger.kernel.org
>
> Subject
>
> Re: [PATCH] SIW: User interface
>
> On 10/05/2010 01:54 AM, Bernard Metzler wrote:
>
>
> <snip>
>
> > +
> > +/*
> > + * siw_post_send()
> > + *
> > + * Post a list of S-WR's to a SQ.
> > + *
> > + * @ofa_qp: OFA QP contained in siw QP
> > + * @wr: Null terminated list of user WR's
> > + * @bad_wr: Points to failing WR in case of synchronous failure.
> > + */
> > +int siw_post_send(struct ib_qp *ofa_qp, struct ib_send_wr *wr,
> > + struct ib_send_wr **bad_wr)
> > +{
> > + struct siw_wqe *wqe = NULL;
> > + struct siw_qp *qp = siw_qp_ofa2siw(ofa_qp);
> > +
> > + unsigned long flags;
> > + int rv = 0;
> > +
> > + dprint(DBG_WR|DBG_TX, "(QP%d): state=%d\n",
> > + QP_ID(qp), qp->attrs.state);
> > +
> > + /*
> > + * Acquire QP state lock for reading. The idea is that a
> > + * user cannot move the QP out of RTS during TX/RX processing.
> > + */
> > + down_read(&qp->state_lock);
> > +
> >
>
> I don't think you can use a rw_semaphore here because it potentially can
> block. You cannot block/sleep in the post_send/post_recv (and some
> other) RDMA provider functions. See
> Documentation/infiniband/core_locking.txt.
>
>
ah, ok.
with that, a down_read_trylock() would solve the issue...?
given the limited set of errno values - what would you suggest
as a meaningful return value? EBUSY, EINVAL, ...?
thanks!
bernard.
> Steve.
^ permalink raw reply
* Re: [PATCH] SIW: Object management
From: Steve Wise @ 2010-10-05 14:26 UTC (permalink / raw)
To: Bernard Metzler; +Cc: netdev, linux-rdma
In-Reply-To: <1286261665-5175-1-git-send-email-bmt@zurich.ibm.com>
On 10/05/2010 01:54 AM, Bernard Metzler wrote:
<snip>+
> +
> +/***** routines for WQE handling ***/
> +
> +/*
> + * siw_wqe_get()
> + *
> + * Get new WQE. For READ RESPONSE, take it from the free list which
> + * has a maximum size of maximum inbound READs. All other WQE are
> + * malloc'ed which creates some overhead. Consider change to
> + *
> + * 1. malloc WR only if it cannot be synchonously completed, or
> + * 2. operate own cache of reuseable WQE's.
> + *
> + * Current code trusts on malloc efficiency.
> + */
> +inline struct siw_wqe *siw_wqe_get(struct siw_qp *qp, enum siw_wr_opcode op)
> +{
> + struct siw_wqe *wqe;
> +
> + if (op == SIW_WR_RDMA_READ_RESP) {
> + spin_lock(&qp->freelist_lock);
> + if (!(list_empty(&qp->wqe_freelist))) {
> + wqe = list_entry(qp->wqe_freelist.next,
> + struct siw_wqe, list);
> + list_del(&wqe->list);
> + spin_unlock(&qp->freelist_lock);
> + wqe->processed = 0;
> + dprint(DBG_OBJ|DBG_WR,
> + "(QP%d): WQE from FreeList p: %p\n",
> + QP_ID(qp), wqe);
> + } else {
> + spin_unlock(&qp->freelist_lock);
> + wqe = NULL;
> + dprint(DBG_ON|DBG_OBJ|DBG_WR,
> + "(QP%d): FreeList empty!\n", QP_ID(qp));
> + }
> + } else {
> + wqe = kzalloc(sizeof(struct siw_wqe), GFP_KERNEL);
> + dprint(DBG_OBJ|DBG_WR, "(QP%d): New WQE p: %p\n",
> + QP_ID(qp), wqe);
> + }
>
I think you can't allocate at GFP_KERNEL here if this is called from the
post_ functions. I think you might want to pre-allocate these when you
create the QP...
Steve.
^ permalink raw reply
* [net-next PATCH] igb: update adapter stats when reading /proc/net/dev.
From: Jesper Dangaard Brouer @ 2010-10-05 14:18 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Jeff Kirsher
Network driver igb: Improve the accuracy of stats in /proc/net/dev, by
updating the adapter stats when reading /proc/net/dev. Currently the
stats are updated by the watchdog timer every 2 sec, or when getting
stats via ethtool -S.
A number of userspace apps read these /proc/net/dev stats every second,
e.g. ifstat, which then gives a perceived very bursty traffic pattern,
which is actually false.
Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
---
drivers/net/igb/igb_main.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 55edcb7..6cec297 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -4218,11 +4218,17 @@ static void igb_reset_task(struct work_struct *work)
* @netdev: network interface device structure
*
* Returns the address of the device statistics structure.
- * The statistics are actually updated from the timer callback.
+ * The statistics are also updated from the timer callback
+ * igb_watchdog_task().
**/
static struct net_device_stats *igb_get_stats(struct net_device *netdev)
{
- /* only return the current stats */
+ struct igb_adapter *adapter = netdev_priv(netdev);
+
+ /* update stats */
+ igb_update_stats(adapter);
+
+ /* return the current stats */
return &netdev->stats;
}
@@ -4307,7 +4313,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu)
void igb_update_stats(struct igb_adapter *adapter)
{
- struct net_device_stats *net_stats = igb_get_stats(adapter->netdev);
+ struct net_device_stats *net_stats = &adapter->netdev->stats;
struct e1000_hw *hw = &adapter->hw;
struct pci_dev *pdev = adapter->pdev;
u32 reg, mpc;
^ permalink raw reply related
* [PATCH net-next] dccp:
From: Stephen Hemminger @ 2010-10-05 14:24 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, David Miller; +Cc: dccp, netdev
Remove dead code and make some functions static.
Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
net/dccp/dccp.h | 2 --
net/dccp/feat.c | 10 ----------
net/dccp/feat.h | 1 -
net/dccp/options.c | 4 +---
net/dccp/proto.c | 48 ++++++++++++++++++++++++------------------------
5 files changed, 25 insertions(+), 40 deletions(-)
--- a/net/dccp/dccp.h 2010-10-05 23:09:10.000117419 +0900
+++ b/net/dccp/dccp.h 2010-10-05 23:22:37.879120065 +0900
@@ -246,7 +246,6 @@ static inline void dccp_clear_xmit_timer
extern unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu);
extern const char *dccp_packet_name(const int type);
-extern const char *dccp_state_name(const int state);
extern void dccp_set_state(struct sock *sk, const int state);
extern void dccp_done(struct sock *sk);
@@ -449,7 +448,6 @@ extern int dccp_insert_options_rsk(struc
extern int dccp_insert_option_elapsed_time(struct sk_buff *skb, u32 elapsed);
extern u32 dccp_timestamp(void);
extern void dccp_timestamping_init(void);
-extern int dccp_insert_option_timestamp(struct sk_buff *skb);
extern int dccp_insert_option(struct sk_buff *skb, unsigned char option,
const void *value, unsigned char len);
--- a/net/dccp/feat.c 2010-10-05 23:09:09.828117827 +0900
+++ b/net/dccp/feat.c 2010-10-05 23:14:58.315118201 +0900
@@ -730,16 +730,6 @@ int dccp_feat_register_sp(struct sock *s
0, list, len);
}
-/* Analogous to dccp_feat_register_sp(), but for non-negotiable values */
-int dccp_feat_register_nn(struct sock *sk, u8 feat, u64 val)
-{
- /* any changes must be registered before establishing the connection */
- if (sk->sk_state != DCCP_CLOSED)
- return -EISCONN;
- if (dccp_feat_type(feat) != FEAT_NN)
- return -EINVAL;
- return __feat_register_nn(&dccp_sk(sk)->dccps_featneg, feat, 0, val);
-}
/*
* Tracking features whose value depend on the choice of CCID
--- a/net/dccp/options.c 2010-10-05 23:09:09.884117478 +0900
+++ b/net/dccp/options.c 2010-10-05 23:14:27.375117940 +0900
@@ -369,7 +369,7 @@ int dccp_insert_option_elapsed_time(stru
EXPORT_SYMBOL_GPL(dccp_insert_option_elapsed_time);
-int dccp_insert_option_timestamp(struct sk_buff *skb)
+static int dccp_insert_option_timestamp(struct sk_buff *skb)
{
__be32 now = htonl(dccp_timestamp());
/* yes this will overflow but that is the point as we want a
@@ -378,8 +378,6 @@ int dccp_insert_option_timestamp(struct
return dccp_insert_option(skb, DCCPO_TIMESTAMP, &now, sizeof(now));
}
-EXPORT_SYMBOL_GPL(dccp_insert_option_timestamp);
-
static int dccp_insert_option_timestamp_echo(struct dccp_sock *dp,
struct dccp_request_sock *dreq,
struct sk_buff *skb)
--- a/net/dccp/proto.c 2010-10-05 23:09:09.956117344 +0900
+++ b/net/dccp/proto.c 2010-10-05 23:22:09.171119892 +0900
@@ -50,6 +50,30 @@ EXPORT_SYMBOL_GPL(dccp_hashinfo);
/* the maximum queue length for tx in packets. 0 is no limit */
int sysctl_dccp_tx_qlen __read_mostly = 5;
+#ifdef CONFIG_IP_DCCP_DEBUG
+static const char *dccp_state_name(const int state)
+{
+ static const char *const dccp_state_names[] = {
+ [DCCP_OPEN] = "OPEN",
+ [DCCP_REQUESTING] = "REQUESTING",
+ [DCCP_PARTOPEN] = "PARTOPEN",
+ [DCCP_LISTEN] = "LISTEN",
+ [DCCP_RESPOND] = "RESPOND",
+ [DCCP_CLOSING] = "CLOSING",
+ [DCCP_ACTIVE_CLOSEREQ] = "CLOSEREQ",
+ [DCCP_PASSIVE_CLOSE] = "PASSIVE_CLOSE",
+ [DCCP_PASSIVE_CLOSEREQ] = "PASSIVE_CLOSEREQ",
+ [DCCP_TIME_WAIT] = "TIME_WAIT",
+ [DCCP_CLOSED] = "CLOSED",
+ };
+
+ if (state >= DCCP_MAX_STATES)
+ return "INVALID STATE!";
+ else
+ return dccp_state_names[state];
+}
+#endif
+
void dccp_set_state(struct sock *sk, const int state)
{
const int oldstate = sk->sk_state;
@@ -146,30 +170,6 @@ const char *dccp_packet_name(const int t
EXPORT_SYMBOL_GPL(dccp_packet_name);
-const char *dccp_state_name(const int state)
-{
- static const char *const dccp_state_names[] = {
- [DCCP_OPEN] = "OPEN",
- [DCCP_REQUESTING] = "REQUESTING",
- [DCCP_PARTOPEN] = "PARTOPEN",
- [DCCP_LISTEN] = "LISTEN",
- [DCCP_RESPOND] = "RESPOND",
- [DCCP_CLOSING] = "CLOSING",
- [DCCP_ACTIVE_CLOSEREQ] = "CLOSEREQ",
- [DCCP_PASSIVE_CLOSE] = "PASSIVE_CLOSE",
- [DCCP_PASSIVE_CLOSEREQ] = "PASSIVE_CLOSEREQ",
- [DCCP_TIME_WAIT] = "TIME_WAIT",
- [DCCP_CLOSED] = "CLOSED",
- };
-
- if (state >= DCCP_MAX_STATES)
- return "INVALID STATE!";
- else
- return dccp_state_names[state];
-}
-
-EXPORT_SYMBOL_GPL(dccp_state_name);
-
int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
{
struct dccp_sock *dp = dccp_sk(sk);
--- a/net/dccp/feat.h 2010-10-05 23:12:45.999118130 +0900
+++ b/net/dccp/feat.h 2010-10-05 23:13:10.347118219 +0900
@@ -111,7 +111,6 @@ extern int dccp_feat_init(struct sock *
extern void dccp_feat_initialise_sysctls(void);
extern int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local,
u8 const *list, u8 len);
-extern int dccp_feat_register_nn(struct sock *sk, u8 feat, u64 val);
extern int dccp_feat_parse_options(struct sock *, struct dccp_request_sock *,
u8 mand, u8 opt, u8 feat, u8 *val, u8 len);
extern int dccp_feat_clone_list(struct list_head const *, struct list_head *);
^ 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