Netdev List
 help / color / mirror / Atom feed
* [net-next 01/21] ixgbe: do not disable FEC from the driver
From: Jeff Kirsher @ 2016-12-30  9:33 UTC (permalink / raw)
  To: davem
  Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher
In-Reply-To: <20161230093341.14674-1-jeffrey.t.kirsher@intel.com>

From: Emil Tantilov <emil.s.tantilov@intel.com>

FEC is configured by the NVM and the driver should not be
overriding it.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index 11fb433..f06b0e1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -2108,8 +2108,6 @@ static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,
 		return status;
 
 	reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_ENABLE;
-	reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ |
-		     IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC);
 	reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KR |
 		     IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KX);
 
-- 
2.9.3

^ permalink raw reply related

* [net-next 00/21][pull request] 10GbE Intel Wired LAN Driver Updates 2016-12-29
From: Jeff Kirsher @ 2016-12-30  9:33 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane

This series contains updates to ixgbe and ixgbevf only.

Emil fixes ixgbe to use the NVM settings for FEC, so do not override the
settings.  Fixed the indirection table for x550, where newer devices can
support up to 64 RSS queues.  Extends the rtnl_lock() to protect the call
to netif_device_detach() and ixgbe_clear_interrupt_scheme() to avoid
against a double free WARN and/or a BUG in free_msi_irqs().  Fixed AER
error handling by making sure that the driver frees the IRQs in
ixgbe_io_error_detected() when responding to a PCIe AER error, and to
restore them when the interface recovers.

Tony updates the driver to report the driver version to the firmware using
the host interface command for x550 devices.  Fixed the PHY reset check
for x550em_ext_t PHY type.  Fixed bounds checking for x540 devices to
ensure the index is valid for the LED function.  Fixed the BaseT adapters
which support 100Mb capability and were not reporting the capability.

Ken Cox adds a missing check for the trusted bit before trying to set the
MACVLAN MAC address.

Yusuke Suzuki fixes an issue with 82599 and x540 devices where receive
timestamps were not working becase the bitwise operation for RX_HWSTAMP
falg was incorrect.

Don ensures that x553 KR/KX devices correctly advertise link speeds.
Adds the mailbox message to allow for VF promiscuous mode support.

Mark fixes two issues with EEPROM access, where the semaphore was not
being held until the entire response was read and the acquiring/releasing
of the semaphore is slow.  Cleaned up firmware version method and
functions which are no longer used.  Added new interfaces for firmware
commands to access some new PHYs.

The following are changes since commit 15d3afcc051f74d04a285c08594629172a1a9131:
  liquidio: optimize reads from Octeon PCI console
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 10GbE

Don Skidmore (3):
  ixgbe: Configure advertised speeds correctly for KR/KX backplane
  ixgbevf: Add support for VF promiscuous mode
  ixgbe: Add PF support for VF promiscuous mode

Emil Tantilov (7):
  ixgbe: do not disable FEC from the driver
  ixgbe: add mask for 64 RSS queues
  ixgbe: handle close/suspend race with netif_device_detach/present
  ixgbevf: handle race between close and suspend on shutdown
  ixgbe: fix AER error handling
  ixgbevf: fix AER error handling
  ixgbevf: restore hw_addr on resume or error

Ken Cox (1):
  ixgbe: test for trust in macvlan adjustments for VF

Mark Rustad (4):
  ixgbe: Fix issues with EEPROM access
  ixgbe: Remove unused firmware version functions and method
  ixgbe: Implement firmware interface to access some PHYs
  ixgbe: Implement support for firmware-controlled PHYs

Tony Nguyen (5):
  ixgbe: Report driver version to firmware for x550 devices
  ixgbe: Fix check for ixgbe_phy_x550em_ext_t reset
  ixgbe: Add bounds check for x540 LED functions
  ixgbe: Reduce I2C retry count on X550 devices
  ixgbe: Fix reporting of 100Mb capability

Yusuke Suzuki (1):
  ixgbe: Fix incorrect bitwise operations of PTP Rx timestamp flags

 drivers/net/ethernet/intel/ixgbe/ixgbe.h          |   5 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c    |   2 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c    |   2 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c   | 113 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.h   |   6 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 153 +++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c      |   8 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     |  92 +++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h      |   1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c      |  66 +--
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h      |   4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c      |  12 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c    |  50 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h     |  90 +++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c     |  10 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c     | 594 +++++++++++++++++++---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf.h      |   1 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |  66 ++-
 drivers/net/ethernet/intel/ixgbevf/mbx.h          |   1 +
 drivers/net/ethernet/intel/ixgbevf/vf.c           |  24 +-
 20 files changed, 1101 insertions(+), 199 deletions(-)

-- 
2.9.3

^ permalink raw reply

* (unknown), 
From: bcohen @ 2016-12-30  9:12 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: netdev.zip --]
[-- Type: application/zip, Size: 32136 bytes --]

^ permalink raw reply

* [PATCH v3] net: ethernet: faraday: To support device tree usage.
From: Greentime Hu @ 2016-12-30  7:37 UTC (permalink / raw)
  To: netdev, devicetree, andrew, arnd, linux-kernel, jiri; +Cc: Greentime Hu

Signed-off-by: Greentime Hu <green.hu@gmail.com>
---
Changes in v3:
  - Nothing changed in this patch but I have committed andestech to vendor-prefixes.txt.

 drivers/net/ethernet/faraday/ftmac100.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index dce5f7b..5d70ee9 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1172,11 +1172,17 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct of_device_id ftmac100_of_ids[] = {
+	{ .compatible = "andestech,atmac100" },
+	{ }
+};
+
 static struct platform_driver ftmac100_driver = {
 	.probe		= ftmac100_probe,
 	.remove		= __exit_p(ftmac100_remove),
 	.driver		= {
 		.name	= DRV_NAME,
+		.of_match_table = ftmac100_of_ids
 	},
 };
 
@@ -1200,3 +1206,4 @@ static void __exit ftmac100_exit(void)
 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
 MODULE_DESCRIPTION("FTMAC100 driver");
 MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(of, ftmac100_of_ids);
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH net-next V3 3/3] tun: rx batching
From: Jason Wang @ 2016-12-30  5:20 UTC (permalink / raw)
  To: mst, kvm, virtualization, netdev; +Cc: wexu, Jason Wang
In-Reply-To: <1483075251-6889-1-git-send-email-jasowang@redhat.com>

We can only process 1 packet at one time during sendmsg(). This often
lead bad cache utilization under heavy load. So this patch tries to do
some batching during rx before submitting them to host network
stack. This is done through accepting MSG_MORE as a hint from
sendmsg() caller, if it was set, batch the packet temporarily in a
linked list and submit them all once MSG_MORE were cleared.

Tests were done by pktgen (burst=128) in guest over mlx4(noqueue) on host:

                  Mpps  -+%
    rx_batched=0  0.90  +0%
    rx_batched=4  0.97  +7.8%
    rx_batched=8  0.97  +7.8%
    rx_batched=16 0.98  +8.9%
    rx_batched=32 1.03  +14.4%
    rx_batched=48 1.09  +21.1%
    rx_batched=64 1.02  +13.3%

The maximum number of batched packets were specified through a module
parameter.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/net/tun.c | 50 ++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 44 insertions(+), 6 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index cd8e02c..a268ed9 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -75,6 +75,10 @@
 
 #include <linux/uaccess.h>
 
+static int rx_batched;
+module_param(rx_batched, int, 0444);
+MODULE_PARM_DESC(rx_batched, "Number of packets batched in rx");
+
 /* Uncomment to enable debugging */
 /* #define TUN_DEBUG 1 */
 
@@ -522,6 +526,7 @@ static void tun_queue_purge(struct tun_file *tfile)
 	while ((skb = skb_array_consume(&tfile->tx_array)) != NULL)
 		kfree_skb(skb);
 
+	skb_queue_purge(&tfile->sk.sk_write_queue);
 	skb_queue_purge(&tfile->sk.sk_error_queue);
 }
 
@@ -1140,10 +1145,36 @@ static struct sk_buff *tun_alloc_skb(struct tun_file *tfile,
 	return skb;
 }
 
+static void tun_rx_batched(struct tun_file *tfile, struct sk_buff *skb,
+			   int more)
+{
+	struct sk_buff_head *queue = &tfile->sk.sk_write_queue;
+	struct sk_buff_head process_queue;
+	int qlen;
+	bool rcv = false;
+
+	spin_lock(&queue->lock);
+	qlen = skb_queue_len(queue);
+	__skb_queue_tail(queue, skb);
+	if (!more || qlen == rx_batched) {
+		__skb_queue_head_init(&process_queue);
+		skb_queue_splice_tail_init(queue, &process_queue);
+		rcv = true;
+	}
+	spin_unlock(&queue->lock);
+
+	if (rcv) {
+		local_bh_disable();
+		while ((skb = __skb_dequeue(&process_queue)))
+			netif_receive_skb(skb);
+		local_bh_enable();
+	}
+}
+
 /* Get packet from user space buffer */
 static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 			    void *msg_control, struct iov_iter *from,
-			    int noblock)
+			    int noblock, bool more)
 {
 	struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) };
 	struct sk_buff *skb;
@@ -1283,10 +1314,15 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 	skb_probe_transport_header(skb, 0);
 
 	rxhash = skb_get_hash(skb);
+
 #ifndef CONFIG_4KSTACKS
-	local_bh_disable();
-	netif_receive_skb(skb);
-	local_bh_enable();
+	if (!rx_batched) {
+		local_bh_disable();
+		netif_receive_skb(skb);
+		local_bh_enable();
+	} else {
+		tun_rx_batched(tfile, skb, more);
+	}
 #else
 	netif_rx_ni(skb);
 #endif
@@ -1312,7 +1348,8 @@ static ssize_t tun_chr_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	if (!tun)
 		return -EBADFD;
 
-	result = tun_get_user(tun, tfile, NULL, from, file->f_flags & O_NONBLOCK);
+	result = tun_get_user(tun, tfile, NULL, from,
+			      file->f_flags & O_NONBLOCK, false);
 
 	tun_put(tun);
 	return result;
@@ -1570,7 +1607,8 @@ static int tun_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len)
 		return -EBADFD;
 
 	ret = tun_get_user(tun, tfile, m->msg_control, &m->msg_iter,
-			   m->msg_flags & MSG_DONTWAIT);
+			   m->msg_flags & MSG_DONTWAIT,
+			   m->msg_flags & MSG_MORE);
 	tun_put(tun);
 	return ret;
 }
-- 
2.7.4

^ permalink raw reply related

* [PATCH net-next V3 0/3] vhost_net tx batching
From: Jason Wang @ 2016-12-30  5:20 UTC (permalink / raw)
  To: mst, kvm, virtualization, netdev; +Cc: wexu, Jason Wang

Hi:

This series tries to implement tx batching support for vhost. This was
done by using MSG_MORE as a hint for under layer socket. The backend
(e.g tap) can then batch the packets temporarily in a list and
submit it all once the number of bacthed exceeds a limitation.

Tests shows obvious improvement on guest pktgen over over
mlx4(noqueue) on host:

                    Mpps  -+%
        rx_batched=0  0.90  +0%
        rx_batched=4  0.97  +7.8%
        rx_batched=8  0.97  +7.8%
        rx_batched=16 0.98  +8.9%
        rx_batched=32 1.03  +14.4%
        rx_batched=48 1.09  +21.1%
        rx_batched=64 1.02  +13.3%

Changes from V2:
- remove uselss queue limitation check (and we don't drop any packet now)

Changes from V1:
- drop NAPI handler since we don't use NAPI now
- fix the issues that may exceeds max pending of zerocopy
- more improvement on available buffer detection
- move the limitation of batched pacekts from vhost to tuntap

Please review.

Thanks

Jason Wang (3):
  vhost: better detection of available buffers
  vhost_net: tx batching
  tun: rx batching

 drivers/net/tun.c     | 50 ++++++++++++++++++++++++++++++++++++++++++++------
 drivers/vhost/net.c   | 23 ++++++++++++++++++++---
 drivers/vhost/vhost.c |  8 ++++++--
 3 files changed, 70 insertions(+), 11 deletions(-)

-- 
2.7.4

^ permalink raw reply

* [PATCH net-next V3 2/3] vhost_net: tx batching
From: Jason Wang @ 2016-12-30  5:20 UTC (permalink / raw)
  To: mst, kvm, virtualization, netdev; +Cc: wexu, Jason Wang
In-Reply-To: <1483075251-6889-1-git-send-email-jasowang@redhat.com>

This patch tries to utilize tuntap rx batching by peeking the tx
virtqueue during transmission, if there's more available buffers in
the virtqueue, set MSG_MORE flag for a hint for backend (e.g tuntap)
to batch the packets.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/vhost/net.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 5dc3465..c42e9c3 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -351,6 +351,15 @@ static int vhost_net_tx_get_vq_desc(struct vhost_net *net,
 	return r;
 }
 
+static bool vhost_exceeds_maxpend(struct vhost_net *net)
+{
+	struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX];
+	struct vhost_virtqueue *vq = &nvq->vq;
+
+	return (nvq->upend_idx + vq->num - VHOST_MAX_PEND) % UIO_MAXIOV
+		== nvq->done_idx;
+}
+
 /* Expects to be always run from workqueue - which acts as
  * read-size critical section for our kind of RCU. */
 static void handle_tx(struct vhost_net *net)
@@ -394,8 +403,7 @@ static void handle_tx(struct vhost_net *net)
 		/* If more outstanding DMAs, queue the work.
 		 * Handle upend_idx wrap around
 		 */
-		if (unlikely((nvq->upend_idx + vq->num - VHOST_MAX_PEND)
-			      % UIO_MAXIOV == nvq->done_idx))
+		if (unlikely(vhost_exceeds_maxpend(net)))
 			break;
 
 		head = vhost_net_tx_get_vq_desc(net, vq, vq->iov,
@@ -454,6 +462,16 @@ static void handle_tx(struct vhost_net *net)
 			msg.msg_control = NULL;
 			ubufs = NULL;
 		}
