[no subject]

2015-11-14 Thread ESTHER LABOSO

--
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 -stable] multiple backports requested

2015-11-14 Thread Charles (Chas) Williams
On Fri, 2015-11-13 at 16:10 -0500, David Miller wrote:
> From: "Charles (Chas) Williams" <3ch...@gmail.com>
> Date: Fri, 13 Nov 2015 15:13:11 -0500
> 
> > Dave, could you please add the following backports?
> > 
> > For the 3.14.y stable queue:
> 
> I am no longer handling 3.14.y -stable submissions, sorry...
> 
> > For the 4.1.y stable queue:
> > 
> > commit 74e98eb085889b0d2d4908f59f6e00026063014f
> > RDS: verify the underlying transport exists before creating a connection
> > This addresses CVE-2015-6937
> 
> Queued up for 3.18, 4.1, and 4.2.

And 3.14?


--
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] ipvs: use skb_to_full_sk() helper

2015-11-14 Thread Julian Anastasov

Hello,

On Thu, 12 Nov 2015, Eric Dumazet wrote:

> From: Eric Dumazet 
> 
> SYNACK packets might be attached to request sockets.
> 
> Use skb_to_full_sk() helper to avoid illegal accesses to
> inet_sk(skb->sk)
> 
> Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead 
> of listener")
> Signed-off-by: Eric Dumazet 
> Reported-by: Sander Eikelenboom 

Looks good, I guess Simon will take the patch for
the ipvs tree.

Acked-by: Julian Anastasov 

> ---
>  net/netfilter/ipvs/ip_vs_core.c |   16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index 1e24fff53e4b..f57b4dcdb233 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1176,6 +1176,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int 
> hooknum, struct sk_buff *skb, in
>   struct ip_vs_protocol *pp;
>   struct ip_vs_proto_data *pd;
>   struct ip_vs_conn *cp;
> + struct sock *sk;
>  
>   EnterFunction(11);
>  
> @@ -1183,13 +1184,12 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int 
> hooknum, struct sk_buff *skb, in
>   if (skb->ipvs_property)
>   return NF_ACCEPT;
>  
> + sk = skb_to_full_sk(skb);
>   /* Bad... Do not break raw sockets */
> - if (unlikely(skb->sk != NULL && hooknum == NF_INET_LOCAL_OUT &&
> + if (unlikely(sk && hooknum == NF_INET_LOCAL_OUT &&
>af == AF_INET)) {
> - struct sock *sk = skb->sk;
> - struct inet_sock *inet = inet_sk(skb->sk);
>  
> - if (inet && sk->sk_family == PF_INET && inet->nodefrag)
> + if (sk->sk_family == PF_INET && inet_sk(sk)->nodefrag)
>   return NF_ACCEPT;
>   }
>  
> @@ -1681,6 +1681,7 @@ ip_vs_in(struct netns_ipvs *ipvs, unsigned int hooknum, 
> struct sk_buff *skb, int
>   struct ip_vs_conn *cp;
>   int ret, pkts;
>   int conn_reuse_mode;
> + struct sock *sk;
>  
>   /* Already marked as IPVS request or reply? */
>   if (skb->ipvs_property)
> @@ -1708,12 +1709,11 @@ ip_vs_in(struct netns_ipvs *ipvs, unsigned int 
> hooknum, struct sk_buff *skb, int
>   ip_vs_fill_iph_skb(af, skb, false, );
>  
>   /* Bad... Do not break raw sockets */
> - if (unlikely(skb->sk != NULL && hooknum == NF_INET_LOCAL_OUT &&
> + sk = skb_to_full_sk(skb);
> + if (unlikely(sk && hooknum == NF_INET_LOCAL_OUT &&
>af == AF_INET)) {
> - struct sock *sk = skb->sk;
> - struct inet_sock *inet = inet_sk(skb->sk);
>  
> - if (inet && sk->sk_family == PF_INET && inet->nodefrag)
> + if (sk->sk_family == PF_INET && inet_sk(sk)->nodefrag)
>   return NF_ACCEPT;
>   }

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


Re: [PATCH] bonding: Offloading bonds to hardware

2015-11-14 Thread Jiri Pirko
Thu, Nov 12, 2015 at 05:02:18PM CET, pjonn...@broadcom.com wrote:
>Packet forwarding to/from bond interfaces is done in software.
>
>This patch enables certain platforms to bridge traffic to/from
>bond interfaces in hardware.  Notifications are sent out when 
>the "active" slave set for a bond interface is updated in 
>software.  Platforms use the notifications to program the 
>hardware accordingly.  The changes have been verified to work 
>with configured and 802.3ad bond interfaces.
>
>Signed-off-by: Premkumar Jonnala 

This patch is wrong, in many different acpects. Leaving the submission
style, and no in-tree consumer aside, adding ndos for this thing is
unacceptable. It should be handled as a part of switchdev attrs.
Also, the solution should not be bonding-centric.

I have a patchset in my queue which does this correctly, for bond and team
using switchdev attr and with actual in-tree consumer, mlxsw driver.
I plan to send that soon after net-next opens.

Jiri
--
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] bonding: Offloading bonds to hardware

2015-11-14 Thread Jiri Pirko
Thu, Nov 12, 2015 at 06:08:01PM CET, and...@lunn.ch wrote:
>On Thu, Nov 12, 2015 at 04:02:18PM +, Premkumar Jonnala wrote:
>> Packet forwarding to/from bond interfaces is done in software.
>> 
>> This patch enables certain platforms to bridge traffic to/from
>> bond interfaces in hardware.  Notifications are sent out when 
>> the "active" slave set for a bond interface is updated in 
>> software.  Platforms use the notifications to program the 
>> hardware accordingly.  The changes have been verified to work 
>> with configured and 802.3ad bond interfaces.
>
>Hi Premkumar
>
>Nice to see this. Do you also have patches for a switch using these
>notification? Are you targeting Starfighter 2?

I fear they are targeting some closed-source crap :/
--
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


Crash in skb_segment / KVM GSO GRE IPV6

2015-11-14 Thread Florian Lohoff

Hi,

we experienced a reproducible crash on a KVM/qemu Host running
Kernel 4.3.0 in skb_segment. (Setup is kvm guest, openvswitch 1.9 up to
2.something, host on 4.3.0). User in the guest kvm with virtio reportedly tried
to set up an v4 GRE tunnel with IPv6 Addresses and as soon as he started a 
simple
wget the host crashed.

I couldnt catch the full backtrace on the Host (IPMI redirect) 
here is what i typed from the video:

NULL pointer dereference at 084

IP skb_segment+0x487/0x970

RIP skb_segment+0x487/0x970

? __enqueue_entity
tcp_gso_segment+0x11d/0x4a0
? debug_smp_processor_id
tcp6_gso_segment
ipv6_gso_segment
? default_wake_function
skb_mac_gso_segment
gre_gso_segment
? __wake_up_sync_key
inet_gso_segment

Using gdb on skbuff.o i find this:

3120if (i >= nfrags) {
   0x5492 <+1154>:  cmp%r15d,%r11d
   0x5495 <+1157>:  jg 0x54d5 

3121BUG_ON(skb_headlen(list_skb));
   0x5497 <+1159>:  mov0x84(%r13),%eax
   0x549e <+1166>:  cmp%eax,0x80(%r13)
   0x54a5 <+1173>:  jne0x5962 
   0x5962 <+2386>:  ud2

Where 0x84 is skb->data_len - So skb_headlen(list_skb) hits
an NULL list_skb.

Flo
-- 
Florian Lohoff f...@zz.de
  We need to self-defend - GnuPG/PGP enable your email today!
--
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 0/9] constify pci_error_handlers structures

2015-11-14 Thread Julia Lawall
Constify never-modified pci_error_handlers structures.

---

 drivers/crypto/qat/qat_common/adf_aer.c |2 +-
 drivers/misc/genwqe/card_base.c |2 +-
 drivers/net/ethernet/cavium/liquidio/lio_main.c |2 +-
 drivers/net/ethernet/sfc/efx.c  |2 +-
 drivers/scsi/be2iscsi/be_main.c |2 +-
 drivers/scsi/bfa/bfad.c |2 +-
 drivers/scsi/csiostor/csio_init.c   |2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c|2 +-
 drivers/vfio/pci/vfio_pci.c |2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)
--
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 5/9] sfc: constify pci_error_handlers structures

2015-11-14 Thread Julia Lawall
This pci_error_handlers structure is never modified, like all the other
pci_error_handlers structures, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
There are no dependencies between these patches.

 drivers/net/ethernet/sfc/efx.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index d288f1c..a3c42a3 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -3422,7 +3422,7 @@ out:
  * with our request for slot reset the mmio_enabled callback will never be
  * called, and the link_reset callback is not used by AER or EEH mechanisms.
  */
-static struct pci_error_handlers efx_err_handlers = {
+static const struct pci_error_handlers efx_err_handlers = {
.error_detected = efx_io_error_detected,
.slot_reset = efx_io_slot_reset,
.resume = efx_io_resume,

--
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/9] net: cavium: liquidio: constify pci_error_handlers structures

2015-11-14 Thread Julia Lawall
This pci_error_handlers structure is never modified, like all the other
pci_error_handlers structures, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
There are no dependencies between these patches.

 drivers/net/ethernet/cavium/liquidio/lio_main.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c 
b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index f683d97..b895044 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -560,7 +560,7 @@ static int liquidio_resume(struct pci_dev *pdev)
 #endif
 
 /* For PCI-E Advanced Error Recovery (AER) Interface */
-static struct pci_error_handlers liquidio_err_handler = {
+static const struct pci_error_handlers liquidio_err_handler = {
.error_detected = liquidio_pcie_error_detected,
.mmio_enabled   = liquidio_pcie_mmio_enabled,
.slot_reset = liquidio_pcie_slot_reset,

--
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 01/14] mm: memcontrol: export root_mem_cgroup

2015-11-14 Thread Vladimir Davydov
On Thu, Nov 12, 2015 at 06:41:20PM -0500, Johannes Weiner wrote:
> A later patch will need this symbol in files other than memcontrol.c,
> so export it now and replace mem_cgroup_root_css at the same time.
> 
> Signed-off-by: Johannes Weiner 
> Acked-by: Michal Hocko 

Reviewed-by: Vladimir Davydov 
--
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/14] mm: vmscan: simplify memcg vs. global shrinker invocation

2015-11-14 Thread Vladimir Davydov
On Thu, Nov 12, 2015 at 06:41:21PM -0500, Johannes Weiner wrote:
...
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index a4507ec..e4f5b3c 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -411,6 +411,10 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
>   struct shrinker *shrinker;
>   unsigned long freed = 0;
>  
> + /* Global shrinker mode */
> + if (memcg == root_mem_cgroup)
> + memcg = NULL;
> +
>   if (memcg && !memcg_kmem_is_active(memcg))
>   return 0;
>  
> @@ -2410,11 +2414,22 @@ static bool shrink_zone(struct zone *zone, struct 
> scan_control *sc,
>   shrink_lruvec(lruvec, swappiness, sc, _pages);
>   zone_lru_pages += lru_pages;
>  
> - if (memcg && is_classzone)
> + /*
> +  * Shrink the slab caches in the same proportion that
> +  * the eligible LRU pages were scanned.
> +  */
> + if (is_classzone) {
>   shrink_slab(sc->gfp_mask, zone_to_nid(zone),
>   memcg, sc->nr_scanned - scanned,
>   lru_pages);
>  
> + if (reclaim_state) {
> + sc->nr_reclaimed +=
> + reclaim_state->reclaimed_slab;
> + reclaim_state->reclaimed_slab = 0;
> + }
> + }
> +
>   /*
>* Direct reclaim and kswapd have to scan all memory
>* cgroups to fulfill the overall scan target for the
> @@ -2432,20 +2447,6 @@ static bool shrink_zone(struct zone *zone, struct 
> scan_control *sc,
>   }
>   } while ((memcg = mem_cgroup_iter(root, memcg, )));
>  
> - /*
> -  * Shrink the slab caches in the same proportion that
> -  * the eligible LRU pages were scanned.
> -  */
> - if (global_reclaim(sc) && is_classzone)
> - shrink_slab(sc->gfp_mask, zone_to_nid(zone), NULL,
> - sc->nr_scanned - nr_scanned,
> - zone_lru_pages);
> -
> - if (reclaim_state) {
> - sc->nr_reclaimed += reclaim_state->reclaimed_slab;
> - reclaim_state->reclaimed_slab = 0;
> - }
> -

AFAICS this patch deadly breaks memcg-unaware shrinkers vs LRU balance:
currently we scan (*total* LRU scanned / *total* LRU pages) of all such
objects; with this patch we'd use the numbers from the root cgroup
instead. If most processes reside in memory cgroups, the root cgroup
will have only a few LRU pages and hence the pressure exerted upon such
objects will be unfairly severe.

Thanks,
Vladimir

>   vmpressure(sc->gfp_mask, sc->target_mem_cgroup,
>  sc->nr_scanned - nr_scanned,
>  sc->nr_reclaimed - nr_reclaimed);
--
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


Hit regression with TCP_TW REUSE/RECYCLE

2015-11-14 Thread Ethan Zhao
Hi,

   When we tested network with following case, found there is
regression with stable 4.1 kernel, connect() returns EADDRNOTAVAIL,
while a pretty old kernel 3.8 doesn't.  anybody knows about this issue
and if it was fixed later ? (I am looking for devices and will do a
test with the last stable).


#echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
#echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
#echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
#./accept -n 5 -r &
#./connect -i 127.0.0.1 -n 5 -d 10



connect.c

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

static void
usage(const char *cmd)
{
fprintf(stderr, "Usage: %s -i IPv4 [-p port] "
"[-n n_instance] [-d duration]\n", cmd);
exit(1);
}

static int global_run = 1;

static void
signal_handler(int signum)
{
global_run = 0;
}

static void
connect_loop(const struct sockaddr_in *in, const int duration, u_long *result)
{
struct itimerval it;
int sock;
u_long count = 0;

if (signal(SIGALRM, signal_handler) == SIG_ERR) {
fprintf(stderr, "signal() failed: %s\n", strerror(errno));
return;
}

it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 0;
it.it_value.tv_sec = duration;
it.it_value.tv_usec = 0;
if (setitimer(ITIMER_REAL, , NULL) < 0) {
fprintf(stderr, "setitimer() failed: %s\n", strerror(errno));
return;
}

while (global_run) {
sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
fprintf(stderr, "socket() failed: %s\n", strerror(errno));
}
if (connect(sock, (const struct sockaddr *)in, sizeof(*in)) < 0) {
fprintf(stderr, "connect() failed: %s\n", strerror(errno));
}
count++;
close(sock);
}

*result = count;
}

int
main(int argc, char *argv[])
{
char *bname;
struct sockaddr_in in;
int opt, port, ninst, duration, i;
ulong *result, sum;

memset(, 0, sizeof(in));
in.sin_family = AF_INET;

port = 7954;
ninst = 1;
duration = 10;
bname = basename(argv[0]);
while ((opt = getopt(argc, argv, "i:p:n:d:")) != -1) {
switch (opt) {
case 'i':
if (inet_pton(AF_INET, optarg, _addr) <= 0) {
fprintf(stderr, "Invalid IPv4 address: %s\n", optarg);
usage(bname);
}
break;
case 'p':
port = atoi(optarg);
break;
case 'n':
ninst = atoi(optarg);
break;
case 'd':
duration = atoi(optarg);
break;
default:
usage(bname);
}
}

if (port == 0 || ninst < 1 || duration < 1
|| in.sin_addr.s_addr == INADDR_ANY) {
usage(bname);
}

in.sin_port = htons(port);

result = mmap(NULL, ninst * sizeof(u_long), PROT_READ | PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 0);
if (result == MAP_FAILED) {
fprintf(stderr, "mmap() failed: %s\n", strerror(errno));
exit(1);
}
memset(result, 0, ninst * sizeof(u_long));

for (i = 0; i < ninst; i++) {
pid_t pid;
pid = fork();
if (pid == 0) { /* fork() succeeded, in child */
connect_loop(, duration, [i]);
exit(0);
} else {
if (pid < 0) { /* fork() failed */
fprintf(stderr, "fork() failed: %s\n", strerror(errno));
exit(1);
}
}
}

/* waiting for all children to terminate */
while (wait(NULL)) {
if (errno == ECHILD) {
break;
}
}

sum = 0;
for (i = 0; i < ninst; i++) {
sum += result[i];
}
printf("%.2f\n", (double)sum / (double)duration);

exit(0);
}
---
accept.c

#include 
#include 
#include 
#include 
#include 
#include 
#include 

static void
usage(const char *cmd)
{
fprintf(stderr, "%s -p port [-n n_instance] [-r]\n", cmd);
exit(1);
}

static int
create_bind_listen(const struct sockaddr_in *in, const int reuseport)
{
int sock, ov;

sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
fprintf(stderr, "socket() failed: %s\n", strerror(errno));
exit(1);
}

ov = 1;
if (reuseport) {
if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, , sizeof(ov)) < 0) {
fprintf(stderr, "setsockopt(REUSEPORT) failed: %s\n",
strerror(errno));
exit(1);
}
} else {
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, , sizeof(ov)) < 0) {
fprintf(stderr, "setsockopt(REUSEADDR) failed: %s\n",
strerror(errno));
exit(1);
}
}

