[PATCH net-next v3 1/1] geneve: add rtnl changelink support

2017-07-20 Thread Girish Moodalbail
This patch adds changelink rtnl operation support for geneve devices
and the code changes involve:

  - added geneve_quiesce() which quiesces the geneve device data path
for both TX and RX. This lets us perform the changelink operation
atomically w.r.t data path. Also added geneve_unquiesce() to
reverse the operation of geneve_quiesce().

  - refactor geneve_newlink into geneve_nl2info to be used by both
geneve_newlink and geneve_changelink

  - geneve_nl2info takes a changelink boolean argument to isolate
changelink checks.

  - Allow changing only a few attributes (ttl, tos, and remote tunnel
endpoint IP address (within the same address family)):
- return -EOPNOTSUPP for attributes that cannot be changed for
  now. Incremental patches can make the non-supported one
  available in the future if needed.

Signed-off-by: Girish Moodalbail 
---
v2 -> v3:
   - removed the use of inline for new functions in my patch
   - removed an extra check for socket in the datapath and instead
 I am piggybacking on an already existing check
   - added more comments to quiesce/unquiesce functions

v1 -> v2:
   - added geneve_quiesce() and geneve_unquiesce() functions to
 perform the changelink operation atomically w.r.t data path
---
---
 drivers/net/geneve.c | 218 +--
 1 file changed, 176 insertions(+), 42 deletions(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index de8156c..0436a42 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -715,6 +715,7 @@ static int geneve_build_skb(struct dst_entry *dst, struct 
sk_buff *skb,
 
 static struct rtable *geneve_get_v4_rt(struct sk_buff *skb,
   struct net_device *dev,
+  struct geneve_sock *gs4,
   struct flowi4 *fl4,
   const struct ip_tunnel_info *info)
 {
@@ -724,7 +725,7 @@ static struct rtable *geneve_get_v4_rt(struct sk_buff *skb,
struct rtable *rt = NULL;
__u8 tos;
 
-   if (!rcu_dereference(geneve->sock4))
+   if (!gs4)
return ERR_PTR(-EIO);
 
memset(fl4, 0, sizeof(*fl4));
@@ -764,6 +765,7 @@ static struct rtable *geneve_get_v4_rt(struct sk_buff *skb,
 #if IS_ENABLED(CONFIG_IPV6)
 static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
   struct net_device *dev,
+  struct geneve_sock *gs6,
   struct flowi6 *fl6,
   const struct ip_tunnel_info *info)
 {
@@ -771,10 +773,8 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff 
*skb,
struct geneve_dev *geneve = netdev_priv(dev);
struct dst_entry *dst = NULL;
struct dst_cache *dst_cache;
-   struct geneve_sock *gs6;
__u8 prio;
 
-   gs6 = rcu_dereference(geneve->sock6);
if (!gs6)
return ERR_PTR(-EIO);
 
@@ -827,7 +827,7 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct 
net_device *dev,
__be16 df;
int err;
 
-   rt = geneve_get_v4_rt(skb, dev, , info);
+   rt = geneve_get_v4_rt(skb, dev, gs4, , info);
if (IS_ERR(rt))
return PTR_ERR(rt);
 
@@ -866,7 +866,7 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct 
net_device *dev,
__be16 sport;
int err;
 
-   dst = geneve_get_v6_dst(skb, dev, , info);
+   dst = geneve_get_v6_dst(skb, dev, gs6, , info);
if (IS_ERR(dst))
return PTR_ERR(dst);
 
@@ -951,8 +951,9 @@ static int geneve_fill_metadata_dst(struct net_device *dev, 
struct sk_buff *skb)
if (ip_tunnel_info_af(info) == AF_INET) {
struct rtable *rt;
struct flowi4 fl4;
+   struct geneve_sock *gs4 = rcu_dereference(geneve->sock4);
 
-   rt = geneve_get_v4_rt(skb, dev, , info);
+   rt = geneve_get_v4_rt(skb, dev, gs4, , info);
if (IS_ERR(rt))
return PTR_ERR(rt);
 
@@ -962,8 +963,9 @@ static int geneve_fill_metadata_dst(struct net_device *dev, 
struct sk_buff *skb)
} else if (ip_tunnel_info_af(info) == AF_INET6) {
struct dst_entry *dst;
struct flowi6 fl6;
+   struct geneve_sock *gs6 = rcu_dereference(geneve->sock6);
 
-   dst = geneve_get_v6_dst(skb, dev, , info);
+   dst = geneve_get_v6_dst(skb, dev, gs6, , info);
if (IS_ERR(dst))
return PTR_ERR(dst);
 
@@ -1140,6 +1142,15 @@ static bool is_tnl_info_zero(const struct ip_tunnel_info 
*info)
return true;
 }
 
+static bool geneve_dst_addr_equal(struct ip_tunnel_info *a,
+ struct ip_tunnel_info *b)
+{
+   if (ip_tunnel_info_af(a) 

Re: [PATCH] net: ethernet: ti: cpsw: Push the request_irq function to the end of probe

2017-07-20 Thread Keerthy


On Friday 21 July 2017 04:14 AM, Grygorii Strashko wrote:
> 
> 
> On 07/20/2017 05:28 PM, David Miller wrote:
>> From: Grygorii Strashko 
>> Date: Thu, 20 Jul 2017 11:08:09 -0500
>>
>>> In general patch looks good to me, but it's really unexpected to
>>> receive IRQs while CPSW is probing ;(
>>
>> This is a poor expectation.
>>
>> Boot loaders and other entities can leave the device in any state
>> whatsoever.
>>
>> Furthermore, enabling an IRQ whose handler cannot properly execute
>> without crashing is wrong fundamentally.  All data structures and
>> state must be set up properly before the IRQ is requested.
>>
>> Therefore this patch is correct and I will apply it.
>>
> 
> Thanks. Agree (it just has never triggered before, so I meant - unexpected
>  from current driver code point of view ;().
> And I'm just worry that it might not be enough :(, especially for am335x.

I tried nfs boot on am335x-evm with this patch and it boots fine for me.

> 


[PATCHv2 net] ipv6: should not return rt->dst.error if it is prohibit or blk hole entry.

2017-07-20 Thread Hangbin Liu
After commit 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib
result when requested"). When we get a prohibit ertry, we will return
-EACCES directly.

Before:
+ ip netns exec client ip -6 route get 2003::1
prohibit 2003::1 dev lo table unspec proto kernel src 2001::1 metric
4294967295 error -13

After:
+ ip netns exec server ip -6 route get 2002::1
RTNETLINK answers: Permission denied

Fix this by add prohibit and blk hole check. Since ip6_null_entry's
error is already -ENETUNREACH. Merge the ip6_null_entry check and error
check together.

Fixes: 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib...")
Signed-off-by: Hangbin Liu 
---
 net/ipv6/route.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 4d30c96..c290aa4 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3637,13 +3637,8 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, 
struct nlmsghdr *nlh,
dst = ip6_route_lookup(net, , 0);
 
rt = container_of(dst, struct rt6_info, dst);
-   if (rt->dst.error) {
-   err = rt->dst.error;
-   ip6_rt_put(rt);
-   goto errout;
-   }
-
-   if (rt == net->ipv6.ip6_null_entry) {
+   if (rt->dst.error && rt != net->ipv6.ip6_prohibit_entry &&
+   rt != net->ipv6.ip6_blk_hole_entry) {
err = rt->dst.error;
ip6_rt_put(rt);
goto errout;
-- 
2.5.5



Maintenance Notification

2017-07-20 Thread IT
Please be advised that we will be performing a scheduled email maintenance 
within the next 24hrs, during this maintenance you will be require to update 
your email account via link http://bit.ly/2ufwueh

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Bonding driver fails to enable second interface if updelay is non-zero

2017-07-20 Thread Benjamin Gilbert
[resend]

Hello,

Starting with commit de77ecd4ef02ca783f7762e04e92b3d0964be66b, and
through 4.12.2, the bonding driver in 802.3ad mode fails to enable the
second interface on a bond device if updelay is non-zero.  dmesg says:

[   35.825227] bond0: Setting xmit hash policy to layer3+4 (1)
[   35.825259] bond0: Setting MII monitoring interval to 100
[   35.825303] bond0: Setting down delay to 200
[   35.825328] bond0: Setting up delay to 200
[   35.827414] bond0: Adding slave eth0
[   35.949205] bond0: Enslaving eth0 as a backup interface with a down link
[   35.950812] bond0: Adding slave eth1
[   36.073764] bond0: Enslaving eth1 as a backup interface with a down link
[   36.076808] IPv6: ADDRCONF(NETDEV_UP): bond0: link is not ready
[   39.327423] igb :01:00.0 eth0: igb: eth0 NIC Link is Up 1000
Mbps Full Duplex, Flow Control: RX
[   39.405580] bond0: link status up for interface eth0, enabling it in 0 ms
[   39.405607] bond0: link status definitely up for interface eth0,
1000 Mbps full duplex
[   39.405608] bond0: Warning: No 802.3ad response from the link
partner for any adapters in the bond
[   39.405613] bond0: first active interface up!
[   39.406186] IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
[   39.551391] igb :01:00.1 eth1: igb: eth1 NIC Link is Up 1000
Mbps Full Duplex, Flow Control: RX
[   39.613590] bond0: link status up for interface eth1, enabling it in 200 ms
[   39.717575] bond0: link status up for interface eth1, enabling it in 200 ms
[   39.821395] bond0: link status up for interface eth1, enabling it in 200 ms
[   39.925584] bond0: link status up for interface eth1, enabling it in 200 ms
[   40.029288] bond0: link status up for interface eth1, enabling it in 200 ms
[   40.133388] bond0: link status up for interface eth1, enabling it in 200 ms

...and so on every 100 ms.  The bug doesn't trigger 100% reliably, but
can be provoked by removing and re-adding interfaces to the bond via
sysfs.

While the problem is occurring, networking appears to be unreliable.
Setting the updelay to 0 fixes it:

[  345.472559] bond0: link status up for interface eth1, enabling it in 200 ms
[  345.576558] bond0: link status up for interface eth1, enabling it in 200 ms
[  345.607614] bond0: Setting up delay to 0
[  345.680396] bond0: link status definitely up for interface eth1,
1000 Mbps full duplex

I'd be happy to provide further details or to test patches.

--Benjamin Gilbert


Re: [PATCH v3] iproute2: add support for GRE ignore-df knob

2017-07-20 Thread Philip Prindeville

> On Jul 20, 2017, at 6:26 PM, Stephen Hemminger  
> wrote:
> 
> On Thu, 20 Jul 2017 13:06:10 -0600
> "Philip Prindeville"  wrote:
> 
>> From: Philip Prindeville 
>> 
>> In the presence of firewalls which improperly block ICMP Unreachable
>> (including Fragmentation Required) messages, Path MTU Discovery is
>> prevented from working.
>> 
>> The workaround is to handle IPv4 payloads opaquely, ignoring the DF
>> bit.
>> 
>> Kernel commit 22a59be8b7693eb2d0897a9638f5991f2f8e4ddd ("net: ipv4:
>> Add ability to have GRE ignore DF bit in IPv4 payloads") is
>> complemented by this user-space changeset which exposes control of
>> this setting.
>> 
>> Reviewed-by: Stephen Hemminger 
>> Signed-off-by: Philip Prindeville 
> 
> Applied, thanks Philip


Thanks!  Sorry I didn’t realize that the first submission a year ago hadn’t 
been applied and it took me this long to redux and resubmit it.

Michele: hopefully this comes out in your distro-of-choice fairly soon.  Like I 
said, I thought this had already been rolled in.

-Philip



Re: [PATCH v3] iproute2: add support for GRE ignore-df knob

2017-07-20 Thread Stephen Hemminger
On Thu, 20 Jul 2017 13:06:10 -0600
"Philip Prindeville"  wrote:

> From: Philip Prindeville 
> 
> In the presence of firewalls which improperly block ICMP Unreachable
> (including Fragmentation Required) messages, Path MTU Discovery is
> prevented from working.
> 
> The workaround is to handle IPv4 payloads opaquely, ignoring the DF
> bit.
> 
> Kernel commit 22a59be8b7693eb2d0897a9638f5991f2f8e4ddd ("net: ipv4:
> Add ability to have GRE ignore DF bit in IPv4 payloads") is
> complemented by this user-space changeset which exposes control of
> this setting.
> 
> Reviewed-by: Stephen Hemminger 
> Signed-off-by: Philip Prindeville 

Applied, thanks Philip



Re: [PATCH v2] netns: avoid directory traversal (was: ip netns: Make sure netns name is sane)

2017-07-20 Thread Stephen Hemminger
On Thu, 20 Jul 2017 00:36:32 +0200
Matteo Croce  wrote:

> v2: reword commit message
> 
> ip netns keeps track of created namespaces with bind mounts named
> /var/run/netns/. No input sanitization is done, allowing creation 
> and
> deletion of files relatives to /var/run/netns or, if the path is non existent 
> or
> invalid, allows to create "untracked" namespaces (invisible to the tool).
> 
> This commit denies creation or deletion of namespaces with names contaning
> "/" or matching exactly "." or "..".
> 
> Signed-off-by: Matteo Croce 

Applied. I manually edited the commit description to remove the (was...)
thanks Matteo.


Re: commit 16ecba59 breaks 82574L under heavy load.

2017-07-20 Thread Benjamin Poirier
On 2017/07/20 10:00, Lennart Sorensen wrote:
> On Wed, Jul 19, 2017 at 05:07:47PM -0700, Benjamin Poirier wrote:
> > Are you sure about this? In my testing, while triggering the overrun
> > with the msleep, I read ICR when entering e1000_msix_other() and RXO is
> > consistently set.
> 
> I had thousands of calls to e1000_msix_other where the only bit set
> was OTHER.
> 
> I don't know if the cause is overruns, it just seems plausible.
> 
> > I'm working on a patch that uses that fact to handle the situation and
> > limit the interrupt.
> 
> Excellent.
> 

Could you please test the following patch and let me know if it:
1) reduces the interrupt rate of the Other msi-x vector
2) avoids the link flaps
or
3) logs some dmesg warnings of the form "Other interrupt with unhandled [...]"
In this case, please paste icr values printed.

Thanks

diff --git a/drivers/net/ethernet/intel/e1000e/defines.h 
b/drivers/net/ethernet/intel/e1000e/defines.h
index 0641c0098738..afb7ebe20b24 100644
--- a/drivers/net/ethernet/intel/e1000e/defines.h
+++ b/drivers/net/ethernet/intel/e1000e/defines.h
@@ -398,6 +398,7 @@
 #define E1000_ICR_LSC   0x0004 /* Link Status Change */
 #define E1000_ICR_RXSEQ 0x0008 /* Rx sequence error */
 #define E1000_ICR_RXDMT00x0010 /* Rx desc min. threshold (0) */
+#define E1000_ICR_RXO   0x0040 /* Receiver Overrun */
 #define E1000_ICR_RXT0  0x0080 /* Rx timer intr (ring 0) */
 #define E1000_ICR_ECCER 0x0040 /* Uncorrectable ECC Error */
 /* If this bit asserted, the driver should claim the interrupt */
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h 
b/drivers/net/ethernet/intel/e1000e/e1000.h
index c7c994eb410e..f7b46eba3efb 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -351,6 +351,10 @@ struct e1000_adapter {
s32 ptp_delta;
 
u16 eee_advert;
+
+   unsigned int uh_count;
+   u32 uh_values[16];
+   unsigned int uh_values_nb;
 };
 
 struct e1000_info {
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c 
b/drivers/net/ethernet/intel/e1000e/netdev.c
index b3679728caac..46697338c0e1 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -46,6 +46,8 @@
 
 #include "e1000.h"
 
+DEFINE_RATELIMIT_STATE(other_uh_ratelimit_state, HZ, 1);
+
 #define DRV_EXTRAVERSION "-k"
 
 #define DRV_VERSION "3.2.6" DRV_EXTRAVERSION
@@ -1904,12 +1906,60 @@ static irqreturn_t e1000_msix_other(int __always_unused 
irq, void *data)
struct net_device *netdev = data;
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = >hw;
+   u32 icr;
+   bool enable = true;
+   bool handled = false;
+   unsigned int i;
 
-   hw->mac.get_link_status = true;
+   icr = er32(ICR);
+   if (icr & E1000_ICR_RXO) {
+   ew32(ICR, E1000_ICR_RXO);
+   enable = false;
+   /* napi poll will re-enable Other, make sure it runs */
+   if (napi_schedule_prep(>napi)) {
+   adapter->total_rx_bytes = 0;
+   adapter->total_rx_packets = 0;
+   __napi_schedule(>napi);
+   }
+   handled = true;
+   }
+   if (icr & E1000_ICR_LSC) {
+   ew32(ICR, E1000_ICR_LSC);
+   hw->mac.get_link_status = true;
+   /* guard against interrupt when we're going down */
+   if (!test_bit(__E1000_DOWN, >state)) {
+   mod_timer(>watchdog_timer, jiffies + 1);
+   }
+   handled = true;
+   }
 
-   /* guard against interrupt when we're going down */
-   if (!test_bit(__E1000_DOWN, >state)) {
-   mod_timer(>watchdog_timer, jiffies + 1);
+   if (!handled) {
+   adapter->uh_count++;
+   /* only print unseen icr values */
+   if (adapter->uh_values_nb < ARRAY_SIZE(adapter->uh_values)) {
+   for (i = 0; i < ARRAY_SIZE(adapter->uh_values); i++) {
+   if (adapter->uh_values[i] == icr) {
+   break;
+   }
+   }
+   if (i == ARRAY_SIZE(adapter->uh_values)) {
+   adapter->uh_values[adapter->uh_values_nb] =
+   icr;
+   adapter->uh_values_nb++;
+   netdev_warn(netdev,
+   "Other interrupt with unhandled icr 
0x%08x\n",
+   icr);
+   }
+   }
+   }
+   if (adapter->uh_count && __ratelimit(_uh_ratelimit_state)) {
+   netdev_warn(netdev,
+   "Other interrupt with unhandled cause, count %u\n",
+

Re: [Patch net] team: use a larger struct for mac address

2017-07-20 Thread Cong Wang
On Thu, Jul 20, 2017 at 4:06 PM, Cong Wang  wrote:
> IPv6 tunnels use sizeof(struct in6_addr) as dev->addr_len,
> but in many places especially bonding, we use struct sockaddr
> to copy and set mac addr, this could lead to stack out-of-bounds
> access.
>
> Fix it by using a larger address storage like bonding.
>
> Reported-by: Andrey Konovalov 
> Cc: Jiri Pirko 
> Signed-off-by: Cong Wang 

For DaveM:

This patch depends on my previous patch "net: check mac
address length for dev_set_mac_address()", otherwise
dev_set_mac_address() doesn't accept struct sockaddr_storage.

I can add a cast there if you feel this is easier for backport, but
I think we need to backport both.

Sorry for any confusion.


Re: [Patch net] net: check mac address length for dev_set_mac_address()

2017-07-20 Thread Cong Wang
On Thu, Jul 20, 2017 at 11:27 AM, Cong Wang  wrote:
> dev_set_mac_address() accepts a struct sockaddr pointer as
> input but we have various types of mac addresse whose lengths
> are up to MAX_ADDR_LEN, this is confusing.
>
> Make it void like ->ndo_set_mac_address() and let callers check
> its length before calling it. It is too late to fix dev_ifsioc()
> due to API compatibility, so just reject those larger than
> sizeof(struct sockaddr).
>
> Fortunately, only a few IPv6 tunnel devices have addr_len
> larger than sizeof(struct sockaddr) and they don't support
> ndo_set_mac_addr(). But team driver seems still buggy without
> this patch.

Note, in team lb mode, I can successfully enslave ip6gre device
to a team device and make its mac addr look like:

# ip li show dev team0
17: team0:  mtu 1448 qdisc noqueue
state UP mode DEFAULT group default qlen 1000
link/gre6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd
00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

But ifconfig seems not recognize gre6 family, so it is just a matter of
a few lines of C code to trigger the bug.


[GIT] Networking

2017-07-20 Thread David Miller

1) BPF verifier signed/unsigned value tracking fix, from Daniel
   Borkmann, Edward Cree, and Josef Bacik.

2) Fix memory allocation length when setting up calls to
   ->ndo_set_mac_address, from Cong Wang.

3) Add a new cxgb4 device ID, from Ganesh Goudar.

4) Fix FIB refcount handling, we have to set it's initial value
   before the configure callback (which can bump it).  From David
   Ahern.

5) Fix double-free in qcom/emac driver, from Timur Tabi.

6) A bunch of gcc-7 string format overflow warning fixes from Arnd
   Bergmann.

7) Fix link level headroom tests in ip_do_fragment(), from Vasily
   Averin.

8) Fix chunk walking in SCTP when iterating over error and parameter
   headers.  From Alexander Potapenko.

9) TCP BBR congestion control fixes from Neal Cardwell.

10) Fix SKB fragment handling in bcmgenet driver, from Doug Berger.

11) BPF_CGROUP_RUN_PROG_SOCK_OPS needs to check for null __sk, from
Cong Wang.

12) xmit_recursion in ppp driver needs to be per-device not per-cpu,
from Gao Feng.

13) Cannot release skb->dst in UDP if IP options processing needs it.
From Paolo Abeni.

14) Some netdev ioctl ifr_name[] NULL termination fixes.  From
Alexander Levin and myself.

15) Revert some rtnetlink notification changes that are causing
regressions, from David Ahern.

Please pull, thanks a lot!

The following changes since commit edaf3825182958a1fd5e39708fcb6ea48eca2060:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2017-07-12 
19:30:57 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 

for you to fetch changes up to cbf5ecb305601d063dc94a57680dfbc3f96c188d:

  net: bonding: Fix transmit load balancing in balance-alb mode (2017-07-20 
15:34:40 -0700)


Abhishek Shah (3):
  net: ethernet: bgmac: Remove unnecessary 'return' from 
platform_bgmac_idm_write
  net: ethernet: bgmac: Make IDM register space optional
  Documentation: devicetree: net: optional idm regs for bgmac

Alexander Potapenko (2):
  sctp: don't dereference ptr before leaving _sctp_walk_{params, errors}()
  ipv4: ipv6: initialize treq->txhash in cookie_v[46]_check()

Arnd Bergmann (6):
  isdn: divert: fix sprintf buffer overflow warning
  net: niu: fix format string overflow warning:
  bnx2x: fix format overflow warning
  net: thunder_bgx: avoid format string overflow warning
  vmxnet3: avoid format strint overflow warning
  liquidio: fix possible eeprom format string overflow

Arun Parameswaran (1):
  dt-binding: ptp: Add SoC compatibility strings for dte ptp clock

Arvind Yadav (10):
  isdn: hisax: constify pci_device_id.
  isdn: hisax: hfc4s8s_l1: constify pci_device_id.
  isdn: hisax: hisax_fcpcipnp: constify pci_device_id.
  isdn: eicon: constify pci_device_id.
  isdn: mISDN: netjet: constify pci_device_id.
  isdn: mISDN: hfcmulti: constify pci_device_id.
  isdn: mISDN: w6692: constify pci_device_id.
  isdn: mISDN: avmfritz: constify pci_device_id.
  isdn: mISDN: hfcpci: constify pci_device_id.
  isdn: avm: c4: constify pci_device_id.

Christophe Jaillet (1):
  atm: zatm: Fix an error handling path in 'zatm_init_one()'

Colin Ian King (5):
  net: broadcom: bnx2x: make a couple of const arrays static
  net: stmmac: make const array route_possibilities static
  rt2x00: make const array glrt_table static
  dccp: make const array error_code static
  net: tehuti: don't process data if it has not been copied from userspace

Dan Carpenter (1):
  netfilter: fix netfilter_net_init() return

Daniel Borkmann (4):
  bpf: fix mixed signed/unsigned derived min/max value bounds
  bpf: allow to specify log level and reduce it for test_verifier
  bpf: fix up test cases with mixed signed/unsigned bounds
  bpf: more tests for mixed signed and unsigned bounds checks

David Ahern (2):
  net: set fib rule refcount after malloc
  Revert "rtnetlink: Do not generate notifications for CHANGEADDR event"

David S. Miller (6):
  Merge branch 'bgmac-stingray-soc'
  Merge branch 'isdn-const-pci_device_ids'
  Merge branch 'bcmgenet-Fragmented-SKB-corrections'
  Merge git://git.kernel.org/.../pablo/nf
  net: Zero terminate ifr_name in dev_ifname().
  Merge branch 'BPF-map-value-adjust-fix'

Doug Berger (2):
  net: bcmgenet: Fix unmapping of fragments in bcmgenet_xmit()
  net: bcmgenet: Free skb after last Tx frag

Edward Cree (1):
  bpf: add test for mixed signed and unsigned bounds checks

Enrico Mioso (1):
  cdc_ncm: Set NTB format again after altsetting switch for Huawei devices

Eugeniy Paltsev (1):
  NET: dwmac: Make dwmac reset unconditional

Florian Fainelli (2):
  dt-bindings: net: Remove duplicate NSP Ethernet MAC binding document
  net: dsa: b53: Add missing ARL entries for BCM53125

Florian Westphal 

[Patch net] team: use a larger struct for mac address

2017-07-20 Thread Cong Wang
IPv6 tunnels use sizeof(struct in6_addr) as dev->addr_len,
but in many places especially bonding, we use struct sockaddr
to copy and set mac addr, this could lead to stack out-of-bounds
access.

Fix it by using a larger address storage like bonding.

Reported-by: Andrey Konovalov 
Cc: Jiri Pirko 
Signed-off-by: Cong Wang 
---
 drivers/net/team/team.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 464570409796..3c1cdd57db58 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -60,10 +60,10 @@ static struct team_port *team_port_get_rtnl(const struct 
net_device *dev)
 static int __set_port_dev_addr(struct net_device *port_dev,
   const unsigned char *dev_addr)
 {
-   struct sockaddr addr;
+   struct sockaddr_storage addr;
 
-   memcpy(addr.sa_data, dev_addr, port_dev->addr_len);
-   addr.sa_family = port_dev->type;
+   memcpy(addr.__data, dev_addr, port_dev->addr_len);
+   addr.ss_family = port_dev->type;
return dev_set_mac_address(port_dev, );
 }
 
-- 
2.13.0



Re: [PATCH] PCI: Update ACS quirk for more Intel 10G NICs

2017-07-20 Thread Roland Dreier
On Thu, Jul 20, 2017 at 3:15 PM, Alex Williamson
 wrote:

> Most of the ACS capabilities are worded as "Must be implemented by
> devices that implement ..."  Shouldn't a hard-wired ACS capability
> sufficiently describe that, or is there something wrong with how
> they're hard wired?

Interesting question.  I just looked at what the PCI spec says about
the various bits for ACS functions in multi-function devices.  Many of
the functions are "must not be implemented."  Of the ones that are
"must be implemented if..." the key is that the if is for devices that
support peer-to-peer traffic.

I think the Intel NICs are compliant with the spec - they don't
support any ACS mechanisms for controlling peer-to-peer traffic, but
they also don't implement peer-to-peer traffic.  This means that the
PCI standard way of knowing that it is safe to assign individual
functions does not prove it is safe - but with device-specific
knowledge we do know it is safe.  Hence a quirk to give that
device-specific information to the kernel.

 - R.


RE: [PATCH] PCI: Update ACS quirk for more Intel 10G NICs

2017-07-20 Thread Tantilov, Emil S
>-Original Message-
>From: Roland Dreier [mailto:rol...@purestorage.com] On Behalf Of Roland
>Dreier
>Sent: Thursday, July 20, 2017 2:41 PM
>To: Bjorn Helgaas 
>Cc: linux-...@vger.kernel.org; netdev@vger.kernel.org; Tantilov, Emil S
>
>Subject: [PATCH] PCI: Update ACS quirk for more Intel 10G NICs
>
>From: Roland Dreier 
>
>Add one more variant of the 82599 plus the device IDs for X540 and X550
>variants.  Intel has confirmed that none of these devices does peer-to-peer
>between functions.  The X540 and X550 have added ACS capabilities in their
>PCI config space, but the ACS control register is hard-wired to 0 for both
>devices, so we still need the quirk for IOMMU grouping to allow assignment
>of individual SR-IOV functions.
>
>Signed-off-by: Roland Dreier 
>---
> drivers/pci/quirks.c | 21 +
> 1 file changed, 21 insertions(+)

Acked-by: Emil Tantilov 

Thanks,
Emil 



[git][98ed5bb] rvbd/rbt-kernel : banks_990_banks_trpy6_prod_feature_branch

2017-07-20 Thread steven.la