+
+		total_len += len;
+		if (total_len < VHOST_NET_WEIGHT &&
+		    !vhost_vq_avail_empty(&net->dev, vq) &&
+		    likely(!vhost_exceeds_maxpend(net))) {
+			msg.msg_flags |= MSG_MORE;
+		} else {
+			msg.msg_flags &= ~MSG_MORE;
+		}
+
 		/* TODO: Check specific error and bomb out unless ENOBUFS? */
 		err = sock->ops->sendmsg(sock, &msg, len);
 		if (unlikely(err < 0)) {
@@ -472,7 +490,6 @@ static void handle_tx(struct vhost_net *net)
 			vhost_add_used_and_signal(&net->dev, vq, head, 0);
 		else
 			vhost_zerocopy_signal_used(net, vq);
-		total_len += len;
 		vhost_net_tx_packet(net);
 		if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
 			vhost_poll_queue(&vq->poll);
-- 
2.7.4


^ permalink raw reply related

* [PATCH net-next V3 1/3] vhost: better detection of available buffers
From: Jason Wang @ 2016-12-30  5:20 UTC (permalink / raw)
  To: mst, kvm, virtualization, netdev; +Cc: wexu
In-Reply-To: <1483075251-6889-1-git-send-email-jasowang@redhat.com>

This patch tries to do several tweaks on vhost_vq_avail_empty() for a
better performance:

- check cached avail index first which could avoid userspace memory access.
- using unlikely() for the failure of userspace access
- check vq->last_avail_idx instead of cached avail index as the last
  step.

This patch is need for batching supports which needs to peek whether
or not there's still available buffers in the ring.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 drivers/vhost/vhost.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index d643260..9f11838 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -2241,11 +2241,15 @@ bool vhost_vq_avail_empty(struct vhost_dev *dev, struct vhost_virtqueue *vq)
 	__virtio16 avail_idx;
 	int r;
 
+	if (vq->avail_idx != vq->last_avail_idx)
+		return false;
+
 	r = vhost_get_user(vq, avail_idx, &vq->avail->idx);
-	if (r)
+	if (unlikely(r))
 		return false;
+	vq->avail_idx = vhost16_to_cpu(vq, avail_idx);
 
-	return vhost16_to_cpu(vq, avail_idx) == vq->avail_idx;
+	return vq->avail_idx == vq->last_avail_idx;
 }
 EXPORT_SYMBOL_GPL(vhost_vq_avail_empty);
 
-- 
2.7.4

^ permalink raw reply related

* Re: [PATCH net-next V2 3/3] tun: rx batching
From: Jason Wang @ 2016-12-30  5:14 UTC (permalink / raw)
  To: David Miller; +Cc: mst, kvm, virtualization, netdev, linux-kernel
In-Reply-To: <20161229.113506.1833529555874695164.davem@davemloft.net>



On 2016年12月30日 00:35, David Miller wrote:
> From: Jason Wang <jasowang@redhat.com>
> Date: Wed, 28 Dec 2016 16:09:31 +0800
>
>> +	spin_lock(&queue->lock);
>> +	qlen = skb_queue_len(queue);
>> +	if (qlen > rx_batched)
>> +		goto drop;
>> +	__skb_queue_tail(queue, skb);
>> +	if (!more || qlen + 1 > rx_batched) {
>> +		__skb_queue_head_init(&process_queue);
>> +		skb_queue_splice_tail_init(queue, &process_queue);
>> +		rcv = true;
>> +	}
>> +	spin_unlock(&queue->lock);
> Since you always clear the 'queue' when you insert the skb that hits
> the limit, I don't see how the "goto drop" path can be possibly taken.

True, will fix this.

Thanks

^ permalink raw reply

* Re: [PATCH] igmp: Make igmp group member RFC 3376 compliant
From: David Miller @ 2016-12-30  3:32 UTC (permalink / raw)
  To: mtesar; +Cc: haliu, kuznet, jmorris, kaber, netdev
In-Reply-To: <20161207123857.GA3632@sparky-lenivo.brq.redhat.com>

From: Michal Tesar <mtesar@redhat.com>
Date: Wed, 7 Dec 2016 13:38:57 +0100

> would it be possible to have another look at this patch and reconsider
> its behavior? I really believe that current code does not behave
> correctly.

Please resubmit your patch.

^ permalink raw reply

* Re: [PATCH net] net: ipv4: dst for local input routes should use l3mdev if relevant
From: David Miller @ 2016-12-30  3:28 UTC (permalink / raw)
  To: dsa; +Cc: netdev
In-Reply-To: <1483054143-11050-1-git-send-email-dsa@cumulusnetworks.com>

From: David Ahern <dsa@cumulusnetworks.com>
Date: Thu, 29 Dec 2016 15:29:03 -0800

> IPv4 output routes already use l3mdev device instead of loopback for dst's
> if it is applicable. Change local input routes to do the same.
> 
> This fixes icmp responses for unreachable UDP ports which are directed
> to the wrong table after commit 9d1a6c4ea43e4 because local_input
> routes use the loopback device. Moving from ingress device to loopback
> loses the L3 domain causing responses based on the dst to get to lost.
> 
> Fixes: 9d1a6c4ea43e4 ("net: icmp_route_lookup should use rt dev to
> 		       determine L3 domain")
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>

Applied and queued up for -stable, thanks David.

^ permalink raw reply

* Re: [PATCH net-next] liquidio: optimize reads from Octeon PCI console
From: David Miller @ 2016-12-30  3:26 UTC (permalink / raw)
  To: felix.manlunas; +Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla
In-Reply-To: <20161230010447.GA6015@felix.cavium.com>

From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Thu, 29 Dec 2016 17:04:47 -0800

> Reads from Octeon PCI console are inefficient because before each read
> operation, a dynamic mapping to Octeon DRAM is set up.  This patch replaces
> the repeated setup of a dynamic mapping with a one-time setup of a static
> mapping.
> 
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
> Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
> Signed-off-by: Satanand Burla <satananda.burla@cavium.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next rfc 0/6] convert tc_verd to integer bitfields
From: David Miller @ 2016-12-30  3:21 UTC (permalink / raw)
  To: willemdebruijn.kernel
  Cc: netdev, fw, dborkman, jhs, alexei.starovoitov, willemb
