Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 0/5] ARM: sunxi: Add support for A10 Ethernet controller
From: Oliver Schinagl @ 2013-03-19  9:47 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1363380605-6577-1-git-send-email-maxime.ripard@free-electrons.com>

Maxime Ripard <maxime.ripard <at> free-electrons.com> writes:

> 
> Hi,
> 
> The Allwinner A10 SoC has an ethernet that is said to be coming from
> Davicom embedded in it. This IP has no public documentation, so exact
> details are quite sparse, and this code come from refactored allwinner
> code.
As we discussed on #linux-sunxi, it may be davicom IP it also may not be.
Register address do not match at all, so it could be that it is only partial
davicom IP at best.

I therefore suggest we put it in kernel/drivers/net/ethernet/allwinner/ and name
the modules/files sunxi-emac.c and sunxi-gmac.c (for the new gigabit mac in the
newest SoC's)...


Thanks,
Oliver
> 
> Since we don't have any clock support yet for the Allwinner SoCs, we
> rely on the bootloader to enable the wemac clock.
> 
> Thanks,
> Maxime

^ permalink raw reply

* Re: [PATCH 1/5] net: Add davicom wemac ethernet driver found on Allwinner A10 SoC's
From: Maxime Ripard @ 2013-03-19 18:39 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-arm-kernel, linux-doc, netdev, devicetree-discuss,
	linux-kernel, Rob Herring, Grant Likely, Rob Landley, sunny,
	shuge, Stefan Roese, kevin
In-Reply-To: <201303161541.37341.florian@openwrt.org>

Hi Florian,

Le 16/03/2013 15:41, Florian Fainelli a écrit :
> Hello Maxime, Stefan,
> 
> Please find below some comments regarding your PHY implementation in the driver 
> as well as the transmit and transmit completion routines.

Stefan implemented the changes you asked about the PHY, it will be in
the next iteration of this patchset.

On a general basis, we don't really know much about this chip, since
we're working without any datasheet on this.

> 
>> +#define WEMAC_PHY		0x100	/* PHY address 0x01 */
> 
> This should be made configurable if possible.

Ok

>> +	unsigned		power_gpio;
> 
> you could make this an int, so that you use gpio_is_valid() on this one.

Alexander Shiyan suggested to move to the regulator API, so I guess we
will just remove that variable.

>> +
>> +static void wemac_dumpblk_32bit(void __iomem *reg, int count)
>> +{
>> +	int i;
>> +	int tmp;
>> +
>> +	for (i = 0; i < (round_up(count, 4) / 4); i++)
>> +		tmp = readl(reg);
>> +}
> 
> This could probably be removed, tmp is a write only location, did you remove 
> the variable printing that came along this?

Hmmm, it looks that way yes. I'll remove it

>> +
>> +static int wemac_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
>> +{
>> +	struct wemac_board_info *dm = to_wemac_board(dev);
>> +
>> +	if (!netif_running(dev))
>> +		return -EINVAL;
>> +
>> +	return generic_mii_ioctl(&dm->mii, if_mii(req), cmd, NULL);
>> +}
>> +
>> +/* ethtool ops */
>> +static void wemac_get_drvinfo(struct net_device *dev,
>> +			      struct ethtool_drvinfo *info)
>> +{
>> +	strcpy(info->driver, DRV_NAME);
>> +	strcpy(info->version, DRV_VERSION);
> 
> You should use strlcpy() here to ensure null-termination, and you should also 
> fill in the bus_info member of struct ethtool_drvinfo.

ok, will do.

>> +	/* Init Driver variable */
>> +	db->tx_fifo_stat = 0;
>> +	dev->trans_start = 0;
> 
> I do not think this is required you are supposed to update this field only in 
> the receive path.

Ok, I'll remove that part.

>> +
>> +	channel = (channel == 1 ? 1 : 0);
>> +
>> +	spin_lock_irqsave(&db->lock, flags);
>> +
>> +	writel(channel, db->membase + EMAC_TX_INS_REG);
>> +
>> +	wemac_outblk_32bit(db->membase + EMAC_TX_IO_DATA_REG,
>> +			skb->data, skb->len);
>> +	dev->stats.tx_bytes += skb->len;
>> +
>> +	db->tx_fifo_stat |= 1 << channel;
>> +	/* TX control: First packet immediately send, second packet queue */
>> +	if (channel == 0) {
>> +		/* set TX len */
>> +		writel(skb->len, db->membase + EMAC_TX_PL0_REG);
>> +		/* start translate from fifo to phy */
>> +		writel(readl(db->membase + EMAC_TX_CTL0_REG) | 1,
>> +		       db->membase + EMAC_TX_CTL0_REG);
> 
> Do not you need some write barrier here to ensure your descriptor address and 
> control are properly written before the EMAC will see these?

writel has a write barrier, so it shouldn't be a problem I guess.

> 
>> +
>> +		/* save the time stamp */
>> +		dev->trans_start = jiffies;
>> +	} else if (channel == 1) {
>> +		/* set TX len */
>> +		writel(skb->len, db->membase + EMAC_TX_PL1_REG);
>> +		/* start translate from fifo to phy */
>> +		writel(readl(db->membase + EMAC_TX_CTL1_REG) | 1,
>> +		       db->membase + EMAC_TX_CTL1_REG);
>> +
>> +		/* save the time stamp */
>> +		dev->trans_start = jiffies;
>> +	}
>> +
>> +	if ((db->tx_fifo_stat & 3) == 3) {
>> +		/* Second packet */
>> +		netif_stop_queue(dev);
> 
> Why is that required? Does that mean that your EMAC can only transmit one 
> packet at a time?

The original driver was working that way, so the hardware can probably
send several packet at a time, but we don't really know how...

>> +static void wemac_tx_done(struct net_device *dev, struct wemac_board_info
>> *db, +			  unsigned int tx_status)
>> +{
>> +	/* One packet sent complete */
>> +	db->tx_fifo_stat &= ~(tx_status & 3);
>> +	if (3 == (tx_status & 3))
>> +		dev->stats.tx_packets += 2;
>> +	else
>> +		dev->stats.tx_packets++;
>> +
>> +	if (netif_msg_tx_done(db))
>> +		dev_dbg(db->dev, "tx done, NSR %02x\n", tx_status);
>> +
>> +	netif_wake_queue(dev);
> 
> Why is that also required? According to your start_xmit function you should do 
> this only when you have transmitted 2 packets no?

I don't know, maybe the code here is more about always having a buffer
of one packet at any point in time. With the current code, when you have
to send packets, it will:
  - send the packet 1
  - stop the queue
  - wait for the packet 1 to be sent
  - once packet 1 is sent, restart the queue, so that it can load a
    packet 3
  - start transmitting packet 2 if there's one, and loop, or just wait
    for it

Which would make sense, and for this, it looks to me that you should
always restart the queue, no matter what the number of packets to send was.

>> +
>> +		reg_val = readl(db->membase + EMAC_RX_IO_DATA_REG);
>> +		if (netif_msg_rx_status(db))
>> +			dev_dbg(db->dev, "receive header: %x\n", reg_val);
>> +		if (reg_val != 0x0143414d) {
> 
> Where is that magic value coming from?

The original code.

Maybe I should define it to something like "UNDOCUMENTED_VOODOO_MAGIC1",
or something like that, but I have no idea what it relates to in the
hardware :S

Thanks for your review,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply

* [PATCH] net: Add socket() system call self test.
From: David Miller @ 2013-03-19 18:52 UTC (permalink / raw)
  To: netdev; +Cc: netfilter-devel, linux-wireless


Signed-off-by: David S. Miller <davem@davemloft.net>
---

As mentioned during the netfilter workshop, we will be adding
all sorts of networking tests now that 3.9.x has a selftest
framework in place.

The first test I'm adding to net-next does some very simple
testing of the socket() system call.

Feel free to send patches for more tests, making the run
script more powerful (perhaps by taking a whitespace
seperated list of tests to run on the command line), and
adding more checks to the socket.c test.

Thanks.

 tools/testing/selftests/Makefile                   |  1 +
 tools/testing/selftests/net-socket/Makefile        | 16 ++++
 .../testing/selftests/net-socket/run_netsocktests  | 12 +++
 tools/testing/selftests/net-socket/socket.c        | 92 ++++++++++++++++++++++
 4 files changed, 121 insertions(+)
 create mode 100644 tools/testing/selftests/net-socket/Makefile
 create mode 100644 tools/testing/selftests/net-socket/run_netsocktests
 create mode 100644 tools/testing/selftests/net-socket/socket.c

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 3cc0ad7..7c6280f 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -5,6 +5,7 @@ TARGETS += vm
 TARGETS += cpu-hotplug
 TARGETS += memory-hotplug
 TARGETS += efivarfs
+TARGETS += net-socket
 
 all:
 	for TARGET in $(TARGETS); do \
diff --git a/tools/testing/selftests/net-socket/Makefile b/tools/testing/selftests/net-socket/Makefile
new file mode 100644
index 0000000..f27ee10
--- /dev/null
+++ b/tools/testing/selftests/net-socket/Makefile
@@ -0,0 +1,16 @@
+# Makefile for net-socket selftests
+
+CC = $(CROSS_COMPILE)gcc
+CFLAGS = -Wall
+
+NET_SOCK_PROGS = socket
+
+all: $(NET_SOCK_PROGS)
+%: %.c
+	$(CC) $(CFLAGS) -o $@ $^
+
+run_tests: all
+	@/bin/sh ./run_netsocktests || echo "vmtests: [FAIL]"
+
+clean:
+	$(RM) $(NET_SOCK_PROGS)
diff --git a/tools/testing/selftests/net-socket/run_netsocktests b/tools/testing/selftests/net-socket/run_netsocktests
new file mode 100644
index 0000000..c09a682
--- /dev/null
+++ b/tools/testing/selftests/net-socket/run_netsocktests
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+echo "--------------------"
+echo "running socket test"
+echo "--------------------"
+./socket
+if [ $? -ne 0 ]; then
+	echo "[FAIL]"
+else
+	echo "[PASS]"
+fi
+
diff --git a/tools/testing/selftests/net-socket/socket.c b/tools/testing/selftests/net-socket/socket.c
new file mode 100644
index 0000000..0f227f2
--- /dev/null
+++ b/tools/testing/selftests/net-socket/socket.c
@@ -0,0 +1,92 @@
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+struct socket_testcase {
+	int	domain;
+	int	type;
+	int	protocol;
+
+	/* 0    = valid file descriptor
+	 * -foo = error foo
+	 */
+	int	expect;
+
+	/* If non-zero, accept EAFNOSUPPORT to handle the case
+	 * of the protocol not being configured into the kernel.
+	 */
+	int	nosupport_ok;
+};
+
+static struct socket_testcase tests[] = {
+	{ AF_MAX,  0,           0,           -EAFNOSUPPORT,    0 },
+	{ AF_INET, SOCK_STREAM, IPPROTO_TCP, 0,                1  },
+	{ AF_INET, SOCK_DGRAM,  IPPROTO_TCP, -EPROTONOSUPPORT, 1  },
+	{ AF_INET, SOCK_DGRAM,  IPPROTO_UDP, 0,                1  },
+	{ AF_INET, SOCK_STREAM, IPPROTO_UDP, -EPROTONOSUPPORT, 1  },
+};
+
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#define ERR_STRING_SZ	64
+
+static int run_tests(void)
+{
+	char err_string1[ERR_STRING_SZ];
+	char err_string2[ERR_STRING_SZ];
+	int i, err;
+
+	err = 0;
+	for (i = 0; i < ARRAY_SIZE(tests); i++) {
+		struct socket_testcase *s = &tests[i];
+		int fd;
+
+		fd = socket(s->domain, s->type, s->protocol);
+		if (fd < 0) {
+			if (s->nosupport_ok &&
+			    errno == EAFNOSUPPORT)
+				continue;
+
+			if (s->expect < 0 &&
+			    errno == -s->expect)
+				continue;
+
+			strerror_r(-s->expect, err_string1, ERR_STRING_SZ);
+			strerror_r(errno, err_string2, ERR_STRING_SZ);
+
+			fprintf(stderr, "socket(%d, %d, %d) expected "
+				"err (%s) got (%s)\n",
+				s->domain, s->type, s->protocol,
+				err_string1, err_string2);
+
+			err = -1;
+			break;
+		} else {
+			close(fd);
+
+			if (s->expect < 0) {
+				strerror_r(errno, err_string1, ERR_STRING_SZ);
+
+				fprintf(stderr, "socket(%d, %d, %d) expected "
+					"success got err (%s)\n",
+					s->domain, s->type, s->protocol,
+					err_string1);
+
+				err = -1;
+				break;
+			}
+		}
+	}
+
+	return err;
+}
+
+int main(void)
+{
+	int err = run_tests();
+
+	return err;
+}
-- 
1.7.11.7

^ permalink raw reply related

* [PATCH] NET: ipconfig: Fix newline handling in log message.
From: Martin Fuzzey @ 2013-03-19 18:19 UTC (permalink / raw)
  To: netdev, David S. Miller

When using ipconfig the logs currently look like:

Single name server:
[    3.467270] IP-Config: Complete:
[    3.470613]      device=eth0, hwaddr=ac:de:48:00:00:01, ipaddr=172.16.42.2, mask=255.255.255.0, gw=172.16.42.1
[    3.480670]      host=infigo-1, domain=, nis-domain=(none)
[    3.486166]      bootserver=172.16.42.1, rootserver=172.16.42.1, rootpath=
[    3.492910]      nameserver0=172.16.42.1[    3.496853] ALSA device list:

Three name servers:
[    3.496949] IP-Config: Complete:
[    3.500293]      device=eth0, hwaddr=ac:de:48:00:00:01, ipaddr=172.16.42.2, mask=255.255.255.0, gw=172.16.42.1
[    3.510367]      host=infigo-1, domain=, nis-domain=(none)
[    3.515864]      bootserver=172.16.42.1, rootserver=172.16.42.1, rootpath=
[    3.522635]      nameserver0=172.16.42.1, nameserver1=172.16.42.100
[    3.529149] , nameserver2=172.16.42.200

Fix newline handling for these cases

Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
---
 net/ipv4/ipconfig.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 98cbc68..bf6c5cf 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1522,7 +1522,8 @@ static int __init ip_auto_config(void)
 		}
 	for (i++; i < CONF_NAMESERVERS_MAX; i++)
 		if (ic_nameservers[i] != NONE)
-			pr_cont(", nameserver%u=%pI4\n", i, &ic_nameservers[i]);
+			pr_cont(", nameserver%u=%pI4", i, &ic_nameservers[i]);
+	pr_cont("\n");
 #endif /* !SILENT */
 
 	return 0;

^ permalink raw reply related

* [GIT] Networking
From: David Miller @ 2013-03-19 19:05 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) Fix ARM BPF JIT handling of negative 'k' values, from Chen Gang.

2) Insufficient space reserved for bridge netlink values, fix from
   Stephen Hemminger.

3) Some dst_neigh_lookup*() callers don't interpret error pointer
   correctly, fix from Zhouyi Zhou.

4) Fix transport match in SCTP active_path loops, from Xugeng Zhang.

