* [PATCH] IPv4: route.c: Change checks against 0xffffffff to ipv4_is_lbcast()
From: Andy Walls @ 2010-10-18 1:11 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel, kuznet, jmorris, kaber
Change a few checks against the hardcoded broadcast address,
0xffffffff, to ipv4_is_lbcast(). Remove some existing checks
using ipv4_is_lbcast() that are now obviously superfluous.
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
---
net/ipv4/route.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 3f56b6e..d78c764 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2124,7 +2124,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
ipv4_is_loopback(saddr))
goto martian_source;
- if (daddr == htonl(0xFFFFFFFF) || (saddr == 0 && daddr == 0))
+ if (ipv4_is_lbcast(daddr) || (saddr == 0 && daddr == 0))
goto brd_input;
/* Accept zero addresses only to limited broadcast;
@@ -2133,8 +2133,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (ipv4_is_zeronet(saddr))
goto martian_source;
- if (ipv4_is_lbcast(daddr) || ipv4_is_zeronet(daddr) ||
- ipv4_is_loopback(daddr))
+ if (ipv4_is_zeronet(daddr) || ipv4_is_loopback(daddr))
goto martian_destination;
/*
@@ -2370,11 +2369,11 @@ static int __mkroute_output(struct rtable **result,
if (ipv4_is_loopback(fl->fl4_src) && !(dev_out->flags&IFF_LOOPBACK))
return -EINVAL;
- if (fl->fl4_dst == htonl(0xFFFFFFFF))
+ if (ipv4_is_lbcast(fl->fl4_dst))
res->type = RTN_BROADCAST;
else if (ipv4_is_multicast(fl->fl4_dst))
res->type = RTN_MULTICAST;
- else if (ipv4_is_lbcast(fl->fl4_dst) || ipv4_is_zeronet(fl->fl4_dst))
+ else if (ipv4_is_zeronet(fl->fl4_dst))
return -EINVAL;
if (dev_out->flags & IFF_LOOPBACK)
@@ -2543,7 +2542,7 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
if (oldflp->oif == 0 &&
(ipv4_is_multicast(oldflp->fl4_dst) ||
- oldflp->fl4_dst == htonl(0xFFFFFFFF))) {
+ ipv4_is_lbcast(oldflp->fl4_dst))) {
/* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
dev_out = ip_dev_find(net, oldflp->fl4_src);
if (dev_out == NULL)
@@ -2592,7 +2591,7 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
}
if (ipv4_is_local_multicast(oldflp->fl4_dst) ||
- oldflp->fl4_dst == htonl(0xFFFFFFFF)) {
+ ipv4_is_lbcast(oldflp->fl4_dst)) {
if (!fl.fl4_src)
fl.fl4_src = inet_select_addr(dev_out, 0,
RT_SCOPE_LINK);
--
1.7.2.3
^ permalink raw reply related
* Re: [PATCH 1/6] r8169: check dma mapping failures
From: Stanislaw Gruszka @ 2010-10-18 7:01 UTC (permalink / raw)
To: Denis Kirjanov; +Cc: Francois Romieu, netdev, David S. Miller
In-Reply-To: <AANLkTimwwhBJdoXcvSt-wdTGv5biHJj094s0TutFM66N@mail.gmail.com>
On Fri, Oct 15, 2010 at 06:23:55PM +0400, Denis Kirjanov wrote:
> Right, we should pass TX_BUSY to upper layers only when the device hw
> queue is full
>
> On Fri, Oct 15, 2010 at 5:41 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
> > Stanislaw Gruszka <sgruszka@redhat.com> :
> >> Check possible dma mapping errors and do clean up if it happens,
> >> when sending frames stop the tx queue.
> >
> > Almost ok: NETDEV_TX_BUSY can not be used like that. Afaik the DMA
> > failure path in the driver really wants a NETDEV_TX_OK (and a device
> > stats update, though missing in tg3 ?).
Ok, I will change that and repost on top of currently applied Eric's
patch.
Stanislaw
^ permalink raw reply
* linux-next: build failure after merge of the final tree (net tree related)
From: Stephen Rothwell @ 2010-10-18 7:36 UTC (permalink / raw)
To: David Miller, netdev; +Cc: linux-next, linux-kernel, stephen hemminger
[-- Attachment #1: Type: text/plain, Size: 500 bytes --]
Hi all,
After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:
net/tipc/core.c:249: error: __ksymtab_tipc_get_mode causes a section type conflict
Caused by commit 31e3c3f6f1f9b154981a0e6620df700463db30ee ("tipc: cleanup
function namespace") which made the EXPORTed function tipc_get_mode() static.
I have reverted that commit for today.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: linux-next: build failure after merge of the final tree (net tree related)
From: David Miller @ 2010-10-18 8:06 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, shemminger
In-Reply-To: <20101018183616.ef5cde84.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 18 Oct 2010 18:36:16 +1100
> net/tipc/core.c:249: error: __ksymtab_tipc_get_mode causes a section type conflict
>
> Caused by commit 31e3c3f6f1f9b154981a0e6620df700463db30ee ("tipc: cleanup
> function namespace") which made the EXPORTed function tipc_get_mode() static.
>
> I have reverted that commit for today.
Thanks I just pushed this fix:
--------------------
tipc: Kill tipc_get_mode() completely.
It's completely unused and exporting a static symbol
makes no sense and breaks the build.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/tipc/core.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/net/tipc/core.c b/net/tipc/core.c
index c005303..e2a09eb 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -96,11 +96,6 @@ int tipc_net_id;
int tipc_remote_management;
-static int tipc_get_mode(void)
-{
- return tipc_mode;
-}
-
/**
* tipc_buf_acquire - creates a TIPC message buffer
* @size: message size (including TIPC header)
@@ -246,7 +241,6 @@ MODULE_VERSION(TIPC_MOD_VER);
EXPORT_SYMBOL(tipc_attach);
EXPORT_SYMBOL(tipc_detach);
-EXPORT_SYMBOL(tipc_get_mode);
EXPORT_SYMBOL(tipc_createport);
EXPORT_SYMBOL(tipc_deleteport);
EXPORT_SYMBOL(tipc_ownidentity);
--
1.7.3.1
^ permalink raw reply related
* RE: [PATCH v12 12/17] Add mp(mediate passthru) device.
From: Xin, Xiaohui @ 2010-10-18 8:30 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: netdev@vger.kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, mingo@elte.hu, davem@davemloft.net,
herbert@gondor.hengli.com.au, jdike@linux.intel.com
In-Reply-To: <20101003131254.GB19184@redhat.com>
>-----Original Message-----
>From: Michael S. Tsirkin [mailto:mst@redhat.com]
>Sent: Sunday, October 03, 2010 9:13 PM
>To: Xin, Xiaohui
>Cc: netdev@vger.kernel.org; kvm@vger.kernel.org; linux-kernel@vger.kernel.org;
>mingo@elte.hu; davem@davemloft.net; herbert@gondor.hengli.com.au;
>jdike@linux.intel.com
>Subject: Re: [PATCH v12 12/17] Add mp(mediate passthru) device.
>
>On Thu, Sep 30, 2010 at 10:04:30PM +0800, xiaohui.xin@intel.com wrote:
>> From: Xin Xiaohui <xiaohui.xin@intel.com>
>>
>> The patch add mp(mediate passthru) device, which now
>> based on vhost-net backend driver and provides proto_ops
>> to send/receive guest buffers data from/to guest vitio-net
>> driver.
>>
>> Signed-off-by: Xin Xiaohui <xiaohui.xin@intel.com>
>> Signed-off-by: Zhao Yu <yzhao81new@gmail.com>
>> Reviewed-by: Jeff Dike <jdike@linux.intel.com>
>
>So you plan to rewrite all this to make this code part of macvtap?
>
V13 exports functions which can be reused by macvtap to get zero-copy.
Currently, I'm adding code in macvtap and trying to make it work.
Thanks
Xiaohui
^ permalink raw reply
* Re: [patch] ns83820: spin_lock_irq() => spin_lock()
From: David Miller @ 2010-10-18 8:53 UTC (permalink / raw)
To: error27; +Cc: netdev, kernel-janitors, mingo
In-Reply-To: <20101013191852.GD6060@bicker>
From: Dan Carpenter <error27@gmail.com>
Date: Wed, 13 Oct 2010 21:18:53 +0200
> This is essentially cosmetic. At this point the IRQs are already
> disabled because we called spin_lock_irq(&dev->rx_info.lock).
>
> The real bug here was fixed back in 2006 in 3a10ccebe: "[PATCH] lock
> validator: fix ns83820.c irq-flags bug". Prior to that patch, it was
> a "spin_lock_irq is not nestable" type bug. The 2006 patch changes the
> unlock to not re-enable IRQs, which eliminates the potential deadlock.
>
> But this bit was missed. We should change the lock function as well so
> it balances nicely.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply
* Re: [patch] gianfar: fix double lock typo
From: David Miller @ 2010-10-18 8:55 UTC (permalink / raw)
To: error27; +Cc: Sandeep.Kumar, netdev, kernel-janitors
In-Reply-To: <20101013191954.GE6060@bicker>
From: Dan Carpenter <error27@gmail.com>
Date: Wed, 13 Oct 2010 21:19:55 +0200
> This should be a _restore() instead of a _save().
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Good find, applied, thanks!
^ permalink raw reply
* Re: [RFC PATCH 1/9] ipvs network name space aware
From: Daniel Lezcano @ 2010-10-18 8:59 UTC (permalink / raw)
To: Hans Schillstrom; +Cc: lvs-devel, netdev, netfilter-devel, horms, ja, wensong
In-Reply-To: <201010081316.46690.hans.schillstrom@ericsson.com>
On 10/08/2010 01:16 PM, Hans Schillstrom wrote:
> This part contains the include files
> where include/net/netns/ip_vs.h is new and contains all moved vars.
>
> SUMMARY
>
> include/net/ip_vs.h | 136 ++++---
> include/net/net_namespace.h | 2 +
> include/net/netns/ip_vs.h | 112 +++++
>
> Signed-off-by:Hans Schillstrom<hans.schillstrom@ericsson.com>
> ---
>
>
[ ... ]
> #ifdef CONFIG_IP_VS_IPV6
> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> index bd10a79..b59cdc5 100644
> --- a/include/net/net_namespace.h
> +++ b/include/net/net_namespace.h
> @@ -15,6 +15,7 @@
> #include<net/netns/ipv4.h>
> #include<net/netns/ipv6.h>
> #include<net/netns/dccp.h>
> +#include<net/netns/ip_vs.h>
> #include<net/netns/x_tables.h>
> #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
> #include<net/netns/conntrack.h>
> @@ -91,6 +92,7 @@ struct net {
> struct sk_buff_head wext_nlevents;
> #endif
> struct net_generic *gen;
> + struct netns_ipvs *ipvs;
> };
>
IMHO, it would be better to use the net_generic infra-structure instead
of adding a new field in the netns structure.
^ permalink raw reply
* [PATCH net-next 1/6] bnx2x: Optimized the branching in the bnx2x_rx_int()
From: Dmitry Kravkov @ 2010-10-18 9:02 UTC (permalink / raw)
To: davem, netdev; +Cc: eilong, vladz
From: Vladislav Zolotarov <vladz@broadcom.com>
Optimized the branching in the bnx2x_rx_int() based on the fact
that FP CQE will always have at least one of START or STOP flags set,
so if not both bits are set and START bit is not set,
then it's a STOP bit that is set.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_cmn.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 97ef674..cb2a3d6 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -507,8 +507,11 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
len = le16_to_cpu(cqe->fast_path_cqe.pkt_len);
pad = cqe->fast_path_cqe.placement_offset;
- /* If CQE is marked both TPA_START and TPA_END
- it is a non-TPA CQE */
+ /* - If CQE is marked both TPA_START and TPA_END it is
+ * a non-TPA CQE.
+ * - FP CQE will always have either TPA_START or/and
+ * TPA_STOP flags set.
+ */
if ((!fp->disable_tpa) &&
(TPA_TYPE(cqe_fp_flags) !=
(TPA_TYPE_START | TPA_TYPE_END))) {
@@ -526,9 +529,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
bnx2x_set_skb_rxhash(bp, cqe, skb);
goto next_rx;
- }
-
- if (TPA_TYPE(cqe_fp_flags) == TPA_TYPE_END) {
+ } else { /* TPA_STOP */
DP(NETIF_MSG_RX_STATUS,
"calling tpa_stop on queue %d\n",
queue);
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 2/6] bnx2x: remove redundant commands during error handling
From: Dmitry Kravkov @ 2010-10-18 9:05 UTC (permalink / raw)
To: davem, netdev; +Cc: Eilon Greenstein, Vladislav Zolotarov
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_cmn.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index ddf90e1..3f0540c 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -1288,8 +1288,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
if (rc) {
BNX2X_ERR("HW init failed, aborting\n");
bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_DONE, 0);
- bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP, 0);
- bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0);
goto load_error2;
}
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 5/6] bnx2x: remove unnecessary FUNC_FLG_RSS flag and related
From: Dmitry Kravkov @ 2010-10-18 9:08 UTC (permalink / raw)
To: davem, netdev; +Cc: Eilon Greenstein, Vladislav Zolotarov
As suggested by: Joe Perches <joe@perches.com>
Although RSS is meaningless when there is a single HW queue we
still need it enabled in order to have HW Rx hash generated.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x.h | 13 ++-----
drivers/net/bnx2x/bnx2x_main.c | 70 +++++++++++++++++-----------------------
2 files changed, 34 insertions(+), 49 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index c49b643..556cad5 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1180,15 +1180,10 @@ struct bnx2x {
TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY
/* func init flags */
-#define FUNC_FLG_RSS 0x0001
-#define FUNC_FLG_STATS 0x0002
-/* removed FUNC_FLG_UNMATCHED 0x0004 */
-#define FUNC_FLG_TPA 0x0008
-#define FUNC_FLG_SPQ 0x0010
-#define FUNC_FLG_LEADING 0x0020 /* PF only */
-
-#define FUNC_CONFIG(flgs) ((flgs) & (FUNC_FLG_RSS | FUNC_FLG_TPA | \
- FUNC_FLG_LEADING))
+#define FUNC_FLG_STATS 0x0001
+#define FUNC_FLG_TPA 0x0002
+#define FUNC_FLG_SPQ 0x0004
+#define FUNC_FLG_LEADING 0x0008 /* PF only */
struct rxq_pause_params {
u16 bd_th_lo;
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index ead524b..012c093 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -2284,35 +2284,31 @@ void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters)
void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p)
{
- if (FUNC_CONFIG(p->func_flgs)) {
- struct tstorm_eth_function_common_config tcfg = {0};
-
- /* tpa */
- if (p->func_flgs & FUNC_FLG_TPA)
- tcfg.config_flags |=
- TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;
-
- /* set rss flags */
- if (p->func_flgs & FUNC_FLG_RSS) {
- u16 rss_flgs = (p->rss->mode <<
- TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);
-
- if (p->rss->cap & RSS_IPV4_CAP)
- rss_flgs |= RSS_IPV4_CAP_MASK;
- if (p->rss->cap & RSS_IPV4_TCP_CAP)
- rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
- if (p->rss->cap & RSS_IPV6_CAP)
- rss_flgs |= RSS_IPV6_CAP_MASK;
- if (p->rss->cap & RSS_IPV6_TCP_CAP)
- rss_flgs |= RSS_IPV6_TCP_CAP_MASK;
-
- tcfg.config_flags |= rss_flgs;
- tcfg.rss_result_mask = p->rss->result_mask;
+ struct tstorm_eth_function_common_config tcfg = {0};
+ u16 rss_flgs;
- }
+ /* tpa */
+ if (p->func_flgs & FUNC_FLG_TPA)
+ tcfg.config_flags |=
+ TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;
- storm_memset_func_cfg(bp, &tcfg, p->func_id);
- }
+ /* set rss flags */
+ rss_flgs = (p->rss->mode <<
+ TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);
+
+ if (p->rss->cap & RSS_IPV4_CAP)
+ rss_flgs |= RSS_IPV4_CAP_MASK;
+ if (p->rss->cap & RSS_IPV4_TCP_CAP)
+ rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
+ if (p->rss->cap & RSS_IPV6_CAP)
+ rss_flgs |= RSS_IPV6_CAP_MASK;
+ if (p->rss->cap & RSS_IPV6_TCP_CAP)
+ rss_flgs |= RSS_IPV6_TCP_CAP_MASK;
+
+ tcfg.config_flags |= rss_flgs;
+ tcfg.rss_result_mask = p->rss->result_mask;
+
+ storm_memset_func_cfg(bp, &tcfg, p->func_id);
/* Enable the function in the FW */
storm_memset_vf_to_pf(bp, p->func_id, p->pf_id);
@@ -2479,23 +2475,17 @@ void bnx2x_pf_init(struct bnx2x *bp)
else
flags |= FUNC_FLG_TPA;
+ /* function setup */
+
/**
* Although RSS is meaningless when there is a single HW queue we
* still need it enabled in order to have HW Rx hash generated.
- *
- * if (is_eth_multi(bp))
- * flags |= FUNC_FLG_RSS;
*/
- flags |= FUNC_FLG_RSS;
-
- /* function setup */
- if (flags & FUNC_FLG_RSS) {
- rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP |
- RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
- rss.mode = bp->multi_mode;
- rss.result_mask = MULTI_MASK;
- func_init.rss = &rss;
- }
+ rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP |
+ RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
+ rss.mode = bp->multi_mode;
+ rss.result_mask = MULTI_MASK;
+ func_init.rss = &rss;
func_init.func_flgs = flags;
func_init.pf_id = BP_FUNC(bp);
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 0/6] bnx2x: patch series
From: Dmitry Kravkov @ 2010-10-18 8:59 UTC (permalink / raw)
To: davem; +Cc: netdev, eilong, vladz
Hi Dave,
This is the respin of previous series with following changes:
1. removed patch with gso_size
2. removed FUNC_FLG_RSS flag and appropriate "if"s (as suggested by Joe Perches)
3. update version
Please, consider applying to net-next
Thanks
Dmitry
^ permalink raw reply
* [PATCH net-next 6/6] bnx2x: update version to 1.60.00-2
From: Dmitry Kravkov @ 2010-10-18 9:08 UTC (permalink / raw)
To: davem, netdev; +Cc: Eilon Greenstein, Vladislav Zolotarov
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 7d7af10..b387717 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -20,8 +20,8 @@
* (you will need to reboot afterwards) */
/* #define BNX2X_STOP_ON_ERROR */
-#define DRV_MODULE_VERSION "1.60.00-1"
-#define DRV_MODULE_RELDATE "2010/10/06"
+#define DRV_MODULE_VERSION "1.60.00-2"
+#define DRV_MODULE_RELDATE "2010/10/18"
#define BNX2X_BC_VER 0x040200
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
--
1.7.2.2
^ permalink raw reply related
* [PATCH net-next 3/6] bnx2x: do not deal with power if no capability
From: Dmitry Kravkov @ 2010-10-18 9:10 UTC (permalink / raw)
To: davem, netdev; +Cc: Eilon Greenstein, Vladislav Zolotarov
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_cmn.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 3f0540c..9a3208e 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -1520,6 +1520,12 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state)
{
u16 pmcsr;
+ /* If there is no power capability, silently succeed */
+ if (!bp->pm_cap) {
+ DP(NETIF_MSG_HW, "No power capability. Breaking.\n");
+ return 0;
+ }
+
pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);
switch (state) {
--
1.7.1
^ permalink raw reply related
* [PATCH net-next 4/6] bnx2x: Use correct FW constant for header padding
From: Dmitry Kravkov @ 2010-10-18 9:09 UTC (permalink / raw)
To: davem, netdev; +Cc: Eilon Greenstein, Vladislav Zolotarov
the value of the constant is the same, but it's clearer to use original
constant provided by HSI
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_cmn.c | 2 +-
drivers/net/bnx2x/bnx2x_cmn.h | 2 --
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 9a3208e..29ed500 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -830,7 +830,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp)
int i, j;
bp->rx_buf_size = bp->dev->mtu + ETH_OVREHEAD + BNX2X_RX_ALIGN +
- BNX2X_FW_IP_HDR_ALIGN_PAD;
+ IP_HEADER_ALIGNMENT_PADDING;
DP(NETIF_MSG_IFUP,
"mtu %d rx_buf_size %d\n", bp->dev->mtu, bp->rx_buf_size);
diff --git a/drivers/net/bnx2x/bnx2x_cmn.h b/drivers/net/bnx2x/bnx2x_cmn.h
index 7f52cec..5bfe0ab 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/bnx2x/bnx2x_cmn.h
@@ -1032,6 +1032,4 @@ static inline void storm_memset_cmng(struct bnx2x *bp,
void bnx2x_acquire_phy_lock(struct bnx2x *bp);
void bnx2x_release_phy_lock(struct bnx2x *bp);
-#define BNX2X_FW_IP_HDR_ALIGN_PAD 2 /* FW places hdr with this padding */
-
#endif /* BNX2X_CMN_H */
--
1.7.1
^ permalink raw reply related
* Re: [PATCH resend] netfilter: fix kconfig unmet dependency warning
From: Patrick McHardy @ 2010-10-18 9:14 UTC (permalink / raw)
To: Randy Dunlap; +Cc: netdev, davem, netfilter-devel
In-Reply-To: <20101016191103.ba9b2e7e.randy.dunlap@oracle.com>
Am 17.10.2010 04:11, schrieb Randy Dunlap:
> Fix netfilter kconfig unmet dependencies warning & spell out
> "compatible" while there.
>
> warning: (IP_NF_TARGET_TTL && NET && INET && NETFILTER && IP_NF_IPTABLES && NETFILTER_ADVANCED || IP6_NF_TARGET_HL && NET && INET && IPV6 && NETFILTER && IP6_NF_IPTABLES && NETFILTER_ADVANCED) selects NETFILTER_XT_TARGET_HL which has unmet direct dependencies ((IP_NF_MANGLE || IP6_NF_MANGLE) && NETFILTER_ADVANCED)
Applied, thanks.
^ permalink raw reply
* Re: [PATCH V2 0/7] can: mcp251x: fix and optimize driver
From: Marc Kleine-Budde @ 2010-10-18 9:19 UTC (permalink / raw)
To: Wolfgang Grandegger
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4CBB0851.9060601-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 510 bytes --]
On 10/17/2010 04:29 PM, Wolfgang Grandegger wrote:
> Acked-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
tnx, I'm going to repost the series with you Ack and ask David to pull
it to net-next-2.6.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [RFC PATCH 1/9] ipvs network name space aware
From: Hans Schillstrom @ 2010-10-18 9:54 UTC (permalink / raw)
To: Daniel Lezcano
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, horms@verge.net.au, ja@ssi.bg,
wensong@linux-vs.org
In-Reply-To: <4CBC0C6D.1080303@free.fr>
On Monday 18 October 2010 10:59:25 Daniel Lezcano wrote:
> On 10/08/2010 01:16 PM, Hans Schillstrom wrote:
> > This part contains the include files
> > where include/net/netns/ip_vs.h is new and contains all moved vars.
> >
> > SUMMARY
> >
> > include/net/ip_vs.h | 136 ++++---
> > include/net/net_namespace.h | 2 +
> > include/net/netns/ip_vs.h | 112 +++++
> >
> > Signed-off-by:Hans Schillstrom<hans.schillstrom@ericsson.com>
> > ---
> >
> >
>
> [ ... ]
>
> > #ifdef CONFIG_IP_VS_IPV6
> > diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> > index bd10a79..b59cdc5 100644
> > --- a/include/net/net_namespace.h
> > +++ b/include/net/net_namespace.h
> > @@ -15,6 +15,7 @@
> > #include<net/netns/ipv4.h>
> > #include<net/netns/ipv6.h>
> > #include<net/netns/dccp.h>
> > +#include<net/netns/ip_vs.h>
> > #include<net/netns/x_tables.h>
> > #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
> > #include<net/netns/conntrack.h>
> > @@ -91,6 +92,7 @@ struct net {
> > struct sk_buff_head wext_nlevents;
> > #endif
> > struct net_generic *gen;
> > + struct netns_ipvs *ipvs;
> > };
> >
>
> IMHO, it would be better to use the net_generic infra-structure instead
> of adding a new field in the netns structure.
>
>
I realized that to, but the performance penalty is quite high with net_generic :-(
But on the other hand if you are going to backport it, (without recompiling the kernel)
you gonna need it!
My sugestion, take both with a configuration switch like:
(i.e. avoid the rcu locking)
--- net/ip_vs.h ---
...
extern int ip_vs_net_id; /* net id for ip_vs */
static inline struct netns_ipvs * net_ipvs(struct net* net, int id) {
#ifdef CONFIG_IP_VS_FAST_NETNS
return net->ipvs;
#else
return (struct netns_ipvs *)net_generic(net, id);
#endif
}
...
and where you need the netns_ipvs struct ptr,
[snip]
struct ip_vs_conn *ip_vs_conn_in_get(struct net *net, ....
{
struct netns_ipvs *ipvs = net_ipvs(net, ip_vs_net_id);
...
--
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>
^ permalink raw reply
* Re: [PATCH net-next 3/5] tipc: Optimizations to bearer enabling logic
From: Neil Horman @ 2010-10-18 10:50 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: davem, netdev, allan.stephens
In-Reply-To: <4CB8C824.7090800@windriver.com>
On Fri, Oct 15, 2010 at 05:31:16PM -0400, Paul Gortmaker wrote:
> On 10-10-15 07:00 AM, Neil Horman wrote:
>
> [...]
>
> > This definately looks more concise, but I don't see why its necessecary to drop
> > the tipc_net_lock around the call to enable_bearer. The only caler of
> > tipc_register_media sets the enable_bearer pointer to the enable_bearer
> > function, and I' don't see any path through that function which would
> > potentially retake that lock. In fact it seems dropping it might be dangerous,
> > if other paths (like from cfg_named_msg_event), tried to enable a bearer in
> > parallel with a user space directive from the netlink socket). With out the
> > protection of tipc_net_lock, you could use the same eth_bearer twice, and
> > corrupt that array.
>
> I think it would be protected by config_lock. but in the end if it is
> just an academic optimization that really isn't in a hot code path
> anyway, and if it just adds more confusion than real world value, then
> I'm fine with just dropping this on the floor (and deleting the extra
> memset in a cleanup patch) -- it won't be the 1st time doing this with
> these carry forward patches, and I'm sure it won't be the last.
>
Copy that.
>
^ permalink raw reply
* [MeeGo-Dev] can: How to set bitrate
From: Masayuki Ohtake @ 2010-10-18 10:56 UTC (permalink / raw)
To: Wolfgang Grandegger, David S. Miller, Wolfram Sang,
Christian Pellegrin, "Barry Song" <2
Cc: andrew.chih.howe.khor, Wang, Qi, Foster, Margie, Wang, Yong Y,
Ewe, Kok Howg, Tomoya MORINAGA, Intel OTC
I want to test our Socket CAN driver(for Topcliff) on Meego1.0.
For setting bitrate, I tried to install "iproute2". But the build failed.
================================================
[root@localhost iproute2-2.6.33]# make
sh configure
TC schedulers
ATM no
IPT using iptables
make[1]: Entering directory `/root/iproute2-2.6.33/lib'
<omission>
ude -o arpd arpd.c ../lib/libnetlink.a ../lib/libutil.a -ldb -lpthread
arpd.c:19:20: error: db_185.h: No such file or directory
arpd.c:42: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
arpd.c: In function 'do_one_request':
arpd.c:304: error: 'DBT' undeclared (first use in this function)
arpd.c:304: error: (Each undeclared identifier is reported only once
arpd.c:304: error: for each function it appears in.)
arpd.c:304: error: expected ';' before 'dbkey'
arpd.c:308: error: 'dbase' undeclared (first use in this function)
arpd.c:338: error: 'dbkey' undeclared (first use in this function)
arpd.c:341: error: 'dbdat' undeclared (first use in this function)
arpd.c: In function 'get_arp_pkt':
arpd.c:485: error: 'DBT' undeclared (first use in this function)
arpd.c:485: error: expected ';' before 'dbkey'
arpd.c:517: error: 'dbkey' undeclared (first use in this function)
arpd.c:520: error: 'dbase' undeclared (first use in this function)
arpd.c:520: error: 'dbdat' undeclared (first use in this function)
arpd.c: In function 'main':
arpd.c:670: error: 'dbase' undeclared (first use in this function)
arpd.c:670: warning: implicit declaration of function 'dbopen'
arpd.c:670: error: 'DB_HASH' undeclared (first use in this function)
arpd.c:680: error: 'DBT' undeclared (first use in this function)
arpd.c:680: error: expected ';' before 'dbkey'
arpd.c:682: error: 'dbkey' undeclared (first use in this function)
arpd.c:712: error: 'dbdat' undeclared (first use in this function)
arpd.c:728: error: expected ';' before 'dbkey'
arpd.c:730: error: 'R_NEXT' undeclared (first use in this function)
make[1]: *** [arpd] Error 1
make[1]: Leaving directory `/root/iproute2/misc'
make: *** [all] Error 2
[root@localhost iproute2]#
================================================
Do you know how to set bitrate on Meego?
Thanks, Ohtake(OKISemi)
^ permalink raw reply
* Re: [MeeGo-Dev] can: How to set bitrate
From: Wolfgang Grandegger @ 2010-10-18 11:05 UTC (permalink / raw)
To: Masayuki Ohtake
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w, Samuel Ortiz,
Foster, Margie, ML netdev, ML linux-kernel,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w, Wang, Yong Y,
Ewe, Kok Howg, Intel OTC, Tomoya MORINAGA, David S. Miller,
Christian Pellegrin, Wang, Qi
In-Reply-To: <000b01cb6eb3$1afcfd60$66f8800a-a06+6cuVnkTSQfdrb5gaxUEOCMrvLtNR@public.gmane.org>
On 10/18/2010 12:56 PM, Masayuki Ohtake wrote:
> I want to test our Socket CAN driver(for Topcliff) on Meego1.0.
>
> For setting bitrate, I tried to install "iproute2". But the build failed.
>
> ================================================
> [root@localhost iproute2-2.6.33]# make
> sh configure
> TC schedulers
> ATM no
> IPT using iptables
> make[1]: Entering directory `/root/iproute2-2.6.33/lib'
>
> <omission>
>
> ude -o arpd arpd.c ../lib/libnetlink.a ../lib/libutil.a -ldb -lpthread
> arpd.c:19:20: error: db_185.h: No such file or directory
> arpd.c:42: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
> arpd.c: In function 'do_one_request':
> arpd.c:304: error: 'DBT' undeclared (first use in this function)
> arpd.c:304: error: (Each undeclared identifier is reported only once
> arpd.c:304: error: for each function it appears in.)
> arpd.c:304: error: expected ';' before 'dbkey'
> arpd.c:308: error: 'dbase' undeclared (first use in this function)
> arpd.c:338: error: 'dbkey' undeclared (first use in this function)
> arpd.c:341: error: 'dbdat' undeclared (first use in this function)
> arpd.c: In function 'get_arp_pkt':
> arpd.c:485: error: 'DBT' undeclared (first use in this function)
> arpd.c:485: error: expected ';' before 'dbkey'
> arpd.c:517: error: 'dbkey' undeclared (first use in this function)
> arpd.c:520: error: 'dbase' undeclared (first use in this function)
> arpd.c:520: error: 'dbdat' undeclared (first use in this function)
> arpd.c: In function 'main':
> arpd.c:670: error: 'dbase' undeclared (first use in this function)
> arpd.c:670: warning: implicit declaration of function 'dbopen'
> arpd.c:670: error: 'DB_HASH' undeclared (first use in this function)
> arpd.c:680: error: 'DBT' undeclared (first use in this function)
> arpd.c:680: error: expected ';' before 'dbkey'
> arpd.c:682: error: 'dbkey' undeclared (first use in this function)
> arpd.c:712: error: 'dbdat' undeclared (first use in this function)
> arpd.c:728: error: expected ';' before 'dbkey'
> arpd.c:730: error: 'R_NEXT' undeclared (first use in this function)
> make[1]: *** [arpd] Error 1
> make[1]: Leaving directory `/root/iproute2/misc'
> make: *** [all] Error 2
> [root@localhost iproute2]#
> ================================================
On my system I get:
~$ rpm -qf /usr/include/db_185.h
db4-devel-4.7.25-13.fc12.i686
Which means you need db4 devel to fully build iproute2.
> Do you know how to set bitrate on Meego?
ip from iproute2 is the right tool.
Wolfgang.
^ permalink raw reply
* Requesting For Your Partnersip!!!
From: Wen Lee @ 2010-10-18 11:06 UTC (permalink / raw)
--
My name is Mr. Wen Lee an account officer with the Bank of Taipei, I am requesting for your partnership in re-profiling funds and you will be paid 30% for your management fees; Contact me for details.
^ permalink raw reply
* Re: [RFC PATCH 1/9] ipvs network name space aware
From: Daniel Lezcano @ 2010-10-18 11:37 UTC (permalink / raw)
To: Hans Schillstrom
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, horms@verge.net.au, ja@ssi.bg,
wensong@linux-vs.org
In-Reply-To: <201010181154.35792.hans.schillstrom@ericsson.com>
On 10/18/2010 11:54 AM, Hans Schillstrom wrote:
> On Monday 18 October 2010 10:59:25 Daniel Lezcano wrote:
>
>> On 10/08/2010 01:16 PM, Hans Schillstrom wrote:
>>
>>> This part contains the include files
>>> where include/net/netns/ip_vs.h is new and contains all moved vars.
>>>
>>> SUMMARY
>>>
>>> include/net/ip_vs.h | 136 ++++---
>>> include/net/net_namespace.h | 2 +
>>> include/net/netns/ip_vs.h | 112 +++++
>>>
>>> Signed-off-by:Hans Schillstrom<hans.schillstrom@ericsson.com>
>>> ---
>>>
>>>
>>>
>> [ ... ]
>>
>>
>>> #ifdef CONFIG_IP_VS_IPV6
>>> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
>>> index bd10a79..b59cdc5 100644
>>> --- a/include/net/net_namespace.h
>>> +++ b/include/net/net_namespace.h
>>> @@ -15,6 +15,7 @@
>>> #include<net/netns/ipv4.h>
>>> #include<net/netns/ipv6.h>
>>> #include<net/netns/dccp.h>
>>> +#include<net/netns/ip_vs.h>
>>> #include<net/netns/x_tables.h>
>>> #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
>>> #include<net/netns/conntrack.h>
>>> @@ -91,6 +92,7 @@ struct net {
>>> struct sk_buff_head wext_nlevents;
>>> #endif
>>> struct net_generic *gen;
>>> + struct netns_ipvs *ipvs;
>>> };
>>>
>>>
>> IMHO, it would be better to use the net_generic infra-structure instead
>> of adding a new field in the netns structure.
>>
>>
>>
> I realized that to, but the performance penalty is quite high with net_generic :-(
> But on the other hand if you are going to backport it, (without recompiling the kernel)
> you gonna need it!
>
Hmm, yes. We don't want to have the init_net_ns performances to be impacted.
You use here a pointer which will be dereferenced like the net_generic,
I don't think there will be
a big difference between using net_generic and using a pointer in the
net namespace structure.
The difference is the id usage, but this one is based on the idr which
is quite fast.
We should experiment a bit here to compare both solutions.
IMHO, we can (1) create a non-pointer netns_ipvs field in the net
namespace structure or (2) use a pointer [with net_generic].
(1) is the faster but with the drawback of having a bigger memory
footprint even if the ipvs module is not loaded.
In this case we have to take care of what we store in the netns_ipvs
structure, that is reduce the per namespace table and so. At the first
glance, I think we can reduce this to the sysctls and a very few data,
for example using global tables tagged with the namespace and we don't
break the cacheline alignment optimization.
(2) is slower but as the memory is allocated and freed when the module
is loaded/unloaded. What I don't like with this approach is we add some
overhead even if the netns is not compiled in the kernel.
> My sugestion, take both with a configuration switch like:
> (i.e. avoid the rcu locking)
>
> --- net/ip_vs.h ---
> ...
> extern int ip_vs_net_id; /* net id for ip_vs */
>
>
> static inline struct netns_ipvs * net_ipvs(struct net* net, int id) {
> #ifdef CONFIG_IP_VS_FAST_NETNS
> return net->ipvs;
> #else
> return (struct netns_ipvs *)net_generic(net, id);
> #endif
> }
> ...
>
> and where you need the netns_ipvs struct ptr,
> [snip]
> struct ip_vs_conn *ip_vs_conn_in_get(struct net *net, ....
> {
> struct netns_ipvs *ipvs = net_ipvs(net, ip_vs_net_id);
> ...
>
It is a nice way to wrap both solutions but at this point I don't think
it is worth to add a 3rd option to compile ipvs.
^ permalink raw reply
* [PATCH] qlcnic: update ethtool stats
From: Amit Kumar Salecha @ 2010-10-18 11:47 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty
Added statistics for Nic Partition supported adapter.
These statistics are maintined in device.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic_ethtool.c | 73 +++++++++++++++++++++++++++++++++-
1 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 2568aa6..25e93a5 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -78,7 +78,25 @@ static const struct qlcnic_stats qlcnic_gstrings_stats[] = {
};
+static const char qlcnic_device_gstrings_stats[][ETH_GSTRING_LEN] = {
+ "rx unicast frames",
+ "rx multicast frames",
+ "rx broadcast frames",
+ "rx dropped frames",
+ "rx errors",
+ "rx local frames",
+ "rx numbytes",
+ "tx unicast frames",
+ "tx multicast frames",
+ "tx broadcast frames",
+ "tx dropped frames",
+ "tx errors",
+ "tx local frames",
+ "tx numbytes",
+};
+
#define QLCNIC_STATS_LEN ARRAY_SIZE(qlcnic_gstrings_stats)
+#define QLCNIC_DEVICE_STATS_LEN ARRAY_SIZE(qlcnic_device_gstrings_stats)
static const char qlcnic_gstrings_test[][ETH_GSTRING_LEN] = {
"Register_Test_on_offline",
@@ -625,10 +643,13 @@ static int qlcnic_reg_test(struct net_device *dev)
static int qlcnic_get_sset_count(struct net_device *dev, int sset)
{
+ struct qlcnic_adapter *adapter = netdev_priv(dev);
switch (sset) {
case ETH_SS_TEST:
return QLCNIC_TEST_LEN;
case ETH_SS_STATS:
+ if (adapter->flags & QLCNIC_ESWITCH_ENABLED)
+ return QLCNIC_STATS_LEN + QLCNIC_DEVICE_STATS_LEN;
return QLCNIC_STATS_LEN;
default:
return -EOPNOTSUPP;
@@ -795,7 +816,8 @@ qlcnic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
static void
qlcnic_get_strings(struct net_device *dev, u32 stringset, u8 * data)
{
- int index;
+ struct qlcnic_adapter *adapter = netdev_priv(dev);
+ int index, i;
switch (stringset) {
case ETH_SS_TEST:
@@ -808,16 +830,43 @@ qlcnic_get_strings(struct net_device *dev, u32 stringset, u8 * data)
qlcnic_gstrings_stats[index].stat_string,
ETH_GSTRING_LEN);
}
- break;
+ if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED))
+ return;
+ for (i = 0; i < QLCNIC_DEVICE_STATS_LEN; index++, i++) {
+ memcpy(data + index * ETH_GSTRING_LEN,
+ qlcnic_device_gstrings_stats[i],
+ ETH_GSTRING_LEN);
+ }
}
}
+#define QLCNIC_FILL_ESWITCH_STATS(VAL1) \
+ (((VAL1) == QLCNIC_ESW_STATS_NOT_AVAIL) ? 0 : VAL1)
+
+static void
+qlcnic_fill_device_stats(int *index, u64 *data,
+ struct __qlcnic_esw_statistics *stats)
+{
+ int ind = *index;
+
+ data[ind++] = QLCNIC_FILL_ESWITCH_STATS(stats->unicast_frames);
+ data[ind++] = QLCNIC_FILL_ESWITCH_STATS(stats->multicast_frames);
+ data[ind++] = QLCNIC_FILL_ESWITCH_STATS(stats->broadcast_frames);
+ data[ind++] = QLCNIC_FILL_ESWITCH_STATS(stats->dropped_frames);
+ data[ind++] = QLCNIC_FILL_ESWITCH_STATS(stats->errors);
+ data[ind++] = QLCNIC_FILL_ESWITCH_STATS(stats->local_frames);
+ data[ind++] = QLCNIC_FILL_ESWITCH_STATS(stats->numbytes);
+
+ *index = ind;
+}
+
static void
qlcnic_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 * data)
{
struct qlcnic_adapter *adapter = netdev_priv(dev);
- int index;
+ struct qlcnic_esw_statistics port_stats;
+ int index, ret;
for (index = 0; index < QLCNIC_STATS_LEN; index++) {
char *p =
@@ -827,6 +876,24 @@ qlcnic_get_ethtool_stats(struct net_device *dev,
(qlcnic_gstrings_stats[index].sizeof_stat ==
sizeof(u64)) ? *(u64 *)p:(*(u32 *)p);
}
+
+ if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED))
+ return;
+
+ memset(&port_stats, 0, sizeof(struct qlcnic_esw_statistics));
+ ret = qlcnic_get_port_stats(adapter, adapter->ahw.pci_func,
+ QLCNIC_QUERY_RX_COUNTER, &port_stats.rx);
+ if (ret)
+ return;
+
+ qlcnic_fill_device_stats(&index, data, &port_stats.rx);
+
+ ret = qlcnic_get_port_stats(adapter, adapter->ahw.pci_func,
+ QLCNIC_QUERY_TX_COUNTER, &port_stats.tx);
+ if (ret)
+ return;
+
+ qlcnic_fill_device_stats(&index, data, &port_stats.tx);
}
static int qlcnic_set_tx_csum(struct net_device *dev, u32 data)
--
1.6.0.2
^ permalink raw reply related
* __bad_udelay in network driver breaks build
From: Andi Kleen @ 2010-10-18 11:52 UTC (permalink / raw)
To: netdev
Current Linus master x86-64 allyesconfig fails with
drivers/built-in.o: In function `tms380tr_chipset_init':
tms380tr.c:(.text+0x10f02de): undefined reference to `__bad_udelay'
tms380tr.c:(.text+0x10f03ab): undefined reference to `__bad_udelay'
tms380tr.c:(.text+0x10f0400): undefined reference to `__bad_udelay'
tms380tr.c:(.text+0x10f07b2): undefined reference to `__bad_udelay'
tms380tr.c:(.text+0x10f08ed): undefined reference to `__bad_udelay'
make[2]: *** [.tmp_vmlinux1] Error 1
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ 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