* Re: [PATCH] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"
From: Colin Ian King @ 2016-12-29 21:35 UTC (permalink / raw)
To: VDR User
Cc: Mauro Carvalho Chehab, Larry Finger, Chaoming Li, Kalle Valo,
mailing list: linux-media, linux-wireless, netdev,
Linux Kernel Mailing List
In-Reply-To: <CAA7C2qjAk6LqTru2zimRr4_JUYXK+4d8VENpyYXjyE0-eJ+RKQ@mail.gmail.com>
On 29/12/16 21:23, VDR User wrote:
>> - err("firmare chunk size bigger than 64 bytes.");
>> + err("firmware chunk size bigger than 64 bytes.");
>
> Yup.
>
>> - "HW don't support CMAC encrypiton, use software CMAC encrypiton\n");
>> + "HW don't support CMAC encryption, use software CMAC encryption\n");
>
> Should be: "HW doesn't support CMAC encryption, use software CMAC
> encryption\n");
>
Very true, I was so focused on the spelling I overlooked the grammar.
I'll re-send with that fixed.
Colin
^ permalink raw reply
* [PATCH][V2] [media] gp8psk: fix spelling mistake: "firmare" -> "firmware"
From: Colin King @ 2016-12-29 21:38 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Larry Finger, Chaoming Li, Kalle Valo,
linux-media, linux-wireless, netdev
Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Trivial fix to spelling mistake in err message. Also change "don't" to
"does not".
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/media/usb/dvb-usb/gp8psk.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/core.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/gp8psk.c b/drivers/media/usb/dvb-usb/gp8psk.c
index 2360e7e..26461f2 100644
--- a/drivers/media/usb/dvb-usb/gp8psk.c
+++ b/drivers/media/usb/dvb-usb/gp8psk.c
@@ -161,7 +161,7 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d)
goto out_free;
}
if (buflen > 64) {
- err("firmare chunk size bigger than 64 bytes.");
+ err("firmware chunk size bigger than 64 bytes.");
goto out_free;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index ded1493..732de0a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1532,7 +1532,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
key_type = AESCMAC_ENCRYPTION;
RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, "alg:CMAC\n");
RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
- "HW don't support CMAC encrypiton, use software CMAC encrypiton\n");
+ "HW does not support CMAC encryption, use software CMAC encryption\n");
err = -EOPNOTSUPP;
goto out_unlock;
default:
--
2.10.2
^ permalink raw reply related
* [PATCH net-next] net: dsa: Implement ndo_get_phys_port_id
From: Florian Fainelli @ 2016-12-29 22:20 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
open list
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>
---
net/dsa/slave.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 68c9eea00518..ffd91969b830 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -984,6 +984,17 @@ static void dsa_slave_poll_controller(struct net_device *dev)
}
#endif
+static int dsa_slave_get_phys_port_id(struct net_device *dev,
+ struct netdev_phys_item_id *ppid)
+{
+ struct dsa_slave_priv *p = netdev_priv(dev);
+
+ ppid->id_len = sizeof(p->port);
+ memcpy(ppid->id, &p->port, ppid->id_len);
+
+ return 0;
+}
+
void dsa_cpu_port_ethtool_init(struct ethtool_ops *ops)
{
ops->get_sset_count = dsa_cpu_port_get_sset_count;
@@ -1031,6 +1042,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
.ndo_bridge_getlink = switchdev_port_bridge_getlink,
.ndo_bridge_setlink = switchdev_port_bridge_setlink,
.ndo_bridge_dellink = switchdev_port_bridge_dellink,
+ .ndo_get_phys_port_id = dsa_slave_get_phys_port_id,
};
static const struct switchdev_ops dsa_slave_switchdev_ops = {
--
2.9.3
^ permalink raw reply related
* [PATCH net] net: ipv4: dst for local input routes should use l3mdev if relevant
From: David Ahern @ 2016-12-29 23:29 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
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>
---
net/ipv4/route.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a82a11747b3f..0fcac8e7a2b2 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1914,7 +1914,8 @@ out: return err;
}
}
- rth = rt_dst_alloc(net->loopback_dev, flags | RTCF_LOCAL, res.type,
+ rth = rt_dst_alloc(l3mdev_master_dev_rcu(dev) ? : net->loopback_dev,
+ flags | RTCF_LOCAL, res.type,
IN_DEV_CONF_GET(in_dev, NOPOLICY), false, do_cache);
if (!rth)
goto e_nobufs;
--
2.1.4
^ permalink raw reply related
* [PATCH net-next] net: Allow IP_MULTICAST_IF to set index to L3 slave
From: David Ahern @ 2016-12-29 23:39 UTC (permalink / raw)
To: netdev; +Cc: darwin.dingel, Mark.Tomlinson, David Ahern
IP_MULTICAST_IF fails if sk_bound_dev_if is already set and the new index
does not match it. e.g.,
ntpd[15381]: setsockopt IP_MULTICAST_IF 192.168.1.23 fails: Invalid argument
Relax the check in setsockopt to allow setting mc_index to an L3 slave if
sk_bound_dev_if points to an L3 master.
Make a similar change for IPv6. In this case change the device lookup to
take the rcu_read_lock avoiding a refcnt. The rcu lock is also needed for
the lookup of a potential L3 master device.
This really only silences a setsockopt failure since uses of mc_index are
secondary to sk_bound_dev_if if it is set. In both cases, if either index
is an L3 slave or master, lookups are directed to the same FIB table so
relaxing the check at setsockopt time causes no harm.
Patch is based on a suggested change by Darwin for a problem noted in
their code base.
Suggested-by: Darwin Dingel <darwin.dingel@alliedtelesis.co.nz>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
net/ipv4/ip_sockglue.c | 7 ++++++-
net/ipv6/ipv6_sockglue.c | 16 ++++++++++++----
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 8b13881ed064..72071a9a348d 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -843,6 +843,7 @@ static int do_ip_setsockopt(struct sock *sk, int level,
{
struct ip_mreqn mreq;
struct net_device *dev = NULL;
+ int midx;
if (sk->sk_type == SOCK_STREAM)
goto e_inval;
@@ -887,11 +888,15 @@ static int do_ip_setsockopt(struct sock *sk, int level,
err = -EADDRNOTAVAIL;
if (!dev)
break;
+
+ midx = l3mdev_master_ifindex(dev);
+
dev_put(dev);
err = -EINVAL;
if (sk->sk_bound_dev_if &&
- mreq.imr_ifindex != sk->sk_bound_dev_if)
+ mreq.imr_ifindex != sk->sk_bound_dev_if &&
+ (!midx || midx != sk->sk_bound_dev_if))
break;
inet->mc_index = mreq.imr_ifindex;
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 3ba530373560..bdf1227fd433 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -595,16 +595,24 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
if (val) {
struct net_device *dev;
+ int midx;
- if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val)
- goto e_inval;
+ rcu_read_lock();
- dev = dev_get_by_index(net, val);
+ dev = dev_get_by_index_rcu(net, val);
if (!dev) {
+ rcu_read_unlock();
retv = -ENODEV;
break;
}
- dev_put(dev);
+ midx = l3mdev_master_ifindex_rcu(dev);
+
+ rcu_read_unlock();
+
+ if (sk->sk_bound_dev_if &&
+ sk->sk_bound_dev_if != val &&
+ (!midx || midx != sk->sk_bound_dev_if))
+ goto e_inval;
}
np->mcast_oif = val;
retv = 0;
--
2.1.4
^ permalink raw reply related
* [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
* 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
* 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 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: 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: 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
* [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
* [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
* 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
* 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: [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: [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 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] 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] 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] 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-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
* [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
* [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 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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox