Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH ghak81 V3 3/3] audit: collect audit task parameters
From: kbuild test robot @ 2018-05-17  1:43 UTC (permalink / raw)
  To: Richard Guy Briggs
  Cc: kbuild-all, Linux-Audit Mailing List, LKML,
	Linux NetDev Upstream Mailing List, Netfilter Devel List,
	Linux Security Module list, Integrity Measurement Architecture,
	SElinux list, Eric Paris, Paul Moore, Steve Grubb, Ingo Molnar,
	David Howells, Richard Guy Briggs
In-Reply-To: <fbed63483b5206009ee43ae889b30d43051f386c.1526430313.git.rgb@redhat.com>

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

Hi Richard,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20180516]
[cannot apply to linus/master tip/sched/core v4.17-rc5 v4.17-rc4 v4.17-rc3 v4.17-rc5]
[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/Richard-Guy-Briggs/audit-group-task-params/20180517-090703
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   kernel/fork.c: In function 'copy_process':
>> kernel/fork.c:1739:3: error: 'struct task_struct' has no member named 'audit'
     p->audit = NULL;
      ^~

vim +1739 kernel/fork.c

  1728	
  1729		p->default_timer_slack_ns = current->timer_slack_ns;
  1730	
  1731		task_io_accounting_init(&p->ioac);
  1732		acct_clear_integrals(p);
  1733	
  1734		posix_cpu_timers_init(p);
  1735	
  1736		p->start_time = ktime_get_ns();
  1737		p->real_start_time = ktime_get_boot_ns();
  1738		p->io_context = NULL;
> 1739		p->audit = NULL;
  1740		cgroup_fork(p);
  1741	#ifdef CONFIG_NUMA
  1742		p->mempolicy = mpol_dup(p->mempolicy);
  1743		if (IS_ERR(p->mempolicy)) {
  1744			retval = PTR_ERR(p->mempolicy);
  1745			p->mempolicy = NULL;
  1746			goto bad_fork_cleanup_threadgroup_lock;
  1747		}
  1748	#endif
  1749	#ifdef CONFIG_CPUSETS
  1750		p->cpuset_mem_spread_rotor = NUMA_NO_NODE;
  1751		p->cpuset_slab_spread_rotor = NUMA_NO_NODE;
  1752		seqcount_init(&p->mems_allowed_seq);
  1753	#endif
  1754	#ifdef CONFIG_TRACE_IRQFLAGS
  1755		p->irq_events = 0;
  1756		p->hardirqs_enabled = 0;
  1757		p->hardirq_enable_ip = 0;
  1758		p->hardirq_enable_event = 0;
  1759		p->hardirq_disable_ip = _THIS_IP_;
  1760		p->hardirq_disable_event = 0;
  1761		p->softirqs_enabled = 1;
  1762		p->softirq_enable_ip = _THIS_IP_;
  1763		p->softirq_enable_event = 0;
  1764		p->softirq_disable_ip = 0;
  1765		p->softirq_disable_event = 0;
  1766		p->hardirq_context = 0;
  1767		p->softirq_context = 0;
  1768	#endif
  1769	
  1770		p->pagefault_disabled = 0;
  1771	

---
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: 6329 bytes --]

^ permalink raw reply

* [PATCH] bonding: introduce link change helper
From: Tonghao Zhang @ 2018-05-17  2:09 UTC (permalink / raw)
  To: netdev; +Cc: Tonghao Zhang

Introduce an new common helper to avoid redundancy.

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
 drivers/net/bonding/bond_main.c | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 718e491..3063a9c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2135,6 +2135,24 @@ static int bond_miimon_inspect(struct bonding *bond)
 	return commit;
 }
 
+static void bond_miimon_link_change(struct bonding *bond,
+				    struct slave *slave,
+				    char link)
+{
+	switch (BOND_MODE(bond)) {
+	case BOND_MODE_8023AD:
+		bond_3ad_handle_link_change(slave, link);
+		break;
+	case BOND_MODE_TLB:
+	case BOND_MODE_ALB:
+		bond_alb_handle_link_change(bond, slave, link);
+		break;
+	case BOND_MODE_XOR:
+		bond_update_slave_arr(bond, NULL);
+		break;
+	}
+}
+
 static void bond_miimon_commit(struct bonding *bond)
 {
 	struct list_head *iter;
@@ -2176,16 +2194,7 @@ static void bond_miimon_commit(struct bonding *bond)
 				    slave->speed == SPEED_UNKNOWN ? 0 : slave->speed,
 				    slave->duplex ? "full" : "half");
 
-			/* notify ad that the link status has changed */
-			if (BOND_MODE(bond) == BOND_MODE_8023AD)
-				bond_3ad_handle_link_change(slave, BOND_LINK_UP);
-
-			if (bond_is_lb(bond))
-				bond_alb_handle_link_change(bond, slave,
-							    BOND_LINK_UP);
-
-			if (BOND_MODE(bond) == BOND_MODE_XOR)
-				bond_update_slave_arr(bond, NULL);
+			bond_miimon_link_change(bond, slave, BOND_LINK_UP);
 
 			if (!bond->curr_active_slave || slave == primary)
 				goto do_failover;
@@ -2207,16 +2216,7 @@ static void bond_miimon_commit(struct bonding *bond)
 			netdev_info(bond->dev, "link status definitely down for interface %s, disabling it\n",
 				    slave->dev->name);
 
-			if (BOND_MODE(bond) == BOND_MODE_8023AD)
-				bond_3ad_handle_link_change(slave,
-							    BOND_LINK_DOWN);
-
-			if (bond_is_lb(bond))
-				bond_alb_handle_link_change(bond, slave,
-							    BOND_LINK_DOWN);
-
-			if (BOND_MODE(bond) == BOND_MODE_XOR)
-				bond_update_slave_arr(bond, NULL);
+			bond_miimon_link_change(bond, slave, BOND_LINK_DOWN);
 
 			if (slave == rcu_access_pointer(bond->curr_active_slave))
 				goto do_failover;
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH net-next v3 1/3] ipv4: support sport, dport and ip_proto in RTM_GETROUTE
From: David Miller @ 2018-05-17  2:36 UTC (permalink / raw)
  To: roopa; +Cc: netdev, dsa, nikolay, idosch
In-Reply-To: <CAJieiUi1p31mrRRP2=X-Z-8fWyfea2JVMgmponMwrUzQF-OyoA@mail.gmail.com>

From: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Wed, 16 May 2018 13:30:28 -0700

> yes, but we hold rcu read lock before calling the reply function for
> fib result.  I did consider allocating the skb before the read
> lock..but then the refactoring (into a separate netlink reply func)
> would seem unnecessary.
> 
> I am fine with pre-allocating and undoing the refactoring if that works better.

Hmmm... I also notice that with this change we end up doing the
rtnl_unicast() under the RCU lock which is unnecessary too.

So yes, please pull the "out_skb" allocation before the
rcu_read_lock(), and push the rtnl_unicast() after the
rcu_read_unlock().

It really is a shame that sharing the ETH_P_IP skb between the route
route lookup and the netlink response doesn't work properly.

I was using RTM_GETROUTE at one point for route/fib lookup performance
measurements.  It never was great at that, but now that there is going
to be two SKB allocations instead of one it is going to be even less
useful for that kind of usage.

^ permalink raw reply

* Re: pull-request: bpf-next 2018-05-17
From: David Miller @ 2018-05-17  2:47 UTC (permalink / raw)
  To: daniel; +Cc: ast, netdev
In-Reply-To: <20180517010948.21249-1-daniel@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Thu, 17 May 2018 03:09:48 +0200

> The following pull-request contains BPF updates for your *net-next*
> tree.

Looks good, pulled, thanks Daniel.

^ permalink raw reply

* Re: xdp and fragments with virtio
From: David Ahern @ 2018-05-17  2:55 UTC (permalink / raw)
  To: Jason Wang, netdev@vger.kernel.org
In-Reply-To: <4d6952b4-b252-2fe5-8893-a3e2329bd34b@redhat.com>

On 5/16/18 1:24 AM, Jason Wang wrote:
> 
> 
> On 2018年05月16日 11:51, David Ahern wrote:
>> Hi Jason:
>>
>> I am trying to test MTU changes to the BPF fib_lookup helper and seeing
>> something odd. Hoping you can help.
>>
>> I have a VM with multiple virtio based NICs and tap backends. I install
>> the xdp program on eth1 and eth2 to do forwarding. In the host I send a
>> large packet to eth1:
>>
>> $ ping -s 1500 9.9.9.9
>>
>>
>> The tap device in the host sees 2 packets:
>>
>> $ sudo tcpdump -nv -i vm02-eth1
>> 20:44:33.943160 IP (tos 0x0, ttl 64, id 58746, offset 0, flags [+],
>> proto ICMP (1), length 1500)
>>      10.100.1.254 > 9.9.9.9: ICMP echo request, id 17917, seq 1,
>> length 1480
>> 20:44:33.943172 IP (tos 0x0, ttl 64, id 58746, offset 1480, flags
>> [none], proto ICMP (1), length 48)
>>      10.100.1.254 > 9.9.9.9: ip-proto-1
>>
>>
>> In the VM, the XDP program only sees the first packet, not the fragment.
>> I added a printk to the program (see diff below):
>>
>> $ cat trace_pipe
>>            <idle>-0     [003] ..s2   254.436467: 0: packet length 1514
>>
>>
>> Anything come to mind in the virtio xdp implementation that affects
>> fragment packets? I see this with both IPv4 and v6.
> 
> Not yet. But we do turn of tap gso when virtio has XDP set, but it
> shouldn't matter this case.
> 
> Will try to see what's wrong.
> 

I added this to the command line for the NICs and it works:

"mrg_rxbuf=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,guest_ufo=off"

XDP program sees the full size packet and the fragment.

Fun fact: only adding mrg_rxbuf=off so that mergeable_rx_bufs is false
but big_packets is true generates a panic when it receives large packets.

^ permalink raw reply

* Re: [PATCH net-next 1/3] net: ethernet: ti: Allow most drivers with COMPILE_TEST
From: kbuild test robot @ 2018-05-17  3:02 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: kbuild-all, netdev, Florian Fainelli, David S. Miller,
	Andrew Lunn, open list
In-Reply-To: <20180515234825.11240-2-f.fainelli@gmail.com>

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

Hi Florian,

I love your patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Florian-Fainelli/net-Allow-more-drivers-with-COMPILE_TEST/20180517-092807
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/realmode.h:15:0,
                    from arch/x86/include/asm/acpi.h:33,
                    from arch/x86/include/asm/fixmap.h:19,
                    from arch/x86/include/asm/apic.h:10,
                    from arch/x86/include/asm/smp.h:13,
                    from include/linux/smp.h:64,
                    from include/linux/topology.h:33,
                    from include/linux/gfp.h:9,
                    from include/linux/idr.h:16,
                    from include/linux/kernfs.h:14,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/device.h:16,
                    from drivers/net/ethernet/ti/davinci_cpdma.c:17:
   drivers/net/ethernet/ti/davinci_cpdma.c: In function 'cpdma_chan_submit':
>> drivers/net/ethernet/ti/davinci_cpdma.c:1083:17: warning: passing argument 1 of '__writel' makes integer from pointer without a cast [-Wint-conversion]
     writel_relaxed(token, &desc->sw_token);
                    ^
   arch/x86/include/asm/io.h:88:39: note: in definition of macro 'writel_relaxed'
    #define writel_relaxed(v, a) __writel(v, a)
                                          ^
   arch/x86/include/asm/io.h:71:18: note: expected 'unsigned int' but argument is of type 'void *'
    build_mmio_write(__writel, "l", unsigned int, "r", )
                     ^
   arch/x86/include/asm/io.h:53:20: note: in definition of macro 'build_mmio_write'
    static inline void name(type val, volatile void __iomem *addr) \
                       ^~~~

vim +/__writel +1083 drivers/net/ethernet/ti/davinci_cpdma.c

ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1029  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1030  int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
aef614e1 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-04-23  1031  		      int len, int directed)
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1032  {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1033  	struct cpdma_ctlr		*ctlr = chan->ctlr;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1034  	struct cpdma_desc __iomem	*desc;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1035  	dma_addr_t			buffer;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1036  	unsigned long			flags;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1037  	u32				mode;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1038  	int				ret = 0;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1039  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1040  	spin_lock_irqsave(&chan->lock, flags);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1041  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1042  	if (chan->state == CPDMA_STATE_TEARDOWN) {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1043  		ret = -EINVAL;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1044  		goto unlock_ret;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1045  	}
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1046  
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1047  	if (chan->count >= chan->desc_num)	{
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1048  		chan->stats.desc_alloc_fail++;
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1049  		ret = -ENOMEM;
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1050  		goto unlock_ret;
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1051  	}
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1052  
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1053  	desc = cpdma_desc_alloc(ctlr->pool);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1054  	if (!desc) {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1055  		chan->stats.desc_alloc_fail++;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1056  		ret = -ENOMEM;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1057  		goto unlock_ret;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1058  	}
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1059  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1060  	if (len < ctlr->params.min_packet_size) {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1061  		len = ctlr->params.min_packet_size;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1062  		chan->stats.runt_transmit_buff++;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1063  	}
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1064  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1065  	buffer = dma_map_single(ctlr->dev, data, len, chan->dir);
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1066  	ret = dma_mapping_error(ctlr->dev, buffer);
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1067  	if (ret) {
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1068  		cpdma_desc_free(ctlr->pool, desc, 1);
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1069  		ret = -EINVAL;
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1070  		goto unlock_ret;
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1071  	}
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1072  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1073  	mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP;
f6e135c8 drivers/net/ethernet/ti/davinci_cpdma.c Mugunthan V N     2013-02-11  1074  	cpdma_desc_to_port(chan, mode, directed);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1075  
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1076  	/* Relaxed IO accessors can be used here as there is read barrier
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1077  	 * at the end of write sequence.
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1078  	 */
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1079  	writel_relaxed(0, &desc->hw_next);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1080  	writel_relaxed(buffer, &desc->hw_buffer);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1081  	writel_relaxed(len, &desc->hw_len);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1082  	writel_relaxed(mode | len, &desc->hw_mode);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06 @1083  	writel_relaxed(token, &desc->sw_token);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1084  	writel_relaxed(buffer, &desc->sw_buffer);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1085  	writel_relaxed(len, &desc->sw_len);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1086  	desc_read(desc, sw_len);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1087  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1088  	__cpdma_chan_submit(chan, desc);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1089  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1090  	if (chan->state == CPDMA_STATE_ACTIVE && chan->rxfree)
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1091  		chan_write(chan, rxfree, 1);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1092  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1093  	chan->count++;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1094  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1095  unlock_ret:
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1096  	spin_unlock_irqrestore(&chan->lock, flags);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1097  	return ret;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1098  }
32a6d90b drivers/net/ethernet/ti/davinci_cpdma.c Arnd Bergmann     2012-04-20  1099  EXPORT_SYMBOL_GPL(cpdma_chan_submit);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1100  

:::::: The code at line 1083 was first introduced by commit
:::::: a6c83ccf3c534214e0aeb167a70391864da9b1fc net: ethernet: ti: cpdma: am437x: allow descs to be plased in ddr

:::::: TO: Grygorii Strashko <grygorii.strashko@ti.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: 63048 bytes --]

^ permalink raw reply

* Re: Donation
From: M.M. Fridman @ 2018-05-15  2:11 UTC (permalink / raw)





I Mikhail Fridman. has selected you specially as one of my beneficiaries
for my Charitable Donation, Just as I have declared on May 23, 2016 to give
my fortune as charity.

Check the link below for confirmation:

http://www.ibtimes.co.uk/russias-second-wealthiest-man-mikhail-fridman-plans-leaving-14-2bn-fortune-charity-1561604

Reply as soon as possible with further directives.

Best Regards,
Mikhail Fridman.

^ permalink raw reply

* Re: [PATCH net-next 2/3] net: ethernet: freescale: Allow FEC with COMPILE_TEST
From: kbuild test robot @ 2018-05-17  3:38 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: kbuild-all, netdev, Florian Fainelli, David S. Miller,
	Andrew Lunn, open list
In-Reply-To: <20180515234825.11240-3-f.fainelli@gmail.com>

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

Hi Florian,

I love your patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Florian-Fainelli/net-Allow-more-drivers-with-COMPILE_TEST/20180517-092807
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
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=m68k 

All warnings (new ones prefixed by >>):

   In file included from include/linux/swab.h:5:0,
                    from include/uapi/linux/byteorder/big_endian.h:13,
                    from include/linux/byteorder/big_endian.h:5,
                    from arch/m68k/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/m68k/include/asm/bitops.h:519,
                    from include/linux/bitops.h:38,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from drivers/net/ethernet/freescale/fec_main.c:24:
   drivers/net/ethernet/freescale/fec_main.c: In function 'fec_restart':
   drivers/net/ethernet/freescale/fec_main.c:959:26: error: 'FEC_RACC' undeclared (first use in this function); did you mean 'FEC_RXIC0'?
      val = readl(fep->hwp + FEC_RACC);
                             ^
   include/uapi/linux/swab.h:117:32: note: in definition of macro '__swab32'
     (__builtin_constant_p((__u32)(x)) ? \
                                   ^
>> include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
>> arch/m68k/include/asm/io_mm.h:452:26: note: in expansion of macro 'in_le32'
    #define readl(addr)      in_le32(addr)
                             ^~~~~~~
>> drivers/net/ethernet/freescale/fec_main.c:959:9: note: in expansion of macro 'readl'
      val = readl(fep->hwp + FEC_RACC);
            ^~~~~
   drivers/net/ethernet/freescale/fec_main.c:959:26: note: each undeclared identifier is reported only once for each function it appears in
      val = readl(fep->hwp + FEC_RACC);
                             ^
   include/uapi/linux/swab.h:117:32: note: in definition of macro '__swab32'
     (__builtin_constant_p((__u32)(x)) ? \
                                   ^
>> include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
>> arch/m68k/include/asm/io_mm.h:452:26: note: in expansion of macro 'in_le32'
    #define readl(addr)      in_le32(addr)
                             ^~~~~~~
>> drivers/net/ethernet/freescale/fec_main.c:959:9: note: in expansion of macro 'readl'
      val = readl(fep->hwp + FEC_RACC);
            ^~~~~
   In file included from arch/m68k/include/asm/io_mm.h:27:0,
                    from arch/m68k/include/asm/io.h:5,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:11,
                    from include/linux/skbuff.h:34,
                    from include/linux/if_ether.h:23,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from include/linux/netdevice.h:41,
                    from drivers/net/ethernet/freescale/fec_main.c:34:
   drivers/net/ethernet/freescale/fec_main.c:968:38: error: 'FEC_FTRL' undeclared (first use in this function); did you mean 'FEC_ECNTRL'?
      writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
>> drivers/net/ethernet/freescale/fec_main.c:968:3: note: in expansion of macro 'writel'
      writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
      ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1034:38: error: 'FEC_R_FIFO_RSEM' undeclared (first use in this function); did you mean 'FEC_FIFO_RAM'?
      writel(FEC_ENET_RSEM_V, fep->hwp + FEC_R_FIFO_RSEM);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1034:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RSEM_V, fep->hwp + FEC_R_FIFO_RSEM);
      ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1035:38: error: 'FEC_R_FIFO_RSFL' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSEM'?
      writel(FEC_ENET_RSFL_V, fep->hwp + FEC_R_FIFO_RSFL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1035:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RSFL_V, fep->hwp + FEC_R_FIFO_RSFL);
      ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1036:38: error: 'FEC_R_FIFO_RAEM' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSEM'?
      writel(FEC_ENET_RAEM_V, fep->hwp + FEC_R_FIFO_RAEM);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1036:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RAEM_V, fep->hwp + FEC_R_FIFO_RAEM);
      ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1037:38: error: 'FEC_R_FIFO_RAFL' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSFL'?
      writel(FEC_ENET_RAFL_V, fep->hwp + FEC_R_FIFO_RAFL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1037:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RAFL_V, fep->hwp + FEC_R_FIFO_RAFL);
      ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1040:37: error: 'FEC_OPD' undeclared (first use in this function); did you mean 'FEC_H'?
      writel(FEC_ENET_OPD_V, fep->hwp + FEC_OPD);
                                        ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1040:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_OPD_V, fep->hwp + FEC_OPD);
      ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1051:23: error: 'FEC_HASH_TABLE_HIGH' undeclared (first use in this function); did you mean 'FEC_GRP_HASH_TABLE_HIGH'?
     writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
                          ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1051:2: note: in expansion of macro 'writel'
     writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
     ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1052:23: error: 'FEC_HASH_TABLE_LOW' undeclared (first use in this function); did you mean 'FEC_HASH_TABLE_HIGH'?
     writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
                          ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1052:2: note: in expansion of macro 'writel'
     writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
     ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c:1067:29: error: 'FEC_MIB_CTRLSTAT' undeclared (first use in this function); did you mean 'TCP_MIB_CURRESTAB'?
     writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT);
                                ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net/ethernet/freescale/fec_main.c:1067:2: note: in expansion of macro 'writel'
     writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT);
     ^~~~~~
   drivers/net/ethernet/freescale/fec_main.c: At top level:
   drivers/net/ethernet/freescale/fec_main.c:2261:18: error: 'RMON_T_DROP' undeclared here (not in a function); did you mean 'RTN_THROW'?
     { "tx_dropped", RMON_T_DROP },
                     ^~~~~~~~~~~
                     RTN_THROW
   drivers/net/ethernet/freescale/fec_main.c:2262:18: error: 'RMON_T_PACKETS' undeclared here (not in a function); did you mean 'SOCK_PACKET'?
     { "tx_packets", RMON_T_PACKETS },
                     ^~~~~~~~~~~~~~
                     SOCK_PACKET
   drivers/net/ethernet/freescale/fec_main.c:2263:20: error: 'RMON_T_BC_PKT' undeclared here (not in a function); did you mean 'RMON_T_DROP'?
     { "tx_broadcast", RMON_T_BC_PKT },
                       ^~~~~~~~~~~~~
                       RMON_T_DROP
   drivers/net/ethernet/freescale/fec_main.c:2264:20: error: 'RMON_T_MC_PKT' undeclared here (not in a function); did you mean 'RMON_T_BC_PKT'?
     { "tx_multicast", RMON_T_MC_PKT },
                       ^~~~~~~~~~~~~
                       RMON_T_BC_PKT
   drivers/net/ethernet/freescale/fec_main.c:2265:21: error: 'RMON_T_CRC_ALIGN' undeclared here (not in a function); did you mean 'RMON_T_MC_PKT'?
     { "tx_crc_errors", RMON_T_CRC_ALIGN },
                        ^~~~~~~~~~~~~~~~
                        RMON_T_MC_PKT
   drivers/net/ethernet/freescale/fec_main.c:2266:20: error: 'RMON_T_UNDERSIZE' undeclared here (not in a function); did you mean 'RMON_T_DROP'?
     { "tx_undersize", RMON_T_UNDERSIZE },
                       ^~~~~~~~~~~~~~~~
                       RMON_T_DROP
   drivers/net/ethernet/freescale/fec_main.c:2267:19: error: 'RMON_T_OVERSIZE' undeclared here (not in a function); did you mean 'RMON_T_UNDERSIZE'?
--
   In file included from include/linux/swab.h:5:0,
                    from include/uapi/linux/byteorder/big_endian.h:13,
                    from include/linux/byteorder/big_endian.h:5,
                    from arch/m68k/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/m68k/include/asm/bitops.h:519,
                    from include/linux/bitops.h:38,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from drivers/net//ethernet/freescale/fec_main.c:24:
   drivers/net//ethernet/freescale/fec_main.c: In function 'fec_restart':
   drivers/net//ethernet/freescale/fec_main.c:959:26: error: 'FEC_RACC' undeclared (first use in this function); did you mean 'FEC_RXIC0'?
      val = readl(fep->hwp + FEC_RACC);
                             ^
   include/uapi/linux/swab.h:117:32: note: in definition of macro '__swab32'
     (__builtin_constant_p((__u32)(x)) ? \
                                   ^
>> include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
>> arch/m68k/include/asm/io_mm.h:452:26: note: in expansion of macro 'in_le32'
    #define readl(addr)      in_le32(addr)
                             ^~~~~~~
   drivers/net//ethernet/freescale/fec_main.c:959:9: note: in expansion of macro 'readl'
      val = readl(fep->hwp + FEC_RACC);
            ^~~~~
   drivers/net//ethernet/freescale/fec_main.c:959:26: note: each undeclared identifier is reported only once for each function it appears in
      val = readl(fep->hwp + FEC_RACC);
                             ^
   include/uapi/linux/swab.h:117:32: note: in definition of macro '__swab32'
     (__builtin_constant_p((__u32)(x)) ? \
                                   ^
>> include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
>> arch/m68k/include/asm/io_mm.h:452:26: note: in expansion of macro 'in_le32'
    #define readl(addr)      in_le32(addr)
                             ^~~~~~~
   drivers/net//ethernet/freescale/fec_main.c:959:9: note: in expansion of macro 'readl'
      val = readl(fep->hwp + FEC_RACC);
            ^~~~~
   In file included from arch/m68k/include/asm/io_mm.h:27:0,
                    from arch/m68k/include/asm/io.h:5,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:11,
                    from include/linux/skbuff.h:34,
                    from include/linux/if_ether.h:23,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from include/linux/netdevice.h:41,
                    from drivers/net//ethernet/freescale/fec_main.c:34:
   drivers/net//ethernet/freescale/fec_main.c:968:38: error: 'FEC_FTRL' undeclared (first use in this function); did you mean 'FEC_ECNTRL'?
      writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:968:3: note: in expansion of macro 'writel'
      writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1034:38: error: 'FEC_R_FIFO_RSEM' undeclared (first use in this function); did you mean 'FEC_FIFO_RAM'?
      writel(FEC_ENET_RSEM_V, fep->hwp + FEC_R_FIFO_RSEM);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1034:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RSEM_V, fep->hwp + FEC_R_FIFO_RSEM);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1035:38: error: 'FEC_R_FIFO_RSFL' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSEM'?
      writel(FEC_ENET_RSFL_V, fep->hwp + FEC_R_FIFO_RSFL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1035:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RSFL_V, fep->hwp + FEC_R_FIFO_RSFL);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1036:38: error: 'FEC_R_FIFO_RAEM' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSEM'?
      writel(FEC_ENET_RAEM_V, fep->hwp + FEC_R_FIFO_RAEM);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1036:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RAEM_V, fep->hwp + FEC_R_FIFO_RAEM);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1037:38: error: 'FEC_R_FIFO_RAFL' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSFL'?
      writel(FEC_ENET_RAFL_V, fep->hwp + FEC_R_FIFO_RAFL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1037:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RAFL_V, fep->hwp + FEC_R_FIFO_RAFL);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1040:37: error: 'FEC_OPD' undeclared (first use in this function); did you mean 'FEC_H'?
      writel(FEC_ENET_OPD_V, fep->hwp + FEC_OPD);
                                        ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1040:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_OPD_V, fep->hwp + FEC_OPD);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1051:23: error: 'FEC_HASH_TABLE_HIGH' undeclared (first use in this function); did you mean 'FEC_GRP_HASH_TABLE_HIGH'?
     writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
                          ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1051:2: note: in expansion of macro 'writel'
     writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
     ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1052:23: error: 'FEC_HASH_TABLE_LOW' undeclared (first use in this function); did you mean 'FEC_HASH_TABLE_HIGH'?
     writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
                          ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1052:2: note: in expansion of macro 'writel'
     writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
     ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1067:29: error: 'FEC_MIB_CTRLSTAT' undeclared (first use in this function); did you mean 'TCP_MIB_CURRESTAB'?
     writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT);
                                ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1067:2: note: in expansion of macro 'writel'
     writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT);
     ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c: At top level:
   drivers/net//ethernet/freescale/fec_main.c:2261:18: error: 'RMON_T_DROP' undeclared here (not in a function); did you mean 'RTN_THROW'?
     { "tx_dropped", RMON_T_DROP },
                     ^~~~~~~~~~~

