* [PATCH net-next v2 1/3] net: factor out a helper to decrement the skb refcount
From: Paolo Abeni @ 2017-06-06 14:23 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Eric Dumazet
In-Reply-To: <cover.1496756090.git.pabeni@redhat.com>
The same code is replicated in 3 different places; move it to a
common helper.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
---
include/linux/skbuff.h | 13 +++++++++++++
net/core/datagram.c | 4 +---
net/core/skbuff.c | 14 ++++----------
3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 45a59c1..3c25fca 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -867,6 +867,19 @@ static inline unsigned int skb_napi_id(const struct sk_buff *skb)
#endif
}
+/* decrement the reference count and return true if we can free the skb */
+static inline bool skb_unref(struct sk_buff *skb)
+{
+ if (unlikely(!skb))
+ return false;
+ if (likely(atomic_read(&skb->users) == 1))
+ smp_rmb();
+ else if (likely(!atomic_dec_and_test(&skb->users)))
+ return false;
+
+ return true;
+}
+
void kfree_skb(struct sk_buff *skb);
void kfree_skb_list(struct sk_buff *segs);
void skb_tx_error(struct sk_buff *skb);
diff --git a/net/core/datagram.c b/net/core/datagram.c
index bc46118..e5311a7 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -330,9 +330,7 @@ void __skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb, int len)
{
bool slow;
- if (likely(atomic_read(&skb->users) == 1))
- smp_rmb();
- else if (likely(!atomic_dec_and_test(&skb->users))) {
+ if (!skb_unref(skb)) {
sk_peek_offset_bwd(sk, len);
return;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 780b7c1..c81b828 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -694,12 +694,9 @@ EXPORT_SYMBOL(__kfree_skb);
*/
void kfree_skb(struct sk_buff *skb)
{
- if (unlikely(!skb))
- return;
- if (likely(atomic_read(&skb->users) == 1))
- smp_rmb();
- else if (likely(!atomic_dec_and_test(&skb->users)))
+ if (!skb_unref(skb))
return;
+
trace_kfree_skb(skb, __builtin_return_address(0));
__kfree_skb(skb);
}
@@ -746,12 +743,9 @@ EXPORT_SYMBOL(skb_tx_error);
*/
void consume_skb(struct sk_buff *skb)
{
- if (unlikely(!skb))
- return;
- if (likely(atomic_read(&skb->users) == 1))
- smp_rmb();
- else if (likely(!atomic_dec_and_test(&skb->users)))
+ if (!skb_unref(skb))
return;
+
trace_consume_skb(skb);
__kfree_skb(skb);
}
--
2.9.4
^ permalink raw reply related
* [PATCH net-next v2 0/3] udp: reduce cache pressure
From: Paolo Abeni @ 2017-06-06 14:23 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Eric Dumazet
In the most common use case, many skb fields are not used by recvmsg(), and
the few ones actually accessed lays on cold cachelines, which leads to several
cache miss per packet.
This patch series attempts to reduce such misses with different strategies:
* caching the interesting fields in the scratched space
* avoid accessing at all uninteresting fields
* prefetching
Tested using the udp_sink program by Jesper[1] as the receiver, an h/w l4 rx
hash on the ingress nic, so that the number of ingress nic rx queues hit by the
udp traffic could be controlled via ethtool -L.
The udp_sink program was bound to the first idle cpu, to get more
stable numbers.
On a single numa node receiver:
nic rx queues vanilla patched kernel delta
1 1850 kpps 1850 kpps 0%
2 2370 kpps 2700 kpps 13.9%
16 2000 kpps 2220 kpps 11%
[1] https://github.com/netoptimizer/network-testing/blob/master/src/udp_sink.c
v1 -> v2:
- replaced secpath_reset() with skb_release_head_state()
- changed udp_dev_scratch fields types to u{32,16} variant,
replaced bitfield with bool
Paolo Abeni (3):
net: factor out a helper to decrement the skb refcount
udp: avoid a cache miss on dequeue
udp: try to avoid 2 cache miss on dequeue
include/linux/skbuff.h | 15 +++++++
net/core/datagram.c | 4 +-
net/core/skbuff.c | 38 ++++++++++------
net/ipv4/udp.c | 120 ++++++++++++++++++++++++++++++++++++++++++++-----
4 files changed, 148 insertions(+), 29 deletions(-)
--
2.9.4
^ permalink raw reply
* Re: [PATCH] net: mvpp2: do not bypass the mvpp22_port_mii_set function
From: Florian Fainelli @ 2017-06-06 14:24 UTC (permalink / raw)
To: Antoine Tenart, Thomas Petazzoni
Cc: netdev, linux, gregory.clement, mw, davem, linux-arm-kernel
In-Reply-To: <20170606135148.GA22618@kwain.lan>
On 06/06/2017 06:51 AM, Antoine Tenart wrote:
> Hello Thomas,
>
> On Tue, Jun 06, 2017 at 03:45:35PM +0200, Thomas Petazzoni wrote:
>> On Tue, 6 Jun 2017 15:36:15 +0200, Antoine Tenart wrote:
>>> The mvpp22_port_mii_set() function was added by 2697582144dd, but the
>>> function directly returns without doing anything. This return was used
>>> when debugging and wasn't removed before sending the patch. Fix this.
>>>
>>> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
>>
>> Please add:
>>
>> Fixes: 2697582144dd ("net: mvpp2: handle misc PPv2.1/PPv2.2 differences")
>>
>> with this:
>>
>> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
> OK, will do.
>
>> I am wondering if we shouldn't Cc: stable as well. I don't think we
>> have seen issues on our side because U-Boot does the necessary
>> initialization, but people using other bootloaders might have issues.
>
> Yes, that might be safer to cc stable. I'll do this as well.
David queues network patches for stable provided that you submit those
against his "net" tree [1] and there is an appropriate Fixes tag (which
Thomas provided).
[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/netdev-FAQ.txt#n114
--
Florian
^ permalink raw reply
* Re: [patch net-next 05/19] net: bridge: Add support for notifying devices about FDB add/del
From: Arkadi Sharshevsky @ 2017-06-06 14:19 UTC (permalink / raw)
To: Nikolay Aleksandrov, Jiri Pirko, netdev
Cc: davem, idosch, mlxsw, roopa, stephen, ivecera
In-Reply-To: <e64dd1c4-8cdc-4be9-350d-171597bf4d1c@cumulusnetworks.com>
On 06/05/2017 04:35 PM, Nikolay Aleksandrov wrote:
> On 05/06/17 12:20, Jiri Pirko wrote:
>> From: Arkadi Sharshevsky <arkadis@mellanox.com>
>>
>> Currently the bridge doesn't notify the underlying devices about new
>> FDBs learned. The FDB sync is placed on the switchdev notifier chain
>> because devices may potentially learn FDB that are not directly related
>> to their ports, for example:
>>
>> 1. Mixed SW/HW bridge - FDBs that point to the ASICs external devices
>> should be offloaded as CPU traps in order to
>> perform forwarding in slow path.
>> 2. EVPN - Externally learned FDBs for the vtep device.
>>
>> Notification is sent only about static FDB add/del. This is done due
>> to fact that currently this is the only scenario supported by switch
>> drivers.
>>
>> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
>> Reviewed-by: Ido Schimmel <idosch@mellanox.com>
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>> ---
>> .../ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +-
>> drivers/net/ethernet/rocker/rocker_ofdpa.c | 4 ++--
>> include/net/switchdev.h | 6 ++++--
>> net/bridge/br.c | 4 ++--
>> net/bridge/br_fdb.c | 22 ++++++++++++++++++++++
>> net/bridge/br_private.h | 8 ++++++++
>> net/bridge/br_switchdev.c | 13 +++++++++++++
>> 7 files changed, 52 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
>> index edcc273..0111a77 100644
>> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
>> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
>> @@ -1867,7 +1867,7 @@ static void mlxsw_sp_fdb_call_notifiers(bool learning_sync, bool adding,
>> if (learning_sync) {
>> info.addr = mac;
>> info.vid = vid;
>> - notifier_type = adding ? SWITCHDEV_FDB_ADD : SWITCHDEV_FDB_DEL;
>> + notifier_type = adding ? SWITCHDEV_FDB_ADD_TO_BRIDGE : SWITCHDEV_FDB_DEL_TO_BRIDGE;
>> call_switchdev_notifiers(notifier_type, dev, &info.info);
>> }
>> }
>> diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c
>> index 2ae8524..f659dad 100644
>> --- a/drivers/net/ethernet/rocker/rocker_ofdpa.c
>> +++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c
>> @@ -1939,10 +1939,10 @@ static void ofdpa_port_fdb_learn_work(struct work_struct *work)
>>
>> rtnl_lock();
>> if (learned && removing)
>> - call_switchdev_notifiers(SWITCHDEV_FDB_DEL,
>> + call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_BRIDGE,
>> lw->ofdpa_port->dev, &info.info);
>> else if (learned && !removing)
>> - call_switchdev_notifiers(SWITCHDEV_FDB_ADD,
>> + call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_BRIDGE,
>> lw->ofdpa_port->dev, &info.info);
>> rtnl_unlock();
>>
>> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
>> index 63a754d..8165ed9 100644
>> --- a/include/net/switchdev.h
>> +++ b/include/net/switchdev.h
>> @@ -155,8 +155,10 @@ struct switchdev_ops {
>> };
>>
>> enum switchdev_notifier_type {
>> - SWITCHDEV_FDB_ADD = 1,
>> - SWITCHDEV_FDB_DEL,
>> + SWITCHDEV_FDB_ADD_TO_BRIDGE = 1,
>> + SWITCHDEV_FDB_DEL_TO_BRIDGE,
>> + SWITCHDEV_FDB_ADD_TO_DEVICE,
>> + SWITCHDEV_FDB_DEL_TO_DEVICE,
>> };
>>
>> struct switchdev_notifier_info {
>> diff --git a/net/bridge/br.c b/net/bridge/br.c
>> index e962fff..96d209c 100644
>> --- a/net/bridge/br.c
>> +++ b/net/bridge/br.c
>> @@ -138,14 +138,14 @@ static int br_switchdev_event(struct notifier_block *unused,
>> br = p->br;
>>
>> switch (event) {
>> - case SWITCHDEV_FDB_ADD:
>> + case SWITCHDEV_FDB_ADD_TO_BRIDGE:
>> fdb_info = ptr;
>> err = br_fdb_external_learn_add(br, p, fdb_info->addr,
>> fdb_info->vid);
>> if (err)
>> err = notifier_from_errno(err);
>> break;
>> - case SWITCHDEV_FDB_DEL:
>> + case SWITCHDEV_FDB_DEL_TO_BRIDGE:
>> fdb_info = ptr;
>> err = br_fdb_external_learn_del(br, p, fdb_info->addr,
>> fdb_info->vid);
>> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
>> index 5c780cd..21bf9d2 100644
>> --- a/net/bridge/br_fdb.c
>> +++ b/net/bridge/br_fdb.c
>> @@ -683,6 +683,26 @@ static inline size_t fdb_nlmsg_size(void)
>> + nla_total_size(sizeof(struct nda_cacheinfo));
>> }
>>
>> +static void
>> +fdb_notify_switchdev(const struct net_bridge_fdb_entry *fdb, int type)
>> +{
>> + if (!fdb->added_by_user)
>> + return;
>> +
>> + switch (type) {
>> + case RTM_DELNEIGH:
>> + br_switchdev_fdb_call_notifiers(false, fdb->addr.addr,
>> + fdb->vlan_id,
>> + fdb->dst->dev);
>> + break;
>> + case RTM_NEWNEIGH:
>> + br_switchdev_fdb_call_notifiers(true, fdb->addr.addr,
>> + fdb->vlan_id,
>> + fdb->dst->dev);
>> + break;
>> + }
>> +}
>
> Same comment here, this switchdev-specific logic can be contained in
> br_switchdev_fdb_call_notifiers().
>
Thanks, will move it to br_switchdev.c.
>> +
>> static void fdb_notify(struct net_bridge *br,
>> const struct net_bridge_fdb_entry *fdb, int type)
>> {
>> @@ -690,6 +710,8 @@ static void fdb_notify(struct net_bridge *br,
>> struct sk_buff *skb;
>> int err = -ENOBUFS;
>>
>> + fdb_notify_switchdev(fdb, type);
>> +
>> skb = nlmsg_new(fdb_nlmsg_size(), GFP_ATOMIC);
>> if (skb == NULL)
>> goto errout;
>> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
>> index 69ba3ba..5e944e9 100644
>> --- a/net/bridge/br_private.h
>> +++ b/net/bridge/br_private.h
>> @@ -1086,6 +1086,8 @@ void nbp_switchdev_frame_mark(const struct net_bridge_port *p,
>> struct sk_buff *skb);
>> bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,
>> const struct sk_buff *skb);
>> +void br_switchdev_fdb_call_notifiers(bool adding, const unsigned char *mac,
>> + u16 vid, struct net_device *dev);
>> #else
>> static inline int nbp_switchdev_mark_set(struct net_bridge_port *p)
>> {
>> @@ -1102,6 +1104,12 @@ static inline bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,
>> {
>> return true;
>> }
>> +
>> +static inline void
>> +br_switchdev_fdb_call_notifiers(bool adding, const unsigned char *mac,
>> + u16 vid, struct net_device *dev)
>> +{
>> +}
>> #endif /* CONFIG_NET_SWITCHDEV */
>>
>> #endif
>> diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
>> index f4097b9..c07dceb 100644
>> --- a/net/bridge/br_switchdev.c
>> +++ b/net/bridge/br_switchdev.c
>> @@ -55,3 +55,16 @@ bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,
>> return !skb->offload_fwd_mark ||
>> BR_INPUT_SKB_CB(skb)->offload_fwd_mark != p->offload_fwd_mark;
>> }
>> +
>> +void
>> +br_switchdev_fdb_call_notifiers(bool adding, const unsigned char *mac,
>> + u16 vid, struct net_device *dev)
>> +{
>> + struct switchdev_notifier_fdb_info info;
>> + unsigned long notifier_type;
>> +
>> + info.addr = mac;
>> + info.vid = vid;
>> + notifier_type = adding ? SWITCHDEV_FDB_ADD_TO_DEVICE : SWITCHDEV_FDB_DEL_TO_DEVICE;
>> + call_switchdev_notifiers(notifier_type, dev, &info.info);
>> +}
>>
>
^ permalink raw reply
* Re: More BPF verifier questions
From: Edward Cree @ 2017-06-06 14:17 UTC (permalink / raw)
To: Josef Bacik, Alexei Starovoitov
Cc: Alexei Starovoitov, Daniel Borkmann, netdev, David Miller,
iovisor-dev, Josef Bacik
In-Reply-To: <20170605184754.GA30973@li70-116.members.linode.com>
On 05/06/17 19:47, Josef Bacik wrote:
> On Mon, Jun 05, 2017 at 11:11:05AM -0700, Alexei Starovoitov wrote:
>> Do you have an asm test case that demonstrates that?
> From here we want to exploit the fact that false_reg->min_value is not
> necessarily correct, but in order to do that we need to get false_reg->max_value
> below the actual size limit for the data we're reaching into, which means we
> want to _only_ change false_reg->max_value. Thankfully there doesn't appear to
> be a way to do that, everything changes either only min_value or both min_value
> and max_value. I think we're safe here, unless I've missed something. Thanks,
Here's the basic idea:
r1 = -8
r2 = -1
JGT r1, r2, end
JSGT r1, 1, end
ptr += r1
*(u8 *)ptr = 0
After the JGT, we're in the false branch so r1->min_value = 0 and r1->max_value
= (u64)-1.
After the JSGT, we're again in the false branch so r1->max_value = 1.
So when we add r1 to the pointer, the verifier thinks it's safe, but it's not,
because r1 is really negative.
And here's the asm:
BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0),
BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
BPF_LD_MAP_FD(BPF_REG_1, 0),
BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0,
BPF_FUNC_map_lookup_elem),
BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 7),
BPF_ST_MEM(BPF_DW, BPF_REG_10, -16, -8),
BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_10, -16),
BPF_MOV64_IMM(BPF_REG_2, -1),
BPF_JMP_REG(BPF_JGT, BPF_REG_1, BPF_REG_2, 3),
BPF_JMP_IMM(BPF_JSGT, BPF_REG_1, 1, 2),
BPF_ALU64_REG(BPF_ADD, BPF_REG_0, BPF_REG_1),
BPF_ST_MEM(BPF_B, BPF_REG_0, 0, 0),
BPF_MOV64_IMM(BPF_REG_0, 0),
BPF_EXIT_INSN(),
The verifier currently accepts this program (with an appropriate map fd), but I
believe when run it will access invalid memory.
-Ed
^ permalink raw reply
* [PATCH v2] net: davicom: dm9000: Avoid spinlock recursion during dm9000_timeout routine
From: Liu Xiang @ 2017-06-06 14:17 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, liuxiang1999, Liu Xiang
On the DM9000B, dm9000_phy_write() is called after the main spinlock
is held, during the dm9000_timeout() routine. Spinlock recursion
occurs because the main spinlock is requested again in
dm9000_phy_write(). So spinlock should be avoided in phy operation
during the dm9000_timeout() routine.
---
v2:
dm9000_phy_write_reg is extracted from dm9000_phy_write, with no lock,
do the real phy operation.
---
Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
---
drivers/net/ethernet/davicom/dm9000.c | 37 +++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 008dc81..0aa2900 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -327,21 +327,13 @@ static void dm9000_msleep(struct board_info *db, unsigned int ms)
return ret;
}
-/* Write a word to phyxcer */
static void
-dm9000_phy_write(struct net_device *dev,
- int phyaddr_unused, int reg, int value)
+dm9000_phy_write_reg(struct net_device *dev,
+ int phyaddr_unused, int reg, int value)
{
struct board_info *db = netdev_priv(dev);
- unsigned long flags;
unsigned long reg_save;
- dm9000_dbg(db, 5, "phy_write[%02x] = %04x\n", reg, value);
- if (!db->in_timeout)
- mutex_lock(&db->addr_lock);
-
- spin_lock_irqsave(&db->lock, flags);
-
/* Save previous register address */
reg_save = readb(db->io_addr);
@@ -356,17 +348,32 @@ static void dm9000_msleep(struct board_info *db, unsigned int ms)
iow(db, DM9000_EPCR, EPCR_EPOS | EPCR_ERPRW);
writeb(reg_save, db->io_addr);
- spin_unlock_irqrestore(&db->lock, flags);
- dm9000_msleep(db, 1); /* Wait write complete */
+ mdelay(1); /* Wait write complete */
- spin_lock_irqsave(&db->lock, flags);
reg_save = readb(db->io_addr);
iow(db, DM9000_EPCR, 0x0); /* Clear phyxcer write command */
/* restore the previous address */
writeb(reg_save, db->io_addr);
+}
+
+/* Write a word to phyxcer */
+static void
+dm9000_phy_write(struct net_device *dev,
+ int phyaddr_unused, int reg, int value)
+{
+ struct board_info *db = netdev_priv(dev);
+ unsigned long flags;
+
+ dm9000_dbg(db, 5, "phy_write[%02x] = %04x\n", reg, value);
+ if (!db->in_timeout)
+ mutex_lock(&db->addr_lock);
+
+ spin_lock_irqsave(&db->lock, flags);
+
+ dm9000_phy_write_reg(dev, phyaddr_unused, reg, value);
spin_unlock_irqrestore(&db->lock, flags);
if (!db->in_timeout)
@@ -933,8 +940,8 @@ static unsigned char dm9000_type_to_char(enum dm9000_type type)
* manual phy reset, and setting init params.
*/
if (db->type == TYPE_DM9000B) {
- dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET);
- dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM);
+ dm9000_phy_write_reg(dev, 0, MII_BMCR, BMCR_RESET);
+ dm9000_phy_write_reg(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM);
}
ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH v3 6/7] net: pch_gbe: Allow longer for resets
From: Marcin Nowakowski @ 2017-06-06 14:10 UTC (permalink / raw)
To: Paul Burton, netdev
Cc: Tobias Klauser, David S . Miller, Jarod Wilson, linux-mips,
Eric Dumazet
In-Reply-To: <20170602234042.22782-7-paul.burton@imgtec.com>
Hi Paul,
On 03.06.2017 01:40, Paul Burton wrote:
> Resets of the EG20T MAC on the MIPS Boston development board take longer
> than the 1000 loops that pch_gbe_wait_clr_bit was performing. Rather
> than simply increasing the number of loops, switch to using
> readl_poll_timeout_atomic() from linux/iopoll.h in order to provide some
> independence from the speed of the CPU.
>
> #define DRV_VERSION "1.01"
> @@ -318,13 +319,11 @@ s32 pch_gbe_mac_read_mac_addr(struct pch_gbe_hw *hw)
> */
> static void pch_gbe_wait_clr_bit(void *reg, u32 bit)
> {
> + int err;
> u32 tmp;
>
> - /* wait busy */
> - tmp = 1000;
> - while ((ioread32(reg) & bit) && --tmp)
> - cpu_relax();
> - if (!tmp)
> + err = readl_poll_timeout_atomic(reg, tmp, !(tmp & bit), 10, 500);
> + if (err)
> pr_err("Error: busy bit is not cleared\n");
> }
This new timeout value appears to be too low - I'm seeing plenty of
timeout warnings now and ultimately the device fails to initialise:
[ 7.541876] pch_gbe: EG20T PCH Gigabit Ethernet Driver - version 1.01
[ 7.566451] pch_gbe: Error: busy bit is not cleared
[ 7.572654] pch_gbe: Error: busy bit is not cleared
[ 7.578727] pch_gbe: Error: busy bit is not cleared
[ 7.587814] pch_gbe 0000:02:00.1: Invalid MAC address, interface
disabled.
[ 7.595605] pch_gbe 0000:02:00.1: MAC address : 00:00:00:00:00:00
[ 7.606451] pch_gbe: Error: busy bit is not cleared
[ 7.612572] pch_gbe: Error: busy bit is not cleared
[ 7.618618] pch_gbe: Error: busy bit is not cleared
<...>
[ 10.063351] pch_gbe 0000:02:00.1 eth0: Error: Invalid MAC address
[ 10.074713] pch_gbe: Error: busy bit is not cleared
[ 10.081030] pch_gbe: Error: busy bit is not cleared
[ 10.087178] pch_gbe: Error: busy bit is not cleared
[ 10.093328] pch_gbe: Error: busy bit is not cleared
[ 10.100883] pch_gbe 0000:02:00.1 eth0: Error End
[ 10.106272] IP-Config: Failed to open eth0
My tests show that a timeout value as big as 20000 may be required to
make it work reliably ...
Marcin
^ permalink raw reply
* [PATCH v4] net: don't call strlen on non-terminated string in dev_set_alias()
From: Alexander Potapenko @ 2017-06-06 13:56 UTC (permalink / raw)
To: dvyukov, kcc, edumazet, davem, stephen; +Cc: linux-kernel, netdev
KMSAN reported a use of uninitialized memory in dev_set_alias(),
which was caused by calling strlcpy() (which in turn called strlen())
on the user-supplied non-terminated string.
Signed-off-by: Alexander Potapenko <glider@google.com>
---
v4: dropped the comment at all, as suggested by Yury Norov
v3: removed the multi-line comment
v2: fixed an off-by-one error spotted by Dmitry Vyukov
For the record, here is the KMSAN report:
==================================================================
BUG: KMSAN: use of unitialized memory in strlcpy+0x8b/0x1b0
CPU: 0 PID: 1062 Comm: probe Not tainted 4.11.0-rc5+ #2763
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:16
dump_stack+0x143/0x1b0 lib/dump_stack.c:52
kmsan_report+0x12a/0x180 mm/kmsan/kmsan.c:1016
__kmsan_warning_32+0x66/0xb0 mm/kmsan/kmsan_instr.c:491
strlen lib/string.c:484
strlcpy+0x8b/0x1b0 lib/string.c:144
dev_set_alias+0x295/0x360 net/core/dev.c:1255
do_setlink+0xfe5/0x5750 net/core/rtnetlink.c:2007
rtnl_setlink+0x469/0x4f0 net/core/rtnetlink.c:2249
rtnetlink_rcv_msg+0x5da/0xb40 net/core/rtnetlink.c:4107
netlink_rcv_skb+0x339/0x5a0 net/netlink/af_netlink.c:2339
rtnetlink_rcv+0x83/0xa0 net/core/rtnetlink.c:4113
netlink_unicast_kernel net/netlink/af_netlink.c:1272
netlink_unicast+0x13b7/0x1480 net/netlink/af_netlink.c:1298
netlink_sendmsg+0x10b8/0x10f0 net/netlink/af_netlink.c:1844
sock_sendmsg_nosec net/socket.c:633
sock_sendmsg net/socket.c:643
sock_write_iter+0x395/0x440 net/socket.c:857
call_write_iter ./include/linux/fs.h:1733
new_sync_write fs/read_write.c:497
__vfs_write+0x619/0x700 fs/read_write.c:510
vfs_write+0x47e/0x8a0 fs/read_write.c:558
SYSC_write+0x17e/0x2f0 fs/read_write.c:605
SyS_write+0x87/0xb0 fs/read_write.c:597
entry_SYSCALL_64_fastpath+0x13/0x94 arch/x86/entry/entry_64.S:204
RIP: 0033:0x4052f1
RSP: 002b:00007fde1ed05d80 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004052f1
RDX: 0000000000000026 RSI: 00000000006cf0c0 RDI: 0000000000000032
RBP: 00007fde1ed05da0 R08: 00007fde1ed06700 R09: 00007fde1ed06700
R10: 00007fde1ed069d0 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fde1ed069c0 R15: 00007fde1ed06700
origin: 00000000aec00057
save_stack_trace+0x59/0x60 arch/x86/kernel/stacktrace.c:59
kmsan_save_stack_with_flags mm/kmsan/kmsan.c:352
kmsan_internal_poison_shadow+0xb1/0x1a0 mm/kmsan/kmsan.c:247
kmsan_poison_shadow+0x6d/0xc0 mm/kmsan/kmsan.c:260
slab_alloc_node mm/slub.c:2743
__kmalloc_node_track_caller+0x1f4/0x390 mm/slub.c:4349
__kmalloc_reserve net/core/skbuff.c:138
__alloc_skb+0x2cd/0x740 net/core/skbuff.c:231
alloc_skb ./include/linux/skbuff.h:933
netlink_alloc_large_skb net/netlink/af_netlink.c:1144
netlink_sendmsg+0x934/0x10f0 net/netlink/af_netlink.c:1819
sock_sendmsg_nosec net/socket.c:633
sock_sendmsg net/socket.c:643
sock_write_iter+0x395/0x440 net/socket.c:857
call_write_iter ./include/linux/fs.h:1733
new_sync_write fs/read_write.c:497
__vfs_write+0x619/0x700 fs/read_write.c:510
vfs_write+0x47e/0x8a0 fs/read_write.c:558
SYSC_write+0x17e/0x2f0 fs/read_write.c:605
SyS_write+0x87/0xb0 fs/read_write.c:597
entry_SYSCALL_64_fastpath+0x13/0x94 arch/x86/entry/entry_64.S:204
==================================================================
and the reproducer:
==================================================================
#include <pthread.h>
int sock = -1;
char buf[] = "\x26\x00\x00\x00\x13\x00\x47\xf1\x07\x01\xc1\xb0"
"\x0e\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00"
"\x09\xef\x18\xff\xff\x00\xf1\x32\x05\x00\x14\x00"
"\x6e\x35";
void do_work(int arg) {
switch (arg) {
case 0:
sock = socket(0x10, 0x3, 0x0);
break;
case 1:
write(sock, buf, 0x26);
break;
}
}
void *thread_fn(void *arg) {
int actual_arg = (int)arg;
int iter = 10000, i;
for (i = 0; i < iter; i++) {
do_work(actual_arg);
usleep(100);
}
return NULL;
}
int main() {
pthread_t thr[4];
int i;
for (i = 0; i < 4; i++) {
pthread_create(&thr, NULL, thread_fn, (void*)(i % 2));
}
sleep(10);
return 0;
}
==================================================================
---
net/core/dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index fca407b4a6ea..84e1e86a4bce 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1253,8 +1253,9 @@ int dev_set_alias(struct net_device *dev, const char *alias, size_t len)
if (!new_ifalias)
return -ENOMEM;
dev->ifalias = new_ifalias;
+ memcpy(dev->ifalias, alias, len);
+ dev->ifalias[len] = 0;
- strlcpy(dev->ifalias, alias, len+1);
return len;
}
--
2.13.0.506.g27d5fe0cd-goog
^ permalink raw reply related
* Re: [PATCH] net: mvpp2: do not bypass the mvpp22_port_mii_set function
From: Antoine Tenart @ 2017-06-06 13:51 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: Antoine Tenart, davem, netdev, gregory.clement, mw, linux,
linux-arm-kernel
In-Reply-To: <20170606154535.3e87bafb@free-electrons.com>
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
Hello Thomas,
On Tue, Jun 06, 2017 at 03:45:35PM +0200, Thomas Petazzoni wrote:
> On Tue, 6 Jun 2017 15:36:15 +0200, Antoine Tenart wrote:
> > The mvpp22_port_mii_set() function was added by 2697582144dd, but the
> > function directly returns without doing anything. This return was used
> > when debugging and wasn't removed before sending the patch. Fix this.
> >
> > Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
>
> Please add:
>
> Fixes: 2697582144dd ("net: mvpp2: handle misc PPv2.1/PPv2.2 differences")
>
> with this:
>
> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
OK, will do.
> I am wondering if we shouldn't Cc: stable as well. I don't think we
> have seen issues on our side because U-Boot does the necessary
> initialization, but people using other bootloaders might have issues.
Yes, that might be safer to cc stable. I'll do this as well.
Thanks,
Antoine
--
Antoine Ténart, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] net: mvpp2: do not bypass the mvpp22_port_mii_set function
From: Thomas Petazzoni @ 2017-06-06 13:45 UTC (permalink / raw)
To: Antoine Tenart
Cc: davem, netdev, gregory.clement, mw, linux, linux-arm-kernel
In-Reply-To: <20170606133615.20747-1-antoine.tenart@free-electrons.com>
Hello,
On Tue, 6 Jun 2017 15:36:15 +0200, Antoine Tenart wrote:
> The mvpp22_port_mii_set() function was added by 2697582144dd, but the
> function directly returns without doing anything. This return was used
> when debugging and wasn't removed before sending the patch. Fix this.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Please add:
Fixes: 2697582144dd ("net: mvpp2: handle misc PPv2.1/PPv2.2 differences")
with this:
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
I am wondering if we shouldn't Cc: stable as well. I don't think we
have seen issues on our side because U-Boot does the necessary
initialization, but people using other bootloaders might have issues.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* [PATCH] net: mvpp2: do not bypass the mvpp22_port_mii_set function
From: Antoine Tenart @ 2017-06-06 13:36 UTC (permalink / raw)
To: davem, netdev, thomas.petazzoni
Cc: Antoine Tenart, gregory.clement, mw, linux, linux-arm-kernel
The mvpp22_port_mii_set() function was added by 2697582144dd, but the
function directly returns without doing anything. This return was used
when debugging and wasn't removed before sending the patch. Fix this.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
drivers/net/ethernet/marvell/mvpp2.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 9b875d776b29..70bca2a6fb02 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -4186,8 +4186,6 @@ static void mvpp22_port_mii_set(struct mvpp2_port *port)
{
u32 val;
- return;
-
/* Only GOP port 0 has an XLG MAC */
if (port->gop_id == 0) {
val = readl(port->base + MVPP22_XLG_CTRL3_REG);
--
2.9.4
^ permalink raw reply related
* [PATCH] net: stmmac: fix a broken u32 less than zero check
From: Colin King @ 2017-06-06 13:10 UTC (permalink / raw)
To: Giuseppe Cavallaro, Alexandre Torgue, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The check that queue is less or equal to zero is always true
because queue is a u32; queue is decremented and will wrap around
and never go -ve. Fix this by making queue an int.
Detected by CoverityScan, CID#1428988 ("Unsigned compared against 0")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 68a188e74c54..05b1ec9194da 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1207,7 +1207,7 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags)
u32 rx_count = priv->plat->rx_queues_to_use;
unsigned int bfsize = 0;
int ret = -ENOMEM;
- u32 queue;
+ int queue;
int i;
if (priv->hw->mode->set_16kib_bfsize)
--
2.11.0
^ permalink raw reply related
* Re: [patch net-next 02/19] net: bridge: Add support for offloading port attributes
From: Arkadi Sharshevsky @ 2017-06-06 13:08 UTC (permalink / raw)
To: Nikolay Aleksandrov, Jiri Pirko, netdev
Cc: davem, idosch, mlxsw, roopa, stephen, ivecera
In-Reply-To: <fc8c1046-d567-e668-ef14-618814af36db@cumulusnetworks.com>
On 06/05/2017 04:29 PM, Nikolay Aleksandrov wrote:
> On 05/06/17 12:20, Jiri Pirko wrote:
>> From: Arkadi Sharshevsky <arkadis@mellanox.com>
>>
>> Currently the flood, learning and learning_sync port attributes are
>> offloaded by setting the SELF flag. Add support for offloading the
>> flood and learning attribute through the bridge code. In case of
>> setting an unsupported flag on a offloded port the operation will
>> fail.
>>
>> The learning_sync attribute doesn't have any software representation
>> and cannot be offloaded through the bridge code.
>>
>> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
>> Reviewed-by: Ido Schimmel <idosch@mellanox.com>
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>> ---
>> net/bridge/br_netlink.c | 112 +++++++++++++++++++++++++++++++++++++++---------
>> net/bridge/br_private.h | 4 ++
>> 2 files changed, 96 insertions(+), 20 deletions(-)
>>
>
> Hi Arkadi,
> A few comments below
>
Hi Nikolay,
Thank you very much for the review, will fix.
>> diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
>> index 1e63ec4..1afafb7 100644
>> --- a/net/bridge/br_netlink.c
>> +++ b/net/bridge/br_netlink.c
>> @@ -17,6 +17,7 @@
>> #include <net/net_namespace.h>
>> #include <net/sock.h>
>> #include <uapi/linux/if_bridge.h>
>> +#include <net/switchdev.h>
>>
>> #include "br_private.h"
>> #include "br_private_stp.h"
>> @@ -662,16 +663,52 @@ static int br_set_port_state(struct net_bridge_port *p, u8 state)
>> }
>>
>> /* Set/clear or port flags based on attribute */
>> -static void br_set_port_flag(struct net_bridge_port *p, struct nlattr *tb[],
>> - int attrtype, unsigned long mask)
>> +static int br_set_port_flag(struct net_bridge_port *p, struct nlattr *tb[],
>> + int attrtype, unsigned long mask)
>> {
>> - if (tb[attrtype]) {
>> - u8 flag = nla_get_u8(tb[attrtype]);
>> - if (flag)
>> - p->flags |= mask;
>> - else
>> - p->flags &= ~mask;
>> + struct switchdev_attr attr = {
>> + .orig_dev = p->dev,
>> + .id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
>> + };
>> + unsigned long flags;
>> + int err;
>> +
>> + if (!tb[attrtype])
>> + return 0;
>> +
>> + if (nla_get_u8(tb[attrtype]))
>> + flags = p->flags | mask;
>> + else
>> + flags = p->flags & ~mask;
>> +
>> + if (mask & ~BR_PORT_FLAGS_HW_OFFLOAD)
>> + goto out;
>> +
>> + err = switchdev_port_attr_get(p->dev, &attr);
>> + if (err == -EOPNOTSUPP)
>> + goto out;
>> + if (err)
>> + return err;
>> +
>> + /* Check if specific bridge flag attribute offload is supported */
>> + if (!(attr.u.brport_flags_support & mask)) {
>> + br_warn(p->br, "bridge flag offload is not supported %u(%s)\n",
>> + (unsigned int)p->port_no, p->dev->name);
>> + return -EOPNOTSUPP;
>> + }
>> +
>> + attr.id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS;
>> + attr.flags = SWITCHDEV_F_DEFER;
>> + attr.u.brport_flags = flags;
>> + err = switchdev_port_attr_set(p->dev, &attr);
>> + if (err) {
>> + br_warn(p->br, "error setting offload FLAG on port %u(%s)\n",
>
> Why all caps (FLAG) ?
>
>> + (unsigned int)p->port_no, p->dev->name);
>> + return err;
>> }
>
> I think all of this switchdev-specific code should be contained into br_switchdev.c and
> exported via some function. Anyone changing only the bridge can easily get confused.
>
>> +out:
>> + p->flags = flags;
>> + return 0;
>> }
>>
>> /* Process bridge protocol info on port */
>> @@ -681,20 +718,55 @@ static int br_setport(struct net_bridge_port *p, struct nlattr *tb[])
>> bool br_vlan_tunnel_old = false;
>> int err;
>>
>> - br_set_port_flag(p, tb, IFLA_BRPORT_MODE, BR_HAIRPIN_MODE);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_GUARD, BR_BPDU_GUARD);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_FAST_LEAVE, BR_MULTICAST_FAST_LEAVE);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_PROTECT, BR_ROOT_BLOCK);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_LEARNING, BR_LEARNING);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_UNICAST_FLOOD, BR_FLOOD);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_MCAST_FLOOD, BR_MCAST_FLOOD);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_MCAST_TO_UCAST, BR_MULTICAST_TO_UNICAST);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_BCAST_FLOOD, BR_BCAST_FLOOD);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_PROXYARP, BR_PROXYARP);
>> - br_set_port_flag(p, tb, IFLA_BRPORT_PROXYARP_WIFI, BR_PROXYARP_WIFI);
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_MODE, BR_HAIRPIN_MODE);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_GUARD, BR_BPDU_GUARD);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_FAST_LEAVE, BR_MULTICAST_FAST_LEAVE);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_PROTECT, BR_ROOT_BLOCK);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_LEARNING, BR_LEARNING);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_UNICAST_FLOOD, BR_FLOOD);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_MCAST_FLOOD, BR_MCAST_FLOOD);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_MCAST_TO_UCAST, BR_MULTICAST_TO_UNICAST);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_BCAST_FLOOD, BR_BCAST_FLOOD);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_PROXYARP, BR_PROXYARP);
>> + if (err)
>> + return err;
>> +
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_PROXYARP_WIFI, BR_PROXYARP_WIFI);
>> + if (err)
>> + return err;
>>
>> br_vlan_tunnel_old = (p->flags & BR_VLAN_TUNNEL) ? true : false;
>> - br_set_port_flag(p, tb, IFLA_BRPORT_VLAN_TUNNEL, BR_VLAN_TUNNEL);
>> + err = br_set_port_flag(p, tb, IFLA_BRPORT_VLAN_TUNNEL, BR_VLAN_TUNNEL);
>> + if (err)
>> + return err;
>> +
>> if (br_vlan_tunnel_old && !(p->flags & BR_VLAN_TUNNEL))
>> nbp_vlan_tunnel_info_flush(p);
>>
>> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
>> index 2062692..5dc30ed 100644
>> --- a/net/bridge/br_private.h
>> +++ b/net/bridge/br_private.h
>> @@ -42,6 +42,10 @@
>> /* Path to usermode spanning tree program */
>> #define BR_STP_PROG "/sbin/bridge-stp"
>>
>> +/* Flags that can be offloaded to hardware */
>> +#define BR_PORT_FLAGS_HW_OFFLOAD (BR_LEARNING | BR_FLOOD | \
>> + BR_MCAST_FLOOD | BR_BCAST_FLOOD)
>> +
>> typedef struct bridge_id bridge_id;
>> typedef struct mac_addr mac_addr;
>> typedef __u16 port_id;
>>
>
^ permalink raw reply
* [PATCH net-next 8/9] s390/qeth: add support for early L3 device setup
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
From: Ursula Braun <ubraun@linux.vnet.ibm.com>
Similar to how qeth currently does early L2 setup of OSM and OSN
devices, add support for early setup of L3-only devices.
This adds a qeth_l3_devtype that contains all core and l3-specific
sysfs attributes, so that they can be created in one go while probing.
This just adds the infrastructure, exploitation of the support happens
in a subsequent patch.
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reviewed-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l3.h | 1 +
drivers/s390/net/qeth_l3_main.c | 18 +++++++++++++-----
drivers/s390/net/qeth_l3_sys.c | 11 +++++++++++
3 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/s390/net/qeth_l3.h b/drivers/s390/net/qeth_l3.h
index 26f79533e62e..9b5e439f18cf 100644
--- a/drivers/s390/net/qeth_l3.h
+++ b/drivers/s390/net/qeth_l3.h
@@ -65,6 +65,7 @@ struct qeth_ipato_entry {
int mask_bits;
};
+extern const struct attribute_group *qeth_l3_attr_groups[];
void qeth_l3_ipaddr_to_string(enum qeth_prot_versions, const __u8 *, char *);
int qeth_l3_string_to_ipaddr(const char *, enum qeth_prot_versions, __u8 *);
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index fb4eee2a46ee..37b594231b76 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3005,14 +3005,21 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
return register_netdev(card->dev);
}
+static const struct device_type qeth_l3_devtype = {
+ .name = "qeth_layer3",
+ .groups = qeth_l3_attr_groups,
+};
+
static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
{
struct qeth_card *card = dev_get_drvdata(&gdev->dev);
int rc;
- rc = qeth_l3_create_device_attributes(&gdev->dev);
- if (rc)
- return rc;
+ if (gdev->dev.type == &qeth_generic_devtype) {
+ rc = qeth_l3_create_device_attributes(&gdev->dev);
+ if (rc)
+ return rc;
+ }
hash_init(card->ip_htable);
hash_init(card->ip_mc_htable);
card->options.layer2 = 0;
@@ -3024,7 +3031,8 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev)
{
struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
- qeth_l3_remove_device_attributes(&cgdev->dev);
+ if (cgdev->dev.type == &qeth_generic_devtype)
+ qeth_l3_remove_device_attributes(&cgdev->dev);
qeth_set_allowed_threads(card, 0, 1);
wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
@@ -3280,7 +3288,7 @@ static int qeth_l3_control_event(struct qeth_card *card,
}
struct qeth_discipline qeth_l3_discipline = {
- .devtype = &qeth_generic_devtype,
+ .devtype = &qeth_l3_devtype,
.start_poll = qeth_qdio_start_poll,
.input_handler = (qdio_handler_t *) qeth_qdio_input_handler,
.output_handler = (qdio_handler_t *) qeth_qdio_output_handler,
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index ff29a4b416b4..f2f94f59e0fa 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -1049,3 +1049,14 @@ void qeth_l3_remove_device_attributes(struct device *dev)
sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
sysfs_remove_group(&dev->kobj, &qeth_device_rxip_group);
}
+
+const struct attribute_group *qeth_l3_attr_groups[] = {
+ &qeth_device_attr_group,
+ &qeth_device_blkt_group,
+ /* l3 specific, see l3_{create,remove}_device_attributes(): */
+ &qeth_l3_device_attr_group,
+ &qeth_device_ipato_group,
+ &qeth_device_vipa_group,
+ &qeth_device_rxip_group,
+NULL,
+};
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 7/9] s390/qeth: silence qeth_fix_features()
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
Noting the lack of TSO support on every feature change is just silly,
in particular since the requested features might not even affect
NETIF_F_TSO.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index a159eb900d03..3cc802cff9d1 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -6390,11 +6390,8 @@ netdev_features_t qeth_fix_features(struct net_device *dev,
features &= ~NETIF_F_IP_CSUM;
if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM))
features &= ~NETIF_F_RXCSUM;
- if (!qeth_is_supported(card, IPA_OUTBOUND_TSO)) {
+ if (!qeth_is_supported(card, IPA_OUTBOUND_TSO))
features &= ~NETIF_F_TSO;
- dev_info(&card->gdev->dev, "Outbound TSO not supported on %s\n",
- QETH_CARD_IFNAME(card));
- }
/* if the card isn't up, remove features that require hw changes */
if (card->state == CARD_STATE_DOWN ||
card->state == CARD_STATE_RECOVER)
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 9/9] s390/qeth: do early device setup for z/VM IQD NICs
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
qeth currently supports early setup for OSM and OSN devices.
This patch adds early setup support for z/VM HiperSockets,
since they can only be coupled to L3 networks.
Based on an initial version by Dmitriy Lakhvich.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core.h | 2 ++
drivers/s390/net/qeth_core_main.c | 44 ++++++++++++++++++++++++++++++---------
drivers/s390/net/qeth_core_sys.c | 2 +-
3 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 30bc6105aac3..0efc54a4d82f 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -659,6 +659,7 @@ struct qeth_card_info {
int max_mtu;
int broadcast_capable;
int unique_id;
+ bool layer_enforced;
struct qeth_card_blkt blkt;
enum qeth_ipa_promisc_modes promisc_mode;
__u32 diagass_support;
@@ -696,6 +697,7 @@ struct qeth_osn_info {
};
enum qeth_discipline_id {
+ QETH_DISCIPLINE_UNDETERMINED = -1,
QETH_DISCIPLINE_LAYER3 = 0,
QETH_DISCIPLINE_LAYER2 = 1,
};
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 3cc802cff9d1..1fb92e870040 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1723,6 +1723,25 @@ static void qeth_configure_unitaddr(struct qeth_card *card, char *prcd)
(prcd[0x11] == _ascebc['M']));
}
+/* Determine whether the device requires a specific layer discipline */
+static enum qeth_discipline_id qeth_enforce_discipline(struct qeth_card *card)
+{
+ if (card->info.type == QETH_CARD_TYPE_OSM ||
+ card->info.type == QETH_CARD_TYPE_OSN) {
+ QETH_DBF_TEXT(SETUP, 3, "force l2");
+ return QETH_DISCIPLINE_LAYER2;
+ }
+
+ /* virtual HiperSocket is L3 only: */
+ if (card->info.guestlan && card->info.type == QETH_CARD_TYPE_IQD) {
+ QETH_DBF_TEXT(SETUP, 3, "force l3");
+ return QETH_DISCIPLINE_LAYER3;
+ }
+
+ QETH_DBF_TEXT(SETUP, 3, "force no");
+ return QETH_DISCIPLINE_UNDETERMINED;
+}
+
static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd)
{
QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
@@ -5485,6 +5504,7 @@ int qeth_core_load_discipline(struct qeth_card *card,
enum qeth_discipline_id discipline)
{
int rc = 0;
+
mutex_lock(&qeth_mod_mutex);
switch (discipline) {
case QETH_DISCIPLINE_LAYER3:
@@ -5495,7 +5515,10 @@ int qeth_core_load_discipline(struct qeth_card *card,
card->discipline = try_then_request_module(
symbol_get(qeth_l2_discipline), "qeth_l2");
break;
+ default:
+ break;
}
+
if (!card->discipline) {
dev_err(&card->gdev->dev, "There is no kernel module to "
"support discipline %d\n", discipline);
@@ -5598,6 +5621,7 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
struct qeth_card *card;
struct device *dev;
int rc;
+ enum qeth_discipline_id enforced_disc;
unsigned long flags;
char dbf_name[DBF_NAME_LEN];
@@ -5645,10 +5669,15 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
goto err_card;
}
- switch (card->info.type) {
- case QETH_CARD_TYPE_OSN:
- case QETH_CARD_TYPE_OSM:
- rc = qeth_core_load_discipline(card, QETH_DISCIPLINE_LAYER2);
+ qeth_determine_capabilities(card);
+ enforced_disc = qeth_enforce_discipline(card);
+ switch (enforced_disc) {
+ case QETH_DISCIPLINE_UNDETERMINED:
+ gdev->dev.type = &qeth_generic_devtype;
+ break;
+ default:
+ card->info.layer_enforced = true;
+ rc = qeth_core_load_discipline(card, enforced_disc);
if (rc)
goto err_card;
@@ -5659,16 +5688,11 @@ static int qeth_core_probe_device(struct ccwgroup_device *gdev)
if (rc)
goto err_disc;
break;
- default:
- gdev->dev.type = &qeth_generic_devtype;
- break;
}
write_lock_irqsave(&qeth_core_card_list.rwlock, flags);
list_add_tail(&card->list, &qeth_core_card_list.list);
write_unlock_irqrestore(&qeth_core_card_list.rwlock, flags);
-
- qeth_determine_capabilities(card);
return 0;
err_disc:
@@ -5705,7 +5729,7 @@ static int qeth_core_set_online(struct ccwgroup_device *gdev)
{
struct qeth_card *card = dev_get_drvdata(&gdev->dev);
int rc = 0;
- int def_discipline;
+ enum qeth_discipline_id def_discipline;
if (!card->discipline) {
if (card->info.type == QETH_CARD_TYPE_IQD)
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index db6a285d41e0..6d255c22656d 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -413,7 +413,7 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
if (card->options.layer2 == newdis)
goto out;
- if (card->info.type == QETH_CARD_TYPE_OSM) {
+ if (card->info.layer_enforced) {
/* fixed layer, can't switch */
rc = -EOPNOTSUPP;
goto out;
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 4/9] s390/qeth: log bridgeport capabilities
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
Bridgeport is a l2-specific feature, and we should write its
capabilities to a debug entry.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l2_main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index bd2df62a5cdf..70b633f951ea 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -1017,6 +1017,13 @@ static int qeth_l2_start_ipassists(struct qeth_card *card)
return 0;
}
+static void qeth_l2_trace_features(struct qeth_card *card)
+{
+ QETH_CARD_TEXT(card, 2, "l2featur");
+ QETH_CARD_HEX(card, 2, &card->options.sbp.supported_funcs,
+ sizeof(card->options.sbp.supported_funcs));
+}
+
static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
{
struct qeth_card *card = dev_get_drvdata(&gdev->dev);
@@ -1040,6 +1047,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
dev_info(&card->gdev->dev,
"The device represents a Bridge Capable Port\n");
qeth_trace_features(card);
+ qeth_l2_trace_features(card);
if (!card->dev && qeth_l2_setup_netdev(card)) {
rc = -ENODEV;
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 2/9] s390/qeth: remove skb_is_nonlinear() check on IQD
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
qeth doesn't advertise NETIF_F_SG for L3 IQDs. So trust the stack to
not hand us any nonlinear skbs, and remove an always-true condition.
With the fact that data_offset < 0 is no longer possible on IQDs,
apply a small cleanup to subsequent code.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Acked-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l3_main.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index ac8310fe2fb0..56e813972d77 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2676,8 +2676,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
use_tso = skb_is_gso(skb) &&
(qeth_get_ip_protocol(skb) == IPPROTO_TCP) && (ipv == 4);
- if ((card->info.type == QETH_CARD_TYPE_IQD) &&
- !skb_is_nonlinear(skb)) {
+ if (card->info.type == QETH_CARD_TYPE_IQD) {
new_skb = skb;
data_offset = ETH_HLEN;
hdr = kmem_cache_alloc(qeth_core_header_cache, GFP_ATOMIC);
@@ -2690,12 +2689,7 @@ static netdev_tx_t qeth_l3_hard_start_xmit(struct sk_buff *skb,
+ VLAN_HLEN);
if (!new_skb)
goto tx_drop;
- }
- if (card->info.type == QETH_CARD_TYPE_IQD) {
- if (data_offset < 0)
- skb_pull(new_skb, ETH_HLEN);
- } else {
if (ipv == 4) {
skb_pull(new_skb, ETH_HLEN);
}
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 6/9] s390/qeth: consolidate pack buffer flushing
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
qeth_switch_to_nonpacking_if_needed() contains an open-coded version
of qeth_flush_buffers_on_no_pci(). Extract a single helper instead.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Acked-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 65 +++++++++++++++------------------------
1 file changed, 25 insertions(+), 40 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index dba7d00715e3..a159eb900d03 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -3347,6 +3347,28 @@ static void qeth_handle_send_error(struct qeth_card *card,
(u16)qdio_err, (u8)sbalf15);
}
+/**
+ * qeth_prep_flush_pack_buffer - Prepares flushing of a packing buffer.
+ * @queue: queue to check for packing buffer
+ *
+ * Returns number of buffers that were prepared for flush.
+ */
+static int qeth_prep_flush_pack_buffer(struct qeth_qdio_out_q *queue)
+{
+ struct qeth_qdio_out_buffer *buffer;
+
+ buffer = queue->bufs[queue->next_buf_to_fill];
+ if ((atomic_read(&buffer->state) == QETH_QDIO_BUF_EMPTY) &&
+ (buffer->next_element_to_fill > 0)) {
+ /* it's a packing buffer */
+ atomic_set(&buffer->state, QETH_QDIO_BUF_PRIMED);
+ queue->next_buf_to_fill =
+ (queue->next_buf_to_fill + 1) % QDIO_MAX_BUFFERS_PER_Q;
+ return 1;
+ }
+ return 0;
+}
+
/*
* Switched to packing state if the number of used buffers on a queue
* reaches a certain limit.
@@ -3373,9 +3395,6 @@ static void qeth_switch_to_packing_if_needed(struct qeth_qdio_out_q *queue)
*/
static int qeth_switch_to_nonpacking_if_needed(struct qeth_qdio_out_q *queue)
{
- struct qeth_qdio_out_buffer *buffer;
- int flush_count = 0;
-
if (queue->do_pack) {
if (atomic_read(&queue->used_buffers)
<= QETH_LOW_WATERMARK_PACK) {
@@ -3384,42 +3403,9 @@ static int qeth_switch_to_nonpacking_if_needed(struct qeth_qdio_out_q *queue)
if (queue->card->options.performance_stats)
queue->card->perf_stats.sc_p_dp++;
queue->do_pack = 0;
- /* flush packing buffers */
- buffer = queue->bufs[queue->next_buf_to_fill];
- if ((atomic_read(&buffer->state) ==
- QETH_QDIO_BUF_EMPTY) &&
- (buffer->next_element_to_fill > 0)) {
- atomic_set(&buffer->state,
- QETH_QDIO_BUF_PRIMED);
- flush_count++;
- queue->next_buf_to_fill =
- (queue->next_buf_to_fill + 1) %
- QDIO_MAX_BUFFERS_PER_Q;
- }
+ return qeth_prep_flush_pack_buffer(queue);
}
}
- return flush_count;
-}
-
-
-/*
- * Called to flush a packing buffer if no more pci flags are on the queue.
- * Checks if there is a packing buffer and prepares it to be flushed.
- * In that case returns 1, otherwise zero.
- */
-static int qeth_flush_buffers_on_no_pci(struct qeth_qdio_out_q *queue)
-{
- struct qeth_qdio_out_buffer *buffer;
-
- buffer = queue->bufs[queue->next_buf_to_fill];
- if ((atomic_read(&buffer->state) == QETH_QDIO_BUF_EMPTY) &&
- (buffer->next_element_to_fill > 0)) {
- /* it's a packing buffer */
- atomic_set(&buffer->state, QETH_QDIO_BUF_PRIMED);
- queue->next_buf_to_fill =
- (queue->next_buf_to_fill + 1) % QDIO_MAX_BUFFERS_PER_Q;
- return 1;
- }
return 0;
}
@@ -3532,8 +3518,7 @@ static void qeth_check_outbound_queue(struct qeth_qdio_out_q *queue)
flush_cnt += qeth_switch_to_nonpacking_if_needed(queue);
if (!flush_cnt &&
!atomic_read(&queue->set_pci_flags_count))
- flush_cnt +=
- qeth_flush_buffers_on_no_pci(queue);
+ flush_cnt += qeth_prep_flush_pack_buffer(queue);
if (queue->card->options.performance_stats &&
q_was_packing)
queue->card->perf_stats.bufs_sent_pack +=
@@ -4127,7 +4112,7 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
* flag out on the queue
*/
if (!flush_count && !atomic_read(&queue->set_pci_flags_count))
- flush_count += qeth_flush_buffers_on_no_pci(queue);
+ flush_count += qeth_prep_flush_pack_buffer(queue);
if (flush_count)
qeth_flush_buffers(queue, start_index, flush_count);
}
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 5/9] s390/qeth: add missing strings for IPA return codes
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
commit 76b11f8e270f ("qeth: HiperSockets Network Traffic Analyzer")
missed adding the human-readable translations when adding new RCs.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Acked-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_mpc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/s390/net/qeth_core_mpc.c b/drivers/s390/net/qeth_core_mpc.c
index beb4bdc26de5..ab9b1376467f 100644
--- a/drivers/s390/net/qeth_core_mpc.c
+++ b/drivers/s390/net/qeth_core_mpc.c
@@ -167,6 +167,8 @@ static struct ipa_rc_msg qeth_ipa_rc_msg[] = {
{IPA_RC_IP_TABLE_FULL, "Add Addr IP Table Full - ipv6"},
{IPA_RC_UNKNOWN_ERROR, "IPA command failed - reason unknown"},
{IPA_RC_UNSUPPORTED_COMMAND, "Command not supported"},
+ {IPA_RC_TRACE_ALREADY_ACTIVE, "trace already active"},
+ {IPA_RC_INVALID_FORMAT, "invalid format or length"},
{IPA_RC_DUP_IPV6_REMOTE, "ipv6 address already registered remote"},
{IPA_RC_DUP_IPV6_HOME, "ipv6 address already registered"},
{IPA_RC_UNREGISTERED_ADDR, "Address not registered"},
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 3/9] s390/qeth: query IPv6 IPA support on HiperSockets
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
HiperSocket devices don't need the full IPv6 initialization, but we
should still query the supported assists for logging purposes.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Acked-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_l3_main.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 56e813972d77..fb4eee2a46ee 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1035,9 +1035,6 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
QETH_CARD_TEXT(card, 3, "softipv6");
- if (card->info.type == QETH_CARD_TYPE_IQD)
- goto out;
-
rc = qeth_query_ipassists(card, QETH_PROT_IPV6);
if (rc) {
dev_err(&card->gdev->dev,
@@ -1045,6 +1042,10 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
QETH_CARD_IFNAME(card));
return rc;
}
+
+ if (card->info.type == QETH_CARD_TYPE_IQD)
+ goto out;
+
rc = qeth_send_simple_setassparms(card, IPA_IPV6,
IPA_CMD_ASS_START, 3);
if (rc) {
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 1/9] s390/qeth: remove support for IPA_IP_FRAGMENTATION
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20170606123350.13781-1-jwi@linux.vnet.ibm.com>
This Assist was never actually implemented in any hardware, so just
remove the leftovers.
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Reviewed-by: Hans Wippel <hwippel@linux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 3 +--
drivers/s390/net/qeth_core_mpc.h | 2 +-
drivers/s390/net/qeth_l3_main.c | 26 --------------------------
3 files changed, 2 insertions(+), 29 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index fc6d85f2b38d..dba7d00715e3 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -4199,8 +4199,7 @@ int qeth_change_mtu(struct net_device *dev, int new_mtu)
sprintf(dbf_text, "%8x", new_mtu);
QETH_CARD_TEXT(card, 4, dbf_text);
- if ((!qeth_is_supported(card, IPA_IP_FRAGMENTATION)) &&
- (!qeth_mtu_is_valid(card, new_mtu)))
+ if (!qeth_mtu_is_valid(card, new_mtu))
return -EINVAL;
dev->mtu = new_mtu;
return 0;
diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h
index 4accb0a61ce0..45bbea2843bf 100644
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -192,7 +192,7 @@ enum qeth_ipa_funcs {
IPA_ARP_PROCESSING = 0x00000001L,
IPA_INBOUND_CHECKSUM = 0x00000002L,
IPA_OUTBOUND_CHECKSUM = 0x00000004L,
- IPA_IP_FRAGMENTATION = 0x00000008L,
+ /* RESERVED = 0x00000008L,*/
IPA_FILTERING = 0x00000010L,
IPA_IPV6 = 0x00000020L,
IPA_MULTICASTING = 0x00000040L,
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index d8df1e635163..ac8310fe2fb0 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -956,31 +956,6 @@ static int qeth_l3_start_ipa_arp_processing(struct qeth_card *card)
return rc;
}
-static int qeth_l3_start_ipa_ip_fragmentation(struct qeth_card *card)
-{
- int rc;
-
- QETH_CARD_TEXT(card, 3, "ipaipfrg");
-
- if (!qeth_is_supported(card, IPA_IP_FRAGMENTATION)) {
- dev_info(&card->gdev->dev,
- "Hardware IP fragmentation not supported on %s\n",
- QETH_CARD_IFNAME(card));
- return -EOPNOTSUPP;
- }
-
- rc = qeth_send_simple_setassparms(card, IPA_IP_FRAGMENTATION,
- IPA_CMD_ASS_START, 0);
- if (rc) {
- dev_warn(&card->gdev->dev,
- "Starting IP fragmentation support for %s failed\n",
- QETH_CARD_IFNAME(card));
- } else
- dev_info(&card->gdev->dev,
- "Hardware IP fragmentation enabled \n");
- return rc;
-}
-
static int qeth_l3_start_ipa_source_mac(struct qeth_card *card)
{
int rc;
@@ -1171,7 +1146,6 @@ static int qeth_l3_start_ipassists(struct qeth_card *card)
if (qeth_set_access_ctrl_online(card, 0))
return -EIO;
qeth_l3_start_ipa_arp_processing(card); /* go on*/
- qeth_l3_start_ipa_ip_fragmentation(card); /* go on*/
qeth_l3_start_ipa_source_mac(card); /* go on*/
qeth_l3_start_ipa_vlan(card); /* go on*/
qeth_l3_start_ipa_multicast(card); /* go on*/
--
2.11.2
^ permalink raw reply related
* [PATCH net-next 0/9] s390/net updates
From: Julian Wiedmann @ 2017-06-06 12:33 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
Stefan Raspl, Ursula Braun, Julian Wiedmann
Hi Dave,
please apply the following qeth updates for net-next.
Aside from some janitorial changes, this adds early setup for virtualized
HiperSockets devices - building upon the code that landed via -net earlier.
Thanks,
Julian
Julian Wiedmann (8):
s390/qeth: remove support for IPA_IP_FRAGMENTATION
s390/qeth: remove skb_is_nonlinear() check on IQD
s390/qeth: query IPv6 IPA support on HiperSockets
s390/qeth: log bridgeport capabilities
s390/qeth: add missing strings for IPA return codes
s390/qeth: consolidate pack buffer flushing
s390/qeth: silence qeth_fix_features()
s390/qeth: do early device setup for z/VM IQD NICs
Ursula Braun (1):
s390/qeth: add support for early L3 device setup
drivers/s390/net/qeth_core.h | 2 +
drivers/s390/net/qeth_core_main.c | 117 ++++++++++++++++++++------------------
drivers/s390/net/qeth_core_mpc.c | 2 +
drivers/s390/net/qeth_core_mpc.h | 2 +-
drivers/s390/net/qeth_core_sys.c | 2 +-
drivers/s390/net/qeth_l2_main.c | 8 +++
drivers/s390/net/qeth_l3.h | 1 +
drivers/s390/net/qeth_l3_main.c | 59 ++++++-------------
drivers/s390/net/qeth_l3_sys.c | 11 ++++
9 files changed, 105 insertions(+), 99 deletions(-)
--
2.11.2
^ permalink raw reply
* Re: [patch net-next v2 1/6] net: sched: introduce a TRAP control action
From: Andrew Lunn @ 2017-06-06 12:22 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, davem, jhs, xiyou.wangcong, edumazet, alexander.h.duyck,
stephen, daniel, mlxsw
In-Reply-To: <20170606121207.2921-2-jiri@resnulli.us>
On Tue, Jun 06, 2017 at 02:12:02PM +0200, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> There is need to instruct the HW offloaded path to push certain matched
> packets to cpu/kernel for further analysis. So this patch introduces a
> new TRAP control action to TC.
>
> For kernel datapath, this action does not make much sense. So with the
> same logic as in HW, new TRAP behaves similar to STOLEN. The skb is just
> dropped in the datapath (and virtually ejected to an upper level, which
> does not exist in case of kernel).
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> Reviewed-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* pull-request: wireless-drivers 2017-06-06
From: Kalle Valo @ 2017-06-06 12:20 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev, linux-kernel
Hi Dave,
fixes to net tree, more info in the tag below. Please let me know if
there are any problems.
Kalle
The following changes since commit 6d18c732b95c0a9d35e9f978b4438bba15412284:
bridge: start hello_timer when enabling KERNEL_STP in br_stp_start (2017-05-21 13:33:28 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git tags/wireless-drivers-for-davem-2017-06-06
for you to fetch changes up to dc89481bb4c9af0700423e21c8371379d3d943b1:
Merge tag 'iwlwifi-for-kalle-2017-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes (2017-06-05 22:21:25 +0300)
----------------------------------------------------------------
wireless-drivers fixes for 4.12
It has been a slow start of cycle and this the first set of fixes for
4.12. Nothing really major here.
wcn36xx
* fix an issue with module reload
brcmfmac
* fix aligment regression on 64 bit systems
iwlwifi
* fixes for memory leaks, runtime PM, memory initialisation and other
smaller problems
* fix IBSS on devices using DQA mode (7260 and up)
* fix the minimum firmware API requirement for 7265D, 3168, 8000 and
8265
----------------------------------------------------------------
Arend Van Spriel (1):
brcmfmac: fix alignment configuration on host using 64-bit DMA
Bjorn Andersson (1):
wcn36xx: Close SMD channel on device removal
Emmanuel Grumbach (1):
iwlwifi: mvm: fix firmware debug restart recording
Gregory Greenman (1):
iwlwifi: mvm: rs: start using LQ command color
Haim Dreyfuss (1):
iwlwifi: mvm: Fix command queue number on d0i3 flow
Johannes Berg (2):
iwlwifi: tt: move ucode_loaded check under mutex
iwlwifi: mvm: clear new beacon command template struct
Kalle Valo (1):
Merge tag 'iwlwifi-for-kalle-2017-06-05' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Liad Kaufman (1):
iwlwifi: mvm: support ibss in dqa mode
Luca Coelho (3):
iwlwifi: pcie: only use d0i3 in suspend/resume if system_pm is set to d0i3
iwlwifi: mvm: don't fail when removing a key from an inexisting sta
iwlwifi: fix min API version for 7265D, 3168, 8000 and 8265
Shahar S Matityahu (1):
iwlwifi: fix host command memory leaks
drivers/net/wireless/ath/wcn36xx/main.c | 2 +
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +-
drivers/net/wireless/intel/iwlwifi/iwl-7000.c | 4 +-
drivers/net/wireless/intel/iwlwifi/iwl-8000.c | 4 +-
drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-rs.h | 5 +++
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h | 3 ++
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c | 12 +-----
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 ++-
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 32 +++++++++++----
drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 46 ++++++----------------
drivers/net/wireless/intel/iwlwifi/mvm/rs.h | 15 +++++++
drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 26 +++++++-----
drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 2 +
drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 8 ++--
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 12 +++++-
drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 6 ++-
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 9 +++--
19 files changed, 118 insertions(+), 79 deletions(-)
^ 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