* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11 1:05 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel, joe
In-Reply-To: <20141210.144430.1749715282635917425.davem@davemloft.net>
Hi David,
On 12/11/2014 03:44 AM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 10 Dec 2014 13:48:04 -0500 (EST)
>
>> From: Gu Zheng <guz.fnst@cn.fujitsu.com>
>> Date: Wed, 10 Dec 2014 13:36:25 +0800
>>
>>> Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
>>> cmsghdr from msghdr, just cleanup.
>>>
>>> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
>>
>> Applied, thanks.
>
> This breaks the build, I'm reverting.
I'm very sorry.
>
> You cannot use your new macros in
> Documentation/networking/timestamping/txtimestamp.c, that is a
> userland program and the header you are adding your helper to is not
> available to userspace.
IMO, the user-land programs need to be build with the matched headers separately.
I split the kernel codes and the user-land programs, build and install the kernel first,
and then build the user-land ones.
>
> This also means you didn't sufficiently test the build of your
> changes.
To be honest, I do the test as I mentioned above.
Thanks,
Gu
>
> Documentation/networking/timestamping/timestamping.c: In function ‘printpacket’:
> Documentation/networking/timestamping/timestamping.c:172:2: warning: implicit declaration of function ‘for_each_cmsghdr’ [-Wimplicit-function-declaration]
> Documentation/networking/timestamping/timestamping.c:172:30: error: expected ‘;’ before ‘{’ token
> Documentation/networking/timestamping/timestamping.c:161:18: warning: unused variable ‘ts’ [-Wunused-variable]
> Documentation/networking/timestamping/timestamping.c:160:17: warning: unused variable ‘tv’ [-Wunused-variable]
> make[3]: *** [Documentation/networking/timestamping/timestamping] Error 1
> make[3]: *** Waiting for unfinished jobs....
> Documentation/networking/timestamping/txtimestamp.c: In function ‘__recv_errmsg_cmsg’:
> Documentation/networking/timestamping/txtimestamp.c:187:2: warning: implicit declaration of function ‘for_each_cmsghdr’ [-Wimplicit-function-declaration]
> Documentation/networking/timestamping/txtimestamp.c:187:19: error: ‘cmsg’ undeclared (first use in this function)
> Documentation/networking/timestamping/txtimestamp.c:187:19: note: each undeclared identifier is reported only once for each function it appears in
> Documentation/networking/timestamping/txtimestamp.c:187:30: error: expected ‘;’ before ‘{’ token
> Documentation/networking/timestamping/txtimestamp.c:185:18: warning: unused variable ‘cm’ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c:184:27: warning: unused variable ‘tss’ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c:183:28: warning: unused variable ‘serr’ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c: At top level:
> Documentation/networking/timestamping/txtimestamp.c:123:13: warning: ‘print_timestamp’ defined but not used [-Wunused-function]
> Documentation/networking/timestamping/txtimestamp.c:159:13: warning: ‘print_pktinfo’ defined but not used [-Wunused-function]
>
^ permalink raw reply
* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11 1:11 UTC (permalink / raw)
To: Joe Perches; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1418223106.18092.1.camel@perches.com>
Hi Joe,
On 12/10/2014 10:51 PM, Joe Perches wrote:
> On Wed, 2014-12-10 at 16:15 +0800, Gu Zheng wrote:
>> On 12/10/2014 02:56 PM, Joe Perches wrote:
>>> On Wed, 2014-12-10 at 13:36 +0800, Gu Zheng wrote:
>>>> Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
>>>> cmsghdr from msghdr, just cleanup.
>>>
>>> This looks nicer.
>>> Ideally this would have used: [PATCH V3] as the subject
>>
>> The previous v2 thread was marked as mistake, so this is the really active
>> v2 version.
>
> A buggy submitted version is still a version.
> Using an incremented version number helps.
Got it, this can also avoid some unnecessary misreading.
Thanks for your suggestion.
Regards,
Gu
>
>
^ permalink raw reply
* RE: [PATCH net-next 1/3] net: fec: reset fep link status in suspend function
From: fugang.duan @ 2014-12-11 1:40 UTC (permalink / raw)
To: David Miller
Cc: netdev@vger.kernel.org, bhutchings@solarflare.com,
stephen@networkplumber.org
In-Reply-To: <20141210.145424.35618035568083747.davem@davemloft.net>
From: David Miller <davem@davemloft.net> Sent: Thursday, December 11, 2014 3:54 AM
> To: Duan Fugang-B38611
> Cc: netdev@vger.kernel.org; bhutchings@solarflare.com;
> stephen@networkplumber.org
> Subject: Re: [PATCH net-next 1/3] net: fec: reset fep link status in
> suspend function
>
> From: Fugang Duan <b38611@freescale.com>
> Date: Wed, 10 Dec 2014 17:54:47 +0800
>
> > + /*
> > + * SOC supply clock to phy, when clock is disabled, phy link down
> > + * SOC control phy regulator, when regulator is disabled, phy link
> down
> > + */
>
> Comments in the networking should be of the form:
>
> /* Like
> * this.
> */
>
> Not:
>
> /*
> * Like
> * this.
> */
Thanks for your comment. I will change it and send V2 version.
Regards,
Andy
^ permalink raw reply
* Re: [PATCH v7 2/3] net: Add Keystone NetCP ethernet driver
From: David Miller @ 2014-12-11 1:41 UTC (permalink / raw)
To: m-karicheri2-l0cyMroinI0
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
grant.likely-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <5488BB96.9070609-l0cyMroinI0@public.gmane.org>
From: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
Date: Wed, 10 Dec 2014 16:31:02 -0500
> Are you referring to the static code analyser sparse that is invoked
> through?
You have to explicitly enable endian checking, it's not on by
default.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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: errors in alignment changes..
From: David Miller @ 2014-12-11 1:42 UTC (permalink / raw)
To: sergei.shtylyov; +Cc: mitsuhiro.kimura.kc, netdev
In-Reply-To: <5488C447.5080906@cogentembedded.com>
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 11 Dec 2014 01:08:07 +0300
> I guess we can just do:
>
> rxdesc->addr = dma_map_single(...);
Best not to leave a potentially invalid DMA address in a
receive descriptor the chip can potentially fetch and
look at.
That's why I said to put it into a local variable and
check for errors first.
^ permalink raw reply
* Re: [PATCH v2] if_bridge: fix conflict with glibc
From: David Miller @ 2014-12-11 1:44 UTC (permalink / raw)
To: stephen; +Cc: gregory.0xf0, f.fainelli, xiyou.wangcong, netdev
In-Reply-To: <20141210155745.3d375230@urahara>
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 10 Dec 2014 15:57:45 -0800
> On Wed, 10 Dec 2014 13:34:17 -0500 (EST)
> David Miller <davem@davemloft.net> wrote:
>
>> No, we really want to incluse the linux/in6.h header, as that's where all
>> the special GLIBC CPP checks are, such as:
>>
>> #if __UAPI_DEF_IN6_ADDR_ALT
>>
>> Please research how we have resolved the conflict between GLIBC and the
>> kernel's exported headers. We really need to use linux/in6.h for all of
>> this to work.
>>
>> I understand that it is upsetting that iproute2 stopped building for you,
>> but I'd like to kindly ask that you look more deeply into this and think
>> more longer term, rather than having a knee jerk reaction and looking for
>> quick fixes.
>
> I don't have the time to understand the intricacies of glibc headers.
> The problem is that Gcc warns about duplicate definitions in headers;
> this is a useful warning and not something that I want to disable.
> Hacks with #undef seem to be heading the wrong way.
GLIBC and the kernel have unconditionally defined various types in
their copies of in.h, and the only way to resolve this moving forward
is to have some communication between the two so we can know who is
in fact in charge of instantianting the type.
The new defines, such as __UAPI_DEF_IN6_ADDR_ALT, are that new
mechanism.
^ permalink raw reply
* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: David Miller @ 2014-12-11 1:47 UTC (permalink / raw)
To: guz.fnst; +Cc: netdev, linux-kernel, joe
In-Reply-To: <5488EDF7.7070001@cn.fujitsu.com>
From: Gu Zheng <guz.fnst@cn.fujitsu.com>
Date: Thu, 11 Dec 2014 09:05:59 +0800
> IMO, the user-land programs need to be build with the matched
> headers separately.
You absolutely cannot provide this new interface to userland and
expect programs to be able to just use it, it's non-standard and does
not exist in older headers.
I do not want this new interface available to userland programs.
They can just open-code the list traversal just like every program
in history has had to do since BSD UNIX.
^ permalink raw reply
* Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11 1:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel, joe
In-Reply-To: <20141210.204703.1525194278635097457.davem@davemloft.net>
Hi David,
On 12/11/2014 09:47 AM, David Miller wrote:
> From: Gu Zheng <guz.fnst@cn.fujitsu.com>
> Date: Thu, 11 Dec 2014 09:05:59 +0800
>
>> IMO, the user-land programs need to be build with the matched
>> headers separately.
>
> You absolutely cannot provide this new interface to userland and
> expect programs to be able to just use it, it's non-standard and does
> not exist in older headers.
Got it, sorry for my mistake, and thanks for your correction.
>
> I do not want this new interface available to userland programs.
> They can just open-code the list traversal just like every program
> in history has had to do since BSD UNIX.
Agree. Let's leave the user-land ones as they are.
I'll send a new version (without changing user-land ones) soon.
Best regards,
Gu
> .
>
^ permalink raw reply
* [PATCH net-next v2 0/3] net: fec: driver code clean and bug fix
From: Fugang Duan @ 2014-12-11 1:20 UTC (permalink / raw)
To: davem; +Cc: netdev, bhutchings, stephen, b38611
The patch serial include code clean and bug fix:
Patch#1: avoid dummy operation during suspend/resume test.
Patch#2: bug fix for i.MX6SX SOC that clean all interrupt events during MAC initial process.
Patch#3: before phy device link status is up, only enable MDIO bus interrupt.
V2:
- Modify the comment form from David's suggestion.
Fugang Duan (3):
net: fec: reset fep link status in suspend function
net: fec: clear all interrupt events to support i.MX6SX
net: fec: only enable mdio interrupt before phy device link up
drivers/net/ethernet/freescale/fec_main.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
--
1.7.8
^ permalink raw reply
* [PATCH net-next v2 2/3] net: fec: clear all interrupt events to support i.MX6SX
From: Fugang Duan @ 2014-12-11 1:20 UTC (permalink / raw)
To: davem; +Cc: netdev, bhutchings, stephen, b38611
In-Reply-To: <1418260833-896-1-git-send-email-b38611@freescale.com>
For i.MX6SX FEC controller, there have interrupt mask and event
field extension. To support all SOCs FEC, we clear all interrupt
events during MAVC initial process.
Signed-off-by: Fugang Duan <B38611@freescale.com>
---
drivers/net/ethernet/freescale/fec_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index b118b7d..85c955e 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -940,7 +940,7 @@ fec_restart(struct net_device *ndev)
}
/* Clear any outstanding interrupt. */
- writel(0xffc00000, fep->hwp + FEC_IEVENT);
+ writel(0xffffffff, fep->hwp + FEC_IEVENT);
fec_enet_bd_init(ndev);
--
1.7.8
^ permalink raw reply related
* [PATCH net-next v2 3/3] net: fec: only enable mdio interrupt before phy device link up
From: Fugang Duan @ 2014-12-11 1:20 UTC (permalink / raw)
To: davem; +Cc: netdev, bhutchings, stephen, b38611
In-Reply-To: <1418260833-896-1-git-send-email-b38611@freescale.com>
Before phy device link up, we only enable FEC mdio interrupt, which
is more reasonable.
Signed-off-by: Fugang Duan <B38611@freescale.com>
---
drivers/net/ethernet/freescale/fec_main.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 85c955e..8c5b15e 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1075,7 +1075,10 @@ fec_restart(struct net_device *ndev)
fec_ptp_start_cyclecounter(ndev);
/* Enable interrupts we wish to service */
- writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+ if (fep->link)
+ writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+ else
+ writel(FEC_ENET_MII, fep->hwp + FEC_IMASK);
/* Init the interrupt coalescing */
fec_enet_itr_coal_init(ndev);
--
1.7.8
^ permalink raw reply related
* Re: [PATCH net-next RESEND 2/2] ipv6: fix sparse warning
From: Ying Xue @ 2014-12-11 1:56 UTC (permalink / raw)
To: paulmck
Cc: davem, eric.dumazet, jon.maloy, erik.hugne, netdev, kbuild-all,
linux-kernel
In-Reply-To: <20141210160406.GS25340@linux.vnet.ibm.com>
On 12/11/2014 12:04 AM, Paul E. McKenney wrote:
> On Wed, Dec 10, 2014 at 04:46:07PM +0800, Ying Xue wrote:
>> This fixes the following spare warning when using
>>
>> make C=1 CF=-D__CHECK_ENDIAN__ net/ipv6/addrconf.o
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>> net/ipv6/addrconf.c:3495:9: error: incompatible types in comparison expression (different address spaces)
>>
>> To silence above spare complaint, an RCU annotation should be added
>> to "next" pointer of hlist_node structure through hlist_next_rcu()
>> macro when iterating over a hlist with
>> hlist_for_each_entry_continue_rcu_bh().
>>
>> By the way, this commit also resolves the same error appearing in
>> hlist_for_each_entry_continue_rcu().
>>
>> Signed-off-by: Ying Xue <ying.xue@windriver.com>
>
> If you pull the rculist.h changes from the first patch into this one,
> I will queue it up through -rcu.
>
Please just queue this patch into your RCU tree. Some changes of the
first patch currently only exists in net-next tree, so it cannot be
merged into RCU tree now. Therefore, please temporarily ignore it. In
next 3.19 development cycle, I will resubmit it to you.
Thanks,
Ying
> Thanx, Paul
>
>> ---
>> include/linux/rculist.h | 16 ++++++++--------
>> 1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/include/linux/rculist.h b/include/linux/rculist.h
>> index 866d9c9..32bd4ad 100644
>> --- a/include/linux/rculist.h
>> +++ b/include/linux/rculist.h
>> @@ -524,11 +524,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n,
>> * @member: the name of the hlist_node within the struct.
>> */
>> #define hlist_for_each_entry_continue_rcu(pos, member) \
>> - for (pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\
>> - typeof(*(pos)), member); \
>> + for (pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \
>> + &(pos)->member)), typeof(*(pos)), member); \
>> pos; \
>> - pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\
>> - typeof(*(pos)), member))
>> + pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu( \
>> + &(pos)->member)), typeof(*(pos)), member))
>>
>> /**
>> * hlist_for_each_entry_continue_rcu_bh - iterate over a hlist continuing after current point
>> @@ -536,11 +536,11 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n,
>> * @member: the name of the hlist_node within the struct.
>> */
>> #define hlist_for_each_entry_continue_rcu_bh(pos, member) \
>> - for (pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\
>> - typeof(*(pos)), member); \
>> + for (pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu( \
>> + &(pos)->member)), typeof(*(pos)), member); \
>> pos; \
>> - pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\
>> - typeof(*(pos)), member))
>> + pos = hlist_entry_safe(rcu_dereference_bh(hlist_next_rcu( \
>> + &(pos)->member)), typeof(*(pos)), member))
>>
>> /**
>> * hlist_for_each_entry_from_rcu - iterate over a hlist continuing from current point
>> --
>> 1.7.9.5
>>
>
>
>
^ permalink raw reply
* Re: [PATCH] net: openvswitch: Support masked set actions.
From: Jesse Gross @ 2014-12-11 2:03 UTC (permalink / raw)
To: Jarno Rajahalme; +Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, netdev
In-Reply-To: <1418170225-9328-1-git-send-email-jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
On Tue, Dec 9, 2014 at 4:10 PM, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index df3c7f2..276bb60 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> @@ -2007,6 +2117,18 @@ int ovs_nla_put_actions(const struct nlattr *attr, int len, struct sk_buff *skb)
> return err;
> break;
>
> + case OVS_ACTION_ATTR_SET_MASKED:
> + err = masked_set_action_to_attr(a, skb);
> + if (err)
> + return err;
> + break;
I don't think this is necessary - the default case will handle things
that don't need any special processing.
I think you can also remove the port checks in validate_tp_port()
since the reasoning behind them is the same as the IP proto check.
Otherwise, I'm generally happy with this though.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev
^ permalink raw reply
* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
From: Toshiaki Makita @ 2014-12-11 2:04 UTC (permalink / raw)
To: David Miller; +Cc: netdev, bridge
In-Reply-To: <20141210.145047.1148744559031706340.davem@davemloft.net>
On 2014/12/11 4:50, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Wed, 10 Dec 2014 11:43:14 +0900
>
>> - features &= ~NETIF_F_ONE_FOR_ALL;
>> + features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>
> I don't think this is the expression you intend to use.
Thank you, but this is really my intended expression.
"features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
including GSO_SOFTWARE.
But I want to leave GSO_SOFTWARE bits here.
>
> I think you meant:
>
> features &= ~(NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE);
ONE_FOR_ALL already includes GSO_SOFTWARE.
>
> Or:
>
> features = ~NETIF_F_ONE_FOR_ALL;
> features |= NETIF_F_GSO_SOFTWARE;
This way, users cannot drop TSO/UFO by ethtool.
Thanks,
Toshiaki Makita
^ permalink raw reply
* Re: [PATCH] net: openvswitch: Support masked set actions.
From: Jesse Gross @ 2014-12-11 2:05 UTC (permalink / raw)
To: Jarno Rajahalme; +Cc: David Miller, netdev, dev@openvswitch.org
In-Reply-To: <2A734ABB-853F-4D17-91BB-1B62A784881C@nicira.com>
On Wed, Dec 10, 2014 at 12:03 PM, Jarno Rajahalme <jrajahalme@nicira.com> wrote:
>
> On Dec 10, 2014, at 11:48 AM, David Miller <davem@davemloft.net> wrote:
>
>> From: Jarno Rajahalme <jrajahalme@nicira.com>
>> Date: Tue, 9 Dec 2014 16:10:25 -0800
>>
>>> OVS userspace already probes the openvswitch kernel module for
>>> OVS_ACTION_ATTR_SET_MASKED support. This patch adds the kernel module
>>> implementation of masked set actions.
>>>
>>> The existing set action sets many fields at once. When only a subset
>>> of the IP header fields, for example, should be modified, all the IP
>>> fields need to be exact matched so that the other field values can be
>>> copied to the set action. A masked set action allows modification of
>>> an arbitrary subset of the supported header bits without requiring the
>>> rest to be matched.
>>>
>>> Masked set action is now supported for all writeable key types, except
>>> for the tunnel key. The set tunnel action is an exception as any
>>> input tunnel info is cleared before action processing starts, so there
>>> is no tunnel info to mask.
>>>
>>> The kernel module converts all (non-tunnel) set actions to masked set
>>> actions. This makes action processing more uniform, and results in
>>> less branching and duplicating the action processing code. When
>>> returning actions to userspace, the fully masked set actions are
>>> converted back to normal set actions. We use a kernel internal action
>>> code to be able to tell the userspace provided and converted masked
>>> set actions apart.
>>>
>>> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
>>
>> How does this work, should I be waiting for a signoff or ACK from
>> Pravin before applying this directly to my tree?
>
> In this case you should wait for an Acked-by from Jesse, as he has
> reviewed previous versions of this patch sent to dev@openvswitch.org
> only. I should have included a note about that, sorry.
I gave some review comments but generally speaking my expectation is
that Pravin, as the maintainer, will provide an ack for OVS patches.
^ permalink raw reply
* Re: [PATCH net] gianfar: Fix dma check map error when DMA_API_DEBUG is enabled
From: Kevin Hao @ 2014-12-11 2:06 UTC (permalink / raw)
To: David Miller; +Cc: claudiu.manoil, netdev
In-Reply-To: <20141210.131347.2165044584202384761.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]
On Wed, Dec 10, 2014 at 01:13:47PM -0500, David Miller wrote:
> From: Claudiu Manoil <claudiu.manoil@freescale.com>
> Date: Tue, 9 Dec 2014 16:24:35 +0200
>
> > From: Kevin Hao <haokexin@gmail.com>
> >
> > We need to use dma_mapping_error() to check the dma address returned
> > by dma_map_single/page(). Otherwise we would get warning like this:
> ...
> > For TX, we need to unmap the pages which has already been mapped and
> > free the skb before return. For RX, just let the rxbdp as unempty.
> > We can retry to initialize it to empty in next round.
> >
> > Signed-off-by: Kevin Hao <haokexin@gmail.com>
> > Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
>
> The RX behavior needs to be adjusted.
>
> You should never leave holes in the RX ring, ever.
>
> Instead, try allocating the new RX skb first, and only if
> you are successful should you pass up the original SKB. If
> it fails, then reuse the original SKB in the RX ring.
OK, will do.
Thanks,
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply
* [PATCH net-next v2 1/3] net: fec: reset fep link status in suspend function
From: Fugang Duan @ 2014-12-11 1:20 UTC (permalink / raw)
To: davem; +Cc: netdev, bhutchings, stephen, b38611
In-Reply-To: <1418260833-896-1-git-send-email-b38611@freescale.com>
On some i.MX6 serial boards, phy power and refrence clock are supplied
or controlled by SOC. When do suspend/resume test, the power and clock
are disabled, so phy device link down.
For current driver, fep->link is still up status, which cause extra operation
like below code. To avoid the dumy operation, we set fep->link to down when
phy device is real down.
...
if (fep->link) {
napi_disable(&fep->napi);
netif_tx_lock_bh(ndev);
fec_stop(ndev);
netif_tx_unlock_bh(ndev);
napi_enable(&fep->napi);
fep->link = phy_dev->link;
status_change = 1;
}
...
Signed-off-by: Fugang Duan <B38611@freescale.com>
---
drivers/net/ethernet/freescale/fec_main.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index fee2afe..b118b7d 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3332,6 +3332,12 @@ static int __maybe_unused fec_suspend(struct device *dev)
if (fep->reg_phy)
regulator_disable(fep->reg_phy);
+ /* SOC supply clock to phy, when clock is disabled, phy link down
+ * SOC control phy regulator, when regulator is disabled, phy link down
+ */
+ if (fep->clk_enet_out || fep->reg_phy)
+ fep->link = 0;
+
return 0;
}
--
1.7.8
^ permalink raw reply related
* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
From: David Miller @ 2014-12-11 2:13 UTC (permalink / raw)
To: makita.toshiaki; +Cc: stephen, netdev, bridge
In-Reply-To: <5488FBBC.2050105@lab.ntt.co.jp>
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Thu, 11 Dec 2014 11:04:44 +0900
> On 2014/12/11 4:50, David Miller wrote:
>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>>
>>> - features &= ~NETIF_F_ONE_FOR_ALL;
>>> + features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>>
>> I don't think this is the expression you intend to use.
>
> Thank you, but this is really my intended expression.
>
> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
> including GSO_SOFTWARE.
> But I want to leave GSO_SOFTWARE bits here.
It is clearer to say this as:
~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)
Or create a new NETIF_F_* macro to express this idea succinctly.
^ permalink raw reply
* Re: [PATCH net-next] bridge: Add ability to always enable TSO/UFO
From: Toshiaki Makita @ 2014-12-11 2:20 UTC (permalink / raw)
To: David Miller; +Cc: netdev, bridge
In-Reply-To: <20141210.211306.1331714594864472914.davem@davemloft.net>
On 2014/12/11 11:13, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Thu, 11 Dec 2014 11:04:44 +0900
>
>> On 2014/12/11 4:50, David Miller wrote:
>>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>>>
>>>> - features &= ~NETIF_F_ONE_FOR_ALL;
>>>> + features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>>>
>>> I don't think this is the expression you intend to use.
>>
>> Thank you, but this is really my intended expression.
>>
>> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
>> including GSO_SOFTWARE.
>> But I want to leave GSO_SOFTWARE bits here.
>
> It is clearer to say this as:
>
> ~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)
>
> Or create a new NETIF_F_* macro to express this idea succinctly.
OK, I will. (once net-next is reopened)
Thanks,
Toshiaki Makita
^ permalink raw reply
* default enable sparse __CHECK_ENDIAN__ (was: Re: [PATCH v7 2/3] net: Add Keystone NetCP ethernet driver)
From: Joe Perches @ 2014-12-11 3:04 UTC (permalink / raw)
To: David Miller, Andrew Morton, Christopher Li, Michal Marek
Cc: m-karicheri2-l0cyMroinI0, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
grant.likely-QSEj5FYQhm4dnm+yROfE0A,
linux-sparse-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20141210.204110.618599360537141819.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Wed, 2014-12-10 at 20:41 -0500, David Miller wrote:
> From: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
> > Are you referring to the static code analyser sparse that is invoked
> > through?
> You have to explicitly enable endian checking, it's not on by
> default.
There don't seem to be thousands of warnings anymore.
Maybe it's time to default enable it when using C=?
from: Documentation/sparse.txt:
The optional make variable CF can be used to pass arguments to sparse. The
build system passes -Wbitwise to sparse automatically. To perform endianness
checks, you may define __CHECK_ENDIAN__:
make C=2 CF="-D__CHECK_ENDIAN__"
These checks are disabled by default as they generate a host of warnings.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH v3] net: introduce helper macro for_each_cmsghdr
From: Gu Zheng @ 2014-12-11 3:22 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, linux-kernel, Joe Perches
Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
cmsghdr from msghdr, just cleanup.
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
---
v3:
-drop the changes about user-land programs as David suggested.
v2:
-use the lower-case macro name as Joe suggested.
crypto/af_alg.c | 2 +-
include/linux/socket.h | 4 ++++
net/core/scm.c | 3 +--
net/dccp/proto.c | 5 ++---
net/ipv4/ip_sockglue.c | 2 +-
net/ipv6/datagram.c | 2 +-
net/iucv/af_iucv.c | 4 +---
net/rds/send.c | 4 ++--
net/rxrpc/ar-output.c | 2 +-
net/sctp/socket.c | 3 +--
10 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 6a3ad80..bc21f52 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -399,7 +399,7 @@ int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con)
{
struct cmsghdr *cmsg;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ for_each_cmsghdr(cmsg, msg) {
if (!CMSG_OK(msg, cmsg))
return -EINVAL;
if (cmsg->cmsg_level != SOL_ALG)
diff --git a/include/linux/socket.h b/include/linux/socket.h
index bb9b836..0e71278 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -94,6 +94,10 @@ struct cmsghdr {
(cmsg)->cmsg_len <= (unsigned long) \
((mhdr)->msg_controllen - \
((char *)(cmsg) - (char *)(mhdr)->msg_control)))
+#define for_each_cmsghdr(cmsg, msg) \
+ for (cmsg = CMSG_FIRSTHDR(msg); \
+ cmsg; \
+ cmsg = CMSG_NXTHDR(msg, cmsg))
/*
* Get the next cmsg header
diff --git a/net/core/scm.c b/net/core/scm.c
index b442e7e..3b6899b 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -129,8 +129,7 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p)
struct cmsghdr *cmsg;
int err;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg))
- {
+ for_each_cmsghdr(cmsg, msg) {
err = -EINVAL;
/* Verify that cmsg_len is at least sizeof(struct cmsghdr) */
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 5ab6627..e7413a9 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -703,7 +703,7 @@ EXPORT_SYMBOL_GPL(compat_dccp_getsockopt);
static int dccp_msghdr_parse(struct msghdr *msg, struct sk_buff *skb)
{
- struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg);
+ struct cmsghdr *cmsg;
/*
* Assign an (opaque) qpolicy priority value to skb->priority.
@@ -717,8 +717,7 @@ static int dccp_msghdr_parse(struct msghdr *msg, struct sk_buff *skb)
*/
skb->priority = 0;
- for (; cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) {
-
+ for_each_cmsghdr(cmsg, msg) {
if (!CMSG_OK(msg, cmsg))
return -EINVAL;
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 9daf217..839db9d 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -192,7 +192,7 @@ int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc,
int err, val;
struct cmsghdr *cmsg;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ for_each_cmsghdr(cmsg, msg) {
if (!CMSG_OK(msg, cmsg))
return -EINVAL;
#if IS_ENABLED(CONFIG_IPV6)
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 2cdc383..7252965 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -640,7 +640,7 @@ int ip6_datagram_send_ctl(struct net *net, struct sock *sk,
int len;
int err = 0;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ for_each_cmsghdr(cmsg, msg) {
int addr_type;
if (!CMSG_OK(msg, cmsg)) {
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index a089b6b..b69d87e 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1070,9 +1070,7 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
txmsg.class = 0;
/* iterate over control messages */
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg;
- cmsg = CMSG_NXTHDR(msg, cmsg)) {
-
+ for_each_cmsghdr(cmsg, msg) {
if (!CMSG_OK(msg, cmsg)) {
err = -EINVAL;
goto out;
diff --git a/net/rds/send.c b/net/rds/send.c
index 0a64541..b23e7b8 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -826,7 +826,7 @@ static int rds_rm_size(struct msghdr *msg, int data_len)
int cmsg_groups = 0;
int retval;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ for_each_cmsghdr(cmsg, msg) {
if (!CMSG_OK(msg, cmsg))
return -EINVAL;
@@ -878,7 +878,7 @@ static int rds_cmsg_send(struct rds_sock *rs, struct rds_message *rm,
struct cmsghdr *cmsg;
int ret = 0;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ for_each_cmsghdr(cmsg, msg) {
if (!CMSG_OK(msg, cmsg))
return -EINVAL;
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 0b4b9a7..83b4616 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -45,7 +45,7 @@ static int rxrpc_sendmsg_cmsg(struct rxrpc_sock *rx, struct msghdr *msg,
if (msg->msg_controllen == 0)
return -EINVAL;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
+ for_each_cmsghdr(cmsg, msg) {
if (!CMSG_OK(msg, cmsg))
return -EINVAL;
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 634a2ab..a3802ed 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6592,8 +6592,7 @@ static int sctp_msghdr_parse(const struct msghdr *msg, sctp_cmsgs_t *cmsgs)
struct cmsghdr *cmsg;
struct msghdr *my_msg = (struct msghdr *)msg;
- for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL;
- cmsg = CMSG_NXTHDR(my_msg, cmsg)) {
+ for_each_cmsghdr(cmsg, my_msg) {
if (!CMSG_OK(my_msg, cmsg))
return -EINVAL;
--
1.7.7
^ permalink raw reply related
* Re: [PATCH v3] net: introduce helper macro for_each_cmsghdr
From: David Miller @ 2014-12-11 3:42 UTC (permalink / raw)
To: guz.fnst; +Cc: netdev, linux-kernel, joe
In-Reply-To: <54890DDC.3040402@cn.fujitsu.com>
From: Gu Zheng <guz.fnst@cn.fujitsu.com>
Date: Thu, 11 Dec 2014 11:22:04 +0800
> Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
> cmsghdr from msghdr, just cleanup.
>
> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
> ---
> v3:
> -drop the changes about user-land programs as David suggested.
> v2:
> -use the lower-case macro name as Joe suggested.
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net v8 1/7] cxgb4i: fix tx immediate data credit check
From: David Miller @ 2014-12-11 3:54 UTC (permalink / raw)
To: kxie; +Cc: linux-scsi, netdev, hariprasad, anish, hch, James.Bottomley,
michaelc
In-Reply-To: <201412102111.sBALB6sI011656@localhost6.localdomain6>
From: Karen Xie <kxie@chelsio.com>
Date: Wed, 10 Dec 2014 13:11:06 -0800
> From: Karen Xie <kxie@chelsio.com>
>
> Only data skbs need the wr header added while control skbs do not. Make sure they are treated differently.
>
> Signed-off-by: Karen Xie <kxie@chelsio.com>
Please text format your commit messages to 80 characters or less per
line.
People are going to read your commits using text tools, not
necessarily GUI tools which will auto-format your commit message.
I know this seems like we are being difficult, but you are making many
fundamental mistakes in your efforts to merge in these changes.
^ permalink raw reply
* [PATCH net-next] net: sock: fix access via invalid file descriptor
From: Alexei Starovoitov @ 2014-12-11 4:14 UTC (permalink / raw)
To: David S. Miller
Cc: Fengguang Wu, Dave Jones, Daniel Borkmann, netdev, linux-kernel
0day robot reported the following crash:
[ 21.233581] BUG: unable to handle kernel NULL pointer dereference at 0000000000000007
[ 21.234709] IP: [<ffffffff8156ebda>] sk_attach_bpf+0x39/0xc2
It's due to bpf_prog_get() returning ERR_PTR.
Check it properly.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Fixes: 89aa075832b0 ("net: sock: allow eBPF programs to be attached to sockets")
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
---
Silly mistake. I was sure I've checked this error path. Apparently not :(
net/core/filter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 8cc3c03078b3..ec9baea10c16 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1103,8 +1103,8 @@ int sk_attach_bpf(u32 ufd, struct sock *sk)
return -EPERM;
prog = bpf_prog_get(ufd);
- if (!prog)
- return -EINVAL;
+ if (IS_ERR(prog))
+ return PTR_ERR(prog);
if (prog->aux->prog_type != BPF_PROG_TYPE_SOCKET_FILTER) {
/* valid fd, but invalid program type */
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH net-next v2 1/4] netdev: introduce new NETIF_F_HW_NETFUNC_OFFLOAD feature flag for switch device offloads
From: Roopa Prabhu @ 2014-12-11 4:31 UTC (permalink / raw)
To: Jiri Pirko
Cc: sfeldma, jhs, bcrl, tgraf, john.fastabend, stephen, linville,
vyasevic, netdev, davem, shm, gospo
In-Reply-To: <20141210093150.GA1863@nanopsycho.orion>
On 12/10/14, 1:31 AM, Jiri Pirko wrote:
> Wed, Dec 10, 2014 at 10:05:17AM CET, roopa@cumulusnetworks.com wrote:
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> This is a high level feature flag for all switch asic offloads
>>
>> switch drivers set this flag on switch ports. Logical devices like
>> bridge, bonds, vxlans can inherit this flag from their slaves/ports.
>
> Interesting thing is that you are talking about "switch" (mentioned 3
> times on 3 lines), yet the name of bit is "NETFUNC_OFFLOAD". I'm sorry,
> I might be missing some obvious facts but "netfunc" seems ambiguous
> to me.
scotts and your series and mine too is being introduced for switch asics
right now.
And we are all only targeting l2 today. But, Keeping future in mind, the
names we choose today
should be applicable for all other features and also other similar devices.
Even the 'switch' in the api names is making it not fit well in some cases.
I am not hung up on 'network function', if there are other suggestions I
will be happy to take.
Thanks,
Roopa
>
>
>> The patch also adds the flag to NETIF_F_ONE_FOR_ALL, so that it gets
>> propagated to the upperdevices (bridges and bonds).
>>
>> (In case you did not notice, I am trying a new name NETIF_F_HW_NETFUNC_OFFLOAD for the flag ;)
>>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>> ---
>> include/linux/netdev_features.h | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
>> index 8e30685..8ab175b 100644
>> --- a/include/linux/netdev_features.h
>> +++ b/include/linux/netdev_features.h
>> @@ -66,6 +66,7 @@ enum {
>> NETIF_F_HW_VLAN_STAG_FILTER_BIT,/* Receive filtering on VLAN STAGs */
>> NETIF_F_HW_L2FW_DOFFLOAD_BIT, /* Allow L2 Forwarding in Hardware */
>> NETIF_F_BUSY_POLL_BIT, /* Busy poll */
>> + NETIF_F_HW_NETFUNC_OFFLOAD_BIT, /* HW switch offload */
>>
>> /*
>> * Add your fresh new feature above and remember to update
>> @@ -124,6 +125,7 @@ enum {
>> #define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX)
>> #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD)
>> #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL)
>> +#define NETIF_F_HW_NETFUNC_OFFLOAD __NETIF_F(HW_NETFUNC_OFFLOAD)
>>
>> /* Features valid for ethtool to change */
>> /* = all defined minus driver/device-class-related */
>> @@ -159,7 +161,8 @@ enum {
>> */
>> #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
>> NETIF_F_SG | NETIF_F_HIGHDMA | \
>> - NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED)
>> + NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED | \
>> + NETIF_F_HW_NETFUNC_OFFLOAD)
>> /*
>> * If one device doesn't support one of these features, then disable it
>> * for all in netdev_increment_features.
>> --
>> 1.7.10.4
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" 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
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