5) Fix qeth driver handling of multi-order SKB frags, from Frank
   Blaschka.

6) fec driver is missing napi_disable() call, resulting in crashes
   on unload, from Georg Hofmann.

7) Don't try to handle PMTU events on a listening socket, fix
   from Eric Dumazet.

8) Fix timestamp location calculations in IP option processing,
   from David Ward.

9) FIB_TABLE_HASHSZ setting is not controlled by the correct
   kconfig tests, from Denis V. Lunev.

10) Fix TX descriptor push handling in SFC driver, from Ben Hutchings.

11) Fix isdn/hisax and tulip/de4x5 kconfig dependencies, from Arnd
    Bergmann.

12) bnx2x statistics don't handle 4GB rollover correctly, fix from
    Maciej Żenczykowski.

13) Openvswitch bug fixes for vport del/new error reporting, missing
    genlmsg_end() call in netlink processing, and mis-parsing of
    LLC/SNAP ethernet types.  From Rich Lane.

14) SKB pfmemalloc state should only be propagated from the head
    page of a compound page, fix from Pavel Emelyanov.

15) Fix link handling in tg3 driver for 5715 chips when autonegotation
    is disabled.  From Nithin Sujir.

16) Fix inverted test of cpdma_check_free_tx_desc return value in
    davinci_emac driver, from Mugunthan V N.

17) vlan_depth is incorrectly calculated in skb_network_protocol(),
    from Li RongQing.

18) Fix probing of Gobi 1K devices in qmi_wwan driver, and fix NCM
    device mode backwards compat in cdc_ncm driver.  From Bjørn Mork.

Please pull, thanks a lot!

The following changes since commit 7c6baa304b841673d3a55ea4fcf9a5cbf7a1674b:

  Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (2013-03-11 07:54:29 -0700)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master

for you to fetch changes up to 5a3da1fe9561828d0ca7eca664b16ec2b9bf0055:

  inet: limit length of fragment queue hash table bucket lists (2013-03-19 10:28:36 -0400)

----------------------------------------------------------------
Arnd Bergmann (2):
      isdn: hisax: netjet requires VIRT_TO_BUS
      ethernet/tulip: DE4x5 needs VIRT_TO_BUS

Ben Hutchings (1):
      sfc: Only use TX push if a single descriptor is to be written

