Netdev List
 help / color / mirror / Atom feed
* Re: [next-queue PATCH v2 3/5] net/sched: Introduce the user API for the CBS shaper
From: Cong Wang @ 2017-10-01  0:24 UTC (permalink / raw)
  To: Vinicius Costa Gomes
  Cc: Linux Kernel Network Developers, intel-wired-lan,
	Jamal Hadi Salim, Jiri Pirko, andre.guedes, Ivan Briano,
	Jesus Sanchez-Palencia, boon.leong.ong, richardcochran,
	Henrik Austad, levipearson, rodney.cummings
In-Reply-To: <20170930002657.15291-4-vinicius.gomes@intel.com>

On Fri, Sep 29, 2017 at 5:26 PM, Vinicius Costa Gomes
<vinicius.gomes@intel.com> wrote:
> Export the API necessary for configuring the CBS shaper (implemented
> in the next patch) via the tc tool.

This one can be folded into patch 4/5.

^ permalink raw reply

* Re: [next-queue PATCH v2 2/5] net/sched: Fix accessing invalid dev_queue
From: Cong Wang @ 2017-10-01  0:22 UTC (permalink / raw)
  To: Vinicius Costa Gomes
  Cc: Linux Kernel Network Developers, intel-wired-lan,
	Jesus Sanchez-Palencia, Jamal Hadi Salim, Jiri Pirko,
	andre.guedes, Ivan Briano, boon.leong.ong, richardcochran,
	Henrik Austad, levipearson, rodney.cummings
In-Reply-To: <20170930002657.15291-3-vinicius.gomes@intel.com>

On Fri, Sep 29, 2017 at 5:26 PM, Vinicius Costa Gomes
<vinicius.gomes@intel.com> wrote:
> From: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
>
> In qdisc_alloc() the dev_queue pointer was used without any checks being
> performed. If qdisc_create() gets a null dev_queue pointer, it just
> passes it along to qdisc_alloc(), leading to a crash. That happens if a
> root qdisc implements select_queue() and returns a null dev_queue
> pointer for an "invalid handle", for example.

Does it make sense to let mqprio_select_queue() always return
non-NULL?

At least mq_select_queue() returns queue #0 as a fallback.

^ permalink raw reply

* Re: [PATCH v4 2/2] ip_tunnel: add mpls over gre encapsulation
From: kbuild test robot @ 2017-10-01  0:17 UTC (permalink / raw)
  To: Amine Kherbouche
  Cc: kbuild-all, netdev, xeb, roopa, amine.kherbouche, equinox
In-Reply-To: <2e611d0f6e0c39ff54bfe464cdf9cf6eeb7843e1.1506590878.git.amine.kherbouche@6wind.com>

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

Hi Amine,

[auto build test ERROR on net/master]
[also build test ERROR on v4.14-rc2 next-20170929]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Amine-Kherbouche/expose-stack-entry-function/20171001-013434
config: i386-randconfig-sb0-10010708 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   net/mpls/af_mpls.o: In function `mpls_exit':
>> af_mpls.c:(.exit.text+0x40): undefined reference to `ip_tunnel_encap_del_ops'
   net/mpls/af_mpls.o: In function `mpls_init':
>> af_mpls.c:(.init.text+0xb9): undefined reference to `ip_tunnel_encap_add_ops'

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30405 bytes --]

^ permalink raw reply

* Re: [net-next V2 PATCH 2/5] bpf: XDP_REDIRECT enable use of cpumap
From: kbuild test robot @ 2017-10-01  0:13 UTC (permalink / raw)
  To: Jesper Dangaard Brouer
  Cc: kbuild-all, netdev, jakub.kicinski, Michael S. Tsirkin,
	Jason Wang, mchan, John Fastabend, peter.waskiewicz.jr,
	Jesper Dangaard Brouer, Daniel Borkmann, Alexei Starovoitov,
	Andy Gospodarek
In-Reply-To: <150670285728.23765.652894515383691347.stgit@firesoul>

[-- Attachment #1: Type: text/plain, Size: 3407 bytes --]

Hi Jesper,

[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Jesper-Dangaard-Brouer/New-bpf-cpumap-type-for-XDP_REDIRECT/20171001-064716
config: i386-randconfig-i0-201740 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

   net//core/filter.c: In function '__bpf_tx_xdp_map':
>> net//core/filter.c:2550:3: error: implicit declaration of function 'cpu_map_enqueue' [-Werror=implicit-function-declaration]
      err = cpu_map_enqueue(rcpu, xdp, dev_rx);
      ^
>> net//core/filter.c:2553:3: error: implicit declaration of function '__cpu_map_insert_ctx' [-Werror=implicit-function-declaration]
      __cpu_map_insert_ctx(map, index);
      ^
   net//core/filter.c: In function 'xdp_do_flush_map':
>> net//core/filter.c:2570:4: error: implicit declaration of function '__cpu_map_flush' [-Werror=implicit-function-declaration]
       __cpu_map_flush(map);
       ^
   net//core/filter.c: In function '__xdp_map_lookup_elem':
>> net//core/filter.c:2585:3: error: implicit declaration of function '__cpu_map_lookup_elem' [-Werror=implicit-function-declaration]
      return __cpu_map_lookup_elem(map, index);
      ^
>> net//core/filter.c:2585:3: warning: return makes pointer from integer without a cast [enabled by default]
   cc1: some warnings being treated as errors

vim +/cpu_map_enqueue +2550 net//core/filter.c

  2527	
  2528	static int __bpf_tx_xdp_map(struct net_device *dev_rx, void *fwd,
  2529				    struct bpf_map *map,
  2530				    struct xdp_buff *xdp,
  2531				    u32 index)
  2532	{
  2533		int err;
  2534	
  2535		if (map->map_type == BPF_MAP_TYPE_DEVMAP) {
  2536			struct net_device *dev = fwd;
  2537	
  2538			if (!dev->netdev_ops->ndo_xdp_xmit) {
  2539				return -EOPNOTSUPP;
  2540			}
  2541	
  2542			err = dev->netdev_ops->ndo_xdp_xmit(dev, xdp);
  2543			if (err)
  2544				return err;
  2545			__dev_map_insert_ctx(map, index);
  2546	
  2547		} else if (map->map_type == BPF_MAP_TYPE_CPUMAP) {
  2548			struct bpf_cpu_map_entry *rcpu = fwd;
  2549	
> 2550			err = cpu_map_enqueue(rcpu, xdp, dev_rx);
  2551			if (err)
  2552				return err;
> 2553			__cpu_map_insert_ctx(map, index);
  2554		}
  2555		return 0;
  2556	}
  2557	
  2558	void xdp_do_flush_map(void)
  2559	{
  2560		struct redirect_info *ri = this_cpu_ptr(&redirect_info);
  2561		struct bpf_map *map = ri->map_to_flush;
  2562	
  2563		ri->map_to_flush = NULL;
  2564		if (map) {
  2565			switch (map->map_type) {
  2566			case BPF_MAP_TYPE_DEVMAP:
  2567				__dev_map_flush(map);
  2568				break;
  2569			case BPF_MAP_TYPE_CPUMAP:
> 2570				__cpu_map_flush(map);
  2571				break;
  2572			default:
  2573				break;
  2574			}
  2575		}
  2576	}
  2577	EXPORT_SYMBOL_GPL(xdp_do_flush_map);
  2578	
  2579	static void *__xdp_map_lookup_elem(struct bpf_map *map, u32 index)
  2580	{
  2581		switch (map->map_type) {
  2582		case BPF_MAP_TYPE_DEVMAP:
  2583			return __dev_map_lookup_elem(map, index);
  2584		case BPF_MAP_TYPE_CPUMAP:
> 2585			return __cpu_map_lookup_elem(map, index);
  2586		default:
  2587			return NULL;
  2588		}
  2589	}
  2590	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27064 bytes --]

^ permalink raw reply

* Re: [PATCH net-next] vhost_net: do not stall on zerocopy depletion
From: kbuild test robot @ 2017-10-01  0:09 UTC (permalink / raw)
  To: Willem de Bruijn
  Cc: kbuild-all, netdev, davem, mst, jasowang, den, virtualization,
	Willem de Bruijn
In-Reply-To: <20170928002556.41240-1-willemdebruijn.kernel@gmail.com>

Hi Willem,

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Willem-de-Bruijn/vhost_net-do-not-stall-on-zerocopy-depletion/20171001-054709
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +440 drivers/vhost/net.c

   433	
   434	static bool vhost_exceeds_maxpend(struct vhost_net *net)
   435	{
   436		struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX];
   437		struct vhost_virtqueue *vq = &nvq->vq;
   438	
   439		return (nvq->upend_idx + UIO_MAXIOV - nvq->done_idx) % UIO_MAXIOV >
 > 440		       min(VHOST_MAX_PEND, vq->num >> 2);
   441	}
   442	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply

* Dear Talented
From: Kim Sharma @ 2017-09-30 22:44 UTC (permalink / raw)
  To: Recipients

Dear Talented,

I am Talent Scout For BLUE SKY FILM STUDIO, Present Blue sky Studio a
Film Corporation Located in the United State, is Soliciting for the
Right to use Your Photo/Face and Personality as One of the Semi -Major
Role/ Character in our Upcoming ANIMATED Stereoscope 3D Movie-The Story
of Anubis (Anubis 2018) The Movie is Currently Filming (In
Production) Please Note That There Will Be No Auditions, Traveling or
Any Special / Professional Acting Skills, Since the Production of This
Movie Will Be Done with our State of Art Computer -Generating Imagery
Equipment. We Are Prepared to Pay the Total Sum of $620,000.00 USD. For
More Information/Understanding, Please Write us on the E-Mail Below.
CONTACT EMAIL: bluesky.filmstudio@usa.com
All Reply to: bluesky.filmstudio@usa.com
Note: Only the Response send to this mail will be Given a Prior
Consideration.


Talent Scout
Kim Sharma

^ permalink raw reply

* Re: [PATCH v4 2/2] ip_tunnel: add mpls over gre encapsulation
From: kbuild test robot @ 2017-09-30 23:03 UTC (permalink / raw)
  To: Amine Kherbouche
  Cc: kbuild-all, netdev, xeb, roopa, amine.kherbouche, equinox
In-Reply-To: <2e611d0f6e0c39ff54bfe464cdf9cf6eeb7843e1.1506590878.git.amine.kherbouche@6wind.com>

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

Hi Amine,

[auto build test ERROR on net/master]
[also build test ERROR on v4.14-rc2 next-20170929]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Amine-Kherbouche/expose-stack-entry-function/20171001-013434
config: x86_64-rhel (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> ERROR: "mpls_forward" [net/ipv4/gre.ko] undefined!

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40101 bytes --]

^ permalink raw reply

* Re: [PATCH net-next] vhost_net: do not stall on zerocopy depletion
From: kbuild test robot @ 2017-09-30 22:20 UTC (permalink / raw)
  To: Willem de Bruijn
  Cc: kbuild-all, netdev, davem, mst, jasowang, den, virtualization,
	Willem de Bruijn
In-Reply-To: <20170928002556.41240-1-willemdebruijn.kernel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

Hi Willem,

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Willem-de-Bruijn/vhost_net-do-not-stall-on-zerocopy-depletion/20171001-054709
config: tile-allyesconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=tile 

All warnings (new ones prefixed by >>):

   drivers/vhost/net.c: In function 'vhost_exceeds_maxpend':
>> drivers/vhost/net.c:440:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]

vim +440 drivers/vhost/net.c

   433	
   434	static bool vhost_exceeds_maxpend(struct vhost_net *net)
   435	{
   436		struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX];
   437		struct vhost_virtqueue *vq = &nvq->vq;
   438	
   439		return (nvq->upend_idx + UIO_MAXIOV - nvq->done_idx) % UIO_MAXIOV >
 > 440		       min(VHOST_MAX_PEND, vq->num >> 2);
   441	}
   442	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50505 bytes --]

^ permalink raw reply

* Re: [PATCH net-next] vhost_net: do not stall on zerocopy depletion
From: kbuild test robot @ 2017-09-30 22:12 UTC (permalink / raw)
  To: Willem de Bruijn
  Cc: Willem de Bruijn, mst, netdev, den, virtualization, kbuild-all,
	davem
In-Reply-To: <20170928002556.41240-1-willemdebruijn.kernel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1630 bytes --]

Hi Willem,

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Willem-de-Bruijn/vhost_net-do-not-stall-on-zerocopy-depletion/20171001-054709
config: x86_64-randconfig-x002-201740 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/linux/list.h:8:0,
                    from include/linux/wait.h:6,
                    from include/linux/eventfd.h:12,
                    from drivers/vhost/net.c:10:
   drivers/vhost/net.c: In function 'vhost_exceeds_maxpend':
   include/linux/kernel.h:772:16: warning: comparison of distinct pointer types lacks a cast
     (void) (&min1 == &min2);   \
                   ^
   include/linux/kernel.h:775:2: note: in expansion of macro '__min'
     __min(typeof(x), typeof(y),   \
     ^~~~~
>> drivers/vhost/net.c:440:9: note: in expansion of macro 'min'
            min(VHOST_MAX_PEND, vq->num >> 2);
            ^~~

vim +/min +440 drivers/vhost/net.c

   433	
   434	static bool vhost_exceeds_maxpend(struct vhost_net *net)
   435	{
   436		struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX];
   437		struct vhost_virtqueue *vq = &nvq->vq;
   438	
   439		return (nvq->upend_idx + UIO_MAXIOV - nvq->done_idx) % UIO_MAXIOV >
 > 440		       min(VHOST_MAX_PEND, vq->num >> 2);
   441	}
   442	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25413 bytes --]