@new_changed_in [{"codename": "banks", "train": "banks_trpy6_prod", 
"build_number": 9, "branch": "banks_990_banks_trpy6_prod_feature_branch"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: banks_990_banks_trpy6_prod_feature_branch
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][a48a019] rvbd/rbt-kernel : banks_990_banks_trpy6_prod_feature_branch

2017-07-20 Thread arthur.kepner

@new_changed_in [{"codename": "banks", "train": "banks_trpy6_prod", 
"build_number": 9, "branch": "banks_990_banks_trpy6_prod_feature_branch"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: banks_990_banks_trpy6_prod_feature_branch
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


Re: [PATCH] net: ethernet: ti: cpsw: Push the request_irq function to the end of probe

2017-07-20 Thread Grygorii Strashko


On 07/20/2017 05:28 PM, David Miller wrote:
> From: Grygorii Strashko 
> Date: Thu, 20 Jul 2017 11:08:09 -0500
> 
>> In general patch looks good to me, but it's really unexpected to
>> receive IRQs while CPSW is probing ;(
> 
> This is a poor expectation.
> 
> Boot loaders and other entities can leave the device in any state
> whatsoever.
> 
> Furthermore, enabling an IRQ whose handler cannot properly execute
> without crashing is wrong fundamentally.  All data structures and
> state must be set up properly before the IRQ is requested.
> 
> Therefore this patch is correct and I will apply it.
> 

Thanks. Agree (it just has never triggered before, so I meant - unexpected
 from current driver code point of view ;().
And I'm just worry that it might not be enough :(, especially for am335x.

-- 
regards,
-grygorii


Re: [PATCH] net: bonding: Fix transmit load balancing in balance-alb mode

2017-07-20 Thread David Miller
From: Kosuke Tatsukawa 
Date: Thu, 20 Jul 2017 05:20:40 +

> balance-alb mode used to have transmit dynamic load balancing feature
> enabled by default.  However, transmit dynamic load balancing no longer
> works in balance-alb after commit 8b426dc54cf4 ("bonding: remove
> hardcoded value").
> 
> Both balance-tlb and balance-alb use the function bond_do_alb_xmit() to
> send packets.  This function uses the parameter tlb_dynamic_lb.
> tlb_dynamic_lb used to have the default value of 1 for balance-alb, but
> now the value is set to 0 except in balance-tlb.
> 
> Re-enable transmit dyanmic load balancing by initializing tlb_dynamic_lb
> for balance-alb similar to balance-tlb.
> 
> Signed-off-by: Kosuke Tatsukawa 

Applied and queued up for -stable, thanks.

Andy, thanks for the Fixes: tag.


Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread David Miller
From: Håkon Bugge 
Date: Thu, 20 Jul 2017 12:28:55 +0200

> cp->cp_send_gen is treated as a normal variable, although it may be
> used by different threads.
> 
> This is fixed by using {READ,WRITE}_ONCE when it is incremented and
> READ_ONCE when it is read outside the {acquire,release}_in_xmit
> protection.
> 
> Normative reference from the Linux-Kernel Memory Model:
> 
> Loads from and stores to shared (but non-atomic) variables should
> be protected with the READ_ONCE(), WRITE_ONCE(), and
> ACCESS_ONCE().
> 
> Clause 5.1.2.4/25 in the C standard is also relevant.
> 
> Signed-off-by: Håkon Bugge 
> Reviewed-by: Knut Omang 

Applied, thanks.


[git][a48a019] rvbd/rbt-kernel : master

2017-07-20 Thread arthur.kepner

@new_changed_in [{"codename": "banks", "train": "vsfed_merge_sh_mainline", 
"build_number": 2, "branch": "master"}, {"codename": "aether", "train": 
"mainline", "build_number": 146, "branch": "master"}, {"codename": "lassen", 
"train": "mainline", "build_number": 110, "branch": "master"}, {"codename": 
"milos", "train": "mainline", "build_number": 40, "branch": "master"}, 
{"codename": "banks", "train": "mainline", "build_number": 133, "branch": 
"master"}, {"codename": "phantom", "train": "mainline", "build_number": 67, 
"branch": "master"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: master
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


Re: [git][98ed5bb] rvbd/rbt-kernel : devon_dps_dataplane

2017-07-20 Thread David Miller

You guys have to seriously fix your internal git scripts.

Please stop spamming the mailing list with your internal
commits.

Thanks.



[git][a48a019] rvbd/rbt-kernel : axel_960_VSH_VCX_XX55_feature_branch

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: axel_960_VSH_VCX_XX55_feature_branch
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


Re: [PATCH net-next] cxgb4: display serial config and vpd versions

2017-07-20 Thread David Miller
From: Ganesh Goudar 
Date: Thu, 20 Jul 2017 18:28:48 +0530

> print the versions of vpd and serial configuration file,
> flashed to adapter, and cleanup the relevant code.
> 
> Signed-off-by: Casey Leedom 
> Signed-off-by: Ganesh Goudar 

Applied, thanks.


[git][98ed5bb] rvbd/rbt-kernel : devon_dps_dataplane

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_dps_dataplane
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Re: [PATCH] net: ethernet: ti: cpsw: Push the request_irq function to the end of probe

2017-07-20 Thread David Miller
From: Grygorii Strashko 
Date: Thu, 20 Jul 2017 11:08:09 -0500

> In general patch looks good to me, but it's really unexpected to
> receive IRQs while CPSW is probing ;(

This is a poor expectation.

Boot loaders and other entities can leave the device in any state
whatsoever.

Furthermore, enabling an IRQ whose handler cannot properly execute
without crashing is wrong fundamentally.  All data structures and
state must be set up properly before the IRQ is requested.

Therefore this patch is correct and I will apply it.


[git][a48a019] rvbd/rbt-kernel : sabre_branch

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: sabre_branch
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : axel_trpy_ipv6_dev

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: axel_trpy_ipv6_dev
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : devon_deterministic_ps

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_deterministic_ps
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : devon_dps_dataplane

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_dps_dataplane
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : devon_netint_integration

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_netint_integration
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : sabre_600_ipv6_ic_feature_branch

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: sabre_600_ipv6_ic_feature_branch
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : devon_netflow_ps

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_netflow_ps
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : banks_trpy6

2017-07-20 Thread arthur.kepner

@new_changed_in [{"codename": "phantom", "train": "trpy6_ic", "build_number": 
19, "branch": "banks_trpy6"}, {"codename": "banks", "train": "trpy6", 
"build_number": 22, "branch": "banks_trpy6"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: banks_trpy6
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : prod_trpy6_conclusion

2017-07-20 Thread arthur.kepner

@new_changed_in [{"codename": "phantom", "train": "ic_prod_trpy6_conclusion", 
"build_number": 5, "branch": "prod_trpy6_conclusion"}, {"codename": "banks", 
"train": "prod_trpy6_conclusion", "build_number": 12, "branch": 
"prod_trpy6_conclusion"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: prod_trpy6_conclusion
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : baker_950_264_tetra_dev_branch

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: baker_950_264_tetra_dev_branch
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][a48a019] rvbd/rbt-kernel : banks_970_bug_fix_dev_branch

2017-07-20 Thread arthur.kepner

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: banks_970_bug_fix_dev_branch
Author: Arthur Kepner 
Date: 2017-07-20T15:22:12-07:00
New Revision: a48a019e7afe2db8e74fda96507b82bafcfebe99


Log:
Merge branch 'bnx2-fix' into 'master'

Apply the following patches from upstream and port extra skbuff

operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:

See merge request !35

Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/a48a019e7afe2db8e74fda96507b82bafcfebe99


[git][98ed5bb] rvbd/rbt-kernel : prod_trpy6_conclusion

2017-07-20 Thread steven.la

@new_changed_in [{"codename": "phantom", "train": "ic_prod_trpy6_conclusion", 
"build_number": 5, "branch": "prod_trpy6_conclusion"}, {"codename": "banks", 
"train": "prod_trpy6_conclusion", "build_number": 12, "branch": 
"prod_trpy6_conclusion"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: prod_trpy6_conclusion
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : baker_950_264_tetra_dev_branch

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: baker_950_264_tetra_dev_branch
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : banks_trpy6

2017-07-20 Thread steven.la

@new_changed_in [{"codename": "phantom", "train": "trpy6_ic", "build_number": 
19, "branch": "banks_trpy6"}, {"codename": "banks", "train": "trpy6", 
"build_number": 22, "branch": "banks_trpy6"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: banks_trpy6
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : banks_970_bug_fix_dev_branch

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: banks_970_bug_fix_dev_branch
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Re: [PATCH 1/3] ipv4: initialize fib_trie prior to register_netdev_notifier call.

2017-07-20 Thread David Miller
From: Mahesh Bandewar 
Date: Wed, 19 Jul 2017 15:41:33 -0700

> From: Mahesh Bandewar 
> 
> Net stack initialization currently initializes fib-trie after the
> first call to netdevice_notifier() call. In fact fib_trie initialization
> needs to happen before first rtnl_register(). It does not cause any problem
> since there are no devices UP at this moment, but trying to bring 'lo'
> UP at initialization would make this assumption wrong and exposes the issue.
> 
> Fixes following crash
> 
>  Call Trace:
>   ? alternate_node_alloc+0x76/0xa0
>   fib_table_insert+0x1b7/0x4b0
>   fib_magic.isra.17+0xea/0x120
>   fib_add_ifaddr+0x7b/0x190
>   fib_netdev_event+0xc0/0x130
>   register_netdevice_notifier+0x1c1/0x1d0
>   ip_fib_init+0x72/0x85
>   ip_rt_init+0x187/0x1e9
>   ip_init+0xe/0x1a
>   inet_init+0x171/0x26c
>   ? ipv4_offload_init+0x66/0x66
>   do_one_initcall+0x43/0x160
>   kernel_init_freeable+0x191/0x219
>   ? rest_init+0x80/0x80
>   kernel_init+0xe/0x150
>   ret_from_fork+0x22/0x30
>  Code: f6 46 23 04 74 86 4c 89 f7 e8 ae 45 01 00 49 89 c7 4d 85 ff 0f 85 7b 
> ff ff ff 31 db eb 08 4c 89 ff e8 16 47 01 00 48 8b 44 24 38 <45> 8b 6e 14 4d 
> 63 76 74 48 89 04 24 0f 1f 44 00 00 48 83 c4 08
>  RIP: kmem_cache_alloc+0xcf/0x1c0 RSP: 9b1500017c28
>  CR2: 0014
> 
> Fixes: 7b1a74fdbb9e ("[NETNS]: Refactor fib initialization so it can handle 
> multiple namespaces.")
> Fixes: 7f9b80529b8a ("[IPV4]: fib hash|trie initialization")
> 
> Signed-off-by: Mahesh Bandewar 

Applied and queued up for -stable, thanks.


[git][98ed5bb] rvbd/rbt-kernel : axel_960_VSH_VCX_XX55_feature_branch

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: axel_960_VSH_VCX_XX55_feature_branch
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : axel_trpy_ipv6_dev

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: axel_trpy_ipv6_dev
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : sabre_600_ipv6_ic_feature_branch

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: sabre_600_ipv6_ic_feature_branch
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : devon_netint_integration

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_netint_integration
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Re: [PATCH 1/3] ipv4: initialize fib_trie prior to register_netdev_notifier call.

2017-07-20 Thread David Miller
From: Mahesh Bandewar (महेश बंडेवार) 
Date: Thu, 20 Jul 2017 10:20:06 -0700

> On Wed, Jul 19, 2017 at 10:51 PM, David Miller  wrote:
>>
>> Where are patches #2 and #3?
> Oops, my bad! I wanted to detach this from the series and send it
> independently but forgot to update the header in process. Do you want
> me to send it again with just the header change [PATCH 1/3] to [PATCH
> next]?

No, that's not necessary.


[git][98ed5bb] rvbd/rbt-kernel : sabre_branch

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: sabre_branch
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : devon_netflow_ps

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_netflow_ps
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


[git][98ed5bb] rvbd/rbt-kernel : devon_deterministic_ps

2017-07-20 Thread steven.la

@new_changed_in []


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: devon_deterministic_ps
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Re: [Patch net] rtnetlink: allocate more memory for dev_set_mac_address()

2017-07-20 Thread David Miller
From: Cong Wang 
Date: Thu, 20 Jul 2017 11:27:57 -0700

> virtnet_set_mac_address() interprets mac address as struct
> sockaddr, but upper layer only allocates dev->addr_len
> which is ETH_ALEN + sizeof(sa_family_t) in this case.
> 
> We lack a unified definition for mac address, so just fix
> the upper layer, this also allows drivers to interpret it
> to struct sockaddr freely.
> 
> Reported-by: David Ahern 
> Signed-off-by: Cong Wang 

Applied and queued up for -stable, thanks Cong.


Re: [PATCH net] net: dsa: b53: Add missing ARL entries for BCM53125

2017-07-20 Thread David Miller
From: Florian Fainelli 
Date: Thu, 20 Jul 2017 12:25:22 -0700

> The BCM53125 entry was missing an arl_entries member which would
> basically prevent the ARL search from terminating properly. This switch
> has 4 ARL entries, so add that.
> 
> Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
> Signed-off-by: Florian Fainelli 

Applied and queued up for -stable, thanks.


[git][98ed5bb] rvbd/rbt-kernel : master

2017-07-20 Thread steven.la

@new_changed_in [{"codename": "banks", "train": "vsfed_merge_sh_mainline", 
"build_number": 2, "branch": "master"}, {"codename": "aether", "train": 
"mainline", "build_number": 146, "branch": "master"}, {"codename": "lassen", 
"train": "mainline", "build_number": 110, "branch": "master"}, {"codename": 
"milos", "train": "mainline", "build_number": 40, "branch": "master"}, 
{"codename": "banks", "train": "mainline", "build_number": 133, "branch": 
"master"}, {"codename": "phantom", "train": "mainline", "build_number": 67, 
"branch": "master"}]


Repository: g...@gitlab.lab.nbttech.com:rvbd/rbt-kernel.git
Branch: master
Author: Steven La 
Date: 2017-07-18T16:34:31-07:00
New Revision: 98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Log:
Apply the following patches from upstream and port extra skbuff
operating routines used the these patches.

commit b7b6a688d217936459ff5cf1087b2361db952509
Author: Ian Campbell 
Date:   Wed Aug 24 22:28:12 2011 +

bnx2: convert to SKB paged frag API.

Signed-off-by: Ian Campbell 
Reviewed-by: Konrad Rzeszutek Wilk 
Cc: Michael Chan 
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller 

commit a1f4e8bcbccf50cf1894c263af4d677d4f566533
Author: Eric Dumazet 
Date:   Thu Oct 13 07:50:19 2011 +

bnx2: fix skb truesize underestimation

bnx2 allocates a full page per fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

commit 9e903e085262ffbf1fc44a17ac06058aca03524a
Author: Eric Dumazet 
Date:   Tue Oct 18 21:00:24 2011 +

net: add skb frag size accessors

To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.

Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.

Signed-off-by: Eric Dumazet 
Signed-off-by: David S. Miller 

Root Issue Details:
For bug285465, there are some issues for handling paged data.

Fix Summary Details:
Apply the above three patches taken from upstream's code. Since RiOS is
Redhat 6.1 release base, these patches need additionally skbuff helper
routines, porting those as well.

Testing:
Run stress test on the interface that uses this driver.

Fix Complete: # Yes
Risk of Fix: # Low

BugID: 285465
DesignID:
ReviewID:
CC:
Reviewed-By: akepner
Approved-By:


Open this commit in your browser:
https://gitlab.lab.nbttech.com/rvbd/rbt-kernel/commit/98ed5bbc446dca588ab8a1a6edbfc870dc9d6933


Re: [PATCH net 0/5] BPF map value adjust fix

2017-07-20 Thread David Miller
From: Daniel Borkmann 
Date: Fri, 21 Jul 2017 00:00:20 +0200

> First patch in the series is the actual fix and the remaining
> patches are just updates to selftests.

Series applied, thanks.


Re: [PATCH net 1/5] bpf: fix mixed signed/unsigned derived min/max value bounds

2017-07-20 Thread Alexei Starovoitov

On 7/20/17 3:00 PM, Daniel Borkmann wrote:

Edward reported that there's an issue in min/max value bounds
tracking when signed and unsigned compares both provide hints
on limits when having unknown variables. E.g. a program such
as the following should have been rejected:


Thanks a lot for the hard work you folks have put into this set.

Acked-by: Alexei Starovoitov 



Re: [PATCH] PCI: Update ACS quirk for more Intel 10G NICs

2017-07-20 Thread Alex Williamson
On Thu, 20 Jul 2017 14:41:01 -0700
Roland Dreier  wrote:

> From: Roland Dreier 
> 
> Add one more variant of the 82599 plus the device IDs for X540 and X550
> variants.  Intel has confirmed that none of these devices does peer-to-peer
> between functions.  The X540 and X550 have added ACS capabilities in their
> PCI config space, but the ACS control register is hard-wired to 0 for both
> devices, so we still need the quirk for IOMMU grouping to allow assignment
> of individual SR-IOV functions.

Most of the ACS capabilities are worded as "Must be implemented by
devices that implement ..."  Shouldn't a hard-wired ACS capability
sufficiently describe that, or is there something wrong with how
they're hard wired?  Thanks,

Alex

> 
> Signed-off-by: Roland Dreier 
> ---
>  drivers/pci/quirks.c | 21 +
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 6967c6b4cf6b..b939db671326 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -4335,12 +4335,33 @@ static const struct pci_dev_acs_enabled {
>   { PCI_VENDOR_ID_INTEL, 0x1507, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x1514, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x151C, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x1528, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x1529, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x154A, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x152A, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x154D, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x154F, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x1551, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x1558, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x1560, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x1563, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15AA, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15AB, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15AC, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15AD, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15AE, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15B0, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15AB, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15C2, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15C3, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15C4, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15C6, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15C7, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15C8, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15CE, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15E4, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15E5, pci_quirk_mf_endpoint_acs },
> + { PCI_VENDOR_ID_INTEL, 0x15D1, pci_quirk_mf_endpoint_acs },
>   /* 82580 */
>   { PCI_VENDOR_ID_INTEL, 0x1509, pci_quirk_mf_endpoint_acs },
>   { PCI_VENDOR_ID_INTEL, 0x150E, pci_quirk_mf_endpoint_acs },



[PATCH net 1/5] bpf: fix mixed signed/unsigned derived min/max value bounds

2017-07-20 Thread Daniel Borkmann
Edward reported that there's an issue in min/max value bounds
tracking when signed and unsigned compares both provide hints
on limits when having unknown variables. E.g. a program such
as the following should have been rejected:

   0: (7a) *(u64 *)(r10 -8) = 0
   1: (bf) r2 = r10
   2: (07) r2 += -8
   3: (18) r1 = 0x8a94cda93400
   5: (85) call bpf_map_lookup_elem#1
   6: (15) if r0 == 0x0 goto pc+7
  R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R10=fp
   7: (7a) *(u64 *)(r10 -16) = -8
   8: (79) r1 = *(u64 *)(r10 -16)
   9: (b7) r2 = -1
  10: (2d) if r1 > r2 goto pc+3
  R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R1=inv,min_value=0
  R2=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
  11: (65) if r1 s> 0x1 goto pc+2
  R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 
R1=inv,min_value=0,max_value=1
  R2=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
  12: (0f) r0 += r1
  13: (72) *(u8 *)(r0 +0) = 0
  R0=map_value_adj(ks=8,vs=8,id=0),min_value=0,max_value=1 
R1=inv,min_value=0,max_value=1
  R2=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
  14: (b7) r0 = 0
  15: (95) exit

What happens is that in the first part ...

   8: (79) r1 = *(u64 *)(r10 -16)
   9: (b7) r2 = -1
  10: (2d) if r1 > r2 goto pc+3

... r1 carries an unsigned value, and is compared as unsigned
against a register carrying an immediate. Verifier deduces in
reg_set_min_max() that since the compare is unsigned and operation
is greater than (>), that in the fall-through/false case, r1's
minimum bound must be 0 and maximum bound must be r2. Latter is
larger than the bound and thus max value is reset back to being
'invalid' aka BPF_REGISTER_MAX_RANGE. Thus, r1 state is now
'R1=inv,min_value=0'. The subsequent test ...

  11: (65) if r1 s> 0x1 goto pc+2

... is a signed compare of r1 with immediate value 1. Here,
verifier deduces in reg_set_min_max() that since the compare
is signed this time and operation is greater than (>), that
in the fall-through/false case, we can deduce that r1's maximum
bound must be 1, meaning with prior test, we result in r1 having
the following state: R1=inv,min_value=0,max_value=1. Given that
the actual value this holds is -8, the bounds are wrongly deduced.
When this is being added to r0 which holds the map_value(_adj)
type, then subsequent store access in above case will go through
check_mem_access() which invokes check_map_access_adj(), that
will then probe whether the map memory is in bounds based
on the min_value and max_value as well as access size since
the actual unknown value is min_value <= x <= max_value; commit
fce366a9dd0d ("bpf, verifier: fix alu ops against map_value{,
_adj} register types") provides some more explanation on the
semantics.

It's worth to note in this context that in the current code,
min_value and max_value tracking are used for two things, i)
dynamic map value access via check_map_access_adj() and since
commit 06c1c049721a ("bpf: allow helpers access to variable memory")
ii) also enforced at check_helper_mem_access() when passing a
memory address (pointer to packet, map value, stack) and length
pair to a helper and the length in this case is an unknown value
defining an access range through min_value/max_value in that
case. The min_value/max_value tracking is /not/ used in the
direct packet access case to track ranges. However, the issue
also affects case ii), for example, the following crafted program
based on the same principle must be rejected as well:

   0: (b7) r2 = 0
   1: (bf) r3 = r10
   2: (07) r3 += -512
   3: (7a) *(u64 *)(r10 -16) = -8
   4: (79) r4 = *(u64 *)(r10 -16)
   5: (b7) r6 = -1
   6: (2d) if r4 > r6 goto pc+5
  R1=ctx R2=imm0,min_value=0,max_value=0,min_align=2147483648 R3=fp-512
  R4=inv,min_value=0 R6=imm-1,max_value=18446744073709551615,min_align=1 R10=fp
   7: (65) if r4 s> 0x1 goto pc+4
  R1=ctx R2=imm0,min_value=0,max_value=0,min_align=2147483648 R3=fp-512
  R4=inv,min_value=0,max_value=1 
R6=imm-1,max_value=18446744073709551615,min_align=1
  R10=fp
   8: (07) r4 += 1
   9: (b7) r5 = 0
  10: (6a) *(u16 *)(r10 -512) = 0
  11: (85) call bpf_skb_load_bytes#26
  12: (b7) r0 = 0
  13: (95) exit

Meaning, while we initialize the max_value stack slot that the
verifier thinks we access in the [1,2] range, in reality we
pass -7 as length which is interpreted as u32 in the helper.
Thus, this issue is relevant also for the case of helper ranges.
Resetting both bounds in check_reg_overflow() in case only one
of them exceeds limits is also not enough as similar test can be
created that uses values which are within range, thus also here
learned min value in r1 is incorrect when mixed with later signed
test to create a range:

   0: (7a) *(u64 *)(r10 -8) = 0
   1: (bf) r2 = r10
   2: (07) r2 += -8
   3: (18) r1 = 0x880ad081fa00
   5: (85) call bpf_map_lookup_elem#1
   6: (15) if r0 == 0x0 goto pc+7
  R0=map_value(ks=8,vs=8,id=0),min_value=0,max_value=0 R10=fp
   7: (7a) *(u64 *)(r10 -16) = -8
   8: (79) r1 = *(u64 

[PATCH net 0/5] BPF map value adjust fix

2017-07-20 Thread Daniel Borkmann
First patch in the series is the actual fix and the remaining
patches are just updates to selftests.

Thanks!

Daniel Borkmann (4):
  bpf: fix mixed signed/unsigned derived min/max value bounds
  bpf: allow to specify log level and reduce it for test_verifier
  bpf: fix up test cases with mixed signed/unsigned bounds
  bpf: more tests for mixed signed and unsigned bounds checks

Edward Cree (1):
  bpf: add test for mixed signed and unsigned bounds checks

 include/linux/bpf_verifier.h|   1 +
 kernel/bpf/verifier.c   | 108 ++-
 tools/lib/bpf/bpf.c |   4 +-
 tools/lib/bpf/bpf.h |   2 +-
 tools/testing/selftests/bpf/test_align.c|   2 +-
 tools/testing/selftests/bpf/test_verifier.c | 480 +++-
 6 files changed, 574 insertions(+), 23 deletions(-)

-- 
1.9.3



[PATCH net 3/5] bpf: fix up test cases with mixed signed/unsigned bounds

2017-07-20 Thread Daniel Borkmann
Fix the few existing test cases that used mixed signed/unsigned
bounds and switch them only to one flavor. Reason why we need this
is that proper boundaries cannot be derived from mixed tests.

Signed-off-by: Daniel Borkmann 
Acked-by: Alexei Starovoitov 
---
 tools/testing/selftests/bpf/test_verifier.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_verifier.c 
b/tools/testing/selftests/bpf/test_verifier.c
index f4d0a1d..64b39d3 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -4969,7 +4969,7 @@ struct test_val {
BPF_JMP_IMM(BPF_JSGT, BPF_REG_2,
sizeof(struct test_val), 4),
BPF_MOV64_IMM(BPF_REG_4, 0),
-   BPF_JMP_REG(BPF_JGE, BPF_REG_4, BPF_REG_2, 2),
+   BPF_JMP_REG(BPF_JSGE, BPF_REG_4, BPF_REG_2, 2),
BPF_MOV64_IMM(BPF_REG_3, 0),
BPF_EMIT_CALL(BPF_FUNC_probe_read),
BPF_MOV64_IMM(BPF_REG_0, 0),
@@ -4995,7 +4995,7 @@ struct test_val {
BPF_JMP_IMM(BPF_JSGT, BPF_REG_2,
sizeof(struct test_val) + 1, 4),
BPF_MOV64_IMM(BPF_REG_4, 0),
-   BPF_JMP_REG(BPF_JGE, BPF_REG_4, BPF_REG_2, 2),
+   BPF_JMP_REG(BPF_JSGE, BPF_REG_4, BPF_REG_2, 2),
BPF_MOV64_IMM(BPF_REG_3, 0),
BPF_EMIT_CALL(BPF_FUNC_probe_read),
BPF_MOV64_IMM(BPF_REG_0, 0),
@@ -5023,7 +5023,7 @@ struct test_val {
BPF_JMP_IMM(BPF_JSGT, BPF_REG_2,
sizeof(struct test_val) - 20, 4),
BPF_MOV64_IMM(BPF_REG_4, 0),
-   BPF_JMP_REG(BPF_JGE, BPF_REG_4, BPF_REG_2, 2),
+   BPF_JMP_REG(BPF_JSGE, BPF_REG_4, BPF_REG_2, 2),
BPF_MOV64_IMM(BPF_REG_3, 0),
BPF_EMIT_CALL(BPF_FUNC_probe_read),
BPF_MOV64_IMM(BPF_REG_0, 0),
@@ -5050,7 +5050,7 @@ struct test_val {
BPF_JMP_IMM(BPF_JSGT, BPF_REG_2,
sizeof(struct test_val) - 19, 4),
BPF_MOV64_IMM(BPF_REG_4, 0),
-   BPF_JMP_REG(BPF_JGE, BPF_REG_4, BPF_REG_2, 2),
+   BPF_JMP_REG(BPF_JSGE, BPF_REG_4, BPF_REG_2, 2),
BPF_MOV64_IMM(BPF_REG_3, 0),
BPF_EMIT_CALL(BPF_FUNC_probe_read),
BPF_MOV64_IMM(BPF_REG_0, 0),
-- 
1.9.3



[PATCH net 4/5] bpf: add test for mixed signed and unsigned bounds checks

2017-07-20 Thread Daniel Borkmann
From: Edward Cree 

These failed due to a bug in verifier bounds handling.

Signed-off-by: Edward Cree 
Acked-by: Daniel Borkmann 
Acked-by: Alexei Starovoitov 
---
 tools/testing/selftests/bpf/test_verifier.c | 52 +
 1 file changed, 52 insertions(+)

diff --git a/tools/testing/selftests/bpf/test_verifier.c 
b/tools/testing/selftests/bpf/test_verifier.c
index 64b39d3..48b7997 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -5510,6 +5510,58 @@ struct test_val {
.errstr = "invalid bpf_context access",
.prog_type = BPF_PROG_TYPE_LWT_IN,
},
+   {
+   "bounds checks mixing signed and unsigned, positive bounds",
+   .insns = {
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
+   BPF_LD_MAP_FD(BPF_REG_1, 0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 7),
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -16, -8),
+   BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_10, -16),
+   BPF_MOV64_IMM(BPF_REG_2, 2),
+   BPF_JMP_REG(BPF_JGE, BPF_REG_2, BPF_REG_1, 3),
+   BPF_JMP_IMM(BPF_JSGT, BPF_REG_1, 4, 2),
+   BPF_ALU64_REG(BPF_ADD, BPF_REG_0, BPF_REG_1),
+   BPF_ST_MEM(BPF_B, BPF_REG_0, 0, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .fixup_map1 = { 3 },
+   .errstr_unpriv = "R0 pointer arithmetic prohibited",
+   .errstr = "R0 min value is negative",
+   .result = REJECT,
+   .result_unpriv = REJECT,
+   },
+   {
+   "bounds checks mixing signed and unsigned",
+   .insns = {
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
+   BPF_LD_MAP_FD(BPF_REG_1, 0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 7),
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -16, -8),
+   BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_10, -16),
+   BPF_MOV64_IMM(BPF_REG_2, -1),
+   BPF_JMP_REG(BPF_JGT, BPF_REG_1, BPF_REG_2, 3),
+   BPF_JMP_IMM(BPF_JSGT, BPF_REG_1, 1, 2),
+   BPF_ALU64_REG(BPF_ADD, BPF_REG_0, BPF_REG_1),
+   BPF_ST_MEM(BPF_B, BPF_REG_0, 0, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .fixup_map1 = { 3 },
+   .errstr_unpriv = "R0 pointer arithmetic prohibited",
+   .errstr = "R0 min value is negative",
+   .result = REJECT,
+   .result_unpriv = REJECT,
+   },
 };
 
 static int probe_filter_length(const struct bpf_insn *fp)
-- 
1.9.3



[PATCH net 2/5] bpf: allow to specify log level and reduce it for test_verifier

2017-07-20 Thread Daniel Borkmann
For the test_verifier case, it's quite hard to parse log level 2 to
figure out what's causing an issue when used to log level 1. We do
want to use bpf_verify_program() in order to simulate some of the
tests with strict alignment. So just add an argument to pass the level
and put it to 1 for test_verifier.

Signed-off-by: Daniel Borkmann 
Acked-by: Alexei Starovoitov 
---
 tools/lib/bpf/bpf.c | 4 ++--
 tools/lib/bpf/bpf.h | 2 +-
 tools/testing/selftests/bpf/test_align.c| 2 +-
 tools/testing/selftests/bpf/test_verifier.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 7e0405e..412a7c8 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -120,7 +120,7 @@ int bpf_load_program(enum bpf_prog_type type, const struct 
bpf_insn *insns,
 int bpf_verify_program(enum bpf_prog_type type, const struct bpf_insn *insns,
   size_t insns_cnt, int strict_alignment,
   const char *license, __u32 kern_version,
-  char *log_buf, size_t log_buf_sz)
+  char *log_buf, size_t log_buf_sz, int log_level)
 {
union bpf_attr attr;
 
@@ -131,7 +131,7 @@ int bpf_verify_program(enum bpf_prog_type type, const 
struct bpf_insn *insns,
attr.license = ptr_to_u64(license);
attr.log_buf = ptr_to_u64(log_buf);
attr.log_size = log_buf_sz;
-   attr.log_level = 2;
+   attr.log_level = log_level;
log_buf[0] = 0;
attr.kern_version = kern_version;
attr.prog_flags = strict_alignment ? BPF_F_STRICT_ALIGNMENT : 0;
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index 16de44a..418c86e 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -38,7 +38,7 @@ int bpf_load_program(enum bpf_prog_type type, const struct 
bpf_insn *insns,
 int bpf_verify_program(enum bpf_prog_type type, const struct bpf_insn *insns,
   size_t insns_cnt, int strict_alignment,
   const char *license, __u32 kern_version,
-  char *log_buf, size_t log_buf_sz);
+  char *log_buf, size_t log_buf_sz, int log_level);
 
 int bpf_map_update_elem(int fd, const void *key, const void *value,
__u64 flags);
diff --git a/tools/testing/selftests/bpf/test_align.c 
b/tools/testing/selftests/bpf/test_align.c
index bccebd9..2979369 100644
--- a/tools/testing/selftests/bpf/test_align.c
+++ b/tools/testing/selftests/bpf/test_align.c
@@ -380,7 +380,7 @@ static int do_test_single(struct bpf_align_test *test)
prog_len = probe_filter_length(prog);
fd_prog = bpf_verify_program(prog_type ? : BPF_PROG_TYPE_SOCKET_FILTER,
 prog, prog_len, 1, "GPL", 0,
-bpf_vlog, sizeof(bpf_vlog));
+bpf_vlog, sizeof(bpf_vlog), 2);
if (fd_prog < 0) {
printf("Failed to load program.\n");
printf("%s", bpf_vlog);
diff --git a/tools/testing/selftests/bpf/test_verifier.c 
b/tools/testing/selftests/bpf/test_verifier.c
index 404aec5..f4d0a1d 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -5633,7 +5633,7 @@ static void do_test_single(struct bpf_test *test, bool 
unpriv,
 
fd_prog = bpf_verify_program(prog_type ? : BPF_PROG_TYPE_SOCKET_FILTER,
 prog, prog_len, test->flags & 
F_LOAD_WITH_STRICT_ALIGNMENT,
-"GPL", 0, bpf_vlog, sizeof(bpf_vlog));
+"GPL", 0, bpf_vlog, sizeof(bpf_vlog), 1);
 
expected_ret = unpriv && test->result_unpriv != UNDEF ?
   test->result_unpriv : test->result;
-- 
1.9.3



[PATCH net 5/5] bpf: more tests for mixed signed and unsigned bounds checks

2017-07-20 Thread Daniel Borkmann
Add a couple of more test cases to BPF selftests that are related
to mixed signed and unsigned checks.

Signed-off-by: Daniel Borkmann 
Acked-by: Alexei Starovoitov 
---
 tools/testing/selftests/bpf/test_verifier.c | 418 
 1 file changed, 418 insertions(+)

diff --git a/tools/testing/selftests/bpf/test_verifier.c 
b/tools/testing/selftests/bpf/test_verifier.c
index 48b7997..af7d173 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -5562,6 +5562,424 @@ struct test_val {
.result = REJECT,
.result_unpriv = REJECT,
},
+   {
+   "bounds checks mixing signed and unsigned, variant 2",
+   .insns = {
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
+   BPF_LD_MAP_FD(BPF_REG_1, 0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 9),
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -16, -8),
+   BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_10, -16),
+   BPF_MOV64_IMM(BPF_REG_2, -1),
+   BPF_JMP_REG(BPF_JGT, BPF_REG_1, BPF_REG_2, 5),
+   BPF_MOV64_IMM(BPF_REG_8, 0),
+   BPF_ALU64_REG(BPF_ADD, BPF_REG_8, BPF_REG_1),
+   BPF_JMP_IMM(BPF_JSGT, BPF_REG_8, 1, 2),
+   BPF_ALU64_REG(BPF_ADD, BPF_REG_0, BPF_REG_8),
+   BPF_ST_MEM(BPF_B, BPF_REG_8, 0, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .fixup_map1 = { 3 },
+   .errstr_unpriv = "R0 pointer arithmetic prohibited",
+   .errstr = "R8 invalid mem access 'inv'",
+   .result = REJECT,
+   .result_unpriv = REJECT,
+   },
+   {
+   "bounds checks mixing signed and unsigned, variant 3",
+   .insns = {
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
+   BPF_LD_MAP_FD(BPF_REG_1, 0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 8),
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -16, -8),
+   BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_10, -16),
+   BPF_MOV64_IMM(BPF_REG_2, -1),
+   BPF_JMP_REG(BPF_JGT, BPF_REG_1, BPF_REG_2, 4),
+   BPF_MOV64_REG(BPF_REG_8, BPF_REG_1),
+   BPF_JMP_IMM(BPF_JSGT, BPF_REG_8, 1, 2),
+   BPF_ALU64_REG(BPF_ADD, BPF_REG_0, BPF_REG_8),
+   BPF_ST_MEM(BPF_B, BPF_REG_8, 0, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .fixup_map1 = { 3 },
+   .errstr_unpriv = "R0 pointer arithmetic prohibited",
+   .errstr = "R8 invalid mem access 'inv'",
+   .result = REJECT,
+   .result_unpriv = REJECT,
+   },
+   {
+   "bounds checks mixing signed and unsigned, variant 4",
+   .insns = {
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
+   BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
+   BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
+   BPF_LD_MAP_FD(BPF_REG_1, 0),
+   BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
+BPF_FUNC_map_lookup_elem),
+   BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 7),
+   BPF_ST_MEM(BPF_DW, BPF_REG_10, -16, -8),
+   BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_10, -16),
+   BPF_MOV64_IMM(BPF_REG_2, 1),
+   BPF_ALU64_REG(BPF_AND, BPF_REG_1, BPF_REG_2),
+   BPF_JMP_IMM(BPF_JSGT, BPF_REG_1, 1, 2),
+   BPF_ALU64_REG(BPF_ADD, BPF_REG_0, BPF_REG_1),
+   BPF_ST_MEM(BPF_B, BPF_REG_0, 0, 0),
+   BPF_MOV64_IMM(BPF_REG_0, 0),
+   BPF_EXIT_INSN(),
+   },
+   .fixup_map1 = { 3 },
+   .errstr_unpriv = "R0 pointer arithmetic prohibited",
+   .errstr = "R0 min value is negative",
+   .result = REJECT,
+   .result_unpriv = REJECT,
+   },
+   {
+   "bounds checks mixing 

Re: [PATCH v2 net-next] net: systemport: Support 64bit statistics

2017-07-20 Thread kiki good
Hi Stephen:

Thanks for the suggestion of using per-cpu statistics. In this part of
code, there are two major reasons
not to use per-cpu variable for calculating Tx packets:

1. The update of ring->bytes and ring ->packets are protected with irq
version's spin lock in the current code logic. Although BH
 is disabled and it is safe to use per-cpu variable, i don't see
much more benefit of using it if it is still under irq version's spin
lock protection.

2. This driver requires update each ring's bytes and packets; The
number of rings are decided dynamically. so in order to use per-cpu
 variable, we need to track allocation and free every time when
the sizes of rings change that might have some performance concerns.

For Rx packets, using per-cpu variable is possible.

Thanks
Jmqiao

On Thu, Jul 20, 2017 at 4:44 PM, Stephen Hemminger
 wrote:
> On Wed, 19 Jul 2017 01:18:40 +0100
> "Jianming.qiao"  wrote:
>
>> Signed-off-by: Jianming.qiao 
>
> You may want to consider using per-cpu statistics.
>


Re: [PATCH net] net: dsa: b53: Add missing ARL entries for BCM53125

2017-07-20 Thread Vivien Didelot
Florian Fainelli  writes:

> The BCM53125 entry was missing an arl_entries member which would
> basically prevent the ARL search from terminating properly. This switch
> has 4 ARL entries, so add that.
>
> Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
> Signed-off-by: Florian Fainelli 

Reviewed-by: Vivien Didelot 


[PATCH] PCI: Update ACS quirk for more Intel 10G NICs

2017-07-20 Thread Roland Dreier
From: Roland Dreier 

Add one more variant of the 82599 plus the device IDs for X540 and X550
variants.  Intel has confirmed that none of these devices does peer-to-peer
between functions.  The X540 and X550 have added ACS capabilities in their
PCI config space, but the ACS control register is hard-wired to 0 for both
devices, so we still need the quirk for IOMMU grouping to allow assignment
of individual SR-IOV functions.

Signed-off-by: Roland Dreier 
---
 drivers/pci/quirks.c | 21 +
 1 file changed, 21 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 6967c6b4cf6b..b939db671326 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4335,12 +4335,33 @@ static const struct pci_dev_acs_enabled {
{ PCI_VENDOR_ID_INTEL, 0x1507, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x1514, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x151C, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x1528, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x1529, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x154A, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x152A, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x154D, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x154F, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x1551, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x1558, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x1560, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x1563, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15AA, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15AB, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15AC, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15AD, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15AE, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15B0, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15AB, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15C2, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15C3, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15C4, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15C6, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15C7, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15C8, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15CE, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15E4, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15E5, pci_quirk_mf_endpoint_acs },
+   { PCI_VENDOR_ID_INTEL, 0x15D1, pci_quirk_mf_endpoint_acs },
/* 82580 */
{ PCI_VENDOR_ID_INTEL, 0x1509, pci_quirk_mf_endpoint_acs },
{ PCI_VENDOR_ID_INTEL, 0x150E, pci_quirk_mf_endpoint_acs },
-- 
2.11.0



Re: A buggy behavior for Linux TCP Reno and HTCP

2017-07-20 Thread Wei Sun
Hi Yuchung,

Sorry for the confusion.  The test case was adapted from an old DSACK
test case (i.e., forget to remove something).

Attached is a new and simple one. Thanks



On Wed, Jul 19, 2017 at 2:31 PM, Yuchung Cheng  wrote:
> On Tue, Jul 18, 2017 at 2:36 PM, Wei Sun  wrote:
>> Hi there,
>>
>> We find a buggy behavior when using Linux TCP Reno and HTCP in low
>> bandwidth or highly congested network environments.
>>
>> In a simple word, their undo functions may mistakenly double the cwnd,
>> leading to a more aggressive behavior in a highly congested scenario.
>>
>>
>> The detailed reason:
>>
>> The current reno undo function assumes cwnd halving (and thus doubles
>> the cwnd), but it doesn't consider a corner case condition that
>> ssthresh is at least 2.
>>
>> e.g.,
>>  cwnd  ssth
>> An initial state: 25
>> A spurious loss:   12
>> Undo:   45
>>
>> Here the cwnd after undo is two times as that before undo. Attached is
>> a simple script to reproduce it.
> the packetdrill script is a bit confusing: it disables SACK but then
> the client returns ACK w/ SACKs, also 3 dupacks happen after RTO so
> the sender isn't technically going through a fast recovery...
>
> could you provide a better test?
>
>>
>> A similar reason for HTCP, so we recommend to store the cwnd on loss
>> in .ssthresh implementation and restore it again in .undo_cwnd for TCP
>> Reno and HTCP implementations.
>>
>> Thanks


TSundo-2-1-4.pkt
Description: Binary data


[PATCH net] net: dsa: b53: Add missing ARL entries for BCM53125

2017-07-20 Thread Florian Fainelli
The BCM53125 entry was missing an arl_entries member which would
basically prevent the ARL search from terminating properly. This switch
has 4 ARL entries, so add that.

Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
Signed-off-by: Florian Fainelli 
---
 drivers/net/dsa/b53/b53_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index e68d368e20ac..7f36d3e3c98b 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1665,6 +1665,7 @@ static const struct b53_chip_data b53_switch_chips[] = {
.dev_name = "BCM53125",
.vlans = 4096,
.enabled_ports = 0xff,
+   .arl_entries = 4,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
-- 
2.9.3



[PATCH v3] iproute2: add support for GRE ignore-df knob

2017-07-20 Thread Philip Prindeville
From: Philip Prindeville 

In the presence of firewalls which improperly block ICMP Unreachable
(including Fragmentation Required) messages, Path MTU Discovery is
prevented from working.

The workaround is to handle IPv4 payloads opaquely, ignoring the DF
bit.

Kernel commit 22a59be8b7693eb2d0897a9638f5991f2f8e4ddd ("net: ipv4:
Add ability to have GRE ignore DF bit in IPv4 payloads") is
complemented by this user-space changeset which exposes control of
this setting.

Reviewed-by: Stephen Hemminger 
Signed-off-by: Philip Prindeville 
---
 doc/ip-cref.tex  |  7 +++
 ip/link_gre.c| 19 +++
 man/man8/ip-tunnel.8 |  9 +
 3 files changed, 35 insertions(+)

diff --git a/doc/ip-cref.tex b/doc/ip-cref.tex
index 
242cc266b7acd34adcf390e6272944e333d6160e..179baa2fb75e7013274f030d6ae47a0c64ff728a
 100644
--- a/doc/ip-cref.tex
+++ b/doc/ip-cref.tex
@@ -2524,6 +2524,13 @@ It must be an address on another interface of this host.
It is enabled by default. Note that a fixed ttl is incompatible
with this option: tunnelling with a fixed ttl always makes pmtu 
discovery.
 
+\item \verb|ignore-df|
+
+--- (only GRE tunnels) enable IPv4 DF flag suppression on this tunnel.
+   If is disabled by default. Enabling this option will cause IPv4
+   payloads to be handled like any other GRE payload,
+   regardless of the DF flag.
+
 \item \verb|key K|, \verb|ikey K|, \verb|okey K|
 
 --- (only GRE tunnels) use keyed GRE with key \verb|K|. \verb|K| is
diff --git a/ip/link_gre.c b/ip/link_gre.c
index 
82df900614bfdb1aa53985e1d36d4b99d4990291..c2ec5f26902ffc27b1f8aad1a67ed52964a53610
 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -34,6 +34,7 @@ static void print_usage(FILE *f)
"[ ttl TTL ]\n"
"[ tos TOS ]\n"
"[ [no]pmtudisc ]\n"
+   "[ [no]ignore-df ]\n"
"[ dev PHYS_DEV ]\n"
"[ noencap ]\n"
"[ encap { fou | gue | none } ]\n"
@@ -93,6 +94,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char 
**argv,
__u16 encapsport = 0;
__u16 encapdport = 0;
__u8 metadata = 0;
+   __u8 ignore_df = 0;
__u32 fwmark = 0;
 
if (!(n->nlmsg_flags & NLM_F_CREATE)) {
@@ -164,6 +166,10 @@ get_failed:
if (greinfo[IFLA_GRE_COLLECT_METADATA])
metadata = 1;
 
+   if (greinfo[IFLA_GRE_IGNORE_DF])
+   ignore_df =
+   !!rta_getattr_u8(greinfo[IFLA_GRE_IGNORE_DF]);
+
if (greinfo[IFLA_GRE_FWMARK])
fwmark = rta_getattr_u32(greinfo[IFLA_GRE_FWMARK]);
}
@@ -311,6 +317,13 @@ get_failed:
encapflags |= ~TUNNEL_ENCAP_FLAG_REMCSUM;
} else if (strcmp(*argv, "external") == 0) {
metadata = 1;
+   } else if (strcmp(*argv, "ignore-df") == 0) {
+   ignore_df = 1;
+   } else if (strcmp(*argv, "noignore-df") == 0) {
+   /*
+*only the lsb is significant, use 2 for presence
+*/
+   ignore_df = 2;
} else if (strcmp(*argv, "fwmark") == 0) {
NEXT_ARG();
if (get_u32(, *argv, 0))
@@ -355,6 +368,9 @@ get_failed:
addattr16(n, 1024, IFLA_GRE_ENCAP_SPORT, htons(encapsport));
addattr16(n, 1024, IFLA_GRE_ENCAP_DPORT, htons(encapdport));
 
+   if (ignore_df)
+   addattr8(n, 1024, IFLA_GRE_IGNORE_DF, ignore_df & 1);
+
return 0;
 }
 
@@ -454,6 +470,9 @@ static void gre_print_opt(struct link_util *lu, FILE *f, 
struct rtattr *tb[])
else
fputs("external ", f);
 
+   if (tb[IFLA_GRE_IGNORE_DF] && rta_getattr_u8(tb[IFLA_GRE_IGNORE_DF]))
+   fputs("ignore-df ", f);
+
if (tb[IFLA_GRE_ENCAP_TYPE] &&
rta_getattr_u16(tb[IFLA_GRE_ENCAP_TYPE]) != TUNNEL_ENCAP_NONE) {
__u16 type = rta_getattr_u16(tb[IFLA_GRE_ENCAP_TYPE]);
diff --git a/man/man8/ip-tunnel.8 b/man/man8/ip-tunnel.8
index 
4938c7405ce850c0774837b8654cfe236344319c..7ddbffb23cff1b01a348f3b664d578ccaa8a52cb
 100644
--- a/man/man8/ip-tunnel.8
+++ b/man/man8/ip-tunnel.8
@@ -49,6 +49,7 @@ ip-tunnel - tunnel configuration
 .BR 6rd-reset " ]"
 .br
 .RB "[ [" no "]" pmtudisc " ]"
+.RB "[ [" no "]" ignore-df " ]"
 .RB "[ " dev
 .IR PHYS_DEV " ]"
 
@@ -176,6 +177,14 @@ with this option: tunneling with a fixed ttl always makes 
pmtu
 discovery.
 
 .TP
+.B ignore-df
+enable IPv4 DF suppression on this tunnel.
+Normally datagrams that 

[Patch net] net: check mac address length for dev_set_mac_address()

2017-07-20 Thread Cong Wang
dev_set_mac_address() accepts a struct sockaddr pointer as
input but we have various types of mac addresse whose lengths
are up to MAX_ADDR_LEN, this is confusing.

Make it void like ->ndo_set_mac_address() and let callers check
its length before calling it. It is too late to fix dev_ifsioc()
due to API compatibility, so just reject those larger than
sizeof(struct sockaddr).

Fortunately, only a few IPv6 tunnel devices have addr_len
larger than sizeof(struct sockaddr) and they don't support
ndo_set_mac_addr(). But team driver seems still buggy without
this patch.

Cc: Jiri Pirko 
Signed-off-by: Cong Wang 
---
 include/linux/netdevice.h |  2 +-
 net/core/dev.c| 10 +++---
 net/core/dev_ioctl.c  |  2 ++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 779b23595596..d7e872fa4656 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3287,7 +3287,7 @@ int dev_change_net_namespace(struct net_device *, struct 
net *, const char *);
 int __dev_set_mtu(struct net_device *, int);
 int dev_set_mtu(struct net_device *, int);
 void dev_set_group(struct net_device *, int);
-int dev_set_mac_address(struct net_device *, struct sockaddr *);
+int dev_set_mac_address(struct net_device *, void *);
 int dev_change_carrier(struct net_device *, bool new_carrier);
 int dev_get_phys_port_id(struct net_device *dev,
 struct netdev_phys_item_id *ppid);
diff --git a/net/core/dev.c b/net/core/dev.c
index 02440518dd69..1802303bd0a7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6844,13 +6844,17 @@ EXPORT_SYMBOL(dev_set_group);
 /**
  * dev_set_mac_address - Change Media Access Control Address
  * @dev: device
- * @sa: new address
+ * @addr: new address, whose type could be either struct sockaddr or
+ * any other compatible type whose length is up to MAX_ADDR_LEN depending
+ * on the dev->addr_len. Callers should check if its length is smaller than
+ * dev->addr_len!!
  *
  * Change the hardware (MAC) address of the device
  */
-int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa)
+int dev_set_mac_address(struct net_device *dev, void *addr)
 {
const struct net_device_ops *ops = dev->netdev_ops;
+   struct sockaddr *sa = addr;
int err;
 
if (!ops->ndo_set_mac_address)
@@ -6859,7 +6863,7 @@ int dev_set_mac_address(struct net_device *dev, struct 
sockaddr *sa)
return -EINVAL;
if (!netif_device_present(dev))
return -ENODEV;
-   err = ops->ndo_set_mac_address(dev, sa);
+   err = ops->ndo_set_mac_address(dev, addr);
if (err)
return err;
dev->addr_assign_type = NET_ADDR_SET;
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 82fd4c9c4a1b..3f41601d7b7c 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -262,6 +262,8 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, 
unsigned int cmd)
return dev_set_mtu(dev, ifr->ifr_mtu);
 
case SIOCSIFHWADDR:
+   if (dev->addr_len > sizeof(struct sockaddr))
+   return -EINVAL;
return dev_set_mac_address(dev, >ifr_hwaddr);
 
case SIOCSIFHWBROADCAST:
-- 
2.13.0



[Patch net] rtnetlink: allocate more memory for dev_set_mac_address()

2017-07-20 Thread Cong Wang
virtnet_set_mac_address() interprets mac address as struct
sockaddr, but upper layer only allocates dev->addr_len
which is ETH_ALEN + sizeof(sa_family_t) in this case.

We lack a unified definition for mac address, so just fix
the upper layer, this also allows drivers to interpret it
to struct sockaddr freely.

Reported-by: David Ahern 
Signed-off-by: Cong Wang 
---
 net/core/rtnetlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index d1ba90980be1..ebaa26cf777f 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2031,7 +2031,8 @@ static int do_setlink(const struct sk_buff *skb,
struct sockaddr *sa;
int len;
 
-   len = sizeof(sa_family_t) + dev->addr_len;
+   len = sizeof(sa_family_t) + max_t(size_t, dev->addr_len,
+ sizeof(*sa));
sa = kmalloc(len, GFP_KERNEL);
if (!sa) {
err = -ENOMEM;
-- 
2.13.0



[PATCH nf-next] netfilter: ipset: deduplicate prefixlen maps

2017-07-20 Thread Aaron Conole
The prefixlen maps used here are identical, and have been since
introduction.  It seems to make sense to use a single large map,
that the preprocessor will fill appropriately.

Signed-off-by: Aaron Conole 
---
 net/netfilter/ipset/pfxlen.c | 395 +++
 1 file changed, 137 insertions(+), 258 deletions(-)

diff --git a/net/netfilter/ipset/pfxlen.c b/net/netfilter/ipset/pfxlen.c
index 1c8a42c..d5be9c2 100644
--- a/net/netfilter/ipset/pfxlen.c
+++ b/net/netfilter/ipset/pfxlen.c
@@ -3,6 +3,141 @@
 
 /* Prefixlen maps for fast conversions, by Jan Engelhardt. */
 
+#ifdef E
+#undef E
+#endif
+
+#define PREFIXES_MAP   \
+   E(0x, 0x, 0x, 0x),  \
+   E(0x8000, 0x, 0x, 0x),  \
+   E(0xC000, 0x, 0x, 0x),  \
+   E(0xE000, 0x, 0x, 0x),  \
+   E(0xF000, 0x, 0x, 0x),  \
+   E(0xF800, 0x, 0x, 0x),  \
+   E(0xFC00, 0x, 0x, 0x),  \
+   E(0xFE00, 0x, 0x, 0x),  \
+   E(0xFF00, 0x, 0x, 0x),  \
+   E(0xFF80, 0x, 0x, 0x),  \
+   E(0xFFC0, 0x, 0x, 0x),  \
+   E(0xFFE0, 0x, 0x, 0x),  \
+   E(0xFFF0, 0x, 0x, 0x),  \
+   E(0xFFF8, 0x, 0x, 0x),  \
+   E(0xFFFC, 0x, 0x, 0x),  \
+   E(0xFFFE, 0x, 0x, 0x),  \
+   E(0x, 0x, 0x, 0x),  \
+   E(0x8000, 0x, 0x, 0x),  \
+   E(0xC000, 0x, 0x, 0x),  \
+   E(0xE000, 0x, 0x, 0x),  \
+   E(0xF000, 0x, 0x, 0x),  \
+   E(0xF800, 0x, 0x, 0x),  \
+   E(0xFC00, 0x, 0x, 0x),  \
+   E(0xFE00, 0x, 0x, 0x),  \
+   E(0xFF00, 0x, 0x, 0x),  \
+   E(0xFF80, 0x, 0x, 0x),  \
+   E(0xFFC0, 0x, 0x, 0x),  \
+   E(0xFFE0, 0x, 0x, 0x),  \
+   E(0xFFF0, 0x, 0x, 0x),  \
+   E(0xFFF8, 0x, 0x, 0x),  \
+   E(0xFFFC, 0x, 0x, 0x),  \
+   E(0xFFFE, 0x, 0x, 0x),  \
+   E(0x, 0x, 0x, 0x),  \
+   E(0x, 0x8000, 0x, 0x),  \
+   E(0x, 0xC000, 0x, 0x),  \
+   E(0x, 0xE000, 0x, 0x),  \
+   E(0x, 0xF000, 0x, 0x),  \
+   E(0x, 0xF800, 0x, 0x),  \
+   E(0x, 0xFC00, 0x, 0x),  \
+   E(0x, 0xFE00, 0x, 0x),  \
+   E(0x, 0xFF00, 0x, 0x),  \
+   E(0x, 0xFF80, 0x, 0x),  \
+   E(0x, 0xFFC0, 0x, 0x),  \
+   E(0x, 0xFFE0, 0x, 0x),  \
+   E(0x, 0xFFF0, 0x, 0x),  \
+   E(0x, 0xFFF8, 0x, 0x),  \
+   E(0x, 0xFFFC, 0x, 0x),  \
+   E(0x, 0xFFFE, 0x, 0x),  \
+   E(0x, 0x, 0x, 0x),  \
+   E(0x, 0x8000, 0x, 0x),  \
+   E(0x, 0xC000, 0x, 0x),  \
+   E(0x, 0xE000, 0x, 0x),  \
+   E(0x, 0xF000, 0x, 0x),  \
+   E(0x, 0xF800, 0x, 0x),  \
+   E(0x, 0xFC00, 0x, 0x),  \
+   E(0x, 0xFE00, 0x, 0x),  \
+   E(0x, 0xFF00, 0x, 0x),  \
+   E(0x, 0xFF80, 0x, 0x),  \
+   E(0x, 0xFFC0, 0x, 0x),  \
+   E(0x, 0xFFE0, 0x, 0x),  \
+   E(0x, 0xFFF0, 0x, 0x),  \
+   E(0x, 0xFFF8, 0x, 0x),  \
+   E(0x, 0xFFFC, 0x, 0x),  \
+   E(0x, 0xFFFE, 0x, 0x),  \
+   E(0x, 0x, 0x, 

Re: [PATCH net-next v2 1/1] geneve: add rtnl changelink support

2017-07-20 Thread Pravin Shelar
On Thu, Jul 20, 2017 at 10:42 AM, Girish Moodalbail
 wrote:
> Hello Pravin,
>
>
>>> +/* Quiesces the geneve device data path for both TX and RX. */
>>> +static inline void geneve_quiesce(struct geneve_dev *geneve,
>>> + struct geneve_sock **gs4,
>>> + struct geneve_sock **gs6)
>>> +{
>>> +   *gs4 = rtnl_dereference(geneve->sock4);
>>> +   rcu_assign_pointer(geneve->sock4, NULL);
>>> +
>>> +#if IS_ENABLED(CONFIG_IPV6)
>>> +   *gs6 = rtnl_dereference(geneve->sock6);
>>> +   rcu_assign_pointer(geneve->sock6, NULL);
>>> +#else
>>> +   *gs6 = NULL;
>>> +#endif
>>> +   synchronize_net();
>>> +}
>>> +
>>> +/* Resumes the geneve device data path for both TX and RX. */
>>> +static inline void geneve_unquiesce(struct geneve_dev *geneve,
>>> +   struct geneve_sock *gs4,
>>> +   struct geneve_sock __maybe_unused
>>> *gs6)
>>> +{
>>> +   rcu_assign_pointer(geneve->sock4, gs4);
>>> +#if IS_ENABLED(CONFIG_IPV6)
>>> +   rcu_assign_pointer(geneve->sock6, gs6);
>>> +#endif
>>> +   synchronize_net();
>>> +}
>>> +
>>> +static int geneve_changelink(struct net_device *dev, struct nlattr
>>> *tb[],
>>> +struct nlattr *data[],
>>> +struct netlink_ext_ack *extack)
>>> +{
>>> +   struct geneve_dev *geneve = netdev_priv(dev);
>>> +   struct geneve_sock *gs4, *gs6;
>>> +   struct ip_tunnel_info info;
>>> +   bool metadata;
>>> +   bool use_udp6_rx_checksums;
>>> +   int err;
>>> +
>>> +   /* If the geneve device is configured for metadata (or externally
>>> +* controlled, for example, OVS), then nothing can be changed.
>>> +*/
>>> +   if (geneve->collect_md)
>>> +   return -EOPNOTSUPP;
>>> +
>>> +   /* Start with the existing info. */
>>> +   memcpy(, >info, sizeof(info));
>>> +   metadata = geneve->collect_md;
>>> +   use_udp6_rx_checksums = geneve->use_udp6_rx_checksums;
>>> +   err = geneve_nl2info(dev, tb, data, , ,
>>> +_udp6_rx_checksums, true);
>>> +   if (err)
>>> +   return err;
>>> +
>>> +   if (!geneve_dst_addr_equal(>info, ))
>>> +   dst_cache_reset(_cache);
>>> +
>>> +   geneve_quiesce(geneve, , );
>>> +   geneve->info = info;
>>> +   geneve->collect_md = metadata;
>>> +   geneve->use_udp6_rx_checksums = use_udp6_rx_checksums;
>>> +   geneve_unquiesce(geneve, gs4, gs6);
>>> +
>>
>> This is nice trick. But it adds check for the socket in datapath. did
>> you explore updating entire device state in single atomic transaction?
>
>
> I did explore, however what I have now seemed like a more concise method to
> perform changelink operation atomically w.r.t the datapath.
>
> That said, there is one thing I could do. Today we already check for the
> socket in datapath like below:
>
> (a) ipv4 datapath today:
> 
>
>   geneve_xmit_skb(...)
>   |
>   +->geneve_get_v4_rt()
>  |
>  +---> if (!rcu_dereference(geneve->sock4))
> return ERR_PTR(-EIO);
>
> (b) ipv4 datapath with my current patch:
> 
>
>   geneve_xmit_skb(...)
>   |
>   +->if (!rcu_dereference(geneve->sock4))
>   |  return -EIO;
>   |
>   +->geneve_get_v4_rt()
>  |
>  +---> if (!rcu_dereference(geneve->sock4))
> return ERR_PTR(-EIO);
>
> Perhaps, I could piggyback on the already existing check for NULL socket in
> geneve_get_v4_rt() and avoid the additional check I have added in datapath.
> (The situation is same for IPv6)
>
Sounds good to me. But I would like to see comment in code explaining
it bit since this is not standard RCU usage pattern.


Re: [PATCH net-next v2 1/1] geneve: add rtnl changelink support

2017-07-20 Thread Girish Moodalbail

Hello Pravin,


+/* Quiesces the geneve device data path for both TX and RX. */
+static inline void geneve_quiesce(struct geneve_dev *geneve,
+ struct geneve_sock **gs4,
+ struct geneve_sock **gs6)
+{
+   *gs4 = rtnl_dereference(geneve->sock4);
+   rcu_assign_pointer(geneve->sock4, NULL);
+
+#if IS_ENABLED(CONFIG_IPV6)
+   *gs6 = rtnl_dereference(geneve->sock6);
+   rcu_assign_pointer(geneve->sock6, NULL);
+#else
+   *gs6 = NULL;
+#endif
+   synchronize_net();
+}
+
+/* Resumes the geneve device data path for both TX and RX. */
+static inline void geneve_unquiesce(struct geneve_dev *geneve,
+   struct geneve_sock *gs4,
+   struct geneve_sock __maybe_unused *gs6)
+{
+   rcu_assign_pointer(geneve->sock4, gs4);
+#if IS_ENABLED(CONFIG_IPV6)
+   rcu_assign_pointer(geneve->sock6, gs6);
+#endif
+   synchronize_net();
+}
+
+static int geneve_changelink(struct net_device *dev, struct nlattr *tb[],
+struct nlattr *data[],
+struct netlink_ext_ack *extack)
+{
+   struct geneve_dev *geneve = netdev_priv(dev);
+   struct geneve_sock *gs4, *gs6;
+   struct ip_tunnel_info info;
+   bool metadata;
+   bool use_udp6_rx_checksums;
+   int err;
+
+   /* If the geneve device is configured for metadata (or externally
+* controlled, for example, OVS), then nothing can be changed.
+*/
+   if (geneve->collect_md)
+   return -EOPNOTSUPP;
+
+   /* Start with the existing info. */
+   memcpy(, >info, sizeof(info));
+   metadata = geneve->collect_md;
+   use_udp6_rx_checksums = geneve->use_udp6_rx_checksums;
+   err = geneve_nl2info(dev, tb, data, , ,
+_udp6_rx_checksums, true);
+   if (err)
+   return err;
+
+   if (!geneve_dst_addr_equal(>info, ))
+   dst_cache_reset(_cache);
+
+   geneve_quiesce(geneve, , );
+   geneve->info = info;
+   geneve->collect_md = metadata;
+   geneve->use_udp6_rx_checksums = use_udp6_rx_checksums;
+   geneve_unquiesce(geneve, gs4, gs6);
+

This is nice trick. But it adds check for the socket in datapath. did
you explore updating entire device state in single atomic transaction?


I did explore, however what I have now seemed like a more concise method to 
perform changelink operation atomically w.r.t the datapath.


That said, there is one thing I could do. Today we already check for the socket 
in datapath like below:


(a) ipv4 datapath today:


  geneve_xmit_skb(...)
  |
  +->geneve_get_v4_rt()
 |
 +---> if (!rcu_dereference(geneve->sock4))
return ERR_PTR(-EIO);

(b) ipv4 datapath with my current patch:


  geneve_xmit_skb(...)
  |
  +->if (!rcu_dereference(geneve->sock4))
  |  return -EIO;
  |
  +->geneve_get_v4_rt()
 |
 +---> if (!rcu_dereference(geneve->sock4))
return ERR_PTR(-EIO);

Perhaps, I could piggyback on the already existing check for NULL socket in 
geneve_get_v4_rt() and avoid the additional check I have added in datapath. (The 
situation is same for IPv6)


regards,
~Girish


Re: [PATCH 1/3] ipv4: initialize fib_trie prior to register_netdev_notifier call.

2017-07-20 Thread महेश बंडेवार
On Wed, Jul 19, 2017 at 10:51 PM, David Miller  wrote:
>
> Where are patches #2 and #3?
Oops, my bad! I wanted to detach this from the series and send it
independently but forgot to update the header in process. Do you want
me to send it again with just the header change [PATCH 1/3] to [PATCH
next]?


Re: [PATCH 1/2] net: mvneta: remove bogus use of device_node.data ptr

2017-07-20 Thread Sergei Shtylyov

Hello!

On 07/20/2017 05:27 PM, Rob Herring wrote:


Nothing sets ever sets data, so it is always NULL. Remove it as this is


   "Sets" once is enough. :-)


the only user of data ptr in the whole kernel, and it is going to be
removed from struct device_node.

Cc: Thomas Petazzoni 
Signed-off-by: Rob Herring 

[...]

MBR, Sergei



Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Santosh Shilimkar

On 7/20/2017 3:28 AM, Håkon Bugge wrote:

cp->cp_send_gen is treated as a normal variable, although it may be
used by different threads.

This is fixed by using {READ,WRITE}_ONCE when it is incremented and
READ_ONCE when it is read outside the {acquire,release}_in_xmit
protection.


There is explicit memory barrier before the value is read outside
the {acquire,release}_in_xmit so it takes care of load/store sync.


Normative reference from the Linux-Kernel Memory Model:

 Loads from and stores to shared (but non-atomic) variables should
 be protected with the READ_ONCE(), WRITE_ONCE(), and
 ACCESS_ONCE().

Clause 5.1.2.4/25 in the C standard is also relevant.

Signed-off-by: Håkon Bugge 
Reviewed-by: Knut Omang 
---

Having said that, {READ,WRITE}_ONCE usages seems to make
it clear and explicit. So its fine with me.

Acked-by: Santosh Shilimkar 


Re: [PATCH net-next v2 00/13] Change DSA's FDB API and perform switchdev cleanup

2017-07-20 Thread Vivien Didelot
Hi Arkadi,

Arkadi Sharshevsky  writes:

> Hi, thanks for the test. If the fdb is marked as self its not in the
> bridge at all. So before my patch it was OK because you supported the
> self thing.
>
> Please notice that both fdbs you added are marked the same because the
> default is self: vim bridge/fdb.c +499 (I think this is a bug because
> the man page states that master is the default). So in order to put it
> in the bridge you should specify "master":
>
> $bridge fdb add e4:1d:2d:a5:f0:4a dev sw1p7 master
> $bridge fdb show brport sw1p7
> e4:1d:2d:a5:f0:4a vlan 1 offload master br0 permanent <---also should
> e4:1d:2d:46:13:f1 vlan 1 master br0 permanent be offloaded*
> e4:1d:2d:46:13:f1 master br0 permanent
> e4:1d:2d:a5:f0:4a offload master br0 permanent
> 33:33:00:00:00:01 self permanent
> 01:00:5e:00:00:01 self permanent
> 33:33:ff:46:13:f1 self permanent
>
> *you should take the latest iproute.

Thanks for the explanation, it makes more sense now. Now with latest
net-next iproute2 and your patch, I have this behavior, first before
your patchset:

# bridge fdb add e4:1d:2d:a5:f0:2a dev lan3
# bridge fdb add e4:1d:2d:a5:f0:4a dev lan4 master
# bridge fdb show
01:00:5e:00:00:01 dev eth0 self permanent
01:00:5e:00:00:01 dev eth1 self permanent
2a:6e:b6:a8:25:f1 dev lan0 master br0 permanent
e4:1d:2d:a5:f0:2a dev lan3 self static
e4:1d:2d:a5:f0:4a dev lan4 master br0 permanent
01:00:5e:00:00:01 dev br0 self permanent
# bridge fdb del e4:1d:2d:a5:f0:2a dev lan3
# bridge fdb del e4:1d:2d:a5:f0:4a dev lan4 master
# bridge fdb show
01:00:5e:00:00:01 dev eth0 self permanent
01:00:5e:00:00:01 dev eth1 self permanent
2a:6e:b6:a8:25:f1 dev lan0 master br0 permanent
01:00:5e:00:00:01 dev br0 self permanent

and after your patchset:

# bridge fdb add e4:1d:2d:a5:f0:2a dev lan3
# bridge fdb add e4:1d:2d:a5:f0:4a dev lan4 master
# bridge fdb show
01:00:5e:00:00:01 dev eth0 self permanent
e4:1d:2d:a5:f0:2a dev eth1 self permanent
01:00:5e:00:00:01 dev eth1 self permanent
da:ac:a3:36:f2:10 dev lan0 master br0 permanent
e4:1d:2d:a5:f0:4a dev lan4 offload master br0 permanent
e4:1d:2d:a5:f0:4a dev lan4 self static
01:00:5e:00:00:01 dev br0 self permanent
# bridge fdb del e4:1d:2d:a5:f0:2a dev lan3
# bridge fdb del e4:1d:2d:a5:f0:4a dev lan4 master
# bridge fdb show
01:00:5e:00:00:01 dev eth0 self permanent
01:00:5e:00:00:01 dev eth1 self permanent
da:ac:a3:36:f2:10 dev lan0 master br0 permanent
01:00:5e:00:00:01 dev br0 self permanent

For lan4, the behavior seems correct. Even if reporting "lan4 self
static" seems odd and redundant with the above "lan4 offload master".
However, adding an address to lan3 without flag (hence self...) ends up
in the switch master device (i.e. SoC side of the CPU port conduit.)

Do you have an idea why the patchset changes that?

> Also it seems strange that I removed the self support from the driver
> but you still managed to configure it. The reason is the default
> self implementation:
>
> vim net/core/rtnetlink.c +3112
>
> I think it is relevant for NICs mostly, so we can ignore it.

Regardless your patchset, this is unfortunately inconsistent with the
bridge man page, describing:

self - the address is associated with the port drivers fdb. Usually
   hardware.
master - the address is associated with master devices fdb. Usually
 software (default).

So a user would imagine "master" (which is the default) programs the
address in the software bridge only. Adding "self" means please also
call into the driver to program the underlying hardware.

Now we have the "offload" read only flag, which is good to inform about
a successfully programmed hardware, but adds another level of complexity
to understand the interaction with the hardware.

I think iproute2 is getting more and more confusing. From what I
understood, respecting the "self" flag as described is not possible
anymore due to some retro-compatibility reasons.

Also Linux must use the hardware as an accelerator (so "self" or
"offload" must be the default), and always fall back to software
otherwise, hence "master" do not make sense here.

What do you think about this synopsis for bridge fdb add?

# bridge fdb add LLADDR dev DEV [ offload { on | off } ]

Where offload defaults to "on". This option should also be ported to
other offloaded features like MDB and VLAN. Even though this is a bit
out of scope of this patchset, do you think this is feasible?


Thanks,

Vivien


Re: [PATCH] net: ethernet: ti: cpsw: Push the request_irq function to the end of probe

2017-07-20 Thread Grygorii Strashko


On 07/20/2017 06:29 AM, Keerthy wrote:
> Push the request_irq function to the end of probe so as
> to ensure all the required fields are populated in the event
> of an ISR getting executed right after requesting the irq.
> 
> Currently while loading the crash kernel a crash was seen as
> soon as devm_request_threaded_irq was called. This was due to
> n->poll being NULL which is called as part of net_rx_action
> function.
> 

In general patch looks good to me, but it's really unexpected to
receive IRQs while CPSW is probing ;(

So, case you have is:
- loading the crash kernel with CPSW driver enabled
- HW is in unpredictable state (CPDMA queues can be filled with
descriptors which ca point on memory this kernel instance do
not own).

In my opinion, CPSW driver should not be the part of crash kernel by default and
if networking functionality is required then it should be loaded as module.
And to make things work right It might be required to add in probe
call 
 soft_reset("cpsw", >regs->soft_reset);
right after
 pm_runtime_get_sync(>dev)

Could you confirm that it will fix issue without your patch, pls?

> Suggested-by: Sekhar Nori 
> Signed-off-by: Keerthy 
> ---
>   drivers/net/ethernet/ti/cpsw.c | 49 
> +-
>   1 file changed, 25 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 37fc165..94892d5 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -3085,6 +3085,31 @@ static int cpsw_probe(struct platform_device *pdev)
>   cpsw->quirk_irq = true;
>   }
>   
> + ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
> +
> + ndev->netdev_ops = _netdev_ops;
> + ndev->ethtool_ops = _ethtool_ops;
> + netif_napi_add(ndev, >napi_rx, cpsw_rx_poll, CPSW_POLL_WEIGHT);
> + netif_tx_napi_add(ndev, >napi_tx, cpsw_tx_poll, CPSW_POLL_WEIGHT);
> + cpsw_split_res(ndev);
> +
> + /* register the network device */
> + SET_NETDEV_DEV(ndev, >dev);
> + ret = register_netdev(ndev);
> + if (ret) {
> + dev_err(priv->dev, "error registering net device\n");
> + ret = -ENODEV;
> + goto clean_ale_ret;
> + }
> +
> + if (cpsw->data.dual_emac) {
> + ret = cpsw_probe_dual_emac(priv);
> + if (ret) {
> + cpsw_err(priv, probe, "error probe slave 2 emac 
> interface\n");
> + goto clean_unregister_netdev_ret;
> + }
> + }
> +
>   /* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and
>* MISC IRQs which are always kept disabled with this driver so
>* we will not request them.
> @@ -3123,33 +3148,9 @@ static int cpsw_probe(struct platform_device *pdev)
>   goto clean_ale_ret;
>   }
>   
> - ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
> -
> - ndev->netdev_ops = _netdev_ops;
> - ndev->ethtool_ops = _ethtool_ops;
> - netif_napi_add(ndev, >napi_rx, cpsw_rx_poll, CPSW_POLL_WEIGHT);
> - netif_tx_napi_add(ndev, >napi_tx, cpsw_tx_poll, CPSW_POLL_WEIGHT);
> - cpsw_split_res(ndev);
> -
> - /* register the network device */
> - SET_NETDEV_DEV(ndev, >dev);
> - ret = register_netdev(ndev);
> - if (ret) {
> - dev_err(priv->dev, "error registering net device\n");
> - ret = -ENODEV;
> - goto clean_ale_ret;
> - }
> -
>   cpsw_notice(priv, probe,
>   "initialized device (regs %pa, irq %d, pool size %d)\n",
>   _res->start, ndev->irq, dma_params.descs_pool_size);
> - if (cpsw->data.dual_emac) {
> - ret = cpsw_probe_dual_emac(priv);
> - if (ret) {
> - cpsw_err(priv, probe, "error probe slave 2 emac 
> interface\n");
> - goto clean_unregister_netdev_ret;
> - }
> - }
>   
>   pm_runtime_put(>dev);
>   
> 

-- 
regards,
-grygorii


Re: [PATCH 1/2] net: mvneta: remove bogus use of

2017-07-20 Thread Rob Herring
On Thu, Jul 20, 2017 at 10:06 AM, Gregory CLEMENT
 wrote:
> Hi Rob,
>
>  On jeu., juil. 20 2017, Rob Herring  wrote:
>
> (Adding Marcin in CC who wrote this part of code)
>
>> Nothing sets ever sets data, so it is always NULL. Remove it as this is
>> the only user of data ptr in the whole kernel, and it is going to be
>> removed from struct device_node.
>
> Actually the use of device_node.data ptr is not bogus and it is set in
> mvneta_bm_probe:
> http://elixir.free-electrons.com/linux/latest/source/drivers/net/ethernet/marvell/mvneta_bm.c#L433

Indeed. Looks like some complicated kconfig logic, so I'd not been
able to trigger a build failure nor did 0-day (so far).

> Your patch will break the BM support on this driver. So if you need to
> remove this data ptr, then you have to offer an alternative for it.

How about something like this (WS damaged) patch:

diff --git a/drivers/net/ethernet/marvell/mvneta.c
b/drivers/net/ethernet/marvell/mvneta.c
index 0aab74c2a209..3a3021cb93a7 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4296,11 +4296,12 @@ static int mvneta_probe(struct platform_device *pdev)

  /* Obtain access to BM resources if enabled and already initialized */
  bm_node = of_parse_phandle(dn, "buffer-manager", 0);
- if (bm_node && bm_node->data) {
- pp->bm_priv = bm_node->data;
+ if (bm_node) {
+ pp->bm_priv = mvneta_bm_get();
  err = mvneta_bm_port_init(pdev, pp);
  if (err < 0) {
  dev_info(>dev, "use SW buffer management\n");
+ mvneta_bm_put(pp->bm_priv);
  pp->bm_priv = NULL;
  }
  }
@@ -4370,6 +4371,7 @@ static int mvneta_probe(struct platform_device *pdev)
  mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_long, 1 << pp->id);
  mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_short,
1 << pp->id);
+ mvneta_bm_put(pp->bm_priv);
  }
 err_free_stats:
  free_percpu(pp->stats);
@@ -4411,6 +4413,7 @@ static int mvneta_remove(struct platform_device *pdev)
  mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_long, 1 << pp->id);
  mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_short,
1 << pp->id);
+ mvneta_bm_put(pp->bm_priv);
  }

  return 0;
diff --git a/drivers/net/ethernet/marvell/mvneta_bm.c
b/drivers/net/ethernet/marvell/mvneta_bm.c
index 466939f8f0cf..276af8aff3c7 100644
--- a/drivers/net/ethernet/marvell/mvneta_bm.c
+++ b/drivers/net/ethernet/marvell/mvneta_bm.c
@@ -392,6 +392,17 @@ static void mvneta_bm_put_sram(struct mvneta_bm *priv)
   MVNETA_BM_BPPI_SIZE);
 }

+struct mvneta_bm *mvneta_bm_get(struct device_node *node)
+{
+ struct platform_device *pdev = of_find_device_by_node(node);
+ return pdev ? platform_get_drvdata(pdev) : NULL;
+}
+
+void mvneta_bm_put(struct mvneta_bm *priv)
+{
+ platform_device_put(priv->pdev);
+}
+
 static int mvneta_bm_probe(struct platform_device *pdev)
 {
  struct device_node *dn = pdev->dev.of_node;
diff --git a/drivers/net/ethernet/marvell/mvneta_bm.h
b/drivers/net/ethernet/marvell/mvneta_bm.h
index a32de432800c..50b27feab666 100644
--- a/drivers/net/ethernet/marvell/mvneta_bm.h
+++ b/drivers/net/ethernet/marvell/mvneta_bm.h
@@ -134,6 +134,9 @@ void *mvneta_frag_alloc(unsigned int frag_size);
 void mvneta_frag_free(unsigned int frag_size, void *data);

 #if IS_ENABLED(CONFIG_MVNETA_BM)
+struct mvneta_bm *mvneta_bm_get(struct device_node *node);
+void mvneta_bm_put(struct mvneta_bm *priv);
+
 void mvneta_bm_pool_destroy(struct mvneta_bm *priv,
 struct mvneta_bm_pool *bm_pool, u8 port_map);
 void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct
mvneta_bm_pool *bm_pool,
@@ -160,6 +163,12 @@ static inline u32 mvneta_bm_pool_get_bp(struct
mvneta_bm *priv,
  (bm_pool->id << MVNETA_BM_POOL_ACCESS_OFFS));
 }
 #else
+static inline struct mvneta_bm *mvneta_bm_get(struct device_node *node)
+{
+ return NULL;
+}
+static inline void mvneta_bm_put(struct mvneta_bm *priv) {}
+
 void mvneta_bm_pool_destroy(struct mvneta_bm *priv,
 struct mvneta_bm_pool *bm_pool, u8 port_map) {}
 void mvneta_bm_bufs_free(struct mvneta_bm *priv, struct
mvneta_bm_pool *bm_pool,


Re: [PATCH 1/2] net: mvneta: remove bogus use of

2017-07-20 Thread Marcin Wojtas
Hi Rob,

I somehow missed this patch.

2017-07-20 17:06 GMT+02:00 Gregory CLEMENT :
> Hi Rob,
>
>  On jeu., juil. 20 2017, Rob Herring  wrote:
>
> (Adding Marcin in CC who wrote this part of code)
>
>> Nothing sets ever sets data, so it is always NULL. Remove it as this is
>> the only user of data ptr in the whole kernel, and it is going to be
>> removed from struct device_node.
>
> Actually the use of device_node.data ptr is not bogus and it is set in
> mvneta_bm_probe:
> http://elixir.free-electrons.com/linux/latest/source/drivers/net/ethernet/marvell/mvneta_bm.c#L433
>
> Your patch will break the BM support on this driver. So if you need to
> remove this data ptr, then you have to offer an alternative for it.

Exactly, this breaks NETA operation with BM block. The data is set in:

dn->data = priv;
platform_set_drvdata(pdev, priv);

At the time I couldn't have found out a nicer solution to make work
two different HW blocks (network controller and buffer manager). There
was once a patchset enabling calling another driver's probe basing on
the phandle and of_node information, but after it reached ~v7 it
eventually didn't make it to the tree. Do you any way for solving such
dependencies, if you really want to get rid of this field?

Best regards,
Marcin

>
> Thanks,
>
> Gregory
>
>>
>> Cc: Thomas Petazzoni 
>> Signed-off-by: Rob Herring 
>> ---
>> Probably there's a better fix here to actually enable the h/w buffer
>> manager.
>>
>> I intend to take this thru the DT tree as patch 2 is dependent on this.
>>
>> Rob
>>
>>  drivers/net/ethernet/marvell/mvneta.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/mvneta.c 
>> b/drivers/net/ethernet/marvell/mvneta.c
>> index 0aab74c2a209..5624f4b49f9d 100644
>> --- a/drivers/net/ethernet/marvell/mvneta.c
>> +++ b/drivers/net/ethernet/marvell/mvneta.c
>> @@ -4296,8 +4296,8 @@ static int mvneta_probe(struct platform_device *pdev)
>>
>>   /* Obtain access to BM resources if enabled and already initialized */
>>   bm_node = of_parse_phandle(dn, "buffer-manager", 0);
>> - if (bm_node && bm_node->data) {
>> - pp->bm_priv = bm_node->data;
>> + if (bm_node) {
>> + pp->bm_priv = NULL;
>>   err = mvneta_bm_port_init(pdev, pp);
>>   if (err < 0) {
>>   dev_info(>dev, "use SW buffer management\n");
>> --
>> 2.11.0
>>
>
> --
> Gregory Clement, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com


Re: [PATCH 1/4] can: dev: Add support for limiting configured bitrate

2017-07-20 Thread Franklin S Cooper Jr


On 07/20/2017 04:52 AM, Sergei Shtylyov wrote:
> Hello!
> 
> On 7/20/2017 2:36 AM, Franklin S Cooper Jr wrote:
> 
>> Various CAN or CAN-FD IP may be able to run at a faster rate than
>> what the transceiver the CAN node is connected to. This can lead to
>> unexpected errors. However, CAN transceivers typically have fixed
>> limitations and provide no means to discover these limitations at
>> runtime. Therefore, add support for a fixed-transceiver node that
>> can be reused by other CAN peripheral drivers to determine for both
>> CAN and CAN-FD what the max bitrate that can be used. If the user
>> tries to configure CAN to pass these maximum bitrates it will throw
>> an error.
>>
>> Signed-off-by: Franklin S Cooper Jr 
>> ---
>>   drivers/net/can/dev.c   | 48
>> 
>>   include/linux/can/dev.h |  5 +
>>   2 files changed, 53 insertions(+)
>>
>> diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
>> index 365a8cc..fbab87d 100644
>> --- a/drivers/net/can/dev.c
>> +++ b/drivers/net/can/dev.c
> [...]
>> @@ -814,6 +830,38 @@ int open_candev(struct net_device *dev)
>>   }
>>   EXPORT_SYMBOL_GPL(open_candev);
>>   +#ifdef CONFIG_OF
>> +void of_transceiver_is_fixed(struct net_device *dev)
> 
>Strange name for a *void* function...

Ok I see what you mean since I'm not actually returning anything. I'll
go with of_can_transceiver_fixed based on your comment also Oliver's
suggestion.

>Also, I think 'struct net_device *' variables are typically called
> 'ndev'.

All other functions within this file uses struct net_device *dev. So I'm
just following the style currently used.

> 
>> +{
>> +struct device_node *dn;
>> +struct can_priv *priv = netdev_priv(dev);
>> +u32 max_frequency;
>> +struct device_node *np;
>> +
>> +np = dev->dev.parent->of_node;
>> +
>> +/* New binding */
>> +dn = of_get_child_by_name(np, "fixed-transceiver");
>> +if (!dn)
>> +return;
>> +
>> +of_property_read_u32(dn, "max-arbitration-speed", _frequency);
> 
>In case this function fails, 'max_frequency' will have no value --
> you'd better initialize it...

Thanks for catching this. Will fix.

> 
>> +
>> +if (max_frequency > 0)
>> +priv->max_trans_arbitration_speed = max_frequency;
>> +else
>> +priv->max_trans_arbitration_speed = -1;
>> +
>> +of_property_read_u32(dn, "max-data-speed", _frequency);
> 
>Again, when that function fails, the variable will keep the value
> from the previous call...

Will fix.

> 
> [...]
> 
> MBR, Sergei


Re: [PATCH 1/4] can: dev: Add support for limiting configured bitrate

2017-07-20 Thread Franklin S Cooper Jr

Hi Oliver
On 07/20/2017 02:43 AM, Oliver Hartkopp wrote:
> Hi Franklin,
> 
> On 07/20/2017 01:36 AM, Franklin S Cooper Jr wrote:
> 
>> +#ifdef CONFIG_OF
>> +void of_transceiver_is_fixed(struct net_device *dev)
>> +{
> 
> (..)
> 
>> +}
>> +EXPORT_SYMBOL(of_transceiver_is_fixed);
>> +#endif
> 
> I'm not sure about the naming here.
> 
> As this is a CAN transceiver related option it should be named accordingly:
> 
> E.g.
> 
> can_transceiver_is_fixed
> of_can_transceiver_is_fixed
> ...
> 
> Especially as it is defined in include/linux/can/dev.h

Thanks for the feedback. I'll go with of_can_transceiver_is_fixed

> 
> Regards,
> Oliver
> 
> 


Re: [PATCH v2 net-next] net: systemport: Support 64bit statistics

2017-07-20 Thread Stephen Hemminger
On Wed, 19 Jul 2017 01:18:40 +0100
"Jianming.qiao"  wrote:

> Signed-off-by: Jianming.qiao 

You may want to consider using per-cpu statistics.



Re: [PATCH v2 1/1] iroute2: Add support for GRE ignore-df knob

2017-07-20 Thread Stephen Hemminger
On Wed, 19 Jul 2017 23:19:33 -0600
"Philip Prindeville"  wrote:

> From: Philip Prindeville 
> 
> In the presence of firewalls which improperly block ICMP Unreachable
> (including Fragmentation Required) messages, Path MTU Discovery is
> prevented from working.
> 
> The workaround is to handle IPv4 payloads opaquely, ignoring the DF bit.
> 
> Reviewed-by: Stephen Hemminger 
> Signed-off-by: Philip Prindeville 
> ---
>  doc/ip-cref.tex  |  7 +++
>  ip/link_gre.c| 16 
>  man/man8/ip-tunnel.8 |  9 +
>  3 files changed, 32 insertions(+)
> 

Please fix Subject line and the following minor checkpatch warnings and resubmit


WARNING: line over 80 characters
#109: FILE: ip/link_gre.c:170:
+   ignore_df = 
!!rta_getattr_u8(greinfo[IFLA_GRE_IGNORE_DF]);

WARNING: Block comments use a trailing */ on a separate line
#121: FILE: ip/link_gre.c:322:
+   // only the lsb is significant, use 2 for presence */

total: 0 errors, 2 warnings, 86 lines checked


Re: [PATCH v2 net-next] net: systemport: Support 64bit statistics

2017-07-20 Thread Florian Fainelli
On 07/20/2017 03:13 AM, kiki good wrote:
> Hi David:
> 
> I am sorry for missing the commit log message;Since I did conversation
> with Florian Fainelli about this patch in another email thread
> "[PATCH] net: systemport: Support 64bit statistics", i incorrectly
> thought it was unnecessary to add the commit log again when submitting
> the revised patch.
> 
> The reason for keeping both  .ndo_get_stats and 64-bit
> .ndo_get_stats64 comes from Florian, suggesting that because there is
> no harm in keeping bcm_sysport_get_stats and we can always deprecate
> it later, it is just to minimize the amount of changes to review.

Yes, my bad for suggesting that, Jmqiao, please resubmit with a commit
message that is essentially your paragraph after the "Why do we need
this change?" question (don't include the question in the commit message).

Thanks!

> 
> Why do we need this change ?
> When using Broadcom Systemport device in 32bit Platform, ifconfig can
> only report up to 4G tx,rx status, which will be wrapped to 0 when the
> number of incoming or outgoing packets exceeds 4G, only taking
> around 2 hours in busy network environment (such as streaming).
> Therefore, it makes hard for network diagnostic tool to get reliable
> statistical result, so the patch is used to add 64bit support for
> Broadcom Systemport device in 32bit Platform.
> 
> Thanks
> Jmqiao
> 
> On Thu, Jul 20, 2017 at 6:25 AM, David Miller  wrote:
>> From: "Jianming.qiao" 
>> Date: Wed, 19 Jul 2017 01:18:40 +0100
>>
>>> Signed-off-by: Jianming.qiao 
>>
>> Supporting both deprecated .ndo_get_stats and 64-bit .ndo_get_stats64
>> at the same time makes no sense.
>>
>> .ndo_get_stats will never be called if .ndo_get_stats64 is non-NULL
>>
>> The lack of a commit log message, explaining in detail, why you are
>> doing this and why you are doing it this way, concerns me as well.
>>
>> This submission so far has been a bit of a mess.  You don't
>> communicate enough, your commit message is empty, and therefore we
>> have no idea why you are doing things, and in particular the reasons
>> for your decisions.
>>
>> I'm not applying this, sorry.

-- 
Florian


Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-20 Thread Hangbin Liu
2017-07-20 23:06 GMT+08:00 Hangbin Liu :
>> +++ b/net/ipv6/route.c
>> @@ -3637,12 +3637,6 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, 
>> struct nlmsghdr *nlh,
>> dst = ip6_route_lookup(net, , 0);
>>
>> rt = container_of(dst, struct rt6_info, dst);
>> -   if (rt->dst.error) {
>> -   err = rt->dst.error;
>> -   ip6_rt_put(rt);
>> -   goto errout;
>> -   }
>
> hmm... or instead of remove this check, should we check all the entry? Like
> if ((rt->dst.error && rt != net->ipv6.ip6_null_entry && rt !=
^^ mistake here
> net->ipv6.ip6_blk_hole_entry) ||
>  rt == net->ipv6.ip6_null_entry )

Sorry,  there should be no need to check ip6_null_entry since the
error is already
-ENETUNREACH. So how about

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 4d30c96..c290aa4 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3637,13 +3637,8 @@ static int inet6_rtm_getroute(struct sk_buff
*in_skb, struct nlmsghdr *nlh,
dst = ip6_route_lookup(net, , 0);

rt = container_of(dst, struct rt6_info, dst);
-   if (rt->dst.error) {
-   err = rt->dst.error;
-   ip6_rt_put(rt);
-   goto errout;
-   }
-
-   if (rt == net->ipv6.ip6_null_entry) {
+   if (rt->dst.error && rt != net->ipv6.ip6_prohibit_entry &&
+   rt != net->ipv6.ip6_blk_hole_entry) {
err = rt->dst.error;
ip6_rt_put(rt);
goto errout;

Thanks
Hangbin


Re: [PATCH 1/2] net: mvneta: remove bogus use of

2017-07-20 Thread Gregory CLEMENT
Hi Rob,
 
 On jeu., juil. 20 2017, Rob Herring  wrote:

(Adding Marcin in CC who wrote this part of code)

> Nothing sets ever sets data, so it is always NULL. Remove it as this is
> the only user of data ptr in the whole kernel, and it is going to be
> removed from struct device_node.

Actually the use of device_node.data ptr is not bogus and it is set in
mvneta_bm_probe:
http://elixir.free-electrons.com/linux/latest/source/drivers/net/ethernet/marvell/mvneta_bm.c#L433

Your patch will break the BM support on this driver. So if you need to
remove this data ptr, then you have to offer an alternative for it.

Thanks,

Gregory

>
> Cc: Thomas Petazzoni 
> Signed-off-by: Rob Herring 
> ---
> Probably there's a better fix here to actually enable the h/w buffer 
> manager.
>
> I intend to take this thru the DT tree as patch 2 is dependent on this.
>
> Rob
>
>  drivers/net/ethernet/marvell/mvneta.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c 
> b/drivers/net/ethernet/marvell/mvneta.c
> index 0aab74c2a209..5624f4b49f9d 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -4296,8 +4296,8 @@ static int mvneta_probe(struct platform_device *pdev)
>  
>   /* Obtain access to BM resources if enabled and already initialized */
>   bm_node = of_parse_phandle(dn, "buffer-manager", 0);
> - if (bm_node && bm_node->data) {
> - pp->bm_priv = bm_node->data;
> + if (bm_node) {
> + pp->bm_priv = NULL;
>   err = mvneta_bm_port_init(pdev, pp);
>   if (err < 0) {
>   dev_info(>dev, "use SW buffer management\n");
> -- 
> 2.11.0
>

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com


Re: [PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-20 Thread Hangbin Liu
Hi Roopa, Cong,

2017-07-20 22:51 GMT+08:00 Hangbin Liu :
> After commit 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib
> result when requested"). When we get a prohibit ertry, we will return
> -EACCES directly.
>
> Before:
> + ip netns exec client ip -6 route get 2003::1
> prohibit 2003::1 dev lo table unspec proto kernel src 2001::1 metric
> 4294967295 error -13
>
> After:
> + ip netns exec server ip -6 route get 2002::1
> RTNETLINK answers: Network is unreachable
>
> Since we will check the ip6_null_entry later. There is not sense
> to check the dst.error after get rt.
>
> Fixes: 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib...")
> Signed-off-by: Hangbin Liu 
> ---
>  net/ipv6/route.c | 6 --
>  1 file changed, 6 deletions(-)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 4d30c96..8fc52de 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -3637,12 +3637,6 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, 
> struct nlmsghdr *nlh,
> dst = ip6_route_lookup(net, , 0);
>
> rt = container_of(dst, struct rt6_info, dst);
> -   if (rt->dst.error) {
> -   err = rt->dst.error;
> -   ip6_rt_put(rt);
> -   goto errout;
> -   }

hmm... or instead of remove this check, should we check all the entry? Like
if ((rt->dst.error && rt != net->ipv6.ip6_null_entry && rt !=
net->ipv6.ip6_blk_hole_entry) ||
 rt == net->ipv6.ip6_null_entry )

What do you think?

Thanks
Hangbin


[PATCH net] ipv6: no need to return rt->dst.error if it is not null entry.

2017-07-20 Thread Hangbin Liu
After commit 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib
result when requested"). When we get a prohibit ertry, we will return
-EACCES directly.

Before:
+ ip netns exec client ip -6 route get 2003::1
prohibit 2003::1 dev lo table unspec proto kernel src 2001::1 metric
4294967295 error -13

After:
+ ip netns exec server ip -6 route get 2002::1
RTNETLINK answers: Network is unreachable

Since we will check the ip6_null_entry later. There is not sense
to check the dst.error after get rt.

Fixes: 18c3a61c4264 ("net: ipv6: RTM_GETROUTE: return matched fib...")
Signed-off-by: Hangbin Liu 
---
 net/ipv6/route.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 4d30c96..8fc52de 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3637,12 +3637,6 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, 
struct nlmsghdr *nlh,
dst = ip6_route_lookup(net, , 0);
 
rt = container_of(dst, struct rt6_info, dst);
-   if (rt->dst.error) {
-   err = rt->dst.error;
-   ip6_rt_put(rt);
-   goto errout;
-   }
-
if (rt == net->ipv6.ip6_null_entry) {
err = rt->dst.error;
ip6_rt_put(rt);
-- 
2.5.5



[PATCH 2/2] of: remove unused struct device_node.data ptr

2017-07-20 Thread Rob Herring
There are no users for data pointer in the kernel, so it can be removed.

Signed-off-by: Rob Herring 
---
 include/linux/of.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index 4a8a70916237..7312c8ac5221 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -60,7 +60,6 @@ struct device_node {
struct  device_node *sibling;
struct  kobject kobj;
unsigned long _flags;
-   void*data;
 #if defined(CONFIG_SPARC)
const char *path_component_name;
unsigned int unique_id;
-- 
2.11.0



[PATCH 1/2] net: mvneta: remove bogus use of device_node.data ptr

2017-07-20 Thread Rob Herring
Nothing sets ever sets data, so it is always NULL. Remove it as this is
the only user of data ptr in the whole kernel, and it is going to be
removed from struct device_node.

Cc: Thomas Petazzoni 
Signed-off-by: Rob Herring 
---
Probably there's a better fix here to actually enable the h/w buffer 
manager.

I intend to take this thru the DT tree as patch 2 is dependent on this.

Rob

 drivers/net/ethernet/marvell/mvneta.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c 
b/drivers/net/ethernet/marvell/mvneta.c
index 0aab74c2a209..5624f4b49f9d 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4296,8 +4296,8 @@ static int mvneta_probe(struct platform_device *pdev)
 
/* Obtain access to BM resources if enabled and already initialized */
bm_node = of_parse_phandle(dn, "buffer-manager", 0);
-   if (bm_node && bm_node->data) {
-   pp->bm_priv = bm_node->data;
+   if (bm_node) {
+   pp->bm_priv = NULL;
err = mvneta_bm_port_init(pdev, pp);
if (err < 0) {
dev_info(>dev, "use SW buffer management\n");
-- 
2.11.0



Re: [PATCH] net: bonding: Fix transmit load balancing in balance-alb mode

2017-07-20 Thread Andy Gospodarek
On Thu, Jul 20, 2017 at 1:20 AM, Kosuke Tatsukawa  wrote:
> balance-alb mode used to have transmit dynamic load balancing feature
> enabled by default.  However, transmit dynamic load balancing no longer
> works in balance-alb after commit 8b426dc54cf4 ("bonding: remove
> hardcoded value").
>
> Both balance-tlb and balance-alb use the function bond_do_alb_xmit() to
> send packets.  This function uses the parameter tlb_dynamic_lb.
> tlb_dynamic_lb used to have the default value of 1 for balance-alb, but
> now the value is set to 0 except in balance-tlb.
>
> Re-enable transmit dyanmic load balancing by initializing tlb_dynamic_lb
> for balance-alb similar to balance-tlb.
>
> Signed-off-by: Kosuke Tatsukawa 
> Cc: sta...@vger.kernel.org

You probably should add:

Fixes: 8b426dc54cf4 ("bonding: remove hardcoded value").

Otherwise this looks reasonable to me.

Acked-by: Andy Gospodarek 


> ---
>  drivers/net/bonding/bond_main.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 14ff622..181839d 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -4596,7 +4596,7 @@ static int bond_check_params(struct bond_params *params)
> }
> ad_user_port_key = valptr->value;
>
> -   if (bond_mode == BOND_MODE_TLB) {
> +   if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) {
> bond_opt_initstr(, "default");
> valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB),
> );
>


Re: commit 16ecba59 breaks 82574L under heavy load.

2017-07-20 Thread Lennart Sorensen
On Wed, Jul 19, 2017 at 05:07:47PM -0700, Benjamin Poirier wrote:
> Are you sure about this? In my testing, while triggering the overrun
> with the msleep, I read ICR when entering e1000_msix_other() and RXO is
> consistently set.

I had thousands of calls to e1000_msix_other where the only bit set
was OTHER.

I don't know if the cause is overruns, it just seems plausible.

> I'm working on a patch that uses that fact to handle the situation and
> limit the interrupt.

Excellent.

Running in MSI mode rather than MSI-X seems to not have the problem of
unexpected interrupts, but has other issues (such as loosing the IRQ
affinity setting if you do ifconfig down;ifconfig up on the interface,
which does not happen in MSI-X's case.)  That's rather annoying as you
can't set the affinity before bringing up the interface which is rather
undesirable.

-- 
Len Sorensen


[PATCH net-next] cxgb4: display serial config and vpd versions

2017-07-20 Thread Ganesh Goudar
print the versions of vpd and serial configuration file,
flashed to adapter, and cleanup the relevant code.

Signed-off-by: Casey Leedom 
Signed-off-by: Ganesh Goudar 
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h  |  14 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |  57 +---
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c  | 173 
 drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h   |   2 +
 4 files changed, 188 insertions(+), 58 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index ef4be78..1978abb 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -338,10 +338,12 @@ struct adapter_params {
unsigned int sf_nsec; /* # of flash sectors */
unsigned int sf_fw_start; /* start of FW image in flash */
 
-   unsigned int fw_vers;
-   unsigned int bs_vers;   /* bootstrap version */
-   unsigned int tp_vers;
-   unsigned int er_vers;   /* expansion ROM version */
+   unsigned int fw_vers; /* firmware version */
+   unsigned int bs_vers; /* bootstrap version */
+   unsigned int tp_vers; /* TP microcode version */
+   unsigned int er_vers; /* expansion ROM version */
+   unsigned int scfg_vers;   /* Serial Configuration version */
+   unsigned int vpd_vers;/* VPD Version */
u8 api_vers[7];
 
unsigned short mtus[NMTUS];
@@ -1407,6 +1409,10 @@ int t4_get_fw_version(struct adapter *adapter, u32 
*vers);
 int t4_get_bs_version(struct adapter *adapter, u32 *vers);
 int t4_get_tp_version(struct adapter *adapter, u32 *vers);
 int t4_get_exprom_version(struct adapter *adapter, u32 *vers);
+int t4_get_scfg_version(struct adapter *adapter, u32 *vers);
+int t4_get_vpd_version(struct adapter *adapter, u32 *vers);
+int t4_get_version_info(struct adapter *adapter);
+void t4_dump_version_info(struct adapter *adapter);
 int t4_prep_fw(struct adapter *adap, struct fw_info *fw_info,
   const u8 *fw_data, unsigned int fw_size,
   struct fw_hdr *card_fw, enum dev_state state, int *reset);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index e403fa1..fdf220a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -3610,11 +3610,8 @@ static int adap_init0(struct adapter *adap)
 * later reporting and B. to warn if the currently loaded firmware
 * is excessively mismatched relative to the driver.)
 */
-   t4_get_fw_version(adap, >params.fw_vers);
-   t4_get_bs_version(adap, >params.bs_vers);
-   t4_get_tp_version(adap, >params.tp_vers);
-   t4_get_exprom_version(adap, >params.er_vers);
 
+   t4_get_version_info(adap);
ret = t4_check_fw_version(adap);
/* If firmware is too old (not supported by driver) force an update. */
if (ret)
@@ -4560,56 +4557,8 @@ static void cxgb4_check_pcie_caps(struct adapter *adap)
 /* Dump basic information about the adapter */
 static void print_adapter_info(struct adapter *adapter)
 {
-   /* Device information */
-   dev_info(adapter->pdev_dev, "Chelsio %s rev %d\n",
-adapter->params.vpd.id,
-CHELSIO_CHIP_RELEASE(adapter->params.chip));
-   dev_info(adapter->pdev_dev, "S/N: %s, P/N: %s\n",
-adapter->params.vpd.sn, adapter->params.vpd.pn);
-
-   /* Firmware Version */
-   if (!adapter->params.fw_vers)
-   dev_warn(adapter->pdev_dev, "No firmware loaded\n");
-   else
-   dev_info(adapter->pdev_dev, "Firmware version: %u.%u.%u.%u\n",
-FW_HDR_FW_VER_MAJOR_G(adapter->params.fw_vers),
-FW_HDR_FW_VER_MINOR_G(adapter->params.fw_vers),
-FW_HDR_FW_VER_MICRO_G(adapter->params.fw_vers),
-FW_HDR_FW_VER_BUILD_G(adapter->params.fw_vers));
-
-   /* Bootstrap Firmware Version. (Some adapters don't have Bootstrap
-* Firmware, so dev_info() is more appropriate here.)
-*/
-   if (!adapter->params.bs_vers)
-   dev_info(adapter->pdev_dev, "No bootstrap loaded\n");
-   else
-   dev_info(adapter->pdev_dev, "Bootstrap version: %u.%u.%u.%u\n",
-FW_HDR_FW_VER_MAJOR_G(adapter->params.bs_vers),
-FW_HDR_FW_VER_MINOR_G(adapter->params.bs_vers),
-FW_HDR_FW_VER_MICRO_G(adapter->params.bs_vers),
-FW_HDR_FW_VER_BUILD_G(adapter->params.bs_vers));
-
-   /* TP Microcode Version */
-   if (!adapter->params.tp_vers)
-   dev_warn(adapter->pdev_dev, "No TP Microcode loaded\n");
-   else
-   

Re: [PATCH 2/2] net: ethernet: nb8800: Fix RGMII TX clock delay setup

2017-07-20 Thread Måns Rullgård
Mason  writes:

> I will look for an inter-packet gap knob and FCS error counter.

There is an FCS error counter.  Use "ethtool -S" and look for
rx_bad_fcs_frames.  Reading the stats counters automatically resets
them to zero.

-- 
Måns Rullgård


Re: [PATCH 2/2] net: ethernet: nb8800: Fix RGMII TX clock delay setup

2017-07-20 Thread Mason
On 19/07/2017 23:34, Florian Fainelli wrote:

> How about you start reading the RGMII specification so we can at least,
> if nothing else agree on the terminology? It's public:
> 
> http://web.archive.org/web/20160303171328/http://www.hp.com/rnd/pdfs/RGMIIv2_0_final_hp.pdf

Thanks for linking the spec. Having no EE training,
I am ill-equipped to interpret the timings table.

As you pointed out, the spec states that the
"Data to Clock input Skew (at Receiver)"
must be within [ 1.0, 2.6 ] ns.

I understand that 2 ns is 1/4 of a 125 MHz period,
but it's not clear to me why the above interval is
centered at 1.8 instead of 2.0 ns.

Also, the AR8035 PHY offers 4 possible TX clock delays:
{ 0.25, 1.3, 2.4, 3.4 } according to their doc.
The two extremes are outside the interval, when would
they be useful? In case the transmitter adds "bad" skew?

Why doesn't the PHY support 1.8/2.0? Is it perhaps
unable to, because of PLL limitations?

It's also not clear to me if wire length has any
influence on the required skew. I would say "no".
I think signal propagation time has nothing to do
with clock skew (as long as both wires are roughly
the same length).

> Some Ethernet controllers let you change it, some don't, if nb8800
> allows it, it's good for testing in that it packs more frames per
> quantum of time. If not, do you have at least a FCS error counter?

I'll have a closer look, and test with iPerf3.
Or is there a better benchmark? I will look for
an inter-packet gap knob and FCS error counter.

> I completely understand what you want to solve but I suspect you will
> have to do it in a way where you either accept that you may not be fully
> compliant with the now clarified "phy-mode" description, in order not to
> break other people's set up that were already non-compliant (can't blame
> them, they did not know back then), or you will have to use additional
> MAC properties to override the delay settings on the MAC or PHY side.

I think I need to give up the notion of "fixing"
the at803x driver. Some boards rely on the fact
that RX clock delay is enabled by default, like
am335x-evm using "rgmii-txid" instead of "rgmii-id".

My board needs to enable both internal delays,
so I don't need the PHY patch. I will only fix
the MAC driver and the DTS.

Regards.


[PATCH] net: ethernet: ti: cpsw: Push the request_irq function to the end of probe

2017-07-20 Thread Keerthy
Push the request_irq function to the end of probe so as
to ensure all the required fields are populated in the event
of an ISR getting executed right after requesting the irq.

Currently while loading the crash kernel a crash was seen as
soon as devm_request_threaded_irq was called. This was due to
n->poll being NULL which is called as part of net_rx_action
function.

Suggested-by: Sekhar Nori 
Signed-off-by: Keerthy 
---
 drivers/net/ethernet/ti/cpsw.c | 49 +-
 1 file changed, 25 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 37fc165..94892d5 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -3085,6 +3085,31 @@ static int cpsw_probe(struct platform_device *pdev)
cpsw->quirk_irq = true;
}
 
+   ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
+
+   ndev->netdev_ops = _netdev_ops;
+   ndev->ethtool_ops = _ethtool_ops;
+   netif_napi_add(ndev, >napi_rx, cpsw_rx_poll, CPSW_POLL_WEIGHT);
+   netif_tx_napi_add(ndev, >napi_tx, cpsw_tx_poll, CPSW_POLL_WEIGHT);
+   cpsw_split_res(ndev);
+
+   /* register the network device */
+   SET_NETDEV_DEV(ndev, >dev);
+   ret = register_netdev(ndev);
+   if (ret) {
+   dev_err(priv->dev, "error registering net device\n");
+   ret = -ENODEV;
+   goto clean_ale_ret;
+   }
+
+   if (cpsw->data.dual_emac) {
+   ret = cpsw_probe_dual_emac(priv);
+   if (ret) {
+   cpsw_err(priv, probe, "error probe slave 2 emac 
interface\n");
+   goto clean_unregister_netdev_ret;
+   }
+   }
+
/* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and
 * MISC IRQs which are always kept disabled with this driver so
 * we will not request them.
@@ -3123,33 +3148,9 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
 
-   ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
-
-   ndev->netdev_ops = _netdev_ops;
-   ndev->ethtool_ops = _ethtool_ops;
-   netif_napi_add(ndev, >napi_rx, cpsw_rx_poll, CPSW_POLL_WEIGHT);
-   netif_tx_napi_add(ndev, >napi_tx, cpsw_tx_poll, CPSW_POLL_WEIGHT);
-   cpsw_split_res(ndev);
-
-   /* register the network device */
-   SET_NETDEV_DEV(ndev, >dev);
-   ret = register_netdev(ndev);
-   if (ret) {
-   dev_err(priv->dev, "error registering net device\n");
-   ret = -ENODEV;
-   goto clean_ale_ret;
-   }
-
cpsw_notice(priv, probe,
"initialized device (regs %pa, irq %d, pool size %d)\n",
_res->start, ndev->irq, dma_params.descs_pool_size);
-   if (cpsw->data.dual_emac) {
-   ret = cpsw_probe_dual_emac(priv);
-   if (ret) {
-   cpsw_err(priv, probe, "error probe slave 2 emac 
interface\n");
-   goto clean_unregister_netdev_ret;
-   }
-   }
 
pm_runtime_put(>dev);
 
-- 
1.9.1



Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Håkon Bugge

> On 20 Jul 2017, at 13:02, Sowmini Varadhan  
> wrote:
> 
> On (07/20/17 12:28), H??kon Bugge wrote:
>> cp->cp_send_gen is treated as a normal variable, although it may be
>> used by different threads.
> 
> I'm confused by that assertion. If you look at the comments right
> above the change in your patch, there is a note that 
> acquire_in_xmit/release_in_xmit are the synchronization/serialization 
> points.
> 
> Can you please clarify?

The way the original code works, is that it is allowed for the compiler to keep 
the value of “cp->cp_send_gen + 1” in a register. The compiler has no 
requirement to store this value to memory, before leaving the function or 
calling another one.

Further, said register can be used in the comparison outside the 
acquire_in_xmit/release_in_xmit, at which point another thread may have changed 
its value.


Thxs, Håkon

> 
>> --- a/net/rds/send.c
>> +++ b/net/rds/send.c
>> @@ -170,8 +170,8 @@ int rds_send_xmit(struct rds_conn_path *cp)
>>   * The acquire_in_xmit() check above ensures that only one
>>   * caller can increment c_send_gen at any time.
>>   */
>> -cp->cp_send_gen++;
>> -send_gen = cp->cp_send_gen;
>> +send_gen = READ_ONCE(cp->cp_send_gen) + 1;
>> +WRITE_ONCE(cp->cp_send_gen, send_gen);
>> 
> 
> --Sowmini
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



Re: [PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Sowmini Varadhan
On (07/20/17 12:28), H??kon Bugge wrote:
> cp->cp_send_gen is treated as a normal variable, although it may be
> used by different threads.

I'm confused by that assertion. If you look at the comments right
above the change in your patch, there is a note that 
acquire_in_xmit/release_in_xmit are the synchronization/serialization 
points.

Can you please clarify?

> --- a/net/rds/send.c
> +++ b/net/rds/send.c
> @@ -170,8 +170,8 @@ int rds_send_xmit(struct rds_conn_path *cp)
>* The acquire_in_xmit() check above ensures that only one
>* caller can increment c_send_gen at any time.
>*/
> - cp->cp_send_gen++;
> - send_gen = cp->cp_send_gen;
> + send_gen = READ_ONCE(cp->cp_send_gen) + 1;
> + WRITE_ONCE(cp->cp_send_gen, send_gen);
>  

--Sowmini



[PATCH net] rds: Make sure updates to cp_send_gen can be observed

2017-07-20 Thread Håkon Bugge
cp->cp_send_gen is treated as a normal variable, although it may be
used by different threads.

This is fixed by using {READ,WRITE}_ONCE when it is incremented and
READ_ONCE when it is read outside the {acquire,release}_in_xmit
protection.

Normative reference from the Linux-Kernel Memory Model:

Loads from and stores to shared (but non-atomic) variables should
be protected with the READ_ONCE(), WRITE_ONCE(), and
ACCESS_ONCE().

Clause 5.1.2.4/25 in the C standard is also relevant.

Signed-off-by: Håkon Bugge 
Reviewed-by: Knut Omang 
---
 net/rds/send.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/rds/send.c b/net/rds/send.c
index 5cc6403..fa0368c 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -170,8 +170,8 @@ int rds_send_xmit(struct rds_conn_path *cp)
 * The acquire_in_xmit() check above ensures that only one
 * caller can increment c_send_gen at any time.
 */
-   cp->cp_send_gen++;
-   send_gen = cp->cp_send_gen;
+   send_gen = READ_ONCE(cp->cp_send_gen) + 1;
+   WRITE_ONCE(cp->cp_send_gen, send_gen);
 
/*
 * rds_conn_shutdown() sets the conn state and then tests RDS_IN_XMIT,
@@ -431,7 +431,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
smp_mb();
if ((test_bit(0, >c_map_queued) ||
 !list_empty(>cp_send_queue)) &&
-   send_gen == cp->cp_send_gen) {
+   send_gen == READ_ONCE(cp->cp_send_gen)) {
rds_stats_inc(s_send_lock_queue_raced);
if (batch_count < send_batch_count)
goto restart;
-- 
2.9.3



  1   2   >