if (bind(sock, (const struct 

Re: [PATCH] bonding: Offloading bonds to hardware

2015-11-14 Thread John Fastabend
On 15-11-14 01:39 AM, Jiri Pirko wrote:
> Thu, Nov 12, 2015 at 05:02:18PM CET, pjonn...@broadcom.com wrote:
>> Packet forwarding to/from bond interfaces is done in software.
>>
>> This patch enables certain platforms to bridge traffic to/from
>> bond interfaces in hardware.  Notifications are sent out when 
>> the "active" slave set for a bond interface is updated in 
>> software.  Platforms use the notifications to program the 
>> hardware accordingly.  The changes have been verified to work 
>> with configured and 802.3ad bond interfaces.
>>
>> Signed-off-by: Premkumar Jonnala 
> 
> This patch is wrong, in many different acpects. Leaving the submission
> style, and no in-tree consumer aside, adding ndos for this thing is
> unacceptable. It should be handled as a part of switchdev attrs.

Why is it unacceptable? I think its at least worth debating. If I
have a nic that can do bonding but none of the other switchdev
things then implementing another ndo is certainly more straight
forward. As it is heading many of the 10+Gbps nics may need to
implement just enough of the switchdev infrastructure to get things
like bonding up and working. Not necessarily a bad thing if we make
the switchdev infrastructure light but does sort of make the name
confusing if my nic is not doing any switching ;)

Thanks,
John

> Also, the solution should not be bonding-centric.
> 
> I have a patchset in my queue which does this correctly, for bond and team
> using switchdev attr and with actual in-tree consumer, mlxsw driver.
> I plan to send that soon after net-next opens.
> 
> Jiri
> --
> 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
> 

--
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: net-ipv6: Delete unnecessary checks before the function call "kfree_skb"

2015-11-14 Thread SF Markus Elfring
> While if the test is done in kfree_skb(), the branch predictor of the
> cpu wont be able to predict things.
> 
> By feeding too many NULL pointers to kfree_skb(), we slow down it.

Would it make sense to annotate checks before such function calls
as "UNLIKELY"?

Regards,
Markus
--
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: [net] net: fix feature changes on devices without ndo_set_features

2015-11-14 Thread Dave Young
On 11/13/15 at 02:54pm, Nikolay Aleksandrov wrote:
> From: Nikolay Aleksandrov 
> 
> When __netdev_update_features() was updated to ensure some features are
> disabled on new lower devices, an error was introduced for devices which
> don't have the ndo_set_features() method set. Before we'll just set the
> new features, but now we return an error and don't set them. Fix this by
> returning the old behaviour and setting err to 0 when ndo_set_features
> is not present.
> 
> Fixes: e7868a85e1b2 ("net/core: ensure features get disabled on new lower 
> devs")
> CC: Jarod Wilson 
> CC: Jiri Pirko 
> CC: Ido Schimmel 
> CC: Sander Eikelenboom 
> CC: Andy Gospodarek 
> CC: Florian Fainelli 
> Signed-off-by: Nikolay Aleksandrov 
> Reviewed-by: Jiri Pirko 
> Reviewed-by: Andy Gospodarek 
> Reviewed-by: Jarod Wilson 
> Tested-by: Florian Fainelli 
> ---
> Sander please feel free to give your Tested-by.
> 
>  net/core/dev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index ab9b8d0d115e..4a1d198dbbff 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6426,6 +6426,8 @@ int __netdev_update_features(struct net_device *dev)
>  
>   if (dev->netdev_ops->ndo_set_features)
>   err = dev->netdev_ops->ndo_set_features(dev, features);
> + else
> + err = 0;
>  
>   if (unlikely(err < 0)) {
>   netdev_err(dev,

Tested-by: Dave Young 

Thanks
Dave
--
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] tcp: ensure proper barriers in lockless contexts

2015-11-14 Thread Eric Dumazet
On Sun, 2015-11-15 at 09:20 +0800, Herbert Xu wrote:
> Eric Dumazet  wrote:
> > From: Eric Dumazet 
> > 
> > Some functions access TCP sockets without holding a lock and
> > might output non consistent data, depending on compiler and or
> > architecture.
> > 
> > tcp_diag_get_info(), tcp_get_info(), tcp_poll(), get_tcp4_sock() ...
> 
> For the information gathering ones such as tcp_diag_get_info I'm
> wondering whether we really need these memory barriers.  After all,
> if it's truly lockless then surely the TCP socket state can change
> again after you load the state the first time, in which case the
> barrier becomes completely meaningless.

Not a big deal, no crash or kernel instability, just making the
information a bit more consistent.

They are not truly needed, but the patch avoids some discrepancies when
an observer gets the data, for a minimum cost ( compiler barrier() in
most cases)

Like : 

   state = sk_state_load(sp);
   if (state == TCP_LISTEN)
   rx_queue = sp->sk_ack_backlog;
   else
   /* Because we don't lock the socket,
* we might find a transient negative value.
*/
   rx_queue = max_t(int, tp->rcv_nxt - tp->copied_seq, 0);

or :

   if (sk_state_load(sk) == TCP_LISTEN) {
r->idiag_rqueue = sk->sk_ack_backlog;
r->idiag_wqueue = sk->sk_max_ack_backlog;


This patch makes sure sk_ack_backlog is written before sk_state is set
to TCP_LISTEN, otherwise one could see a '0' listener backlog.

We had a spurious kernel log for a similar issue that was solved in
commit f985c65c908f6b26c30019a83dc5ea295f5fcf62
("tcp: avoid spurious SYN flood detection at listen() time")

Sure, we can live with a spurious log, but experience showed that taking
care of this early could avoid lot of hassle, say in 12 months when
people start using linux-4.4 

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 net] tcp: ensure proper barriers in lockless contexts

2015-11-14 Thread Herbert Xu
On Sat, Nov 14, 2015 at 07:21:41PM -0800, Eric Dumazet wrote:
>
> This patch makes sure sk_ack_backlog is written before sk_state is set
> to TCP_LISTEN, otherwise one could see a '0' listener backlog.
> 
> We had a spurious kernel log for a similar issue that was solved in
> commit f985c65c908f6b26c30019a83dc5ea295f5fcf62
> ("tcp: avoid spurious SYN flood detection at listen() time")
> 
> Sure, we can live with a spurious log, but experience showed that taking
> care of this early could avoid lot of hassle, say in 12 months when
> people start using linux-4.4 

Oh I have no problems whatsoever with adding barriers where they
are needed, such as in this particular spot.  What I do have an
issue with though is the fact that your patch in its current form
may give future TCP developers a false sense of security.

I know that you as the person who added these helpers know exactly
what they do and don't do.  But the next guy who comes along may
not have that complete understanding and they may think that these
helpers give them the right to do things locklessly.

So personally I'd prefer explicit barriers in the spots where they
are needed with detailed comments as opposed to these helpers which
appear to offer guarrantees that they can't really give.

Or perhaps give these helpers names that make people think twice,
e.g., tcp_load_state_unsafe.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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-ipv6: Delete unnecessary checks before the function call "kfree_skb"

2015-11-14 Thread Eric Dumazet
On Sat, 2015-11-14 at 20:05 +0100, SF Markus Elfring wrote:
> From: Markus Elfring 
> Date: Sat, 14 Nov 2015 19:55:00 +0100
> 
> The kfree_skb() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the calls is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring 
> ---
>  net/ipv6/af_inet6.c | 7 ++-
>  net/ipv6/netfilter/nf_conntrack_reasm.c | 3 +--
>  2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> index 44bb66b..4cd9259 100644
> --- a/net/ipv6/af_inet6.c
> +++ b/net/ipv6/af_inet6.c
> @@ -416,12 +416,9 @@ void inet6_destroy_sock(struct sock *sk)
>   /* Release rx options */
>  
>   skb = xchg(>pktoptions, NULL);
> - if (skb)
> - kfree_skb(skb);
> -
> + kfree_skb(skb);
>   skb = xchg(>rxpmtu, NULL);
> - if (skb)
> - kfree_skb(skb);
> + kfree_skb(skb);
>  

There is no 'issue' here, or not this one.

In most cases, these pointers are NULL, so the test can be predicted by
the processor.

While if the test is done in kfree_skb(), the branch predictor of the
cpu wont be able to predict things.

By feeding too many NULL pointers to kfree_skb(), we slow down it.

Branch misses and hits were considered important years ago...

But seeing this inet6_destroy_sock() is (ab)using xchg() three times, I
am not sure author cared that much about performance.



--
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] dl2k: Add support for IP1000A-based cards

2015-11-14 Thread Andy Shevchenko
On Sun, Nov 15, 2015 at 12:05 AM, Ondrej Zary
 wrote:
> Add support for IP1000A chips to dl2k driver.
> IP1000A chip looks like a TC9020 with integrated PHY.
>
> This allows IP1000A chips to work reliably because the ipg driver is
> buggy - it loses packets under load and then completely stops
> transmitting data.
>
> Tested with Asus NX1101 v2.0 at 10, 100 and 1000Mbps.
> Also verified that it does not break D-Link DGE-550T.
>
> Signed-off-by: Ondrej Zary 

Nitpicks below.

> --- a/drivers/net/ethernet/dlink/dl2k.c
> +++ b/drivers/net/ethernet/dlink/dl2k.c
> @@ -253,6 +253,18 @@ rio_probe1 (struct pci_dev *pdev, const struct 
> pci_device_id *ent)
> if (err)
> goto err_out_unmap_rx;
>
> +   if (np->chip_id == CHIP_IP1000A &&
> +   (np->pdev->revision == 0x40 || np->pdev->revision == 0x41)) {
> +   /* PHY magic taken from ipg driver */
> +   mii_write(dev, np->phy_addr, 31, 0x0001);
> +   mii_write(dev, np->phy_addr, 27, 0x01e0);
> +   mii_write(dev, np->phy_addr, 31, 0x0002);
> +   mii_write(dev, np->phy_addr, 27, 0xeb8e);
> +   mii_write(dev, np->phy_addr, 31, 0x);
> +   mii_write(dev, np->phy_addr, 30, 0x005e);
> +   mii_write(dev, np->phy_addr, 9, 0x0700);

Isn't too many magic numbers?

> +   }
> +
> /* Fiber device? */
> np->phy_media = (dr16(ASICCtrl) & PhyMedia) ? 1 : 0;
> np->link_status = 0;
> @@ -361,6 +373,11 @@ parse_eeprom (struct net_device *dev)
> for (i = 0; i < 6; i++)
> dev->dev_addr[i] = psrom->mac_addr[i];
>
> +   if (np->chip_id == CHIP_IP1000A) {
> +   np->led_mode = psrom->led_mode;
> +   return 0;
> +   }
> +
> if (np->pdev->vendor != PCI_VENDOR_ID_DLINK) {
> return 0;
> }
> @@ -406,6 +423,28 @@ parse_eeprom (struct net_device *dev)
> return 0;
>  }
>
> +static void rio_set_led_mode(struct net_device *dev)
> +{
> +   struct netdev_private *np = netdev_priv(dev);
> +   void __iomem *ioaddr = np->ioaddr;
> +   u32 mode;
> +
> +   if (np->chip_id != CHIP_IP1000A)
> +   return;
> +
> +   mode = dr32(ASICCtrl);
> +   mode &= ~(IPG_AC_LED_MODE_BIT_1 | IPG_AC_LED_MODE | IPG_AC_LED_SPEED);
> +
> +   if ((np->led_mode & 0x03) > 1)

Isn't "& 0x03) > 1" the same as plain "& 0x02"?

> +   mode |= IPG_AC_LED_MODE_BIT_1;
> +   if ((np->led_mode & 0x01) == 1)

Hmm… Seems redundant == 1.

> +   mode |= IPG_AC_LED_MODE;
> +   if ((np->led_mode & 0x08) == 8)

Similar here.

> +   mode |= IPG_AC_LED_SPEED;
> +
> +   dw32(ASICCtrl, mode);
> +}
> +
>  static int
>  rio_open (struct net_device *dev)
>  {
> @@ -424,6 +463,8 @@ rio_open (struct net_device *dev)
>  GlobalReset | DMAReset | FIFOReset | NetworkReset | HostReset);
> mdelay(10);
>
> +   rio_set_led_mode(dev);
> +
> /* DebugCtrl bit 4, 5, 9 must set */
> dw32(DebugCtrl, dr32(DebugCtrl) | 0x0230);
>
> @@ -433,9 +474,10 @@ rio_open (struct net_device *dev)
>
> alloc_list (dev);
>
> -   /* Get station address */
> -   for (i = 0; i < 6; i++)
> -   dw8(StationAddr0 + i, dev->dev_addr[i]);
> +   /* Set station address */
> +   for (i = 0; i < 3; i++)
> +   dw16(StationAddr0 + 2 * i,
> +cpu_to_le16(((u16 *)dev->dev_addr)[i]));

Is it specific requirement for new HW? If not, may be another patch
with micro optimizations.

>
> set_multicast (dev);
> if (np->coalesce) {
> @@ -780,6 +822,7 @@ tx_error (struct net_device *dev, int tx_status)
> break;
> mdelay (1);
> }
> +   rio_set_led_mode(dev);
> rio_free_tx (dev, 1);
> /* Reset TFDListPtr */
> dw32(TFDListPtr0, np->tx_ring_dma +
> @@ -799,6 +842,7 @@ tx_error (struct net_device *dev, int tx_status)
> break;
> mdelay (1);
> }
> +   rio_set_led_mode(dev);
> /* Let TxStartThresh stay default value */
> }
> /* Maximum Collisions */
> @@ -965,6 +1009,7 @@ rio_error (struct net_device *dev, int int_status)
> dev->name, int_status);
> dw16(ASICCtrl + 2, GlobalReset | HostReset);
> mdelay (500);
> +   rio_set_led_mode(dev);
> }
>  }
>
> diff --git a/drivers/net/ethernet/dlink/dl2k.h 
> b/drivers/net/ethernet/dlink/dl2k.h
> index 23c07b0..8f4f612 100644
> --- a/drivers/net/ethernet/dlink/dl2k.h
> +++ b/drivers/net/ethernet/dlink/dl2k.h
> @@ -211,6 +211,10 @@ enum ASICCtrl_HiWord_bits {
> ResetBusy = 0x0400,
>  };
>
> +#define IPG_AC_LED_MODEBIT(14)
> 

