Re: [PATCH v3 0/7] Isolate time_t data types for clock/timer syscalls

2017-06-25 Thread Al Viro
On Mon, Jun 26, 2017 at 03:35:25AM +0100, Al Viro wrote:
> On Sat, Jun 24, 2017 at 11:45:01AM -0700, Deepa Dinamani wrote:
> > The series aims at isolating data conversions of time_t based structures:
> > struct timespec and struct itimerspec at user space boundaries.
> > This helps to later change the underlying types to handle y2038 changes
> > to these.
> 
> Nice...  A few questions:
> 
> * what about setitimer(2)?  Right now that's the only remaining user of
> get_compat_itimerval(); similar for getitimer(2) and put_compat_itimerval().
> 
> * you have two callers of get_compat_itimerspec64(); one is followed by
> itimerspec64_valid(), another - by its open-coded analogue.  The same
> goes for get_itimerspec64(); wouldn't it be better to have both check
> the validity immediately and simply fail with -EINVAL?  Matter of taste,
> but...
> 
> * should __sys_recvmmsg() switch to timespec64?

While we are at it - do we need any locking for accesses of ->sk_stamp?
* ax25, ipx, netrom, qrtr: sock_get_timestamp() done under lock_sock().
* bluetooth: without (and case next door in the same switch is
grabbing/dropping lock_sock, so it's not held by caller either)
* ipv4, ipv6, packet, can: without
* irda: without, checks for NULL sock->sk for some reason (other
cases do not, so if we ever get there with NULL ->sk, we are fucked).
Incidentally, TIOCINQ in there looks fishy - what's to prevent us from
losing CPU just as skb_peek() returns, with skb getting freed by the
time we regain it and go looking at skb->len?  Don't we need at least
to hold ->lock on queue we are peeking into?
* rose: without, and TIOCINQ there looks similar to irda one
* x25: without, with the same odd check for NULL sock->sk
* atm: without, apparently.  Same unprotected skb_peek() on
TIOCINQ...
* atalk: ditto.



Re: [PATCH net-next v2 5/5] net: add netlink_ext_ack argument to rtnl_link_ops.slave_validate

2017-06-25 Thread David Ahern
On 6/25/17 10:05 PM, David Ahern wrote:
> On 6/25/17 3:56 PM, Matthias Schiffer wrote:
>> Add support for extended error reporting.
>>
>> Signed-off-by: Matthias Schiffer 
>> ---
> 
> Acked-by: David Ahern 
> 

And slave_validate is not used; it should be removed.


Re: [PATCH net-next v2 4/5] net: add netlink_ext_ack argument to rtnl_link_ops.slave_changelink

2017-06-25 Thread David Ahern
On 6/25/17 10:04 PM, David Ahern wrote:
> On 6/25/17 3:56 PM, Matthias Schiffer wrote:
>> Add support for extended error reporting.
>>
>> Signed-off-by: Matthias Schiffer 
>> ---
> 
> 
> Acked-by: David Ahern 
> 

Actually, you are missing the chagne to br_port_slave_changelink.


Re: [PATCH net-next v2 5/5] net: add netlink_ext_ack argument to rtnl_link_ops.slave_validate

2017-06-25 Thread David Ahern
On 6/25/17 3:56 PM, Matthias Schiffer wrote:
> Add support for extended error reporting.
> 
> Signed-off-by: Matthias Schiffer 
> ---

Acked-by: David Ahern 


Re: [PATCH net-next v2 4/5] net: add netlink_ext_ack argument to rtnl_link_ops.slave_changelink

2017-06-25 Thread David Ahern
On 6/25/17 3:56 PM, Matthias Schiffer wrote:
> Add support for extended error reporting.
> 
> Signed-off-by: Matthias Schiffer 
> ---


Acked-by: David Ahern 


Re: [PATCH net-next v2 3/5] net: add netlink_ext_ack argument to rtnl_link_ops.validate

2017-06-25 Thread David Ahern
On 6/25/17 3:56 PM, Matthias Schiffer wrote:
> Add support for extended error reporting.
> 
> Signed-off-by: Matthias Schiffer 
> ---

Acked-by: David Ahern 


Re: [PATCH net-next v2 2/5] net: add netlink_ext_ack argument to rtnl_link_ops.changelink

2017-06-25 Thread David Ahern
On 6/25/17 3:56 PM, Matthias Schiffer wrote:
> Add support for extended error reporting.
> 
> Signed-off-by: Matthias Schiffer 

Acked-by: David Ahern 


Re: [PATCH net-next v2 1/5] net: add netlink_ext_ack argument to rtnl_link_ops.newlink

2017-06-25 Thread David Ahern
On 6/25/17 3:55 PM, Matthias Schiffer wrote:
> Add support for extended error reporting.
> 
> Signed-off-by: Matthias Schiffer 
> ---

Acked-by: David Ahern 


Re: DNS (?) not working on G5 (64-bit powerpc) (was [net-next,v3,3/3] udp: try to avoid 2 cache miss on dequeue)

2017-06-25 Thread Michael Ellerman
Paolo Abeni  writes:
> Thank you!
>
> I'll submit formally the patch after some more testing.

Thanks.

> I noticed this version has entered the ppc patchwork, but I think that
> the formal submission should go towards the net-next tree.

Yeah it picks up all patches sent to the list. That's fine I'll just
mark it "Not applicable", and expect to see it arrive via net-next.

cheers


EMAIL UPDATE

2017-06-25 Thread IT Department
Recently, we have detect some unusual activity on your account and as a result, 
all email users are urged to update their email account within 24 hours of 
receiving this e-mail, please click the link  http://www.beam.to/9687  to 
confirm that your email account is up to date with the institution requirement.

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



Re: BUG: KASAN: use-after-free in free_old_xmit_skbs

2017-06-25 Thread Jason Wang



On 2017年06月24日 06:32, Cong Wang wrote:

On Fri, Jun 23, 2017 at 1:43 AM, Jason Wang  wrote:


On 2017年06月23日 02:53, Michael S. Tsirkin wrote:

On Thu, Jun 22, 2017 at 08:15:58AM +0200, jean-philippe menil wrote:

Hi Michael,

from what i see, the race appear when we hit virtnet_reset in
virtnet_xdp_set.
virtnet_reset
_remove_vq_common
  virtnet_del_vqs
virtnet_free_queues
  kfree(vi->sq)
when the xdp program (with two instances of the program to trigger it
faster)
is added or removed.

It's easily repeatable, with 2 cpus and 4 queues on the qemu command
line,
running the xdp_ttl tool from Jesper.

For now, i'm able to continue my qualification, testing if xdp_qp is not
null,
but do not seem to be a sustainable trick.
if (xdp_qp && vi->xdp_queues_pairs != xdp_qp)

Maybe it will be more clear to you with theses informations.

Best regards.

Jean-Philippe


I'm pretty clear about the issue here, I was trying to figure out a fix.
Jason, any thoughts?



Hi Jean:

Does the following fix this issue? (I can't reproduce it locally through
xdp_ttl)

It is tricky here.

 From my understanding of the code base, the tx_lock is not sufficient
here, because in virtnet_del_vqs() all vqs are deleted and one vp
maps to one txq.

I am afraid you have to add a spinlock somewhere to serialized
free_old_xmit_skbs() vs. vring_del_virtqueue(). As you can see
they are in different layers, so it is hard to figure out where to add
it...

Also, make sure we don't sleep inside the spinlock, I see a
synchronize_net().


Looks like I miss something. I thought free_old_xmit_skbs() were 
serialized in this case since we disable all tx queues after 
netif_tx_unlock_bh()?


Jean:

I thought this could be easily reproduced by e.g produce some traffic 
and in the same time try to attach an xdp program. But looks not. How do 
you trigger this? What's your qemu command line for this?


Thanks


Re: [PATCH] net/icmp: restore source address if packet is NATed

2017-06-25 Thread David Miller
From: "Jason A. Donenfeld" 
Date: Mon, 26 Jun 2017 00:52:09 +0200

> On Sun, Jun 25, 2017 at 5:49 PM, David Miller  wrote:
>> You definitely can't just rewrite header fields here either.  The
>> SKB could be shared, for example.
> 
> I was afraid of that. It's easy to rework this particular patch,
> though, if you're still interested in the crufty bolt on approach...
> But I think I should investigate the netfilter-only approach instead,
> as you suggested.

I highly encourage you to continue pursuing the netfilter based
approach, and to also discuss it on netfilter-devel which will
hit more capable minds than just here on netdev.


[PATCH NET V5 2/2] net: hns: Use phy_driver to setup Phy loopback

2017-06-25 Thread Lin Yun Sheng
Use function set_loopback in phy_driver to setup phy loopback
when doing ethtool self test.

Signed-off-by: Lin Yun Sheng 
---
 drivers/net/ethernet/hisilicon/hns/hnae.h|  1 +
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 92 +++-
 2 files changed, 26 insertions(+), 67 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h 
b/drivers/net/ethernet/hisilicon/hns/hnae.h
index 04211ac..7ba653a 100644
--- a/drivers/net/ethernet/hisilicon/hns/hnae.h
+++ b/drivers/net/ethernet/hisilicon/hns/hnae.h
@@ -360,6 +360,7 @@ enum hnae_loop {
MAC_INTERNALLOOP_MAC = 0,
MAC_INTERNALLOOP_SERDES,
MAC_INTERNALLOOP_PHY,
+   MAC_LOOP_PHY_NONE,
MAC_LOOP_NONE,
 };
 
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c 
b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index e95795b..10d82df 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -259,67 +259,24 @@ static int hns_nic_set_link_ksettings(struct net_device 
*net_dev,
 
 static int hns_nic_config_phy_loopback(struct phy_device *phy_dev, u8 en)
 {
-#define COPPER_CONTROL_REG 0
-#define PHY_POWER_DOWN BIT(11)
-#define PHY_LOOP_BACK BIT(14)
-   u16 val = 0;
-
-   if (phy_dev->is_c45) /* c45 branch adding for XGE PHY */
-   return -ENOTSUPP;
+   int err;
 
if (en) {
-   /* speed : 1000M */
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 2);
-   phy_write(phy_dev, 21, 0x1046);
-
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 0);
-   /* Force Master */
-   phy_write(phy_dev, 9, 0x1F00);
-
-   /* Soft-reset */
-   phy_write(phy_dev, 0, 0x9140);
-   /* If autoneg disabled,two soft-reset operations */
-   phy_write(phy_dev, 0, 0x9140);
-
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 0xFA);
-
-   /* Default is 0x0400 */
-   phy_write(phy_dev, 1, 0x418);
-
-   /* Force 1000M Link, Default is 0x0200 */
-   phy_write(phy_dev, 7, 0x20C);
-
-   /* Powerup Fiber */
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 1);
-   val = phy_read(phy_dev, COPPER_CONTROL_REG);
-   val &= ~PHY_POWER_DOWN;
-   phy_write(phy_dev, COPPER_CONTROL_REG, val);
-
-   /* Enable Phy Loopback */
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 0);
-   val = phy_read(phy_dev, COPPER_CONTROL_REG);
-   val |= PHY_LOOP_BACK;
-   val &= ~PHY_POWER_DOWN;
-   phy_write(phy_dev, COPPER_CONTROL_REG, val);
+   err = phy_resume(phy_dev);
+   if (err)
+   goto out;
+
+   err = phy_loopback(phy_dev, true);
} else {
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 0xFA);
-   phy_write(phy_dev, 1, 0x400);
-   phy_write(phy_dev, 7, 0x200);
-
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 1);
-   val = phy_read(phy_dev, COPPER_CONTROL_REG);
-   val |= PHY_POWER_DOWN;
-   phy_write(phy_dev, COPPER_CONTROL_REG, val);
-
-   phy_write(phy_dev, HNS_PHY_PAGE_REG, 0);
-   phy_write(phy_dev, 9, 0xF00);
-
-   val = phy_read(phy_dev, COPPER_CONTROL_REG);
-   val &= ~PHY_LOOP_BACK;
-   val |= PHY_POWER_DOWN;
-   phy_write(phy_dev, COPPER_CONTROL_REG, val);
+   err = phy_loopback(phy_dev, false);
+   if (err)
+   goto out;
+
+   err = phy_suspend(phy_dev);
}
-   return 0;
+
+out:
+   return err;
 }
 
 static int __lb_setup(struct net_device *ndev,
@@ -332,10 +289,8 @@ static int __lb_setup(struct net_device *ndev,
 
switch (loop) {
case MAC_INTERNALLOOP_PHY:
-   if ((phy_dev) && (!phy_dev->is_c45)) {
-   ret = hns_nic_config_phy_loopback(phy_dev, 0x1);
-   ret |= h->dev->ops->set_loopback(h, loop, 0x1);
-   }
+   ret = hns_nic_config_phy_loopback(phy_dev, 0x1);
+   ret |= h->dev->ops->set_loopback(h, loop, 0x1);
break;
case MAC_INTERNALLOOP_MAC:
if ((h->dev->ops->set_loopback) &&
@@ -346,10 +301,9 @@ static int __lb_setup(struct net_device *ndev,
if (h->dev->ops->set_loopback)
ret = h->dev->ops->set_loopback(h, loop, 0x1);
break;
+   case MAC_LOOP_PHY_NONE:
+   ret |= hns_nic_config_phy_loopback(phy_dev, 0x0);
case MAC_LOOP_NONE:
-   if ((phy_dev) && (!phy_dev->is_c45))
-   ret |= hns_nic_config_phy_loopback(phy_dev, 0x0);
-
if (h->dev->ops->set_loopback) {
if (priv->ae_handle->phy_if != 

[PATCH NET V5 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-25 Thread Lin Yun Sheng
This patch add set_loopback in phy_driver, which is used by Mac
driver to enable or disable a phy. it also add a generic
genphy_loopback function, which use BMCR loopback bit to enable
or disable a phy.

Signed-off-by: Lin Yun Sheng 
---
 drivers/net/phy/marvell.c|  1 +
 drivers/net/phy/phy_device.c | 51 
 include/linux/phy.h  |  5 +
 3 files changed, 57 insertions(+)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 57297ba..01a1586 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -2094,6 +2094,7 @@ static int m88e1510_probe(struct phy_device *phydev)
.get_sset_count = marvell_get_sset_count,
.get_strings = marvell_get_strings,
.get_stats = marvell_get_stats,
+   .set_loopback = genphy_loopback,
},
{
.phy_id = MARVELL_PHY_ID_88E1540,
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 1219eea..1e08d62 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1123,6 +1123,39 @@ int phy_resume(struct phy_device *phydev)
 }
 EXPORT_SYMBOL(phy_resume);
 
+int phy_loopback(struct phy_device *phydev, bool enable)
+{
+   struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver);
+   int ret = 0;
+
+   mutex_lock(>lock);
+
+   if (enable && phydev->loopback_enabled) {
+   ret = -EBUSY;
+   goto out;
+   }
+
+   if (!enable && !phydev->loopback_enabled) {
+   ret = -EINVAL;
+   goto out;
+   }
+
+   if (phydev->drv && phydrv->set_loopback)
+   ret = phydrv->set_loopback(phydev, enable);
+   else
+   ret = -EOPNOTSUPP;
+
+   if (ret)
+   goto out;
+
+   phydev->loopback_enabled = enable;
+
+out:
+   mutex_unlock(>lock);
+   return ret;
+}
+EXPORT_SYMBOL(phy_loopback);
+
 /* Generic PHY support and helper functions */
 
 /**
@@ -1628,6 +1661,23 @@ static int gen10g_resume(struct phy_device *phydev)
return 0;
 }
 
+int genphy_loopback(struct phy_device *phydev, bool enable)
+{
+   int value;
+
+   value = phy_read(phydev, MII_BMCR);
+   if (value < 0)
+   return value;
+
+   if (enable)
+   value |= BMCR_LOOPBACK;
+   else
+   value &= ~BMCR_LOOPBACK;
+
+   return phy_write(phydev, MII_BMCR, value);
+}
+EXPORT_SYMBOL(genphy_loopback);
+
 static int __set_phy_supported(struct phy_device *phydev, u32 max_speed)
 {
/* The default values for phydev->supported are provided by the PHY
@@ -1874,6 +1924,7 @@ void phy_drivers_unregister(struct phy_driver *drv, int n)
.read_status= genphy_read_status,
.suspend= genphy_suspend,
.resume = genphy_resume,
+   .set_loopback   = genphy_loopback,
 }, {
.phy_id = 0x,
.phy_id_mask= 0x,
diff --git a/include/linux/phy.h b/include/linux/phy.h
index e76e4ad..49c903dc 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -364,6 +364,7 @@ struct phy_c45_device_ids {
  * is_pseudo_fixed_link: Set to true if this phy is an Ethernet switch, etc.
  * has_fixups: Set to true if this phy has fixups/quirks.
  * suspended: Set to true if this phy has been suspended successfully.
+ * loopback_enabled: Set true if this phy has been loopbacked successfully.
  * state: state of the PHY for management purposes
  * dev_flags: Device-specific flags used by the PHY driver.
  * link_timeout: The number of timer firings to wait before the
@@ -400,6 +401,7 @@ struct phy_device {
bool is_pseudo_fixed_link;
bool has_fixups;
bool suspended;
+   bool loopback_enabled;
 
enum phy_state state;
 
@@ -639,6 +641,7 @@ struct phy_driver {
int (*set_tunable)(struct phy_device *dev,
struct ethtool_tunable *tuna,
const void *data);
+   int (*set_loopback)(struct phy_device *dev, bool enable);
 };
 #define to_phy_driver(d) container_of(to_mdio_common_driver(d),
\
  struct phy_driver, mdiodrv)
@@ -774,6 +777,7 @@ static inline void phy_device_free(struct phy_device 
*phydev) { }
 int phy_init_hw(struct phy_device *phydev);
 int phy_suspend(struct phy_device *phydev);
 int phy_resume(struct phy_device *phydev);
+int phy_loopback(struct phy_device *phydev, bool enable);
 struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
  phy_interface_t interface);
 struct phy_device *phy_find_first(struct mii_bus *bus);
@@ -825,6 +829,7 @@ void phy_attached_print(struct phy_device *phydev, const 
char *fmt, ...)
 int genphy_read_status(struct phy_device *phydev);
 int genphy_suspend(struct phy_device *phydev);
 int genphy_resume(struct phy_device 

[PATCH NET V5 0/2] Add loopback support in phy_driver and hns ethtool fix

2017-06-25 Thread Lin Yun Sheng
This Patch Set add set_loopback in phy_driver and use it to setup loopback
when doing ethtool phy self_test.

Patch V5:
Removing non loopback related code change.

Patch V4:
1. Remove c45 checking
2. Add -ENOTSUPP when function pointer is null,
   take mutex in phy_loopback.

Patch V3:
Calling phy_loopback enable and disable in pair in hns mac driver.

Patch V2:
1. Add phy_loopback in phy_device.c.
2. Do error checking and do the read and write once in 
   genphy_loopback.
3. Remove gen10g_loopback in phy_device.c.

Patch V1:
Initial Submit

Lin Yun Sheng (2):
  net: phy: Add phy loopback support in net phy framework
  net: hns: Use phy_driver to setup Phy loopback

 drivers/net/ethernet/hisilicon/hns/hnae.h|  1 +
 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 92 +++-
 drivers/net/phy/marvell.c|  1 +
 drivers/net/phy/phy_device.c | 51 +
 include/linux/phy.h  |  5 ++
 5 files changed, 83 insertions(+), 67 deletions(-)

-- 
1.9.1



Re: [PATCH NET V4 1/2] net: phy: Add phy loopback support in net phy framework

2017-06-25 Thread Yunsheng Lin
Hi, Andrew

On 2017/6/24 21:44, Andrew Lunn wrote:
>> @@ -1087,7 +1087,7 @@ int phy_suspend(struct phy_device *phydev)
>>  {
>>  struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver);
>>  struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
>> -int ret = 0;
>> +int ret = -EOPNOTSUPP;
>>  
>>  /* If the device has WOL enabled, we cannot suspend the PHY */
>>  phy_ethtool_get_wol(phydev, );
>> @@ -1109,7 +1109,7 @@ int phy_suspend(struct phy_device *phydev)
>>  int phy_resume(struct phy_device *phydev)
>>  {
>>  struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver);
>> -int ret = 0;
>> +int ret = -EOPNOTSUPP;
>>  
>>  if (phydev->drv && phydrv->resume)
>>  ret = phydrv->resume(phydev);
>> @@ -1123,6 +1123,39 @@ int phy_resume(struct phy_device *phydev)
>>  }
> 
> These changes should be in a separate patch, since they have nothing
> to do with loopback. You want lots of small patches, making them
> easier to both describe the why it is needed, and easier to review.
> 
Thanks for pointing out. Will remove it next version.
> What are the implications of this change? Are you sure the power core
> code does not understand EOPNOTSUPP as being a real error?
> I was thinking phy_suspend/resume was making the mistake not returing error 
> when
function point is null, as I did in phy_loopback. I am not sure if power core
understand EOPNOTSUPP.
But I think we should fix it if it is fixable, if not, then add a comment. 
because
it is not consitent with other phy_* . For anyone who is not familiar with phy 
core,
it is confusing.



Re: [PATCH v6 05/21] net-next: stmmac: Add dwmac-sun8i

2017-06-25 Thread André Przywara
On 31/05/17 08:18, Corentin Labbe wrote:
> The dwmac-sun8i is a heavy hacked version of stmmac hardware by
> allwinner.
> In fact the only common part is the descriptor management and the first
> register function.

Hi,

I know I am a bit late with this, but while adapting the U-Boot driver
to the new binding I was wondering about the internal PHY detection:

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c 
> b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> new file mode 100644
> index ..1a6bfe6c958f
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> @@ -0,0 +1,990 @@



> +static int sun8i_dwmac_probe(struct platform_device *pdev)
> +{
> + struct plat_stmmacenet_data *plat_dat;
> + struct stmmac_resources stmmac_res;
> + struct sunxi_priv_data *gmac;
> + struct device *dev = >dev;
> + int ret;
> +
> + ret = stmmac_get_platform_resources(pdev, _res);
> + if (ret)
> + return ret;
> +
> + plat_dat = stmmac_probe_config_dt(pdev, _res.mac);
> + if (IS_ERR(plat_dat))
> + return PTR_ERR(plat_dat);
> +
> + gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL);
> + if (!gmac)
> + return -ENOMEM;
> +
> + gmac->variant = of_device_get_match_data(>dev);
> + if (!gmac->variant) {
> + dev_err(>dev, "Missing dwmac-sun8i variant\n");
> + return -EINVAL;
> + }
> +
> + gmac->tx_clk = devm_clk_get(dev, "stmmaceth");
> + if (IS_ERR(gmac->tx_clk)) {
> + dev_err(dev, "Could not get TX clock\n");
> + return PTR_ERR(gmac->tx_clk);
> + }
> +
> + /* Optional regulator for PHY */
> + gmac->regulator = devm_regulator_get_optional(dev, "phy");
> + if (IS_ERR(gmac->regulator)) {
> + if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + dev_info(dev, "No regulator found\n");
> + gmac->regulator = NULL;
> + }
> +
> + gmac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
> +"syscon");
> + if (IS_ERR(gmac->regmap)) {
> + ret = PTR_ERR(gmac->regmap);
> + dev_err(>dev, "Unable to map syscon: %d\n", ret);
> + return ret;
> + }
> +
> + plat_dat->interface = of_get_phy_mode(dev->of_node);
> + if (plat_dat->interface == gmac->variant->internal_phy) {
> + dev_info(>dev, "Will use internal PHY\n");

So here you seem to deduce the usage of the internal PHY by the PHY
interface specified in the DT (MII = internal, RGMII = external).
I think I raised this question before, but isn't it perfectly legal for
a board to use MII with an external PHY even on those SoCs that feature
an internal PHY?
On the first glance that does not make too much sense, but apart from
not being the correct binding to describe all of the SoCs features I see
two scenarios:
1) A board vendor might choose to not use the internal PHY because it
has bugs, lacks features (configurability) or has other issues. For
instance I have heard reports that the internal PHY makes the SoC go
rather hot, possibly limiting the CPU frequency. By using an external
MII PHY (which are still cheaper than RGMII PHYs) this can be avoided.
2) A PHY does not necessarily need to be directly connected to
magnetics. Indeed quite some boards use (RG)MII to connect to a switch
IC or some other network circuitry, for instance fibre connectors.

So I was wondering if we would need an explicit:
allwinner,use-internal-phy;
boolean DT property to signal the usage of the internal PHY?
Alternatively we could go with the negative version:
allwinner,disable-internal-phy;

Or what about introducing a new "allwinner,internal-mii-phy" compatible
string for the *PHY* node and use that?

I just want to avoid that we introduce a binding that causes us
headaches later. I think we can still fix this with a followup patch
before the driver and its binding hit a release kernel.

Cheers,
Andre.

> + gmac->use_internal_phy = true;
> + gmac->ephy_clk = of_clk_get(plat_dat->phy_node, 0);
> + if (IS_ERR(gmac->ephy_clk)) {
> + ret = PTR_ERR(gmac->ephy_clk);
> + dev_err(>dev, "Cannot get EPHY clock: %d\n", ret);
> + return -EINVAL;
> + }
> +
> + gmac->rst_ephy = of_reset_control_get(plat_dat->phy_node, NULL);
> + if (IS_ERR(gmac->rst_ephy)) {
> + ret = PTR_ERR(gmac->rst_ephy);
> + if (ret == -EPROBE_DEFER)
> + return ret;
> + dev_err(>dev, "No EPHY reset control found %d\n",
> + ret);
> + return -EINVAL;
> + }
> + } else {
> + dev_info(>dev, "Will use external PHY\n");
> + 

Re: [PATCH] net/icmp: restore source address if packet is NATed

2017-06-25 Thread Jason A. Donenfeld
Hi David,

On Sun, Jun 25, 2017 at 5:49 PM, David Miller  wrote:
> This violates things on so many levels.

Yes, indeed.

> I think this kind of thing need to be hidden inside of netfilter,
> it can do the rate limiting and stuff like that in the spot
> where it makes the transformation and knows all of the original
> addressing and ports.

Indeed I'd prefer that, and I'll look again into trying to make that
work. But when I tried last, it seemed like there were some
insurmountable challenges. With the ratelimiting, the limit has
already been applied to one IP -- the masqueraded one -- before
netfilter even has a chance to act -- so that IP will already hit the
ratelimits well before any additional one inside netfilter would. Then
the issue of transformation: last I looked it seemed like icmp_send
threw away a bit too much information to do the transformation
entirely correctly, but I could be wrong, so I'll give it another
look. Hopefully it winds up being as easy as just reverse-transforming
ICMP's payload IP header.

>
> You definitely can't just rewrite header fields here either.  The
> SKB could be shared, for example.

I was afraid of that. It's easy to rework this particular patch,
though, if you're still interested in the crufty bolt on approach...
But I think I should investigate the netfilter-only approach instead,
as you suggested.

Jason


Re: Repeatable inet6_dump_fib crash in stock 4.12.0-rc4+

2017-06-25 Thread David Ahern
On 6/20/17 9:03 PM, David Ahern wrote:
> On 6/20/17 5:41 PM, Ben Greear wrote:
>> On 06/20/2017 11:05 AM, Michal Kubecek wrote:
>>> On Tue, Jun 20, 2017 at 07:12:27AM -0700, Ben Greear wrote:
 On 06/14/2017 03:25 PM, David Ahern wrote:
> On 6/14/17 4:23 PM, Ben Greear wrote:
>> On 06/13/2017 07:27 PM, David Ahern wrote:
>>
>>> Let's try a targeted debug patch. See attached
>>
>> I had to change it to pr_err so it would go to our serial console
>> since the system locked hard on crash,
>> and that appears to be enough to change the timing where we can no
>> longer
>> reproduce the problem.
>
>
> ok, let's figure out which one is doing that. There are 3 debug
> statements. I suspect fib6_del_route is the one setting the state to
> FWS_U. Can you remove the debug prints in fib6_repair_tree and
> fib6_walk_continue and try again?

 We cannot reproduce with just that one printf in the kernel either.  It
 must change the timing too much to trigger the bug.
>>>
>>> You might try trace_printk() which should have less impact (don't forget
>>> to enable /proc/sys/kernel/ftrace_dump_on_oops).
>>
>> We cannot reproduce with trace_printk() either.
> 
> I think that suggests the walker state is set to FWS_U in
> fib6_del_route, and it is the FWS_U case in fib6_walk_continue that
> triggers the fault -- the null parent (pn = fn->parent). So we have the
> 2 areas of code that are interacting.
> 
> I'm on a road trip through the end of this week with little time to
> focus on this problem. I'll get back to you another suggestion when I can.
> 

Remove all other changes and try the attached. The fault should not
happen so you need to watch dmesg / console output.
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index deea901746c8..245941e9db8a 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -372,12 +372,13 @@ static int fib6_dump_table(struct fib6_table *table, 
struct sk_buff *skb,
 
read_lock_bh(>tb6_lock);
res = fib6_walk(net, w);
-   read_unlock_bh(>tb6_lock);
if (res > 0) {
cb->args[4] = 1;
cb->args[5] = w->root->fn_sernum;
}
+   read_unlock_bh(>tb6_lock);
} else {
+   read_lock_bh(>tb6_lock);
if (cb->args[5] != w->root->fn_sernum) {
/* Begin at the root if the tree changed */
cb->args[5] = w->root->fn_sernum;
@@ -387,7 +388,6 @@ static int fib6_dump_table(struct fib6_table *table, struct 
sk_buff *skb,
} else
w->skip = 0;
 
-   read_lock_bh(>tb6_lock);
res = fib6_walk_continue(w);
read_unlock_bh(>tb6_lock);
if (res <= 0) {
@@ -1422,7 +1422,6 @@ static void fib6_del_route(struct fib6_node *fn, struct 
rt6_info **rtp,
 
/* Unlink it */
*rtp = rt->dst.rt6_next;
-   rt->rt6i_node = NULL;
net->ipv6.rt6_stats->fib_rt_entries--;
net->ipv6.rt6_stats->fib_discarded_routes++;
 
@@ -1447,12 +1446,24 @@ static void fib6_del_route(struct fib6_node *fn, struct 
rt6_info **rtp,
if (w->state == FWS_C && w->leaf == rt) {
RT6_TRACE("walker %p adjusted by delroute\n", w);
w->leaf = rt->dst.rt6_next;
-   if (!w->leaf)
-   w->state = FWS_U;
+   if (!w->leaf) {
+   if (!w->node->parent) {
+pr_warn("fib6_del_route: setting walker node to null while deleting route: "
+   "dst %pI6c/%d src %pI6c/%d dev %s siblings %d\n",
+   >rt6i_dst.addr, rt->rt6i_dst.plen, >rt6i_src.addr, 
rt->rt6i_src.plen,
+   rt->dst.dev ? rt->dst.dev->name : "", rt->rt6i_nsiblings);
+
+if (rt->rt6i_node == w->node)
+   pr_warn("fib6_del_route: walker node matches deleted route\n");
+   w->node = NULL;
+   } else
+   w->state = FWS_U;
+   }
}
}
read_unlock(>ipv6.fib6_walker_lock);
 
+   rt->rt6i_node = NULL;
rt->dst.rt6_next = NULL;
 
/* If it was last route, expunge its radix tree node */


[PATCH] batman-adv: fix spelling mistake "ourselve" -> "ourself"

2017-06-25 Thread Colin King
From: Colin Ian King 

Trivial fix to spelling mistake in batadv_dbg debug message

Signed-off-by: Colin Ian King 
---
 net/batman-adv/bat_v_ogm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c
index 1e3dc374bfde..d6dbf67acbb5 100644
--- a/net/batman-adv/bat_v_ogm.c
+++ b/net/batman-adv/bat_v_ogm.c
@@ -200,7 +200,7 @@ static void batadv_v_ogm_send(struct work_struct *work)
type = "unknown";
}
 
-   batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "OGM2 from 
ourselve on %s surpressed: %s\n",
+   batadv_dbg(BATADV_DBG_BATMAN, bat_priv, "OGM2 from 
ourself on %s surpressed: %s\n",
   hard_iface->net_dev->name, type);
 
batadv_hardif_put(hard_iface);
-- 
2.11.0



[PATCH net-next v2 1/5] net: add netlink_ext_ack argument to rtnl_link_ops.newlink

2017-06-25 Thread Matthias Schiffer
Add support for extended error reporting.

Signed-off-by: Matthias Schiffer 
---
 drivers/infiniband/ulp/ipoib/ipoib_netlink.c | 3 ++-
 drivers/net/bonding/bond_netlink.c   | 3 ++-
 drivers/net/caif/caif_hsi.c  | 3 ++-
 drivers/net/can/dev.c| 3 ++-
 drivers/net/can/vxcan.c  | 3 ++-
 drivers/net/geneve.c | 3 ++-
 drivers/net/gtp.c| 3 ++-
 drivers/net/ipvlan/ipvlan.h  | 3 ++-
 drivers/net/ipvlan/ipvlan_main.c | 3 ++-
 drivers/net/ipvlan/ipvtap.c  | 9 -
 drivers/net/macsec.c | 3 ++-
 drivers/net/macvlan.c| 3 ++-
 drivers/net/macvtap.c| 7 +++
 drivers/net/ppp/ppp_generic.c| 3 ++-
 drivers/net/team/team.c  | 3 ++-
 drivers/net/veth.c   | 3 ++-
 drivers/net/vrf.c| 3 ++-
 drivers/net/vxlan.c  | 3 ++-
 include/net/rtnetlink.h  | 3 ++-
 net/8021q/vlan_netlink.c | 3 ++-
 net/bridge/br_netlink.c  | 3 ++-
 net/caif/chnl_net.c  | 3 ++-
 net/core/rtnetlink.c | 3 ++-
 net/hsr/hsr_netlink.c| 3 ++-
 net/ieee802154/6lowpan/core.c| 3 ++-
 net/ipv4/ip_gre.c| 5 +++--
 net/ipv4/ip_vti.c| 3 ++-
 net/ipv4/ipip.c  | 3 ++-
 net/ipv6/ip6_gre.c   | 3 ++-
 net/ipv6/ip6_tunnel.c| 3 ++-
 net/ipv6/ip6_vti.c   | 3 ++-
 net/ipv6/sit.c   | 3 ++-
 32 files changed, 68 insertions(+), 40 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_netlink.c 
b/drivers/infiniband/ulp/ipoib/ipoib_netlink.c
index 28884781311b..8b75f80da56c 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_netlink.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_netlink.c
@@ -93,7 +93,8 @@ static int ipoib_changelink(struct net_device *dev,
 }
 
 static int ipoib_new_child_link(struct net *src_net, struct net_device *dev,
-  struct nlattr *tb[], struct nlattr *data[])
+   struct nlattr *tb[], struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
struct net_device *pdev;
struct ipoib_dev_priv *ppriv;
diff --git a/drivers/net/bonding/bond_netlink.c 
b/drivers/net/bonding/bond_netlink.c
index 47a8103610bc..f817fb8005ef 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -438,7 +438,8 @@ static int bond_changelink(struct net_device *bond_dev,
 }
 
 static int bond_newlink(struct net *src_net, struct net_device *bond_dev,
-   struct nlattr *tb[], struct nlattr *data[])
+   struct nlattr *tb[], struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
int err;
 
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 11ba6e3eea22..ed4723a9031f 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -1399,7 +1399,8 @@ static int caif_hsi_fill_info(struct sk_buff *skb, const 
struct net_device *dev)
 }
 
 static int caif_hsi_newlink(struct net *src_net, struct net_device *dev,
- struct nlattr *tb[], struct nlattr *data[])
+   struct nlattr *tb[], struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
struct cfhsi *cfhsi = NULL;
struct cfhsi_ops *(*get_ops)(void);
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index a3011c001080..7f99e8a5dd09 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -1146,7 +1146,8 @@ static int can_fill_xstats(struct sk_buff *skb, const 
struct net_device *dev)
 }
 
 static int can_newlink(struct net *src_net, struct net_device *dev,
-  struct nlattr *tb[], struct nlattr *data[])
+  struct nlattr *tb[], struct nlattr *data[],
+  struct netlink_ext_ack *extack)
 {
return -EOPNOTSUPP;
 }
diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c
index cfe889e8f172..8404e8852a0f 100644
--- a/drivers/net/can/vxcan.c
+++ b/drivers/net/can/vxcan.c
@@ -163,7 +163,8 @@ static void vxcan_setup(struct net_device *dev)
 static struct rtnl_link_ops vxcan_link_ops;
 
 static int vxcan_newlink(struct net *net, struct net_device *dev,
-struct nlattr *tb[], struct nlattr *data[])
+struct nlattr *tb[], struct nlattr *data[],
+struct netlink_ext_ack *extack)
 {
struct vxcan_priv *priv;
struct net_device *peer;
diff --git 

[PATCH net-next v2 0/5] net: add netlink_ext_ack support to rtnl_link_ops

2017-06-25 Thread Matthias Schiffer
Same changes as http://patchwork.ozlabs.org/patch/780351/ , split into
separate patches for each rtnl_link_ops field as requested.


Matthias Schiffer (5):
  net: add netlink_ext_ack argument to rtnl_link_ops.newlink
  net: add netlink_ext_ack argument to rtnl_link_ops.changelink
  net: add netlink_ext_ack argument to rtnl_link_ops.validate
  net: add netlink_ext_ack argument to rtnl_link_ops.slave_changelink
  net: add netlink_ext_ack argument to rtnl_link_ops.slave_validate

 drivers/infiniband/ulp/ipoib/ipoib_netlink.c | 10 ++
 drivers/net/bonding/bond_netlink.c   | 16 ++--
 drivers/net/caif/caif_hsi.c  |  6 --
 drivers/net/can/dev.c| 11 +++
 drivers/net/can/vxcan.c  |  3 ++-
 drivers/net/dummy.c  |  3 ++-
 drivers/net/geneve.c |  6 --
 drivers/net/gtp.c|  6 --
 drivers/net/ifb.c|  3 ++-
 drivers/net/ipvlan/ipvlan.h  |  3 ++-
 drivers/net/ipvlan/ipvlan_main.c |  9 ++---
 drivers/net/ipvlan/ipvtap.c  |  9 -
 drivers/net/macsec.c |  9 ++---
 drivers/net/macvlan.c|  9 ++---
 drivers/net/macvtap.c|  7 +++
 drivers/net/nlmon.c  |  3 ++-
 drivers/net/ppp/ppp_generic.c|  6 --
 drivers/net/team/team.c  |  6 --
 drivers/net/tun.c|  3 ++-
 drivers/net/veth.c   |  8 +---
 drivers/net/vrf.c|  6 --
 drivers/net/vxlan.c  |  9 ++---
 include/net/rtnetlink.h  | 15 ++-
 net/8021q/vlan_netlink.c | 13 -
 net/bridge/br_netlink.c  | 15 ++-
 net/caif/chnl_net.c  |  6 --
 net/core/rtnetlink.c | 13 -
 net/hsr/hsr_netlink.c|  3 ++-
 net/ieee802154/6lowpan/core.c|  6 --
 net/ipv4/ip_gre.c| 16 ++--
 net/ipv4/ip_vti.c|  9 ++---
 net/ipv4/ipip.c  |  9 ++---
 net/ipv6/ip6_gre.c   | 14 +-
 net/ipv6/ip6_tunnel.c|  9 ++---
 net/ipv6/ip6_vti.c   |  9 ++---
 net/ipv6/sit.c   |  9 ++---
 36 files changed, 190 insertions(+), 107 deletions(-)

-- 
2.13.1



[PATCH net-next v2 3/5] net: add netlink_ext_ack argument to rtnl_link_ops.validate

2017-06-25 Thread Matthias Schiffer
Add support for extended error reporting.

Signed-off-by: Matthias Schiffer 
---
 drivers/net/bonding/bond_netlink.c | 3 ++-
 drivers/net/can/dev.c  | 3 ++-
 drivers/net/dummy.c| 3 ++-
 drivers/net/geneve.c   | 3 ++-
 drivers/net/gtp.c  | 3 ++-
 drivers/net/ifb.c  | 3 ++-
 drivers/net/ipvlan/ipvlan_main.c   | 3 ++-
 drivers/net/macsec.c   | 3 ++-
 drivers/net/macvlan.c  | 3 ++-
 drivers/net/nlmon.c| 3 ++-
 drivers/net/ppp/ppp_generic.c  | 3 ++-
 drivers/net/team/team.c| 3 ++-
 drivers/net/tun.c  | 3 ++-
 drivers/net/veth.c | 5 +++--
 drivers/net/vrf.c  | 3 ++-
 drivers/net/vxlan.c| 3 ++-
 include/net/rtnetlink.h| 3 ++-
 net/8021q/vlan_netlink.c   | 3 ++-
 net/bridge/br_netlink.c| 4 +++-
 net/core/rtnetlink.c   | 2 +-
 net/ieee802154/6lowpan/core.c  | 3 ++-
 net/ipv4/ip_gre.c  | 8 +---
 net/ipv4/ip_vti.c  | 3 ++-
 net/ipv4/ipip.c| 3 ++-
 net/ipv6/ip6_gre.c | 8 +---
 net/ipv6/ip6_tunnel.c  | 3 ++-
 net/ipv6/ip6_vti.c | 3 ++-
 net/ipv6/sit.c | 3 ++-
 28 files changed, 63 insertions(+), 33 deletions(-)

diff --git a/drivers/net/bonding/bond_netlink.c 
b/drivers/net/bonding/bond_netlink.c
index cb803c026f1f..0a9d78de6138 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -118,7 +118,8 @@ static const struct nla_policy 
bond_slave_policy[IFLA_BOND_SLAVE_MAX + 1] = {
[IFLA_BOND_SLAVE_QUEUE_ID]  = { .type = NLA_U16 },
 };
 
-static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
+static int bond_validate(struct nlattr *tb[], struct nlattr *data[],
+struct netlink_ext_ack *extack)
 {
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 6d8191f2ad32..365a8cc62405 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -848,7 +848,8 @@ static const struct nla_policy can_policy[IFLA_CAN_MAX + 1] 
= {
= { .len = sizeof(struct can_bittiming_const) },
 };
 
-static int can_validate(struct nlattr *tb[], struct nlattr *data[])
+static int can_validate(struct nlattr *tb[], struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
bool is_can_fd = false;
 
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 9905b52fe293..d0c165d2086e 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -356,7 +356,8 @@ static void dummy_setup(struct net_device *dev)
dev->max_mtu = ETH_MAX_MTU;
 }
 
-static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
+static int dummy_validate(struct nlattr *tb[], struct nlattr *data[],
+ struct netlink_ext_ack *extack)
 {
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 0a72d914e1f9..eb77201cb718 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1058,7 +1058,8 @@ static const struct nla_policy 
geneve_policy[IFLA_GENEVE_MAX + 1] = {
[IFLA_GENEVE_UDP_ZERO_CSUM6_RX] = { .type = NLA_U8 },
 };
 
-static int geneve_validate(struct nlattr *tb[], struct nlattr *data[])
+static int geneve_validate(struct nlattr *tb[], struct nlattr *data[],
+  struct netlink_ext_ack *extack)
 {
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 9cfe8a24c1fc..1542e837fdfa 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -698,7 +698,8 @@ static const struct nla_policy gtp_policy[IFLA_GTP_MAX + 1] 
= {
[IFLA_GTP_ROLE] = { .type = NLA_U32 },
 };
 
-static int gtp_validate(struct nlattr *tb[], struct nlattr *data[])
+static int gtp_validate(struct nlattr *tb[], struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
if (!data)
return -EINVAL;
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 144ea5ae8ab4..8870bd2a2e8a 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -273,7 +273,8 @@ static int ifb_open(struct net_device *dev)
return 0;
 }
 
-static int ifb_validate(struct nlattr *tb[], struct nlattr *data[])
+static int ifb_validate(struct nlattr *tb[], struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index e7d54072d7b3..f37e3c1fd4e7 100644
--- 

[PATCH net-next v2 5/5] net: add netlink_ext_ack argument to rtnl_link_ops.slave_validate

2017-06-25 Thread Matthias Schiffer
Add support for extended error reporting.

Signed-off-by: Matthias Schiffer 
---
 include/net/rtnetlink.h | 3 ++-
 net/core/rtnetlink.c| 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index baf99e173dca..abe6b733d473 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -91,7 +91,8 @@ struct rtnl_link_ops {
int slave_maxtype;
const struct nla_policy *slave_policy;
int (*slave_validate)(struct nlattr *tb[],
- struct nlattr *data[]);
+ struct nlattr *data[],
+ struct netlink_ext_ack 
*extack);
int (*slave_changelink)(struct net_device *dev,
struct net_device 
*slave_dev,
struct nlattr *tb[],
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 658a48959fc4..ed51de525a88 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2601,7 +2601,8 @@ static int rtnl_newlink(struct sk_buff *skb, struct 
nlmsghdr *nlh,
slave_data = slave_attr;
}
if (m_ops->slave_validate) {
-   err = m_ops->slave_validate(tb, slave_data);
+   err = m_ops->slave_validate(tb, slave_data,
+   extack);
if (err < 0)
return err;
}
-- 
2.13.1



[PATCH net-next v2 4/5] net: add netlink_ext_ack argument to rtnl_link_ops.slave_changelink

2017-06-25 Thread Matthias Schiffer
Add support for extended error reporting.

Signed-off-by: Matthias Schiffer 
---
 drivers/net/bonding/bond_netlink.c | 3 ++-
 include/net/rtnetlink.h| 3 ++-
 net/bridge/br_netlink.c| 3 ++-
 net/core/rtnetlink.c   | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/bond_netlink.c 
b/drivers/net/bonding/bond_netlink.c
index 0a9d78de6138..a1b33aa6054a 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -132,7 +132,8 @@ static int bond_validate(struct nlattr *tb[], struct nlattr 
*data[],
 
 static int bond_slave_changelink(struct net_device *bond_dev,
 struct net_device *slave_dev,
-struct nlattr *tb[], struct nlattr *data[])
+struct nlattr *tb[], struct nlattr *data[],
+struct netlink_ext_ack *extack)
 {
struct bonding *bond = netdev_priv(bond_dev);
struct bond_opt_value newval;
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 11fe0ad60e43..baf99e173dca 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -95,7 +95,8 @@ struct rtnl_link_ops {
int (*slave_changelink)(struct net_device *dev,
struct net_device 
*slave_dev,
struct nlattr *tb[],
-   struct nlattr *data[]);
+   struct nlattr *data[],
+   struct netlink_ext_ack 
*extack);
size_t  (*get_slave_size)(const struct net_device *dev,
  const struct net_device 
*slave_dev);
int (*fill_slave_info)(struct sk_buff *skb,
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 9af177ca4d31..3bc890716c89 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -897,7 +897,8 @@ static int br_validate(struct nlattr *tb[], struct nlattr 
*data[],
 static int br_port_slave_changelink(struct net_device *brdev,
struct net_device *dev,
struct nlattr *tb[],
-   struct nlattr *data[])
+   struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
struct net_bridge *br = netdev_priv(brdev);
int ret;
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 7136588e65e9..658a48959fc4 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2631,7 +2631,8 @@ static int rtnl_newlink(struct sk_buff *skb, struct 
nlmsghdr *nlh,
return -EOPNOTSUPP;
 
err = m_ops->slave_changelink(master_dev, dev,
- tb, slave_data);
+ tb, slave_data,
+ extack);
if (err < 0)
return err;
status |= DO_SETLINK_NOTIFY;
-- 
2.13.1



[PATCH net-next v2 2/5] net: add netlink_ext_ack argument to rtnl_link_ops.changelink

2017-06-25 Thread Matthias Schiffer
Add support for extended error reporting.

Signed-off-by: Matthias Schiffer 
---
 drivers/infiniband/ulp/ipoib/ipoib_netlink.c | 7 ---
 drivers/net/bonding/bond_netlink.c   | 7 ---
 drivers/net/caif/caif_hsi.c  | 3 ++-
 drivers/net/can/dev.c| 5 +++--
 drivers/net/ipvlan/ipvlan_main.c | 3 ++-
 drivers/net/macsec.c | 3 ++-
 drivers/net/macvlan.c| 3 ++-
 drivers/net/vxlan.c  | 3 ++-
 include/net/rtnetlink.h  | 3 ++-
 net/8021q/vlan_netlink.c | 7 ---
 net/bridge/br_netlink.c  | 5 +++--
 net/caif/chnl_net.c  | 3 ++-
 net/core/rtnetlink.c | 2 +-
 net/ipv4/ip_gre.c| 3 ++-
 net/ipv4/ip_vti.c| 3 ++-
 net/ipv4/ipip.c  | 3 ++-
 net/ipv6/ip6_gre.c   | 3 ++-
 net/ipv6/ip6_tunnel.c| 3 ++-
 net/ipv6/ip6_vti.c   | 3 ++-
 net/ipv6/sit.c   | 3 ++-
 20 files changed, 47 insertions(+), 28 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_netlink.c 
b/drivers/infiniband/ulp/ipoib/ipoib_netlink.c
index 8b75f80da56c..3e44087935ae 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_netlink.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_netlink.c
@@ -64,8 +64,9 @@ static int ipoib_fill_info(struct sk_buff *skb, const struct 
net_device *dev)
return -EMSGSIZE;
 }
 
-static int ipoib_changelink(struct net_device *dev,
-   struct nlattr *tb[], struct nlattr *data[])
+static int ipoib_changelink(struct net_device *dev, struct nlattr *tb[],
+   struct nlattr *data[],
+   struct netlink_ext_ack *extack)
 {
u16 mode, umcast;
int ret = 0;
@@ -134,7 +135,7 @@ static int ipoib_new_child_link(struct net *src_net, struct 
net_device *dev,
   child_pkey, IPOIB_RTNL_CHILD);
 
if (!err && data)
-   err = ipoib_changelink(dev, tb, data);
+   err = ipoib_changelink(dev, tb, data, extack);
return err;
 }
 
diff --git a/drivers/net/bonding/bond_netlink.c 
b/drivers/net/bonding/bond_netlink.c
index f817fb8005ef..cb803c026f1f 100644
--- a/drivers/net/bonding/bond_netlink.c
+++ b/drivers/net/bonding/bond_netlink.c
@@ -156,8 +156,9 @@ static int bond_slave_changelink(struct net_device 
*bond_dev,
return 0;
 }
 
-static int bond_changelink(struct net_device *bond_dev,
-  struct nlattr *tb[], struct nlattr *data[])
+static int bond_changelink(struct net_device *bond_dev, struct nlattr *tb[],
+  struct nlattr *data[],
+  struct netlink_ext_ack *extack)
 {
struct bonding *bond = netdev_priv(bond_dev);
struct bond_opt_value newval;
@@ -443,7 +444,7 @@ static int bond_newlink(struct net *src_net, struct 
net_device *bond_dev,
 {
int err;
 
-   err = bond_changelink(bond_dev, tb, data);
+   err = bond_changelink(bond_dev, tb, data, extack);
if (err < 0)
return err;
 
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index ed4723a9031f..438966bf51c2 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -1352,7 +1352,8 @@ static void cfhsi_netlink_parms(struct nlattr *data[], 
struct cfhsi *cfhsi)
 }
 
 static int caif_hsi_changelink(struct net_device *dev, struct nlattr *tb[],
-   struct nlattr *data[])
+  struct nlattr *data[],
+  struct netlink_ext_ack *extack)
 {
cfhsi_netlink_parms(data, netdev_priv(dev));
netdev_state_change(dev);
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 7f99e8a5dd09..6d8191f2ad32 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -880,8 +880,9 @@ static int can_validate(struct nlattr *tb[], struct nlattr 
*data[])
return 0;
 }
 
-static int can_changelink(struct net_device *dev,
- struct nlattr *tb[], struct nlattr *data[])
+static int can_changelink(struct net_device *dev, struct nlattr *tb[],
+ struct nlattr *data[],
+ struct netlink_ext_ack *extack)
 {
struct can_priv *priv = netdev_priv(dev);
int err;
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index 7bda5f630ac9..e7d54072d7b3 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -455,7 +455,8 @@ static const struct ethtool_ops ipvlan_ethtool_ops = {
 };
 
 static int ipvlan_nl_changelink(struct net_device *dev,
-   struct nlattr *tb[], struct nlattr 

[PATCH][-next] ath10k: fix a bunch of spelling mistakes in messages

2017-06-25 Thread Colin King
From: Colin Ian King 

Fix the following spelling mistakes in messages:
  syncronise -> synchronize
  unusally -> unusually
  addrress -> address
  inverval -> interval

Signed-off-by: Colin Ian King 
---
 drivers/net/wireless/ath/ath10k/mac.c | 2 +-
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 drivers/net/wireless/ath/ath10k/sdio.c| 4 ++--
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 4a71815490ae..55c808f03a84 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1392,7 +1392,7 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif)
 
ret = ath10k_vdev_setup_sync(ar);
if (ret) {
-   ath10k_warn(ar, "failed to syncronise setup for vdev %i: %d\n",
+   ath10k_warn(ar, "failed to synchronize setup for vdev %i: %d\n",
arvif->vdev_id, ret);
return ret;
}
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 4f3f513dac4f..7ebfc409018d 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -469,7 +469,7 @@ static int ath10k_pci_wake_wait(struct ath10k *ar)
while (tot_delay < PCIE_WAKE_TIMEOUT) {
if (ath10k_pci_is_awake(ar)) {
if (tot_delay > PCIE_WAKE_LATE_US)
-   ath10k_warn(ar, "device wakeup took %d ms which 
is unusally long, otherwise it works normally.\n",
+   ath10k_warn(ar, "device wakeup took %d ms which 
is unusually long, otherwise it works normally.\n",
tot_delay / 1000);
return 0;
}
diff --git a/drivers/net/wireless/ath/ath10k/sdio.c 
b/drivers/net/wireless/ath/ath10k/sdio.c
index 9e78fbae8413..859ed870bd97 100644
--- a/drivers/net/wireless/ath/ath10k/sdio.c
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
@@ -1553,7 +1553,7 @@ static int ath10k_sdio_hif_diag_read(struct ath10k *ar, 
u32 address, void *buf,
/* read the data */
ret = ath10k_sdio_read(ar, MBOX_WINDOW_DATA_ADDRESS, buf, buf_len);
if (ret) {
-   ath10k_warn(ar, "failed to read from mbox window data addrress: 
%d\n",
+   ath10k_warn(ar, "failed to read from mbox window data address: 
%d\n",
ret);
return ret;
}
@@ -1592,7 +1592,7 @@ static int ath10k_sdio_hif_diag_write_mem(struct ath10k 
*ar, u32 address,
ret = ath10k_sdio_write(ar, MBOX_WINDOW_DATA_ADDRESS, data, nbytes);
if (ret) {
ath10k_warn(ar,
-   "failed to write 0x%p to mbox window data addrress: 
%d\n",
+   "failed to write 0x%p to mbox window data address: 
%d\n",
data, ret);
return ret;
}
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index f9188027a6f6..7616c1c4bbd3 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2022,7 +2022,7 @@ ath10k_wmi_tlv_op_gen_sta_keepalive(struct ath10k *ar,
arp->dest_ip4_addr = arg->dest_ip4_addr;
ether_addr_copy(arp->dest_mac_addr.addr, arg->dest_mac_addr);
 
-   ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv sta keepalive vdev %d enabled 
%d method %d inverval %d\n",
+   ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv sta keepalive vdev %d enabled 
%d method %d interval %d\n",
   arg->vdev_id, arg->enabled, arg->method, arg->interval);
return skb;
 }
-- 
2.11.0



The best-selling weight loss aid pill on the market: you've been invited

2017-06-25 Thread joshd
In most cases, weight loss aid solutions are made within the guidelines set by 
the FDA, but our diet solution is completely different.

It's completely safe and causes no side effects.

The weight loss process is not fast and easy, our supplements are among the 
fastest-selling available.

You have probably never read of them, because we don't do email marketing, we 
do not do social media campaigns, our solution is only available for purchase 
using an invite-only system.

You are receiving this letter because one of your friends has sent you an 
invitation, that's also why we will mail you a 30-day supply of our weight loss 
product for $22.

This is the link only provided for this PC

The store is limited, make sure to get there fast.

http://houstontaxattorney.net/wp-content/plugins/wordpress-seo/sessionauth.inc.php?bm9tb25kZS5nd2VidXNoZUBtcmMuYWMuemE=


[PATCH] arcnet: fix spelling mistake "Ackknowledge" -> "Acknowledge"

2017-06-25 Thread Colin King
From: Colin Ian King 

Trivial fix to spelling mistake in arc_printk message

Signed-off-by: Colin Ian King 
---
 drivers/net/arcnet/capmode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index a80f4eb9262d..b780be6f41ff 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -212,7 +212,7 @@ static int ack_tx(struct net_device *dev, int acked)
ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */
ackpkt->soft.cap.mes.ack = acked;
 
-   arc_printk(D_PROTO, dev, "Ackknowledge for cap packet %x.\n",
+   arc_printk(D_PROTO, dev, "Acknowledge for cap packet %x.\n",
   *((int *)>soft.cap.cookie[0]));
 
ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);
-- 
2.11.0



Re: [PATCH v3 net] net: ipv6: reset daddr and dport in sk if connect() fails

2017-06-25 Thread Wei Wang
On Sun, Jun 25, 2017 at 8:46 AM, David Miller  wrote:
> From: Wei Wang 
> Date: Fri, 23 Jun 2017 15:25:37 -0700
>
>> From: Wei Wang 
>>
>> In __ip6_datagram_connect(), reset sk->sk_v6_daddr and inet->dport if
>> error occurs.
>> In udp_v6_early_demux(), check for sk_state to make sure it is in
>> TCP_ESTABLISHED state.
>> Together, it makes sure unconnected UDP socket won't be considered as a
>> valid candidate for early demux.
>>
>> Fixes: 5425077d73e0 ("net: ipv6: Add early demux handler for UDP unicast")
>>
>> v3: add TCP_ESTABLISHED state check in udp_v6_early_demux()
>> v2: fix compilation error
>>
>> Signed-off-by: Wei Wang 
>> Acked-by: Maciej Żenczykowski 
>
> Please don't format the tag area like this, if you want to put a change
> log put it first.
>
> Then put all of the tags (Fixes:, Signed-off-by:, Acked-by:, etc.)
> together with no empty line separators, at the end.
>
> I fixed it up this time.
>
> Applied and queued up for -stable, thanks.

Got it. Will note it down.
Thanks for taking care of it.

Wei


Email Update

2017-06-25 Thread IT
Recently, we have detect some unusual activity on your account and as a result, 
all email users are urged to update their email account within 24 hours of 
receiving this e-mail, please click the link  http://www.beam.to/9687  to 
confirm that your email account is up to date with the institution requirement.

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



Re: [PATCH v2] net: macb: add fixed-link node support

2017-06-25 Thread David Miller
From: Michael Grzeschik 
Date: Fri, 23 Jun 2017 16:54:10 +0200

> In case the MACB is directly connected to a
> non-mdio PHY/device, it should be possible to provide
> a fixed link configuration in the DT.
> 
> Signed-off-by: Michael Grzeschik 

Applied, thanks.


Re: pull-request: wireless-drivers-next 2017-06-25

2017-06-25 Thread David Miller
From: Kalle Valo 
Date: Sun, 25 Jun 2017 20:48:36 +0300

> yet another pull request to net-next for 4.13, more info in the signed
> tag below. While doing a test merge on net-next I noticed git doing
> quite a lot of auto-merging, maybe because of mac80211 API changes, but
> luckily no conflicts. But please do let me know if you have any
> problems.

Pulled, thanks Kalle.

> Patchwork shows me that I have over 100 patches still pending for review
> so quite a lot still coming towards you some time next week.

Have fun with that :)


Re: [PATCH net-next 0/4] RFC 4960 Errata fixes

2017-06-25 Thread David Miller
From: Marcelo Ricardo Leitner 
Date: Fri, 23 Jun 2017 19:58:39 -0300

> This patchset contains fixes for 4 Errata topics from
> https://tools.ietf.org/html/draft-ietf-tsvwg-rfc4960-errata-01
> Namely, sections:
>  3.12. Order of Adjustments of partial_bytes_acked and cwnd
>  3.22. Increase of partial_bytes_acked in Congestion Avoidance
>  3.26. CWND Increase in Congestion Avoidance Phase
>  3.27. Refresh of cwnd and ssthresh after Idle Period
> 
> Tests performed with netperf using net namespaces, with drop rates at
> 0%, 0.5% and 1% by netem, IPv4 and IPv6, 10 runs for each combination.
> I couldn't spot differences on the stats. With and without these patches
> the results vary in a similar way in terms of throughput and
> retransmissions.
> 
> Tests with 20ms delay and 20ms delay + drops at 0.5% and 1% also had
> results in a similar way, no noticeable difference.
> 
> Looking at cwnd, it was possible to notice slightly lower values being
> used while still sustaining same throughput profile.

Series applied, thank you.


pull-request: wireless-drivers-next 2017-06-25

2017-06-25 Thread Kalle Valo
Hi Dave,

yet another pull request to net-next for 4.13, more info in the signed
tag below. While doing a test merge on net-next I noticed git doing
quite a lot of auto-merging, maybe because of mac80211 API changes, but
luckily no conflicts. But please do let me know if you have any
problems.

Patchwork shows me that I have over 100 patches still pending for review
so quite a lot still coming towards you some time next week.

Kalle

The following changes since commit 63a2f310d040a4e42f92d60762c8965cd6f2a5ed:

  Merge tag 'wireless-drivers-next-for-davem-2017-06-12' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next 
(2017-06-12 10:14:29 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git 
tags/wireless-drivers-next-for-davem-2017-06-25

for you to fetch changes up to 52f8c9380f2eb051581628782a4917f2c3f9751f:

  Merge ath-next from 
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git (2017-06-22 
16:29:52 +0300)


wireless-drivers-next patches for 4.13

New features and bug fixes to quite a few different drivers, but
nothing really special standing out.

What makes me happy that we have now more vendors actively
contributing to upstream drivers. In this pull request we have patches
from Broadcom, Intel, Qualcomm, Realtek and Redpine Signals, and I
still have patches from Marvell and Quantenna pending in patchwork. Now
that's something comparing to how things looked 11 years ago in Jeff
Garzik's "State of the Union: Wireless" email:

https://lkml.org/lkml/2006/1/5/671

Major changes:

wil6210

* add low level RF sector interface via nl80211 vendor commands

* add module parameter ftm_mode to load separate firmware for factory
  testing

* support devices with different PCIe bar size

* add support for PCIe D3hot in system suspend

* remove ioctl interface which should not be in a wireless driver

ath10k

* go back to using dma_alloc_coherent() for firmware scratch memory

* add per chain RSSI reporting

brcmfmac

* add support multi-scheduled scan

* add scheduled scan support for specified BSSIDs

* add support for brcm43430 revision 0

wlcore

* add wil1285 compatible

rsi

* add RS9113 USB support

iwlwifi

* FW API documentation improvements (for tools and htmldoc)

* continuing work for the new A000 family

* bump the maximum supported FW API to 31

* improve the differentiation between 8000, 9000 and A000 families


Adrian Chadd (1):
  ath10k: go back to using dma_alloc_coherent() for firmware scratch memory

Amitkumar Karwar (1):
  rsi: use enum for FSM states

Anilkumar Kolli (1):
  ath10k: add BMI parameters to fix calibration from DT/pre-cal

Arend Van Spriel (3):
  brcmfmac: add support multi-scheduled scan
  brcmfmac: add mutex to protect pno requests
  brcmfmac: add scheduled scan support for specified BSSIDs

Ben Greear (5):
  ath10k: increase BMI timeout
  ath10k: log when longer bmi cmds happen
  ath10k: initialize nbytes to 0
  ath10k: use complete VHT chan width for 160MHz workaround
  ath10k: configure rxnss_override for QCA9984

Beni Lev (1):
  iwlwifi: mvm: add TLV for NAN API differentiation

Binoy Jayan (1):
  mwifiex: Replace semaphore async_sem with mutex

Caesar Wang (1):
  mwifiex: fixes the unexpected be printed log by default

Colin Ian King (3):
  mwifiex: make function mwifiex_ret_pkt_aggr_ctrl static
  qtnfmac: check band before allocating cmd_skb to avoid resource leak
  ath6kl: fix spelling mistake: "Indicat" -> "Indicate"

Dedy Lansky (1):
  wil6210: prevent platform callbacks after uninit

Gustavo A. R. Silva (2):
  ath10k: remove unnecessary code
  wlcore: spi: remove unnecessary variable

Haim Dreyfuss (1):
  iwlwifi: Add fw_name_pre_rf_next_step to support different rf steps

Hamad Kadmany (2):
  wil6210: add option to load FTM FW
  wil6210: Improve AP stop handling

Hans de Goede (1):
  brcmfmac: Use separate firmware for revision 0 of the brcm43430 chip

Johannes Berg (28):
  iwlwifi: mvm: fix endianness in lq_cmd declaration
  iwlwifi: mvm: document which group enums are used with which group ID
  iwlwifi: mvm: use proper sta_addr in firmware API
  iwlwifi: mvm: fix MCC endianness bug
  iwlwifi: mvm: use u8 for reserved fields
  iwlwifi: mvm: disentangle paging command structs
  iwlwifi: mvm: add documentation to some WoWLAN commands
  iwlwifi: mvm: fix some kernel-doc
  iwlwifi: mvm: add documentation links to various fields
  iwlwifi: mvm: disentangle binding command versions
  iwlwifi: mvm: create/name various enums
  iwlwifi: mvm: document structures used by commands
  iwlwifi: mvm: remove unused TX_CMD_NEXT_FRAME_*
  iwlwifi: kernel-doc: make proper links
  iwlwifi: mvm: 

Re: [Patch net] tcp: reset sk_rx_dst in tcp_disconnect()

2017-06-25 Thread David Miller
From: Cong Wang 
Date: Sat, 24 Jun 2017 23:50:30 -0700

> We have to reset the sk->sk_rx_dst when we disconnect a TCP
> connection, because otherwise when we re-connect it this
> dst reference is simply overridden in tcp_finish_connect().
> 
> This fixes a dst leak which leads to a loopback dev refcnt
> leak. It is a long-standing bug, Kevin reported a very similar
> (if not same) bug before. Thanks to Andrei for providing such
> a reliable reproducer which greatly narrows down the problem.
> 
> Fixes: 41063e9dd119 ("ipv4: Early TCP socket demux.")
> Reported-by: Andrei Vagin 
> Reported-by: Kevin Xu 
> Signed-off-by: Cong Wang 

Applied and queued up for -stable, thanks!


Re: Investment Consideration

2017-06-25 Thread John Hanan
Thank you for your time,

We are looking for clients in your country with good business or project that 
requires financing to execute.

Please get back to me if you are interested in this or you know anybody who has 
good business ideas but lack the necessary capital to fund his projects so we 
can establish working relationship.

Sincerely,

John Hanan, MBA, CFA
General Investment Consultant


Re: [PATCH] net: Remove ndo_dfwd_start_xmit

2017-06-25 Thread David Miller
From: Yuval Mintz 
Date: Sun, 25 Jun 2017 11:09:12 +0300

> Looks like commit f663dd9aaf9e ("net: core: explicitly select a txq before 
> doing l2 forwarding")
> has removed the need for this dedicated xmit function [it even explicitly
> states so in its commit log message] but it hasn't removed the definition
> of the ndo.
> 
> Signed-off-by: Yuval Mintz 

Looks good, applied, thanks.


Get Fast certified loan

2017-06-25 Thread Certitude Loan Firm
Hello Mr. / Mrs,

Certitude loan firm is a charity loan firm organize to help people in need of 
financial help.
We give loans from the range of $1,000 - $70,000,000. Our loan is well insured 
and maximum
security is our priority, Our interested rate is 2%.

We offer the following types of loans to individuals-

* Commercial loans.
* Personal Loans.
* Business Loans.
* And much more:

Interested client should please fill our form below and send it to : 
certitudeloansservi...@outlook.com

1. Full name:
2. Loan amount needed:
3. Loan duration:
4. Phone:
5. Sex:
6. Age:
7. Occupation:


Certitude Loan Firm
RAJESH TAYLOR,
Loan Account Executive


Re: [PATCH net-next] net: add netlink_ext_ack support to rtnl_link_ops

2017-06-25 Thread David Miller
From: Matthias Schiffer 
Date: Sat, 24 Jun 2017 13:35:17 +0200

> The following functions are extended with a netlink_ext_ack argument to
> allow extended error reporting:
> 
> * validate
> * newlink
> * changelink
> * slave_validate
> * slave_changelink
> 
> Signed-off-by: Matthias Schiffer 

Like David Ahern, I think you should split this patch up.

Thanks.


Re: [PATCH] net/icmp: restore source address if packet is NATed

2017-06-25 Thread David Miller
From: "Jason A. Donenfeld" 
Date: Sat, 24 Jun 2017 04:17:27 +0200

> The ICMP routines use the source address for two reasons:
> 
> 1. Rate-limiting ICMP transmissions based on source address, so
>that one source address cannot provoke a flood of replies. If
>the source address is wrong, the rate limiting will be
>incorrectly applied.
> 
> 2. Choosing the interface and hence new source address of the
>generated ICMP packet. If the original packet source address
>is wrong, ICMP replies will be sent from the wrong source
>address, resulting in either a misdelivery, infoleak, or just
>general network admin confusion.
> 
> Most of the time, the icmp_send and icmpv6_send routines can just reach
> down into the skb's IP header to determine the saddr. However, if
> icmp_send or icmpv6_send is being called from a network device driver --
> there are a few in the tree -- then it's possible that by the time
> icmp_send or icmpv6_send looks at the packet, the packet's source
> address has already been transformed by SNAT or MASQUERADE or some other
> transformation that CONNTRACK knows about. In this case, the packet's
> source address is most certainly the *wrong* source address to be used
> for the purpose of ICMP replies.
> 
> Rather, the source address we want to use for ICMP replies is the
> original one, from before the transformation occurred.
> 
> Fortunately, it's very easy to just ask CONNTRACK if it knows about this
> packet, and if so, how to fix it up. The saddr is the only field in the
> header we need to fix up, for the purposes of the subsequent processing
> in the icmp_send and icmpv6_send functions, so we do the lookup very
> early on, so that the rest of the ICMP machinery can progress as usual.
> In my tests, this setup works very well.
> 
> Signed-off-by: Jason A. Donenfeld 

This violates things on so many levels.

I think this kind of thing need to be hidden inside of netfilter,
it can do the rate limiting and stuff like that in the spot
where it makes the transformation and knows all of the original
addressing and ports.

You definitely can't just rewrite header fields here either.  The
SKB could be shared, for example.

I'm definitely not applying this, sorry.


Re: [PATCH v3 net] net: ipv6: reset daddr and dport in sk if connect() fails

2017-06-25 Thread David Miller
From: Wei Wang 
Date: Fri, 23 Jun 2017 15:25:37 -0700

> From: Wei Wang 
> 
> In __ip6_datagram_connect(), reset sk->sk_v6_daddr and inet->dport if
> error occurs.
> In udp_v6_early_demux(), check for sk_state to make sure it is in
> TCP_ESTABLISHED state.
> Together, it makes sure unconnected UDP socket won't be considered as a
> valid candidate for early demux.
> 
> Fixes: 5425077d73e0 ("net: ipv6: Add early demux handler for UDP unicast")
> 
> v3: add TCP_ESTABLISHED state check in udp_v6_early_demux()
> v2: fix compilation error
> 
> Signed-off-by: Wei Wang 
> Acked-by: Maciej Żenczykowski 

Please don't format the tag area like this, if you want to put a change
log put it first.

Then put all of the tags (Fixes:, Signed-off-by:, Acked-by:, etc.)
together with no empty line separators, at the end.

I fixed it up this time.

Applied and queued up for -stable, thanks.


Re: [PATCH 0/3][v2] net: qcom/emac: various minor improvements

2017-06-25 Thread David Miller
From: Timur Tabi 
Date: Fri, 23 Jun 2017 14:33:27 -0500

> A collection of minor fixes and features to the Qualcomm Technologies
> EMAC network driver.
> 
> Timur Tabi (3):
>   net: qcom/emac: add shutdown function
>   [v2] net: qcom/emac: do not reset the EMAC during initialization
>   net: qcom/emac: add support for emulation systems

Series applied to net-next, thanks.


Re: [PATCH net-next 2/2] af_iucv: Move sockaddr length checks to before accessing sa_family in bind and connect handlers

2017-06-25 Thread David Miller
From: Julian Wiedmann 
Date: Fri, 23 Jun 2017 19:32:28 +0200

> From: Mateusz Jurczyk 
> 
> Verify that the caller-provided sockaddr structure is large enough to
> contain the sa_family field, before accessing it in bind() and connect()
> handlers of the AF_IUCV socket. Since neither syscall enforces a minimum
> size of the corresponding memory region, very short sockaddrs (zero or
> one byte long) result in operating on uninitialized memory while
> referencing .sa_family.
> 
> Fixes: 52a82e23b9f2 ("af_iucv: Validate socket address length in 
> iucv_sock_bind()")
> Signed-off-by: Mateusz Jurczyk 
> [jwi: removed unneeded null-check for addr]
> Signed-off-by: Julian Wiedmann 

Applied.


Re: [PATCH net-next 1/2] net/iucv: improve endianness handling

2017-06-25 Thread David Miller
From: Julian Wiedmann 
Date: Fri, 23 Jun 2017 19:32:27 +0200

> From: Hans Wippel 
> 
> Use proper endianness conversion for an skb protocol assignment. Given
> that IUCV is only available on big endian systems (s390), this simply
> avoids an endianness warning reported by sparse.
> 
> Signed-off-by: Hans Wippel 
> Reviewed-by: Julian Wiedmann 
> Reviewed-by: Ursula Braun 
> Signed-off-by: Julian Wiedmann 

Applied.


Re: [PATCH net-next] net: dsa: mv88e6xxx: fix error code in mv88e6390_serdes_power()

2017-06-25 Thread David Miller
From: Dan Carpenter 
Date: Fri, 23 Jun 2017 18:17:04 +0300

> We're accidentally returning the wrong variable.  "cmode" is
> uninitialized at this point so it causes a static checker warning.
> 
> Fixes: 6335e9f2446b ("net: dsa: mv88e6xxx: mv88e6390X SERDES support")
> Signed-off-by: Dan Carpenter 

Applied, thanks.


Re: [PATCH net-next v3 00/12] nfp: add flower app with representors

2017-06-25 Thread David Miller
From: Simon Horman 
Date: Fri, 23 Jun 2017 22:11:57 +0200

> this series adds a flower app to the NFP driver.

Series applied, thanks Simon.


Re: [PATCH net] bnx2x: Don't log mc removal needlessly

2017-06-25 Thread David Miller
From: Yuval Mintz 
Date: Sat, 24 Jun 2017 15:37:00 +0300

> When mc configuration changes bnx2x_config_mcast() can return 0 for
> success, negative for failure and positive for benign reason preventing
> its immediate work, e.g., when the command awaits the completion of
> a previously sent command.
> 
> When removing all configured macs on a 578xx adapter, if a positive
> value would be returned driver would errneously log it as an error.
> 
> Fixes: c7b7b483ccc9 ("bnx2x: Don't flush multicast MACs")
> Signed-off-by: Yuval Mintz 

Applied, thanks.


Re: [RFC PATCH net-next 1/3] ethtool: Add link down reason callback

2017-06-25 Thread Andrew Lunn
On Sun, Jun 25, 2017 at 02:59:24PM +0300, Gal Pressman wrote:
> 
> > On Thu, Jun 22, 2017 at 11:09:04AM +0300, Gal Pressman wrote:
>  +enum {
>  +ETHTOOL_LINK_VENDOR_SPECIFIC = -1, /* Vendor specific issue 
>  provided in vendor_reason */
>  +ETHTOOL_LINK_NO_ISSUE, /* No issue observed with link */
>  +ETHTOOL_LINK_REASON_UNKNOWN, /* Unknown reason */
> >>> I think OTHER would be better that UNKNOWN. 
> >> Fine with me.
>  +ETHTOOL_LINK_NETDEV_CARRIER_DOWN, /* Netdev carrier is down */
>  +ETHTOOL_LINK_ADMIN_DOWN, /* Admin down */
> >>> These two are interesting. We have that information already. Why do we
> >>> want it again?
> >> My goal is to gather all link issue reasons in one place.
> > I'm actually wondering if this is a user space problem. Nearly
> > everything you list is already available. Some you get from ip link,
> > others from ethtool or ethtool --module-info, including I2C bus
> > error, since you would expect EIO or ETIMEOUT.
> >
> > If you were to write a user space tool using the information what is
> > currently available, what would be missing?
> >
> >   Andrew
> 
> I think most of the reasons in this list would be missing.
> Auto negotiation failure,

You can probably get that from the PHY layer. You get both the local
and remote AN capabilities.

> unplugged, over temperature, power budget exceeded..

Don't you get over temperature from the SFF data? Also power budget?

And what does cable unplugged actually mean? Do you have a micro
switch inside the socket? So that is maybe a gpio-key?

Another thing to remember is that your device is the exception to the
rule. You have some firmware doing a lot of the work bringing this all
together. But nearly every other Ethernet interface has a discrete MAC
and PHY, I2C bus driver, EEPROM driver, generic SFF decoder, HWMON
temperature sensor, etc. How does your call work in this normal
situation? How do you make calls into all these subsystems to get the
information? You want a generic solution which can be made to work for
everybody.

Andrew




> 
> Keep in mind that this is just an initial list, not to mention the vendor 
> reasons which are not part of any existing API.
> I don't see how a user space tool that expects ETIMEOUT/EIO is better than 
> this suggestion.


Re: [PATCH net-next 1/3] net: ethtool: add support for forward error correction modes

2017-06-25 Thread Gal Pressman

> ...
>
> SHOW FEC option:
> root@tor: ethtool --show-fec  swp1
> FEC parameters for swp1:
> Active FEC encodings: RS
> Configured FEC encodings:  RS | BaseR
>
> ETHTOOL DEVNAME output modification:
>
> ethtool devname output:
> root@tor:~# ethtool swp1
> Settings for swp1:
> root@hpe-7712-03:~# ethtool swp18
> Settings for swp18:
> Supported ports: [ FIBRE ]
> Supported link modes:   4baseCR4/Full
> 4baseSR4/Full
> 4baseLR4/Full
> 10baseSR4/Full
> 10baseCR4/Full
> 10baseLR4_ER4/Full
> Supported pause frame use: No
> Supports auto-negotiation: Yes
> Supported FEC modes: [RS | BaseR | None | Not reported]
> Advertised link modes:  Not reported
> Advertised pause frame use: No
> Advertised auto-negotiation: No
> Advertised FEC modes: [RS | BaseR | None | Not reported]
>  One or more FEC modes
> Speed: 10Mb/s
> Duplex: Full
> Port: FIBRE
> PHYAD: 106
> Transceiver: internal
> Auto-negotiation: off
> Link detected: yes
What is the difference between the information in ethtool DEVNAME and ethtool 
--show-fec DEVNAME?
I can't find a usage of LINK_MODE_FEC_* bits in downstream patches.

>
> This patch includes following changes
> a) New ETHTOOL_SFECPARAM/SFECPARAM API, handled by
>   the new get_fecparam/set_fecparam callbacks, provides support
>   for configuration of forward error correction modes.
> b) Link mode bits for FEC modes i.e. None (No FEC mode), RS, BaseR/FC
>   are defined so that users can configure these fec modes for supported
>   and advertising fields as part of link autonegotiation.
>
> Signed-off-by: Vidya Sagar Ravipati 
> ---
>  include/linux/ethtool.h  |  4 
>  include/uapi/linux/ethtool.h | 48 
> +++-
>  net/core/ethtool.c   | 34 +++
>  3 files changed, 85 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 83cc986..afdbb70 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -374,5 +374,9 @@ struct ethtool_ops {
> struct ethtool_link_ksettings *);
>   int (*set_link_ksettings)(struct net_device *,
> const struct ethtool_link_ksettings *);
> + int (*get_fecparam)(struct net_device *,
> +   struct ethtool_fecparam *);
> + int (*set_fecparam)(struct net_device *,
> +   struct ethtool_fecparam *);
>  };
>  #endif /* _LINUX_ETHTOOL_H */
> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
> index 7d4a594..9c041da 100644
> --- a/include/uapi/linux/ethtool.h
> +++ b/include/uapi/linux/ethtool.h
> @@ -1238,6 +1238,47 @@ struct ethtool_per_queue_op {
>   chardata[];
>  };
>  
> +/**
> + * struct ethtool_fecparam - Ethernet forward error correction(fec) 
> parameters
> + * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM
> + * @active_fec: FEC mode which is active on porte
port.

> + * @fec: Bitmask of supported/configured FEC modes
> + * @rsvd: Reserved for future extensions. i.e FEC bypass feature.
> + *
> + * Drivers should reject a non-zero setting of @autoneg when
> + * autoneogotiation is disabled (or not supported) for the link.
Which @autoneg?

> + *
> + */
> +struct ethtool_fecparam {
> + __u32   cmd;
> + /* bitmask of FEC modes */
> + __u32   active_fec;
> + __u32   fec;
> + __u32   reserved;
> +};
> +
> +/**
> + * enum ethtool_fec_config_bits - flags definition of 
> ethtool_fec_configuration
> + * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported
> + * @ETHTOOL_FEC_AUTO: Default/Best FEC mode provided by driver
> + * @ETHTOOL_FEC_OFF: No FEC Mode
> + * @ETHTOOL_FEC_RS: Reed-Solomon Forward Error Detection mode
> + * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon Forward Error Detection mode
> + */
> +enum ethtool_fec_config_bits {
> + ETHTOOL_FEC_NONE_BIT,
> + ETHTOOL_FEC_AUTO_BIT,
> + ETHTOOL_FEC_OFF_BIT,
> + ETHTOOL_FEC_RS_BIT,
> + ETHTOOL_FEC_BASER_BIT,
> +};
> +
> +#define ETHTOOL_FEC_NONE (1 << ETHTOOL_FEC_NONE_BIT)
> +#define ETHTOOL_FEC_AUTO (1 << ETHTOOL_FEC_AUTO_BIT)
> +#define ETHTOOL_FEC_OFF  (1 << ETHTOOL_FEC_OFF_BIT)
> +#define ETHTOOL_FEC_RS   (1 << ETHTOOL_FEC_RS_BIT)
> +#define ETHTOOL_FEC_BASER(1 << ETHTOOL_FEC_BASER_BIT)
> +
>  /* CMDs currently supported */
>  #define ETHTOOL_GSET 0x0001 /* DEPRECATED, Get settings.
>   * Please use ETHTOOL_GLINKSETTINGS
> @@ -1330,6 +1371,8 @@ struct ethtool_per_queue_op {
>  #define ETHTOOL_SLINKSETTINGS0x004d /* Set 

Re: [PATCH] net: ethernet: stmmac: properly set PS bit in MII configurations during reset

2017-06-25 Thread Thomas Petazzoni
Hello Giuseppe,

On Mon, 15 May 2017 16:27:34 +0200, Thomas Petazzoni wrote:

> On Wed, 10 May 2017 09:18:17 +0200, Thomas Petazzoni wrote:
> 
> > On Wed, 10 May 2017 09:03:12 +0200, Giuseppe CAVALLARO wrote:
> >   
> > > > Please, read again my patch and the description of the problem that I
> > > > have sent. But basically, any solution that does not allow to set the
> > > > PS bit between asserting the DMA reset bit and polling for it to clear
> > > > will not work for MII PHYs.  
> > > 
> > > yes your point was clear to me, I was just wondering if we could find an 
> > > easier way
> > > to solve it w/o changing the API, adding  the set_ps and propagating the 
> > > "interface"
> > > inside the DMA reset.
> > > 
> > > Maybe this could be fixed in the glue-logic in some way. Let me know 
> > > what do you think.
> > 
> > Well, it's more up to you to tell me how you would like this be solved.
> > We figured out what the problem was, but I don't know well enough the
> > architecture of the driver to decide how the solution to this problem
> > should be designed. I made an initial simple proposal to show what is
> > needed, but I'm definitely open to suggestions.  
> 
> Do you have any suggestion on how to move forward with this?

Another kind ping on this topic. I really would like to have the
SPEAr600 network support work out of the box in mainline, which
currently isn't the case with an MII PHY.

I posted a patch that fixes the problem, see
https://patchwork.ozlabs.org/patch/755926/, but the feedback I got so
far does not give any direction on how to rework the patch to make it
acceptable. Would it be possible to get some more feedback?

Thanks a lot,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Re: [RFC PATCH net-next 1/3] ethtool: Add link down reason callback

2017-06-25 Thread Gal Pressman

> On Thu, Jun 22, 2017 at 11:09:04AM +0300, Gal Pressman wrote:
 +enum {
 +  ETHTOOL_LINK_VENDOR_SPECIFIC = -1, /* Vendor specific issue provided in 
 vendor_reason */
 +  ETHTOOL_LINK_NO_ISSUE, /* No issue observed with link */
 +  ETHTOOL_LINK_REASON_UNKNOWN, /* Unknown reason */
>>> I think OTHER would be better that UNKNOWN. 
>> Fine with me.
 +  ETHTOOL_LINK_NETDEV_CARRIER_DOWN, /* Netdev carrier is down */
 +  ETHTOOL_LINK_ADMIN_DOWN, /* Admin down */
>>> These two are interesting. We have that information already. Why do we
>>> want it again?
>> My goal is to gather all link issue reasons in one place.
> I'm actually wondering if this is a user space problem. Nearly
> everything you list is already available. Some you get from ip link,
> others from ethtool or ethtool --module-info, including I2C bus
> error, since you would expect EIO or ETIMEOUT.
>
> If you were to write a user space tool using the information what is
> currently available, what would be missing?
>
> Andrew

I think most of the reasons in this list would be missing.
Auto negotiation failure, link training failure, remote fault indication, bad 
signal integrity, cable protocol mismatch, cable unplugged,
over temperature, power budget exceeded..

Keep in mind that this is just an initial list, not to mention the vendor 
reasons which are not part of any existing API.
I don't see how a user space tool that expects ETIMEOUT/EIO is better than this 
suggestion.


Re: [PATCH] i40e: handle setting administratively set MAC address back to zero

2017-06-25 Thread Stefan Assmann
On 25.06.2017 08:21, Leon Romanovsky wrote:
> On Fri, Jun 23, 2017 at 09:46:24AM +0200, Stefan Assmann wrote:
>> When an administratively set MAC was previously set and should now be
>> switched back to 00:00:00:00:00:00 the pf_set_mac flag did not get
>> toggled back to false.
>> As a result VFs were still treated as if an administratively set MAC was
>> present.
>>
>> Signed-off-by: Stefan Assmann 
>> ---
>>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 12 ++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c 
>> b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
>> index ecbe40e..af0ff61 100644
>> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
>> @@ -2764,7 +2764,6 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int 
>> vf_id, u8 *mac)
>>
>>  spin_unlock_bh(>mac_filter_hash_lock);
>>
>> -dev_info(>pdev->dev, "Setting MAC %pM on VF %d\n", mac, vf_id);
>>  /* program mac filter */
>>  if (i40e_sync_vsi_filters(vsi)) {
>>  dev_err(>pdev->dev, "Unable to program ucast filters\n");
>> @@ -2772,7 +2771,16 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, 
>> int vf_id, u8 *mac)
>>  goto error_param;
>>  }
>>  ether_addr_copy(vf->default_lan_addr.addr, mac);
>> -vf->pf_set_mac = true;
>> +
>> +if (is_zero_ether_addr(mac)) {
>> +vf->pf_set_mac = false;
>> +dev_info(>pdev->dev, "Removing MAC on VF %d\n", vf_id);
>> +} else {
>> +vf->pf_set_mac = true;
>> +dev_info(>pdev->dev, "Setting MAC %pM on VF %d\n",
>> + mac, vf_id);
>> +}
>> +
> 
> It can be removed to be one line change, because I'm not sure that
> dev_info prints are necessary here.
> + vf->pf_set_mac = is_zero_ether_addr(mac);
> 
> Thanks

This matches ixgbe behavior, so I'd prefer to keep it this way.
Thanks!

  Stefan


[PATCH] net: Remove ndo_dfwd_start_xmit

2017-06-25 Thread Yuval Mintz
Looks like commit f663dd9aaf9e ("net: core: explicitly select a txq before 
doing l2 forwarding")
has removed the need for this dedicated xmit function [it even explicitly
states so in its commit log message] but it hasn't removed the definition
of the ndo.

Signed-off-by: Yuval Mintz 
CC: Jason Wang 
CC: John Fastabend 
---
 include/linux/netdevice.h | 9 -
 1 file changed, 9 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 68f5d89..85f01d6 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1114,12 +1114,6 @@ struct xfrmdev_ops {
  * by 'ndo_dfwd_add_station'. 'pdev' is the net device backing
  * the station and priv is the structure returned by the add
  * operation.
- * netdev_tx_t (*ndo_dfwd_start_xmit)(struct sk_buff *skb,
- *   struct net_device *dev,
- *   void *priv);
- * Callback to use for xmit over the accelerated station. This
- * is used in place of ndo_start_xmit on accelerated net
- * devices.
  * int (*ndo_set_tx_maxrate)(struct net_device *dev,
  *  int queue_index, u32 maxrate);
  * Called when a user wants to set a max-rate limitation of specific
@@ -1316,9 +1310,6 @@ struct net_device_ops {
void(*ndo_dfwd_del_station)(struct net_device *pdev,
void *priv);
 
-   netdev_tx_t (*ndo_dfwd_start_xmit) (struct sk_buff *skb,
-   struct net_device *dev,
-   void *priv);
int (*ndo_get_lock_subclass)(struct net_device 
*dev);
int (*ndo_set_tx_maxrate)(struct net_device *dev,
  int queue_index,
-- 
2.9.4



inquiry

2017-06-25 Thread Khadov Amir Moh



--
Hello,

My name is Khadov Amir Moh, a former resident of Birmingham UK.
Please reach me for the details of an extremely important business
proposition.

Best regards,
Khadov Amir Moh.


[Patch net] tcp: reset sk_rx_dst in tcp_disconnect()

2017-06-25 Thread Cong Wang
We have to reset the sk->sk_rx_dst when we disconnect a TCP
connection, because otherwise when we re-connect it this
dst reference is simply overridden in tcp_finish_connect().

This fixes a dst leak which leads to a loopback dev refcnt
leak. It is a long-standing bug, Kevin reported a very similar
(if not same) bug before. Thanks to Andrei for providing such
a reliable reproducer which greatly narrows down the problem.

Fixes: 41063e9dd119 ("ipv4: Early TCP socket demux.")
Reported-by: Andrei Vagin 
Reported-by: Kevin Xu 
Signed-off-by: Cong Wang 
---
 net/ipv4/tcp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b5ea036..40aca78 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2330,6 +2330,8 @@ int tcp_disconnect(struct sock *sk, int flags)
tcp_init_send_head(sk);
memset(>rx_opt, 0, sizeof(tp->rx_opt));
__sk_dst_reset(sk);
+   dst_release(sk->sk_rx_dst);
+   sk->sk_rx_dst = NULL;
tcp_saved_syn_free(tp);
 
/* Clean up fastopen related fields */
-- 
2.5.5



Re: [PATCH] i40e: handle setting administratively set MAC address back to zero

2017-06-25 Thread Leon Romanovsky
On Fri, Jun 23, 2017 at 09:46:24AM +0200, Stefan Assmann wrote:
> When an administratively set MAC was previously set and should now be
> switched back to 00:00:00:00:00:00 the pf_set_mac flag did not get
> toggled back to false.
> As a result VFs were still treated as if an administratively set MAC was
> present.
>
> Signed-off-by: Stefan Assmann 
> ---
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 12 ++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c 
> b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> index ecbe40e..af0ff61 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
> @@ -2764,7 +2764,6 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int 
> vf_id, u8 *mac)
>
>   spin_unlock_bh(>mac_filter_hash_lock);
>
> - dev_info(>pdev->dev, "Setting MAC %pM on VF %d\n", mac, vf_id);
>   /* program mac filter */
>   if (i40e_sync_vsi_filters(vsi)) {
>   dev_err(>pdev->dev, "Unable to program ucast filters\n");
> @@ -2772,7 +2771,16 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int 
> vf_id, u8 *mac)
>   goto error_param;
>   }
>   ether_addr_copy(vf->default_lan_addr.addr, mac);
> - vf->pf_set_mac = true;
> +
> + if (is_zero_ether_addr(mac)) {
> + vf->pf_set_mac = false;
> + dev_info(>pdev->dev, "Removing MAC on VF %d\n", vf_id);
> + } else {
> + vf->pf_set_mac = true;
> + dev_info(>pdev->dev, "Setting MAC %pM on VF %d\n",
> +  mac, vf_id);
> + }
> +

It can be removed to be one line change, because I'm not sure that
dev_info prints are necessary here.
+   vf->pf_set_mac = is_zero_ether_addr(mac);

Thanks

>   /* Force the VF driver stop so it has to reload with new MAC address */
>   i40e_vc_disable_vf(pf, vf);
>   dev_info(>pdev->dev, "Reload the VF driver to make this change 
> effective.\n");
> --
> 2.9.4
>


signature.asc
Description: PGP signature


Re: [PATCH net-next] liquidio: fix bug in soft reset failure detection

2017-06-25 Thread Leon Romanovsky
On Sat, Jun 24, 2017 at 04:00:21AM -0700, Felix Manlunas wrote:
> From: Derek Chickles 
>
> The code that detects a failed soft reset of Octeon is comparing the wrong
> value against the reset value of the Octeon SLI_SCRATCH_1 register,
> resulting in an inability to detect a soft reset failure.  Fix it by using
> the correct value in the comparison.
>
> Signed-off-by: Derek Chickles 
> Signed-off-by: Satanand Burla 
> Signed-off-by: Felix Manlunas 
> ---
>  drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 2 +-
>  drivers/net/ethernet/cavium/liquidio/cn66xx_device.c| 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c 
> b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
> index 6081c31..3ab311f 100644
> --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
> +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
> @@ -221,7 +221,7 @@ static int cn23xx_pf_soft_reset(struct octeon_device *oct)
>   /* Wait for 100ms as Octeon resets. */
>   mdelay(100);
>
> - if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) == 0x1234ULL) {
> + if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) != 0x0ULL) {

Zero is always zero, please drop this 0x0ULL and add fixes line to the commit 
message.

>   dev_err(>pci_dev->dev, "OCTEON[%d]: Soft reset failed\n",
>   oct->octeon_id);
>   return 1;
> diff --git a/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c 
> b/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
> index b28253c..effd7ac 100644
> --- a/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
> +++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
> @@ -44,7 +44,7 @@ int lio_cn6xxx_soft_reset(struct octeon_device *oct)
>   /* Wait for 10ms as Octeon resets. */
>   mdelay(100);
>
> - if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) == 0x1234ULL) {
> + if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) != 0x0ULL) {
>   dev_err(>pci_dev->dev, "Soft reset failed\n");
>   return 1;
>   }


signature.asc
Description: PGP signature


Re: [PATCH net-next] liquidio: standardization: use min_t instead of custom macro

2017-06-25 Thread Leon Romanovsky
On Sat, Jun 24, 2017 at 04:31:56AM -0700, Felix Manlunas wrote:
> From: Rick Farrington 
>
> Replaced custom MIN macro with use of standard 'min_t'.
>
> Signed-off-by: Rick Farrington 
> Signed-off-by: Derek Chickles 
> Signed-off-by: Felix Manlunas 
> ---
>  drivers/net/ethernet/cavium/liquidio/octeon_console.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_console.c 
> b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> index 53f38d0..2dc0e30 100644
> --- a/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> +++ b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
> @@ -42,7 +42,6 @@ static int octeon_console_read(struct octeon_device *oct, 
> u32 console_num,
>  MODULE_PARM_DESC(console_bitmask,
>"Bitmask indicating which consoles have debug output 
> redirected to syslog.");
>
> -#define MIN(a, b) min((a), (b))
>  #define CAST_ULL(v) ((u64)(v))

It will be awesome to drop this macro too. It is used in one place and
hides important information.

Thanks

>
>  #define BOOTLOADER_PCI_READ_BUFFER_DATA_ADDR0x0006c008
> @@ -704,7 +703,7 @@ static int octeon_console_read(struct octeon_device *oct, 
> u32 console_num,
>   if (bytes_to_read <= 0)
>   return bytes_to_read;
>
> - bytes_to_read = MIN(bytes_to_read, (s32)buf_size);
> + bytes_to_read = min_t(s32, bytes_to_read, buf_size);
>
>   /* Check to see if what we want to read is not contiguous, and limit
>* ourselves to the contiguous block
> --
> 1.8.3.1
>


signature.asc
Description: PGP signature