Re: [PATCH V5 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-27 Thread Rafael J. Wysocki
On Sun, Sep 27, 2015 at 12:04 AM, Viresh Kumar  wrote:
> global_lock is defined as an unsigned long and accessing only its lower
> 32 bits from sysfs is incorrect, as we need to consider other 32 bits
> for big endian 64-bit systems. There are no such platforms yet, but the
> code needs to be robust for such a case.
>
> Fix that by changing type of 'global_lock' to u32.
>
> Signed-off-by: Viresh Kumar 

Acked-by: Rafael J. Wysocki 

Greg, please take this one along with the [2/2] if that one looks good to you.

> ---
> BCC'd a lot of people (rather than cc'ing them) to make sure
> - the series reaches them
> - mailing lists do not block the patchset due to long cc list
> - and we don't spam the BCC'd people for every reply
>
> V4->V5:
> - Switch back to the original solution of making global_lock u32.
> ---
>  drivers/acpi/ec_sys.c   | 2 +-
>  drivers/acpi/internal.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
> index b4c216bab22b..bea8e425a8de 100644
> --- a/drivers/acpi/ec_sys.c
> +++ b/drivers/acpi/ec_sys.c
> @@ -128,7 +128,7 @@ static int acpi_ec_add_debugfs(struct acpi_ec *ec, 
> unsigned int ec_device_count)
> if (!debugfs_create_x32("gpe", 0444, dev_dir, (u32 *)_ec->gpe))
> goto error;
> if (!debugfs_create_bool("use_global_lock", 0444, dev_dir,
> -(u32 *)_ec->global_lock))
> +_ec->global_lock))
> goto error;
>
> if (write_support)
> diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
> index 9e426210c2a8..9db196de003c 100644
> --- a/drivers/acpi/internal.h
> +++ b/drivers/acpi/internal.h
> @@ -138,7 +138,7 @@ struct acpi_ec {
> unsigned long gpe;
> unsigned long command_addr;
> unsigned long data_addr;
> -   unsigned long global_lock;
> +   u32 global_lock;
> unsigned long flags;
> unsigned long reference_count;
> struct mutex mutex;
> --
> 2.4.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


did you receive my charity proposal details

2015-09-27 Thread Janet Penninger

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-27 Thread Viresh Kumar
On 26 September 2015 at 22:31, Jiri Slaby  wrote:
> But this has to crash whenever the file is read as val's storage is gone at
> that moment already, right?

Yeah, its fixed now in the new version. This was a *really* bad idea :(
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] ipvs: drop first packet to dead server

2015-09-27 Thread Julian Anastasov

Hello,

On Fri, 25 Sep 2015, Jiri Bohac wrote:

>   if (!atomic_read(>n_control))
>   ip_vs_conn_expire_now(cp);
>   __ip_vs_conn_put(cp);
> - cp = NULL;
> + return NF_DROP;

So, at this point we do not know whether we have
one or many real servers, with same or different forwarding
method. For example, if we know that old real server is DR
and the new real server is again DR we can reuse the conntrack.

Without such info we have to drop the connection
_only_ when conntrack is used. But if the connection is referenced
by others, eg. FTP:21 referenced by data connection, it is not
going to expire soon. We have to reuse it, otherwise client
will retransmit for long time. See below...

Also, according to RFC 5961, 4.2. Mitigation, client can
send RST during its SYN retransmissions. So, may be we have to
allow rescheduling by adding IP_VS_TCP_S_CLOSE check after the
IP_VS_TCP_S_TIME_WAIT check in is_new_conn_expected(). This should
allow restarted client to be rescheduled. But this can be in
separate patch.

Here is a RFC patch (not for latest tree, not tested):

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 9b9ca87..e989841 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1591,6 +1591,23 @@ static inline void ip_vs_conn_drop_conntrack(struct 
ip_vs_conn *cp)
 }
 #endif /* CONFIG_IP_VS_NFCT */
 
+/* Really using conntrack? */
+static inline bool ip_vs_conn_uses_conntrack(struct ip_vs_conn *cp,
+   struct sk_buff *skb)
+{
+#ifdef CONFIG_IP_VS_NFCT
+   enum ip_conntrack_info ctinfo;
+   struct nf_conn *ct;
+
+   if (!(cp->flags & IP_VS_CONN_F_NFCT))
+   return false;
+   ct = nf_ct_get(skb, );
+   if (ct && !nf_ct_is_untracked(ct))
+   return true;
+#endif
+   return false;
+}
+
 static inline int
 ip_vs_dest_conn_overhead(struct ip_vs_dest *dest)
 {
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 38fbc19..a26bd65 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1689,15 +1689,34 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int 
af)
cp = pp->conn_in_get(af, skb, , 0);
 
conn_reuse_mode = sysctl_conn_reuse_mode(ipvs);
-   if (conn_reuse_mode && !iph.fragoffs &&
-   is_new_conn(skb, ) && cp &&
-   ((unlikely(sysctl_expire_nodest_conn(ipvs)) && cp->dest &&
- unlikely(!atomic_read(>dest->weight))) ||
-unlikely(is_new_conn_expected(cp, conn_reuse_mode {
-   if (!atomic_read(>n_control))
-   ip_vs_conn_expire_now(cp);
-   __ip_vs_conn_put(cp);
-   cp = NULL;
+   if (conn_reuse_mode && !iph.fragoffs && is_new_conn(skb, ) && cp) {
+   bool uses_ct = false, resched = false;
+
+   if (unlikely(sysctl_expire_nodest_conn(ipvs)) && cp->dest &&
+   unlikely(!atomic_read(>dest->weight))) {
+   resched = true;
+   uses_ct = ip_vs_conn_uses_conntrack(cp, skb);
+   } else if (is_new_conn_expected(cp, conn_reuse_mode)) {
+   uses_ct = ip_vs_conn_uses_conntrack(cp, skb);
+   if (!atomic_read(>n_control)) {
+   resched = true;
+   } else {
+   /* Do not reschedule controlling connection
+* that uses conntrack while it is still
+* referenced by controlled connection(s).
+*/
+   resched = !uses_ct;
+   }
+   }
+
+   if (resched) {
+   if (!atomic_read(>n_control))
+   ip_vs_conn_expire_now(cp);
+   __ip_vs_conn_put(cp);
+   if (uses_ct)
+   return NF_DROP;
+   cp = NULL;
+   }
}
 
if (unlikely(!cp) && !iph.fragoffs) {

Regards

--
Julian Anastasov 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ne: Add h8300 support.

2015-09-27 Thread Yoshinori Sato
Signed-off-by: Yoshinori Sato 
---
 drivers/net/ethernet/8390/Kconfig | 2 +-
 drivers/net/ethernet/8390/ne.c| 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/8390/Kconfig 
b/drivers/net/ethernet/8390/Kconfig
index edf7225..44d7167 100644
--- a/drivers/net/ethernet/8390/Kconfig
+++ b/drivers/net/ethernet/8390/Kconfig
@@ -88,7 +88,7 @@ config MCF8390
 config NE2000
tristate "NE2000/NE1000 support"
depends on (ISA || (Q40 && m) || M32R || MACH_TX49XX || \
-   ATARI_ETHERNEC)
+   ATARI_ETHERNEC || H8300)
select CRC32
---help---
  If you have a network (Ethernet) card of this type, say Y here.
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index c063b41..576917c 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -422,7 +422,8 @@ static int __init ne_probe1(struct net_device *dev, 
unsigned long ioaddr)
stop_page  = NE1SM_STOP_PG;
}
 
-#if  defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R)
+#if  defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R) || \
+   defined(CONFIG_H8300_KANEBEBE) || defined(CONFIG_H8300_AE3069)
neX000 = ((SA_prom[14] == 0x57  &&  SA_prom[15] == 0x57)
|| (SA_prom[14] == 0x42 && SA_prom[15] == 0x42));
 #else
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/23] usb-gadget: use per-attribute show and store methods

2015-09-27 Thread Felipe Balbi
On Fri, Sep 25, 2015 at 06:49:39AM -0700, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig 
> ---
>  drivers/usb/gadget/configfs.c   | 295 
> ++--
>  include/linux/usb/gadget_configfs.h |  19 +--
>  2 files changed, 118 insertions(+), 196 deletions(-)
> 
> diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
> index 294eb74..163d305 100644
> --- a/drivers/usb/gadget/configfs.c
> +++ b/drivers/usb/gadget/configfs.c
> @@ -64,6 +64,11 @@ struct gadget_info {
>   char qw_sign[OS_STRING_QW_SIGN_LEN];
>  };
>  
> +static inline struct gadget_info *to_gadget_info(struct config_item *item)
> +{
> +  return container_of(to_config_group(item), struct gadget_info, group);
> +}

this (and the other helper below) could be macros just fine. Are you 100% 
compiler
will *always* inline these helpers. The likelyhood of not inlining is minimal, 
sure,
but what do we get for writing these as functions instead of macros ?

also, lacking commit log

-- 
balbi


signature.asc
Description: PGP signature


Re: [PATCH v2 net-next] tcp: Fix CWV being too strict on thin streams

2015-09-27 Thread Eric Dumazet
On Wed, 2015-09-23 at 18:49 +0200, Bendik Rønning Opstad wrote:
> Application limited streams such as thin streams, that transmit small
> amounts of payload in relatively few packets per RTT, can be prevented
> from growing the CWND when in congestion avoidance. This leads to
> increased sojourn times for data segments in streams that often transmit
> time-dependent data.
> 
> Currently, a connection is considered CWND limited only after having
> successfully transmitted at least one packet with new data, while at the
> same time failing to transmit some unsent data from the output queue
> because the CWND is full. Applications that produce small amounts of
> data may be left in a state where it is never considered to be CWND
> limited, because all unsent data is successfully transmitted each time
> an incoming ACK opens up for more data to be transmitted in the send
> window.
> 
> Fix by always testing whether the CWND is fully used after successful
> packet transmissions, such that a connection is considered CWND limited
> whenever the CWND has been filled. This is the correct behavior as
> specified in RFC2861 (section 3.1).
> 
> Cc: Andreas Petlund 
> Cc: Carsten Griwodz 
> Cc: Jonas Markussen 
> Cc: Kenneth Klette Jonassen 
> Cc: Mads Johannessen 
> Signed-off-by: Bendik Rønning Opstad 
> ---
> Changes in v2:
>  - Instead of updating tp->is_cwnd_limited after failing to send
>any packets, test whether CWND is full after successfull packet
>transmissions.
>  - Updating commit message according to changes.
> 
>  net/ipv4/tcp_output.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 4cd0b50..57a586f 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -1827,7 +1827,7 @@ static bool tcp_tso_should_defer(struct sock *sk, 
> struct sk_buff *skb,
>  
>   /* Ok, it looks like it is advisable to defer. */
>  
> - if (cong_win < send_win && cong_win < skb->len)
> + if (cong_win < send_win && cong_win <= skb->len)
>   *is_cwnd_limited = true;
>  
>   return true;
> @@ -2060,7 +2060,6 @@ static bool tcp_write_xmit(struct sock *sk, unsigned 
> int mss_now, int nonagle,
>  
>   cwnd_quota = tcp_cwnd_test(tp, skb);
>   if (!cwnd_quota) {
> - is_cwnd_limited = true;
>   if (push_one == 2)
>   /* Force out a loss probe pkt. */
>   cwnd_quota = 1;
> @@ -2142,6 +2141,7 @@ repair:
>   /* Send one loss probe per tail loss episode. */
>   if (push_one != 2)
>   tcp_schedule_loss_probe(sk);
> + is_cwnd_limited |= (tcp_packets_in_flight(tp) >= tp->snd_cwnd);
>   tcp_cwnd_validate(sk, is_cwnd_limited);
>   return false;
>   }

David, any idea of what happened to Bendik patch ?

https://patchwork.ozlabs.org/patch/521765

Do we need to re-submit or something ?

Thanks !


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-27 Thread Rafael J. Wysocki
On Saturday, September 26, 2015 12:52:08 PM James Bottomley wrote:
> On Fri, 2015-09-25 at 22:58 +0200, Rafael J. Wysocki wrote:
> > On Friday, September 25, 2015 01:25:49 PM Viresh Kumar wrote:
> > > On 25 September 2015 at 13:33, Rafael J. Wysocki  
> > > wrote:
> > > > You're going to change that into bool in the next patch, right?
> > > 
> > > Yeah.
> > > 
> > > > So what if bool is a byte and the field is not word-aligned
> > > 
> > > Its between two 'unsigned long' variables today, and the struct isn't 
> > > packed.
> > > So, it will be aligned, isn't it?
> > > 
> > > > and changing
> > > > that byte requires a read-modify-write.  How do we ensure that things 
> > > > remain
> > > > consistent in that case?
> > > 
> > > I didn't understood why a read-modify-write is special here? That's
> > > what will happen
> > > to most of the non-word-sized fields anyway?
> > > 
> > > Probably I didn't understood what you meant..
> > 
> > Say you have three adjacent fields in a structure, x, y, z, each one byte 
> > long.
> > Initially, all of them are equal to 0.
> > 
> > CPU A writes 1 to x and CPU B writes 2 to y at the same time.
> > 
> > What's the result?
> 
> I think every CPU's  cache architecure guarantees adjacent store
> integrity, even in the face of SMP, so it's x==1 and y==2.  If you're
> thinking of old alpha SMP system where the lowest store width is 32 bits
> and thus you have to do RMW to update a byte, this was usually fixed by
> padding (assuming the structure is not packed).  However, it was such a
> problem that even the later alpha chips had byte extensions.

OK, thanks!

Rafael

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-27 Thread Rafael J. Wysocki
On Saturday, September 26, 2015 09:33:56 PM Arnd Bergmann wrote:
> On Saturday 26 September 2015 11:40:00 Viresh Kumar wrote:
> > On 25 September 2015 at 15:19, Rafael J. Wysocki  wrote:
> > > So if you allow something like debugfs to update your structure, how
> > > do you make sure there is the proper locking?
> > 
> > Not really sure at all.. Isn't there some debugfs locking that will
> > jump in, to avoid updation of fields to the same device?
> 
> No, if you need any locking to access variable, you cannot use the
> simple debugfs helpers but have to provide your own functions.
> 
> > >> Anyway, that problem isn't here for sure as its between two
> > >> unsigned-longs. So, should I just move it to bool and resend ?
> > >
> > > I guess it might be more convenient to fold this into the other patch,
> > > because we seem to be splitting hairs here.
> > 
> > I can and that's what I did. But then Arnd asked me to separate it
> > out. I can fold it back if that's what you want.
> 
> It still makes sense to keep it separate I think, the patch is clearly
> different from the other parts.

I just don't see much point in going from unsigned long to u32 and then
from 32 to bool if we can go directly to bool in one go.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ne: DeviceTree support.

2015-09-27 Thread Yoshinori Sato
Signed-off-by: Yoshinori Sato 
---
 Documentation/devicetree/bindings/net/ne2000.txt | 17 +
 drivers/net/ethernet/8390/ne.c   | 20 +++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/net/ne2000.txt

diff --git a/Documentation/devicetree/bindings/net/ne2000.txt 
b/Documentation/devicetree/bindings/net/ne2000.txt
new file mode 100644
index 000..69b68dfb
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ne2000.txt
@@ -0,0 +1,17 @@
+NE2000 compatible network controller
+
+Required properties:
+- compatible: "novell,ne2000"
+- reg: base address and length of NE2000.
+- interrupts: interrupt specifier for the sole interrupt.
+- novell,dcr: DCR setting value.
+
+Example
+
+   ne2000: ethernet@20 {
+   compatible = "realtek,rtl8019as", "novell,ne2000";
+   reg = <0x20 32>;
+   interrupts = <17 0>;
+   novell,dcr = <0x48>;
+   };
+
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index 576917c..f0a0400 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -52,6 +52,7 @@ static const char version2[] =
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -72,6 +73,7 @@ static int io[MAX_NE_CARDS];
 static int irq[MAX_NE_CARDS];
 static int bad[MAX_NE_CARDS];
 static u32 ne_msg_enable;
+static unsigned int of_dcr_val;
 
 #ifdef MODULE
 module_param_array(io, int, NULL, 0);
@@ -171,6 +173,8 @@ bad_clone_list[] __initdata = {
 #  define DCR_VAL 0x48 /* 8-bit mode */
 #elif defined(CONFIG_ATARI)/* 8-bit mode on Atari, normal on Q40 */
 #  define DCR_VAL (MACH_IS_ATARI ? 0x48 : 0x49)
+#elif defined(CONFIG_OF_NET)
+#  define DCR_VAL of_dcr_val
 #else
 #  define DCR_VAL 0x49
 #endif
@@ -304,7 +308,8 @@ static int __init ne_probe1(struct net_device *dev, 
unsigned long ioaddr)
struct ei_device *ei_local = netdev_priv(dev);
 
if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
-   return -EBUSY;
+   if(!request_mem_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
+   return -EBUSY;
 
reg0 = inb_p(ioaddr);
if (reg0 == 0xFF) {
@@ -809,11 +814,18 @@ static int __init ne_drv_probe(struct platform_device 
*pdev)
if (!dev)
return -ENOMEM;
 
+
+   if (dev->dev.of_node)
+   of_property_read_u32(dev->dev.of_node,
+"novell,dcr", _dcr_val);
+
/* ne.c doesn't populate resources in platform_device, but
 * rbtx4927_ne_init and rbtx4938_ne_init do register devices
 * with resources.
 */
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+   if (res == NULL)
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res) {
dev->base_addr = res->start;
dev->irq = platform_get_irq(pdev, 0);
@@ -915,12 +927,18 @@ static int ne_drv_resume(struct platform_device *pdev)
 #define ne_drv_resume NULL
 #endif
 
+static const struct of_device_id ne2000_of_table[] __maybe_unused = {
+   { .compatible = "novell,ne2000" },
+   { }
+};
+
 static struct platform_driver ne_driver = {
.remove = ne_drv_remove,
.suspend= ne_drv_suspend,
.resume = ne_drv_resume,
.driver = {
.name   = DRV_NAME,
+   .of_match_table = of_match_ptr(ne2000_of_table),
},
 };
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] ne: Add h8300 support.

2015-09-27 Thread David Miller
From: Yoshinori Sato 
Date: Sun, 27 Sep 2015 23:19:15 +0900

> @@ -88,7 +88,7 @@ config MCF8390
>  config NE2000
>   tristate "NE2000/NE1000 support"
>   depends on (ISA || (Q40 && m) || M32R || MACH_TX49XX || \
> - ATARI_ETHERNEC)
> + ATARI_ETHERNEC || H8300)
...
>  
> -#if  defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R)
> +#if  defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R) || \
> + defined(CONFIG_H8300_KANEBEBE) || defined(CONFIG_H8300_AE3069)

It makes no sense to test different config symbols for these two
things.

Either both should use "H8300" or both should use
"H8300_KANEBEBE || H8300_AE3069".
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Pending Delivery.

2015-09-27 Thread ''FedEx''


FDX.docx
Description: Binary data


Re: [PATCH] netpoll: Drop budget parameter from NAPI polling call hierarchy

2015-09-27 Thread Alexander Duyck

On 09/26/2015 10:36 PM, David Miller wrote:

From: Alexander Duyck 
Date: Tue, 22 Sep 2015 14:56:08 -0700


Rather than carry around a value of budget that is 0 or less we can instead
just loop through and pass 0 to each napi->poll call.  If any driver
returns a value for work done that is non-zero then we can report that
driver and continue rather than allowing a bad actor to make the budget
value negative and pass that negative value to napi->poll.

Unfortunately we have drivers that won't do any TX work if the budget
is zero.


Well that is what we are doing right now.  The fact is the call starts 
out with a budget of 0, and it is somewhat hidden from the call since 
the budget is assigned a value of 0 in netpoll_poll_dev. That is one of 
the things I was wanting do address because that is clear as mud from 
looking at poll_one_napi.  Based on the code you would assume budget 
starts out as a non-zero value and it doesn't.



Using the budget for TX work is unfortunate and not the recommended
way for drivers to do things, but it's not explicitly disallowed
either.

So I'm not applying this because it definitely has the potential
to break something.

Sorry.


I don't see how this introduces a regression when all I am doing is 
avoiding tracking a value that should be 0 assuming everything is 
working correctly.  If work returns a non-zero value with the code as it 
currently is then the WARN_ONCE is triggered, and the value of budget is 
becoming negative.  I would consider a negative budget value worse than 
a 0 budget value.


I'll go back through the patch and rebase it since it looks like Neil 
had to submit a v3 of his patch and it may have impacted mine. However 
perhaps we need to revisit this code if you think it is risky as the 
only thing my changes did is remove the ability for the budget value to 
go from 0 to negative and then passing that negative value into the 
function.


- Alex
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bridge: Allow forward delay to be cfgd when STP enabled

2015-09-27 Thread David Miller
From: Stephen Hemminger 
Date: Thu, 24 Sep 2015 11:20:11 -0700

> From: Ian Wilson 
> 
> Allow bridge forward delay to be configured when Spanning Tree is enabled.
> 
> Signed-off-by: Ian Wilson 
> Signed-off-by: Stephen Hemminger 

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next] cxgb4: Add HW timesptamp support for RX

2015-09-27 Thread Hariprasad Shenai
Adds support for ethtool get time stamp ioctl, which is used by
tcpdump to get the supported time stamp types

eg: tcpdump -i eth5 -J
Time stamp types for eth5 (use option -j to set):
  host (Host)
  adapter_unsynced (Adapter, not synced with system time)

Adds support for adapter unsynced mode, by adding SIOCSHWTSTAMP support
in driver. 

Signed-off-by: Hariprasad Shenai 
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h |  4 +++
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 15 +
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c| 24 +++
 drivers/net/ethernet/chelsio/cxgb4/sge.c   | 36 --
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.h |  5 +++
 5 files changed, 81 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index fa0c7b5..634e50c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "cxgb4_uld.h"
 
@@ -478,6 +479,8 @@ struct port_info {
 #ifdef CONFIG_CHELSIO_T4_FCOE
struct cxgb_fcoe fcoe;
 #endif /* CONFIG_CHELSIO_T4_FCOE */
+   bool rxtstamp;  /* Enable TS */
+   struct hwtstamp_config tstamp_config;
 };
 
 struct dentry;
@@ -517,6 +520,7 @@ struct sge_fl { /* SGE free-buffer 
queue state */
 
 /* A packet gather list */
 struct pkt_gl {
+   u64 sgetstamp;  /* SGE Time Stamp for Ingress Packet */
struct page_frag frags[MAX_SKB_FRAGS];
void *va; /* virtual address of first byte */
unsigned int nfrags;  /* # of fragments */
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
index 5eedb98..02e4e02 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c
@@ -961,6 +961,20 @@ static int set_flash(struct net_device *netdev, struct 
ethtool_flash *ef)
return ret;
 }
 
+static int get_ts_info(struct net_device *dev, struct ethtool_ts_info *ts_info)
+{
+   ts_info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
+  SOF_TIMESTAMPING_RX_SOFTWARE |
+  SOF_TIMESTAMPING_SOFTWARE;
+
+   ts_info->so_timestamping |= SOF_TIMESTAMPING_RX_HARDWARE |
+   SOF_TIMESTAMPING_RAW_HARDWARE;
+
+   ts_info->phc_index = -1;
+
+   return 0;
+}
+
 static u32 get_rss_table_size(struct net_device *dev)
 {
const struct port_info *pi = netdev_priv(dev);
@@ -1095,6 +1109,7 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.get_rxfh  = get_rss_table,
.set_rxfh  = set_rss_table,
.flash_device  = set_flash,
+   .get_ts_info   = get_ts_info
 };
 
 void cxgb4_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c 
b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index f5dcde2..0b7570d 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2959,6 +2959,30 @@ static int cxgb_ioctl(struct net_device *dev, struct 
ifreq *req, int cmd)
ret = t4_mdio_wr(pi->adapter, mbox, prtad, devad,
 data->reg_num, data->val_in);
break;
+   case SIOCGHWTSTAMP:
+   return copy_to_user(req->ifr_data, >tstamp_config,
+   sizeof(pi->tstamp_config)) ?
+   -EFAULT : 0;
+   case SIOCSHWTSTAMP:
+   if (copy_from_user(>tstamp_config, req->ifr_data,
+  sizeof(pi->tstamp_config)))
+   return -EFAULT;
+
+   switch (pi->tstamp_config.rx_filter) {
+   case HWTSTAMP_FILTER_NONE:
+   pi->rxtstamp = false;
+   break;
+   case HWTSTAMP_FILTER_ALL:
+   pi->rxtstamp = true;
+   break;
+   default:
+   pi->tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE;
+   return -ERANGE;
+   }
+
+   return copy_to_user(req->ifr_data, >tstamp_config,
+   sizeof(pi->tstamp_config)) ?
+   -EFAULT : 0;
default:
return -EOPNOTSUPP;
}
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c 
b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index 9162746..b7b93e7 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -1820,11 +1820,34 @@ static noinline int handle_trace_pkt(struct adapter 
*adap,
return 0;
 }
 
+/**
+ * 

Re: [PATCH 02/23] usb-gadget: use per-attribute show and store methods

2015-09-27 Thread Felipe Balbi
On Fri, Sep 25, 2015 at 06:49:39AM -0700, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig 

I need commit logs for everything. Without commit logs, I can't apply your 
patches.

-- 
balbi


signature.asc
Description: PGP signature


Fw: [Bug 105091] New: ICMP unreachable is not sent when receiving GRE packets on device that has no tunnel interface

2015-09-27 Thread Stephen Hemminger


Begin forwarded message:

Date: Sun, 27 Sep 2015 22:42:34 +
From: "bugzilla-dae...@bugzilla.kernel.org" 

To: "shemmin...@linux-foundation.org" 
Subject: [Bug 105091] New: ICMP unreachable is not sent when receiving GRE 
packets on device that has no tunnel interface


https://bugzilla.kernel.org/show_bug.cgi?id=105091

Bug ID: 105091
   Summary: ICMP unreachable is not sent when receiving GRE
packets on device that has no tunnel interface
   Product: Networking
   Version: 2.5
Kernel Version: 4.2
  Hardware: All
OS: Linux
  Tree: Mainline
Status: NEW
  Severity: low
  Priority: P1
 Component: IPV4
  Assignee: shemmin...@linux-foundation.org
  Reporter: isaac@alliedtelesis.co.nz
Regression: No

Created attachment 188691
  --> https://bugzilla.kernel.org/attachment.cgi?id=188691=edit
fix patch

This used to work in version 3.9. In file ip_gre.c, when a GRE packet is
received and tunnel lookup returned NULL (ie, no such interface), ipgre_rcv()
calls icmp_send() to respond with port unreachable message.

In the latest version, gre_demux.c tries to do the same thing in
gre_cisco_rcv(), but icmp_send fails because skb dst entry has been dropped
(during parse_gre_header() -> iptunnel_pull_header() ->  skb_dst_drop(skb);)
prior to calling icmp_send, causing icmp_send to return early due to rt is
NULL.

A fix patch is attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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 ipv4 ipconfig: use preferred log methods

2015-09-27 Thread Stephen Hemminger
On Fri, 25 Sep 2015 11:58:30 +0200
Bastian Stender  wrote:

>  
>  #ifdef IPCONFIG_DEBUG
> -#define DBG(x) printk x
> +#define DBG(x) pr_debug(x)
>  #else
>  #define DBG(x) do { } while(0)
>  #endif

Why not remove all the local IPCONFIG_DEBUG stuff and just use pr_debug()
like modern kernel code.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 RFC] 8139cp: Fix GSO MSS handling

2015-09-27 Thread Tom Herbert
On Thu, Sep 24, 2015 at 5:31 AM, David Woodhouse  wrote:
> On Thu, 2015-09-24 at 05:05 -0700, Eric Dumazet wrote:
>>
>> Right, netif_skb_features() only has the following checks :
>>
>> if (gso_segs > dev->gso_max_segs || gso_segs < dev->gso_min_segs)
>> features &= ~NETIF_F_GSO_MASK;
>>
>> But now we have .ndo_features_check() we could remove this generic
>> check from fast path.
>
> Perhaps so, yes.
>
> Any thoughts on the other reason I was staring at this same code path
> this week? I am able to reliably feed inappropriate packets to a
> NETIF_F_IP_CSUM-capable device with the test program at
> http://bombadil.infradead.org/~dwmw2/raw.c (and equivalent code paths
> via virtio_net, tun and others).
>
> They're *supposed* to get checksummed by software if the device can't
> cope, but netif_skb_features() returns the wrong answer, so we fail to
> do that and they're fed with CHECKSUM_PARTIAL to a device which can't
> handle them. Causing a WARN() or a BUG() or a silent corruption,
> depending on the driver.
>
Which drivers are doing this? It is up to the driver to determine
whether a particular packet being sent can have checksum offloaded to
the device. If it cannot offload the checksum it must call
skb_checksum_help.

Tom

> --
> dwmw2
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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-next 0/4] ila: Use NF_INET_PRE_ROUTING nfhook

2015-09-27 Thread Florian Westphal
David Miller  wrote:
> > This patch set addresses the issue for ILA by adding a fast locator
> > lookup that occurs before early demux. This is done by using a hook
> > at NF_INET_PRE_ROUTING. For the backend we implement an rhashtable
> > that contains identifier to locator to mappings. The table also
> > allows more specific matches that include original locator and
> > interface.
> 
> I really don't think we should use netfilter hooks to perform
> operations setup outside of netfilter's normal configuration
> mechanisms.

Thanks, thats my thinking as well.

> If ILA were instead configured inside of netfilter's normal mechanisms
> then there would be full transparency about whether ILA
> transformations are performed before or after the user's other
> netfilter rules.  And the user would have full control over this.
> As implemented here, they don't.
> 
> So sorry, I'm not too keen on this and I bet if netfilter developers
> reviewed this patch series they'd have similar objections.

Seems this should/could be implemented similar to RFC6296 network
prefix translations (see net/ipv6/netfilter/ip6t_NPT.c).
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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-next v3] net: Fix Hisilicon Network Subsystem Support Compilation

2015-09-27 Thread huangdaode

On 2015/9/26 12:42, David Miller wrote:

From: huangdaode 
Date: Fri, 25 Sep 2015 16:29:50 +0800


@@ -191,9 +191,12 @@ static void hns_rcb_ring_init(struct ring_pair_cb 
*ring_pair, int ring_type)
if (ring_type == RX_RING) {
dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_L_REG,
   (u32)dma);
+#ifdef CONFIG_64BIT
dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG,
   (u32)(dma >> 32));
-
+#else
+   dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG, 0);
+#endif
dsaf_write_dev(q, RCB_RING_RX_RING_BD_LEN_REG,
   bd_size_type);
dsaf_write_dev(q, RCB_RING_RX_RING_BD_NUM_REG,

CONFIG_64BIT doesn't tell you if _DMA_ addresses are 64-bit or not.

Furthermore there is a portable way to shift a 32-bit value down
32-bits whilst avoiding warnings.

(x >> 31) >> 1

So you should definitely use that instead of the CONFIG_64BIT test.

.


agreed.



--
To unsubscribe from this list: send the line "unsubscribe netdev" 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-next 0/4] ila: Use NF_INET_PRE_ROUTING nfhook

2015-09-27 Thread David Miller
From: Tom Herbert 
Date: Thu, 24 Sep 2015 09:30:20 -0700

> This patch set addresses the issue for ILA by adding a fast locator
> lookup that occurs before early demux. This is done by using a hook
> at NF_INET_PRE_ROUTING. For the backend we implement an rhashtable
> that contains identifier to locator to mappings. The table also
> allows more specific matches that include original locator and
> interface.

I really don't think we should use netfilter hooks to perform
operations setup outside of netfilter's normal configuration
mechanisms.

It is not a set of arbitray hooks to take advantage of in another
subsystem or facility.

If ILA were instead configured inside of netfilter's normal mechanisms
then there would be full transparency about whether ILA
transformations are performed before or after the user's other
netfilter rules.  And the user would have full control over this.
As implemented here, they don't.

So sorry, I'm not too keen on this and I bet if netfilter developers
reviewed this patch series they'd have similar objections.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: simplify configfs attributes

2015-09-27 Thread Christoph Hellwig
On Sat, Sep 26, 2015 at 04:49:06PM -0700, Nicholas A. Bellinger wrote:
> That said, it would probably make sense to merge via target-pending.git
> and get this series into linux-next ASAP.

Sounds good to me!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next v4] net: Fix Hisilicon Network Subsystem Support Compilation

2015-09-27 Thread huangdaode
This patch fixes the compilation error with arm allmodconfig, this error
generated due to unavailability of readq() on 32-bit platform which was
found during net-next daily compilation. In the same time, fix all the
hns drivers compilation warnings.

Signed-off-by: huangdaode 
Signed-off-by: zhaungyuzeng 
Signed-off-by: kenneth Lee 
Signed-off-by: yankejian 
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c   |  2 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h  |  4 ++--
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c   |  6 ++
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h   |  2 +-
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c |  1 +
 drivers/net/ethernet/hisilicon/hns/hns_enet.c   | 17 -
 6 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c 
b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index a8bd27b..95bf42a 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -86,7 +86,7 @@ int hns_mac_get_sfp_prsnt(struct hns_mac_cb *mac_cb, int 
*sfp_prsnt)
if (!mac_cb->cpld_vaddr)
return -ENODEV;
 
-   *sfp_prsnt = !dsaf_read_b((u64)mac_cb->cpld_vaddr
+   *sfp_prsnt = !dsaf_read_b((u8 *)mac_cb->cpld_vaddr
+ MAC_SFP_PORT_OFFSET);
 
return 0;
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h 
b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
index e0417c0..315b07e 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.h
@@ -43,7 +43,7 @@ struct hns_mac_cb;
 #define DSAF_DUMP_REGS_NUM 504
 #define DSAF_STATIC_NUM 28
 
-#define DSAF_STATS_READ(p, offset) (*((u64 *)((u64)(p) + (offset
+#define DSAF_STATS_READ(p, offset) (*((u64 *)((u8 *)(p) + (offset
 
 enum hal_dsaf_mode {
HRD_DSAF_NO_DSAF_MODE   = 0x0,
@@ -302,7 +302,7 @@ struct dsaf_device {
 
 static inline void *hns_dsaf_dev_priv(const struct dsaf_device *dsaf_dev)
 {
-   return (void *)((u64)dsaf_dev + sizeof(*dsaf_dev));
+   return (void *)((u8 *)dsaf_dev + sizeof(*dsaf_dev));
 }
 
 struct dsaf_drv_tbl_tcam_key {
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c 
b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
index 50f3427..05ea244 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c
@@ -192,8 +192,7 @@ static void hns_rcb_ring_init(struct ring_pair_cb 
*ring_pair, int ring_type)
dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_L_REG,
   (u32)dma);
dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG,
-  (u32)(dma >> 32));
-
+  (u32)((dma >> 31) >> 1));
dsaf_write_dev(q, RCB_RING_RX_RING_BD_LEN_REG,
   bd_size_type);
dsaf_write_dev(q, RCB_RING_RX_RING_BD_NUM_REG,
@@ -204,8 +203,7 @@ static void hns_rcb_ring_init(struct ring_pair_cb 
*ring_pair, int ring_type)
dsaf_write_dev(q, RCB_RING_TX_RING_BASEADDR_L_REG,
   (u32)dma);
dsaf_write_dev(q, RCB_RING_TX_RING_BASEADDR_H_REG,
-  (u32)(dma >> 32));
-
+  (u32)((dma >> 31) >> 1));
dsaf_write_dev(q, RCB_RING_TX_RING_BD_LEN_REG,
   bd_size_type);
dsaf_write_dev(q, RCB_RING_TX_RING_BD_NUM_REG,
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h 
b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
index 6fc58ba..b475e1b 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
@@ -967,6 +967,6 @@ static inline u32 dsaf_get_reg_field(void *base, u32 reg, 
u32 mask, u32 shift)
readb((__iomem unsigned char *)(addr))
 
 #define hns_mac_reg_read64(drv, offset) \
-   readq((__iomem void *)(((u64)(drv)->io_base + 0xc00 + (offset
+   readq((__iomem void *)(((u8 *)(drv)->io_base + 0xc00 + (offset
 
 #endif /* _DSAF_REG_H */
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c 
b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
index fe7fa1d..dab5ecf 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
@@ -7,6 +7,7 @@
  * (at your option) any later version.
  */
 
+#include 
 #include 
 #include "hns_dsaf_main.h"
 #include "hns_dsaf_mac.h"
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c 
b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 0713ced..ce7f2e0 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++