vim +/__le32_to_cpu +89 include/linux/byteorder/generic.h

^1da177e Linus Torvalds 2005-04-16    4  
^1da177e Linus Torvalds 2005-04-16    5  /*
90a85643 Geoff Levand   2014-08-06    6   * linux/byteorder/generic.h
^1da177e Linus Torvalds 2005-04-16    7   * Generic Byte-reordering support
^1da177e Linus Torvalds 2005-04-16    8   *
e0487992 Ed L. Cashin   2005-09-19    9   * The "... p" macros, like le64_to_cpup, can be used with pointers
e0487992 Ed L. Cashin   2005-09-19   10   * to unaligned data, but there will be a performance penalty on 
e0487992 Ed L. Cashin   2005-09-19   11   * some architectures.  Use get_unaligned for unaligned data.
e0487992 Ed L. Cashin   2005-09-19   12   *
^1da177e Linus Torvalds 2005-04-16   13   * Francois-Rene Rideau <fare@tunes.org> 19970707
^1da177e Linus Torvalds 2005-04-16   14   *    gathered all the good ideas from all asm-foo/byteorder.h into one file,
^1da177e Linus Torvalds 2005-04-16   15   *    cleaned them up.
^1da177e Linus Torvalds 2005-04-16   16   *    I hope it is compliant with non-GCC compilers.
^1da177e Linus Torvalds 2005-04-16   17   *    I decided to put __BYTEORDER_HAS_U64__ in byteorder.h,
^1da177e Linus Torvalds 2005-04-16   18   *    because I wasn't sure it would be ok to put it in types.h
^1da177e Linus Torvalds 2005-04-16   19   *    Upgraded it to 2.1.43
^1da177e Linus Torvalds 2005-04-16   20   * Francois-Rene Rideau <fare@tunes.org> 19971012
^1da177e Linus Torvalds 2005-04-16   21   *    Upgraded it to 2.1.57
^1da177e Linus Torvalds 2005-04-16   22   *    to please Linus T., replaced huge #ifdef's between little/big endian
^1da177e Linus Torvalds 2005-04-16   23   *    by nestedly #include'd files.
^1da177e Linus Torvalds 2005-04-16   24   * Francois-Rene Rideau <fare@tunes.org> 19971205
^1da177e Linus Torvalds 2005-04-16   25   *    Made it to 2.1.71; now a facelift:
^1da177e Linus Torvalds 2005-04-16   26   *    Put files under include/linux/byteorder/
^1da177e Linus Torvalds 2005-04-16   27   *    Split swab from generic support.
^1da177e Linus Torvalds 2005-04-16   28   *
^1da177e Linus Torvalds 2005-04-16   29   * TODO:
^1da177e Linus Torvalds 2005-04-16   30   *   = Regular kernel maintainers could also replace all these manual
^1da177e Linus Torvalds 2005-04-16   31   *    byteswap macros that remain, disseminated among drivers,
^1da177e Linus Torvalds 2005-04-16   32   *    after some grep or the sources...
^1da177e Linus Torvalds 2005-04-16   33   *   = Linus might want to rename all these macros and files to fit his taste,
^1da177e Linus Torvalds 2005-04-16   34   *    to fit his personal naming scheme.
^1da177e Linus Torvalds 2005-04-16   35   *   = it seems that a few drivers would also appreciate
^1da177e Linus Torvalds 2005-04-16   36   *    nybble swapping support...
^1da177e Linus Torvalds 2005-04-16   37   *   = every architecture could add their byteswap macro in asm/byteorder.h
^1da177e Linus Torvalds 2005-04-16   38   *    see how some architectures already do (i386, alpha, ppc, etc)
^1da177e Linus Torvalds 2005-04-16   39   *   = cpu_to_beXX and beXX_to_cpu might some day need to be well
^1da177e Linus Torvalds 2005-04-16   40   *    distinguished throughout the kernel. This is not the case currently,
^1da177e Linus Torvalds 2005-04-16   41   *    since little endian, big endian, and pdp endian machines needn't it.
^1da177e Linus Torvalds 2005-04-16   42   *    But this might be the case for, say, a port of Linux to 20/21 bit
^1da177e Linus Torvalds 2005-04-16   43   *    architectures (and F21 Linux addict around?).
^1da177e Linus Torvalds 2005-04-16   44   */
^1da177e Linus Torvalds 2005-04-16   45  
^1da177e Linus Torvalds 2005-04-16   46  /*
^1da177e Linus Torvalds 2005-04-16   47   * The following macros are to be defined by <asm/byteorder.h>:
^1da177e Linus Torvalds 2005-04-16   48   *
^1da177e Linus Torvalds 2005-04-16   49   * Conversion of long and short int between network and host format
^1da177e Linus Torvalds 2005-04-16   50   *	ntohl(__u32 x)
^1da177e Linus Torvalds 2005-04-16   51   *	ntohs(__u16 x)
^1da177e Linus Torvalds 2005-04-16   52   *	htonl(__u32 x)
^1da177e Linus Torvalds 2005-04-16   53   *	htons(__u16 x)
^1da177e Linus Torvalds 2005-04-16   54   * It seems that some programs (which? where? or perhaps a standard? POSIX?)
^1da177e Linus Torvalds 2005-04-16   55   * might like the above to be functions, not macros (why?).
^1da177e Linus Torvalds 2005-04-16   56   * if that's true, then detect them, and take measures.
^1da177e Linus Torvalds 2005-04-16   57   * Anyway, the measure is: define only ___ntohl as a macro instead,
^1da177e Linus Torvalds 2005-04-16   58   * and in a separate file, have
^1da177e Linus Torvalds 2005-04-16   59   * unsigned long inline ntohl(x){return ___ntohl(x);}
^1da177e Linus Torvalds 2005-04-16   60   *
^1da177e Linus Torvalds 2005-04-16   61   * The same for constant arguments
^1da177e Linus Torvalds 2005-04-16   62   *	__constant_ntohl(__u32 x)
^1da177e Linus Torvalds 2005-04-16   63   *	__constant_ntohs(__u16 x)
^1da177e Linus Torvalds 2005-04-16   64   *	__constant_htonl(__u32 x)
^1da177e Linus Torvalds 2005-04-16   65   *	__constant_htons(__u16 x)
^1da177e Linus Torvalds 2005-04-16   66   *
^1da177e Linus Torvalds 2005-04-16   67   * Conversion of XX-bit integers (16- 32- or 64-)
^1da177e Linus Torvalds 2005-04-16   68   * between native CPU format and little/big endian format
^1da177e Linus Torvalds 2005-04-16   69   * 64-bit stuff only defined for proper architectures
^1da177e Linus Torvalds 2005-04-16   70   *	cpu_to_[bl]eXX(__uXX x)
^1da177e Linus Torvalds 2005-04-16   71   *	[bl]eXX_to_cpu(__uXX x)
^1da177e Linus Torvalds 2005-04-16   72   *
^1da177e Linus Torvalds 2005-04-16   73   * The same, but takes a pointer to the value to convert
^1da177e Linus Torvalds 2005-04-16   74   *	cpu_to_[bl]eXXp(__uXX x)
^1da177e Linus Torvalds 2005-04-16   75   *	[bl]eXX_to_cpup(__uXX x)
^1da177e Linus Torvalds 2005-04-16   76   *
^1da177e Linus Torvalds 2005-04-16   77   * The same, but change in situ
^1da177e Linus Torvalds 2005-04-16   78   *	cpu_to_[bl]eXXs(__uXX x)
^1da177e Linus Torvalds 2005-04-16   79   *	[bl]eXX_to_cpus(__uXX x)
^1da177e Linus Torvalds 2005-04-16   80   *
^1da177e Linus Torvalds 2005-04-16   81   * See asm-foo/byteorder.h for examples of how to provide
^1da177e Linus Torvalds 2005-04-16   82   * architecture-optimized versions
^1da177e Linus Torvalds 2005-04-16   83   *
^1da177e Linus Torvalds 2005-04-16   84   */
^1da177e Linus Torvalds 2005-04-16   85  
^1da177e Linus Torvalds 2005-04-16   86  #define cpu_to_le64 __cpu_to_le64
^1da177e Linus Torvalds 2005-04-16   87  #define le64_to_cpu __le64_to_cpu
^1da177e Linus Torvalds 2005-04-16   88  #define cpu_to_le32 __cpu_to_le32
^1da177e Linus Torvalds 2005-04-16  @89  #define le32_to_cpu __le32_to_cpu
^1da177e Linus Torvalds 2005-04-16   90  #define cpu_to_le16 __cpu_to_le16
^1da177e Linus Torvalds 2005-04-16   91  #define le16_to_cpu __le16_to_cpu
^1da177e Linus Torvalds 2005-04-16   92  #define cpu_to_be64 __cpu_to_be64
^1da177e Linus Torvalds 2005-04-16   93  #define be64_to_cpu __be64_to_cpu
^1da177e Linus Torvalds 2005-04-16   94  #define cpu_to_be32 __cpu_to_be32
^1da177e Linus Torvalds 2005-04-16   95  #define be32_to_cpu __be32_to_cpu
^1da177e Linus Torvalds 2005-04-16   96  #define cpu_to_be16 __cpu_to_be16
^1da177e Linus Torvalds 2005-04-16   97  #define be16_to_cpu __be16_to_cpu
^1da177e Linus Torvalds 2005-04-16   98  #define cpu_to_le64p __cpu_to_le64p
^1da177e Linus Torvalds 2005-04-16   99  #define le64_to_cpup __le64_to_cpup
^1da177e Linus Torvalds 2005-04-16  100  #define cpu_to_le32p __cpu_to_le32p
^1da177e Linus Torvalds 2005-04-16  101  #define le32_to_cpup __le32_to_cpup
^1da177e Linus Torvalds 2005-04-16  102  #define cpu_to_le16p __cpu_to_le16p
^1da177e Linus Torvalds 2005-04-16  103  #define le16_to_cpup __le16_to_cpup
^1da177e Linus Torvalds 2005-04-16  104  #define cpu_to_be64p __cpu_to_be64p
^1da177e Linus Torvalds 2005-04-16  105  #define be64_to_cpup __be64_to_cpup
^1da177e Linus Torvalds 2005-04-16  106  #define cpu_to_be32p __cpu_to_be32p
^1da177e Linus Torvalds 2005-04-16  107  #define be32_to_cpup __be32_to_cpup
^1da177e Linus Torvalds 2005-04-16  108  #define cpu_to_be16p __cpu_to_be16p
^1da177e Linus Torvalds 2005-04-16  109  #define be16_to_cpup __be16_to_cpup
^1da177e Linus Torvalds 2005-04-16  110  #define cpu_to_le64s __cpu_to_le64s
^1da177e Linus Torvalds 2005-04-16  111  #define le64_to_cpus __le64_to_cpus
^1da177e Linus Torvalds 2005-04-16  112  #define cpu_to_le32s __cpu_to_le32s
^1da177e Linus Torvalds 2005-04-16  113  #define le32_to_cpus __le32_to_cpus
^1da177e Linus Torvalds 2005-04-16  114  #define cpu_to_le16s __cpu_to_le16s
^1da177e Linus Torvalds 2005-04-16  115  #define le16_to_cpus __le16_to_cpus
^1da177e Linus Torvalds 2005-04-16  116  #define cpu_to_be64s __cpu_to_be64s
^1da177e Linus Torvalds 2005-04-16  117  #define be64_to_cpus __be64_to_cpus
^1da177e Linus Torvalds 2005-04-16  118  #define cpu_to_be32s __cpu_to_be32s
^1da177e Linus Torvalds 2005-04-16  119  #define be32_to_cpus __be32_to_cpus
^1da177e Linus Torvalds 2005-04-16  120  #define cpu_to_be16s __cpu_to_be16s
^1da177e Linus Torvalds 2005-04-16  121  #define be16_to_cpus __be16_to_cpus
^1da177e Linus Torvalds 2005-04-16  122  