[PATCH] wireless: change cfg80211 regulatory domain info as debug messages

2015-11-14 Thread Dave Young
cfg80211 module prints a lot of messages like below. Actually printing
once is acceptable but sometimes it will print again and again, it looks
very annoying. It is better to change these detail messages to debugging
only.

cfg80211: World regulatory domain updated:
cfg80211:  DFS Master region: unset
cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), 
(dfs_cac_time)
cfg80211:   (2402000 KHz - 2472000 KHz @ 4 KHz), (N/A, 2000 mBm), (N/A)
cfg80211:   (2457000 KHz - 2482000 KHz @ 4 KHz), (N/A, 2000 mBm), (N/A)
cfg80211:   (2474000 KHz - 2494000 KHz @ 2 KHz), (N/A, 2000 mBm), (N/A)
cfg80211:   (517 KHz - 525 KHz @ 8 KHz, 16 KHz AUTO), (N/A, 
2000 mBm), (N/A)
cfg80211:   (525 KHz - 533 KHz @ 8 KHz, 16 KHz AUTO), (N/A, 
2000 mBm), (0 s)
cfg80211:   (549 KHz - 573 KHz @ 16 KHz), (N/A, 2000 mBm), (0 s)
cfg80211:   (5735000 KHz - 5835000 KHz @ 8 KHz), (N/A, 2000 mBm), (N/A)
cfg80211:   (5724 KHz - 6372 KHz @ 216 KHz), (N/A, 0 mBm), (N/A)

The changes in this patch is to replace pr_info with pr_debug in function
print_rd_rules and print_regdomain_info

Signed-off-by: Dave Young 
---
 net/wireless/reg.c |   24 
 1 file changed, 12 insertions(+), 12 deletions(-)