Bing Zhao (1):
      mwifiex: fix potential out-of-boundary access to ibss rate table

Bjørn Mork (2):
      net: qmi_wwan: set correct altsetting for Gobi 1K devices
      net: cdc_ncm, cdc_mbim: allow user to prefer NCM for backwards compatibility

Chen Gang (1):
      ARM:net: an issue for k which is u32, never < 0

Cong Wang (2):
      openvswitch: fix the calculation of checksum for vlan header
      openvswitch: remove some useless comments

Daniel Mack (1):
      net: ethernet: cpsw: fix usage of cpdma_check_free_tx_desc()

David S. Miller (4):
      Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
      Merge branch 'sfc-3.9' of git://git.kernel.org/.../bwh/sfc
      Merge branch 'fixes' of git://git.kernel.org/.../jesse/openvswitch
      Merge branch 'for-davem' of git://git.kernel.org/.../linville/wireless

David Ward (1):
      net/ipv4: Ensure that location of timestamp option is stored

Denis V. Lunev (1):
      ipv4: fix definition of FIB_TABLE_HASHSZ

Eric Dumazet (2):
      tcp: fix skb_availroom()
      tcp: dont handle MTU reduction on LISTEN socket

Frank Blaschka (1):
      qeth: Fix scatter-gather regression

Georg Hofmann (1):
      net: fec: fix missing napi_disable call

Hannes Frederic Sowa (1):
      inet: limit length of fragment queue hash table bucket lists

John Crispin (1):
      rt2x00: fix rt2x00 to work with the new ralink SoC config symbols

John W. Linville (3):
      Merge tag 'nfc-fixes-3.9-1' of git://git.kernel.org/.../sameo/nfc-fixes
      Merge branch 'for-upstream' of git://git.kernel.org/.../bluetooth/bluetooth
      Merge branch 'master' of git://git.kernel.org/.../linville/wireless into for-davem

Josh Boyer (1):
      Bluetooth: Add support for atheros 04ca:3004 device to ath3k

Larry Finger (2):
      rtlwifi: rtl8192cu: Fix schedule while atomic bug splat
      rtlwifi: rtl8192cu: Fix problem that prevents reassociation

Li RongQing (1):
      net/core: move vlan_depth out of while loop in skb_network_protocol()

Lucas Stach (1):
      net: fec: restart the FEC when PHY speed changes

Maciej Żenczykowski (1):
      bnx2x: fix occasional statistics off-by-4GB error

Marek Lindner (1):
      batman-adv: verify tt len does not exceed packet len

Michael S. Tsirkin (1):
      vhost/net: fix heads usage of ubuf_info

Michal Schmidt (1):
      bnx2x: add missing napi deletion in error path

Mugunthan V N (1):
      drivers: net: ethernet: ti: davinci_emac: fix usage of cpdma_check_free_tx_desc()

Nithin Sujir (1):
      tg3: 5715 does not link up when autoneg off

Pavel Emelyanov (1):
      skb: Propagate pfmemalloc on skb from head page only

Rich Lane (4):
      openvswitch: Fix ovs_vport_cmd_del return value on success
      openvswitch: Fix ovs_vport_cmd_new return value on success
      openvswitch: Call genlmsg_end in queue_userspace_packet
      openvswitch: Fix parsing invalid LLC/SNAP ethertypes

Robert de Vries (1):
      smsc75xx: configuration help incorrectly mentions smsc95xx

Samuel Ortiz (4):
      NFC: llcp: Decrease socket ack log when accepting a connection
      NFC: llcp: Clean local timers and works when removing a device
      NFC: llcp: Clean raw sockets from nfc_llcp_socket_release
      NFC: llcp: Report error to pending sockets when a device is removed

Santosh Rastapur (1):
      cxgb4: Allow for backward compatibility with new VPD scheme.

Stefan Raspl (2):
      qeth: delay feature trace
      qeth: Fix invalid router settings handling

Sunguk Lee (1):
      Bluetooth: Device 0cf3:3008 should map AR 3012

Timo Teräs (1):
      Revert "ip_gre: make ipgre_tunnel_xmit() not parse network header as IP unconditionally"

Veaceslav Falico (2):
      netconsole: don't call __netpoll_cleanup() while atomic
      bonding: don't call update_speed_duplex() under spinlocks

Vlad Yasevich (3):
      sctp: Use correct sideffect command in duplicate cookie handling
      rtnetlink: Mask the rta_type when range checking
      bridge: Add support for setting BR_ROOT_BLOCK flag.

Xufeng Zhang (1):
      sctp: don't break the loop while meeting the active_path so as to find the matched transport

Zhouyi Zhou (1):
      Fix dst_neigh_lookup/dst_neigh_lookup_skb return value handling bug

stephen hemminger (1):
      bridge: reserve space for IFLA_BRPORT_FAST_LEAVE

 arch/arm/net/bpf_jit_32.c                         |  2 +-
 drivers/bluetooth/ath3k.c                         |  4 +++
 drivers/bluetooth/btusb.c                         |  2 ++
 drivers/infiniband/hw/cxgb4/cm.c                  | 12 ++++++++
 drivers/isdn/hisax/Kconfig                        |  6 ++--
 drivers/net/bonding/bond_main.c                   |  6 ++--
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c   |  1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h |  3 +-
 drivers/net/ethernet/broadcom/tg3.c               |  8 ++++++
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c        | 12 ++++++--
 drivers/net/ethernet/dec/tulip/Kconfig            |  1 +
 drivers/net/ethernet/freescale/fec.c              | 27 ++++++++++--------
 drivers/net/ethernet/freescale/fec.h              |  1 +
 drivers/net/ethernet/sfc/nic.c                    |  3 +-
 drivers/net/ethernet/ti/cpsw.c                    |  2 +-
 drivers/net/ethernet/ti/davinci_emac.c            |  2 +-
 drivers/net/netconsole.c                          | 15 ++++++----
 drivers/net/usb/Kconfig                           |  2 +-
 drivers/net/usb/cdc_mbim.c                        | 11 +-------
 drivers/net/usb/cdc_ncm.c                         | 49 +++++++++++++++++++++------------
 drivers/net/usb/qmi_wwan.c                        | 49 +++++++++++----------------------
 drivers/net/wireless/mwifiex/join.c               |  7 ++---
 drivers/net/wireless/rt2x00/Kconfig               |  4 +--
 drivers/net/wireless/rt2x00/rt2800pci.c           | 14 +++++-----
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c       | 89 ++++++++++++++++++++++++------------------------------------
 drivers/s390/net/qeth_core.h                      |  1 +
 drivers/s390/net/qeth_core_main.c                 | 45 +++++++++++++++++++++++++-----
 drivers/s390/net/qeth_l3_main.c                   | 23 ++++++++++------
 drivers/s390/net/qeth_l3_sys.c                    |  2 ++
 drivers/vhost/net.c                               |  3 +-
 include/linux/skbuff.h                            | 13 ++++++---
 include/linux/usb/cdc_ncm.h                       |  1 +
 include/net/dst.h                                 |  6 ++--
 include/net/inet_frag.h                           |  9 ++++++
 include/net/ip_fib.h                              | 12 ++++----
 net/batman-adv/bat_iv_ogm.c                       |  6 ++--
 net/bridge/br_netlink.c                           |  2 ++
 net/core/dev.c                                    |  2 +-
 net/core/rtnetlink.c                              |  2 +-
 net/ipv4/inet_fragment.c                          | 20 +++++++++++++-
 net/ipv4/ip_fragment.c                            | 11 +++-----
 net/ipv4/ip_gre.c                                 |  5 +---
 net/ipv4/ip_options.c                             |  5 +---
 net/ipv4/tcp.c                                    |  2 +-
 net/ipv4/tcp_ipv4.c                               | 14 +++++-----
 net/ipv4/tcp_output.c                             |  1 -
 net/ipv6/netfilter/nf_conntrack_reasm.c           | 12 ++++----
 net/ipv6/reassembly.c                             |  8 ++++--
 net/ipv6/tcp_ipv6.c                               |  7 +++++
 net/nfc/llcp/llcp.c                               | 62 ++++++++++++++++++++++++++++++++++++------
 net/nfc/llcp/sock.c                               |  2 ++
 net/openvswitch/actions.c                         |  4 +--
 net/openvswitch/datapath.c                        |  3 ++
 net/openvswitch/flow.c                            |  6 +++-
 net/openvswitch/vport-netdev.c                    |  3 +-
 net/openvswitch/vport.c                           |  3 +-
 net/sctp/associola.c                              |  2 +-
 net/sctp/sm_statefuns.c                           |  2 +-
 58 files changed, 387 insertions(+), 244 deletions(-)

^ permalink raw reply

* Re: [BUG][mvebu] mvneta: cannot request irq 25 on openblocks-ax3
From: Florian Fainelli @ 2013-03-19 19:48 UTC (permalink / raw)
  To: Gregory CLEMENT
  Cc: Masami Hiramatsu, Ezequiel Garcia, linux-arm-kernel,
	thomas.petazzoni, Jason Cooper, netdev, linux-kernel,
	yrl.pp-manager.tt@hitachi.com
In-Reply-To: <514895C5.40706@free-electrons.com>

On Tuesday 19 March 2013 17:43:49 Gregory CLEMENT wrote:
> 
> Hi Masami,
> 
> You can try this patch if you want.
> I don't have the hardware today so I didn't test it.
> If you (and also Florian and Ezequiel) can test it and if it fixed
> the bug, then I will be able send a proper email for it,

I just tested your patch on RD-A370-A1 and DB-MV784MP-GP and it works fine, 
thanks! Feel free to add my Tested-by: Florian Fainelli <florian@openwrt.org> 
to your next submission.

Thanks!
-- 
Florian

^ permalink raw reply

* Re: [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: Nick Pegg @ 2013-03-19 20:13 UTC (permalink / raw)
  To: Wei Liu; +Cc: netdev, annie.li, konrad.wilk, ian.campbell, xen-devel
In-Reply-To: <1363602955-24790-3-git-send-email-wei.liu2@citrix.com>


On 3/18/13 6:35 AM, Wei Liu wrote:
> The `size' field of Xen network wire format is uint16_t, anything bigger than
> 65535 will cause overflow.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
>  drivers/net/xen-netfront.c |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 5527663..8c3d065 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -547,6 +547,18 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  	unsigned int len = skb_headlen(skb);
>  	unsigned long flags;
>  
> +	/*
> +	 * wire format of xen_netif_tx_request only supports skb->len
> +	 * < 64K, because size field in xen_netif_tx_request is
> +	 * uint16_t.
> +	 */
> +	if (unlikely(skb->len > (uint16_t)(~0))) {
> +		net_alert_ratelimited(
> +			"xennet: skb->len = %d, too big for wire format\n",
> +			skb->len);
> +		goto drop;
> +	}
> +
>  	slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
>  		xennet_count_skb_frag_slots(skb);
>  	if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
> 

I have tested this patch on a 3.7.10 DomU and have confirmed that it
works for the test case that Wei came up with (set MTU to 100 on DomU,
run iperf). I haven't come across any other ways to cause this to
happen, so my testing isn't very thorough.


-Nick

^ permalink raw reply

* [PATCH net-next v3] packet: packet fanout rollover during socket overload
From: Willem de Bruijn @ 2013-03-19 20:18 UTC (permalink / raw)
  To: eric.dumazet, davem, netdev; +Cc: Willem de Bruijn

Changes:
  v3->v2: rebase (no other changes)
          passes selftest
  v2->v1: read f->num_members only once
          fix bug: test rollover mode + flag

Minimize packet drop in a fanout group. If one socket is full,
roll over packets to another from the group. Maintain flow
affinity during normal load using an rxhash fanout policy, while
dispersing unexpected traffic storms that hit a single cpu, such
as spoofed-source DoS flows. Rollover breaks affinity for flows
arriving at saturated sockets during those conditions.

The patch adds a fanout policy ROLLOVER that rotates between sockets,
filling each socket before moving to the next. It also adds a fanout
flag ROLLOVER. If passed along with any other fanout policy, the
primary policy is applied until the chosen socket is full. Then,
rollover selects another socket, to delay packet drop until the
entire system is saturated.

Probing sockets is not free. Selecting the last used socket, as
rollover does, is a greedy approach that maximizes chance of
success, at the cost of extreme load imbalance. In practice, with
sufficiently long queues to absorb bursts, sockets are drained in
parallel and load balance looks uniform in `top`.

To avoid contention, scales counters with number of sockets and
accesses them lockfree. Values are bounds checked to ensure
correctness.

Tested using an application with 9 threads pinned to CPUs, one socket
per thread and sufficient busywork per packet operation to limits each
thread to handling 32 Kpps. When sent 500 Kpps single UDP stream
packets, a FANOUT_CPU setup processes 32 Kpps in total without this
patch, 270 Kpps with the patch. Tested with read() and with a packet
ring (V1). Also, passes unit test (perhaps for selftests) at
http://kernel.googlecode.com/files/psock_fanout.c

Signed-off-by: Willem de Bruijn <willemb@google.com>
---
 include/uapi/linux/if_packet.h |   2 +
 net/packet/af_packet.c         | 109 ++++++++++++++++++++++++++++++++---------
 net/packet/internal.h          |   3 +-
 3 files changed, 90 insertions(+), 24 deletions(-)

diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index f9a6037..8136658 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -55,6 +55,8 @@ struct sockaddr_ll {
 #define PACKET_FANOUT_HASH		0
 #define PACKET_FANOUT_LB		1
 #define PACKET_FANOUT_CPU		2
+#define PACKET_FANOUT_ROLLOVER		3
+#define PACKET_FANOUT_FLAG_ROLLOVER	0x1000
 #define PACKET_FANOUT_FLAG_DEFRAG	0x8000
 
 struct tpacket_stats {
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1d6793d..0304c6b 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -181,6 +181,8 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
 
 struct packet_sock;
 static int tpacket_snd(struct packet_sock *po, struct msghdr *msg);
+static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
+		       struct packet_type *pt, struct net_device *orig_dev);
 
 static void *packet_previous_frame(struct packet_sock *po,
 		struct packet_ring_buffer *rb,
@@ -973,11 +975,11 @@ static void *packet_current_rx_frame(struct packet_sock *po,
 
 static void *prb_lookup_block(struct packet_sock *po,
 				     struct packet_ring_buffer *rb,
-				     unsigned int previous,
+				     unsigned int idx,
 				     int status)
 {
 	struct tpacket_kbdq_core *pkc  = GET_PBDQC_FROM_RB(rb);
-	struct tpacket_block_desc *pbd = GET_PBLOCK_DESC(pkc, previous);
+	struct tpacket_block_desc *pbd = GET_PBLOCK_DESC(pkc, idx);
 
 	if (status != BLOCK_STATUS(pbd))
 		return NULL;
@@ -1041,6 +1043,29 @@ static void packet_increment_head(struct packet_ring_buffer *buff)
 	buff->head = buff->head != buff->frame_max ? buff->head+1 : 0;
 }
 
+static bool packet_rcv_has_room(struct packet_sock *po, struct sk_buff *skb)
+{
+	struct sock *sk = &po->sk;
+	bool has_room;
+
+	if (po->prot_hook.func != tpacket_rcv)
+		return (atomic_read(&sk->sk_rmem_alloc) + skb->truesize)
+		       <= sk->sk_rcvbuf;
+
+	spin_lock(&sk->sk_receive_queue.lock);
+	if (po->tp_version == TPACKET_V3)
+		has_room = prb_lookup_block(po, &po->rx_ring,
+					po->rx_ring.prb_bdqc.kactive_blk_num,
+					TP_STATUS_KERNEL);
+	else
+		has_room = packet_lookup_frame(po, &po->rx_ring,
+					       po->rx_ring.head,
+					       TP_STATUS_KERNEL);
+	spin_unlock(&sk->sk_receive_queue.lock);
+
+	return has_room;
+}
+
 static void packet_sock_destruct(struct sock *sk)
 {
 	skb_queue_purge(&sk->sk_error_queue);
@@ -1066,16 +1091,16 @@ static int fanout_rr_next(struct packet_fanout *f, unsigned int num)
 	return x;
 }
 
-static struct sock *fanout_demux_hash(struct packet_fanout *f, struct sk_buff *skb, unsigned int num)
+static unsigned int fanout_demux_hash(struct packet_fanout *f,
+				      struct sk_buff *skb,
+				      unsigned int num)
 {
-	u32 idx, hash = skb->rxhash;
-
-	idx = ((u64)hash * num) >> 32;
-
-	return f->arr[idx];
+	return (((u64)skb->rxhash) * num) >> 32;
 }
 
-static struct sock *fanout_demux_lb(struct packet_fanout *f, struct sk_buff *skb, unsigned int num)
+static unsigned int fanout_demux_lb(struct packet_fanout *f,
+				    struct sk_buff *skb,
+				    unsigned int num)
 {
 	int cur, old;
 
@@ -1083,14 +1108,40 @@ static struct sock *fanout_demux_lb(struct packet_fanout *f, struct sk_buff *skb
 	while ((old = atomic_cmpxchg(&f->rr_cur, cur,
 				     fanout_rr_next(f, num))) != cur)
 		cur = old;
-	return f->arr[cur];
+	return cur;
+}
+
+static unsigned int fanout_demux_cpu(struct packet_fanout *f,
+				     struct sk_buff *skb,
+				     unsigned int num)
+{
+	return smp_processor_id() % num;
 }
 
-static struct sock *fanout_demux_cpu(struct packet_fanout *f, struct sk_buff *skb, unsigned int num)
+static unsigned int fanout_demux_rollover(struct packet_fanout *f,
+					  struct sk_buff *skb,
+					  unsigned int idx, unsigned int skip,
+					  unsigned int num)
 {
-	unsigned int cpu = smp_processor_id();
+	unsigned int i, j;
 
-	return f->arr[cpu % num];
+	i = j = min_t(int, f->next[idx], num - 1);
+	do {
+		if (i != skip && packet_rcv_has_room(pkt_sk(f->arr[i]), skb)) {
+			if (i != j)
+				f->next[idx] = i;
+			return i;
+		}
+		if (++i == num)
+			i = 0;
+	} while (i != j);
+
+	return idx;
+}
+
+static bool fanout_has_flag(struct packet_fanout *f, u16 flag)
+{
+	return f->flags & (flag >> 8);
 }
 
 static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev,
@@ -1099,7 +1150,7 @@ static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev,
 	struct packet_fanout *f = pt->af_packet_priv;
 	unsigned int num = f->num_members;
 	struct packet_sock *po;
-	struct sock *sk;
+	unsigned int idx;
 
 	if (!net_eq(dev_net(dev), read_pnet(&f->net)) ||
 	    !num) {
@@ -1110,23 +1161,31 @@ static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev,
 	switch (f->type) {
 	case PACKET_FANOUT_HASH:
 	default:
-		if (f->defrag) {
+		if (fanout_has_flag(f, PACKET_FANOUT_FLAG_DEFRAG)) {
 			skb = ip_check_defrag(skb, IP_DEFRAG_AF_PACKET);
 			if (!skb)
 				return 0;
 		}
 		skb_get_rxhash(skb);
-		sk = fanout_demux_hash(f, skb, num);
+		idx = fanout_demux_hash(f, skb, num);
 		break;
 	case PACKET_FANOUT_LB:
-		sk = fanout_demux_lb(f, skb, num);
+		idx = fanout_demux_lb(f, skb, num);
 		break;
 	case PACKET_FANOUT_CPU:
-		sk = fanout_demux_cpu(f, skb, num);
+		idx = fanout_demux_cpu(f, skb, num);
+		break;
+	case PACKET_FANOUT_ROLLOVER:
+		idx = fanout_demux_rollover(f, skb, 0, (unsigned int) -1, num);
 		break;
 	}
 
-	po = pkt_sk(sk);
+	po = pkt_sk(f->arr[idx]);
+	if (fanout_has_flag(f, PACKET_FANOUT_FLAG_ROLLOVER) &&
+	    unlikely(!packet_rcv_has_room(po, skb))) {
+		idx = fanout_demux_rollover(f, skb, idx, idx, num);
+		po = pkt_sk(f->arr[idx]);
+	}
 
 	return po->prot_hook.func(skb, dev, &po->prot_hook, orig_dev);
 }
@@ -1175,10 +1234,13 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 	struct packet_sock *po = pkt_sk(sk);
 	struct packet_fanout *f, *match;
 	u8 type = type_flags & 0xff;
-	u8 defrag = (type_flags & PACKET_FANOUT_FLAG_DEFRAG) ? 1 : 0;
+	u8 flags = type_flags >> 8;
 	int err;
 
 	switch (type) {
+	case PACKET_FANOUT_ROLLOVER:
+		if (type_flags & PACKET_FANOUT_FLAG_ROLLOVER)
+			return -EINVAL;
 	case PACKET_FANOUT_HASH:
 	case PACKET_FANOUT_LB:
 	case PACKET_FANOUT_CPU:
@@ -1203,7 +1265,7 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 		}
 	}
 	err = -EINVAL;
-	if (match && match->defrag != defrag)
+	if (match && match->flags != flags)
 		goto out;
 	if (!match) {
 		err = -ENOMEM;
@@ -1213,7 +1275,7 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 		write_pnet(&match->net, sock_net(sk));
 		match->id = id;
 		match->type = type;
-		match->defrag = defrag;
+		match->flags = flags;
 		atomic_set(&match->rr_cur, 0);
 		INIT_LIST_HEAD(&match->list);
 		spin_lock_init(&match->lock);
@@ -3240,7 +3302,8 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
 	case PACKET_FANOUT:
 		val = (po->fanout ?
 		       ((u32)po->fanout->id |
-			((u32)po->fanout->type << 16)) :
+			((u32)po->fanout->type << 16) |
+			((u32)po->fanout->flags << 24)) :
 		       0);
 		break;
 	case PACKET_TX_HAS_OFF:
diff --git a/net/packet/internal.h b/net/packet/internal.h
index e84cab8..e891f02 100644
--- a/net/packet/internal.h
+++ b/net/packet/internal.h
@@ -77,10 +77,11 @@ struct packet_fanout {
 	unsigned int		num_members;
 	u16			id;
 	u8			type;
-	u8			defrag;
+	u8			flags;
 	atomic_t		rr_cur;
 	struct list_head	list;
 	struct sock		*arr[PACKET_FANOUT_MAX];
+	int			next[PACKET_FANOUT_MAX];
 	spinlock_t		lock;
 	atomic_t		sk_ref;
 	struct packet_type	prot_hook ____cacheline_aligned_in_smp;
-- 
1.8.1.3

^ permalink raw reply related

* Re: [PATCH 1/2] dma-debug: Fix locking bug in check_unmap
From: Shuah Khan @ 2013-03-19 20:29 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: linux-kernel, konrad.wilk, joerg.roedel, konrad, christoph.paasch,
	mingo, hpa, akpm, netdev, jeffrey.t.kirsher, shuah.khan
In-Reply-To: <20130318221243.7349.64147.stgit@ahduyck-cp1.jf.intel.com>

On Mon, 2013-03-18 at 15:12 -0700, Alexander Duyck wrote:
> In check_unmap it is possible to get into a dead-locked state if
> dma_mapping_error is called.  The problem is that the bucket is locked in
> check_unmap, and locked again by debug_dma_mapping_error which is called by
> dma_mapping_error.  To resolve that we must release the lock on the bucket
> before making the call to dma_mapping_error.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

Looks good.

Reviewed-by: Shuah Khan
Tested-by Shuah Khan

Thanks for finding and fixing the problem.
-- Shuah

^ permalink raw reply

* Re: [PATCH 2/2] dma-debug: Update DMA debug API to better handle multiple mappings of a buffer
From: Shuah Khan @ 2013-03-19 20:30 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: linux-kernel, konrad.wilk, joerg.roedel, konrad, christoph.paasch,
	mingo, hpa, akpm, netdev, jeffrey.t.kirsher, shuah.khan
In-Reply-To: <20130318221249.7349.85892.stgit@ahduyck-cp1.jf.intel.com>

On Mon, 2013-03-18 at 15:12 -0700, Alexander Duyck wrote:
> There were reports of the igb driver unmapping buffers without calling
> dma_mapping_error.  On closer inspection issues were found in the DMA debug
> API and how it handled multiple mappings of the same buffer.
> 
> The issue I found is the fact that the debug_dma_mapping_error would only set
> the map_err_type to MAP_ERR_CHECKED in the case that the was only one match
> for device and device address.  However in the case of non-IOMMU, multiple
> addresses existed and as a result it was not setting this field once a
> second mapping was instantiated.  I have resolved this by changing the search
> so that it instead will now set MAP_ERR_CHECKED on the first buffer that
> matches the device and DMA address that is currently in the state
> MAP_ERR_NOT_CHECKED.
> 
> A secondary side effect of this patch is that in the case of multiple buffers
> using the same address only the last mapping will have a valid map_err_type.
> The previous mappings will all end up with map_err_type set to
> MAP_ERR_CHECKED because of the dma_mapping_error call in debug_dma_map_page.
> However this behavior may be preferable as it means you will likely only see
> one real error per multi-mapped buffer, versus the current behavior of
> multiple false errors mer multi-mapped buffer.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---

Looks good. Tested it as well.

Reviewed-by: shuah.khan@hp.com
Tested-by: shuah.khan@hp.com

Thanks for finding and fixing the problem.

-- Shuah

^ permalink raw reply

* Re: [PATCH net-next v3] packet: packet fanout rollover during socket overload
From: Eric Dumazet @ 2013-03-19 20:37 UTC (permalink / raw)
  To: Willem de Bruijn; +Cc: davem, netdev
In-Reply-To: <1363724291-27580-1-git-send-email-willemb@google.com>

On Tue, 2013-03-19 at 16:18 -0400, Willem de Bruijn wrote:
> Changes:
>   v3->v2: rebase (no other changes)
>           passes selftest
>   v2->v1: read f->num_members only once
>           fix bug: test rollover mode + flag
> 
> Minimize packet drop in a fanout group. If one socket is full,
> roll over packets to another from the group. Maintain flow
> affinity during normal load using an rxhash fanout policy, while
> dispersing unexpected traffic storms that hit a single cpu, such
> as spoofed-source DoS flows. Rollover breaks affinity for flows
> arriving at saturated sockets during those conditions.
> 
> The patch adds a fanout policy ROLLOVER that rotates between sockets,
> filling each socket before moving to the next. It also adds a fanout
> flag ROLLOVER. If passed along with any other fanout policy, the
> primary policy is applied until the chosen socket is full. Then,
> rollover selects another socket, to delay packet drop until the
> entire system is saturated.
> 
> Probing sockets is not free. Selecting the last used socket, as
> rollover does, is a greedy approach that maximizes chance of
> success, at the cost of extreme load imbalance. In practice, with
> sufficiently long queues to absorb bursts, sockets are drained in
> parallel and load balance looks uniform in `top`.
> 
> To avoid contention, scales counters with number of sockets and
> accesses them lockfree. Values are bounds checked to ensure
> correctness.
> 
> Tested using an application with 9 threads pinned to CPUs, one socket
> per thread and sufficient busywork per packet operation to limits each
> thread to handling 32 Kpps. When sent 500 Kpps single UDP stream
> packets, a FANOUT_CPU setup processes 32 Kpps in total without this
> patch, 270 Kpps with the patch. Tested with read() and with a packet
> ring (V1). Also, passes unit test (perhaps for selftests) at
> http://kernel.googlecode.com/files/psock_fanout.c
> 
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> ---
>  include/uapi/linux/if_packet.h |   2 +
>  net/packet/af_packet.c         | 109 ++++++++++++++++++++++++++++++++---------
>  net/packet/internal.h          |   3 +-
>  3 files changed, 90 insertions(+), 24 deletions(-)

Reviewed-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: [PATCH v2 net-next 1/5] GRE: Refactor GRE tunneling code.
From: Stephen Hemminger @ 2013-03-19 20:58 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: David Miller, pshelar, netdev, jesse
In-Reply-To: <87r4jb1y0t.fsf@nemi.mork.no>

On Tue, 19 Mar 2013 11:31:30 +0100
Bjørn Mork <bjorn@mork.no> wrote:

> David Miller <davem@davemloft.net> writes:
> > From: Stephen Hemminger <stephen@networkplumber.org>
> >> On Mon, 18 Mar 2013 11:13:25 -0700
> >> Pravin B Shelar <pshelar@nicira.com> wrote:
> >> 
> >>> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
> >>> index 7944df7..2073226 100644
> >>> --- a/net/ipv4/Kconfig
> >>> +++ b/net/ipv4/Kconfig
> >>> @@ -186,9 +186,14 @@ config NET_IPGRE_DEMUX
> >>>  	 This is helper module to demultiplex GRE packets on GRE version field criteria.
> >>>  	 Required by ip_gre and pptp modules.
> >>>  
> >>> +config NET_IP_TUNNEL
> >>> +	tristate
> >>> +	default n
> >>> +
> >> 
> >> Won't this break existing kernel config's, shouldn't this default y?
> >
> > Or "m".  But indeed, it should be made to automatically work for
> > existing configs.
> 
> Won't the "select NET_IP_TUNNEL" statements do just that?
> 
> Changing the default to m will enable this module even if all of
> NET_IPGRE, VXLAN and NET_IPIP are disabled. That's pointless, isn't it?

Looks like you are right, just tried a number of different kernel
configs with 'make oldconfig' and it picks up the dependency  correctly.

^ permalink raw reply

* Re: [PATCH net-next v3] packet: packet fanout rollover during socket overload
From: David Miller @ 2013-03-19 21:16 UTC (permalink / raw)
  To: eric.dumazet; +Cc: willemb, netdev
In-Reply-To: <1363725437.2558.22.camel@edumazet-glaptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 19 Mar 2013 13:37:17 -0700

> On Tue, 2013-03-19 at 16:18 -0400, Willem de Bruijn wrote:
>> Changes:
>>   v3->v2: rebase (no other changes)
>>           passes selftest
>>   v2->v1: read f->num_members only once
>>           fix bug: test rollover mode + flag
 ...
>> Signed-off-by: Willem de Bruijn <willemb@google.com>
 ...
> Reviewed-by: Eric Dumazet <edumazet@google.com>

Applied, and I added the selftest too, but it fails for me on my
128-cpu sparc64 machine:

make[1]: Entering directory `/home/davem/src/GIT/net-next/tools/testing/selftests/net-afpacket'
--------------------
running psock_fanout test
--------------------
test: control single socket
test: control multiple sockets
test: datapath 0x0
info: count=0,0, expect=0,0
info: count=0,20, expect=15,5
ERROR: incorrect queue lengths
[FAIL]

^ permalink raw reply

* [PATCH] net: Fix failure string in net-socket selftests Makefile.
From: David Miller @ 2013-03-19 21:16 UTC (permalink / raw)
  To: netdev


Signed-off-by: David S. Miller <davem@davemloft.net>
---
 tools/testing/selftests/net-socket/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net-socket/Makefile b/tools/testing/selftests/net-socket/Makefile
index f27ee10..2450fd8 100644
--- a/tools/testing/selftests/net-socket/Makefile
+++ b/tools/testing/selftests/net-socket/Makefile
@@ -10,7 +10,7 @@ all: $(NET_SOCK_PROGS)
 	$(CC) $(CFLAGS) -o $@ $^
 
 run_tests: all
-	@/bin/sh ./run_netsocktests || echo "vmtests: [FAIL]"
+	@/bin/sh ./run_netsocktests || echo "sockettests: [FAIL]"
 
 clean:
 	$(RM) $(NET_SOCK_PROGS)
-- 
1.7.11.7

^ permalink raw reply related

* Re: [PATCH] igb: fix PHC stopping on max freq
From: Vick, Matthew @ 2013-03-19 21:17 UTC (permalink / raw)
  To: Jiri Benc, netdev@vger.kernel.org
  Cc: e1000-devel@lists.sourceforge.net, Miroslav Lichvar,
	Stefan Assmann
In-Reply-To: <f254bc583cbe1f623bd6ebb4ff375e440696d8b2.1363703896.git.jbenc@redhat.com>

On 3/19/13 7:42 AM, "Jiri Benc" <jbenc@redhat.com> wrote:

>For 82576 MAC type, max_adj is reported as 1000000000 ppb. However, if
>this value is passed to igb_ptp_adjfreq_82576, incvalue overflows out of
>INCVALUE_82576_MASK, resulting in setting of zero TIMINCA.incvalue,
>stopping
>the PHC (instead of going at twice the nominal speed).
>
>Fix the advertised max_adj value to the largest value hardware can handle.
>As there is no min_adj value available (-max_adj is used instead), this
>will
>also prevent stopping the clock intentionally. It's probably not a big
>deal,
>other igb MAC types don't support stopping the clock, either.
>
>Signed-off-by: Jiri Benc <jbenc@redhat.com>
>---
> drivers/net/ethernet/intel/igb/igb_ptp.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c
>b/drivers/net/ethernet/intel/igb/igb_ptp.c
>index 0987822..0a23750 100644
>--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
>+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
>@@ -740,7 +740,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
> 	case e1000_82576:
> 		snprintf(adapter->ptp_caps.name, 16, "%pm", netdev->dev_addr);
> 		adapter->ptp_caps.owner = THIS_MODULE;
>-		adapter->ptp_caps.max_adj = 1000000000;
>+		adapter->ptp_caps.max_adj = 999999881;
> 		adapter->ptp_caps.n_ext_ts = 0;
> 		adapter->ptp_caps.pps = 0;
> 		adapter->ptp_caps.adjfreq = igb_ptp_adjfreq_82576;
>-- 
>1.7.6.5

Good catch on this, Jiri! I know the math works out the same, but I'd
prefer it if you changed the max_adj value to 999999999, since that is
technically what we can accept before we have any issues. If you re-submit
with this change, I'll add my ACK and we can run it through our internal
testing. Thanks!

Matthew

Matthew Vick
Linux Development
Networking Division
Intel Corporation


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply

* Re: [PATCH v2 net-next 1/5] GRE: Refactor GRE tunneling code.
From: Stephen Hemminger @ 2013-03-19 21:21 UTC (permalink / raw)
  To: Pravin B Shelar; +Cc: davem, netdev, jesse
In-Reply-To: <1363630405-1672-1-git-send-email-pshelar@nicira.com>

On Mon, 18 Mar 2013 11:13:25 -0700
Pravin B Shelar <pshelar@nicira.com> wrote:

> Following patch refactors GRE code into ip tunneling code and GRE
> specific code. Common tunneling code is moved to ip_tunnel module.
> ip_tunnel module is written as generic library which can be used
> by different tunneling implementations.
> 
> ip_tunnel module contains following components:
>  - packet xmit and rcv generic code. xmit flow looks like
>    (gre_xmit/ipip_xmit)->ip_tunnel_xmit->ip_local_out.
>  - hash table of all devices.
>  - lookup for tunnel devices.
>  - control plane operations like device create, destroy, ioctl, netlink
>    operations code.
>  - registration for tunneling modules, like gre, ipip etc.
>  - define single pcpu_tstats dev->tstats.
>  - struct tnl_ptk_info added to pass parsed tunnel packet parameters.
> 
> ipip.h header is renamed to ip_tunnel.h
> 
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>

Doesn't build with this patch alone (ie. not bisectable).


  CC [M]  net/ipv6/ip6_gre.o
net/ipv6/ip6_gre.c:41:27: fatal error: net/ip_tunnel.h: No such file or directory
compilation terminated.

^ permalink raw reply

* Re: [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: Ben Hutchings @ 2013-03-19 21:24 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Wei Liu, netdev@vger.kernel.org, xen-devel@lists.xen.org,
	konrad.wilk@oracle.com, annie.li@oracle.com
In-Reply-To: <1363619244.2963.11.camel@zakaz.uk.xensource.com>

On Mon, 2013-03-18 at 15:07 +0000, Ian Campbell wrote:
> On Mon, 2013-03-18 at 15:04 +0000, Wei Liu wrote:
> > On Mon, 2013-03-18 at 14:54 +0000, Ian Campbell wrote:
> > > On Mon, 2013-03-18 at 14:40 +0000, Wei Liu wrote:
> > > > On Mon, 2013-03-18 at 11:42 +0000, Ian Campbell wrote:
> > > > > On Mon, 2013-03-18 at 10:35 +0000, Wei Liu wrote:
> > > > > > The `size' field of Xen network wire format is uint16_t, anything bigger than
> > > > > > 65535 will cause overflow.
> > > > > > 
> > > > > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > > > > > ---
> > > > > >  drivers/net/xen-netfront.c |   12 ++++++++++++
> > > > > >  1 file changed, 12 insertions(+)
> > > > > > 
> > > > > > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> > > > > > index 5527663..8c3d065 100644
> > > > > > --- a/drivers/net/xen-netfront.c
> > > > > > +++ b/drivers/net/xen-netfront.c
> > > > > > @@ -547,6 +547,18 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > > > > >  	unsigned int len = skb_headlen(skb);
> > > > > >  	unsigned long flags;
> > > > > >  
> > > > > > +	/*
> > > > > > +	 * wire format of xen_netif_tx_request only supports skb->len
> > > > > > +	 * < 64K, because size field in xen_netif_tx_request is
> > > > > > +	 * uint16_t.
> > > > > 
> > > > > Is there some field we can set e.g. in struct ethernet_device which
> > > > > would stop this from happening?
> > > > > 
> > > > 
> > > > struct ethernet_device? I could not find it.
> > > > 
> > > > And for struct net_device,
> > > 
> > > I meant struct net_device.
> > > 
> > > >  there is no field for this AFAICT.
> > > 
> > > Interesting. Are hardware devices expected to cope with arbitrary sized
> > > GSO skbs then I wonder.
> > > 
> > 
> > No idea. But there is a macro called GSO_MAX_SIZE (65536) in struct
> > net_device. :-)
> 
> But aren't we seeing skb's bigger than that?
> 
> Maybe this is just a historical bug in some older guests?

GSO_MAX_SIZE is the maximum payload length, not the maximum total length
of an skb.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: Can we rely on ethernet header padding?
From: Stephen Hemminger @ 2013-03-19 21:25 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: Eric Dumazet, netdev, netfilter-devel
In-Reply-To: <20130319154806.GB18218@unicorn.suse.cz>

On Tue, 19 Mar 2013 16:48:06 +0100
Michal Kubecek <mkubecek@suse.cz> wrote:

> On Tue, Mar 19, 2013 at 08:21:35AM -0700, Eric Dumazet wrote:
> > 
> > Normally a driver has NET_SKB_PAD bytes of headroom before the ethernet
> > header, so the bridge code is safe only if all drivers use this
> > NET_SKB_PAD padding on receive side. And they really should for
> > performance reasons.
> > 
> > Better not touch bridge code to catch offending drivers
> 
> That makes sense. Thank you for your reply.
> 

My view is that the bridge code must check before assuming headroom.
But because of that, it means a packet copy would be necessary for cases
where packets arrive without enough headroom.

^ permalink raw reply

* Re: [PATCH v2 net-next 1/5] GRE: Refactor GRE tunneling code.
From: David Miller @ 2013-03-19 21:26 UTC (permalink / raw)
  To: stephen; +Cc: pshelar, netdev, jesse
In-Reply-To: <20130319142141.5d32cae2@nehalam.linuxnetplumber.net>

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 19 Mar 2013 14:21:41 -0700

> Doesn't build with this patch alone (ie. not bisectable).
> 
>   CC [M]  net/ipv6/ip6_gre.o
> net/ipv6/ip6_gre.c:41:27: fatal error: net/ip_tunnel.h: No such file or directory
> compilation terminated.

Oh well, too late, it's all already in my tree.

^ permalink raw reply

* Re: [PATCH 2/4] xen-netfront: drop skb when skb->len > 65535
From: Ben Hutchings @ 2013-03-19 21:28 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Wei Liu, netdev@vger.kernel.org, xen-devel@lists.xen.org,
	konrad.wilk@oracle.com, annie.li@oracle.com
In-Reply-To: <1363728289.31336.7.camel@deadeye.wl.decadent.org.uk>

On Tue, 2013-03-19 at 21:24 +0000, Ben Hutchings wrote:
> On Mon, 2013-03-18 at 15:07 +0000, Ian Campbell wrote:
> > On Mon, 2013-03-18 at 15:04 +0000, Wei Liu wrote:
> > > On Mon, 2013-03-18 at 14:54 +0000, Ian Campbell wrote:
> > > > On Mon, 2013-03-18 at 14:40 +0000, Wei Liu wrote:
> > > > > On Mon, 2013-03-18 at 11:42 +0000, Ian Campbell wrote:
> > > > > > On Mon, 2013-03-18 at 10:35 +0000, Wei Liu wrote:
> > > > > > > The `size' field of Xen network wire format is uint16_t, anything bigger than
> > > > > > > 65535 will cause overflow.
> > > > > > > 
> > > > > > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > > > > > > ---
> > > > > > >  drivers/net/xen-netfront.c |   12 ++++++++++++
> > > > > > >  1 file changed, 12 insertions(+)
> > > > > > > 
> > > > > > > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> > > > > > > index 5527663..8c3d065 100644
> > > > > > > --- a/drivers/net/xen-netfront.c
> > > > > > > +++ b/drivers/net/xen-netfront.c
> > > > > > > @@ -547,6 +547,18 @@ static int xennet_start_xmit(struct sk_buff *skb, struct net_device *dev)
> > > > > > >  	unsigned int len = skb_headlen(skb);
> > > > > > >  	unsigned long flags;
> > > > > > >  
> > > > > > > +	/*
> > > > > > > +	 * wire format of xen_netif_tx_request only supports skb->len
> > > > > > > +	 * < 64K, because size field in xen_netif_tx_request is
> > > > > > > +	 * uint16_t.
> > > > > > 
> > > > > > Is there some field we can set e.g. in struct ethernet_device which
> > > > > > would stop this from happening?
> > > > > > 
> > > > > 
> > > > > struct ethernet_device? I could not find it.
> > > > > 
> > > > > And for struct net_device,
> > > > 
> > > > I meant struct net_device.
> > > > 
> > > > >  there is no field for this AFAICT.
> > > > 
> > > > Interesting. Are hardware devices expected to cope with arbitrary sized
> > > > GSO skbs then I wonder.
> > > > 
> > > 
> > > No idea. But there is a macro called GSO_MAX_SIZE (65536) in struct
> > > net_device. :-)
> > 
> > But aren't we seeing skb's bigger than that?
> > 
> > Maybe this is just a historical bug in some older guests?
> 
> GSO_MAX_SIZE is the maximum payload length, not the maximum total length
> of an skb.

...and it's actually just the default value assigned to
dev->gso_max_size.  You'll want to change it to your actual maximum
(65535 - maximum length of headers) before registering your net devices.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [PATCH net-next v3] packet: packet fanout rollover during socket overload
From: Willem de Bruijn @ 2013-03-19 21:34 UTC (permalink / raw)
  To: David Miller; +Cc: Eric Dumazet, netdev
In-Reply-To: <20130319.171631.896160775901462168.davem@davemloft.net>

On Tue, Mar 19, 2013 at 5:16 PM, David Miller <davem@davemloft.net> wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 19 Mar 2013 13:37:17 -0700
>
>> On Tue, 2013-03-19 at 16:18 -0400, Willem de Bruijn wrote:
>>> Changes:
>>>   v3->v2: rebase (no other changes)
>>>           passes selftest
>>>   v2->v1: read f->num_members only once
>>>           fix bug: test rollover mode + flag
>  ...
>>> Signed-off-by: Willem de Bruijn <willemb@google.com>
>  ...
>> Reviewed-by: Eric Dumazet <edumazet@google.com>
>
> Applied, and I added the selftest too

Thanks!

>, but it fails for me on my
> 128-cpu sparc64 machine:
>
> make[1]: Entering directory `/home/davem/src/GIT/net-next/tools/testing/selftests/net-afpacket'
> --------------------
> running psock_fanout test
> --------------------
> test: control single socket
> test: control multiple sockets
> test: datapath 0x0
> info: count=0,0, expect=0,0
> info: count=0,20, expect=15,5
> ERROR: incorrect queue lengths

I'm looking into it. The test needs the packet sockets to be able to
hold an exact number of test packets and then overflow. Queue
length configured in bytes (SO_RCVBUF) was arrived at by
experimentation. My best hunch so far is that this differs between
platforms/nic, if skb->truesize does. If queue length is the problem,
I'll switch to a packet ring. Booting another machine right now.

> [FAIL]

^ permalink raw reply

* [PATCH] dynticks: avoid flow_cache_flush() interrupting every core
From: Chris Metcalf @ 2013-03-19 21:35 UTC (permalink / raw)
  To: netdev, linux-kernel, Frederic Weisbecker, Gilad Ben Yossef,
	David S. Miller, Sasha Levin, Andrew Morton, Paul E. McKenney,
	YOSHIFUJI Hideaki

Previously, if you did an "ifconfig down" or similar on one core, and
the kernel had CONFIG_XFRM enabled, every core would be interrupted to
check its percpu flow list for items that could be garbage collected.

With this change, we generate a mask of cores that actually have any
percpu items, and only interrupt those cores.  When we are trying to
isolate a set of cpus from interrupts, this is important to do.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
---
This change stands alone so could be taken into the net tree if
desired, but it is most useful in the context of Frederic Weisbecker's
linux-dynticks work.  So it could be taken up through either tree,
but it certainly needs sign-off from someone familiar with net/core/flow.c.

 net/core/flow.c |   42 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)

diff --git a/net/core/flow.c b/net/core/flow.c
index c56ea6f..7fae135 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -323,6 +323,24 @@ static void flow_cache_flush_tasklet(unsigned long data)
 		complete(&info->completion);
 }
 
+/*
+ * Return whether a cpu needs flushing.  Conservatively, we assume
+ * the presence of any entries means the core may require flushing,
+ * since the flow_cache_ops.check() function may assume it's running
+ * on the same core as the per-cpu cache component.
+ */
+static int flow_cache_percpu_empty(struct flow_cache *fc, int cpu)
+{
+	struct flow_cache_percpu *fcp;
+	int i;
+
+	fcp = &per_cpu(*fc->percpu, cpu);
+	for (i = 0; i < flow_cache_hash_size(fc); i++)
+		if (!hlist_empty(&fcp->hash_table[i]))
+			return 0;
+	return 1;
+}
+
 static void flow_cache_flush_per_cpu(void *data)
 {
 	struct flow_flush_info *info = data;
@@ -337,22 +355,40 @@ void flow_cache_flush(void)
 {
 	struct flow_flush_info info;
 	static DEFINE_MUTEX(flow_flush_sem);
+	cpumask_var_t mask;
+	int i, self;
+
+	/* Track which cpus need flushing to avoid disturbing all cores. */
+	if (!alloc_cpumask_var(&mask, GFP_KERNEL))
+		return;
+	cpumask_clear(mask);
 
 	/* Don't want cpus going down or up during this. */
 	get_online_cpus();
 	mutex_lock(&flow_flush_sem);
 	info.cache = &flow_cache_global;
-	atomic_set(&info.cpuleft, num_online_cpus());
+	for_each_online_cpu(i)
+		if (!flow_cache_percpu_empty(info.cache, i))
+			cpumask_set_cpu(i, mask);
+	atomic_set(&info.cpuleft, cpumask_weight(mask));
+	if (atomic_read(&info.cpuleft) == 0)
+		goto done;
+
 	init_completion(&info.completion);
 
 	local_bh_disable();
-	smp_call_function(flow_cache_flush_per_cpu, &info, 0);
-	flow_cache_flush_tasklet((unsigned long)&info);
+	self = cpumask_test_and_clear_cpu(smp_processor_id(), mask);
+	on_each_cpu_mask(mask, flow_cache_flush_per_cpu, &info, 0);
+	if (self)
+		flow_cache_flush_tasklet((unsigned long)&info);
 	local_bh_enable();
 
 	wait_for_completion(&info.completion);
+
+done:
 	mutex_unlock(&flow_flush_sem);
 	put_online_cpus();
+	free_cpumask_var(mask);
 }
 
 static void flow_cache_flush_task(struct work_struct *work)
-- 
1.7.10.3

^ permalink raw reply related

* Re: [PATCH v2 net-next 1/5] GRE: Refactor GRE tunneling code.
From: Pravin Shelar @ 2013-03-19 21:38 UTC (permalink / raw)
  To: David Miller; +Cc: stephen, netdev, jesse
In-Reply-To: <20130319.172645.2081434694692631052.davem@davemloft.net>

On Tue, Mar 19, 2013 at 2:26 PM, David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Tue, 19 Mar 2013 14:21:41 -0700
>
>> Doesn't build with this patch alone (ie. not bisectable).
>>
>>   CC [M]  net/ipv6/ip6_gre.o
>> net/ipv6/ip6_gre.c:41:27: fatal error: net/ip_tunnel.h: No such file or directory
>> compilation terminated.
>
> Oh well, too late, it's all already in my tree.

sorry about that.
I am sending update patch soon.

^ permalink raw reply

* Re: [PATCH v2 net-next 1/5] GRE: Refactor GRE tunneling code.
From: David Miller @ 2013-03-19 21:56 UTC (permalink / raw)
  To: pshelar; +Cc: stephen, netdev, jesse
In-Reply-To: <CALnjE+ryZpcfev4xDQ8dcnrxFqXFjjxvnnxN_dU35gu_KEk86g@mail.gmail.com>

From: Pravin Shelar <pshelar@nicira.com>
Date: Tue, 19 Mar 2013 14:38:11 -0700

> On Tue, Mar 19, 2013 at 2:26 PM, David Miller <davem@davemloft.net> wrote:
>> From: Stephen Hemminger <stephen@networkplumber.org>
>> Date: Tue, 19 Mar 2013 14:21:41 -0700
>>
>>> Doesn't build with this patch alone (ie. not bisectable).
>>>
>>>   CC [M]  net/ipv6/ip6_gre.o
>>> net/ipv6/ip6_gre.c:41:27: fatal error: net/ip_tunnel.h: No such file or directory
>>> compilation terminated.
>>
>> Oh well, too late, it's all already in my tree.
> 
> sorry about that.
> I am sending update patch soon.

There is nothing for you to send, what's in my tree is not changing.

^ permalink raw reply

* [PATCH net-next] packet: Fix compile error
From: Daniel Baluta @ 2013-03-19 22:01 UTC (permalink / raw)
  To: willemb, edumazet, davem, netdev; +Cc: Daniel Baluta

PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
<tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
as one would expect. This causes the following compilation error:
<snip>
psock_fanout.c: In function ‘test_control_single’:
psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
</snip>

Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
---
 .../testing/selftests/net-afpacket/psock_fanout.c  |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net-afpacket/psock_fanout.c b/tools/testing/selftests/net-afpacket/psock_fanout.c
index 09dbf93..c827415 100644
--- a/tools/testing/selftests/net-afpacket/psock_fanout.c
+++ b/tools/testing/selftests/net-afpacket/psock_fanout.c
@@ -63,6 +63,7 @@
 #define PACKET_FANOUT_LB		1
 #define PACKET_FANOUT_CPU		2
 #define PACKET_FANOUT_FLAG_DEFRAG	0x8000
+#endif
 
 #ifndef PACKET_FANOUT_ROLLOVER
 #define PACKET_FANOUT_ROLLOVER		3
@@ -72,8 +73,6 @@
 #define PACKET_FANOUT_FLAG_ROLLOVER	0x1000
 #endif
 
-#endif
-
 #define DATA_LEN			100
 #define DATA_CHAR			'a'
 
-- 
1.7.5.4

^ permalink raw reply related


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