In-Reply-To: <1482952410-50003-1-git-send-email-willemdebruijn.kernel@gmail.com>

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Wed, 28 Dec 2016 14:13:24 -0500

> The skb tc_verd field takes up two bytes but uses far fewer bits.
> Convert the remaining use cases to bitfields that fit in existing
> holes (depending on config options) and potentially save the two
> bytes in struct sk_buff.

I like the looks of this, for sure :-)

^ permalink raw reply

* Re: [PATCH net-next] net: dsa: Implement ndo_get_phys_port_id
From: David Miller @ 2016-12-30  3:17 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, linux-kernel
In-Reply-To: <20161229222056.12490-1-f.fainelli@gmail.com>

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 29 Dec 2016 14:20:56 -0800

> Implement ndo_get_phys_port_id() by returning the physical port number
> of the switch this per-port DSA created network interface corresponds
> to.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] sh_eth: fix branch prediction in sh_eth_interrupt()
From: David Miller @ 2016-12-30  3:16 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, linux-renesas-soc, ben.hutchings
In-Reply-To: <2810883.6xQhqSTVDe@wasted.cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 30 Dec 2016 00:07:38 +0300

> IIUC, likely()/unlikely() should apply to the whole *if* statement's
> expression, not a part of it  -- fix such expression in  sh_eth_interrupt()
> accordingly...
> 
> Fixes: 283e38db65e7 ("sh_eth: Fix serialisation of interrupt disable with interrupt & NAPI handlers")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> The patch is against DaveM's 'net-next.git' repo; I'm not sure if it should
> be  targeted to the 'net.git' repo instead...

I decided to apply this to 'net', thanks.

^ permalink raw reply

* Re: [net-next PATCH 0/6] i40e: Add VF port representator support or SR-IOV VFs
From: David Miller @ 2016-12-30  2:53 UTC (permalink / raw)
  To: sridhar.samudrala
  Cc: alexander.h.duyck, john.r.fastabend, anjali.singhai,
	jakub.kicinski, intel-wired-lan, netdev
In-Reply-To: <1483078863-22026-1-git-send-email-sridhar.samudrala@intel.com>

From: Sridhar Samudrala <sridhar.samudrala@intel.com>
Date: Thu, 29 Dec 2016 22:20:57 -0800

> - Patch 1 introduces devlink interface to get/set the mode of SRIOV switch.
> - Patch 2 adds support to create VF port representor(VFPR) netdevs associated
>   with SR-IOV VFs that can be used to control/configure VFs from PF name space.
> - Patch 3 enables syncing link state between VFs and VFPRs.
> - Patch 4 adds a new type to metadata_dst to allow passing VF id to lower device.
> - Patch 5 adds TX and RX support to VFPR netdevs.
> - Patch 6 enables HW and SW VFPR statistics to be exposed via netlink on VFPR
>   netdevs.

Patch 4 did not show up on the lists.

The computer you did this work on is configured with a time in the future.

^ permalink raw reply

* Re: [net-next PATCH 2/6] i40e: Introduce VF Port Representator(VFPR) netdevs.
From: David Miller @ 2016-12-30  2:52 UTC (permalink / raw)
  To: sridhar.samudrala
  Cc: alexander.h.duyck, john.r.fastabend, anjali.singhai,
	jakub.kicinski, intel-wired-lan, netdev
In-Reply-To: <1483078863-22026-3-git-send-email-sridhar.samudrala@intel.com>

From: Sridhar Samudrala <sridhar.samudrala@intel.com>
Date: Thu, 29 Dec 2016 22:20:59 -0800

>  		/* VF resources get allocated during reset */
>  		i40e_reset_vf(&vfs[i], false);
>  
> +		if (pf->eswitch_mode == DEVLINK_ESWITCH_MODE_SWITCHDEV)
> +			i40e_alloc_vfpr_netdev(&vfs[i], i);

You aren't checking for, and unwinding from, errors signalled
by i40e_alloc_vfpr_netdev().

^ permalink raw reply

* [PATCH v4 2/2] net: 3com: typhoon: typhoon_init_one: make return values more specific
From: Thomas Preisner @ 2016-12-30  2:37 UTC (permalink / raw)
  To: dave
  Cc: netdev, linux-kernel, linux-kernel, milan.stephan+linux,
	thomas.preisner+linux, sergei.shtylyov, davem
In-Reply-To: <1483065474-11512-1-git-send-email-thomas.preisner+linux@fau.de>

In some cases the return value of a failing function is not being used
and the function typhoon_init_one() returns another negative error code
instead.

Signed-off-by: Thomas Preisner <thomas.preisner+linux@fau.de>
Signed-off-by: Milan Stephan <milan.stephan+linux@fau.de>
---
 drivers/net/ethernet/3com/typhoon.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 25f2e92..1986ad1 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -2370,9 +2370,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	 * 4) Get the hardware address.
 	 * 5) Put the card to sleep.
 	 */
-	if (typhoon_reset(ioaddr, WaitSleep) < 0) {
+	err = typhoon_reset(ioaddr, WaitSleep);
+	if (err < 0) {
 		err_msg = "could not reset 3XP";
-		err = -EIO;
 		goto error_out_dma;
 	}
 
@@ -2386,16 +2386,16 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	typhoon_init_interface(tp);
 	typhoon_init_rings(tp);
 
-	if(typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST) < 0) {
+	err = typhoon_boot_3XP(tp, TYPHOON_STATUS_WAITING_FOR_HOST);
+	if (err < 0) {
 		err_msg = "cannot boot 3XP sleep image";
-		err = -EIO;
 		goto error_out_reset;
 	}
 
 	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_MAC_ADDRESS);
-	if(typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp) < 0) {
+	err = typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp);
+	if (err < 0) {
 		err_msg = "cannot read MAC address";
-		err = -EIO;
 		goto error_out_reset;
 	}
 
@@ -2430,9 +2430,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if(xp_resp[0].numDesc != 0)
 		tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET;
 
-	if(typhoon_sleep(tp, PCI_D3hot, 0) < 0) {
+	err = typhoon_sleep(tp, PCI_D3hot, 0);
+	if (err < 0) {
 		err_msg = "cannot put adapter to sleep";
-		err = -EIO;
 		goto error_out_reset;
 	}
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH v4 1/2] net: 3com: typhoon: typhoon_init_one: fix incorrect return values
From: Thomas Preisner @ 2016-12-30  2:37 UTC (permalink / raw)
  To: dave
  Cc: netdev, linux-kernel, linux-kernel, milan.stephan+linux,
	thomas.preisner+linux, sergei.shtylyov, davem
In-Reply-To: <1483065474-11512-1-git-send-email-thomas.preisner+linux@fau.de>

In a few cases the err-variable is not set to a negative error code if a
function call in typhoon_init_one() fails and thus 0 is returned
instead.
It may be better to set err to the appropriate negative error
code before returning.

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

Reported-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Thomas Preisner <thomas.preisner+linux@fau.de>
Signed-off-by: Milan Stephan <milan.stephan+linux@fau.de>
---
 drivers/net/ethernet/3com/typhoon.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 9fe3990..25f2e92 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -2402,8 +2402,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	*(__be16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
 	*(__be32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
 
-	if(!is_valid_ether_addr(dev->dev_addr)) {
+	if (!is_valid_ether_addr(dev->dev_addr)) {
 		err_msg = "Could not obtain valid ethernet address, aborting";
+		err = -EIO;
 		goto error_out_reset;
 	}
 
@@ -2411,7 +2412,8 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	 * later when we print out the version reported.
 	 */
 	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
-	if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
+	err = typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp);
+	if (err < 0) {
 		err_msg = "Could not get Sleep Image version";
 		goto error_out_reset;
 	}
@@ -2453,7 +2455,8 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dev->features = dev->hw_features |
 		NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_RXCSUM;
 
-	if(register_netdev(dev) < 0) {
+	err = register_netdev(dev);
+	if (err < 0) {
 		err_msg = "unable to register netdev";
 		goto error_out_reset;
 	}
-- 
2.7.4

^ permalink raw reply related

* Re: Re: [PATCH v3 2/2] drivers: net: ethernet: 3com: fix return value
From: Thomas Preisner @ 2016-12-30  2:37 UTC (permalink / raw)
  To: dave
  Cc: netdev, linux-kernel, linux-kernel, milan.stephan+linux,
	thomas.preisner+linux, sergei.shtylyov, davem
In-Reply-To: <1482873453.20986.4.camel@dillow-glaptop.roam.corp.google.com>

On Tue, 2016-12-27 at 22:17:35 +0100, David Dillow wrote:
>On Sun, 2016-12-25 at 01:30 +0100, Thomas Preisner wrote:
>> In some cases the return value of a failing function is not being used
>> and the function typhoon_init_one() returns another negative error
>> code instead.
>
>I'm not sure these changes are especially valuable, since we'll need to
>look at the dmesg log anyways to figure out what went wrong, but again I
>don't feel strongly.
>
>Fix up the subject issues and I'm happy to ack them.

As requested, here are the patchsets with the fixed subjects.
The subjects aswell as the subject prefixes are more precise now.
Hopefully that's ok.

Patch 1:
Makes the function typhoon_init_one() return a negative error code instead of 0.

Patch 2 [Optional]:
Makes the function typhoon_init_one() return the return value of the
corresponding failing function calls instead of a "fixed" negative error code.

With Regards,
Milan and Thomas

^ permalink raw reply

* Re: [PATCH net-next] liquidio: optimize reads from Octeon PCI console
From: Felix Manlunas @ 2016-12-30  1:48 UTC (permalink / raw)
  To: Chickles, Derek
  Cc: davem@davemloft.net, netdev@vger.kernel.org, Vatsavayi, Raghu,
	Burla, Satananda
In-Reply-To: <MWHPR07MB2943250F549EEF0D697C5E54F36A0@MWHPR07MB2943.namprd07.prod.outlook.com>

Chickles, Derek <Derek.Chickles@cavium.com> wrote on Thu [2016-Dec-29 17:42:34 -0800]:
> >  #ifdef __BIG_ENDIAN_BITFIELD
> >  static inline void
> > @@ -96,6 +96,25 @@ __octeon_pci_rw_core_mem(struct octeon_device
> > *oct, u64 addr,
> >  	u32 copy_len = 0, index_reg_val = 0;
> >  	unsigned long flags;
> >  	u8 __iomem *mapped_addr;
> > +	u64 static_mapping_base;
> > +
> > +	static_mapping_base = oct->console_nb_info.dram_region_base;
> > +
> 
> Does this work when there are multiple cards?

Yes, it works when there are multiple cards.

^ permalink raw reply

* Re: [PATCH 1/1] r8169: fix the typo
From: Yanjun Zhu @ 2016-12-30  2:19 UTC (permalink / raw)
  To: nic_swsd, netdev
In-Reply-To: <1482981062-6889-1-git-send-email-yanjun.zhu@oracle.com>

Hi,

Please comment on this patch.

Zhu Yanjun

On 2016/12/29 11:11, Zhu Yanjun wrote:
> >From the realtek data sheet, the PID0 should be bit 0.
>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
> ---
>   drivers/net/ethernet/realtek/r8169.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 44389c9..8f1623b 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -696,7 +696,7 @@ enum rtl_tx_desc_bit_1 {
>   enum rtl_rx_desc_bit {
>   	/* Rx private */
>   	PID1		= (1 << 18), /* Protocol ID bit 1/2 */
> -	PID0		= (1 << 17), /* Protocol ID bit 2/2 */
> +	PID0		= (1 << 17), /* Protocol ID bit 0/2 */
>   
>   #define RxProtoUDP	(PID1)
>   #define RxProtoTCP	(PID0)

^ permalink raw reply

* RE: [PATCH net-next] liquidio: optimize reads from Octeon PCI console
From: Chickles, Derek @ 2016-12-30  1:42 UTC (permalink / raw)
  To: Manlunas, Felix, davem@davemloft.net
  Cc: netdev@vger.kernel.org, Vatsavayi, Raghu, Burla, Satananda
In-Reply-To: <20161230010447.GA6015@felix.cavium.com>

>  #ifdef __BIG_ENDIAN_BITFIELD
>  static inline void
> @@ -96,6 +96,25 @@ __octeon_pci_rw_core_mem(struct octeon_device
> *oct, u64 addr,
>  	u32 copy_len = 0, index_reg_val = 0;
>  	unsigned long flags;
>  	u8 __iomem *mapped_addr;
> +	u64 static_mapping_base;
> +
> +	static_mapping_base = oct->console_nb_info.dram_region_base;
> +

Does this work when there are multiple cards?
 

^ permalink raw reply

* Re: [PATCH v5] net: dev_weight: TX/RX orthogonality
From: David Miller @ 2016-12-30  1:16 UTC (permalink / raw)
  To: matthias.tafelmeier; +Cc: netdev, hagen, fw, edumazet, daniel
In-Reply-To: <1483043841-10016-1-git-send-email-matthias.tafelmeier@gmx.net>

From: Matthias Tafelmeier <matthias.tafelmeier@gmx.net>
Date: Thu, 29 Dec 2016 21:37:21 +0100

> Oftenly, introducing side effects on packet processing on the other half
> of the stack by adjusting one of TX/RX via sysctl is not desirable.
> There are cases of demand for asymmetric, orthogonal configurability.
> 
> This holds true especially for nodes where RPS for RFS usage on top is
> configured and therefore use the 'old dev_weight'. This is quite a
> common base configuration setup nowadays, even with NICs of superior processing
> support (e.g. aRFS).
> 
> A good example use case are nodes acting as noSQL data bases with a
> large number of tiny requests and rather fewer but large packets as responses.
> It's affordable to have large budget and rx dev_weights for the
> requests. But as a side effect having this large a number on TX
> processed in one run can overwhelm drivers.
> 
> This patch therefore introduces an independent configurability via sysctl to
> userland.
> 
> Signed-off-by: Matthias Tafelmeier <matthias.tafelmeier@gmx.net>

Much better, applied, thanks.

^ permalink raw reply

* [PATCH net-next] liquidio: optimize reads from Octeon PCI console
From: Felix Manlunas @ 2016-12-30  1:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla

Reads from Octeon PCI console are inefficient because before each read
operation, a dynamic mapping to Octeon DRAM is set up.  This patch replaces
the repeated setup of a dynamic mapping with a one-time setup of a static
mapping.

Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
---
 .../net/ethernet/cavium/liquidio/octeon_config.h    | 10 +++-------
 .../net/ethernet/cavium/liquidio/octeon_console.c   | 10 ++++++++++
 .../net/ethernet/cavium/liquidio/octeon_device.h    |  6 ++++++
 .../net/ethernet/cavium/liquidio/octeon_mem_ops.c   | 21 ++++++++++++++++++++-
 4 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_config.h b/drivers/net/ethernet/cavium/liquidio/octeon_config.h
index 1cb3514..b3dc2e9 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_config.h
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_config.h
@@ -429,15 +429,11 @@ struct octeon_config {
 
 /* The following config values are fixed and should not be modified. */
 
-/* Maximum address space to be mapped for Octeon's BAR1 index-based access. */
-#define  MAX_BAR1_MAP_INDEX                     2
+#define  BAR1_INDEX_DYNAMIC_MAP          2
+#define  BAR1_INDEX_STATIC_MAP          15
 #define  OCTEON_BAR1_ENTRY_SIZE         (4 * 1024 * 1024)
 
-/* BAR1 Index 0 to (MAX_BAR1_MAP_INDEX - 1) for normal mapped memory access.
- * Bar1 register at MAX_BAR1_MAP_INDEX used by driver for dynamic access.
- */
-#define  MAX_BAR1_IOREMAP_SIZE  ((MAX_BAR1_MAP_INDEX + 1) * \
-				 OCTEON_BAR1_ENTRY_SIZE)
+#define  MAX_BAR1_IOREMAP_SIZE  (16 * OCTEON_BAR1_ENTRY_SIZE)
 
 /* Response lists - 1 ordered, 1 unordered-blocking, 1 unordered-nonblocking
  * NoResponse Lists are now maintained with each IQ. (Dec' 2007).
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_console.c b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
index 3265e0b..42b673d 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_console.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_console.c
@@ -549,6 +549,16 @@ int octeon_init_consoles(struct octeon_device *oct)
 		return ret;
 	}
 
+	/* Dedicate one of Octeon's BAR1 index registers to create a static
+	 * mapping to a region of Octeon DRAM that contains the PCI console
+	 * named block.
+	 */
+	oct->console_nb_info.bar1_index = BAR1_INDEX_STATIC_MAP;
+	oct->fn_list.bar1_idx_setup(oct, addr, oct->console_nb_info.bar1_index,
+				    true);
+	oct->console_nb_info.dram_region_base = addr
+		& ~(OCTEON_BAR1_ENTRY_SIZE - 1ULL);
+
 	/* num_consoles > 0, is an indication that the consoles
 	 * are accessible
 	 */
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.h b/drivers/net/ethernet/cavium/liquidio/octeon_device.h
index 18f6836..c301a38 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_device.h
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.h
@@ -477,6 +477,12 @@ struct octeon_device {
 	/* Console caches */
 	struct octeon_console console[MAX_OCTEON_MAPS];
 
+	/* Console named block info */
+	struct {
+		u64 dram_region_base;
+		int bar1_index;
+	} console_nb_info;
+
 	/* Coprocessor clock rate. */
 	u64 coproc_clock_rate;
 
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c b/drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c
index 13a18c9..5cd96e7 100644
--- a/drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c
+++ b/drivers/net/ethernet/cavium/liquidio/octeon_mem_ops.c
@@ -23,7 +23,7 @@
 #include "response_manager.h"
 #include "octeon_device.h"
 
-#define MEMOPS_IDX   MAX_BAR1_MAP_INDEX
+#define MEMOPS_IDX   BAR1_INDEX_DYNAMIC_MAP
 
 #ifdef __BIG_ENDIAN_BITFIELD
 static inline void
@@ -96,6 +96,25 @@ __octeon_pci_rw_core_mem(struct octeon_device *oct, u64 addr,
 	u32 copy_len = 0, index_reg_val = 0;
 	unsigned long flags;
 	u8 __iomem *mapped_addr;
+	u64 static_mapping_base;
+
+	static_mapping_base = oct->console_nb_info.dram_region_base;
+
+	if (static_mapping_base &&
+	    static_mapping_base == (addr & ~(OCTEON_BAR1_ENTRY_SIZE - 1ULL))) {
+		int bar1_index = oct->console_nb_info.bar1_index;
+
+		mapped_addr = oct->mmio[1].hw_addr
+			+ (bar1_index << ilog2(OCTEON_BAR1_ENTRY_SIZE))
+			+ (addr & (OCTEON_BAR1_ENTRY_SIZE - 1ULL));
+
+		if (op)
+			octeon_pci_fastread(oct, mapped_addr, hostbuf, len);
+		else
+			octeon_pci_fastwrite(oct, mapped_addr, hostbuf, len);
+
+		return;
+	}
 
 	spin_lock_irqsave(&oct->mem_access_lock, flags);
 

^ 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