:::::: The code at line 89 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
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: 45454 bytes --]

^ permalink raw reply

* [PATCH net-next] vmxnet3: Replace msleep(1) with usleep_range()
From: YueHaibing @ 2018-05-17  3:46 UTC (permalink / raw)
  To: doshir, pv-drivers, davem; +Cc: netdev, linux-kernel, YueHaibing

As documented in Documentation/timers/timers-howto.txt,
replace msleep(1) with usleep_range().

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/vmxnet3/vmxnet3_drv.c     | 6 +++---
 drivers/net/vmxnet3/vmxnet3_ethtool.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 9ebe2a6..2234a33 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -2945,7 +2945,7 @@ vmxnet3_close(struct net_device *netdev)
 	 * completion.
 	 */
 	while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-		msleep(1);
+		usleep_range(1000, 2000);
 
 	vmxnet3_quiesce_dev(adapter);
 
@@ -2995,7 +2995,7 @@ vmxnet3_change_mtu(struct net_device *netdev, int new_mtu)
 	 * completion.
 	 */
 	while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-		msleep(1);
+		usleep_range(1000, 2000);
 
 	if (netif_running(netdev)) {
 		vmxnet3_quiesce_dev(adapter);
@@ -3567,7 +3567,7 @@ static void vmxnet3_shutdown_device(struct pci_dev *pdev)
 	 * completion.
 	 */
 	while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-		msleep(1);
+		usleep_range(1000, 2000);
 
 	if (test_and_set_bit(VMXNET3_STATE_BIT_QUIESCED,
 			     &adapter->state)) {
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 2ff2731..559db05 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -600,7 +600,7 @@ vmxnet3_set_ringparam(struct net_device *netdev,
 	 * completion.
 	 */
 	while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
-		msleep(1);
+		usleep_range(1000, 2000);
 
 	if (netif_running(netdev)) {
 		vmxnet3_quiesce_dev(adapter);
-- 
2.7.0

^ permalink raw reply related

* Re: [PATCH net-next 2/3] net: ethernet: freescale: Allow FEC with COMPILE_TEST
From: kbuild test robot @ 2018-05-17  4:03 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: kbuild-all, netdev, Florian Fainelli, David S. Miller,
	Andrew Lunn, open list
In-Reply-To: <20180515234825.11240-3-f.fainelli@gmail.com>

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

Hi Florian,

I love your patch! Yet something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Florian-Fainelli/net-Allow-more-drivers-with-COMPILE_TEST/20180517-092807
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
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=m68k 

All errors (new ones prefixed by >>):

   In file included from include/linux/swab.h:5:0,
                    from include/uapi/linux/byteorder/big_endian.h:13,
                    from include/linux/byteorder/big_endian.h:5,
                    from arch/m68k/include/uapi/asm/byteorder.h:5,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/m68k/include/asm/bitops.h:519,
                    from include/linux/bitops.h:38,
                    from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from drivers/net//ethernet/freescale/fec_main.c:24:
   drivers/net//ethernet/freescale/fec_main.c: In function 'fec_restart':
>> drivers/net//ethernet/freescale/fec_main.c:959:26: error: 'FEC_RACC' undeclared (first use in this function); did you mean 'FEC_RXIC1'?
      val = readl(fep->hwp + FEC_RACC);
                             ^
   include/uapi/linux/swab.h:117:32: note: in definition of macro '__swab32'
     (__builtin_constant_p((__u32)(x)) ? \
                                   ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   arch/m68k/include/asm/io_mm.h:452:26: note: in expansion of macro 'in_le32'
    #define readl(addr)      in_le32(addr)
                             ^~~~~~~
   drivers/net//ethernet/freescale/fec_main.c:959:9: note: in expansion of macro 'readl'
      val = readl(fep->hwp + FEC_RACC);
            ^~~~~
   drivers/net//ethernet/freescale/fec_main.c:959:26: note: each undeclared identifier is reported only once for each function it appears in
      val = readl(fep->hwp + FEC_RACC);
                             ^
   include/uapi/linux/swab.h:117:32: note: in definition of macro '__swab32'
     (__builtin_constant_p((__u32)(x)) ? \
                                   ^
   include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__le32_to_cpu'
    #define le32_to_cpu __le32_to_cpu
                        ^~~~~~~~~~~~~
   arch/m68k/include/asm/io_mm.h:452:26: note: in expansion of macro 'in_le32'
    #define readl(addr)      in_le32(addr)
                             ^~~~~~~
   drivers/net//ethernet/freescale/fec_main.c:959:9: note: in expansion of macro 'readl'
      val = readl(fep->hwp + FEC_RACC);
            ^~~~~
   In file included from arch/m68k/include/asm/io_mm.h:27:0,
                    from arch/m68k/include/asm/io.h:5,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:11,
                    from include/linux/skbuff.h:34,
                    from include/linux/if_ether.h:23,
                    from include/uapi/linux/ethtool.h:19,
                    from include/linux/ethtool.h:18,
                    from include/linux/netdevice.h:41,
                    from drivers/net//ethernet/freescale/fec_main.c:34:
   drivers/net//ethernet/freescale/fec_main.c:968:38: error: 'FEC_FTRL' undeclared (first use in this function); did you mean 'FEC_ECNTRL'?
      writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:968:3: note: in expansion of macro 'writel'
      writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1034:38: error: 'FEC_R_FIFO_RSEM' undeclared (first use in this function); did you mean 'FEC_FIFO_RAM'?
      writel(FEC_ENET_RSEM_V, fep->hwp + FEC_R_FIFO_RSEM);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1034:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RSEM_V, fep->hwp + FEC_R_FIFO_RSEM);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1035:38: error: 'FEC_R_FIFO_RSFL' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSEM'?
      writel(FEC_ENET_RSFL_V, fep->hwp + FEC_R_FIFO_RSFL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1035:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RSFL_V, fep->hwp + FEC_R_FIFO_RSFL);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1036:38: error: 'FEC_R_FIFO_RAEM' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSEM'?
      writel(FEC_ENET_RAEM_V, fep->hwp + FEC_R_FIFO_RAEM);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1036:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RAEM_V, fep->hwp + FEC_R_FIFO_RAEM);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1037:38: error: 'FEC_R_FIFO_RAFL' undeclared (first use in this function); did you mean 'FEC_R_FIFO_RSFL'?
      writel(FEC_ENET_RAFL_V, fep->hwp + FEC_R_FIFO_RAFL);
                                         ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1037:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_RAFL_V, fep->hwp + FEC_R_FIFO_RAFL);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1040:37: error: 'FEC_OPD' undeclared (first use in this function); did you mean 'FEC_H'?
      writel(FEC_ENET_OPD_V, fep->hwp + FEC_OPD);
                                        ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1040:3: note: in expansion of macro 'writel'
      writel(FEC_ENET_OPD_V, fep->hwp + FEC_OPD);
      ^~~~~~
   drivers/net//ethernet/freescale/fec_main.c:1051:23: error: 'FEC_HASH_TABLE_HIGH' undeclared (first use in this function); did you mean 'FEC_GRP_HASH_TABLE_HIGH'?
     writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
                          ^
   arch/m68k/include/asm/raw_io.h:48:64: note: in definition of macro 'out_le32'
    #define out_le32(addr,l) (void)((*(__force volatile __le32 *) (addr)) = cpu_to_le32(l))
                                                                   ^~~~
   drivers/net//ethernet/freescale/fec_main.c:1051:2: note: in expansion of macro 'writel'

vim +959 drivers/net//ethernet/freescale/fec_main.c

14109a59c drivers/net/ethernet/freescale/fec.c      Frank Li         2013-03-26   898  
dbc64a8ea drivers/net/ethernet/freescale/fec_main.c Russell King     2014-07-08   899  /*
dbc64a8ea drivers/net/ethernet/freescale/fec_main.c Russell King     2014-07-08   900   * This function is called to start or restart the FEC during a link
dbc64a8ea drivers/net/ethernet/freescale/fec_main.c Russell King     2014-07-08   901   * change, transmit timeout, or to reconfigure the FEC.  The network
dbc64a8ea drivers/net/ethernet/freescale/fec_main.c Russell King     2014-07-08   902   * packet processing for this device must be stopped before this call.
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   903   */
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   904  static void
ef83337d1 drivers/net/ethernet/freescale/fec_main.c Russell King     2014-07-08   905  fec_restart(struct net_device *ndev)
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   906  {
c556167f8 drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   907  	struct fec_enet_private *fep = netdev_priv(ndev);
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19   908  	u32 val;
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   909  	u32 temp_mac[2];
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   910  	u32 rcntl = OPT_FRAME_SIZE | 0x04;
230dec613 drivers/net/ethernet/freescale/fec.c      Shawn Guo        2011-09-23   911  	u32 ecntl = 0x2; /* ETHEREN */
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   912  
106c314c7 drivers/net/ethernet/freescale/fec_main.c Fugang Duan      2014-09-13   913  	/* Whack a reset.  We should wait for this.
106c314c7 drivers/net/ethernet/freescale/fec_main.c Fugang Duan      2014-09-13   914  	 * For i.MX6SX SOC, enet use AXI bus, we use disable MAC
106c314c7 drivers/net/ethernet/freescale/fec_main.c Fugang Duan      2014-09-13   915  	 * instead of reset MAC itself.
106c314c7 drivers/net/ethernet/freescale/fec_main.c Fugang Duan      2014-09-13   916  	 */
6b7e40083 drivers/net/ethernet/freescale/fec_main.c Lothar Waßmann   2014-11-17   917  	if (fep->quirks & FEC_QUIRK_HAS_AVB) {
106c314c7 drivers/net/ethernet/freescale/fec_main.c Fugang Duan      2014-09-13   918  		writel(0, fep->hwp + FEC_ECNTRL);
106c314c7 drivers/net/ethernet/freescale/fec_main.c Fugang Duan      2014-09-13   919  	} else {
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   920  		writel(1, fep->hwp + FEC_ECNTRL);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   921  		udelay(10);
106c314c7 drivers/net/ethernet/freescale/fec_main.c Fugang Duan      2014-09-13   922  	}
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   923  
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   924  	/*
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   925  	 * enet-mac reset will reset mac address registers too,
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   926  	 * so need to reconfigure it.
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   927  	 */
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   928  	memcpy(&temp_mac, ndev->dev_addr, ETH_ALEN);
5cfa30397 drivers/net/ethernet/freescale/fec_main.c Johannes Berg    2016-01-24   929  	writel((__force u32)cpu_to_be32(temp_mac[0]),
5cfa30397 drivers/net/ethernet/freescale/fec_main.c Johannes Berg    2016-01-24   930  	       fep->hwp + FEC_ADDR_LOW);
5cfa30397 drivers/net/ethernet/freescale/fec_main.c Johannes Berg    2016-01-24   931  	writel((__force u32)cpu_to_be32(temp_mac[1]),
5cfa30397 drivers/net/ethernet/freescale/fec_main.c Johannes Berg    2016-01-24   932  	       fep->hwp + FEC_ADDR_HIGH);
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   933  
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   934  	/* Clear any outstanding interrupt. */
e17f7fecd drivers/net/ethernet/freescale/fec_main.c Nimrod Andy      2014-12-11   935  	writel(0xffffffff, fep->hwp + FEC_IEVENT);
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   936  
14109a59c drivers/net/ethernet/freescale/fec.c      Frank Li         2013-03-26   937  	fec_enet_bd_init(ndev);
14109a59c drivers/net/ethernet/freescale/fec.c      Frank Li         2013-03-26   938  
59d0f7465 drivers/net/ethernet/freescale/fec_main.c Frank Li         2014-09-13   939  	fec_enet_enable_ring(ndev);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   940  
59d0f7465 drivers/net/ethernet/freescale/fec_main.c Frank Li         2014-09-13   941  	/* Reset tx SKB buffers. */
59d0f7465 drivers/net/ethernet/freescale/fec_main.c Frank Li         2014-09-13   942  	fec_enet_reset_skb(ndev);
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   943  
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   944  	/* Enable MII mode */
ef83337d1 drivers/net/ethernet/freescale/fec_main.c Russell King     2014-07-08   945  	if (fep->full_duplex == DUPLEX_FULL) {
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   946  		/* FD enable */
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   947  		writel(0x04, fep->hwp + FEC_X_CNTRL);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   948  	} else {
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   949  		/* No Rcv on Xmit */
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   950  		rcntl |= 0x02;
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   951  		writel(0x0, fep->hwp + FEC_X_CNTRL);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   952  	}
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   953  
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   954  	/* Set MII speed */
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   955  	writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   956  
d13919301 drivers/net/ethernet/freescale/fec_main.c Guenter Roeck    2013-06-18   957  #if !defined(CONFIG_M5272)
18803495a drivers/net/ethernet/freescale/fec_main.c Greg Ungerer     2015-06-20   958  	if (fep->quirks & FEC_QUIRK_HAS_RACC) {
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19  @959  		val = readl(fep->hwp + FEC_RACC);
3ac72b7b6 drivers/net/ethernet/freescale/fec_main.c Eric Nelson      2016-09-24   960  		/* align IP header */
3ac72b7b6 drivers/net/ethernet/freescale/fec_main.c Eric Nelson      2016-09-24   961  		val |= FEC_RACC_SHIFT16;
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19   962  		if (fep->csum_flags & FLAG_RX_CSUM_ENABLED)
3ac72b7b6 drivers/net/ethernet/freescale/fec_main.c Eric Nelson      2016-09-24   963  			/* set RX checksum */
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19   964  			val |= FEC_RACC_OPTIONS;
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19   965  		else
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19   966  			val &= ~FEC_RACC_OPTIONS;
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19   967  		writel(val, fep->hwp + FEC_RACC);
55cd48c82 drivers/net/ethernet/freescale/fec_main.c Troy Kisky       2016-02-05   968  		writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
32867fcc0 drivers/net/ethernet/freescale/fec_main.c Fabio Estevam    2016-03-31   969  	}
d13919301 drivers/net/ethernet/freescale/fec_main.c Guenter Roeck    2013-06-18   970  #endif
4c09eed9d drivers/net/ethernet/freescale/fec_main.c Jim Baxter       2013-04-19   971  
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   972  	/*
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   973  	 * The phy interface and speed need to get configured
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   974  	 * differently on enet-mac.
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16   975  	 */
6b7e40083 drivers/net/ethernet/freescale/fec_main.c Lothar Waßmann   2014-11-17   976  	if (fep->quirks & FEC_QUIRK_ENET_MAC) {
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   977  		/* Enable flow control and length check */
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   978  		rcntl |= 0x40000000 | 0x00000020;
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   979  
230dec613 drivers/net/ethernet/freescale/fec.c      Shawn Guo        2011-09-23   980  		/* RGMII, RMII or MII */
e813bb2b9 drivers/net/ethernet/freescale/fec_main.c Markus Pargmann  2015-04-30   981  		if (fep->phy_interface == PHY_INTERFACE_MODE_RGMII ||
e813bb2b9 drivers/net/ethernet/freescale/fec_main.c Markus Pargmann  2015-04-30   982  		    fep->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
e813bb2b9 drivers/net/ethernet/freescale/fec_main.c Markus Pargmann  2015-04-30   983  		    fep->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID ||
e813bb2b9 drivers/net/ethernet/freescale/fec_main.c Markus Pargmann  2015-04-30   984  		    fep->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID)
230dec613 drivers/net/ethernet/freescale/fec.c      Shawn Guo        2011-09-23   985  			rcntl |= (1 << 6);
230dec613 drivers/net/ethernet/freescale/fec.c      Shawn Guo        2011-09-23   986  		else if (fep->phy_interface == PHY_INTERFACE_MODE_RMII)
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   987  			rcntl |= (1 << 8);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   988  		else
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   989  			rcntl &= ~(1 << 8);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   990  
230dec613 drivers/net/ethernet/freescale/fec.c      Shawn Guo        2011-09-23   991  		/* 1G, 100M or 10M */
45f5c327c drivers/net/ethernet/freescale/fec_main.c Philippe Reynes  2016-05-10   992  		if (ndev->phydev) {
45f5c327c drivers/net/ethernet/freescale/fec_main.c Philippe Reynes  2016-05-10   993  			if (ndev->phydev->speed == SPEED_1000)
230dec613 drivers/net/ethernet/freescale/fec.c      Shawn Guo        2011-09-23   994  				ecntl |= (1 << 5);
45f5c327c drivers/net/ethernet/freescale/fec_main.c Philippe Reynes  2016-05-10   995  			else if (ndev->phydev->speed == SPEED_100)
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   996  				rcntl &= ~(1 << 9);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19   997  			else
cd1f402c1 drivers/net/fec.c                         Uwe Kleine-König 2011-01-25   998  				rcntl |= (1 << 9);
230dec613 drivers/net/ethernet/freescale/fec.c      Shawn Guo        2011-09-23   999  		}
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1000  	} else {
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1001  #ifdef FEC_MIIGSK_ENR
6b7e40083 drivers/net/ethernet/freescale/fec_main.c Lothar Waßmann   2014-11-17  1002  		if (fep->quirks & FEC_QUIRK_USE_GASKET) {
8d82f219c drivers/net/ethernet/freescale/fec.c      Eric Benard      2012-01-12  1003  			u32 cfgr;
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1004  			/* disable the gasket and wait */
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1005  			writel(0, fep->hwp + FEC_MIIGSK_ENR);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1006  			while (readl(fep->hwp + FEC_MIIGSK_ENR) & 4)
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1007  				udelay(1);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1008  
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1009  			/*
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1010  			 * configure the gasket:
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1011  			 *   RMII, 50 MHz, no loopback, no echo
0ca1e290b drivers/net/fec.c                         Shawn Guo        2011-07-01  1012  			 *   MII, 25 MHz, no loopback, no echo
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1013  			 */
8d82f219c drivers/net/ethernet/freescale/fec.c      Eric Benard      2012-01-12  1014  			cfgr = (fep->phy_interface == PHY_INTERFACE_MODE_RMII)
8d82f219c drivers/net/ethernet/freescale/fec.c      Eric Benard      2012-01-12  1015  				? BM_MIIGSK_CFGR_RMII : BM_MIIGSK_CFGR_MII;
45f5c327c drivers/net/ethernet/freescale/fec_main.c Philippe Reynes  2016-05-10  1016  			if (ndev->phydev && ndev->phydev->speed == SPEED_10)
8d82f219c drivers/net/ethernet/freescale/fec.c      Eric Benard      2012-01-12  1017  				cfgr |= BM_MIIGSK_CFGR_FRCONT_10M;
8d82f219c drivers/net/ethernet/freescale/fec.c      Eric Benard      2012-01-12  1018  			writel(cfgr, fep->hwp + FEC_MIIGSK_CFGR);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1019  
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1020  			/* re-enable the gasket */
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1021  			writel(2, fep->hwp + FEC_MIIGSK_ENR);
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1022  		}
45993653b drivers/net/fec.c                         Uwe Kleine-König 2011-01-19  1023  #endif
^1da177e4 drivers/net/fec.c                         Linus Torvalds   2005-04-16  1024  	}
baa70a5c4 drivers/net/ethernet/freescale/fec.c      Frank Li         2013-01-16  1025  

:::::: The code at line 959 was first introduced by commit
:::::: 4c09eed9dc422e980fabdb25434ef68e599b704c net: fec: Enable imx6 enet checksum acceleration.

:::::: TO: Jim Baxter <jim_baxter@mentor.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: 45215 bytes --]

^ permalink raw reply

* Re: Grant
From: Maratovich.M. Fridman @ 2018-05-15  2:19 UTC (permalink / raw)





I Mikhail Fridman. has selected you specially as one of my beneficiaries
for my Charitable Donation, Just as I have declared on May 23, 2016 to give
my fortune as charity.

Check the link below for confirmation:

http://www.ibtimes.co.uk/russias-second-wealthiest-man-mikhail-fridman-plans-leaving-14-2bn-fortune-charity-1561604

Reply as soon as possible with further directives.

Best Regards,
Mikhail Fridman.

^ permalink raw reply

* Re: [PATCH net-next 1/3] net: ethernet: ti: Allow most drivers with COMPILE_TEST
From: kbuild test robot @ 2018-05-17  4:25 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: kbuild-all, netdev, Florian Fainelli, David S. Miller,
	Andrew Lunn, open list
In-Reply-To: <20180515234825.11240-2-f.fainelli@gmail.com>

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

Hi Florian,

I love your patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Florian-Fainelli/net-Allow-more-drivers-with-COMPILE_TEST/20180517-092807
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.2.0
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=xtensa 

All warnings (new ones prefixed by >>):

   drivers/net//ethernet/ti/davinci_cpdma.c: In function 'cpdma_chan_submit':
>> drivers/net//ethernet/ti/davinci_cpdma.c:1083:17: warning: passing argument 1 of 'writel_relaxed' makes integer from pointer without a cast [-Wint-conversion]
     writel_relaxed(token, &desc->sw_token);
                    ^~~~~
   In file included from arch/xtensa/include/asm/io.h:83:0,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:11,
                    from drivers/net//ethernet/ti/davinci_cpdma.c:21:
   include/asm-generic/io.h:303:24: note: expected 'u32 {aka unsigned int}' but argument is of type 'void *'
    #define writel_relaxed writel_relaxed
                           ^
>> include/asm-generic/io.h:304:20: note: in expansion of macro 'writel_relaxed'
    static inline void writel_relaxed(u32 value, volatile void __iomem *addr)
                       ^~~~~~~~~~~~~~
--
   drivers/net/ethernet/ti/davinci_cpdma.c: In function 'cpdma_chan_submit':
   drivers/net/ethernet/ti/davinci_cpdma.c:1083:17: warning: passing argument 1 of 'writel_relaxed' makes integer from pointer without a cast [-Wint-conversion]
     writel_relaxed(token, &desc->sw_token);
                    ^~~~~
   In file included from arch/xtensa/include/asm/io.h:83:0,
                    from include/linux/scatterlist.h:9,
                    from include/linux/dma-mapping.h:11,
                    from drivers/net/ethernet/ti/davinci_cpdma.c:21:
   include/asm-generic/io.h:303:24: note: expected 'u32 {aka unsigned int}' but argument is of type 'void *'
    #define writel_relaxed writel_relaxed
                           ^
>> include/asm-generic/io.h:304:20: note: in expansion of macro 'writel_relaxed'
    static inline void writel_relaxed(u32 value, volatile void __iomem *addr)
                       ^~~~~~~~~~~~~~

vim +/writel_relaxed +1083 drivers/net//ethernet/ti/davinci_cpdma.c

ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1029  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1030  int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
aef614e1 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-04-23  1031  		      int len, int directed)
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1032  {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1033  	struct cpdma_ctlr		*ctlr = chan->ctlr;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1034  	struct cpdma_desc __iomem	*desc;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1035  	dma_addr_t			buffer;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1036  	unsigned long			flags;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1037  	u32				mode;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1038  	int				ret = 0;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1039  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1040  	spin_lock_irqsave(&chan->lock, flags);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1041  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1042  	if (chan->state == CPDMA_STATE_TEARDOWN) {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1043  		ret = -EINVAL;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1044  		goto unlock_ret;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1045  	}
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1046  
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1047  	if (chan->count >= chan->desc_num)	{
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1048  		chan->stats.desc_alloc_fail++;
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1049  		ret = -ENOMEM;
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1050  		goto unlock_ret;
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1051  	}
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1052  
742fb20f drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2016-06-27  1053  	desc = cpdma_desc_alloc(ctlr->pool);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1054  	if (!desc) {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1055  		chan->stats.desc_alloc_fail++;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1056  		ret = -ENOMEM;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1057  		goto unlock_ret;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1058  	}
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1059  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1060  	if (len < ctlr->params.min_packet_size) {
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1061  		len = ctlr->params.min_packet_size;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1062  		chan->stats.runt_transmit_buff++;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1063  	}
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1064  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1065  	buffer = dma_map_single(ctlr->dev, data, len, chan->dir);
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1066  	ret = dma_mapping_error(ctlr->dev, buffer);
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1067  	if (ret) {
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1068  		cpdma_desc_free(ctlr->pool, desc, 1);
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1069  		ret = -EINVAL;
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1070  		goto unlock_ret;
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1071  	}
14bd0769 drivers/net/ethernet/ti/davinci_cpdma.c Sebastian Siewior 2013-06-20  1072  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1073  	mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP;
f6e135c8 drivers/net/ethernet/ti/davinci_cpdma.c Mugunthan V N     2013-02-11  1074  	cpdma_desc_to_port(chan, mode, directed);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1075  
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1076  	/* Relaxed IO accessors can be used here as there is read barrier
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1077  	 * at the end of write sequence.
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1078  	 */
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1079  	writel_relaxed(0, &desc->hw_next);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1080  	writel_relaxed(buffer, &desc->hw_buffer);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1081  	writel_relaxed(len, &desc->hw_len);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1082  	writel_relaxed(mode | len, &desc->hw_mode);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06 @1083  	writel_relaxed(token, &desc->sw_token);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1084  	writel_relaxed(buffer, &desc->sw_buffer);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1085  	writel_relaxed(len, &desc->sw_len);
a6c83ccf drivers/net/ethernet/ti/davinci_cpdma.c Grygorii Strashko 2017-01-06  1086  	desc_read(desc, sw_len);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1087  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1088  	__cpdma_chan_submit(chan, desc);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1089  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1090  	if (chan->state == CPDMA_STATE_ACTIVE && chan->rxfree)
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1091  		chan_write(chan, rxfree, 1);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1092  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1093  	chan->count++;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1094  
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1095  unlock_ret:
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1096  	spin_unlock_irqrestore(&chan->lock, flags);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1097  	return ret;
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1098  }
32a6d90b drivers/net/ethernet/ti/davinci_cpdma.c Arnd Bergmann     2012-04-20  1099  EXPORT_SYMBOL_GPL(cpdma_chan_submit);
ef8c2dab drivers/net/davinci_cpdma.c             Cyril Chemparathy 2010-09-15  1100  

:::::: The code at line 1083 was first introduced by commit
:::::: a6c83ccf3c534214e0aeb167a70391864da9b1fc net: ethernet: ti: cpdma: am437x: allow descs to be plased in ddr

:::::: TO: Grygorii Strashko <grygorii.strashko@ti.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: 53063 bytes --]

^ permalink raw reply

* Re: [PATCH 11/40] ipv6/flowlabel: simplify pid namespace lookup
From: Eric W. Biederman @ 2018-05-17  5:28 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, devel,
	linux-kernel, linux-scsi, linux-ide, Greg Kroah-Hartman,
	jfs-discussion, linux-afs, linux-acpi, netdev, netfilter-devel,
	Alexander Viro, Jiri Slaby, Andrew Morton, linux-ext4,
	Alexey Dobriyan, megaraidlinux.pdl, drbd-dev
In-Reply-To: <20180515145643.GA661@lst.de>

Christoph Hellwig <hch@lst.de> writes:

> On Sat, May 05, 2018 at 07:37:33AM -0500, Eric W. Biederman wrote:
>> Christoph Hellwig <hch@lst.de> writes:
>> 
>> > The shole seq_file sequence already operates under a single RCU lock pair,
>> > so move the pid namespace lookup into it, and stop grabbing a reference
>> > and remove all kinds of boilerplate code.
>> 
>> This is wrong.
>> 
>> Move task_active_pid_ns(current) from open to seq_start actually means
>> that the results if you pass this proc file between callers the results
>> will change.  So this breaks file descriptor passing.
>> 
>> Open is a bad place to access current.  In the middle of read/write is
>> broken.
>> 
>> 
>> In this particular instance looking up the pid namespace with
>> task_active_pid_ns was a personal brain fart.  What the code should be
>> doing (with an appropriate helper) is:
>> 
>> struct pid_namespace *pid_ns = inode->i_sb->s_fs_info;
>> 
>> Because each mount of proc is bound to a pid namespace.  Looking up the
>> pid namespace from the super_block is a much better way to go.
>
> What do you have in mind for the helper?  For now I've thrown it in
> opencoded into my working tree, but I'd be glad to add a helper.
>
> struct pid_namespace *proc_pid_namespace(struct inode *inode)
> {
> 	// maybe warn on for s_magic not on procfs??
> 	return inode->i_sb->s_fs_info;
> }

That should work.  Ideally out of line for the proc_fs.h version.
Basically it should be a cousin of PDE_DATA.

Eric

^ permalink raw reply

* Re: [RFC PATCH bpf-next 05/12] xdp: add MEM_TYPE_ZERO_COPY
From: Jesper Dangaard Brouer @ 2018-05-17  5:57 UTC (permalink / raw)
  To: Björn Töpel
  Cc: magnus.karlsson, magnus.karlsson, alexander.h.duyck,
	alexander.duyck, john.fastabend, ast, willemdebruijn.kernel,
	daniel, mst, netdev, Björn Töpel, michael.lundkvist,
	jesse.brandeburg, anjali.singhai, qi.z.zhang, intel-wired-lan,
	brouer
In-Reply-To: <20180515190615.23099-6-bjorn.topel@gmail.com>

On Tue, 15 May 2018 21:06:08 +0200
Björn Töpel <bjorn.topel@gmail.com> wrote:

> @@ -82,6 +88,10 @@ struct xdp_frame *convert_to_xdp_frame(struct xdp_buff *xdp)
>  	int metasize;
>  	int headroom;
>  
> +	// XXX implement clone, copy, use "native" MEM_TYPE
> +	if (xdp->rxq->mem.type == MEM_TYPE_ZERO_COPY)
> +		return NULL;
> +

There is going to be significant tradeoffs between AF_XDP zero-copy and
copy-variant.  The copy-variant, still have very attractive
RX-performance, and other benefits like no exposing unrelated packets
to userspace (but limit these to the XDP filter).

Thus, as a user I would like to choose between AF_XDP zero-copy and
copy-variant. Even if my NIC support zero-copy, I can be interested in
only enabling the copy-variant. This patchset doesn't let me choose.

How do we expose this to userspace?
(Maybe as simple as an sockaddr_xdp->sxdp_flags flag?)

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

^ permalink raw reply

* [PATCH bpf 0/6] bpf: enhancements for multi-function programs
From: Sandipan Das @ 2018-05-17  6:35 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, linuxppc-dev, naveen.n.rao

This patch series introduces the following:

[1] Support for bpf-to-bpf function calls in the powerpc64 JIT compiler.

[2] Provide a way for resolving function calls because of the way JITed
    images are allocated in powerpc64.

[3] Fix to get JITed instruction dumps for multi-function programs from
    the bpf system call.

Sandipan Das (6):
  bpf: support 64-bit offsets for bpf function calls
  bpf: powerpc64: add JIT support for multi-function programs
  bpf: get kernel symbol addresses via syscall
  tools: bpf: sync bpf uapi header
  tools: bpftool: resolve calls without using imm field
  bpf: fix JITed dump for multi-function programs via syscall

 arch/powerpc/net/bpf_jit_comp64.c | 79 ++++++++++++++++++++++++++++++++++-----
 include/uapi/linux/bpf.h          |  2 +
 kernel/bpf/syscall.c              | 56 ++++++++++++++++++++++++---
 kernel/bpf/verifier.c             | 22 +++++++----
 tools/bpf/bpftool/prog.c          | 31 +++++++++++++++
 tools/bpf/bpftool/xlated_dumper.c | 24 ++++++++----
 tools/bpf/bpftool/xlated_dumper.h |  2 +
 tools/include/uapi/linux/bpf.h    |  2 +
 8 files changed, 189 insertions(+), 29 deletions(-)

-- 
2.14.3

^ permalink raw reply

* [PATCH bpf 1/6] bpf: support 64-bit offsets for bpf function calls
From: Sandipan Das @ 2018-05-17  6:35 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, linuxppc-dev, naveen.n.rao
In-Reply-To: <20180517063548.6373-1-sandipan@linux.vnet.ibm.com>

The imm field of a bpf instruction is a signed 32-bit integer.
For JIT bpf-to-bpf function calls, it stores the offset of the
start address of the callee's JITed image from __bpf_call_base.

For some architectures, such as powerpc64, this offset may be
as large as 64 bits and cannot be accomodated in the imm field
without truncation.

We resolve this by:

[1] Additionally using the auxillary data of each function to
    keep a list of start addresses of the JITed images for all
    functions determined by the verifier.

[2] Retaining the subprog id inside the off field of the call
    instructions and using it to index into the list mentioned
    above and lookup the callee's address.

To make sure that the existing JIT compilers continue to work
without requiring changes, we keep the imm field as it is.

Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
---
 kernel/bpf/verifier.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index d5e1a6c4165d..aa76879f4fd1 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5373,11 +5373,24 @@ static int jit_subprogs(struct bpf_verifier_env *env)
 			    insn->src_reg != BPF_PSEUDO_CALL)
 				continue;
 			subprog = insn->off;
-			insn->off = 0;
 			insn->imm = (u64 (*)(u64, u64, u64, u64, u64))
 				func[subprog]->bpf_func -
 				__bpf_call_base;
 		}
+
+		/* we use the aux data to keep a list of the start addresses
+		 * of the JITed images for each function in the program
+		 *
+		 * for some architectures, such as powerpc64, the imm field
+		 * might not be large enough to hold the offset of the start
+		 * address of the callee's JITed image from __bpf_call_base
+		 *
+		 * in such cases, we can lookup the start address of a callee
+		 * by using its subprog id, available from the off field of
+		 * the call instruction, as an index for this list
+		 */
+		func[i]->aux->func = func;
+		func[i]->aux->func_cnt = env->subprog_cnt + 1;
 	}
 	for (i = 0; i < env->subprog_cnt; i++) {
 		old_bpf_func = func[i]->bpf_func;
-- 
2.14.3

^ permalink raw reply related

* [PATCH bpf 3/6] bpf: get kernel symbol addresses via syscall
From: Sandipan Das @ 2018-05-17  6:35 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, linuxppc-dev, naveen.n.rao
In-Reply-To: <20180517063548.6373-1-sandipan@linux.vnet.ibm.com>

This adds new two new fields to struct bpf_prog_info. For
multi-function programs, these fields can be used to pass
a list of kernel symbol addresses for all functions in a
given program and to userspace using the bpf system call
with the BPF_OBJ_GET_INFO_BY_FD command.

When bpf_jit_kallsyms is enabled, we can get the address
of the corresponding kernel symbol for a callee function
and resolve the symbol's name. The address is determined
by adding the value of the call instruction's imm field
to __bpf_call_base. This offset gets assigned to the imm
field by the verifier.

For some architectures, such as powerpc64, the imm field
is not large enough to hold this offset.

We resolve this by:

[1] Assigning the subprog id to the imm field of a call
    instruction in the verifier instead of the offset of
    the callee's symbol's address from __bpf_call_base.

[2] Determining the address of a callee's corresponding
    symbol by using the imm field as an index for the
    list of kernel symbol addresses now available from
    the program info.

Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
---
 include/uapi/linux/bpf.h |  2 ++
 kernel/bpf/syscall.c     | 20 ++++++++++++++++++++
 kernel/bpf/verifier.c    |  7 +------
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 93d5a4eeec2a..061482d3be11 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -2108,6 +2108,8 @@ struct bpf_prog_info {
 	__u32 xlated_prog_len;
 	__aligned_u64 jited_prog_insns;
 	__aligned_u64 xlated_prog_insns;
+	__aligned_u64 jited_ksyms;
+	__u32 nr_jited_ksyms;
 	__u64 load_time;	/* ns since boottime */
 	__u32 created_by_uid;
 	__u32 nr_map_ids;
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index c286e75ec087..03c8437a2990 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1933,6 +1933,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
 	if (!capable(CAP_SYS_ADMIN)) {
 		info.jited_prog_len = 0;
 		info.xlated_prog_len = 0;
+		info.nr_jited_ksyms = 0;
 		goto done;
 	}
 
@@ -1981,6 +1982,25 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
 		}
 	}
 
+	ulen = info.nr_jited_ksyms;
+	info.nr_jited_ksyms = prog->aux->func_cnt;
+	if (info.nr_jited_ksyms && ulen) {
+		u64 __user *user_jited_ksyms = u64_to_user_ptr(info.jited_ksyms);
+		ulong ksym_addr;
+		u32 i;
+
+		/* copy the address of the kernel symbol corresponding to
+		 * each function
+		 */
+		ulen = min_t(u32, info.nr_jited_ksyms, ulen);
+		for (i = 0; i < ulen; i++) {
+			ksym_addr = (ulong) prog->aux->func[i]->bpf_func;
+			ksym_addr &= PAGE_MASK;
+			if (put_user((u64) ksym_addr, &user_jited_ksyms[i]))
+				return -EFAULT;
+		}
+	}
+
 done:
 	if (copy_to_user(uinfo, &info, info_len) ||
 	    put_user(info_len, &uattr->info.info_len))
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index aa76879f4fd1..fc864eb3e29d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5416,17 +5416,12 @@ static int jit_subprogs(struct bpf_verifier_env *env)
 	 * later look the same as if they were interpreted only.
 	 */
 	for (i = 0, insn = prog->insnsi; i < prog->len; i++, insn++) {
-		unsigned long addr;
-
 		if (insn->code != (BPF_JMP | BPF_CALL) ||
 		    insn->src_reg != BPF_PSEUDO_CALL)
 			continue;
 		insn->off = env->insn_aux_data[i].call_imm;
 		subprog = find_subprog(env, i + insn->off + 1);
-		addr  = (unsigned long)func[subprog]->bpf_func;
-		addr &= PAGE_MASK;
-		insn->imm = (u64 (*)(u64, u64, u64, u64, u64))
-			    addr - __bpf_call_base;
+		insn->imm = subprog;
 	}
 
 	prog->jited = 1;
-- 
2.14.3

^ permalink raw reply related

* [PATCH bpf 4/6] tools: bpf: sync bpf uapi header
From: Sandipan Das @ 2018-05-17  6:35 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, linuxppc-dev, naveen.n.rao
In-Reply-To: <20180517063548.6373-1-sandipan@linux.vnet.ibm.com>

Syncing the bpf.h uapi header with tools so that struct
bpf_prog_info has the two new fields for passing on the
addresses of the kernel symbols corresponding to each
function in a JITed program.

Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
---
 tools/include/uapi/linux/bpf.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 83a95ae388dd..c14a74eea910 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -2107,6 +2107,8 @@ struct bpf_prog_info {
 	__u32 xlated_prog_len;
 	__aligned_u64 jited_prog_insns;
 	__aligned_u64 xlated_prog_insns;
+	__aligned_u64 jited_ksyms;
+	__u32 nr_jited_ksyms;
 	__u64 load_time;	/* ns since boottime */
 	__u32 created_by_uid;
 	__u32 nr_map_ids;
-- 
2.14.3

^ permalink raw reply related

* [PATCH bpf 5/6] tools: bpftool: resolve calls without using imm field
From: Sandipan Das @ 2018-05-17  6:35 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, linuxppc-dev, naveen.n.rao
In-Reply-To: <20180517063548.6373-1-sandipan@linux.vnet.ibm.com>

Currently, we resolve the callee's address for a JITed function
call by using the imm field of the call instruction as an offset
from __bpf_call_base. If bpf_jit_kallsyms is enabled, we further
use this address to get the callee's kernel symbol's name.

For some architectures, such as powerpc64, the imm field is not
large enough to hold this offset. So, instead of assigning this
offset to the imm field, the verifier now assigns the subprog
id. Also, a list of kernel symbol addresses for all the JITed
functions is provided in the program info. We now use the imm
field as an index for this list to lookup a callee's symbol's
address and resolve its name.

Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
---
 tools/bpf/bpftool/prog.c          | 31 +++++++++++++++++++++++++++++++
 tools/bpf/bpftool/xlated_dumper.c | 24 +++++++++++++++++-------
 tools/bpf/bpftool/xlated_dumper.h |  2 ++
 3 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 9bdfdf2d3fbe..ac2f62a97e84 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -430,6 +430,10 @@ static int do_dump(int argc, char **argv)
 	unsigned char *buf;
 	__u32 *member_len;
 	__u64 *member_ptr;
+	unsigned int nr_addrs;
+	unsigned long *addrs = NULL;
+	__u32 *ksyms_len;
+	__u64 *ksyms_ptr;
 	ssize_t n;
 	int err;
 	int fd;
@@ -437,6 +441,8 @@ static int do_dump(int argc, char **argv)
 	if (is_prefix(*argv, "jited")) {
 		member_len = &info.jited_prog_len;
 		member_ptr = &info.jited_prog_insns;
+		ksyms_len = &info.nr_jited_ksyms;
+		ksyms_ptr = &info.jited_ksyms;
 	} else if (is_prefix(*argv, "xlated")) {
 		member_len = &info.xlated_prog_len;
 		member_ptr = &info.xlated_prog_insns;
@@ -496,10 +502,23 @@ static int do_dump(int argc, char **argv)
 		return -1;
 	}
 
+	nr_addrs = *ksyms_len;
+	if (nr_addrs) {
+		addrs = malloc(nr_addrs * sizeof(__u64));
+		if (!addrs) {
+			p_err("mem alloc failed");
+			free(buf);
+			close(fd);
+			return -1;
+		}
+	}
+
 	memset(&info, 0, sizeof(info));
 
 	*member_ptr = ptr_to_u64(buf);
 	*member_len = buf_size;
+	*ksyms_ptr = ptr_to_u64(addrs);
+	*ksyms_len = nr_addrs;
 
 	err = bpf_obj_get_info_by_fd(fd, &info, &len);
 	close(fd);
@@ -513,6 +532,11 @@ static int do_dump(int argc, char **argv)
 		goto err_free;
 	}
 
+	if (*ksyms_len > nr_addrs) {
+		p_err("too many addresses returned");
+		goto err_free;
+	}
+
 	if ((member_len == &info.jited_prog_len &&
 	     info.jited_prog_insns == 0) ||
 	    (member_len == &info.xlated_prog_len &&
@@ -558,6 +582,9 @@ static int do_dump(int argc, char **argv)
 			dump_xlated_cfg(buf, *member_len);
 	} else {
 		kernel_syms_load(&dd);
+		dd.jited_ksyms = ksyms_ptr;
+		dd.nr_jited_ksyms = *ksyms_len;
+
 		if (json_output)
 			dump_xlated_json(&dd, buf, *member_len, opcodes);
 		else
@@ -566,10 +593,14 @@ static int do_dump(int argc, char **argv)
 	}
 
 	free(buf);
+	if (addrs)
+		free(addrs);
 	return 0;
 
 err_free:
 	free(buf);
+	if (addrs)
+		free(addrs);
 	return -1;
 }
 
diff --git a/tools/bpf/bpftool/xlated_dumper.c b/tools/bpf/bpftool/xlated_dumper.c
index 7a3173b76c16..dc8e4eca0387 100644
--- a/tools/bpf/bpftool/xlated_dumper.c
+++ b/tools/bpf/bpftool/xlated_dumper.c
@@ -178,8 +178,12 @@ static const char *print_call_pcrel(struct dump_data *dd,
 		snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
 			 "%+d#%s", insn->off, sym->name);
 	else
-		snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
-			 "%+d#0x%lx", insn->off, address);
+		if (address)
+			snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
+				 "%+d#0x%lx", insn->off, address);
+		else
+			snprintf(dd->scratch_buff, sizeof(dd->scratch_buff),
+				 "%+d", insn->off);
 	return dd->scratch_buff;
 }
 