[-- Attachment #3: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v3 net-next 1/8] flow_dissector: Change skbuf argument to be non const
From: kbuild test robot @ 2017-09-30 21:46 UTC (permalink / raw)
  To: Tom Herbert; +Cc: kbuild-all, davem, netdev, rohit, Tom Herbert
In-Reply-To: <20170928214823.2426-1-tom@quantonium.net>

[-- Attachment #1: Type: text/plain, Size: 7201 bytes --]

Hi Tom,

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Tom-Herbert/flow_dissector-Change-skbuf-argument-to-be-non-const/20171001-052131
config: x86_64-randconfig-x010-201740 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/sfc/rx.c: In function 'efx_filter_rfs':
>> drivers/net/ethernet/sfc/rx.c:842:34: warning: passing argument 1 of 'skb_flow_dissect_flow_keys' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     if (!skb_flow_dissect_flow_keys(skb, &fk, 0))
                                     ^~~
   In file included from include/linux/ip.h:20:0,
                    from drivers/net/ethernet/sfc/rx.c:14:
   include/linux/skbuff.h:1189:20: note: expected 'struct sk_buff *' but argument is of type 'const struct sk_buff *'
    static inline bool skb_flow_dissect_flow_keys(struct sk_buff *skb,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
--
   drivers/net/ethernet/sfc/falcon/rx.c: In function 'ef4_filter_rfs':
>> drivers/net/ethernet/sfc/falcon/rx.c:848:34: warning: passing argument 1 of 'skb_flow_dissect_flow_keys' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     if (!skb_flow_dissect_flow_keys(skb, &fk, 0))
                                     ^~~
   In file included from include/linux/ip.h:20:0,
                    from drivers/net/ethernet/sfc/falcon/rx.c:14:
   include/linux/skbuff.h:1189:20: note: expected 'struct sk_buff *' but argument is of type 'const struct sk_buff *'
    static inline bool skb_flow_dissect_flow_keys(struct sk_buff *skb,
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~

vim +842 drivers/net/ethernet/sfc/rx.c

add724771 Ben Hutchings 2012-11-08  829  
add724771 Ben Hutchings 2012-11-08  830  int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
add724771 Ben Hutchings 2012-11-08  831  		   u16 rxq_index, u32 flow_id)
add724771 Ben Hutchings 2012-11-08  832  {
add724771 Ben Hutchings 2012-11-08  833  	struct efx_nic *efx = netdev_priv(net_dev);
add724771 Ben Hutchings 2012-11-08  834  	struct efx_channel *channel;
add724771 Ben Hutchings 2012-11-08  835  	struct efx_filter_spec spec;
68bb399e6 Edward Cree   2016-05-26  836  	struct flow_keys fk;
add724771 Ben Hutchings 2012-11-08  837  	int rc;
add724771 Ben Hutchings 2012-11-08  838  
faf8dcc12 Jon Cooper    2016-05-31  839  	if (flow_id == RPS_FLOW_ID_INVALID)
faf8dcc12 Jon Cooper    2016-05-31  840  		return -EINVAL;
faf8dcc12 Jon Cooper    2016-05-31  841  
68bb399e6 Edward Cree   2016-05-26 @842  	if (!skb_flow_dissect_flow_keys(skb, &fk, 0))
68bb399e6 Edward Cree   2016-05-26  843  		return -EPROTONOSUPPORT;
add724771 Ben Hutchings 2012-11-08  844  
68bb399e6 Edward Cree   2016-05-26  845  	if (fk.basic.n_proto != htons(ETH_P_IP) && fk.basic.n_proto != htons(ETH_P_IPV6))
68bb399e6 Edward Cree   2016-05-26  846  		return -EPROTONOSUPPORT;
68bb399e6 Edward Cree   2016-05-26  847  	if (fk.control.flags & FLOW_DIS_IS_FRAGMENT)
c47b2d9d5 Ben Hutchings 2013-09-03  848  		return -EPROTONOSUPPORT;
c47b2d9d5 Ben Hutchings 2013-09-03  849  
c47b2d9d5 Ben Hutchings 2013-09-03  850  	efx_filter_init_rx(&spec, EFX_FILTER_PRI_HINT,
c47b2d9d5 Ben Hutchings 2013-09-03  851  			   efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0,
c47b2d9d5 Ben Hutchings 2013-09-03  852  			   rxq_index);
c47b2d9d5 Ben Hutchings 2013-09-03  853  	spec.match_flags =
c47b2d9d5 Ben Hutchings 2013-09-03  854  		EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_IP_PROTO |
c47b2d9d5 Ben Hutchings 2013-09-03  855  		EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_LOC_PORT |
c47b2d9d5 Ben Hutchings 2013-09-03  856  		EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_REM_PORT;
68bb399e6 Edward Cree   2016-05-26  857  	spec.ether_type = fk.basic.n_proto;
68bb399e6 Edward Cree   2016-05-26  858  	spec.ip_proto = fk.basic.ip_proto;
c47b2d9d5 Ben Hutchings 2013-09-03  859  
68bb399e6 Edward Cree   2016-05-26  860  	if (fk.basic.n_proto == htons(ETH_P_IP)) {
68bb399e6 Edward Cree   2016-05-26  861  		spec.rem_host[0] = fk.addrs.v4addrs.src;
68bb399e6 Edward Cree   2016-05-26  862  		spec.loc_host[0] = fk.addrs.v4addrs.dst;
c47b2d9d5 Ben Hutchings 2013-09-03  863  	} else {
68bb399e6 Edward Cree   2016-05-26  864  		memcpy(spec.rem_host, &fk.addrs.v6addrs.src, sizeof(struct in6_addr));
68bb399e6 Edward Cree   2016-05-26  865  		memcpy(spec.loc_host, &fk.addrs.v6addrs.dst, sizeof(struct in6_addr));
c47b2d9d5 Ben Hutchings 2013-09-03  866  	}
c47b2d9d5 Ben Hutchings 2013-09-03  867  
68bb399e6 Edward Cree   2016-05-26  868  	spec.rem_port = fk.ports.src;
68bb399e6 Edward Cree   2016-05-26  869  	spec.loc_port = fk.ports.dst;
add724771 Ben Hutchings 2012-11-08  870  
add724771 Ben Hutchings 2012-11-08  871  	rc = efx->type->filter_rfs_insert(efx, &spec);
add724771 Ben Hutchings 2012-11-08  872  	if (rc < 0)
add724771 Ben Hutchings 2012-11-08  873  		return rc;
add724771 Ben Hutchings 2012-11-08  874  
add724771 Ben Hutchings 2012-11-08  875  	/* Remember this so we can check whether to expire the filter later */
faf8dcc12 Jon Cooper    2016-05-31  876  	channel = efx_get_channel(efx, rxq_index);
faf8dcc12 Jon Cooper    2016-05-31  877  	channel->rps_flow_id[rc] = flow_id;
add724771 Ben Hutchings 2012-11-08  878  	++channel->rfs_filters_added;
add724771 Ben Hutchings 2012-11-08  879  
68bb399e6 Edward Cree   2016-05-26  880  	if (spec.ether_type == htons(ETH_P_IP))
add724771 Ben Hutchings 2012-11-08  881  		netif_info(efx, rx_status, efx->net_dev,
add724771 Ben Hutchings 2012-11-08  882  			   "steering %s %pI4:%u:%pI4:%u to queue %u [flow %u filter %d]\n",
c47b2d9d5 Ben Hutchings 2013-09-03  883  			   (spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
68bb399e6 Edward Cree   2016-05-26  884  			   spec.rem_host, ntohs(spec.rem_port), spec.loc_host,
68bb399e6 Edward Cree   2016-05-26  885  			   ntohs(spec.loc_port), rxq_index, flow_id, rc);
c47b2d9d5 Ben Hutchings 2013-09-03  886  	else
c47b2d9d5 Ben Hutchings 2013-09-03  887  		netif_info(efx, rx_status, efx->net_dev,
c47b2d9d5 Ben Hutchings 2013-09-03  888  			   "steering %s [%pI6]:%u:[%pI6]:%u to queue %u [flow %u filter %d]\n",
c47b2d9d5 Ben Hutchings 2013-09-03  889  			   (spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
68bb399e6 Edward Cree   2016-05-26  890  			   spec.rem_host, ntohs(spec.rem_port), spec.loc_host,
68bb399e6 Edward Cree   2016-05-26  891  			   ntohs(spec.loc_port), rxq_index, flow_id, rc);
add724771 Ben Hutchings 2012-11-08  892  
add724771 Ben Hutchings 2012-11-08  893  	return rc;
add724771 Ben Hutchings 2012-11-08  894  }
add724771 Ben Hutchings 2012-11-08  895  

:::::: The code at line 842 was first introduced by commit
:::::: 68bb399e656f244d3d173a20a8280c167632fca8 sfc: use flow dissector helpers for aRFS

:::::: TO: Edward Cree <ecree@solarflare.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30375 bytes --]

^ permalink raw reply

* Re: [PATCH v2] lib: fix multiple strlcpy definition
From: Baruch Siach @ 2017-09-30 20:29 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Phil Sutter
In-Reply-To: <20170929115858.275217b8@xeon-e3>

Hi Stephen,

On Fri, Sep 29, 2017 at 11:58:58AM -0700, Stephen Hemminger wrote:
> On Thu, 28 Sep 2017 21:02:11 +0300
> Baruch Siach <baruch@tkos.co.il> wrote:
> 
> > Some C libraries, like uClibc and musl, provide BSD compatible
> > strlcpy(). Add check_strlcpy() to configure, and avoid defining strlcpy
> > and strlcat when the C library provides them.
> > 
> > This fixes the following static link error with uClibc-ng:
> > 
> > .../sysroot/usr/lib/libc.a(strlcpy.os): In function `strlcpy':
> > strlcpy.c:(.text+0x0): multiple definition of `strlcpy'
> > ../lib/libutil.a(utils.o):utils.c:(.text+0x1ddc): first defined here
> > collect2: error: ld returned 1 exit status
> > 
> > Acked-by: Phil Sutter <phil@nwl.cc>
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> 
> This is OK because it doesn't impact normal glibc too much.
> 
> > diff --git a/lib/Makefile b/lib/Makefile
> > index 0fbdf4c31f50..132ad00c3335 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -1,5 +1,9 @@
> >  include ../config.mk
> >  
> > +ifeq ($(NEED_STRLCPY),y)
> > +	CFLAGS += -DNEED_STRLCPY
> > +endif
> > +
> 
> I just removed all the conditional CFLAGS out of subdirectory Makefiles
> and moved them into the generated config.mk. Please do that for this
> as well and resubmit.

What code do you refer to? I don't see that as of current master 
(e4139268ba96).

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply

* Re: [PATCH 2/4] ravb: Add optional PHY reset during system resume
From: Sergei Shtylyov @ 2017-09-30 20:23 UTC (permalink / raw)
  To: Florian Fainelli, Geert Uytterhoeven
  Cc: Geert Uytterhoeven, David S . Miller, Simon Horman, Magnus Damm,
	Andrew Lunn, Niklas Söderlund, netdev@vger.kernel.org,
	Linux-Renesas, devicetree@vger.kernel.org
In-Reply-To: <1a474c45-29ea-82fa-1ab0-0febfdc38bcb@gmail.com>

Hello!

On 09/28/2017 10:21 PM, Florian Fainelli wrote:

>>>> If the optional "reset-gpios" property is specified in DT, the generic
>>>> MDIO bus code takes care of resetting the PHY during device probe.
>>>> However, the PHY may still have to be reset explicitly after system
>>>> resume.
>>>>
>>>> This allows to restore Ethernet operation after resume from s2ram on
>>>> Salvator-XS, where the enable pin of the regulator providing PHY power
>>>> is connected to PRESETn, and PSCI suspend powers down the SoC.
>>>>
>>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>>> ---
>>>>   drivers/net/ethernet/renesas/ravb_main.c | 9 +++++++++
>>>>   1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>>>> index fdf30bfa403bf416..96d1d48e302f8c9a 100644
>>>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>>>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
[...]
>>>> @@ -2302,6 +2304,13 @@ static int __maybe_unused ravb_resume(struct device *dev)
>>>>         * reopen device if it was running before system suspended.
>>>>         */
>>>>
>>>> +     /* PHY reset */
>>>> +     if (bus->reset_gpiod) {
>>>> +             gpiod_set_value_cansleep(bus->reset_gpiod, 1);
>>>> +             udelay(bus->reset_delay_us);
>>>> +             gpiod_set_value_cansleep(bus->reset_gpiod, 0);
>>>> +     }
>>>
>>> This is a clever hack, but unfortunately this is also misusing the MDIO
>>> bus reset line into a PHY reset line. As commented in patch 3, if this
>>> reset line is tied to the PHY, then this should be a PHY property and
>>
>> OK.
>>
>>> you cannot (ab)use the MDIO bus GPIO reset logic anymore...
>>
>> And then I should add reset-gpios support to drivers/net/phy/micrel.c?
>> Or is there already generic code to handle per-PHY reset? I couldn't find it.
> 
> There is not such a thing unfortunately, but it would presumably be

    It's strange you don't remember about my (abandoned) patches to handle 
per=PHY reset GPIOs -- perhaps it's time to unearth them. Here they are:

http://patchwork.ozlabs.org/patch/616495/
http://patchwork.ozlabs.org/patch/616501/

    I had v3 in the works before abandoning this series -- it doesn't apply now.

> called within drivers/net/phy/mdio_bus.c during bus->reset() time
> because you need the PHY reset to be deasserted before you can
> successfully read/write from the PHY, and if you can't read/write from
> the PHY, the MDIO bus layer cannot read the PHY ID, and therefore cannot
> match a PHY device with its driver, so things don't work.

    I did this a bit differently...

[...]

MBR, Sergei

^ permalink raw reply

* Re: WARNING: kernel stack frame pointer at ffff880156a5fea0 in bash:2103 has bad value 00007ffec7d87e50
From: Richard Weinberger @ 2017-09-30 20:01 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Alexei Starovoitov, ast, daniel, netdev, linux-kernel, mingo
In-Reply-To: <20170927141430.i6awpjkyoqffof4b@treble>

Josh,

Am Mittwoch, 27. September 2017, 16:14:30 CEST schrieb Josh Poimboeuf:
> On Wed, Sep 27, 2017 at 08:51:22AM +0200, Richard Weinberger wrote:
> > Am Mittwoch, 27. September 2017, 00:42:46 CEST schrieb Josh Poimboeuf:
> > > > Here is another variant of the warning, it matches the attached 
.config:
> > > I can take a look at it.  Unfortunately, for these types of issues I
> > > often need the vmlinux file to be able to make sense of the unwinder
> > > dump.  So if you happen to have somewhere to copy the vmlinux to, that
> > > would be helpful.  Or if you give me your GCC version I can try to
> > > rebuild it locally.
> > 
> > There you go:
> > http://git.infradead.org/~rw/bpf_splat/vmlinux.xz
> 
> Thanks.  Can you test this fix?
> 
> 
> diff --git a/arch/x86/kernel/kprobes/common.h
> b/arch/x86/kernel/kprobes/common.h index db2182d63ed0..3fc0f9a794cb 100644
> --- a/arch/x86/kernel/kprobes/common.h
> +++ b/arch/x86/kernel/kprobes/common.h
> @@ -3,6 +3,15 @@
> 
>  /* Kprobes and Optprobes common header */
> 
> +#include <asm/asm.h>
> +
> +#ifdef CONFIG_FRAME_POINTER
> +# define SAVE_RBP_STRING "	push %" _ASM_BP "\n" \
> +			 "	mov  %" _ASM_SP ", %" _ASM_BP "\n"
> +#else
> +# define SAVE_RBP_STRING "	push %" _ASM_BP "\n"
> +#endif
> +
>  #ifdef CONFIG_X86_64
>  #define SAVE_REGS_STRING			\
>  	/* Skip cs, ip, orig_ax. */		\
> @@ -17,7 +26,7 @@
>  	"	pushq %r10\n"			\
>  	"	pushq %r11\n"			\
>  	"	pushq %rbx\n"			\
> -	"	pushq %rbp\n"			\
> +	SAVE_RBP_STRING				\
>  	"	pushq %r12\n"			\
>  	"	pushq %r13\n"			\
>  	"	pushq %r14\n"			\
> @@ -48,7 +57,7 @@
>  	"	pushl %es\n"			\
>  	"	pushl %ds\n"			\
>  	"	pushl %eax\n"			\
> -	"	pushl %ebp\n"			\
> +	SAVE_RBP_STRING				\
>  	"	pushl %edi\n"			\
>  	"	pushl %esi\n"			\
>  	"	pushl %edx\n"			\

This fixes the issue for me!

Thanks,
//richard

-- 
sigma star gmbh - Eduard-Bodem-Gasse 6 - 6020 Innsbruck - Austria
ATU66964118 - FN 374287y

^ permalink raw reply

* Re: [PATCH net-next] bpf: Fix compiler warning on info.map_ids for 32bit platform
From: Daniel Borkmann @ 2017-09-30 19:05 UTC (permalink / raw)
  To: Martin KaFai Lau, netdev; +Cc: Alexei Starovoitov, kernel-team
In-Reply-To: <20170929175217.437830-1-kafai@fb.com>

On 09/29/2017 07:52 PM, Martin KaFai Lau wrote:
> This patch uses u64_to_user_ptr() to cast info.map_ids to a userspace ptr.
> It also tags the user_map_ids with '__user' for sparse check.
>
> Fixes: cb4d2b3f03d8 ("bpf: Add name, load_time, uid and map_ids to bpf_prog_info")
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply

* Re: [PATCH net-next 00/10] Introduce SCTP Stream Schedulers
From: Xin Long @ 2017-09-30 16:52 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner
  Cc: network dev, linux-sctp, Neil Horman, Vlad Yasevich, David Laight
In-Reply-To: <cover.1506536044.git.marcelo.leitner@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2576 bytes --]

On Fri, Sep 29, 2017 at 4:25 AM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> This patchset introduces the SCTP Stream Schedulers are defined by
> https://tools.ietf.org/html/draft-ietf-tsvwg-sctp-ndata-13
>
> It provides 3 schedulers at the moment: FCFS, Priority and Round Robin.
> The other 3, Round Robin per packet, Fair Capacity and Weighted Fair
> Capacity will be added later. More specifically, WFQ is required by
> WebRTC Datachannels.
>
> The draft also defines the idata chunk, allowing a usermsg to be
> interrupted by another piece of idata from another stream. This patchset
> *doesn't* include it. It will be posted later by Xin Long.  Its
> integration with this patchset is very simple and it basically only
> requires a tweak in sctp_sched_dequeue_done(), to ignore datamsg
> boundaries.
>
> The first 5 patches are a preparation for the next ones. The most
> relevant patches are the 4th and 6th ones. More details are available on
> each patch.
>
> Marcelo Ricardo Leitner (10):
>   sctp: silence warns on sctp_stream_init allocations
>   sctp: factor out stream->out allocation
>   sctp: factor out stream->in allocation
>   sctp: introduce struct sctp_stream_out_ext
>   sctp: introduce sctp_chunk_stream_no
>   sctp: introduce stream scheduler foundations
>   sctp: add sockopt to get/set stream scheduler
>   sctp: add sockopt to get/set stream scheduler parameters
>   sctp: introduce priority based stream scheduler
>   sctp: introduce round robin stream scheduler
>
>  include/net/sctp/stream_sched.h |  72 +++++++++
>  include/net/sctp/structs.h      |  63 +++++++-
>  include/uapi/linux/sctp.h       |  16 ++
>  net/sctp/Makefile               |   3 +-
>  net/sctp/chunk.c                |   6 +-
>  net/sctp/outqueue.c             |  63 ++++----
>  net/sctp/sm_sideeffect.c        |   3 +
>  net/sctp/socket.c               | 179 ++++++++++++++++++++-
>  net/sctp/stream.c               | 196 +++++++++++++++++++----
>  net/sctp/stream_sched.c         | 275 +++++++++++++++++++++++++++++++
>  net/sctp/stream_sched_prio.c    | 347 ++++++++++++++++++++++++++++++++++++++++
>  net/sctp/stream_sched_rr.c      | 201 +++++++++++++++++++++++
>  12 files changed, 1347 insertions(+), 77 deletions(-)
>  create mode 100644 include/net/sctp/stream_sched.h
>  create mode 100644 net/sctp/stream_sched.c
>  create mode 100644 net/sctp/stream_sched_prio.c
>  create mode 100644 net/sctp/stream_sched_rr.c
>
> --
> 2.13.5
>
Attachment are the testcase based on:
https://github.com/sctp/sctp-tests

Tested-by: Xin Long <lucien.xin@gmail.com>

[-- Attachment #2: ndatasched.tar.gz --]
[-- Type: application/x-gzip, Size: 3749 bytes --]

^ permalink raw reply

* Re: [PATCH v2] netlink: do not proceed if dump's start() errs
From: David Miller @ 2017-09-30 15:14 UTC (permalink / raw)
  To: johannes; +Cc: Jason, netdev, linux-kernel
In-Reply-To: <1506754570.3568.3.camel@sipsolutions.net>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Sat, 30 Sep 2017 08:56:10 +0200

> On Thu, 2017-09-28 at 00:41 +0200, Jason A. Donenfeld wrote:
>> Drivers that use the start method for netlink dumping rely on dumpit
>> not
>> being called if start fails. For example, ila_xlat.c allocates memory
>> and assigns it to cb->args[0] in its start() function. It might fail
>> to
>> do that and return -ENOMEM instead. However, even when returning an
>> error, dumpit will be called, which, in the example above, quickly
>> dereferences the memory in cb->args[0], which will OOPS the kernel.
>> This
>> is but one example of how this goes wrong.
>> 
>> Since start() has always been a function with an int return type, it
>> therefore makes sense to use it properly, rather than ignoring it.
>> This
>> patch thus returns early and does not call dumpit() when start()
>> fails.
>> 
>> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> 
> Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
 ...
> Either way, perhaps it's worth sending this to stable for that reason.

Agreed, applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCHv4 iproute2 1/2] lib/libnetlink: re malloc buff if size is not enough
From: Hangbin Liu @ 2017-09-30 13:54 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Michal Kubecek, Phil Sutter, Hangbin Liu
In-Reply-To: <20170929105440.7edaec1f@xeon-e3>

Hi Stephen,
On Fri, Sep 29, 2017 at 10:54:40AM -0700, Stephen Hemminger wrote:
> 
> Doubling the number of system calls per message is not going to make
> users with 5,000,000 routes or 1000 vlans, or 10,000 tunnels happy.
> Please rethink this.

I tried to add 2500 vlans and 70,000 routes. Then show the result. The
time looks reasonable.

# ip link show | wc -l
5024

# time ip link show > /dev/null

real    0m0.218s
user    0m0.007s
sys     0m0.210s

# time iproute2/ip/ip link show > /dev/null

real    0m0.221s
user    0m0.008s
sys     0m0.212s

# time ip addr show > /dev/null

real    0m0.299s
user    0m0.094s
sys     0m0.205s

# time iproute2/ip/ip addr show > /dev/null

real    0m0.302s
user    0m0.099s
sys     0m0.202s

# ip -6 route show | wc -l
704458

# time ip -6 route show > /dev/null

real    0m5.400s
user    0m0.947s
sys     0m4.453s

# time iproute2/ip/ip -6 route show > /dev/null

real    0m5.404s
user    0m1.070s
sys     0m4.333s


Thanks
Hangbin

^ permalink raw reply

* Re: [PATCH v2 2/2] net: phonet: mark phonet_protocol as const
From: Rémi Denis-Courmont @ 2017-09-30 11:51 UTC (permalink / raw)
  To: Lin Zhang; +Cc: davem, netdev, courmisch
In-Reply-To: <1506764448-6915-1-git-send-email-xiaolou4617@gmail.com>

On samedi 30 septembre 2017 17:40:48 EEST Lin Zhang wrote:
> The phonet_protocol structs don't need to be written by anyone and
> so can be marked as const.
> 
> Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
> ---
> changelog:
> 
> v1 -> v2:
> 	* remove __read_mostly tag
> ---
>  include/net/phonet/phonet.h |  6 ++++--
>  net/phonet/af_phonet.c      | 15 ++++++++-------
>  net/phonet/datagram.c       |  2 +-
>  net/phonet/pep.c            |  2 +-
>  4 files changed, 14 insertions(+), 11 deletions(-)
> 
> diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
> index 039cc29..51e1a2a 100644
> --- a/include/net/phonet/phonet.h
> +++ b/include/net/phonet/phonet.h
> @@ -108,8 +108,10 @@ struct phonet_protocol {
>  	int			sock_type;
>  };
> 
> -int phonet_proto_register(unsigned int protocol, struct phonet_protocol
> *pp); -void phonet_proto_unregister(unsigned int protocol, struct
> phonet_protocol *pp); +int phonet_proto_register(unsigned int protocol,
> +		const struct phonet_protocol *pp);
> +void phonet_proto_unregister(unsigned int protocol,
> +		const struct phonet_protocol *pp);
> 
>  int phonet_sysctl_init(void);
>  void phonet_sysctl_exit(void);
> diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
> index b12142e..63b9870 100644
> --- a/net/phonet/af_phonet.c
> +++ b/net/phonet/af_phonet.c
> @@ -35,11 +35,11 @@
>  #include <net/phonet/pn_dev.h>
> 
>  /* Transport protocol registration */
> -static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
> +static const struct phonet_protocol *proto_tab[PHONET_NPROTO];

Your patch makes each element in the table constant. It does not, cannot, make 
the table itself constant. So I am not certain that removing __read_mostly is 
a good thing.

(Well, nowadays this should probably be rare-write rather than read-mostly but 
that's a slightly different issue.)

-- 
Rémi Denis-Courmont

^ permalink raw reply

* Re: [PATCH v2 1/2] net: phonet: mark header_ops as const
From: Rémi Denis-Courmont @ 2017-09-30 11:49 UTC (permalink / raw)
  To: Lin Zhang; +Cc: davem, netdev, courmisch
In-Reply-To: <1506764376-6549-1-git-send-email-xiaolou4617@gmail.com>

On samedi 30 septembre 2017 17:39:36 EEST Lin Zhang wrote:
> Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
> ---
>  net/phonet/af_phonet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
> index f925753..b12142e 100644
> --- a/net/phonet/af_phonet.c
> +++ b/net/phonet/af_phonet.c
> @@ -149,7 +149,7 @@ static int pn_header_parse(const struct sk_buff *skb,
> unsigned char *haddr) return 1;
>  }
> 
> -struct header_ops phonet_header_ops = {
> +const struct header_ops phonet_header_ops = {
>  	.create = pn_header_create,
>  	.parse = pn_header_parse,
>  };

Acked-by: Rémi Denis-Courmont <remi@remlab.net>


-- 
Rémi Denis-Courmont

^ permalink raw reply

* [PATCH v2] netfilter: SYNPROXY: fix process non tcp packet bug in {ipv4,ipv6}_synproxy_hook
From: Lin Zhang @ 2017-09-30 10:25 UTC (permalink / raw)
  To: pablo, kadlec, fw, davem, kuznet, yoshfuji
  Cc: netfilter-devel, coreteam, netdev, Lin Zhang

In function {ipv4,ipv6}_synproxy_hook we expect a normal tcp packet,
but the real server maybe reply an icmp error packet related to the 
exist tcp conntrack, so we will access wrong tcp data.

For fix it, check for the protocol field and only process tcp traffic.

Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
---
changelog:

v1 -> v2:
	* we only deal with TCP traffic, per Pablo Neira.
---
 net/ipv4/netfilter/ipt_SYNPROXY.c  | 3 ++-
 net/ipv6/netfilter/ip6t_SYNPROXY.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_SYNPROXY.c b/net/ipv4/netfilter/ipt_SYNPROXY.c
index 811689e..13bec90 100644
--- a/net/ipv4/netfilter/ipt_SYNPROXY.c
+++ b/net/ipv4/netfilter/ipt_SYNPROXY.c
@@ -330,7 +330,8 @@ static unsigned int ipv4_synproxy_hook(void *priv,
 	if (synproxy == NULL)
 		return NF_ACCEPT;
 
-	if (nf_is_loopback_packet(skb))
+	if (nf_is_loopback_packet(skb) ||
+	    ip_hdr(skb)->protocol != IPPROTO_TCP)
 		return NF_ACCEPT;
 
 	thoff = ip_hdrlen(skb);
diff --git a/net/ipv6/netfilter/ip6t_SYNPROXY.c b/net/ipv6/netfilter/ip6t_SYNPROXY.c
index a5cd43d..af19c16 100644
--- a/net/ipv6/netfilter/ip6t_SYNPROXY.c
+++ b/net/ipv6/netfilter/ip6t_SYNPROXY.c
@@ -347,7 +347,8 @@ static unsigned int ipv6_synproxy_hook(void *priv,
 	if (synproxy == NULL)
 		return NF_ACCEPT;
 
-	if (nf_is_loopback_packet(skb))
+	if (nf_is_loopback_packet(skb) ||
+	    ipv6_hdr(skb)->protocol != IPPROTO_TCP)
 		return NF_ACCEPT;
 
 	nexthdr = ipv6_hdr(skb)->nexthdr;
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH] net: stmmac: dwmac-rk: Add RK3128 GMAC support
From: David Wu @ 2017-09-30  9:47 UTC (permalink / raw)
  To: davem, heiko
  Cc: peppe.cavallaro, alexandre.torgue, huangtao, netdev,
	linux-rockchip, linux-kernel, David Wu

Add constants and callback functions for the dwmac on rk3128 soc.
As can be seen, the base structure is the same, only registers
and the bits in them moved slightly.

Signed-off-by: David Wu <david.wu@rock-chips.com>
---
 .../devicetree/bindings/net/rockchip-dwmac.txt     |   1 +
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c     | 112 +++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.txt b/Documentation/devicetree/bindings/net/rockchip-dwmac.txt
index 6af8eed..9c16ee2 100644
--- a/Documentation/devicetree/bindings/net/rockchip-dwmac.txt
+++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.txt
@@ -4,6 +4,7 @@ The device node has following properties.
 
 Required properties:
  - compatible: should be "rockchip,<name>-gamc"
+   "rockchip,rk3128-gmac": found on RK312x SoCs
    "rockchip,rk3228-gmac": found on RK322x SoCs
    "rockchip,rk3288-gmac": found on RK3288 SoCs
    "rockchip,rk3328-gmac": found on RK3328 SoCs
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 99823f5..13133b3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -83,6 +83,117 @@ struct rk_priv_data {
 	(((tx) ? soc##_GMAC_TXCLK_DLY_ENABLE : soc##_GMAC_TXCLK_DLY_DISABLE) | \
 	 ((rx) ? soc##_GMAC_RXCLK_DLY_ENABLE : soc##_GMAC_RXCLK_DLY_DISABLE))
 
+#define RK3128_GRF_MAC_CON0	0x0168
+#define RK3128_GRF_MAC_CON1	0x016c
+
+/* RK3128_GRF_MAC_CON0 */
+#define RK3128_GMAC_TXCLK_DLY_ENABLE   GRF_BIT(14)
+#define RK3128_GMAC_TXCLK_DLY_DISABLE  GRF_CLR_BIT(14)
+#define RK3128_GMAC_RXCLK_DLY_ENABLE   GRF_BIT(15)
+#define RK3128_GMAC_RXCLK_DLY_DISABLE  GRF_CLR_BIT(15)
+#define RK3128_GMAC_CLK_RX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 7)
+#define RK3128_GMAC_CLK_TX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 0)
+
+/* RK3128_GRF_MAC_CON1 */
+#define RK3128_GMAC_PHY_INTF_SEL_RGMII	\
+		(GRF_BIT(6) | GRF_CLR_BIT(7) | GRF_CLR_BIT(8))
+#define RK3128_GMAC_PHY_INTF_SEL_RMII	\
+		(GRF_CLR_BIT(6) | GRF_CLR_BIT(7) | GRF_BIT(8))
+#define RK3128_GMAC_FLOW_CTRL          GRF_BIT(9)
+#define RK3128_GMAC_FLOW_CTRL_CLR      GRF_CLR_BIT(9)
+#define RK3128_GMAC_SPEED_10M          GRF_CLR_BIT(10)
+#define RK3128_GMAC_SPEED_100M         GRF_BIT(10)
+#define RK3128_GMAC_RMII_CLK_25M       GRF_BIT(11)
+#define RK3128_GMAC_RMII_CLK_2_5M      GRF_CLR_BIT(11)
+#define RK3128_GMAC_CLK_125M           (GRF_CLR_BIT(12) | GRF_CLR_BIT(13))
+#define RK3128_GMAC_CLK_25M            (GRF_BIT(12) | GRF_BIT(13))
+#define RK3128_GMAC_CLK_2_5M           (GRF_CLR_BIT(12) | GRF_BIT(13))
+#define RK3128_GMAC_RMII_MODE          GRF_BIT(14)
+#define RK3128_GMAC_RMII_MODE_CLR      GRF_CLR_BIT(14)
+
+static void rk3128_set_to_rgmii(struct rk_priv_data *bsp_priv,
+				int tx_delay, int rx_delay)
+{
+	struct device *dev = &bsp_priv->pdev->dev;
+
+	if (IS_ERR(bsp_priv->grf)) {
+		dev_err(dev, "Missing rockchip,grf property\n");
+		return;
+	}
+
+	regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON1,
+		     RK3128_GMAC_PHY_INTF_SEL_RGMII |
+		     RK3128_GMAC_RMII_MODE_CLR);
+	regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON0,
+		     DELAY_ENABLE(RK3128, tx_delay, rx_delay) |
+		     RK3128_GMAC_CLK_RX_DL_CFG(rx_delay) |
+		     RK3128_GMAC_CLK_TX_DL_CFG(tx_delay));
+}
+
+static void rk3128_set_to_rmii(struct rk_priv_data *bsp_priv)
+{
+	struct device *dev = &bsp_priv->pdev->dev;
+
+	if (IS_ERR(bsp_priv->grf)) {
+		dev_err(dev, "Missing rockchip,grf property\n");
+		return;
+	}
+
+	regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON1,
+		     RK3128_GMAC_PHY_INTF_SEL_RMII | RK3128_GMAC_RMII_MODE);
+}
+
+static void rk3128_set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed)
+{
+	struct device *dev = &bsp_priv->pdev->dev;
+
+	if (IS_ERR(bsp_priv->grf)) {
+		dev_err(dev, "Missing rockchip,grf property\n");
+		return;
+	}
+
+	if (speed == 10)
+		regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON1,
+			     RK3128_GMAC_CLK_2_5M);
+	else if (speed == 100)
+		regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON1,
+			     RK3128_GMAC_CLK_25M);
+	else if (speed == 1000)
+		regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON1,
+			     RK3128_GMAC_CLK_125M);
+	else
+		dev_err(dev, "unknown speed value for RGMII! speed=%d", speed);
+}
+
+static void rk3128_set_rmii_speed(struct rk_priv_data *bsp_priv, int speed)
+{
+	struct device *dev = &bsp_priv->pdev->dev;
+
+	if (IS_ERR(bsp_priv->grf)) {
+		dev_err(dev, "Missing rockchip,grf property\n");
+		return;
+	}
+
+	if (speed == 10) {
+		regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON1,
+			     RK3128_GMAC_RMII_CLK_2_5M |
+			     RK3128_GMAC_SPEED_10M);
+	} else if (speed == 100) {
+		regmap_write(bsp_priv->grf, RK3128_GRF_MAC_CON1,
+			     RK3128_GMAC_RMII_CLK_25M |
+			     RK3128_GMAC_SPEED_100M);
+	} else {
+		dev_err(dev, "unknown speed value for RMII! speed=%d", speed);
+	}
+}
+
+static const struct rk_gmac_ops rk3128_ops = {
+	.set_to_rgmii = rk3128_set_to_rgmii,
+	.set_to_rmii = rk3128_set_to_rmii,
+	.set_rgmii_speed = rk3128_set_rgmii_speed,
+	.set_rmii_speed = rk3128_set_rmii_speed,
+};
+
 #define RK3228_GRF_MAC_CON0	0x0900
 #define RK3228_GRF_MAC_CON1	0x0904
 
@@ -1313,6 +1424,7 @@ static int rk_gmac_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(rk_gmac_pm_ops, rk_gmac_suspend, rk_gmac_resume);
 
 static const struct of_device_id rk_gmac_dwmac_match[] = {
+	{ .compatible = "rockchip,rk3128-gmac", .data = &rk3128_ops },
 	{ .compatible = "rockchip,rk3228-gmac", .data = &rk3228_ops },
 	{ .compatible = "rockchip,rk3288-gmac", .data = &rk3288_ops },
 	{ .compatible = "rockchip,rk3328-gmac", .data = &rk3328_ops },
-- 
1.9.1

^ permalink raw reply related

* [PATCH v2 2/2] net: phonet: mark phonet_protocol as const
From: Lin Zhang @ 2017-09-30  9:40 UTC (permalink / raw)
  To: davem; +Cc: netdev, courmisch, Lin Zhang

The phonet_protocol structs don't need to be written by anyone and
so can be marked as const.

Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
---
changelog:

v1 -> v2:
	* remove __read_mostly tag
---
 include/net/phonet/phonet.h |  6 ++++--
 net/phonet/af_phonet.c      | 15 ++++++++-------
 net/phonet/datagram.c       |  2 +-
 net/phonet/pep.c            |  2 +-
 4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
index 039cc29..51e1a2a 100644
--- a/include/net/phonet/phonet.h
+++ b/include/net/phonet/phonet.h
@@ -108,8 +108,10 @@ struct phonet_protocol {
 	int			sock_type;
 };
 
-int phonet_proto_register(unsigned int protocol, struct phonet_protocol *pp);
-void phonet_proto_unregister(unsigned int protocol, struct phonet_protocol *pp);
+int phonet_proto_register(unsigned int protocol,
+		const struct phonet_protocol *pp);
+void phonet_proto_unregister(unsigned int protocol,
+		const struct phonet_protocol *pp);
 
 int phonet_sysctl_init(void);
 void phonet_sysctl_exit(void);
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index b12142e..63b9870 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -35,11 +35,11 @@
 #include <net/phonet/pn_dev.h>
 
 /* Transport protocol registration */
-static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
+static const struct phonet_protocol *proto_tab[PHONET_NPROTO];
 
-static struct phonet_protocol *phonet_proto_get(unsigned int protocol)
+static const struct phonet_protocol *phonet_proto_get(unsigned int protocol)
 {
-	struct phonet_protocol *pp;
+	const struct phonet_protocol *pp;
 
 	if (protocol >= PHONET_NPROTO)
 		return NULL;
@@ -53,7 +53,7 @@ static struct phonet_protocol *phonet_proto_get(unsigned int protocol)
 	return pp;
 }
 
-static inline void phonet_proto_put(struct phonet_protocol *pp)
+static inline void phonet_proto_put(const struct phonet_protocol *pp)
 {
 	module_put(pp->prot->owner);
 }
@@ -65,7 +65,7 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol,
 {
 	struct sock *sk;
 	struct pn_sock *pn;
-	struct phonet_protocol *pnp;
+	const struct phonet_protocol *pnp;
 	int err;
 
 	if (!capable(CAP_SYS_ADMIN))
@@ -470,7 +470,7 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
 static DEFINE_MUTEX(proto_tab_lock);
 
 int __init_or_module phonet_proto_register(unsigned int protocol,
-						struct phonet_protocol *pp)
+				const struct phonet_protocol *pp)
 {
 	int err = 0;
 
@@ -492,7 +492,8 @@ int __init_or_module phonet_proto_register(unsigned int protocol,
 }
 EXPORT_SYMBOL(phonet_proto_register);
 
-void phonet_proto_unregister(unsigned int protocol, struct phonet_protocol *pp)
+void phonet_proto_unregister(unsigned int protocol,
+			const struct phonet_protocol *pp)
 {
 	mutex_lock(&proto_tab_lock);
 	BUG_ON(proto_tab[protocol] != pp);
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c
index 5e71043..b44fb90 100644
--- a/net/phonet/datagram.c
+++ b/net/phonet/datagram.c
@@ -195,7 +195,7 @@ static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb)
 	.name		= "PHONET",
 };
 
-static struct phonet_protocol pn_dgram_proto = {
+static const struct phonet_protocol pn_dgram_proto = {
 	.ops		= &phonet_dgram_ops,
 	.prot		= &pn_proto,
 	.sock_type	= SOCK_DGRAM,
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index e815379..9fc76b1 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -1351,7 +1351,7 @@ static void pep_sock_unhash(struct sock *sk)
 	.name		= "PNPIPE",
 };
 
-static struct phonet_protocol pep_pn_proto = {
+static const struct phonet_protocol pep_pn_proto = {
 	.ops		= &phonet_stream_ops,
 	.prot		= &pep_proto,
 	.sock_type	= SOCK_SEQPACKET,
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v2 1/2] net: phonet: mark header_ops as const
From: Lin Zhang @ 2017-09-30  9:39 UTC (permalink / raw)
  To: davem; +Cc: netdev, courmisch, Lin Zhang

Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
---
 net/phonet/af_phonet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index f925753..b12142e 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -149,7 +149,7 @@ static int pn_header_parse(const struct sk_buff *skb, unsigned char *haddr)
 	return 1;
 }
 
-struct header_ops phonet_header_ops = {
+const struct header_ops phonet_header_ops = {
 	.create = pn_header_create,
 	.parse = pn_header_parse,
 };
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH 2/2] net: phonet: mark phonet_protocol as const
From: Lin Zhang @ 2017-09-30  9:11 UTC (permalink / raw)
  To: davem; +Cc: netdev, courmisch, Lin Zhang

The phonet_protocol structs don't need to be written by anyone and
so can be marked as const.

Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
---
 include/net/phonet/phonet.h |  6 ++++--
 net/phonet/af_phonet.c      | 15 ++++++++-------
 net/phonet/datagram.c       |  2 +-
 net/phonet/pep.c            |  2 +-
 4 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
index 039cc29..51e1a2a 100644
--- a/include/net/phonet/phonet.h
+++ b/include/net/phonet/phonet.h
@@ -108,8 +108,10 @@ struct phonet_protocol {
 	int			sock_type;
 };
 
-int phonet_proto_register(unsigned int protocol, struct phonet_protocol *pp);
-void phonet_proto_unregister(unsigned int protocol, struct phonet_protocol *pp);
+int phonet_proto_register(unsigned int protocol,
+		const struct phonet_protocol *pp);
+void phonet_proto_unregister(unsigned int protocol,
+		const struct phonet_protocol *pp);
 
 int phonet_sysctl_init(void);
 void phonet_sysctl_exit(void);
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index b12142e..3b0ef69 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -35,11 +35,11 @@
 #include <net/phonet/pn_dev.h>
 
 /* Transport protocol registration */
-static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
+static const struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
 
-static struct phonet_protocol *phonet_proto_get(unsigned int protocol)
+static const struct phonet_protocol *phonet_proto_get(unsigned int protocol)
 {
-	struct phonet_protocol *pp;
+	const struct phonet_protocol *pp;
 
 	if (protocol >= PHONET_NPROTO)
 		return NULL;
@@ -53,7 +53,7 @@ static struct phonet_protocol *phonet_proto_get(unsigned int protocol)
 	return pp;
 }
 
-static inline void phonet_proto_put(struct phonet_protocol *pp)
+static inline void phonet_proto_put(const struct phonet_protocol *pp)
 {
 	module_put(pp->prot->owner);
 }
@@ -65,7 +65,7 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol,
 {
 	struct sock *sk;
 	struct pn_sock *pn;
-	struct phonet_protocol *pnp;
+	const struct phonet_protocol *pnp;
 	int err;
 
 	if (!capable(CAP_SYS_ADMIN))
@@ -470,7 +470,7 @@ static int phonet_rcv(struct sk_buff *skb, struct net_device *dev,
 static DEFINE_MUTEX(proto_tab_lock);
 
 int __init_or_module phonet_proto_register(unsigned int protocol,
-						struct phonet_protocol *pp)
+				const struct phonet_protocol *pp)
 {
 	int err = 0;
 
@@ -492,7 +492,8 @@ int __init_or_module phonet_proto_register(unsigned int protocol,
 }
 EXPORT_SYMBOL(phonet_proto_register);
 
-void phonet_proto_unregister(unsigned int protocol, struct phonet_protocol *pp)
+void phonet_proto_unregister(unsigned int protocol,
+			const struct phonet_protocol *pp)
 {
 	mutex_lock(&proto_tab_lock);
 	BUG_ON(proto_tab[protocol] != pp);
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c
index 5e71043..b44fb90 100644
--- a/net/phonet/datagram.c
+++ b/net/phonet/datagram.c
@@ -195,7 +195,7 @@ static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb)
 	.name		= "PHONET",
 };
 
-static struct phonet_protocol pn_dgram_proto = {
+static const struct phonet_protocol pn_dgram_proto = {
 	.ops		= &phonet_dgram_ops,
 	.prot		= &pn_proto,
 	.sock_type	= SOCK_DGRAM,
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index e815379..9fc76b1 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -1351,7 +1351,7 @@ static void pep_sock_unhash(struct sock *sk)
 	.name		= "PNPIPE",
 };
 
-static struct phonet_protocol pep_pn_proto = {
+static const struct phonet_protocol pep_pn_proto = {
 	.ops		= &phonet_stream_ops,
 	.prot		= &pep_proto,
 	.sock_type	= SOCK_SEQPACKET,
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH 1/2] net: phonet: mark header_ops as const
From: Lin Zhang @ 2017-09-30  9:08 UTC (permalink / raw)
  To: davem; +Cc: netdev, courmisch, Lin Zhang

Signed-off-by: Lin Zhang <xiaolou4617@gmail.com>
---
 net/phonet/af_phonet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index f925753..b12142e 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -149,7 +149,7 @@ static int pn_header_parse(const struct sk_buff *skb, unsigned char *haddr)
 	return 1;
 }
 
-struct header_ops phonet_header_ops = {
+const struct header_ops phonet_header_ops = {
 	.create = pn_header_create,
 	.parse = pn_header_parse,
 };
-- 
1.8.3.1

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox