* Re: [PATCH RFC 6/6] skbuff: set zerocopy flag on frag destructor
From: Michael S. Tsirkin @ 2012-05-08 12:46 UTC (permalink / raw)
To: Ian Campbell; +Cc: David Miller, netdev@vger.kernel.org, eric.dumazet@gmail.com
In-Reply-To: <7e4fb863d3936baa87d318d97103689304a3923c.1336397823.git.mst@redhat.com>
On Mon, May 07, 2012 at 04:54:57PM +0300, Michael S. Tsirkin wrote:
> set tx flags when adding a frag destructor to
> force frags to be orphaned as appropriate.
> copy when copying frags between skbs.
> Note: rare false positives (where flag is set with no
> destructors) are harmless.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Ugh. I somehow managed to mangle this last patch and send out
a version that defines skb_copy_frag_destructor twice.
The following is needed on top (not resubmitting everything as it's an
RFC, and needs to be part of Ian's patchset anyway. Sorry about the
noise.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2876e4d..5fbefc3 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -258,13 +258,6 @@ enum {
SKBTX_WIFI_STATUS = 1 << 5,
};
-static inline void skb_copy_frag_destructor(struct sk_buff *to,
- struct sk_buff *from)
-{
- skb_shinfo(to)->tx_flags |= skb_shinfo(from)->tx_flags &
- SKBTX_DEV_ZEROCOPY;
-}
-
/*
* The callback notifies userspace to release buffers when skb DMA is done in
* lower device, the skb last reference should be 0 when calling this.
^ permalink raw reply related
* Re: [PATCH RFC 2/6] skbuff: add an api to orphan frags
From: Michael S. Tsirkin @ 2012-05-08 12:47 UTC (permalink / raw)
To: Ian Campbell; +Cc: David Miller, netdev@vger.kernel.org, eric.dumazet@gmail.com
In-Reply-To: <3a000e3075bb234d628191be748423433d49a97c.1336397823.git.mst@redhat.com>
On Mon, May 07, 2012 at 04:54:36PM +0300, Michael S. Tsirkin wrote:
> Many places do
> if ((skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY))
> skb_copy_ubufs(skb, gfp_mask);
> to copy and invoke frag destructors if necessary.
> Add an inline helper for this.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> include/linux/skbuff.h | 24 ++++++++++++++++++++++++
> 1 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index bb78f70..28d842e 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -1711,6 +1711,30 @@ static inline void skb_orphan(struct sk_buff *skb)
> }
>
> /**
> + * skb_orphan_frags - orphan the frags contained in a buffer
> + * @skb: buffer to orphan frags from
> + * @gfp_mask: allocation mask for replacement pages
> + *
> + * For each frag in the SKB which needs a destructor (i.e. has an
> + * owner) create a copy of that frag and release the original
> + * page by calling the destructor.
> + */
> +static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask)
> +{
> + if (likely(!(skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)))
> + return 0;
> + return skb_copy_ubufs(skb, gfp_mask);
> +}
> +
> +
> +static inline void skb_copy_frag_destructor(struct sk_buff *to,
> + struct sk_buff *from)
> +{
> + skb_shinfo(to)->tx_flags |= skb_shinfo(from)->tx_flags &
> + SKBTX_DEV_ZEROCOPY;
> +}
> +
> +/**
> * __skb_queue_purge - empty a list
> * @list: list to empty
> *
> --
> MST
>
This last chunk should actually be part of 6/6.
squashed it here mistakenly.
^ permalink raw reply
* Re: batostr() function
From: David Herrmann @ 2012-05-08 13:30 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA, netdev
In-Reply-To: <1336391383.4325.24.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
Hi Johannes
On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> wrote:
> Really? 2 static buffers that are used alternately based on a static
> variable? How can that possibly be thread-safe? That may work in very
> restricted scenarios, but ...
Looking at "git blame" it seems the whole function is still from
linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
it, thanks.
> johannes
Regards
David
^ permalink raw reply
* Re: [PATCH net-next 0/2] extend sch_mqprio to distribute traffic not only by ETS TC
From: Amir Vadai @ 2012-05-08 13:56 UTC (permalink / raw)
To: John Fastabend; +Cc: David S. Miller, netdev, Oren Duer, Liran Liss
In-Reply-To: <4FA86EB8.2050006@intel.com>
On 05/08/2012 03:54 AM, John Fastabend wrote:
> On 5/6/2012 12:05 AM, Amir Vadai wrote:
>> This series comes to revive the discussion initiated on the thread "net:
>> support tx_ring per UP in HW based QoS mechanism" (see
>> http://marc.info/?t=133165957200004&r=1&w=2) with the major issue to be address
>> is - how should sk_prio<=> TC be done, for both, tagged and untagged traffic.
>> Following is a staged description addressing the background, problem
>> description, current situation, suggestion for the change and implementation of
>> it.
>
> OK but the mqprio qdisc is only concerned with mapping skb->priority to
> queue sets I perhaps unfortunately called the queue sets tc's. Try not
> to get hung up on my perhaps limiting naming of variables and functions.
I understand that.
>
> mqprio is used outside of 802.1Q as well in these cases a traffic class
> is not usually even defined.
>
>>
>> Background
>> ----------
>> Egress traffic has 3 layers of management to configure QoS attributes:
>> * Application - sets sk_prio
>> * setsockopt() - application may set sk_prio using SO_PRIORITY or IP_TOS
>> * Host admin - sets sk_prio<=> UP
>> * net_prio cgroup
>
> net_prio cgroup is about setting skb->priority not really UP.
Right.
>
>> * Egress map for tagged traffic
>> * Net admin - sets UP<=> TC + TC QoS attributes
>> * lldpad
>> Commit 4f57c087de9 "net: implement mechanism for HW based QOS" introduced a
>> mechanism for lower layer devices to steer traffic using skb->priority to tx
>> queues.
>
> yep that was my first comment.
>
>>
>> Problem
>> -------
>> How should sk_prio<=> TC be done, for both, tagged and untagged traffic?
>>
>> Current situation
>> -----------------
>> * The network priority cgroup infrastructure commit 5bc1421e, introduced implicit
>> assumption that sk_prio == UP.
>
> I don't think this is true at least this is not my perspective.
>
> The cgroup infrastructure in that commit sets the skb->priority. What you
> do with the priority and if you map it to a UP or qdisc classes or some
> other thing is up to the lower layers. In the DCBX context it eventually
> gets mapped to some queue sets but that is only one usage case.
>
>> * tc tool is used to map UP<=> TC for both tagged and untagged traffic.
>
> Yes. But this is just a display issue. If I was being more general I
> would have named this 'priority to queue set'. A bit short sighted
> on my part.
>
>> * egress map and lldptool and ignored when tc tool is being used.
>
> Agreed. And this creates a bit of a nuisance but I believe it can
> be resolved in user space. AFAIK all the interfaces needed are available.
>
>> * HW queue is per TC.
>>
>> Suggestion
>> ----------
>> * sk_prio is an attribute controlled by the Application or cgroup.
>> As used to be in tagged traffic
>
> This is the current usage correct?
Yes
>
>> * tc tool is used by the Host admin and sets sk_prio<=> UP for untagged
>> traffic. The rest of the chain is UP<=> TC mapped by the Net admin (using
>> DCBx netlink).
>
> This seems fine. But, what exactly is broken today? If you use the current
> mqprio qdisc and rename tc to queue_set then this works right?
For untagged traffic it is perfectly ok. This will cause problems with
tagged traffic (below).
>
>
>> To keep backward compatibility, will have an option to set tc tool to
>> compatabilty mode, in which, the old sk_prio<=> TC will be kept.
>> * Depending on HW, queue selection is by UP or by TC.
>>
>> Implementation
>> --------------
>> Extended mqprio hw attribute:
>> * Bit 1: is queue offset/count owned by HW
>> * Bits 2-7: HW queueing type.
>> * 0 - by ETS TC
>> * 1 - by UP
>>
>> __skb_tx_hash() is now aware to the HW queuing type (pg_type): for pg_type
>> being ETS TC, traffic is distributed as it was before - tagged and untagged
>> packets are distributed by netdev_get_prio_tc_map. For pg_type being UP, tagged
>> and untagged packets are distributed by UP (taken from egress map for tagged
>> traffic, or netdev_get_prio_tc_map for untagged).
>
> I guess I don't see why we need this. If you keep the mqprio priority to
> queue set mapping set to 1:1. Then modify the egress map accordingly then
> this should work right?
>
> For example:
>
> If we want to map 8 802.1Q priority code points onto 4 traffic classes this
> should work,
>
> egress map: 0:0 1:0 2:1 3:1 4:2 5:2 6:3 7:3<-- vlan layer inserts correct tag
> mqprio up2tc: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7<-- mqprio with unfortunate 'tc' name maps priority to queues
But mqprio is mapping sk_priority to queue set, which is different from
UP to queue set.
The term UP which we use, is the 8021q PCP in tagged traffic, and a
priority mapped by the host admin for untagged traffic.
What you wrote, is actually, that the application will set the priority
without enabling the host admin to control it.
> dcbnl up2tc: 0:0 1:0 2:1 3:1 4:2 5:2 6:3 7:3<-- dcbx pushes up2tc mapping correctly
For example, lets take an application that calls setsockopt(SO_PRIORITY, 2):
according to egress map: 8021q PCP field in vlan tag should be set to 1
(=UP)
according to mqprio: a tx ring belonging to UP 2 will be selected.
according to dcbnl: traffic will have ETS attributes of TC 1
Except some conceptual problems, it won't work:
8021q PCP field is set by HW according to the tx ring (UP=2). which
is different from the one that the user configured in the egress_map
(UP=1).
>
> We may need to fixup userspace tools some but I think the kernel mechanisms
> are in place.
>
> BTW I did think about this while implementing the existing code and decided
> that rather than create more if/else branches the case you are describing
> could be handled by independently controlling the priority to queue set mappings
> in mqprio and the egress map.
>
> Feel free to let me know where I went wrong or why this doesn't work on
> your hardware. I agree though we may need to fixup lldpad and maybe even
> 'tc' some to get this to look correct in user space and get automagically
> setup correctly.
>
> Thanks,
> .John
I think I understand your stand, that mqprio mapping should be generic
and should not be TC nor UP oriented.
The problem is that our HW needs the queues to be selected by UP. ETS
TC mapping is configured before traffic starts, and therefore ETS
attributes are enforced by HW according to the UP, which the tx ring
belongs to. Same thing for vlan tag in tagged traffic. 8021q PCP is
placed by HW according to the tx ring.
For backward compatibility, tagged traffic should be steered to a tx
ring by UP taken from egress map - skb_tx_hash() as it is today, can't
do it. Even if we implement ndo_select_queue(), we will need to
duplicate most of the code from skb_tx_hash(), because there are more
than one tx ring per UP, and we need skb_tx_hash() to be able to select
a ring from a range of rings belonging to a UP.
Also, there are some configurations that can't be done by mqprio and
egress map. For example when having two vlans with different egress
maps.
And in the conceptual level, I think that kernel should not accept bad
configurations and rely on user space to protect it.
- Amir
^ permalink raw reply
* Re: batostr() function
From: Ulisses Furquim @ 2012-05-08 14:20 UTC (permalink / raw)
To: David Herrmann
Cc: Johannes Berg, linux-bluetooth-u79uwXL29TY76Z2rM5mHXA, netdev
In-Reply-To: <CANq1E4QW4vSn_r9C=rirShE+-eyPjRX+b5tpC+mx69Hs6aEYqQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi David,
On Tue, May 8, 2012 at 10:30 AM, David Herrmann
<dh.herrmann-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
>
> Hi Johannes
>
> On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
> wrote:
> > Really? 2 static buffers that are used alternately based on a static
> > variable? How can that possibly be thread-safe? That may work in very
> > restricted scenarios, but ...
>
> Looking at "git blame" it seems the whole function is still from
> linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> it, thanks.
Thanks for fixing it. I'm sure we haven't noticed but it's still weird
to have it this way. :-/
Regards,
--
Ulisses Furquim
ProFUSION embedded systems
http://profusion.mobi
Mobile: +55 19 9250 0942
Skype: ulissesffs
^ permalink raw reply
* Re: batostr() function
From: Johannes Berg @ 2012-05-08 14:25 UTC (permalink / raw)
To: David Herrmann; +Cc: linux-bluetooth, netdev
In-Reply-To: <CANq1E4QW4vSn_r9C=rirShE+-eyPjRX+b5tpC+mx69Hs6aEYqQ@mail.gmail.com>
On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> Hi Johannes
>
> On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > Really? 2 static buffers that are used alternately based on a static
> > variable? How can that possibly be thread-safe? That may work in very
> > restricted scenarios, but ...
>
> Looking at "git blame" it seems the whole function is still from
> linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> it, thanks.
I was thinking you could use %pM, but it seems BT addresses are stored
the wrong way around for some reason ...
johannes
^ permalink raw reply
* Re: batostr() function
From: Andrei Emeltchenko @ 2012-05-08 14:30 UTC (permalink / raw)
To: Johannes Berg; +Cc: David Herrmann, linux-bluetooth, netdev
In-Reply-To: <1336487108.4320.2.camel@jlt3.sipsolutions.net>
On Tue, May 08, 2012 at 04:25:08PM +0200, Johannes Berg wrote:
> On Tue, 2012-05-08 at 15:30 +0200, David Herrmann wrote:
> > Hi Johannes
> >
> > On Mon, May 7, 2012 at 1:49 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > > Really? 2 static buffers that are used alternately based on a static
> > > variable? How can that possibly be thread-safe? That may work in very
> > > restricted scenarios, but ...
> >
> > Looking at "git blame" it seems the whole function is still from
> > linux-2.4. Looks like no-one ever noticed. I've sent a patchset fixing
> > it, thanks.
>
> I was thinking you could use %pM, but it seems BT addresses are stored
> the wrong way around for some reason ...
This looks like better idea then allocating buffers, we can use swap to
take care about "wrong order".
Best regards
Andrei Emeltchenko
^ permalink raw reply
* Re: [PATCH RFC 4/6] tun: orphan frags on xmit
From: Michael S. Tsirkin @ 2012-05-08 14:36 UTC (permalink / raw)
To: Ian Campbell; +Cc: David Miller, netdev@vger.kernel.org, eric.dumazet@gmail.com
In-Reply-To: <248cee8310a8d41b58b988dfea94e75ee79c6647.1336397823.git.mst@redhat.com>
On Mon, May 07, 2012 at 04:54:46PM +0300, Michael S. Tsirkin wrote:
> tun xmit is actually receive of the internal tun
> socket. Orphan the frags same as we do for normal rx path.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
If tun is built as a module, skb_copy_ubufs needs to be exported:
---->
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 83b04d9..a809014 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -765,7 +765,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;
return 0;
}
-
+EXPORT_SYMBOL_GPL(skb_copy_ubufs);
/**
* skb_clone - duplicate an sk_buff
^ permalink raw reply related
* Re: [PATCH RFC 0/6] copy aside frags with destructors (was [PATCH 7/9] net: add skb_orphan_frags to copy aside frags with destructors)
From: Michael S. Tsirkin @ 2012-05-08 14:49 UTC (permalink / raw)
To: Ian Campbell; +Cc: David Miller, netdev@vger.kernel.org, eric.dumazet@gmail.com
In-Reply-To: <1336474451.14542.63.camel@zakaz.uk.xensource.com>
On Tue, May 08, 2012 at 11:54:11AM +0100, Ian Campbell wrote:
> On Tue, 2012-05-08 at 10:41 +0100, Michael S. Tsirkin wrote:
> > On Mon, May 07, 2012 at 04:53:46PM +0300, Michael S. Tsirkin wrote:
> > > > > > But I fear we're about to toss Ian into yet another rabbit hole. :-)
> > > > > >
> > > > > > Let's try to converge on something quickly as I think integration of
> > > > > > his work has been delayed enough as-is.
> >
> > ...
> >
> > > Here's a first stub at a fix. Basically to be able to modify frags on
> > > the fly we must make sure the skb isn't cloned, so the moment someone
> > > clones the skb we need to trigger the frag copy logic. And this is
> > > exactly what happens with SKBTX_DEV_ZEROCOPY so it seems to make sense
> > > to reuse that logic.
> > >
> > > The below patchset replaces patch 7
> > > ([PATCH 7/9] net: add skb_orphan_frags to copy aside frags with destructors)
> > > in Ian's patchset and needs to be applied there.
> > >
> > >
> > > Compiled only but I'd like to hear what people think all the same
> > > because it does add a couple of branches on fast path. On the other
> > > hand this makes it generic so the same logic will be reusable for packet
> > > sockets (which IIRC are currently buggy in the same way as sunrpc) and
> > > for adding zero copy support to tun.
> > >
> > > Please comment,
> > > Thanks!
> >
> > Ian, just to stress, need your ack that this does what you wanted.
>
> Sure, yesterday was a public holiday and today looks likely to be crazy
> busy. I'll try and have a look later in the week.
>
> Ian.
>
In case you or anyone else has cycles to test this, here's the
updated tree, net-next based - so far I verified that it builds and boots
and regular networking works, but didn't test nfs yet.
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git refs/heads/zerocopy
^ permalink raw reply
* Re: [PATCH] ipv4: Fixed checkpatch warnings and errors
From: Ben Greear @ 2012-05-08 15:13 UTC (permalink / raw)
To: Cristian Chilipirea
Cc: davem, kuznet, jmorris, yoshfuji, kaber, netdev, linux-kernel,
daniel.baluta
In-Reply-To: <1336474704-9366-1-git-send-email-cristian.chilipirea@gmail.com>
On 05/08/2012 03:58 AM, Cristian Chilipirea wrote:
> Fixed warnings and errors in af_inet.c.
> #ifdef CONFIG_COMPAT
> -static int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
> +static int inet_compat_ioctl(struct socket *sock, unsigned int cmd,
> + unsigned long arg)
> {
That is so much worse than what was there before.
Lets stop useless checkpatch crap on existing code
unless it's really ugly.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [PATCH net-next 2/4] netxen_nic: Allow only useful and recommended firmware dump capture mask values
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko, Manish chopra
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>
From: Manish chopra <manish.chopra@qlogic.com>
o 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F and 0xFF are the allowed capture masks.
Signed-off-by: Manish chopra <manish.chopra@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/netxen/netxen_nic.h | 4 ++++
.../ethernet/qlogic/netxen/netxen_nic_ethtool.c | 18 ++++++++++--------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index b5de8a7..b8614af 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -1201,6 +1201,10 @@ typedef struct {
#define NX_FORCE_FW_RESET 0xdeaddead
+/* Fw dump levels */
+static const u32 FW_DUMP_LEVELS[] = {
+ 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
+
/* Flash read/write address */
#define NX_FW_DUMP_REG1 0x00130060
#define NX_FW_DUMP_REG2 0x001e0000
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
index 8c39299..3973040 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
@@ -834,7 +834,7 @@ netxen_get_dump_flag(struct net_device *netdev, struct ethtool_dump *dump)
static int
netxen_set_dump(struct net_device *netdev, struct ethtool_dump *val)
{
- int ret = 0;
+ int i;
struct netxen_adapter *adapter = netdev_priv(netdev);
struct netxen_minidump *mdump = &adapter->mdump;
@@ -844,7 +844,7 @@ netxen_set_dump(struct net_device *netdev, struct ethtool_dump *val)
mdump->md_enabled = 1;
if (adapter->fw_mdump_rdy) {
netdev_info(netdev, "Previous dump not cleared, not forcing dump\n");
- return ret;
+ return 0;
}
netdev_info(netdev, "Forcing a fw dump\n");
nx_dev_request_reset(adapter);
@@ -867,19 +867,21 @@ netxen_set_dump(struct net_device *netdev, struct ethtool_dump *val)
adapter->flags &= ~NETXEN_FW_RESET_OWNER;
break;
default:
- if (val->flag <= NX_DUMP_MASK_MAX &&
- val->flag >= NX_DUMP_MASK_MIN) {
- mdump->md_capture_mask = val->flag & 0xff;
- netdev_info(netdev, "Driver mask changed to: 0x%x\n",
+ for (i = 0; i < ARRAY_SIZE(FW_DUMP_LEVELS); i++) {
+ if (val->flag == FW_DUMP_LEVELS[i]) {
+ mdump->md_capture_mask = val->flag;
+ netdev_info(netdev,
+ "Driver mask changed to: 0x%x\n",
mdump->md_capture_mask);
- break;
+ return 0;
+ }
}
netdev_info(netdev,
"Invalid dump level: 0x%x\n", val->flag);
return -EINVAL;
}
- return ret;
+ return 0;
}
static int
--
1.7.3.3
^ permalink raw reply related
* [PATCH 0/4] netxen: Fixes
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko
Please apply it to net-next.
^ permalink raw reply
* [PATCH net-next 1/4] netxen_nic: disable minidump by default
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko, Sritej Velaga
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>
From: Sritej Velaga <sritej.velaga@qlogic.com>
disable fw dump by default at start up.
Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
.../net/ethernet/qlogic/netxen/netxen_nic_ctx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
index f3c0057..c86ea12 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
@@ -229,7 +229,7 @@ netxen_setup_minidump(struct netxen_adapter *adapter)
adapter->mdump.md_template;
adapter->mdump.md_capture_buff = NULL;
adapter->mdump.fw_supports_md = 1;
- adapter->mdump.md_enabled = 1;
+ adapter->mdump.md_enabled = 0;
return err;
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 4/4] netxen_nic: Fix estimation of recv MSS in case of LRO
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>
o Linux stack estimates MSS from skb->len or skb_shinfo(skb)->gso_size.
In case of LRO skb->len is aggregate of len of number of packets hence MSS
obtained using skb->len would be incorrect. Incorrect estimation of recv MSS
would lead to delayed acks in some traffic patterns (which sends two or three
packets and wait for ack and only then send remaining packets). This leads to
drop in performance. Hence we need to set gso_size to MSS obtained from firmware.
o This is fixed recently in firmware hence the MSS is obtained based on
capability. If fw is capable of sending the MSS then only driver sets the gso_size.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/netxen/netxen_nic.h | 10 ++++++++--
.../net/ethernet/qlogic/netxen/netxen_nic_ctx.c | 3 +++
.../net/ethernet/qlogic/netxen/netxen_nic_hdr.h | 1 +
.../net/ethernet/qlogic/netxen/netxen_nic_init.c | 4 +++-
.../net/ethernet/qlogic/netxen/netxen_nic_main.c | 9 ++++++++-
5 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index a43a26c..36ae0ae 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -53,8 +53,8 @@
#define _NETXEN_NIC_LINUX_MAJOR 4
#define _NETXEN_NIC_LINUX_MINOR 0
-#define _NETXEN_NIC_LINUX_SUBVERSION 78
-#define NETXEN_NIC_LINUX_VERSIONID "4.0.78"
+#define _NETXEN_NIC_LINUX_SUBVERSION 79
+#define NETXEN_NIC_LINUX_VERSIONID "4.0.79"
#define NETXEN_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
#define _major(v) (((v) >> 24) & 0xff)
@@ -419,6 +419,8 @@ struct rcv_desc {
(((sts_data) >> 52) & 0x1)
#define netxen_get_lro_sts_seq_number(sts_data) \
((sts_data) & 0x0FFFFFFFF)
+#define netxen_get_lro_sts_mss(sts_data1) \
+ ((sts_data1 >> 32) & 0x0FFFF)
struct status_desc {
@@ -794,6 +796,7 @@ struct netxen_cmd_args {
#define NX_CAP0_JUMBO_CONTIGUOUS NX_CAP_BIT(0, 7)
#define NX_CAP0_LRO_CONTIGUOUS NX_CAP_BIT(0, 8)
#define NX_CAP0_HW_LRO NX_CAP_BIT(0, 10)
+#define NX_CAP0_HW_LRO_MSS NX_CAP_BIT(0, 21)
/*
* Context state
@@ -1073,6 +1076,8 @@ typedef struct {
#define NX_FW_CAPABILITY_FVLANTX (1 << 9)
#define NX_FW_CAPABILITY_HW_LRO (1 << 10)
#define NX_FW_CAPABILITY_GBE_LINK_CFG (1 << 11)
+#define NX_FW_CAPABILITY_MORE_CAPS (1 << 31)
+#define NX_FW_CAPABILITY_2_LRO_MAX_TCP_SEG (1 << 2)
/* module types */
#define LINKEVENT_MODULE_NOT_PRESENT 1
@@ -1155,6 +1160,7 @@ typedef struct {
#define NETXEN_NIC_BRIDGE_ENABLED 0X10
#define NETXEN_NIC_DIAG_ENABLED 0x20
#define NETXEN_FW_RESET_OWNER 0x40
+#define NETXEN_FW_MSS_CAP 0x80
#define NETXEN_IS_MSI_FAMILY(adapter) \
((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED))
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
index c86ea12..7f556a8 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
@@ -328,6 +328,9 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
cap = (NX_CAP0_LEGACY_CONTEXT | NX_CAP0_LEGACY_MN);
cap |= (NX_CAP0_JUMBO_CONTIGUOUS | NX_CAP0_LRO_CONTIGUOUS);
+ if (adapter->flags & NETXEN_FW_MSS_CAP)
+ cap |= NX_CAP0_HW_LRO_MSS;
+
prq->capabilities[0] = cpu_to_le32(cap);
prq->host_int_crb_mode =
cpu_to_le32(NX_HOST_INT_CRB_MODE_SHARED);
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
index a41106b..28e0769 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
@@ -776,6 +776,7 @@ enum {
#define CRB_SW_INT_MASK_3 (NETXEN_NIC_REG(0x1e8))
#define CRB_FW_CAPABILITIES_1 (NETXEN_CAM_RAM(0x128))
+#define CRB_FW_CAPABILITIES_2 (NETXEN_CAM_RAM(0x12c))
#define CRB_MAC_BLOCK_START (NETXEN_CAM_RAM(0x1c0))
/*
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
index 718b274..0d725dc 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
@@ -1131,7 +1131,6 @@ netxen_validate_firmware(struct netxen_adapter *adapter)
_build(file_fw_ver));
return -EINVAL;
}
-
val = nx_get_bios_version(adapter);
netxen_rom_fast_read(adapter, NX_BIOS_VERSION_OFFSET, (int *)&bios);
if ((__force u32)val != bios) {
@@ -1661,6 +1660,9 @@ netxen_process_lro(struct netxen_adapter *adapter,
length = skb->len;
+ if (adapter->flags & NETXEN_FW_MSS_CAP)
+ skb_shinfo(skb)->gso_size = netxen_get_lro_sts_mss(sts_data1);
+
netif_receive_skb(skb);
adapter->stats.lro_pkts++;
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 05f3ffe..b025940 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -1184,6 +1184,7 @@ netxen_nic_attach(struct netxen_adapter *adapter)
int err, ring;
struct nx_host_rds_ring *rds_ring;
struct nx_host_tx_ring *tx_ring;
+ u32 capab2;
if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC)
return 0;
@@ -1192,6 +1193,13 @@ netxen_nic_attach(struct netxen_adapter *adapter)
if (err)
return err;
+ adapter->flags &= ~NETXEN_FW_MSS_CAP;
+ if (adapter->capabilities & NX_FW_CAPABILITY_MORE_CAPS) {
+ capab2 = NXRD32(adapter, CRB_FW_CAPABILITIES_2);
+ if (capab2 & NX_FW_CAPABILITY_2_LRO_MAX_TCP_SEG)
+ adapter->flags |= NETXEN_FW_MSS_CAP;
+ }
+
err = netxen_napi_add(adapter, netdev);
if (err)
return err;
@@ -1810,7 +1818,6 @@ netxen_tso_check(struct net_device *netdev,
flags = FLAGS_VLAN_TAGGED;
} else if (vlan_tx_tag_present(skb)) {
-
flags = FLAGS_VLAN_OOB;
vid = vlan_tx_tag_get(skb);
netxen_set_tx_vlan_tci(first_desc, vid);
--
1.7.3.3
^ permalink raw reply related
* [PATCH net-next 3/4] netxen: added miniDIMM support in driver.
From: Rajesh Borundia @ 2012-05-08 15:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Ameen Rahman, Sony Chacko, Sucheta Chakraborty
In-Reply-To: <1336489288-22347-1-git-send-email-rajesh.borundia@qlogic.com>
From: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Driver queries DIMM information from firmware and accordingly
sets "presence" field of the structure.
"presence" field when set to 0xff denotes invalid flag. And when
set to 0x0 denotes DIMM memory is not present.
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
---
drivers/net/ethernet/qlogic/netxen/netxen_nic.h | 7 +
.../net/ethernet/qlogic/netxen/netxen_nic_hdr.h | 25 ++++
.../net/ethernet/qlogic/netxen/netxen_nic_main.c | 131 ++++++++++++++++++++
3 files changed, 163 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
index b8614af..a43a26c 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h
@@ -1818,6 +1818,13 @@ struct netxen_brdinfo {
char short_name[NETXEN_MAX_SHORT_NAME];
};
+struct netxen_dimm_cfg {
+ u8 presence;
+ u8 mem_type;
+ u8 dimm_type;
+ u32 size;
+};
+
static const struct netxen_brdinfo netxen_boards[] = {
{NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, "XGb CX4"},
{NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, "XGb HMEZ"},
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
index b1a897c..a41106b 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h
@@ -955,6 +955,31 @@ enum {
#define NX_CRB_DEV_REF_COUNT (NETXEN_CAM_RAM(0x138))
#define NX_CRB_DEV_STATE (NETXEN_CAM_RAM(0x140))
+/* MiniDIMM related macros */
+#define NETXEN_DIMM_CAPABILITY (NETXEN_CAM_RAM(0x258))
+#define NETXEN_DIMM_PRESENT 0x1
+#define NETXEN_DIMM_MEMTYPE_DDR2_SDRAM 0x2
+#define NETXEN_DIMM_SIZE 0x4
+#define NETXEN_DIMM_MEMTYPE(VAL) ((VAL >> 3) & 0xf)
+#define NETXEN_DIMM_NUMROWS(VAL) ((VAL >> 7) & 0xf)
+#define NETXEN_DIMM_NUMCOLS(VAL) ((VAL >> 11) & 0xf)
+#define NETXEN_DIMM_NUMRANKS(VAL) ((VAL >> 15) & 0x3)
+#define NETXEN_DIMM_DATAWIDTH(VAL) ((VAL >> 18) & 0x3)
+#define NETXEN_DIMM_NUMBANKS(VAL) ((VAL >> 21) & 0xf)
+#define NETXEN_DIMM_TYPE(VAL) ((VAL >> 25) & 0x3f)
+#define NETXEN_DIMM_VALID_FLAG 0x80000000
+
+#define NETXEN_DIMM_MEM_DDR2_SDRAM 0x8
+
+#define NETXEN_DIMM_STD_MEM_SIZE 512
+
+#define NETXEN_DIMM_TYPE_RDIMM 0x1
+#define NETXEN_DIMM_TYPE_UDIMM 0x2
+#define NETXEN_DIMM_TYPE_SO_DIMM 0x4
+#define NETXEN_DIMM_TYPE_Micro_DIMM 0x8
+#define NETXEN_DIMM_TYPE_Mini_RDIMM 0x10
+#define NETXEN_DIMM_TYPE_Mini_UDIMM 0x20
+
/* Device State */
#define NX_DEV_COLD 1
#define NX_DEV_INITALIZING 2
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 65a718f..05f3ffe 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2926,6 +2926,134 @@ static struct bin_attribute bin_attr_mem = {
.write = netxen_sysfs_write_mem,
};
+static ssize_t
+netxen_sysfs_read_dimm(struct file *filp, struct kobject *kobj,
+ struct bin_attribute *attr,
+ char *buf, loff_t offset, size_t size)
+{
+ struct device *dev = container_of(kobj, struct device, kobj);
+ struct netxen_adapter *adapter = dev_get_drvdata(dev);
+ struct net_device *netdev = adapter->netdev;
+ struct netxen_dimm_cfg dimm;
+ u8 dw, rows, cols, banks, ranks;
+ u32 val;
+
+ if (size != sizeof(struct netxen_dimm_cfg)) {
+ netdev_err(netdev, "Invalid size\n");
+ return -1;
+ }
+
+ memset(&dimm, 0, sizeof(struct netxen_dimm_cfg));
+ val = NXRD32(adapter, NETXEN_DIMM_CAPABILITY);
+
+ /* Checks if DIMM info is valid. */
+ if (val & NETXEN_DIMM_VALID_FLAG) {
+ netdev_err(netdev, "Invalid DIMM flag\n");
+ dimm.presence = 0xff;
+ goto out;
+ }
+
+ rows = NETXEN_DIMM_NUMROWS(val);
+ cols = NETXEN_DIMM_NUMCOLS(val);
+ ranks = NETXEN_DIMM_NUMRANKS(val);
+ banks = NETXEN_DIMM_NUMBANKS(val);
+ dw = NETXEN_DIMM_DATAWIDTH(val);
+
+ dimm.presence = (val & NETXEN_DIMM_PRESENT);
+
+ /* Checks if DIMM info is present. */
+ if (!dimm.presence) {
+ netdev_err(netdev, "DIMM not present\n");
+ goto out;
+ }
+
+ dimm.dimm_type = NETXEN_DIMM_TYPE(val);
+
+ switch (dimm.dimm_type) {
+ case NETXEN_DIMM_TYPE_RDIMM:
+ case NETXEN_DIMM_TYPE_UDIMM:
+ case NETXEN_DIMM_TYPE_SO_DIMM:
+ case NETXEN_DIMM_TYPE_Micro_DIMM:
+ case NETXEN_DIMM_TYPE_Mini_RDIMM:
+ case NETXEN_DIMM_TYPE_Mini_UDIMM:
+ break;
+ default:
+ netdev_err(netdev, "Invalid DIMM type %x\n", dimm.dimm_type);
+ goto out;
+ }
+
+ if (val & NETXEN_DIMM_MEMTYPE_DDR2_SDRAM)
+ dimm.mem_type = NETXEN_DIMM_MEM_DDR2_SDRAM;
+ else
+ dimm.mem_type = NETXEN_DIMM_MEMTYPE(val);
+
+ if (val & NETXEN_DIMM_SIZE) {
+ dimm.size = NETXEN_DIMM_STD_MEM_SIZE;
+ goto out;
+ }
+
+ if (!rows) {
+ netdev_err(netdev, "Invalid no of rows %x\n", rows);
+ goto out;
+ }
+
+ if (!cols) {
+ netdev_err(netdev, "Invalid no of columns %x\n", cols);
+ goto out;
+ }
+
+ if (!banks) {
+ netdev_err(netdev, "Invalid no of banks %x\n", banks);
+ goto out;
+ }
+
+ ranks += 1;
+
+ switch (dw) {
+ case 0x0:
+ dw = 32;
+ break;
+ case 0x1:
+ dw = 33;
+ break;
+ case 0x2:
+ dw = 36;
+ break;
+ case 0x3:
+ dw = 64;
+ break;
+ case 0x4:
+ dw = 72;
+ break;
+ case 0x5:
+ dw = 80;
+ break;
+ case 0x6:
+ dw = 128;
+ break;
+ case 0x7:
+ dw = 144;
+ break;
+ default:
+ netdev_err(netdev, "Invalid data-width %x\n", dw);
+ goto out;
+ }
+
+ dimm.size = ((1 << rows) * (1 << cols) * dw * banks * ranks) / 8;
+ /* Size returned in MB. */
+ dimm.size = (dimm.size) / 0x100000;
+out:
+ memcpy(buf, &dimm, sizeof(struct netxen_dimm_cfg));
+ return sizeof(struct netxen_dimm_cfg);
+
+}
+
+static struct bin_attribute bin_attr_dimm = {
+ .attr = {.name = "dimm", .mode = (S_IRUGO | S_IWUSR)},
+ .size = 0,
+ .read = netxen_sysfs_read_dimm,
+};
+
static void
netxen_create_sysfs_entries(struct netxen_adapter *adapter)
@@ -2963,6 +3091,8 @@ netxen_create_diag_entries(struct netxen_adapter *adapter)
dev_info(dev, "failed to create crb sysfs entry\n");
if (device_create_bin_file(dev, &bin_attr_mem))
dev_info(dev, "failed to create mem sysfs entry\n");
+ if (device_create_bin_file(dev, &bin_attr_dimm))
+ dev_info(dev, "failed to create dimm sysfs entry\n");
}
@@ -2975,6 +3105,7 @@ netxen_remove_diag_entries(struct netxen_adapter *adapter)
device_remove_file(dev, &dev_attr_diag_mode);
device_remove_bin_file(dev, &bin_attr_crb);
device_remove_bin_file(dev, &bin_attr_mem);
+ device_remove_bin_file(dev, &bin_attr_dimm);
}
#ifdef CONFIG_INET
--
1.7.3.3
^ permalink raw reply related
* Re: SLUB warning in netfilter code on shutdown
From: Christoph Lameter @ 2012-05-08 15:33 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: Pablo Neira Ayuso, Patrick McHardy, netfilter-devel, netfilter,
coreteam, netdev, Pekka Enberg
In-Reply-To: <20120508112236.GA15404@otc-wbsnb-06>
On Tue, 8 May 2012, Kirill A. Shutemov wrote:
> On Tue, May 08, 2012 at 02:19:24PM +0300, Kirill A. Shutemov wrote:
> > Hi,
> >
> > Screenshot attached.
>
> It's v3.4-rc6 on x86_64. Config attached.
Cannot see the bug report but I guess this is a message related to object
remaining on kmem_cache_destroy? We have other reports on that one as
well. The IPI reduction patch introduces a bug in has_cpu_slab().
Modify the return statement to
return c->page || c->partial;
^ permalink raw reply
* Re: [PATCH] net: compare_ether_addr[_64bits]() has no ordering
From: Joe Perches @ 2012-05-08 16:44 UTC (permalink / raw)
To: David Miller; +Cc: johannes, eric.dumazet, netdev
In-Reply-To: <20120508.033120.1272130362698029549.davem@davemloft.net>
On Tue, 2012-05-08 at 03:31 -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Mon, 07 May 2012 23:35:36 -0700
>
> > On Tue, 2012-05-08 at 02:26 -0400, David Miller wrote:
> >> From: Johannes Berg <johannes@sipsolutions.net>
> >> Date: Tue, 08 May 2012 07:25:44 +0200
> >>
> >> > I suppose I could fix those first and then later change the type, but I
> >> > think having a "compare_ether_addr" function that returns *false* when
> >> > they *match* would be rather confusing. I'd rather have
> >> > "equal_ether_addr()" that returns *true* when they match.
> >> >
> >> > I guess we could introduce equal_ether_addr() though and slowly convert,
> >> > keeping compare_ether_addr() as a sort of wrapper around it.
> >>
> >> Indeed, this is one way to proceed.
> >
> > perhaps is_equal_ether_addr or is_same_ether_addr instead?
>
> Hmmm, my first choice would have been "eth_addr_equal()"
Perhaps ether_addr_equal for some API naming semi-consistency.
$ grep "\bint.*is_.*ether_addr" include/linux/etherdevice.h
static inline int is_zero_ether_addr(const u8 *addr)
static inline int is_multicast_ether_addr(const u8 *addr)
static inline int is_local_ether_addr(const u8 *addr)
static inline int is_broadcast_ether_addr(const u8 *addr)
static inline int is_unicast_ether_addr(const u8 *addr)
static inline int is_valid_ether_addr(const u8 *addr)
Perhaps all of these should be bool too
(patch in a separate email)
^ permalink raw reply
* [PATCH] etherdev.h: Convert int is_<foo>_ether_addr to bool
From: Joe Perches @ 2012-05-08 16:44 UTC (permalink / raw)
To: David Miller; +Cc: johannes, eric.dumazet, netdev
In-Reply-To: <20120508.033120.1272130362698029549.davem@davemloft.net>
Make the return value explicitly true or false.
Signed-off-by: Joe Perches <joe@perches.com>
---
I grepped through the uses, there are a couple of
tests that store to an int that are unaffected.
There are also a couple of senseless tests of
is_broadcast_ether_addr() || is_multicast_ether_addr()
in staging that could be improved.
include/linux/etherdevice.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 8a18358..46a95ef 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -59,7 +59,7 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
*
* Return true if the address is all zeroes.
*/
-static inline int is_zero_ether_addr(const u8 *addr)
+static inline bool is_zero_ether_addr(const u8 *addr)
{
return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
}
@@ -71,7 +71,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
* Return true if the address is a multicast address.
* By definition the broadcast address is also a multicast address.
*/
-static inline int is_multicast_ether_addr(const u8 *addr)
+static inline bool is_multicast_ether_addr(const u8 *addr)
{
return 0x01 & addr[0];
}
@@ -82,7 +82,7 @@ static inline int is_multicast_ether_addr(const u8 *addr)
*
* Return true if the address is a local address.
*/
-static inline int is_local_ether_addr(const u8 *addr)
+static inline bool is_local_ether_addr(const u8 *addr)
{
return 0x02 & addr[0];
}
@@ -93,7 +93,7 @@ static inline int is_local_ether_addr(const u8 *addr)
*
* Return true if the address is the broadcast address.
*/
-static inline int is_broadcast_ether_addr(const u8 *addr)
+static inline bool is_broadcast_ether_addr(const u8 *addr)
{
return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff;
}
@@ -104,7 +104,7 @@ static inline int is_broadcast_ether_addr(const u8 *addr)
*
* Return true if the address is a unicast address.
*/
-static inline int is_unicast_ether_addr(const u8 *addr)
+static inline bool is_unicast_ether_addr(const u8 *addr)
{
return !is_multicast_ether_addr(addr);
}
@@ -118,7 +118,7 @@ static inline int is_unicast_ether_addr(const u8 *addr)
*
* Return true if the address is valid.
*/
-static inline int is_valid_ether_addr(const u8 *addr)
+static inline bool is_valid_ether_addr(const u8 *addr)
{
/* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
* explicitly check for it here. */
^ permalink raw reply related
* Re: [PATCH 00/25] [v2] netfilter updates for net-next (upcoming 3.5)
From: David Miller @ 2012-05-08 16:49 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <1336463394-3119-1-git-send-email-pablo@netfilter.org>
From: pablo@netfilter.org
Date: Tue, 8 May 2012 09:49:29 +0200
> Second version including requested updates.
There were lots of conflicts, due to my merge of net into net-next.
Those were easy enough, but the result doesn't build.
net/netfilter/nf_conntrack_helper.c: In function ‘nf_conntrack_helper_init_sysctl’:
net/netfilter/nf_conntrack_helper.c:65:2: error: implicit declaration of function ‘register_net_sysctl_table’ [-Werror=implicit-function-declaration]
net/netfilter/nf_conntrack_helper.c:66:4: error: ‘nf_net_netfilter_sysctl_path’ undeclared (first use in this function)
net/netfilter/nf_conntrack_helper.c:66:4: note: each undeclared identifier is reported only once for each function it appears in
^ permalink raw reply
* Re: [PATCH net-next 2/4] netxen_nic: Allow only useful and recommended firmware dump capture mask values
From: David Miller @ 2012-05-08 16:52 UTC (permalink / raw)
To: rajesh.borundia; +Cc: netdev, ameen.rahman, sony.chacko, manish.chopra
In-Reply-To: <1336489288-22347-3-git-send-email-rajesh.borundia@qlogic.com>
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Tue, 8 May 2012 08:01:26 -0700
> +/* Fw dump levels */
> +static const u32 FW_DUMP_LEVELS[] = {
> + 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
Format this more reasonably, this looks terrible.
^ permalink raw reply
* Re: [PATCH net-next 3/4] netxen: added miniDIMM support in driver.
From: David Miller @ 2012-05-08 16:53 UTC (permalink / raw)
To: rajesh.borundia; +Cc: netdev, ameen.rahman, sony.chacko, sucheta.chakraborty
In-Reply-To: <1336489288-22347-4-git-send-email-rajesh.borundia@qlogic.com>
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Date: Tue, 8 May 2012 08:01:27 -0700
> +static struct bin_attribute bin_attr_dimm = {
> + .attr = {.name = "dimm", .mode = (S_IRUGO | S_IWUSR)},
How about a space next to the braces?
^ permalink raw reply
* Re: [PATCH] ipv4: Fixed checkpatch warnings and errors
From: David Miller @ 2012-05-08 17:01 UTC (permalink / raw)
To: greearb
Cc: cristian.chilipirea, kuznet, jmorris, yoshfuji, kaber, netdev,
linux-kernel, daniel.baluta
In-Reply-To: <4FA9382A.9090709@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Date: Tue, 08 May 2012 08:13:46 -0700
> On 05/08/2012 03:58 AM, Cristian Chilipirea wrote:
>> Fixed warnings and errors in af_inet.c.
>
>> #ifdef CONFIG_COMPAT
>> -static int inet_compat_ioctl(struct socket *sock, unsigned int cmd,
>> -unsigned long arg)
>> +static int inet_compat_ioctl(struct socket *sock, unsigned int cmd,
>> + unsigned long arg)
>> {
>
> That is so much worse than what was there before.
>
> Lets stop useless checkpatch crap on existing code
> unless it's really ugly.
Agreed, this patch is terrible.
^ permalink raw reply
* Re: [PATCH] etherdev.h: Convert int is_<foo>_ether_addr to bool
From: David Miller @ 2012-05-08 17:07 UTC (permalink / raw)
To: joe; +Cc: johannes, eric.dumazet, netdev
In-Reply-To: <1336495480.29640.19.camel@joe2Laptop>
From: Joe Perches <joe@perches.com>
Date: Tue, 08 May 2012 09:44:40 -0700
> Make the return value explicitly true or false.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Looks good, applied, thanks Joe.
^ permalink raw reply
* Re: [PATCH 00/25] [v2] netfilter updates for net-next (upcoming 3.5)
From: Pablo Neira Ayuso @ 2012-05-08 17:10 UTC (permalink / raw)
To: David Miller; +Cc: netfilter-devel, netdev
In-Reply-To: <20120508.124926.2241646617733136639.davem@davemloft.net>
On Tue, May 08, 2012 at 12:49:26PM -0400, David Miller wrote:
> From: pablo@netfilter.org
> Date: Tue, 8 May 2012 09:49:29 +0200
>
> > Second version including requested updates.
>
> There were lots of conflicts, due to my merge of net into net-next.
>
> Those were easy enough, but the result doesn't build.
>
> net/netfilter/nf_conntrack_helper.c: In function ‘nf_conntrack_helper_init_sysctl’:
> net/netfilter/nf_conntrack_helper.c:65:2: error: implicit declaration of function ‘register_net_sysctl_table’ [-Werror=implicit-function-declaration]
> net/netfilter/nf_conntrack_helper.c:66:4: error: ‘nf_net_netfilter_sysctl_path’ undeclared (first use in this function)
> net/netfilter/nf_conntrack_helper.c:66:4: note: each undeclared identifier is reported only once for each function it appears in
Strange, this compiles here. Probably you have to add the following
include to net/netfilter/nf_conntrack_helper.c:
#include <net/net_namespace.h>
I can rebase all my patches on top of fresh tree, fix all conflicts
myself and send you another patchset that will apply to your current
tree.
Please, let me know how to proceed.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 00/25] [v2] netfilter updates for net-next (upcoming 3.5)
From: David Miller @ 2012-05-08 17:12 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel, netdev
In-Reply-To: <20120508171049.GA16205@1984>
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue, 8 May 2012 19:10:49 +0200
> I can rebase all my patches on top of fresh tree, fix all conflicts
> myself and send you another patchset that will apply to your current
> tree.
>
> Please, let me know how to proceed.
Yes, please build a tree that compiles properly :-)
The error is pretty trivial to reproduce, just "allmodconfig" like I
do.
^ 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