--- linux.orig/net/wireless/reg.c
+++ linux/net/wireless/reg.c
@@ -2763,7 +2763,7 @@ static void print_rd_rules(const struct
const struct ieee80211_power_rule *power_rule = NULL;
char bw[32], cac_time[32];
 
-   pr_info("  (start_freq - end_freq @ bandwidth), (max_antenna_gain, 
max_eirp), (dfs_cac_time)\n");
+   pr_debug("  (start_freq - end_freq @ bandwidth), (max_antenna_gain, 
max_eirp), (dfs_cac_time)\n");
 
for (i = 0; i < rd->n_reg_rules; i++) {
reg_rule = >reg_rules[i];
@@ -2790,7 +2790,7 @@ static void print_rd_rules(const struct
 * in certain regions
 */
if (power_rule->max_antenna_gain)
-   pr_info("  (%d KHz - %d KHz @ %s), (%d mBi, %d mBm), 
(%s)\n",
+   pr_debug("  (%d KHz - %d KHz @ %s), (%d mBi, %d mBm), 
(%s)\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
bw,
@@ -2798,7 +2798,7 @@ static void print_rd_rules(const struct
power_rule->max_eirp,
cac_time);
else
-   pr_info("  (%d KHz - %d KHz @ %s), (N/A, %d mBm), 
(%s)\n",
+   pr_debug("  (%d KHz - %d KHz @ %s), (N/A, %d mBm), 
(%s)\n",
freq_range->start_freq_khz,
freq_range->end_freq_khz,
bw,
@@ -2831,35 +2831,35 @@ static void print_regdomain(const struct
struct cfg80211_registered_device *rdev;
rdev = cfg80211_rdev_by_wiphy_idx(lr->wiphy_idx);
if (rdev) {
-   pr_info("Current regulatory domain updated by 
AP to: %c%c\n",
+   pr_debug("Current regulatory domain updated by 
AP to: %c%c\n",
rdev->country_ie_alpha2[0],
rdev->country_ie_alpha2[1]);
} else
-   pr_info("Current regulatory domain 
intersected:\n");
+   pr_debug("Current regulatory domain 
intersected:\n");
} else
-   pr_info("Current regulatory domain intersected:\n");
+   pr_debug("Current regulatory domain intersected:\n");
} else if (is_world_regdom(rd->alpha2)) {
-   pr_info("World regulatory domain updated:\n");
+   pr_debug("World regulatory domain updated:\n");
} else {
if (is_unknown_alpha2(rd->alpha2))
-   pr_info("Regulatory domain changed to driver built-in 
settings (unknown country)\n");
+   pr_debug("Regulatory domain changed to driver built-in 
settings (unknown country)\n");
else {
if (reg_request_cell_base(lr))
-   pr_info("Regulatory domain changed to country: 
%c%c by Cell Station\n",
+   pr_debug("Regulatory domain changed to country: 
%c%c by Cell Station\n",
rd->alpha2[0], rd->alpha2[1]);
else
-   pr_info("Regulatory domain changed to country: 
%c%c\n",
+   pr_debug("Regulatory domain changed to country: 
%c%c\n",
rd->alpha2[0], rd->alpha2[1]);
}
}
 
-   pr_info(" DFS Master region: %s", 

Re: [PATCH 03/14] net: tcp_memcontrol: properly detect ancestor socket pressure

2015-11-14 Thread Vladimir Davydov
On Thu, Nov 12, 2015 at 06:41:22PM -0500, Johannes Weiner wrote:
> When charging socket memory, the code currently checks only the local
> page counter for excess to determine whether the memcg is under socket
> pressure. But even if the local counter is fine, one of the ancestors
> could have breached its limit, which should also force this child to
> enter socket pressure. This currently doesn't happen.
> 
> Fix this by using page_counter_try_charge() first. If that fails, it
> means that either the local counter or one of the ancestors are in
> excess of their limit, and the child should enter socket pressure.
> 
> Signed-off-by: Johannes Weiner 

Reviewed-by: Vladimir Davydov 

For the record: it was broken by commit 3e32cb2e0a12 ("mm: memcontrol:
lockless page counters").
--
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/14] mm: vmscan: simplify memcg vs. global shrinker invocation

2015-11-14 Thread Johannes Weiner
On Sat, Nov 14, 2015 at 03:36:50PM +0300, Vladimir Davydov wrote:
> On Thu, Nov 12, 2015 at 06:41:21PM -0500, Johannes Weiner wrote:
> > @@ -2432,20 +2447,6 @@ static bool shrink_zone(struct zone *zone, struct 
> > scan_control *sc,
> > }
> > } while ((memcg = mem_cgroup_iter(root, memcg, )));
> >  
> > -   /*
> > -* Shrink the slab caches in the same proportion that
> > -* the eligible LRU pages were scanned.
> > -*/
> > -   if (global_reclaim(sc) && is_classzone)
> > -   shrink_slab(sc->gfp_mask, zone_to_nid(zone), NULL,
> > -   sc->nr_scanned - nr_scanned,
> > -   zone_lru_pages);
> > -
> > -   if (reclaim_state) {
> > -   sc->nr_reclaimed += reclaim_state->reclaimed_slab;
> > -   reclaim_state->reclaimed_slab = 0;
> > -   }
> > -
> 
> AFAICS this patch deadly breaks memcg-unaware shrinkers vs LRU balance:
> currently we scan (*total* LRU scanned / *total* LRU pages) of all such
> objects; with this patch we'd use the numbers from the root cgroup
> instead. If most processes reside in memory cgroups, the root cgroup
> will have only a few LRU pages and hence the pressure exerted upon such
> objects will be unfairly severe.

You're absolutely right, good catch.

Please disregard this patch. It's not necessary for this series after
v2, I just kept it because I thought it's a nice simplification that's
possible after making root_mem_cgroup public.
--
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 v2 net] raw: increment correct SNMP counters for ICMP messages

2015-11-14 Thread Ben Cartwright-Cox
Sending ICMP packets with raw sockets ends up in the SNMP counters
logging the type as the first byte of the IPv4 header rather than
the ICMP header. This is fixed by adding the IP Header Length to
the casting into a icmphdr struct.

Signed-off-by: Ben Cartwright-Cox 
Acked-by: Eric Dumazet 
---
 net/ipv4/raw.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 561cd4b..ef3c9ba 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -406,10 +406,12 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 
*fl4,
ip_select_ident(net, skb, NULL);
 
iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
+   skb->transport_header += iphlen;
+   if (iph->protocol == IPPROTO_ICMP &&
+   length >= iphlen + sizeof(struct icmphdr))
+   icmp_out_count(net, ((struct icmphdr *)
+   skb_transport_header(skb))->type);
}
-   if (iph->protocol == IPPROTO_ICMP)
-   icmp_out_count(net, ((struct icmphdr *)
-   skb_transport_header(skb))->type);
 
err = NF_HOOK(NFPROTO_IPV4, NF_INET_LOCAL_OUT, sk, skb,
  NULL, rt->dst.dev, dst_output_sk);
-- 
1.9.1

--
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] brcmfmac: constify brcmf_bus_ops structures

2015-11-14 Thread Julia Lawall
The brcmf_bus_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/net/wireless/brcm80211/brcmfmac/bus.h  |2 +-
 drivers/net/wireless/brcm80211/brcmfmac/pcie.c |2 +-
 drivers/net/wireless/brcm80211/brcmfmac/sdio.c |2 +-
 drivers/net/wireless/brcm80211/brcmfmac/usb.c  |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bus.h 
b/drivers/net/wireless/brcm80211/brcmfmac/bus.h
index 230cad7..36093f9 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bus.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bus.h
@@ -137,7 +137,7 @@ struct brcmf_bus {
bool always_use_fws_queue;
bool wowl_supported;
 
-   struct brcmf_bus_ops *ops;
+   const struct brcmf_bus_ops *ops;
struct brcmf_bus_msgbuf *msgbuf;
 };
 
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c 
b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c
index 83d8042..65ae3b0 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/pcie.c
@@ -1419,7 +1419,7 @@ static int brcmf_pcie_get_memdump(struct device *dev, 
void *data, size_t len)
 }
 
 
-static struct brcmf_bus_ops brcmf_pcie_bus_ops = {
+static const struct brcmf_bus_ops brcmf_pcie_bus_ops = {
.txdata = brcmf_pcie_tx,
.stop = brcmf_pcie_down,
.txctl = brcmf_pcie_tx_ctlpkt,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c 
b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
index 7e74ac3..01f359e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
@@ -4025,7 +4025,7 @@ brcmf_sdio_watchdog(unsigned long data)
}
 }
 
-static struct brcmf_bus_ops brcmf_sdio_bus_ops = {
+static const struct brcmf_bus_ops brcmf_sdio_bus_ops = {
.stop = brcmf_sdio_bus_stop,
.preinit = brcmf_sdio_bus_preinit,
.txdata = brcmf_sdio_bus_txdata,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c 
b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index 689e64d..4bdd3b3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -1163,7 +1163,7 @@ static void brcmf_usb_wowl_config(struct device *dev, 
bool enabled)
device_set_wakeup_enable(devinfo->dev, false);
 }
 
-static struct brcmf_bus_ops brcmf_usb_bus_ops = {
+static const struct brcmf_bus_ops brcmf_usb_bus_ops = {
.txdata = brcmf_usb_tx,
.stop = brcmf_usb_down,
.txctl = brcmf_usb_tx_ctlpkt,

--
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 11/14] mm: memcontrol: do not account memory+swap on unified hierarchy

2015-11-14 Thread Vladimir Davydov
On Thu, Nov 12, 2015 at 06:41:30PM -0500, Johannes Weiner wrote:
> The unified hierarchy memory controller doesn't expose the memory+swap
> counter to userspace, but its accounting is hardcoded in all charge
> paths right now, including the per-cpu charge cache ("the stock").
> 
> To avoid adding yet more pointless memory+swap accounting with the
> socket memory support in unified hierarchy, disable the counter
> altogether when in unified hierarchy mode.
> 
> Signed-off-by: Johannes Weiner 

Reviewed-by: Vladimir Davydov 
--
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 10/14] mm: memcontrol: generalize the socket accounting jump label

2015-11-14 Thread Vladimir Davydov
On Thu, Nov 12, 2015 at 06:41:29PM -0500, Johannes Weiner wrote:
> The unified hierarchy memory controller is going to use this jump
> label as well to control the networking callbacks. Move it to the
> memory controller code and give it a more generic name.
> 
> Signed-off-by: Johannes Weiner 

Reviewed-by: Vladimir Davydov 
--
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 03/14] net: tcp_memcontrol: properly detect ancestor socket pressure

2015-11-14 Thread Johannes Weiner
On Sat, Nov 14, 2015 at 03:45:52PM +0300, Vladimir Davydov wrote:
> On Thu, Nov 12, 2015 at 06:41:22PM -0500, Johannes Weiner wrote:
> > When charging socket memory, the code currently checks only the local
> > page counter for excess to determine whether the memcg is under socket
> > pressure. But even if the local counter is fine, one of the ancestors
> > could have breached its limit, which should also force this child to
> > enter socket pressure. This currently doesn't happen.
> > 
> > Fix this by using page_counter_try_charge() first. If that fails, it
> > means that either the local counter or one of the ancestors are in
> > excess of their limit, and the child should enter socket pressure.
> > 
> > Signed-off-by: Johannes Weiner 
> 
> Reviewed-by: Vladimir Davydov 

Thanks Vladimir!

> For the record: it was broken by commit 3e32cb2e0a12 ("mm: memcontrol:
> lockless page counters").

I didn't realize that.

Fixes: 3e32cb2e0a12 ("mm: memcontrol: lockless page counters")
--
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] ipvs: use skb_to_full_sk() helper

2015-11-14 Thread Simon Horman
[Attn Dave]
[Cc Pablo]

On Sat, Nov 14, 2015 at 01:37:46PM +0200, Julian Anastasov wrote:
> 
>   Hello,
> 
> On Thu, 12 Nov 2015, Eric Dumazet wrote:
> 
> > From: Eric Dumazet 
> > 
> > SYNACK packets might be attached to request sockets.
> > 
> > Use skb_to_full_sk() helper to avoid illegal accesses to
> > inet_sk(skb->sk)
> > 
> > Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets 
> > instead of listener")
> > Signed-off-by: Eric Dumazet 
> > Reported-by: Sander Eikelenboom 
> 
>   Looks good, I guess Simon will take the patch for
> the ipvs tree.
> 
> Acked-by: Julian Anastasov 

Dave,

It looks like this patch has a compile-time dependency on
54abc686c2d1 ("net: add skb_to_full_sk() helper and use it in
selinux_netlbl_skbuff_setsid()") which is currently present in
net but not nf. The latter tree is the usual path for IPVS fixes.

With the above in mind I think it would be easiest if you could
pick this patch up directly and add it to net with:

Acked-by: Simon Horman 

An alternative would be for Pablo to merge net into nf and
for me to then prepare a pull request for him. But it seems a bit
excessive for what otherwise appears to be a straightforward patch.

> > ---
> >  net/netfilter/ipvs/ip_vs_core.c |   16 
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/net/netfilter/ipvs/ip_vs_core.c 
> > b/net/netfilter/ipvs/ip_vs_core.c
> > index 1e24fff53e4b..f57b4dcdb233 100644
> > --- a/net/netfilter/ipvs/ip_vs_core.c
> > +++ b/net/netfilter/ipvs/ip_vs_core.c
> > @@ -1176,6 +1176,7 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int 
> > hooknum, struct sk_buff *skb, in
> > struct ip_vs_protocol *pp;
> > struct ip_vs_proto_data *pd;
> > struct ip_vs_conn *cp;
> > +   struct sock *sk;
> >  
> > EnterFunction(11);
> >  
> > @@ -1183,13 +1184,12 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int 
> > hooknum, struct sk_buff *skb, in
> > if (skb->ipvs_property)
> > return NF_ACCEPT;
> >  
> > +   sk = skb_to_full_sk(skb);
> > /* Bad... Do not break raw sockets */
> > -   if (unlikely(skb->sk != NULL && hooknum == NF_INET_LOCAL_OUT &&
> > +   if (unlikely(sk && hooknum == NF_INET_LOCAL_OUT &&
> >  af == AF_INET)) {
> > -   struct sock *sk = skb->sk;
> > -   struct inet_sock *inet = inet_sk(skb->sk);
> >  
> > -   if (inet && sk->sk_family == PF_INET && inet->nodefrag)
> > +   if (sk->sk_family == PF_INET && inet_sk(sk)->nodefrag)
> > return NF_ACCEPT;
> > }
> >  
> > @@ -1681,6 +1681,7 @@ ip_vs_in(struct netns_ipvs *ipvs, unsigned int 
> > hooknum, struct sk_buff *skb, int
> > struct ip_vs_conn *cp;
> > int ret, pkts;
> > int conn_reuse_mode;
> > +   struct sock *sk;
> >  
> > /* Already marked as IPVS request or reply? */
> > if (skb->ipvs_property)
> > @@ -1708,12 +1709,11 @@ ip_vs_in(struct netns_ipvs *ipvs, unsigned int 
> > hooknum, struct sk_buff *skb, int
> > ip_vs_fill_iph_skb(af, skb, false, );
> >  
> > /* Bad... Do not break raw sockets */
> > -   if (unlikely(skb->sk != NULL && hooknum == NF_INET_LOCAL_OUT &&
> > +   sk = skb_to_full_sk(skb);
> > +   if (unlikely(sk && hooknum == NF_INET_LOCAL_OUT &&
> >  af == AF_INET)) {
> > -   struct sock *sk = skb->sk;
> > -   struct inet_sock *inet = inet_sk(skb->sk);
> >  
> > -   if (inet && sk->sk_family == PF_INET && inet->nodefrag)
> > +   if (sk->sk_family == PF_INET && inet_sk(sk)->nodefrag)
> > return NF_ACCEPT;
> > }
> 
> 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


Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label

2015-11-14 Thread Vladimir Davydov
On Thu, Nov 12, 2015 at 06:41:24PM -0500, Johannes Weiner wrote:
> Move the jump-label from sock_update_memcg() and sock_release_memcg()
> to the callsite, and so eliminate those function calls when socket
> accounting is not enabled.

I don't believe this patch's necessary, because these functions aren't
hot paths. Neither do I think it makes the code look better. Anyway,
it's rather a matter of personal preference, and the patch looks correct
to me, so

Reviewed-by: Vladimir Davydov 

> 
> This also eliminates the need for dummy functions because the calls
> will be optimized away if the Kconfig options are not enabled.
> 
> Signed-off-by: Johannes Weiner 
--
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-ipv6: Delete unnecessary checks before the function call "kfree_skb"

2015-11-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 14 Nov 2015 19:55:00 +0100

The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 net/ipv6/af_inet6.c | 7 ++-
 net/ipv6/netfilter/nf_conntrack_reasm.c | 3 +--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 44bb66b..4cd9259 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -416,12 +416,9 @@ void inet6_destroy_sock(struct sock *sk)
/* Release rx options */
 
skb = xchg(>pktoptions, NULL);
-   if (skb)
-   kfree_skb(skb);
-
+   kfree_skb(skb);
skb = xchg(>rxpmtu, NULL);
-   if (skb)
-   kfree_skb(skb);
+   kfree_skb(skb);
 
/* Free flowlabels */
fl6_free_socklist(sk);
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c 
b/net/ipv6/netfilter/nf_conntrack_reasm.c
index d5efeb8..dbc013b 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -172,8 +172,7 @@ static unsigned int nf_hashfn(const struct inet_frag_queue 
*q)
 
 static void nf_skb_free(struct sk_buff *skb)
 {
-   if (NFCT_FRAG6_CB(skb)->orig)
-   kfree_skb(NFCT_FRAG6_CB(skb)->orig);
+   kfree_skb(NFCT_FRAG6_CB(skb)->orig);
 }
 
 static void nf_ct_frag6_expire(unsigned long data)
-- 
2.6.2

--
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] mac802154: Delete an unnecessary check before the function call "kfree_skb"

2015-11-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 14 Nov 2015 20:22:41 +0100

The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 net/mac802154/rx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
index 42e9672..446e130 100644
--- a/net/mac802154/rx.c
+++ b/net/mac802154/rx.c
@@ -217,8 +217,7 @@ __ieee802154_rx_handle_packet(struct ieee802154_local 
*local,
break;
}
 
-   if (skb)
-   kfree_skb(skb);
+   kfree_skb(skb);
 }
 
 static void
-- 
2.6.2

--
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: dsa: Delete an unnecessary check before the function call "put_device"

2015-11-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 14 Nov 2015 17:58:00 +0100

The put_device() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 net/dsa/dsa.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 1eba07f..045d776 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -671,8 +671,7 @@ static void dsa_of_free_platform_data(struct 
dsa_platform_data *pd)
kfree(pd->chip[i].rtable);
 
/* Drop our reference to the MDIO bus device */
-   if (pd->chip[i].host_dev)
-   put_device(pd->chip[i].host_dev);
+   put_device(pd->chip[i].host_dev);
}
kfree(pd->chip);
 }
-- 
2.6.2

--
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 -stable] multiple backports requested

2015-11-14 Thread David Miller
From: "Charles (Chas) Williams" <3ch...@gmail.com>
Date: Sat, 14 Nov 2015 06:34:15 -0500

> On Fri, 2015-11-13 at 16:10 -0500, David Miller wrote:
>> From: "Charles (Chas) Williams" <3ch...@gmail.com>
>> Date: Fri, 13 Nov 2015 15:13:11 -0500
>> 
>> > Dave, could you please add the following backports?
>> > 
>> > For the 3.14.y stable queue:
>> 
>> I am no longer handling 3.14.y -stable submissions, sorry...
>> 
>> > For the 4.1.y stable queue:
>> > 
>> >commit 74e98eb085889b0d2d4908f59f6e00026063014f
>> >RDS: verify the underlying transport exists before creating a connection
>> >This addresses CVE-2015-6937
>> 
>> Queued up for 3.18, 4.1, and 4.2.
> 
> And 3.14?

Can you read what I said?  You even quoted it.  I said explicitly
that I'm not handling 3.14.y -stable submissions.
--
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 stable <= 3.18] net: add length argument to skb_copy_and_csum_datagram_iovec

2015-11-14 Thread Ben Hutchings
On Thu, 2015-10-15 at 14:25 +0200, Sabrina Dubroca wrote:
> Without this length argument, we can read past the end of the iovec
> in
> memcpy_toiovec because we have no way of knowing the total length of
> the
> iovec's buffers.
> 
> This is needed for stable kernels where 89c22d8c3b27 ("net: Fix skb
> csum races when peeking") has been backported but that don't have the
> ioviter conversion, which is almost all the stable trees <= 3.18.
> 
> This also fixes a kernel crash for NFS servers when the client uses
>  -onfsvers=3,proto=udp to mount the export.
> 
> Signed-off-by: Sabrina Dubroca 
> Reviewed-by: Hannes Frederic Sowa 
> ---
> Note: this is based on 3.14.54, as 3.18 doesn't need the hunk for
> net/rxrpc/ar-recvmsg.c, but all older stable kernels do.
[...]

Queued up for 3.2, thanks.

Ben.

-- 
Ben Hutchings
Everything should be made as simple as possible, but not simpler.
   - Albert Einstein


signature.asc
Description: This is a digitally signed message part


[PATCH 1/2] dl2k: Add support for IP1000A-based cards

2015-11-14 Thread Ondrej Zary
Add support for IP1000A chips to dl2k driver.
IP1000A chip looks like a TC9020 with integrated PHY.

This allows IP1000A chips to work reliably because the ipg driver is
buggy - it loses packets under load and then completely stops
transmitting data.

Tested with Asus NX1101 v2.0 at 10, 100 and 1000Mbps.
Also verified that it does not break D-Link DGE-550T.

Signed-off-by: Ondrej Zary 
---
 drivers/net/ethernet/dlink/Kconfig |5 ++--
 drivers/net/ethernet/dlink/dl2k.c  |   51 +---
 drivers/net/ethernet/dlink/dl2k.h  |   15 ++-
 3 files changed, 65 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/dlink/Kconfig 
b/drivers/net/ethernet/dlink/Kconfig
index f6e858d..ebdc832 100644
--- a/drivers/net/ethernet/dlink/Kconfig
+++ b/drivers/net/ethernet/dlink/Kconfig
@@ -17,15 +17,16 @@ config NET_VENDOR_DLINK
 if NET_VENDOR_DLINK
 
 config DL2K
-   tristate "DL2000/TC902x-based Gigabit Ethernet support"
+   tristate "DL2000/TC902x/IP1000A-based Gigabit Ethernet support"
depends on PCI
select CRC32
---help---
- This driver supports DL2000/TC902x-based Gigabit ethernet cards,
+ This driver supports DL2000/TC902x/IP1000A-based Gigabit ethernet 
cards,
  which includes
  D-Link DGE-550T Gigabit Ethernet Adapter.
  D-Link DL2000-based Gigabit Ethernet Adapter.
  Sundance/Tamarack TC902x Gigabit Ethernet Adapter.
+ ICPlus IP1000A-based cards
 
  To compile this driver as a module, choose M here: the
  module will be called dl2k.
diff --git a/drivers/net/ethernet/dlink/dl2k.c 
b/drivers/net/ethernet/dlink/dl2k.c
index cf0a5fc..c8a1cfd 100644
--- a/drivers/net/ethernet/dlink/dl2k.c
+++ b/drivers/net/ethernet/dlink/dl2k.c
@@ -253,6 +253,18 @@ rio_probe1 (struct pci_dev *pdev, const struct 
pci_device_id *ent)
if (err)
goto err_out_unmap_rx;
 
+   if (np->chip_id == CHIP_IP1000A &&
+   (np->pdev->revision == 0x40 || np->pdev->revision == 0x41)) {
+   /* PHY magic taken from ipg driver */
+   mii_write(dev, np->phy_addr, 31, 0x0001);
+   mii_write(dev, np->phy_addr, 27, 0x01e0);
+   mii_write(dev, np->phy_addr, 31, 0x0002);
+   mii_write(dev, np->phy_addr, 27, 0xeb8e);
+   mii_write(dev, np->phy_addr, 31, 0x);
+   mii_write(dev, np->phy_addr, 30, 0x005e);
+   mii_write(dev, np->phy_addr, 9, 0x0700);
+   }
+
/* Fiber device? */
np->phy_media = (dr16(ASICCtrl) & PhyMedia) ? 1 : 0;
np->link_status = 0;
@@ -361,6 +373,11 @@ parse_eeprom (struct net_device *dev)
for (i = 0; i < 6; i++)
dev->dev_addr[i] = psrom->mac_addr[i];
 
+   if (np->chip_id == CHIP_IP1000A) {
+   np->led_mode = psrom->led_mode;
+   return 0;
+   }
+
if (np->pdev->vendor != PCI_VENDOR_ID_DLINK) {
return 0;
}
@@ -406,6 +423,28 @@ parse_eeprom (struct net_device *dev)
return 0;
 }
 
+static void rio_set_led_mode(struct net_device *dev)
+{
+   struct netdev_private *np = netdev_priv(dev);
+   void __iomem *ioaddr = np->ioaddr;
+   u32 mode;
+
+   if (np->chip_id != CHIP_IP1000A)
+   return;
+
+   mode = dr32(ASICCtrl);
+   mode &= ~(IPG_AC_LED_MODE_BIT_1 | IPG_AC_LED_MODE | IPG_AC_LED_SPEED);
+
+   if ((np->led_mode & 0x03) > 1)
+   mode |= IPG_AC_LED_MODE_BIT_1;
+   if ((np->led_mode & 0x01) == 1)
+   mode |= IPG_AC_LED_MODE;
+   if ((np->led_mode & 0x08) == 8)
+   mode |= IPG_AC_LED_SPEED;
+
+   dw32(ASICCtrl, mode);
+}
+
 static int
 rio_open (struct net_device *dev)
 {
@@ -424,6 +463,8 @@ rio_open (struct net_device *dev)
 GlobalReset | DMAReset | FIFOReset | NetworkReset | HostReset);
mdelay(10);
 
+   rio_set_led_mode(dev);
+
/* DebugCtrl bit 4, 5, 9 must set */
dw32(DebugCtrl, dr32(DebugCtrl) | 0x0230);
 
@@ -433,9 +474,10 @@ rio_open (struct net_device *dev)
 
alloc_list (dev);
 
-   /* Get station address */
-   for (i = 0; i < 6; i++)
-   dw8(StationAddr0 + i, dev->dev_addr[i]);
+   /* Set station address */
+   for (i = 0; i < 3; i++)
+   dw16(StationAddr0 + 2 * i,
+cpu_to_le16(((u16 *)dev->dev_addr)[i]));
 
set_multicast (dev);
if (np->coalesce) {
@@ -780,6 +822,7 @@ tx_error (struct net_device *dev, int tx_status)
break;
mdelay (1);
}
+   rio_set_led_mode(dev);
rio_free_tx (dev, 1);
/* Reset TFDListPtr */
dw32(TFDListPtr0, np->tx_ring_dma +
@@ -799,6 +842,7 @@ tx_error (struct net_device *dev, int tx_status)
break;

[PATCH 2/2] ipg: Remove ipg driver

2015-11-14 Thread Ondrej Zary
Now that IP1000A chips are supported by dl2k driver, the buggy ipg
driver can be removed. The ipg driver loses packets under load and then
completely stops transmitting data.


Signed-off-by: Ondrej Zary 
---
 MAINTAINERS  |7 -
 drivers/net/ethernet/Kconfig |1 -
 drivers/net/ethernet/Makefile|1 -
 drivers/net/ethernet/icplus/Kconfig  |   13 -
 drivers/net/ethernet/icplus/Makefile |5 -
 drivers/net/ethernet/icplus/ipg.c| 2300 --
 drivers/net/ethernet/icplus/ipg.h|  748 ---
 7 files changed, 3075 deletions(-)
 delete mode 100644 drivers/net/ethernet/icplus/Kconfig
 delete mode 100644 drivers/net/ethernet/icplus/Makefile
 delete mode 100644 drivers/net/ethernet/icplus/ipg.c
 delete mode 100644 drivers/net/ethernet/icplus/ipg.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 7ba7ab7..b683820 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5588,13 +5588,6 @@ M:   Juanjo Ciarlante 
 S: Maintained
 F: net/ipv4/netfilter/ipt_MASQUERADE.c
 
-IP1000A 10/100/1000 GIGABIT ETHERNET DRIVER
-M: Francois Romieu 
-M: Sorbica Shieh 
-L: netdev@vger.kernel.org
-S: Maintained
-F: drivers/net/ethernet/icplus/ipg.*
-
 IPATH DRIVER
 M: Mike Marciniszyn 
 L: linux-r...@vger.kernel.org
diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
index 05aa759..955d06b 100644
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
@@ -78,7 +78,6 @@ source "drivers/net/ethernet/ibm/Kconfig"
 source "drivers/net/ethernet/intel/Kconfig"
 source "drivers/net/ethernet/i825xx/Kconfig"
 source "drivers/net/ethernet/xscale/Kconfig"
-source "drivers/net/ethernet/icplus/Kconfig"
 
 config JME
tristate "JMicron(R) PCI-Express Gigabit Ethernet support"
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index ddfc808..4a2ee98 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -41,7 +41,6 @@ obj-$(CONFIG_NET_VENDOR_IBM) += ibm/
 obj-$(CONFIG_NET_VENDOR_INTEL) += intel/
 obj-$(CONFIG_NET_VENDOR_I825XX) += i825xx/
 obj-$(CONFIG_NET_VENDOR_XSCALE) += xscale/
-obj-$(CONFIG_IP1000) += icplus/
 obj-$(CONFIG_JME) += jme.o
 obj-$(CONFIG_KORINA) += korina.o
 obj-$(CONFIG_LANTIQ_ETOP) += lantiq_etop.o
diff --git a/drivers/net/ethernet/icplus/Kconfig 
b/drivers/net/ethernet/icplus/Kconfig
deleted file mode 100644
index 14a66e9..000
--- a/drivers/net/ethernet/icplus/Kconfig
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# IC Plus device configuration
-#
-
-config IP1000
-   tristate "IP1000 Gigabit Ethernet support"
-   depends on PCI
-   select MII
-   ---help---
- This driver supports IP1000 gigabit Ethernet cards.
-
- To compile this driver as a module, choose M here: the module
- will be called ipg.  This is recommended.
diff --git a/drivers/net/ethernet/icplus/Makefile 
b/drivers/net/ethernet/icplus/Makefile
deleted file mode 100644
index 5bc87c1..000
--- a/drivers/net/ethernet/icplus/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the IC Plus device drivers
-#
-
-obj-$(CONFIG_IP1000) += ipg.o
diff --git a/drivers/net/ethernet/icplus/ipg.c 
b/drivers/net/ethernet/icplus/ipg.c
deleted file mode 100644
index c3b6af8..000
--- a/drivers/net/ethernet/icplus/ipg.c
+++ /dev/null
@@ -1,2300 +0,0 @@
-/*
- * ipg.c: Device Driver for the IP1000 Gigabit Ethernet Adapter
- *
- * Copyright (C) 2003, 2007  IC Plus Corp
- *
- * Original Author:
- *
- *   Craig Rich
- *   Sundance Technology, Inc.
- *   www.sundanceti.com
- *   craig_r...@sundanceti.com
- *
- * Current Maintainer:
- *
- *   Sorbica Shieh.
- *   http://www.icplus.com.tw
- *   sorb...@icplus.com.tw
- *
- *   Jesse Huang
- *   http://www.icplus.com.tw
- *   je...@icplus.com.tw
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#define IPG_RX_RING_BYTES  (sizeof(struct ipg_rx) * IPG_RFDLIST_LENGTH)
-#define IPG_TX_RING_BYTES  (sizeof(struct ipg_tx) * IPG_TFDLIST_LENGTH)
-#define IPG_RESET_MASK \
-   (IPG_AC_GLOBAL_RESET | IPG_AC_RX_RESET | IPG_AC_TX_RESET | \
-IPG_AC_DMA | IPG_AC_FIFO | IPG_AC_NETWORK | IPG_AC_HOST | \
-IPG_AC_AUTO_INIT)
-
-#define ipg_w32(val32, reg)iowrite32((val32), ioaddr + (reg))
-#define ipg_w16(val16, reg)iowrite16((val16), ioaddr + (reg))
-#define ipg_w8(val8, reg)  iowrite8((val8), ioaddr + (reg))
-
-#define ipg_r32(reg)   ioread32(ioaddr + (reg))
-#define ipg_r16(reg)   ioread16(ioaddr + (reg))
-#define ipg_r8(reg)ioread8(ioaddr + (reg))
-
-enum {
-   netdev_io_size = 128
-};
-
-#include "ipg.h"
-#define DRV_NAME   "ipg"
-
-MODULE_AUTHOR("IC Plus Corp. 2003");
-MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux 

Working an extra job.

2015-11-14 Thread Mystery Shopper



--
To whom it may concern:
I am writing to both Unemployed and employed, that if you are interest 
in working an extra job, non-stressful work online as our mystery 
shopper should not hesitate to contact me Via This E-mail ( 
shopfstest0...@gmail.com ) for further information.


Sincerely yours.
Mr.Sean Anderson.


--
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] Bluetooth-cmtp: Delete an unnecessary check before the function call "kfree_skb"

2015-11-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 14 Nov 2015 22:00:27 +0100

The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 net/bluetooth/cmtp/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
index 298ed37..9e59b66 100644
--- a/net/bluetooth/cmtp/core.c
+++ b/net/bluetooth/cmtp/core.c
@@ -178,8 +178,7 @@ static inline int cmtp_recv_frame(struct cmtp_session 
*session, struct sk_buff *
cmtp_add_msgpart(session, id, skb->data + hdrlen, len);
break;
default:
-   if (session->reassembly[id] != NULL)
-   kfree_skb(session->reassembly[id]);
+   kfree_skb(session->reassembly[id]);
session->reassembly[id] = NULL;
break;
}
-- 
2.6.2

--
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-hsr: Delete unnecessary checks before the function call "kfree_skb"

2015-11-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 14 Nov 2015 22:23:48 +0100

The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 net/hsr/hsr_forward.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 7871ed6..55ba943 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -355,11 +355,8 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port 
*port)
goto out_drop;
hsr_register_frame_in(frame.node_src, port, frame.sequence_nr);
hsr_forward_do();
-
-   if (frame.skb_hsr != NULL)
-   kfree_skb(frame.skb_hsr);
-   if (frame.skb_std != NULL)
-   kfree_skb(frame.skb_std);
+   kfree_skb(frame.skb_hsr);
+   kfree_skb(frame.skb_std);
return;
 
 out_drop:
-- 
2.6.2

--
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] NFC-nci: Delete unnecessary checks before the function call "kfree_skb"

2015-11-14 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sat, 14 Nov 2015 22:42:48 +0100

The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring 
---
 net/nfc/nci/uart.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c
index 21d8875..106ecc1 100644
--- a/net/nfc/nci/uart.c
+++ b/net/nfc/nci/uart.c
@@ -199,11 +199,8 @@ static void nci_uart_tty_close(struct tty_struct *tty)
if (!nu)
return;
 
-   if (nu->tx_skb)
-   kfree_skb(nu->tx_skb);
-   if (nu->rx_skb)
-   kfree_skb(nu->rx_skb);
-
+   kfree_skb(nu->tx_skb);
+   kfree_skb(nu->rx_skb);
skb_queue_purge(>tx_q);
 
nu->ops.close(nu);
-- 
2.6.2

--
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] mac802154: Delete an unnecessary check before the function call "kfree_skb"

2015-11-14 Thread Marcel Holtmann
Hi Markus,

> The kfree_skb() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring 
> ---
> net/mac802154/rx.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

--
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] Bluetooth-cmtp: Delete an unnecessary check before the function call "kfree_skb"

2015-11-14 Thread Marcel Holtmann
Hi Markus,

> The kfree_skb() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the call is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring 
> ---
> net/bluetooth/cmtp/core.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

--
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] tcp: ensure proper barriers in lockless contexts

2015-11-14 Thread Herbert Xu
Eric Dumazet  wrote:
> From: Eric Dumazet 
> 
> Some functions access TCP sockets without holding a lock and
> might output non consistent data, depending on compiler and or
> architecture.
> 
> tcp_diag_get_info(), tcp_get_info(), tcp_poll(), get_tcp4_sock() ...

For the information gathering ones such as tcp_diag_get_info I'm
wondering whether we really need these memory barriers.  After all,
if it's truly lockless then surely the TCP socket state can change
again after you load the state the first time, in which case the
barrier becomes completely meaningless.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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