@@ -200,14 +204,20 @@ static const char *print_call(void *private_data,
 			      const struct bpf_insn *insn)
 {
 	struct dump_data *dd = private_data;
-	unsigned long address = dd->address_call_base + insn->imm;
-	struct kernel_sym *sym;
+	unsigned long address = 0;
+	struct kernel_sym *sym = NULL;
 
-	sym = kernel_syms_search(dd, address);
-	if (insn->src_reg == BPF_PSEUDO_CALL)
+	if (insn->src_reg == BPF_PSEUDO_CALL) {
+		if (dd->nr_jited_ksyms) {
+			address = dd->jited_ksyms[insn->imm];
+			sym = kernel_syms_search(dd, address);
+		}
 		return print_call_pcrel(dd, sym, address, insn);
-	else
+	} else {
+		address = dd->address_call_base + insn->imm;
+		sym = kernel_syms_search(dd, address);
 		return print_call_helper(dd, sym, address);
+	}
 }
 
 static const char *print_imm(void *private_data,
diff --git a/tools/bpf/bpftool/xlated_dumper.h b/tools/bpf/bpftool/xlated_dumper.h
index b34affa7ef2d..eafbb49c8d0b 100644
--- a/tools/bpf/bpftool/xlated_dumper.h
+++ b/tools/bpf/bpftool/xlated_dumper.h
@@ -49,6 +49,8 @@ struct dump_data {
 	unsigned long address_call_base;
 	struct kernel_sym *sym_mapping;
 	__u32 sym_count;
+	__u64 *jited_ksyms;
+	__u32 nr_jited_ksyms;
 	char scratch_buff[SYM_MAX_NAME + 8];
 };
 
-- 
2.14.3

^ permalink raw reply related

* [PATCH bpf 6/6] bpf: fix JITed dump for multi-function programs via syscall
From: Sandipan Das @ 2018-05-17  6:35 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, linuxppc-dev, naveen.n.rao
In-Reply-To: <20180517063548.6373-1-sandipan@linux.vnet.ibm.com>

Currently, for multi-function programs, we cannot get the JITed
instructions using the bpf system call's BPF_OBJ_GET_INFO_BY_FD
command. Because of this, userspace tools such as bpftool fail
to identify a multi-function program as being JITed or not.

With the JIT enabled and the test program running, this can be
verified as follows:

  # cat /proc/sys/net/core/bpf_jit_enable
  1

Before applying this patch:

  # bpftool prog list
  1: kprobe  name foo  tag b811aab41a39ad3d  gpl
          loaded_at 2018-05-16T11:43:38+0530  uid 0
          xlated 216B  not jited  memlock 65536B
  ...

  # bpftool prog dump jited id 1
  no instructions returned

After applying this patch:

  # bpftool prog list
  1: kprobe  name foo  tag b811aab41a39ad3d  gpl
          loaded_at 2018-05-16T12:13:01+0530  uid 0
          xlated 216B  jited 308B  memlock 65536B
  ...

  # bpftool prog dump jited id 1
     0:   nop
     4:   nop
     8:   mflr    r0
     c:   std     r0,16(r1)
    10:   stdu    r1,-112(r1)
    14:   std     r31,104(r1)
    18:   addi    r31,r1,48
    1c:   li      r3,10
  ...

Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
---
 kernel/bpf/syscall.c | 38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 03c8437a2990..b2f70718aca7 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1896,7 +1896,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
 	struct bpf_prog_info info = {};
 	u32 info_len = attr->info.info_len;
 	char __user *uinsns;
-	u32 ulen;
+	u32 ulen, i;
 	int err;
 
 	err = check_uarg_tail_zero(uinfo, sizeof(info), info_len);
@@ -1922,7 +1922,6 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
 	ulen = min_t(u32, info.nr_map_ids, ulen);
 	if (ulen) {
 		u32 __user *user_map_ids = u64_to_user_ptr(info.map_ids);
-		u32 i;
 
 		for (i = 0; i < ulen; i++)
 			if (put_user(prog->aux->used_maps[i]->id,
@@ -1970,13 +1969,41 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
 	 * for offload.
 	 */
 	ulen = info.jited_prog_len;
-	info.jited_prog_len = prog->jited_len;
+	if (prog->aux->func_cnt) {
+		info.jited_prog_len = 0;
+		for (i = 0; i < prog->aux->func_cnt; i++)
+			info.jited_prog_len += prog->aux->func[i]->jited_len;
+	} else {
+		info.jited_prog_len = prog->jited_len;
+	}
+
 	if (info.jited_prog_len && ulen) {
 		if (bpf_dump_raw_ok()) {
 			uinsns = u64_to_user_ptr(info.jited_prog_insns);
 			ulen = min_t(u32, info.jited_prog_len, ulen);
-			if (copy_to_user(uinsns, prog->bpf_func, ulen))
-				return -EFAULT;
+
+			/* for multi-function programs, copy the JITed
+			 * instructions for all the functions
+			 */
+			if (prog->aux->func_cnt) {
+				u32 len, free;
+				u8 *img;
+
+				free = ulen;
+				for (i = 0; i < prog->aux->func_cnt; i++) {
+					len = prog->aux->func[i]->jited_len;
+					img = (u8 *) prog->aux->func[i]->bpf_func;
+					if (len > free)
+						break;
+					if (copy_to_user(uinsns, img, len))
+						return -EFAULT;
+					uinsns += len;
+					free -= len;
+				}
+			} else {
+				if (copy_to_user(uinsns, prog->bpf_func, ulen))
+					return -EFAULT;
+			}
 		} else {
 			info.jited_prog_insns = 0;
 		}
@@ -1987,7 +2014,6 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
 	if (info.nr_jited_ksyms && ulen) {
 		u64 __user *user_jited_ksyms = u64_to_user_ptr(info.jited_ksyms);
 		ulong ksym_addr;
-		u32 i;
 
 		/* copy the address of the kernel symbol corresponding to
 		 * each function
-- 
2.14.3

^ permalink raw reply related

* [PATCH bpf 2/6] bpf: powerpc64: add JIT support for multi-function programs
From: Sandipan Das @ 2018-05-17  6:35 UTC (permalink / raw)
  To: ast, daniel; +Cc: netdev, linuxppc-dev, naveen.n.rao
In-Reply-To: <20180517063548.6373-1-sandipan@linux.vnet.ibm.com>

This adds support for bpf-to-bpf function calls in the powerpc64
JIT compiler. The JIT compiler converts the bpf call instructions
to native branch instructions. After a round of the usual passes,
the start addresses of the JITed images for the callee functions
are known. Finally, to fixup the branch target addresses, we need
to perform an extra pass.

Because of the address range in which JITed images are allocated
on powerpc64, the offsets of the start addresses of these images
from __bpf_call_base are as large as 64 bits. So, for a function
call, we cannot use the imm field of the instruction to determine
the callee's address. Instead, we use the alternative method of
getting it from the list of function addresses in the auxillary
data of the caller by using the off field as an index.

Signed-off-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
---
 arch/powerpc/net/bpf_jit_comp64.c | 79 ++++++++++++++++++++++++++++++++++-----
 1 file changed, 69 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
index 1bdb1aff0619..25939892d8f7 100644
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -256,7 +256,7 @@ static void bpf_jit_emit_tail_call(u32 *image, struct codegen_context *ctx, u32
 /* Assemble the body code between the prologue & epilogue */
 static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
 			      struct codegen_context *ctx,
-			      u32 *addrs)
+			      u32 *addrs, bool extra_pass)
 {
 	const struct bpf_insn *insn = fp->insnsi;
 	int flen = fp->len;
@@ -712,11 +712,23 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
 			break;
 
 		/*
-		 * Call kernel helper
+		 * Call kernel helper or bpf function
 		 */
 		case BPF_JMP | BPF_CALL:
 			ctx->seen |= SEEN_FUNC;
-			func = (u8 *) __bpf_call_base + imm;
+
+			/* bpf function call */
+			if (insn[i].src_reg == BPF_PSEUDO_CALL && extra_pass)
+				if (fp->aux->func && off < fp->aux->func_cnt)
+					/* use the subprog id from the off
+					 * field to lookup the callee address
+					 */
+					func = (u8 *) fp->aux->func[off]->bpf_func;
+				else
+					return -EINVAL;
+			/* kernel helper call */
+			else
+				func = (u8 *) __bpf_call_base + imm;
 
 			bpf_jit_emit_func_call(image, ctx, (u64)func);
 
@@ -864,6 +876,14 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
 	return 0;
 }
 
+struct powerpc64_jit_data {
+	struct bpf_binary_header *header;
+	u32 *addrs;
+	u8 *image;
+	u32 proglen;
+	struct codegen_context ctx;
+};
+
 struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 {
 	u32 proglen;
@@ -871,6 +891,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 	u8 *image = NULL;
 	u32 *code_base;
 	u32 *addrs;
+	struct powerpc64_jit_data *jit_data;
 	struct codegen_context cgctx;
 	int pass;
 	int flen;
@@ -878,6 +899,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 	struct bpf_prog *org_fp = fp;
 	struct bpf_prog *tmp_fp;
 	bool bpf_blinded = false;
+	bool extra_pass = false;
 
 	if (!fp->jit_requested)
 		return org_fp;
@@ -891,7 +913,28 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 		fp = tmp_fp;
 	}
 
+	jit_data = fp->aux->jit_data;
+	if (!jit_data) {
+		jit_data = kzalloc(sizeof(*jit_data), GFP_KERNEL);
+		if (!jit_data) {
+			fp = org_fp;
+			goto out;
+		}
+		fp->aux->jit_data = jit_data;
+	}
+
 	flen = fp->len;
+	addrs = jit_data->addrs;
+	if (addrs) {
+		cgctx = jit_data->ctx;
+		image = jit_data->image;
+		bpf_hdr = jit_data->header;
+		proglen = jit_data->proglen;
+		alloclen = proglen + FUNCTION_DESCR_SIZE;
+		extra_pass = true;
+		goto skip_init_ctx;
+	}
+
 	addrs = kzalloc((flen+1) * sizeof(*addrs), GFP_KERNEL);
 	if (addrs == NULL) {
 		fp = org_fp;
@@ -904,10 +947,10 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 	cgctx.stack_size = round_up(fp->aux->stack_depth, 16);
 
 	/* Scouting faux-generate pass 0 */
-	if (bpf_jit_build_body(fp, 0, &cgctx, addrs)) {
+	if (bpf_jit_build_body(fp, 0, &cgctx, addrs, false)) {
 		/* We hit something illegal or unsupported. */
 		fp = org_fp;
-		goto out;
+		goto out_addrs;
 	}
 
 	/*
@@ -925,9 +968,10 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 			bpf_jit_fill_ill_insns);
 	if (!bpf_hdr) {
 		fp = org_fp;
-		goto out;
+		goto out_addrs;
 	}
 
+skip_init_ctx:
 	code_base = (u32 *)(image + FUNCTION_DESCR_SIZE);
 
 	/* Code generation passes 1-2 */
@@ -935,7 +979,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 		/* Now build the prologue, body code & epilogue for real. */
 		cgctx.idx = 0;
 		bpf_jit_build_prologue(code_base, &cgctx);
-		bpf_jit_build_body(fp, code_base, &cgctx, addrs);
+		bpf_jit_build_body(fp, code_base, &cgctx, addrs, extra_pass);
 		bpf_jit_build_epilogue(code_base, &cgctx);
 
 		if (bpf_jit_enable > 1)
@@ -956,15 +1000,30 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
 	((u64 *)image)[1] = local_paca->kernel_toc;
 #endif
 
+	bpf_flush_icache(bpf_hdr, (u8 *)bpf_hdr + (bpf_hdr->pages * PAGE_SIZE));
+
+	if (!fp->is_func || extra_pass) {
+		bpf_jit_binary_lock_ro(bpf_hdr);
+	} else {
+		jit_data->addrs = addrs;
+		jit_data->ctx = cgctx;
+		jit_data->proglen = proglen;
+		jit_data->image = image;
+		jit_data->header = bpf_hdr;
+	}
+
 	fp->bpf_func = (void *)image;
 	fp->jited = 1;
 	fp->jited_len = alloclen;
 
-	bpf_flush_icache(bpf_hdr, (u8 *)bpf_hdr + (bpf_hdr->pages * PAGE_SIZE));
+	if (!fp->is_func || extra_pass) {
+out_addrs:
+		kfree(addrs);
+		kfree(jit_data);
+		fp->aux->jit_data = NULL;
+	}
 
 out:
-	kfree(addrs);
-
 	if (bpf_blinded)
 		bpf_jit_prog_release_other(fp, fp == org_fp ? tmp_fp : org_fp);
 
-- 
2.14.3

^ permalink raw reply related

* Re: [PATCH 11/40] ipv6/flowlabel: simplify pid namespace lookup
From: Christoph Hellwig @ 2018-05-17  6:42 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA, Alessandro Zummo,
	Alexandre Belloni, devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-afs-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA,
	linux-ide-u79uwXL29TY76Z2rM5mHXA, Greg Kroah-Hartman,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	jfs-discussion-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Christoph Hellwig, linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	netfilter-devel-u79uwXL29TY76Z2rM5mHXA, Alexander Viro,
	Jiri Slaby, Andrew Morton, linux-ext4-u79uwXL29TY76Z2rM5mHXA,
	Alexey Dobriyan, megaraidlinux.pdl-dY08KVG/lbpWk0Htik3J/w,
	drbd-dev-cunTk1MwBs8qoQakbn7OcQ
In-Reply-To: <871seakg0u.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>

On Thu, May 17, 2018 at 12:28:01AM -0500, Eric W. Biederman wrote:
> > struct pid_namespace *proc_pid_namespace(struct inode *inode)
> > {
> > 	// maybe warn on for s_magic not on procfs??
> > 	return inode->i_sb->s_fs_info;
> > }
> 
> That should work.  Ideally out of line for the proc_fs.h version.
> Basically it should be a cousin of PDE_DATA.

The version in Al's tree is inline and without the warning as
I didn't want to drag in the magic.h include.  Please look at it for
additional comments, I can send incremental fixups if needed.

^ permalink raw reply

* Re: [PATCH] xen-netfront: fix xennet_start_xmit()'s return type
From: Juergen Gross @ 2018-05-17  6:43 UTC (permalink / raw)
  To: Luc Van Oostenryck, linux-kernel; +Cc: Boris Ostrovsky, xen-devel, netdev
In-Reply-To: <20180424131815.5064-1-luc.vanoostenryck@gmail.com>

On 24/04/18 15:18, Luc Van Oostenryck wrote:
> The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
> which is a typedef for an enum type, but the implementation in this
> driver returns an 'int'.
> 
> Fix this by returning 'netdev_tx_t' in this driver too.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

Pushed to xen/tip.git for-linus-4.18


Juergen

^ permalink raw reply

* Re: [PATCH bpf-next v3 00/15] Introducing AF_XDP support
From: Björn Töpel @ 2018-05-17  6:46 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Daniel Borkmann, Karlsson, Magnus, Duyck, Alexander H,
	Alexander Duyck, John Fastabend, Alexei Starovoitov,
	Jesper Dangaard Brouer, Willem de Bruijn, Michael S. Tsirkin,
	Netdev, Björn Töpel, michael.lundkvist,
	Brandeburg, Jesse, Singhai, Anjali, Zhang, Qi Z
In-Reply-To: <20180503233819.2tplfjd32auudys2@ast-mbp>

2018-05-04 1:38 GMT+02:00 Alexei Starovoitov <alexei.starovoitov@gmail.com>:
> On Fri, May 04, 2018 at 12:49:09AM +0200, Daniel Borkmann wrote:
>> On 05/02/2018 01:01 PM, Björn Töpel wrote:
>> > From: Björn Töpel <bjorn.topel@intel.com>
>> >
>> > This patch set introduces a new address family called AF_XDP that is
>> > optimized for high performance packet processing and, in upcoming
>> > patch sets, zero-copy semantics. In this patch set, we have removed
>> > all zero-copy related code in order to make it smaller, simpler and
>> > hopefully more review friendly. This patch set only supports copy-mode
>> > for the generic XDP path (XDP_SKB) for both RX and TX and copy-mode
>> > for RX using the XDP_DRV path. Zero-copy support requires XDP and
>> > driver changes that Jesper Dangaard Brouer is working on. Some of his
>> > work has already been accepted. We will publish our zero-copy support
>> > for RX and TX on top of his patch sets at a later point in time.
>>
>> +1, would be great to see it land this cycle. Saw few minor nits here
>> and there but nothing to hold it up, for the series:
>>
>> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
>>
>> Thanks everyone!
>
> Great stuff!
>
> Applied to bpf-next, with one condition.
> Upcoming zero-copy patches for both RX and TX need to be posted
> and reviewed within this release window.
> If netdev community as a whole won't be able to agree on the zero-copy
> bits we'd need to revert this feature before the next merge window.
>
> Few other minor nits:
> patch 3:
> +struct xdp_ring {
> +       __u32 producer __attribute__((aligned(64)));
> +       __u32 consumer __attribute__((aligned(64)));
> +};
> It kinda begs for ____cacheline_aligned_in_smp to be introduced for uapi headers.
>

Hmm, I need some guidance on what a sane uapi variant would be. We
can't have the uapi depend on the kernel build. ARM64, e.g., can have
both 64B and 128B according to the specs. Contemporary IA processors
have 64B.

The simplest, and maybe most future-proof, would be 128B aligned for
all. Another is having 128B for ARM and 64B for all IA. A third option
is having a hand-shaking API (I think virtio has that) for determine
the cache line size, but I'd rather not go down that route.

Thoughts/ideas on how a uapi ____cacheline_aligned_in_smp version
would look like?

> patch 5:
> +struct sockaddr_xdp {
> +       __u16 sxdp_family;
> +       __u32 sxdp_ifindex;
> Not great to have a hole in uapi struct. Please fix it in the follow up.
>
> patch 7:
> Has a lot of synchronize_net(). I think udpate/delete side
> can be improved to avoid them. Otherwise users may unknowingly DoS.
>
> As the next steps I suggest to prioritize the highest to ship
> zero-copy rx/tx patches and to add selftests.
>
> Thanks!
>

^ permalink raw reply

* Re: linux-next: manual merge of the net-next tree with the vfs tree
From: Christoph Hellwig @ 2018-05-17  6:47 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: David Miller, Networking, Al Viro, Linux-Next Mailing List,
	Linux Kernel Mailing List, Christoph Hellwig, Chris Novakovic
In-Reply-To: <20180517113450.182c8259@canb.auug.org.au>

> + /* Create a new file under /proc/net/ipconfig */
> + static int ipconfig_proc_net_create(const char *name,
> + 				    const struct file_operations *fops)
> + {
> + 	char *pname;
> + 	struct proc_dir_entry *p;
> + 
> + 	if (!ipconfig_dir)
> + 		return -ENOMEM;
> + 
> + 	pname = kasprintf(GFP_KERNEL, "%s%s", "ipconfig/", name);
> + 	if (!pname)
> + 		return -ENOMEM;
> + 
> + 	p = proc_create(pname, 0444, init_net.proc_net, fops);
> + 	kfree(pname);
> + 	if (!p)
> + 		return -ENOMEM;
> + 
> + 	return 0;

This code doesn't exist in the above mentioned commit.  But event
without knowing the details of the /proc/net code this looks somewhat
bogus.  For one I thought all the /proc/net files should be per-net
namespace.  Second the ntp file really should be using proc_create_net,
to handle all that under the hood - with the merge of the VFS
tree it will take a seq_ops, which is what this code really wants
anyway.

^ permalink raw reply


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