* Re: [PATCH net-next] can: fix build error without CONFIG_PROC_FS
From: Marc Kleine-Budde @ 2017-04-27 14:29 UTC (permalink / raw)
To: Arnd Bergmann, Oliver Hartkopp, David S. Miller
Cc: Thomas Gleixner, Cong Wang, Mario Kicherer, Eric Dumazet,
linux-can, netdev, linux-kernel
In-Reply-To: <20170427142146.3107957-1-arnd@arndb.de>
[-- Attachment #1.1: Type: text/plain, Size: 1409 bytes --]
Hello Arnd,
On 04/27/2017 04:21 PM, Arnd Bergmann wrote:
> The procfs dir entry was added inside of an #ifdef, causing a build error
> when we try to access it without CONFIG_PROC_FS set:
>
> net/can/bcm.c:1541:14: error: 'struct netns_can' has no member named 'bcmproc_dir'
> net/can/bcm.c: In function 'bcm_connect':
> net/can/bcm.c:1601:14: error: 'struct netns_can' has no member named 'bcmproc_dir'
> net/can/bcm.c: In function 'canbcm_pernet_init':
> net/can/bcm.c:1696:11: error: 'struct netns_can' has no member named 'bcmproc_dir'
> net/can/bcm.c: In function 'canbcm_pernet_exit':
> net/can/bcm.c:1707:15: error: 'struct netns_can' has no member named 'bcmproc_dir'
>
> This adds the same #ifdef around all users of the pointer. Alternatively
> we could move the pointer outside of the #ifdef.
>
> Fixes: 384317ef4187 ("can: network namespace support for CAN_BCM protocol")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
A fix for this problem is part of the pull request I send to David
earlier today:
https://www.mail-archive.com/netdev@vger.kernel.org/msg165764.html
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [REGRESSION next-20170426] Commit 09515ef5ddad ("of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices") causes oops in mvneta
From: Ralph Sennhauser @ 2017-04-27 14:40 UTC (permalink / raw)
To: Sricharan R
Cc: Rafael J. Wysocki, Joerg Roedel, Bjorn Helgaas, linux-acpi,
linux-kernel, linux-pci, Thomas Petazzoni, netdev
In-Reply-To: <2fb57b9b-3944-d9cc-1fac-8dcccaa0c37a@codeaurora.org>
On Thu, 27 Apr 2017 19:05:09 +0530
Sricharan R <sricharan@codeaurora.org> wrote:
> Hi,
>
> On 4/26/2017 9:45 PM, Ralph Sennhauser wrote:
> > Hi Sricharan R,
> >
> > Commit 09515ef5ddad ("of/acpi: Configure dma operations at probe
> > time for platform/amba/pci bus devices") causes a kernel panic as
> > in the log below on an armada-385. Reverting the commit fixes the
> > issue.
> >
> > Regards
> > Ralph
>
> Somehow not getting a obvious clue on whats going wrong with the logs
> below. From the log and looking in to dts, the drivers seems to the
> one for "marvell,armada-370-neta".
Correct.
> Issue looks the data from the dma
> has gone bad and subsequently referring the wrong data has resulted
> in the crash. Looks like the dma_masks is the one going wrong.
> Can i get some logs from mvneta_probe, about dev->dma_mask,
> dev->coherent_dma_mask and dev->dma_ops with and without the patch
> to see whats the difference ?
Not sure I understood what exactly you are after. Might be faster to
just send me a patch with all debug print statements you like to see.
Regards
Ralph
^ permalink raw reply
* Re: [PATCH net-next 6/6] bpf: show bpf programs
From: Alexei Starovoitov @ 2017-04-27 14:45 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: netdev@vger.kernel.org, Alexei Starovoitov, daniel, Jiri Benc,
Aaron Conole, Martin KaFai Lau
On Thu, Apr 27, 2017 at 6:28 AM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
>
>> I don't want this to become debugfs for bpf.
>
> Right now it just prints a list of ebpf programs. You reject of where
> things are going or do you already reject this particular patch?
both.
procfs/debugfs always starts as 'i just print a little, because it's easier'
and the next thing you know it's full of knobs and user tooling
to parse this text.
^ permalink raw reply
* Re: [PATCH net-next 4/6] bpf: track if the bpf program was loaded with SYS_ADMIN capabilities
From: Alexei Starovoitov @ 2017-04-27 14:49 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: netdev@vger.kernel.org, Alexei Starovoitov, Jiri Benc,
Aaron Conole, Daniel Borkmann
On Thu, Apr 27, 2017 at 6:17 AM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
>
> cap_sys_admin influences the verifier a lot in terms which programs are
> accepted and which are not. So during investigations it might be even
> interesting if the bpf program required those special flags or if the
> same program could be loaded just as underprivileged.
there are bunch of other things that influence verifier.
should we add all of them ?
there is prog->aux->user which is more than enough for
debugging.
^ permalink raw reply
* [PATCH net-next 0/9] support unique MAC addresses for slave devices
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
Currently every slave device gets assigned the same MAC address, by
having it copied from the master interface. Since some code paths
depend on this identity, changing the MAC address on slave interfaces
is not supported. However identical MAC addresses can pose problems to
management and orchestration software that correctly expect network
interfaces on the same segment to have unique addresses.
Patches 1-8 include style fixes and refactoring (patch 9 depends upon)
that improve the overal quality and make the intruduction of the
feature straightforward.
Patch 9 enables slave devices to own unique MAC addresses and change
such addresses live, fixing lack of support and a related bug, as
MAC address changes on master were not propagated to slave devices.
In order to preserve the main peculiarity of this driver, that is
exposing only a single MAC address for outbound traffic, frames
egressing from master are now effectively masquerated when working in
L2 mode.
Marco Chiappero (9):
ipvlan: fix coding style for the ipvlan tree
ipvlan: refactor ipvlan_process_multicast for readability
ipvlan: replace ipvlan_rcv_frame
ipvlan: rework the IP lookup function
ipvlan: improve and uniform naming
ipvlan: reposition three functions
ipvlan: relocate ipvlan_skb_crossing_ns calls
ipvlan: improve compiler hints
ipvlan: introduce individual MAC addresses
drivers/net/ipvlan/ipvlan.h | 2 +-
drivers/net/ipvlan/ipvlan_core.c | 592 ++++++++++++++++++++-------------------
drivers/net/ipvlan/ipvlan_main.c | 49 ++--
drivers/net/ipvlan/ipvtap.c | 1 +
4 files changed, 333 insertions(+), 311 deletions(-)
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply
* [PATCH net-next 1/9] ipvlan: fix coding style for the ipvlan tree
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
Update the ipvlan and ipvtap drivers to comply to the Linux coding
style, fixing errors and warnings reported by checkpatch.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 29 ++++++++++++++++-------------
drivers/net/ipvlan/ipvlan_main.c | 31 ++++++++++++++-----------------
drivers/net/ipvlan/ipvtap.c | 1 +
3 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 1f3295e..1266f01 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -17,7 +17,7 @@ void ipvlan_init_secret(void)
}
void ipvlan_count_rx(const struct ipvl_dev *ipvlan,
- unsigned int len, bool success, bool mcast)
+ unsigned int len, bool success, bool mcast)
{
if (likely(success)) {
struct ipvl_pcpu_stats *pcptr;
@@ -95,9 +95,9 @@ struct ipvl_addr *ipvlan_find_addr(const struct ipvl_dev *ipvlan,
list_for_each_entry(addr, &ipvlan->addrs, anode) {
if ((is_v6 && addr->atype == IPVL_IPV6 &&
- ipv6_addr_equal(&addr->ip6addr, iaddr)) ||
+ ipv6_addr_equal(&addr->ip6addr, iaddr)) ||
(!is_v6 && addr->atype == IPVL_IPV4 &&
- addr->ip4addr.s_addr == ((struct in_addr *)iaddr)->s_addr))
+ addr->ip4addr.s_addr == ((struct in_addr *)iaddr)->s_addr))
return addr;
}
return NULL;
@@ -179,7 +179,7 @@ static void *ipvlan_get_L3_hdr(struct sk_buff *skb, int *type)
unsigned int ipvlan_mac_hash(const unsigned char *addr)
{
- u32 hash = jhash_1word(__get_unaligned_cpu32(addr+2),
+ u32 hash = jhash_1word(__get_unaligned_cpu32(addr + 2),
ipvlan_jhash_secret);
return hash & IPVLAN_MAC_FILTER_MASK;
@@ -234,11 +234,13 @@ void ipvlan_process_multicast(struct work_struct *work)
nskb->pkt_type = pkt_type;
nskb->dev = ipvlan->dev;
if (tx_pkt)
- ret = dev_forward_skb(ipvlan->dev, nskb);
+ ret = dev_forward_skb(ipvlan->dev,
+ nskb);
else
ret = netif_rx(nskb);
}
- ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS, true);
+ ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS,
+ true);
local_bh_enable();
}
rcu_read_unlock();
@@ -461,11 +463,11 @@ static int ipvlan_process_outbound(struct sk_buff *skb)
skb_reset_network_header(skb);
}
- if (skb->protocol == htons(ETH_P_IPV6))
+ if (skb->protocol == htons(ETH_P_IPV6)) {
ret = ipvlan_process_v6_outbound(skb);
- else if (skb->protocol == htons(ETH_P_IP))
+ } else if (skb->protocol == htons(ETH_P_IP)) {
ret = ipvlan_process_v4_outbound(skb);
- else {
+ } else {
pr_warn_ratelimited("Dropped outbound packet type=%x\n",
ntohs(skb->protocol));
kfree_skb(skb);
@@ -534,7 +536,8 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
if (ether_addr_equal(eth->h_dest, eth->h_source)) {
lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
if (lyr3h) {
- addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true);
+ addr = ipvlan_addr_lookup(ipvlan->port, lyr3h,
+ addr_type, true);
if (addr)
return ipvlan_rcv_frame(addr, &skb, true);
}
@@ -570,7 +573,7 @@ int ipvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
if (unlikely(!pskb_may_pull(skb, sizeof(struct ethhdr))))
goto out;
- switch(port->mode) {
+ switch (port->mode) {
case IPVLAN_MODE_L2:
return ipvlan_xmit_mode_l2(skb, dev);
case IPVLAN_MODE_L3:
@@ -580,7 +583,7 @@ int ipvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
/* Should not reach here */
WARN_ONCE(true, "ipvlan_queue_xmit() called for mode = [%hx]\n",
- port->mode);
+ port->mode);
out:
kfree_skb(skb);
return NET_XMIT_DROP;
@@ -685,7 +688,7 @@ rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb)
/* Should not reach here */
WARN_ONCE(true, "ipvlan_handle_frame() called for mode = [%hx]\n",
- port->mode);
+ port->mode);
kfree_skb(skb);
return RX_HANDLER_CONSUMED;
}
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index aa8575c..b837807 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -9,7 +9,7 @@
#include "ipvlan.h"
-static u32 ipvl_nf_hook_refcnt = 0;
+static u32 ipvl_nf_hook_refcnt;
static struct nf_hook_ops ipvl_nfops[] __read_mostly = {
{
@@ -73,8 +73,9 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval)
if (!err) {
mdev->l3mdev_ops = &ipvl_l3mdev_ops;
mdev->priv_flags |= IFF_L3MDEV_MASTER;
- } else
+ } else {
return err;
+ }
} else if (port->mode == IPVLAN_MODE_L3S) {
/* Old mode was L3S */
mdev->priv_flags &= ~IFF_L3MDEV_MASTER;
@@ -107,7 +108,7 @@ static int ipvlan_port_create(struct net_device *dev)
return -EBUSY;
}
- port = kzalloc(sizeof(struct ipvl_port), GFP_KERNEL);
+ port = kzalloc(sizeof(*port), GFP_KERNEL);
if (!port)
return -ENOMEM;
@@ -163,7 +164,7 @@ static void ipvlan_port_destroy(struct net_device *dev)
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER)
#define IPVLAN_STATE_MASK \
- ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT))
+ ((1 << __LINK_STATE_NOCARRIER) | (1 << __LINK_STATE_DORMANT))
static int ipvlan_init(struct net_device *dev)
{
@@ -274,7 +275,7 @@ static void ipvlan_change_rx_flags(struct net_device *dev, int change)
struct net_device *phy_dev = ipvlan->phy_dev;
if (change & IFF_ALLMULTI)
- dev_set_allmulti(phy_dev, dev->flags & IFF_ALLMULTI? 1 : -1);
+ dev_set_allmulti(phy_dev, (dev->flags & IFF_ALLMULTI) ? 1 : -1);
}
static void ipvlan_set_multicast_mac_filter(struct net_device *dev)
@@ -319,7 +320,7 @@ static void ipvlan_get_stats64(struct net_device *dev,
for_each_possible_cpu(idx) {
pcptr = per_cpu_ptr(ipvlan->pcpu_stats, idx);
do {
- strt= u64_stats_fetch_begin_irq(&pcptr->syncp);
+ strt = u64_stats_fetch_begin_irq(&pcptr->syncp);
rx_pkts = pcptr->rx_pkts;
rx_bytes = pcptr->rx_bytes;
rx_mcast = pcptr->rx_mcast;
@@ -386,7 +387,7 @@ static const struct net_device_ops ipvlan_netdev_ops = {
static int ipvlan_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
- const void *saddr, unsigned len)
+ const void *saddr, unsigned int len)
{
const struct ipvl_dev *ipvlan = netdev_priv(dev);
struct net_device *phy_dev = ipvlan->phy_dev;
@@ -400,7 +401,7 @@ static int ipvlan_hard_header(struct sk_buff *skb, struct net_device *dev,
}
static const struct header_ops ipvlan_header_ops = {
- .create = ipvlan_hard_header,
+ .create = ipvlan_hard_header,
.parse = eth_header_parse,
.cache = eth_header_cache,
.cache_update = eth_header_cache_update,
@@ -571,13 +572,12 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev,
goto remove_ida;
err = netdev_upper_dev_link(phy_dev, dev);
- if (err) {
+ if (err)
goto unregister_netdev;
- }
+
err = ipvlan_set_port_mode(port, mode);
- if (err) {
+ if (err)
goto unlink_netdev;
- }
list_add_tail_rcu(&ipvlan->pnode, &port->ipvlans);
netif_stacked_transfer_operstate(phy_dev, dev);
@@ -627,8 +627,7 @@ void ipvlan_link_setup(struct net_device *dev)
}
EXPORT_SYMBOL_GPL(ipvlan_link_setup);
-static const struct nla_policy ipvlan_nl_policy[IFLA_IPVLAN_MAX + 1] =
-{
+static const struct nla_policy ipvlan_nl_policy[IFLA_IPVLAN_MAX + 1] = {
[IFLA_IPVLAN_MODE] = { .type = NLA_U16 },
};
@@ -709,7 +708,7 @@ static int ipvlan_add_addr(struct ipvl_dev *ipvlan, void *iaddr, bool is_v6)
{
struct ipvl_addr *addr;
- addr = kzalloc(sizeof(struct ipvl_addr), GFP_ATOMIC);
+ addr = kzalloc(sizeof(*addr), GFP_ATOMIC);
if (!addr)
return -ENOMEM;
@@ -743,8 +742,6 @@ static void ipvlan_del_addr(struct ipvl_dev *ipvlan, void *iaddr, bool is_v6)
ipvlan_ht_addr_del(addr);
list_del(&addr->anode);
kfree_rcu(addr, rcu);
-
- return;
}
static int ipvlan_add_addr6(struct ipvl_dev *ipvlan, struct in6_addr *ip6_addr)
diff --git a/drivers/net/ipvlan/ipvtap.c b/drivers/net/ipvlan/ipvtap.c
index 2b713b6..04b2d50 100644
--- a/drivers/net/ipvlan/ipvtap.c
+++ b/drivers/net/ipvlan/ipvtap.c
@@ -32,6 +32,7 @@ static struct cdev ipvtap_cdev;
static const void *ipvtap_net_namespace(struct device *d)
{
struct net_device *dev = to_net_dev(d->parent);
+
return dev_net(dev);
}
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 2/9] ipvlan: refactor ipvlan_process_multicast for readability
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
The function ipvlan_process_multicast both dequeues and dispatches
packets from/to ipvlan slaves. Decouple these two steps by introducing
ipvlan_dispatch_multicast, in order to reduce indentation and improve
the overall readability.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Tested-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 107 +++++++++++++++++++++------------------
1 file changed, 57 insertions(+), 50 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 1266f01..fd40c25 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -185,18 +185,69 @@ unsigned int ipvlan_mac_hash(const unsigned char *addr)
return hash & IPVLAN_MAC_FILTER_MASK;
}
+static void ipvlan_dispatch_multicast(struct ipvl_port *port,
+ struct sk_buff *skb, u8 pkt_type,
+ unsigned int mac_hash)
+{
+ struct ipvl_dev *ipvlan;
+ struct sk_buff *nskb;
+ struct net_device *dev = skb->dev;
+ bool tx_pkt = IPVL_SKB_CB(skb)->tx_pkt;
+ bool consumed = false;
+ unsigned int len;
+ int ret;
+
+ /* dispatch to slaves */
+ rcu_read_lock();
+ list_for_each_entry_rcu(ipvlan, &port->ipvlans, pnode) {
+ if (tx_pkt && (ipvlan->dev == skb->dev))
+ continue;
+ if (!test_bit(mac_hash, ipvlan->mac_filters))
+ continue;
+ if (!(ipvlan->dev->flags & IFF_UP))
+ continue;
+ ret = NET_RX_DROP;
+ len = skb->len + ETH_HLEN;
+ nskb = skb_clone(skb, GFP_ATOMIC);
+ local_bh_disable();
+ if (nskb) {
+ consumed = true;
+ nskb->pkt_type = pkt_type;
+ nskb->dev = ipvlan->dev;
+ if (tx_pkt)
+ ret = dev_forward_skb(ipvlan->dev, nskb);
+ else
+ ret = netif_rx(nskb);
+ }
+ ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS, true);
+ local_bh_enable();
+ }
+ rcu_read_unlock();
+
+ if (tx_pkt) {
+ /* If the packet originated here, send it out. */
+ skb->dev = port->dev;
+ skb->pkt_type = pkt_type;
+ dev_queue_xmit(skb);
+ } else {
+ if (consumed)
+ consume_skb(skb);
+ else
+ kfree_skb(skb);
+ }
+
+ if (dev)
+ dev_put(dev);
+}
+
void ipvlan_process_multicast(struct work_struct *work)
{
struct ipvl_port *port = container_of(work, struct ipvl_port, wq);
struct ethhdr *ethh;
- struct ipvl_dev *ipvlan;
- struct sk_buff *skb, *nskb;
+ struct sk_buff *skb;
struct sk_buff_head list;
- unsigned int len;
unsigned int mac_hash;
- int ret;
u8 pkt_type;
- bool tx_pkt;
__skb_queue_head_init(&list);
@@ -205,11 +256,7 @@ void ipvlan_process_multicast(struct work_struct *work)
spin_unlock_bh(&port->backlog.lock);
while ((skb = __skb_dequeue(&list)) != NULL) {
- struct net_device *dev = skb->dev;
- bool consumed = false;
-
ethh = eth_hdr(skb);
- tx_pkt = IPVL_SKB_CB(skb)->tx_pkt;
mac_hash = ipvlan_mac_hash(ethh->h_dest);
if (ether_addr_equal(ethh->h_dest, port->dev->broadcast))
@@ -217,47 +264,7 @@ void ipvlan_process_multicast(struct work_struct *work)
else
pkt_type = PACKET_MULTICAST;
- rcu_read_lock();
- list_for_each_entry_rcu(ipvlan, &port->ipvlans, pnode) {
- if (tx_pkt && (ipvlan->dev == skb->dev))
- continue;
- if (!test_bit(mac_hash, ipvlan->mac_filters))
- continue;
- if (!(ipvlan->dev->flags & IFF_UP))
- continue;
- ret = NET_RX_DROP;
- len = skb->len + ETH_HLEN;
- nskb = skb_clone(skb, GFP_ATOMIC);
- local_bh_disable();
- if (nskb) {
- consumed = true;
- nskb->pkt_type = pkt_type;
- nskb->dev = ipvlan->dev;
- if (tx_pkt)
- ret = dev_forward_skb(ipvlan->dev,
- nskb);
- else
- ret = netif_rx(nskb);
- }
- ipvlan_count_rx(ipvlan, len, ret == NET_RX_SUCCESS,
- true);
- local_bh_enable();
- }
- rcu_read_unlock();
-
- if (tx_pkt) {
- /* If the packet originated here, send it out. */
- skb->dev = port->dev;
- skb->pkt_type = pkt_type;
- dev_queue_xmit(skb);
- } else {
- if (consumed)
- consume_skb(skb);
- else
- kfree_skb(skb);
- }
- if (dev)
- dev_put(dev);
+ ipvlan_dispatch_multicast(port, skb, pkt_type, mac_hash);
}
}
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 3/9] ipvlan: replace ipvlan_rcv_frame
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
So far the ipvlan_rcv_frame function handled the reception for slaves of
both externally and internally (from the same port) originated packets.
However they need significantly different processing, with almost no
code to share.
This patch modifies ipvlan_rcv_frame to deal with internal packets only,
renaming it to ipvlan_rcv_int_frame, and introduces a new
ipvlan_rcv_ext_frame function for externally originated ones.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Tested-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 58 +++++++++++++++++++++-------------------
1 file changed, 30 insertions(+), 28 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index fd40c25..4683bad 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -280,46 +280,36 @@ static void ipvlan_skb_crossing_ns(struct sk_buff *skb, struct net_device *dev)
skb->dev = dev;
}
-static int ipvlan_rcv_frame(struct ipvl_addr *addr, struct sk_buff **pskb,
- bool local)
+static int ipvlan_rcv_int_frame(struct ipvl_addr *addr, struct sk_buff **pskb)
{
struct ipvl_dev *ipvlan = addr->master;
struct net_device *dev = ipvlan->dev;
- unsigned int len;
- rx_handler_result_t ret = RX_HANDLER_CONSUMED;
- bool success = false;
struct sk_buff *skb = *pskb;
+ unsigned int len = skb->len + ETH_HLEN;
+ bool success = false;
- len = skb->len + ETH_HLEN;
/* Only packets exchanged between two local slaves need to have
* device-up check as well as skb-share check.
*/
- if (local) {
- if (unlikely(!(dev->flags & IFF_UP))) {
- kfree_skb(skb);
- goto out;
- }
+ if (unlikely(!(dev->flags & IFF_UP))) {
+ kfree_skb(skb);
+ goto out;
+ }
- skb = skb_share_check(skb, GFP_ATOMIC);
- if (!skb)
- goto out;
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (unlikely(!skb))
+ goto out;
- *pskb = skb;
- }
+ *pskb = skb;
ipvlan_skb_crossing_ns(skb, dev);
+ skb->pkt_type = PACKET_HOST;
- if (local) {
- skb->pkt_type = PACKET_HOST;
- if (dev_forward_skb(ipvlan->dev, skb) == NET_RX_SUCCESS)
- success = true;
- } else {
- ret = RX_HANDLER_ANOTHER;
+ if (dev_forward_skb(ipvlan->dev, skb) == NET_RX_SUCCESS)
success = true;
- }
out:
ipvlan_count_rx(ipvlan, len, success, false);
- return ret;
+ return RX_HANDLER_CONSUMED;
}
static struct ipvl_addr *ipvlan_addr_lookup(struct ipvl_port *port,
@@ -525,7 +515,7 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true);
if (addr)
- return ipvlan_rcv_frame(addr, &skb, true);
+ return ipvlan_rcv_int_frame(addr, &skb);
out:
ipvlan_skb_crossing_ns(skb, ipvlan->phy_dev);
@@ -546,7 +536,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
addr = ipvlan_addr_lookup(ipvlan->port, lyr3h,
addr_type, true);
if (addr)
- return ipvlan_rcv_frame(addr, &skb, true);
+ return ipvlan_rcv_int_frame(addr, &skb);
}
skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb)
@@ -616,6 +606,18 @@ static bool ipvlan_external_frame(struct sk_buff *skb, struct ipvl_port *port)
return true;
}
+static int ipvlan_rcv_ext_frame(struct ipvl_addr *addr, struct sk_buff *skb)
+{
+ struct ipvl_dev *ipvlan = addr->master;
+ struct net_device *dev = ipvlan->dev;
+ unsigned int len = skb->len + ETH_HLEN;
+
+ ipvlan_skb_crossing_ns(skb, dev);
+ ipvlan_count_rx(ipvlan, len, true, false);
+
+ return RX_HANDLER_ANOTHER;
+}
+
static rx_handler_result_t ipvlan_handle_mode_l3(struct sk_buff **pskb,
struct ipvl_port *port)
{
@@ -631,7 +633,7 @@ static rx_handler_result_t ipvlan_handle_mode_l3(struct sk_buff **pskb,
addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
if (addr)
- ret = ipvlan_rcv_frame(addr, pskb, false);
+ ret = ipvlan_rcv_ext_frame(addr, skb);
out:
return ret;
@@ -670,7 +672,7 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
if (addr)
- ret = ipvlan_rcv_frame(addr, pskb, false);
+ ret = ipvlan_rcv_ext_frame(addr, skb);
}
return ret;
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 4/9] ipvlan: rework the IP lookup function
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
Functions ipvlan_get_L3_hdr and ipvlan_addr_lookup are used to determine
whether a packet belongs to a slave by looking at L3 addresses. Being
tightly coupled, these two functions are always used in pair and have
some duplicated code that could be shared.
This patch combines them into a single ipvlan_get_slave_addr function
and refactor caller functions, streamlining code and improving
readability.
A ipvlan_get_slave_addr_dst utility function is also provided as most
lookups are based on the destination IP address.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Tested-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 187 +++++++++++----------------------------
1 file changed, 52 insertions(+), 135 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 4683bad..876ce37 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -116,25 +116,34 @@ bool ipvlan_addr_busy(struct ipvl_port *port, void *iaddr, bool is_v6)
return false;
}
-static void *ipvlan_get_L3_hdr(struct sk_buff *skb, int *type)
+static struct ipvl_addr *ipvlan_get_slave_addr(struct sk_buff *skb,
+ struct ipvl_port *port,
+ bool use_dest)
{
- void *lyr3h = NULL;
+ struct ipvl_addr *addr = NULL;
switch (skb->protocol) {
case htons(ETH_P_ARP): {
- struct arphdr *arph;
+ u8 *arp_ptr;
+ __be32 dip;
- if (unlikely(!pskb_may_pull(skb, sizeof(*arph))))
+ if (unlikely(!pskb_may_pull(skb, sizeof(struct arphdr))))
return NULL;
- arph = arp_hdr(skb);
- *type = IPVL_ARP;
- lyr3h = arph;
+ arp_ptr = (u8 *)(arp_hdr(skb) + 1);
+ if (use_dest)
+ arp_ptr += (2 * port->dev->addr_len) + 4;
+ else
+ arp_ptr += port->dev->addr_len;
+
+ memcpy(&dip, arp_ptr, 4);
+ addr = ipvlan_ht_addr_lookup(port, &dip, false);
break;
}
case htons(ETH_P_IP): {
u32 pktlen;
struct iphdr *ip4h;
+ __be32 *i4addr;
if (unlikely(!pskb_may_pull(skb, sizeof(*ip4h))))
return NULL;
@@ -146,12 +155,14 @@ static void *ipvlan_get_L3_hdr(struct sk_buff *skb, int *type)
if (skb->len < pktlen || pktlen < (ip4h->ihl * 4))
return NULL;
- *type = IPVL_IPV4;
- lyr3h = ip4h;
+ i4addr = use_dest ? &ip4h->daddr : &ip4h->saddr;
+ addr = ipvlan_ht_addr_lookup(port, i4addr, false);
break;
}
case htons(ETH_P_IPV6): {
struct ipv6hdr *ip6h;
+ struct nd_msg *ndmh;
+ struct in6_addr *i6addr;
if (unlikely(!pskb_may_pull(skb, sizeof(*ip6h))))
return NULL;
@@ -160,21 +171,28 @@ static void *ipvlan_get_L3_hdr(struct sk_buff *skb, int *type)
if (ip6h->version != 6)
return NULL;
- *type = IPVL_IPV6;
- lyr3h = ip6h;
- /* Only Neighbour Solicitation pkts need different treatment */
+ ndmh = (struct nd_msg *)(ip6h + 1);
if (ipv6_addr_any(&ip6h->saddr) &&
- ip6h->nexthdr == NEXTHDR_ICMP) {
- *type = IPVL_ICMPV6;
- lyr3h = ip6h + 1;
- }
+ ip6h->nexthdr == NEXTHDR_ICMP &&
+ ndmh->icmph.icmp6_type == NDISC_NEIGHBOUR_SOLICITATION)
+ i6addr = &ndmh->target;
+ else
+ i6addr = use_dest ? &ip6h->daddr : &ip6h->saddr;
+
+ addr = ipvlan_ht_addr_lookup(port, i6addr, true);
break;
}
default:
return NULL;
}
- return lyr3h;
+ return addr;
+}
+
+static inline struct ipvl_addr *ipvlan_get_slave_addr_dst(struct sk_buff *skb,
+ struct ipvl_port *port)
+{
+ return ipvlan_get_slave_addr(skb, port, true);
}
unsigned int ipvlan_mac_hash(const unsigned char *addr)
@@ -312,57 +330,6 @@ static int ipvlan_rcv_int_frame(struct ipvl_addr *addr, struct sk_buff **pskb)
return RX_HANDLER_CONSUMED;
}
-static struct ipvl_addr *ipvlan_addr_lookup(struct ipvl_port *port,
- void *lyr3h, int addr_type,
- bool use_dest)
-{
- struct ipvl_addr *addr = NULL;
-
- if (addr_type == IPVL_IPV6) {
- struct ipv6hdr *ip6h;
- struct in6_addr *i6addr;
-
- ip6h = (struct ipv6hdr *)lyr3h;
- i6addr = use_dest ? &ip6h->daddr : &ip6h->saddr;
- addr = ipvlan_ht_addr_lookup(port, i6addr, true);
- } else if (addr_type == IPVL_ICMPV6) {
- struct nd_msg *ndmh;
- struct in6_addr *i6addr;
-
- /* Make sure that the NeighborSolicitation ICMPv6 packets
- * are handled to avoid DAD issue.
- */
- ndmh = (struct nd_msg *)lyr3h;
- if (ndmh->icmph.icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) {
- i6addr = &ndmh->target;
- addr = ipvlan_ht_addr_lookup(port, i6addr, true);
- }
- } else if (addr_type == IPVL_IPV4) {
- struct iphdr *ip4h;
- __be32 *i4addr;
-
- ip4h = (struct iphdr *)lyr3h;
- i4addr = use_dest ? &ip4h->daddr : &ip4h->saddr;
- addr = ipvlan_ht_addr_lookup(port, i4addr, false);
- } else if (addr_type == IPVL_ARP) {
- struct arphdr *arph;
- unsigned char *arp_ptr;
- __be32 dip;
-
- arph = (struct arphdr *)lyr3h;
- arp_ptr = (unsigned char *)(arph + 1);
- if (use_dest)
- arp_ptr += (2 * port->dev->addr_len) + 4;
- else
- arp_ptr += port->dev->addr_len;
-
- memcpy(&dip, arp_ptr, 4);
- addr = ipvlan_ht_addr_lookup(port, &dip, false);
- }
-
- return addr;
-}
-
static int ipvlan_process_v4_outbound(struct sk_buff *skb)
{
const struct iphdr *ip4h = ip_hdr(skb);
@@ -505,19 +472,12 @@ static void ipvlan_multicast_enqueue(struct ipvl_port *port,
static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
{
const struct ipvl_dev *ipvlan = netdev_priv(dev);
- void *lyr3h;
struct ipvl_addr *addr;
- int addr_type;
- lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
- if (!lyr3h)
- goto out;
-
- addr = ipvlan_addr_lookup(ipvlan->port, lyr3h, addr_type, true);
+ addr = ipvlan_get_slave_addr_dst(skb, ipvlan->port);
if (addr)
return ipvlan_rcv_int_frame(addr, &skb);
-out:
ipvlan_skb_crossing_ns(skb, ipvlan->phy_dev);
return ipvlan_process_outbound(skb);
}
@@ -527,17 +487,12 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
const struct ipvl_dev *ipvlan = netdev_priv(dev);
struct ethhdr *eth = eth_hdr(skb);
struct ipvl_addr *addr;
- void *lyr3h;
- int addr_type;
if (ether_addr_equal(eth->h_dest, eth->h_source)) {
- lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
- if (lyr3h) {
- addr = ipvlan_addr_lookup(ipvlan->port, lyr3h,
- addr_type, true);
- if (addr)
- return ipvlan_rcv_int_frame(addr, &skb);
- }
+ addr = ipvlan_get_slave_addr_dst(skb, ipvlan->port);
+ if (addr)
+ return ipvlan_rcv_int_frame(addr, &skb);
+
skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb)
return NET_XMIT_DROP;
@@ -586,24 +541,10 @@ int ipvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
return NET_XMIT_DROP;
}
-static bool ipvlan_external_frame(struct sk_buff *skb, struct ipvl_port *port)
+static inline bool ipvlan_external_frame(struct sk_buff *skb,
+ struct ipvl_port *port)
{
- struct ethhdr *eth = eth_hdr(skb);
- struct ipvl_addr *addr;
- void *lyr3h;
- int addr_type;
-
- if (ether_addr_equal(eth->h_source, skb->dev->dev_addr)) {
- lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
- if (!lyr3h)
- return true;
-
- addr = ipvlan_addr_lookup(port, lyr3h, addr_type, false);
- if (addr)
- return false;
- }
-
- return true;
+ return !ipvlan_get_slave_addr(skb, port, false);
}
static int ipvlan_rcv_ext_frame(struct ipvl_addr *addr, struct sk_buff *skb)
@@ -621,22 +562,14 @@ static int ipvlan_rcv_ext_frame(struct ipvl_addr *addr, struct sk_buff *skb)
static rx_handler_result_t ipvlan_handle_mode_l3(struct sk_buff **pskb,
struct ipvl_port *port)
{
- void *lyr3h;
- int addr_type;
struct ipvl_addr *addr;
struct sk_buff *skb = *pskb;
- rx_handler_result_t ret = RX_HANDLER_PASS;
- lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
- if (!lyr3h)
- goto out;
-
- addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
+ addr = ipvlan_get_slave_addr_dst(skb, port);
if (addr)
- ret = ipvlan_rcv_ext_frame(addr, skb);
+ return ipvlan_rcv_ext_frame(addr, skb);
-out:
- return ret;
+ return RX_HANDLER_PASS;
}
static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
@@ -644,9 +577,6 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
{
struct sk_buff *skb = *pskb;
struct ethhdr *eth = eth_hdr(skb);
- rx_handler_result_t ret = RX_HANDLER_PASS;
- void *lyr3h;
- int addr_type;
if (is_multicast_ether_addr(eth->h_dest)) {
if (ipvlan_external_frame(skb, port)) {
@@ -666,16 +596,12 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
} else {
struct ipvl_addr *addr;
- lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
- if (!lyr3h)
- return ret;
-
- addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
+ addr = ipvlan_get_slave_addr_dst(skb, port);
if (addr)
- ret = ipvlan_rcv_ext_frame(addr, skb);
+ return ipvlan_rcv_ext_frame(addr, skb);
}
- return ret;
+ return RX_HANDLER_PASS;
}
rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb)
@@ -705,25 +631,16 @@ rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb)
static struct ipvl_addr *ipvlan_skb_to_addr(struct sk_buff *skb,
struct net_device *dev)
{
- struct ipvl_addr *addr = NULL;
struct ipvl_port *port;
- void *lyr3h;
- int addr_type;
if (!dev || !netif_is_ipvlan_port(dev))
- goto out;
+ return NULL;
port = ipvlan_port_get_rcu(dev);
if (!port || port->mode != IPVLAN_MODE_L3S)
- goto out;
-
- lyr3h = ipvlan_get_L3_hdr(skb, &addr_type);
- if (!lyr3h)
- goto out;
+ return NULL;
- addr = ipvlan_addr_lookup(port, lyr3h, addr_type, true);
-out:
- return addr;
+ return ipvlan_get_slave_addr_dst(skb, port);
}
struct sk_buff *ipvlan_l3_rcv(struct net_device *dev, struct sk_buff *skb,
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 5/9] ipvlan: improve and uniform naming
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
Rename a few functions to make them more descriptive. Also rename a
couple of variables to make them consistent with similar ones in other
functions.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Tested-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 876ce37..54c4e85 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -330,7 +330,7 @@ static int ipvlan_rcv_int_frame(struct ipvl_addr *addr, struct sk_buff **pskb)
return RX_HANDLER_CONSUMED;
}
-static int ipvlan_process_v4_outbound(struct sk_buff *skb)
+static int ipvlan_process_l3_outbound_v4(struct sk_buff *skb)
{
const struct iphdr *ip4h = ip_hdr(skb);
struct net_device *dev = skb->dev;
@@ -367,7 +367,7 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
return ret;
}
-static int ipvlan_process_v6_outbound(struct sk_buff *skb)
+static int ipvlan_process_l3_outbound_v6(struct sk_buff *skb)
{
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
struct net_device *dev = skb->dev;
@@ -404,7 +404,7 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
return ret;
}
-static int ipvlan_process_outbound(struct sk_buff *skb)
+static int ipvlan_process_l3_outbound(struct sk_buff *skb)
{
struct ethhdr *ethh = eth_hdr(skb);
int ret = NET_XMIT_DROP;
@@ -428,9 +428,9 @@ static int ipvlan_process_outbound(struct sk_buff *skb)
}
if (skb->protocol == htons(ETH_P_IPV6)) {
- ret = ipvlan_process_v6_outbound(skb);
+ ret = ipvlan_process_l3_outbound_v6(skb);
} else if (skb->protocol == htons(ETH_P_IP)) {
- ret = ipvlan_process_v4_outbound(skb);
+ ret = ipvlan_process_l3_outbound_v4(skb);
} else {
pr_warn_ratelimited("Dropped outbound packet type=%x\n",
ntohs(skb->protocol));
@@ -479,16 +479,16 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
return ipvlan_rcv_int_frame(addr, &skb);
ipvlan_skb_crossing_ns(skb, ipvlan->phy_dev);
- return ipvlan_process_outbound(skb);
+ return ipvlan_process_l3_outbound(skb);
}
static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
{
const struct ipvl_dev *ipvlan = netdev_priv(dev);
- struct ethhdr *eth = eth_hdr(skb);
+ struct ethhdr *ethh = eth_hdr(skb);
struct ipvl_addr *addr;
- if (ether_addr_equal(eth->h_dest, eth->h_source)) {
+ if (ether_addr_equal(ethh->h_dest, ethh->h_source)) {
addr = ipvlan_get_slave_addr_dst(skb, ipvlan->port);
if (addr)
return ipvlan_rcv_int_frame(addr, &skb);
@@ -504,7 +504,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
*/
return dev_forward_skb(ipvlan->phy_dev, skb);
- } else if (is_multicast_ether_addr(eth->h_dest)) {
+ } else if (is_multicast_ether_addr(ethh->h_dest)) {
ipvlan_skb_crossing_ns(skb, NULL);
ipvlan_multicast_enqueue(ipvlan->port, skb, true);
return NET_XMIT_SUCCESS;
@@ -576,9 +576,8 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
struct ipvl_port *port)
{
struct sk_buff *skb = *pskb;
- struct ethhdr *eth = eth_hdr(skb);
- if (is_multicast_ether_addr(eth->h_dest)) {
+ if (is_multicast_ether_addr(eth_hdr(skb)->h_dest)) {
if (ipvlan_external_frame(skb, port)) {
struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
@@ -628,8 +627,8 @@ rx_handler_result_t ipvlan_handle_frame(struct sk_buff **pskb)
return RX_HANDLER_CONSUMED;
}
-static struct ipvl_addr *ipvlan_skb_to_addr(struct sk_buff *skb,
- struct net_device *dev)
+static struct ipvl_addr *ipvlan_skb_to_addr_l3s(struct sk_buff *skb,
+ struct net_device *dev)
{
struct ipvl_port *port;
@@ -649,7 +648,7 @@ struct sk_buff *ipvlan_l3_rcv(struct net_device *dev, struct sk_buff *skb,
struct ipvl_addr *addr;
struct net_device *sdev;
- addr = ipvlan_skb_to_addr(skb, dev);
+ addr = ipvlan_skb_to_addr_l3s(skb, dev);
if (!addr)
goto out;
@@ -699,7 +698,7 @@ unsigned int ipvlan_nf_input(void *priv, struct sk_buff *skb,
struct ipvl_addr *addr;
unsigned int len;
- addr = ipvlan_skb_to_addr(skb, skb->dev);
+ addr = ipvlan_skb_to_addr_l3s(skb, skb->dev);
if (!addr)
goto out;
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 7/9] ipvlan: relocate ipvlan_skb_crossing_ns calls
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
Relocate ipvlan_skb_crossing_ns invocations across the code to reduce
duplications and improve readability. Additionally introduce
ipvlan_process_l2_outbound for the purpose, similarly to
ipvlan_process_l3_outbound.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 81dc3e5..a9fc1b5 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -289,6 +289,8 @@ void ipvlan_process_multicast(struct work_struct *work)
ethh = eth_hdr(skb);
mac_hash = ipvlan_mac_hash(ethh->h_dest);
+ ipvlan_skb_crossing_ns(skb, NULL);
+
if (ether_addr_equal(ethh->h_dest, port->dev->broadcast))
pkt_type = PACKET_BROADCAST;
else
@@ -433,7 +435,8 @@ static int ipvlan_process_l3_outbound_v6(struct sk_buff *skb)
return ret;
}
-static int ipvlan_process_l3_outbound(struct sk_buff *skb)
+static int ipvlan_process_l3_outbound(struct sk_buff *skb,
+ struct net_device *dev)
{
struct ethhdr *ethh = eth_hdr(skb);
int ret = NET_XMIT_DROP;
@@ -446,6 +449,8 @@ static int ipvlan_process_l3_outbound(struct sk_buff *skb)
goto out;
}
+ ipvlan_skb_crossing_ns(skb, dev);
+
/* The ipvlan is a pseudo-L2 device, so the packets that we receive
* will have L2; which need to discarded and processed further
* in the net-ns of the main-device.
@@ -478,8 +483,14 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
if (addr)
return ipvlan_rcv_int_frame(addr, &skb);
- ipvlan_skb_crossing_ns(skb, ipvlan->phy_dev);
- return ipvlan_process_l3_outbound(skb);
+ return ipvlan_process_l3_outbound(skb, ipvlan->phy_dev);
+}
+
+static inline int ipvlan_process_l2_outbound(struct sk_buff *skb,
+ struct net_device *dev)
+{
+ ipvlan_skb_crossing_ns(skb, dev);
+ return dev_queue_xmit(skb);
}
static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
@@ -505,13 +516,11 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
return dev_forward_skb(ipvlan->phy_dev, skb);
} else if (is_multicast_ether_addr(ethh->h_dest)) {
- ipvlan_skb_crossing_ns(skb, NULL);
ipvlan_multicast_enqueue(ipvlan->port, skb, true);
return NET_XMIT_SUCCESS;
}
- ipvlan_skb_crossing_ns(skb, ipvlan->phy_dev);
- return dev_queue_xmit(skb);
+ return ipvlan_process_l2_outbound(skb, ipvlan->phy_dev);
}
int ipvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -587,10 +596,8 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
* when work-queue processes this frame. This is
* achieved by returning RX_HANDLER_PASS.
*/
- if (nskb) {
- ipvlan_skb_crossing_ns(nskb, NULL);
+ if (nskb)
ipvlan_multicast_enqueue(port, nskb, false);
- }
}
} else {
struct ipvl_addr *addr;
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 6/9] ipvlan: reposition three functions
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
Move ipvlan_multicast_enqueue, ipvlan_skb_crossing_ns and
ipvlan_mac_hash close to their related siblings.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 80 ++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 54c4e85..81dc3e5 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -88,6 +88,14 @@ void ipvlan_ht_addr_del(struct ipvl_addr *addr)
hlist_del_init_rcu(&addr->hlnode);
}
+unsigned int ipvlan_mac_hash(const unsigned char *addr)
+{
+ u32 hash = jhash_1word(__get_unaligned_cpu32(addr + 2),
+ ipvlan_jhash_secret);
+
+ return hash & IPVLAN_MAC_FILTER_MASK;
+}
+
struct ipvl_addr *ipvlan_find_addr(const struct ipvl_dev *ipvlan,
const void *iaddr, bool is_v6)
{
@@ -195,12 +203,16 @@ static inline struct ipvl_addr *ipvlan_get_slave_addr_dst(struct sk_buff *skb,
return ipvlan_get_slave_addr(skb, port, true);
}
-unsigned int ipvlan_mac_hash(const unsigned char *addr)
+static void ipvlan_skb_crossing_ns(struct sk_buff *skb, struct net_device *dev)
{
- u32 hash = jhash_1word(__get_unaligned_cpu32(addr + 2),
- ipvlan_jhash_secret);
+ bool xnet = true;
- return hash & IPVLAN_MAC_FILTER_MASK;
+ if (dev)
+ xnet = !net_eq(dev_net(skb->dev), dev_net(dev));
+
+ skb_scrub_packet(skb, xnet);
+ if (dev)
+ skb->dev = dev;
}
static void ipvlan_dispatch_multicast(struct ipvl_port *port,
@@ -286,16 +298,33 @@ void ipvlan_process_multicast(struct work_struct *work)
}
}
-static void ipvlan_skb_crossing_ns(struct sk_buff *skb, struct net_device *dev)
+static void ipvlan_multicast_enqueue(struct ipvl_port *port,
+ struct sk_buff *skb, bool tx_pkt)
{
- bool xnet = true;
+ if (skb->protocol == htons(ETH_P_PAUSE)) {
+ kfree_skb(skb);
+ return;
+ }
- if (dev)
- xnet = !net_eq(dev_net(skb->dev), dev_net(dev));
+ /* Record that the deferred packet is from TX or RX path. By
+ * looking at mac-addresses on packet will lead to erronus decisions.
+ * (This would be true for a loopback-mode on master device or a
+ * hair-pin mode of the switch.)
+ */
+ IPVL_SKB_CB(skb)->tx_pkt = tx_pkt;
- skb_scrub_packet(skb, xnet);
- if (dev)
- skb->dev = dev;
+ spin_lock(&port->backlog.lock);
+ if (skb_queue_len(&port->backlog) < IPVLAN_QBACKLOG_LIMIT) {
+ if (skb->dev)
+ dev_hold(skb->dev);
+ __skb_queue_tail(&port->backlog, skb);
+ spin_unlock(&port->backlog.lock);
+ schedule_work(&port->wq);
+ } else {
+ spin_unlock(&port->backlog.lock);
+ atomic_long_inc(&skb->dev->rx_dropped);
+ kfree_skb(skb);
+ }
}
static int ipvlan_rcv_int_frame(struct ipvl_addr *addr, struct sk_buff **pskb)
@@ -440,35 +469,6 @@ static int ipvlan_process_l3_outbound(struct sk_buff *skb)
return ret;
}
-static void ipvlan_multicast_enqueue(struct ipvl_port *port,
- struct sk_buff *skb, bool tx_pkt)
-{
- if (skb->protocol == htons(ETH_P_PAUSE)) {
- kfree_skb(skb);
- return;
- }
-
- /* Record that the deferred packet is from TX or RX path. By
- * looking at mac-addresses on packet will lead to erronus decisions.
- * (This would be true for a loopback-mode on master device or a
- * hair-pin mode of the switch.)
- */
- IPVL_SKB_CB(skb)->tx_pkt = tx_pkt;
-
- spin_lock(&port->backlog.lock);
- if (skb_queue_len(&port->backlog) < IPVLAN_QBACKLOG_LIMIT) {
- if (skb->dev)
- dev_hold(skb->dev);
- __skb_queue_tail(&port->backlog, skb);
- spin_unlock(&port->backlog.lock);
- schedule_work(&port->wq);
- } else {
- spin_unlock(&port->backlog.lock);
- atomic_long_inc(&skb->dev->rx_dropped);
- kfree_skb(skb);
- }
-}
-
static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
{
const struct ipvl_dev *ipvlan = netdev_priv(dev);
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 8/9] ipvlan: improve compiler hints
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
Extend inlining and branch prediction hints.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index a9fc1b5..67e342d 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -88,7 +88,7 @@ void ipvlan_ht_addr_del(struct ipvl_addr *addr)
hlist_del_init_rcu(&addr->hlnode);
}
-unsigned int ipvlan_mac_hash(const unsigned char *addr)
+inline unsigned int ipvlan_mac_hash(const unsigned char *addr)
{
u32 hash = jhash_1word(__get_unaligned_cpu32(addr + 2),
ipvlan_jhash_secret);
@@ -505,7 +505,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
return ipvlan_rcv_int_frame(addr, &skb);
skb = skb_share_check(skb, GFP_ATOMIC);
- if (!skb)
+ if (unlikely(!skb))
return NET_XMIT_DROP;
/* Packet definitely does not belong to any of the
@@ -596,7 +596,7 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff **pskb,
* when work-queue processes this frame. This is
* achieved by returning RX_HANDLER_PASS.
*/
- if (nskb)
+ if (likely(nskb))
ipvlan_multicast_enqueue(port, nskb, false);
}
} else {
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* [PATCH net-next 9/9] ipvlan: introduce individual MAC addresses
From: Marco Chiappero @ 2017-04-27 14:51 UTC (permalink / raw)
To: netdev
Cc: David S . Miller, Jeff Kirsher, Alexander Duyck, Sainath Grandhi,
Mahesh Bandewar, Marco Chiappero
In-Reply-To: <20170427145142.15830-1-marco.chiappero@intel.com>
Currently all the slave devices belonging to the same port inherit their
MAC address from its master device. This patch removes this limitation
and allows every slave device to obtain a unique MAC address, by default
randomly generated at creation time.
Moreover it is now possible to correctly modify the MAC address at any
time, fixing an existing bug as MAC address changes on the master were
not reflected on the slaves. It also avoids multiple interfaces sharing
the same IPv6 link-local address.
Since ipvlan is designed to expose a single MAC address for external
communications, the driver now behaves as follow:
- L2 mode:
* Any reference to the internal MAC address of the originating slave
is replaced with the MAC address of the master for outbound frames.
* Likewise, the destination MAC address is overwritten with the
internal one (once the correct slave is determined) for any
incoming external frame.
* For any internal slave-to-slave communication, the original MAC
addresses are preserved (although not used for routing/switching).
- L3/L3s mode:
* The destination MAC address for incoming external packets is
replaced with the one belonging to the destination slave device
(as for L2 mode)
* Every other path behaves as before.
Being a significant behavioral change, version number has been
increased.
Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Tested-by: Marco Chiappero <marco.chiappero@intel.com>
---
drivers/net/ipvlan/ipvlan.h | 2 +-
drivers/net/ipvlan/ipvlan_core.c | 113 ++++++++++++++++++++++++++++++++++-----
drivers/net/ipvlan/ipvlan_main.c | 18 +++----
3 files changed, 111 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h
index 800a46c..efe4fd1 100644
--- a/drivers/net/ipvlan/ipvlan.h
+++ b/drivers/net/ipvlan/ipvlan.h
@@ -32,7 +32,7 @@
#include <net/l3mdev.h>
#define IPVLAN_DRV "ipvlan"
-#define IPV_DRV_VER "0.1"
+#define IPV_DRV_VER "0.2"
#define IPVLAN_HASH_SIZE (1 << BITS_PER_BYTE)
#define IPVLAN_HASH_MASK (IPVLAN_HASH_SIZE - 1)
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
index 67e342d..a30bc11 100644
--- a/drivers/net/ipvlan/ipvlan_core.c
+++ b/drivers/net/ipvlan/ipvlan_core.c
@@ -215,6 +215,89 @@ static void ipvlan_skb_crossing_ns(struct sk_buff *skb, struct net_device *dev)
skb->dev = dev;
}
+static inline struct nd_opt_hdr *ipvlan_icmp6_nd_opts(struct icmp6hdr *icmph)
+{
+ return (struct nd_opt_hdr *)((struct nd_msg *)icmph)->opt;
+}
+
+static inline struct nd_opt_hdr *ipvlan_icmp6_rs_opts(struct icmp6hdr *icmph)
+{
+ return (struct nd_opt_hdr *)((struct rs_msg *)icmph)->opt;
+}
+
+static void ipvlan_proxy_l2_update_icmp6(const struct net_device *master,
+ struct sk_buff *skb,
+ struct nd_opt_hdr *nd_opt,
+ u8 opt_type)
+{
+ u32 opts_len = skb_tail_pointer(skb) - (u8 *)nd_opt;
+
+ while (opts_len) {
+ u32 opt_len = nd_opt->nd_opt_len << 3;
+
+ if (nd_opt->nd_opt_type == opt_type) {
+ struct ipv6hdr *ip6h = ipv6_hdr(skb);
+ struct icmp6hdr *icmph = icmp6_hdr(skb);
+ u32 len = ntohs(ip6h->payload_len);
+
+ memcpy(nd_opt + 1, master->dev_addr, master->addr_len);
+ icmph->icmp6_cksum = 0;
+ icmph->icmp6_cksum =
+ csum_ipv6_magic(&ip6h->saddr,
+ &ip6h->daddr, len,
+ IPPROTO_ICMPV6,
+ csum_partial(icmph, len, 0));
+ return;
+ }
+
+ opts_len -= opt_len;
+ nd_opt = ((void *)nd_opt) + opt_len;
+ }
+}
+
+static void ipvlan_proxy_l2_outbound(struct sk_buff *skb,
+ const struct net_device *master)
+{
+ /* masquerade the source MAC address for every outgoing frame */
+ memcpy(eth_hdr(skb)->h_source, master->dev_addr, master->addr_len);
+
+ /* ARP and some NDISC packets need additional treatment */
+ if (skb->protocol == htons(ETH_P_IPV6)) {
+ struct ipv6hdr *ip6h = ipv6_hdr(skb);
+ struct icmp6hdr *icmph = icmp6_hdr(skb);
+ struct nd_opt_hdr *nd_opt;
+ u8 opt_type;
+
+ if (likely(ip6h->nexthdr != NEXTHDR_ICMP))
+ return;
+
+ switch (icmph->icmp6_type) {
+ case NDISC_NEIGHBOUR_SOLICITATION: {
+ nd_opt = ipvlan_icmp6_nd_opts(icmph);
+ opt_type = ND_OPT_SOURCE_LL_ADDR;
+ break;
+ }
+ case NDISC_NEIGHBOUR_ADVERTISEMENT: {
+ nd_opt = ipvlan_icmp6_nd_opts(icmph);
+ opt_type = ND_OPT_TARGET_LL_ADDR;
+ break;
+ }
+ case NDISC_ROUTER_SOLICITATION: {
+ nd_opt = ipvlan_icmp6_rs_opts(icmph);
+ opt_type = ND_OPT_SOURCE_LL_ADDR;
+ break;
+ }
+ default:
+ return;
+ }
+
+ ipvlan_proxy_l2_update_icmp6(master, skb, nd_opt, opt_type);
+
+ } else if (unlikely(skb->protocol == htons(ETH_P_ARP))) {
+ memcpy(arp_hdr(skb) + 1, master->dev_addr, master->addr_len);
+ }
+}
+
static void ipvlan_dispatch_multicast(struct ipvl_port *port,
struct sk_buff *skb, u8 pkt_type,
unsigned int mac_hash)
@@ -258,6 +341,7 @@ static void ipvlan_dispatch_multicast(struct ipvl_port *port,
/* If the packet originated here, send it out. */
skb->dev = port->dev;
skb->pkt_type = pkt_type;
+ ipvlan_proxy_l2_outbound(skb, port->dev);
dev_queue_xmit(skb);
} else {
if (consumed)
@@ -489,6 +573,7 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)
static inline int ipvlan_process_l2_outbound(struct sk_buff *skb,
struct net_device *dev)
{
+ ipvlan_proxy_l2_outbound(skb, dev);
ipvlan_skb_crossing_ns(skb, dev);
return dev_queue_xmit(skb);
}
@@ -499,27 +584,27 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)
struct ethhdr *ethh = eth_hdr(skb);
struct ipvl_addr *addr;
- if (ether_addr_equal(ethh->h_dest, ethh->h_source)) {
- addr = ipvlan_get_slave_addr_dst(skb, ipvlan->port);
- if (addr)
- return ipvlan_rcv_int_frame(addr, &skb);
+ if (is_multicast_ether_addr(ethh->h_dest)) {
+ ipvlan_multicast_enqueue(ipvlan->port, skb, true);
+ return NET_XMIT_SUCCESS;
+ }
+ if (ether_addr_equal(ethh->h_dest, ipvlan->phy_dev->dev_addr)) {
skb = skb_share_check(skb, GFP_ATOMIC);
if (unlikely(!skb))
return NET_XMIT_DROP;
- /* Packet definitely does not belong to any of the
- * virtual devices, but the dest is local. So forward
- * the skb for the main-dev. At the RX side we just return
- * RX_PASS for it to be processed further on the stack.
+ /* Forward the skb for the master device. At the RX side we
+ * just return RX_HANDLER_PASS for it to be processed further
+ * on the stack.
*/
return dev_forward_skb(ipvlan->phy_dev, skb);
-
- } else if (is_multicast_ether_addr(ethh->h_dest)) {
- ipvlan_multicast_enqueue(ipvlan->port, skb, true);
- return NET_XMIT_SUCCESS;
}
+ addr = ipvlan_get_slave_addr_dst(skb, ipvlan->port);
+ if (addr)
+ return ipvlan_rcv_int_frame(addr, &skb);
+
return ipvlan_process_l2_outbound(skb, ipvlan->phy_dev);
}
@@ -562,6 +647,10 @@ static int ipvlan_rcv_ext_frame(struct ipvl_addr *addr, struct sk_buff *skb)
struct net_device *dev = ipvlan->dev;
unsigned int len = skb->len + ETH_HLEN;
+ /* NOTE: although not necessary restore the actual destination
+ * address; this is also what traffic sniffers will display.
+ */
+ memcpy(eth_hdr(skb)->h_dest, dev->dev_addr, dev->addr_len);
ipvlan_skb_crossing_ns(skb, dev);
ipvlan_count_rx(ipvlan, len, true, false);
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index b837807..709f27d 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -378,6 +378,7 @@ static const struct net_device_ops ipvlan_netdev_ops = {
.ndo_start_xmit = ipvlan_start_xmit,
.ndo_fix_features = ipvlan_fix_features,
.ndo_change_rx_flags = ipvlan_change_rx_flags,
+ .ndo_set_mac_address = eth_mac_addr,
.ndo_set_rx_mode = ipvlan_set_multicast_mac_filter,
.ndo_get_stats64 = ipvlan_get_stats64,
.ndo_vlan_rx_add_vid = ipvlan_vlan_rx_add_vid,
@@ -392,9 +393,10 @@ static int ipvlan_hard_header(struct sk_buff *skb, struct net_device *dev,
const struct ipvl_dev *ipvlan = netdev_priv(dev);
struct net_device *phy_dev = ipvlan->phy_dev;
- /* TODO Probably use a different field than dev_addr so that the
- * mac-address on the virtual device is portable and can be carried
- * while the packets use the mac-addr on the physical device.
+ /* This driver uses (almost exclusively) L3 addresses for
+ * routing/switching. Use the actual slave's MAC address,
+ * but overwrite it later during the packet processing for
+ * frames leaving from master
*/
return dev_hard_header(skb, phy_dev, type, daddr,
saddr ? : dev->dev_addr, len);
@@ -559,11 +561,8 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev,
/* Increment id-base to the next slot for the future assignment */
port->dev_id_start = err + 1;
- /* TODO Probably put random address here to be presented to the
- * world but keep using the physical-dev address for the outgoing
- * packets.
- */
- memcpy(dev->dev_addr, phy_dev->dev_addr, ETH_ALEN);
+ /* TODO: consider storing the original MAC address in dev->perm_addr */
+ eth_hw_addr_random(dev);
dev->priv_flags |= IFF_IPVLAN_SLAVE;
@@ -619,7 +618,8 @@ void ipvlan_link_setup(struct net_device *dev)
ether_setup(dev);
dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
- dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE;
+ dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE
+ | IFF_LIVE_ADDR_CHANGE;
dev->netdev_ops = &ipvlan_netdev_ops;
dev->destructor = free_netdev;
dev->header_ops = &ipvlan_header_ops;
--
2.9.3
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
^ permalink raw reply related
* RE: [PATCH v6 1/5] skbuff: return -EMSGSIZE in skb_to_sgvec to prevent overflow
From: David Laight @ 2017-04-27 14:54 UTC (permalink / raw)
To: 'Jason A. Donenfeld', Sabrina Dubroca
Cc: Netdev, LKML, kernel-hardening@lists.openwall.com, David Miller
In-Reply-To: <CAHmME9oa3LYsnBgguxFqbJwps1ai=cuHHEgSpfY36AQHAN5r1Q@mail.gmail.com>
From: Jason A. Donenfeld
> On Thu, Apr 27, 2017 at 1:30 PM, Sabrina Dubroca <sd@queasysnail.net> wrote:
> > Hmm, I think this can actually happen:
>
> Alright, perhaps better to err on the side of caution, then.
You only need to recurse if both pointers are set.
David
^ permalink raw reply
* Re: [PATCH net-next 4/6] bpf: track if the bpf program was loaded with SYS_ADMIN capabilities
From: Jiri Benc @ 2017-04-27 14:56 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Hannes Frederic Sowa, netdev@vger.kernel.org, Alexei Starovoitov,
Aaron Conole, Daniel Borkmann
In-Reply-To: <CAADnVQ+GL6sYCff4eU4WXZYeZSi5BJ5amy6NQjuZk2=OjuM5+g@mail.gmail.com>
On Thu, 27 Apr 2017 07:49:29 -0700, Alexei Starovoitov wrote:
> there are bunch of other things that influence verifier.
> should we add all of them ?
Sure, why not? It's always good to be able to see the complete input
conditions while debugging.
Jiri
^ permalink raw reply
* RE: [PATCH net-next 8/9] ipvlan: improve compiler hints
From: Duyck, Alexander H @ 2017-04-27 15:21 UTC (permalink / raw)
To: Chiappero, Marco, netdev@vger.kernel.org
Cc: David S . Miller, Kirsher, Jeffrey T, Grandhi, Sainath,
Mahesh Bandewar
In-Reply-To: <20170427145142.15830-9-marco.chiappero@intel.com>
> -----Original Message-----
> From: Chiappero, Marco
> Sent: Thursday, April 27, 2017 7:52 AM
> To: netdev@vger.kernel.org
> Cc: David S . Miller <davem@davemloft.net>; Kirsher, Jeffrey T
> <jeffrey.t.kirsher@intel.com>; Duyck, Alexander H
> <alexander.h.duyck@intel.com>; Grandhi, Sainath
> <sainath.grandhi@intel.com>; Mahesh Bandewar <maheshb@google.com>;
> Chiappero, Marco <marco.chiappero@intel.com>
> Subject: [PATCH net-next 8/9] ipvlan: improve compiler hints
>
> Extend inlining and branch prediction hints.
>
> Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
> ---
> drivers/net/ipvlan/ipvlan_core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
> index a9fc1b5..67e342d 100644
> --- a/drivers/net/ipvlan/ipvlan_core.c
> +++ b/drivers/net/ipvlan/ipvlan_core.c
> @@ -88,7 +88,7 @@ void ipvlan_ht_addr_del(struct ipvl_addr *addr)
> hlist_del_init_rcu(&addr->hlnode);
> }
>
> -unsigned int ipvlan_mac_hash(const unsigned char *addr)
> +inline unsigned int ipvlan_mac_hash(const unsigned char *addr)
> {
> u32 hash = jhash_1word(__get_unaligned_cpu32(addr + 2),
> ipvlan_jhash_secret);
I'm kind of surprised this isn't causing a problem with differing declarations between the declaration here and the declaration in ipvlan.h. Normally for inlining something like this you would change it to a "static inline" and move the entire declaration into the header file.
> @@ -505,7 +505,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb,
> struct net_device *dev)
> return ipvlan_rcv_int_frame(addr, &skb);
>
> skb = skb_share_check(skb, GFP_ATOMIC);
> - if (!skb)
> + if (unlikely(!skb))
> return NET_XMIT_DROP;
>
> /* Packet definitely does not belong to any of the @@ -596,7
> +596,7 @@ static rx_handler_result_t ipvlan_handle_mode_l2(struct sk_buff
> **pskb,
> * when work-queue processes this frame. This is
> * achieved by returning RX_HANDLER_PASS.
> */
> - if (nskb)
> + if (likely(nskb))
> ipvlan_multicast_enqueue(port, nskb, false);
> }
> } else {
> --
> 2.9.3
^ permalink raw reply
* Re: [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions
From: Jason Gunthorpe @ 2017-04-27 15:27 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-nvdimm-y27Ovi1pjclAfugRpC6u6w,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA,
target-devel-u79uwXL29TY76Z2rM5mHXA, Sumit Semwal,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, James E.J. Bottomley,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, Matthew Wilcox,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
open-iscsi-/JYPxA39Uh5TLH3MbocFFw,
linux-media-u79uwXL29TY76Z2rM5mHXA,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA,
linux-raid-u79uwXL29TY76Z2rM5mHXA,
megaraidlinux.pdl-dY08KVG/lbpWk0Htik3J/w, Jens Axboe,
Martin K. Petersen, Greg Kroah-Hartman,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-crypto-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170427065338.GA20677-jcswGhMUV9g@public.gmane.org>
On Thu, Apr 27, 2017 at 08:53:38AM +0200, Christoph Hellwig wrote:
> > The main difficulty we
> > have now is that neither of those functions are expected to fail and we
> > need them to be able to in cases where the page doesn't map to system
> > RAM. This patch series is trying to address it for users of scatterlist.
> > I'm certainly open to other suggestions.
>
> I think you'll need to follow the existing kmap semantics and never
> fail the iomem version either. Otherwise you'll have a special case
> that's almost never used that has a different error path.
How about first switching as many call sites as possible to use
sg_copy_X_buffer instead of kmap?
A random audit of Logan's series suggests this is actually a fairly
common thing.
eg drivers/mmc/host/sdhci.c is only doing this:
buffer = sdhci_kmap_atomic(sg, &flags);
memcpy(buffer, align, size);
sdhci_kunmap_atomic(buffer, &flags);
drivers/scsi/mvsas/mv_sas.c is this:
+ to = sg_map(sg_resp, 0, SG_KMAP_ATOMIC);
+ memcpy(to,
+ slot->response + sizeof(struct mvs_err_info),
+ sg_dma_len(sg_resp));
+ sg_unmap(sg_resp, to, 0, SG_KMAP_ATOMIC);
etc.
Lots of other places seem similar, if not sometimes a little bit more
convoluted..
Switching all the trivial cases to use copy might bring more clarity
as to what is actually required for the remaining few users? If there
are only a few then it may no longer matter if the API is not idyllic.
Jason
^ permalink raw reply
* RE: [PATCH net-next 8/9] ipvlan: improve compiler hints
From: David Laight @ 2017-04-27 15:27 UTC (permalink / raw)
To: 'Duyck, Alexander H', Chiappero, Marco,
netdev@vger.kernel.org
Cc: David S . Miller, Kirsher, Jeffrey T, Grandhi, Sainath,
Mahesh Bandewar
In-Reply-To: <B1C1DF2ACD01FD4881736AA51731BAB2B2EFB2@ORSMSX107.amr.corp.intel.com>
From: Duyck, Alexander H
> Sent: 27 April 2017 16:21
...
> > -unsigned int ipvlan_mac_hash(const unsigned char *addr)
> > +inline unsigned int ipvlan_mac_hash(const unsigned char *addr)
> > {
> > u32 hash = jhash_1word(__get_unaligned_cpu32(addr + 2),
> > ipvlan_jhash_secret);
>
> I'm kind of surprised this isn't causing a problem with differing declarations between the declaration
> here and the declaration in ipvlan.h. Normally for inlining something like this you would change it to
> a "static inline" and move the entire declaration into the header file.
You get a callable copy for external callers and local calls inlined.
Not usually what you want.
David
^ permalink raw reply
* [PATCH net-next] rhashtable: compact struct rhashtable_params
From: Florian Westphal @ 2017-04-27 15:28 UTC (permalink / raw)
To: netdev; +Cc: Florian Westphal
By using smaller datatypes this struct shrinks considerably
(80 -> 48 bytes on x86_64).
As this is embedded in other structs, this also reduces size of several
others, e.g. cls_fl_head and nft_hash.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
include/linux/rhashtable.h | 18 +++++++++---------
lib/rhashtable.c | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index 8e628feb8708..77cf43166383 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -127,23 +127,23 @@ struct rhashtable;
* @head_offset: Offset of rhash_head in struct to be hashed
* @max_size: Maximum size while expanding
* @min_size: Minimum size while shrinking
- * @nulls_base: Base value to generate nulls marker
- * @automatic_shrinking: Enable automatic shrinking of tables
* @locks_mul: Number of bucket locks to allocate per cpu (default: 128)
+ * @automatic_shrinking: Enable automatic shrinking of tables
+ * @nulls_base: Base value to generate nulls marker
* @hashfn: Hash function (default: jhash2 if !(key_len % 4), or jhash)
* @obj_hashfn: Function to hash object
* @obj_cmpfn: Function to compare key with object
*/
struct rhashtable_params {
- size_t nelem_hint;
- size_t key_len;
- size_t key_offset;
- size_t head_offset;
+ u16 nelem_hint;
+ u16 key_len;
+ u16 key_offset;
+ u16 head_offset;
unsigned int max_size;
- unsigned int min_size;
- u32 nulls_base;
+ u16 min_size;
bool automatic_shrinking;
- size_t locks_mul;
+ u8 locks_mul;
+ u32 nulls_base;
rht_hashfn_t hashfn;
rht_obj_hashfn_t obj_hashfn;
rht_obj_cmpfn_t obj_cmpfn;
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 1fd7986aa9b4..4462676a26f2 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -961,7 +961,7 @@ int rhashtable_init(struct rhashtable *ht,
if (params->max_size)
ht->p.max_size = rounddown_pow_of_two(params->max_size);
- ht->p.min_size = max(ht->p.min_size, HASH_MIN_SIZE);
+ ht->p.min_size = max_t(u16, ht->p.min_size, HASH_MIN_SIZE);
if (params->nelem_hint)
size = rounded_hashtable_size(&ht->p);
--
2.10.2
^ permalink raw reply related
* Realtek RTL8101E PCI-E ethernet controller does not work with the r8169 driver
From: Piotr Gabriel Kosinski @ 2017-04-27 15:31 UTC (permalink / raw)
To: netdev
The Realtek RTL8101E PCI Express ethernet controller does not work
with the r8169 driver, on kernel 4.10 (it also did not work on earlier
kernels). These are the messages from the kernel log:
[ 11.359593] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 11.359611] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have
ASPM control
[ 11.359803] r8169 0000:03:00.0 (unnamed net_device)
(uninitialized): unknown MAC, using family default
[ 11.369802] r8169 0000:03:00.0 (unnamed net_device)
(uninitialized): rtl_chipcmd_cond == 1 (loop: 100, delay: 100).
[ 11.406668] r8169 0000:03:00.0 eth0: rtl_counters_cond == 1 (loop:
1000, delay: 10).
[ 11.406815] r8169 0000:03:00.0 eth0: RTL8101e at
0xffffb3140068d000, ff:ff:ff:ff:ff:ff, XID 9cf0f8ff IRQ 89
[ 11.482740] r8169 0000:03:00.0 enp3s0: renamed from eth0
[ 11.501187] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
(loop: 1000, delay: 10).
[ 33.348246] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
(loop: 1000, delay: 10).
[ 34.273602] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
(loop: 1000, delay: 10).
[ 35.195420] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
(loop: 1000, delay: 10).
[ 35.678908] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
(loop: 1000, delay: 10).
[ 36.401291] IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
[ 36.411989] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
(loop: 1000, delay: 10).
the rtl_counters_cond message is then regularly repeated.
ifconfig's ether address shows ff:ff:ff:ff:ff:ff
If that is of any help - the controller works on FreeBSD's re driver,
but only when the following two loader options are set:
hw.re.msix_disable=1
hw.re.prefer_iomap=1
Both of these options must be set to 1. If prefer_iomap is not set,
there are messages like:
re0: reset never completed!
re0: PHY write failed
re0: attaching PHYs failed
device_attach: re0 attach returned 6
If msix_disable is not set (msix is enabled), there are no error
messages and mac address is read correctly, but the controller does
not work (no connection can be established, e.g. DHCP).
If both of the above options are set to 1, the controller works fine,
with the following messages:
re0: <RealTek 810xE PCIe 10/100baseTX> port 0xe000-0xe0ff mem
0xe0004000-0xe0004fff,0xe0000000-0xe0003fff at device 0.0 on pci2
re0: Using 1 MSI message
re0: Chip rev. 0x44800000
re0: MAC rev. 0x00100000
miibus0: <MII bus> on re0
rlphy0: <RTL8201E 10/100 media interface> PHY 1 on miibus0
rlphy0: 10baseT, 100baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
re0: Using defaults for TSO: 65518/35/2048
re0: netmap queues/slots: TX 1/256, RX 1/256
re0: link state changed to DOWN
re0: link state changed to UP
The problem occurs e.g. on Intel Atom-based Toshiba NB10-A-104 Netbook.
In the next mail I will attach lspci -vvv output.
Thank you,
Piotr.
^ permalink raw reply
* Re: Realtek RTL8101E PCI-E ethernet controller does not work with the r8169 driver
From: Piotr Gabriel Kosinski @ 2017-04-27 15:33 UTC (permalink / raw)
To: netdev
In-Reply-To: <CAFMLSdOBwO4zWZo48EymSGw=4i5DSDfc4VjrxBjWaM5h5DBknw@mail.gmail.com>
00:00.0 Host bridge: Intel Corporation Atom Processor Z36xxx/Z37xxx
Series SoC Transaction Register (rev 0a)
Subsystem: Toshiba America Info Systems Atom Processor
Z36xxx/Z37xxx Series SoC Transaction Register
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Kernel driver in use: iosf_mbi_pci
00:02.0 VGA compatible controller: Intel Corporation Atom Processor
Z36xxx/Z37xxx Series Graphics & Display (rev 0a) (prog-if 00 [VGA
controller])
Subsystem: Toshiba America Info Systems Atom Processor
Z36xxx/Z37xxx Series Graphics & Display
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 90
Region 0: Memory at c0000000 (32-bit, non-prefetchable) [size=4M]
Region 2: Memory at d0000000 (32-bit, prefetchable) [size=256M]
Region 4: I/O ports at f080 [size=8]
[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: [d0] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
Address: fee0200c Data: 41d1
Capabilities: [b0] Vendor Specific Information: Len=07 <?>
Kernel driver in use: i915
Kernel modules: i915
00:13.0 SATA controller: Intel Corporation Atom Processor E3800 Series
SATA AHCI Controller (rev 0a) (prog-if 01 [AHCI 1.0])
Subsystem: Toshiba America Info Systems Atom Processor E3800
Series SATA AHCI Controller
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 88
Region 0: I/O ports at f070 [size=8]
Region 1: I/O ports at f060 [size=4]
Region 2: I/O ports at f050 [size=8]
Region 3: I/O ports at f040 [size=4]
Region 4: I/O ports at f020 [size=32]
Region 5: Memory at c0815000 (32-bit, non-prefetchable) [size=2K]
Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
Address: fee0200c Data: 41b1
Capabilities: [70] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [a8] SATA HBA v1.0 BAR4 Offset=00000004
Kernel driver in use: ahci
Kernel modules: ahci
00:14.0 USB controller: Intel Corporation Atom Processor
Z36xxx/Z37xxx, Celeron N2000 Series USB xHCI (rev 0a) (prog-if 30
[XHCI])
Subsystem: Toshiba America Info Systems Atom Processor
Z36xxx/Z37xxx, Celeron N2000 Series USB xHCI
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 87
Region 0: Memory at c0800000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [70] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA
PME(D0-,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
Address: 00000000fee0200c Data: 4191
Kernel driver in use: xhci_hcd
00:1a.0 Encryption controller: Intel Corporation Atom Processor
Z36xxx/Z37xxx Series Trusted Execution Engine (rev 0a)
Subsystem: Toshiba America Info Systems Atom Processor
Z36xxx/Z37xxx Series Trusted Execution Engine
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 91
Region 0: Memory at c0500000 (32-bit, non-prefetchable) [size=1M]
Region 1: Memory at c0400000 (32-bit, non-prefetchable) [size=1M]
Capabilities: [80] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit-
Address: fee0300c Data: 41e1
Kernel driver in use: mei_txe
Kernel modules: mei_txe
00:1b.0 Audio device: Intel Corporation Atom Processor Z36xxx/Z37xxx
Series High Definition Audio Controller (rev 0a)
Subsystem: Toshiba America Info Systems Atom Processor
Z36xxx/Z37xxx Series High Definition Audio Controller
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 92
Region 0: Memory at c0810000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee0300c Data: 4142
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
00:1c.0 PCI bridge: Intel Corporation Atom Processor E3800 Series PCI
Express Root Port 1 (rev 0a) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 16
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00001000-00001fff
Memory behind bridge: c0900000-c0afffff
Prefetchable memory behind bridge: 00000000c0b00000-00000000c0cfffff
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ <SERR- <PERR-
BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0
ExtTag- RBE+
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 128 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
LnkCap: Port #1, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <512ns, L1 <4us
ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x0, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+
Slot #0, PowerLimit 10.000W; Interlock- NoCompl+
SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt-
HPIrq- LinkChg-
Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet- Interlock-
Changed: MRL- PresDet- LinkState-
RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
RootCap: CRSVisible-
RootSta: PME ReqID 0000, PMEStatus- PMEPending-
DevCap2: Completion Timeout: Range BC, TimeoutDis+, LTR-, OBFF
Not Supported ARIFwd-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
OBFF Disabled ARIFwd-
LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB,
EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
Address: 00000000 Data: 0000
Capabilities: [90] Subsystem: Toshiba America Info Systems Atom
Processor E3800 Series PCI Express Root Port 1
Capabilities: [a0] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1c.1 PCI bridge: Intel Corporation Atom Processor E3800 Series PCI
Express Root Port 2 (rev 0a) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin B routed to IRQ 17
Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
I/O behind bridge: 00002000-00002fff
Memory behind bridge: c0700000-c07fffff
Prefetchable memory behind bridge: 00000000c0d00000-00000000c0efffff
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ <SERR- <PERR-
BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0
ExtTag- RBE+
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 128 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
LnkCap: Port #2, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <512ns, L1 <4us
ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive+ BWMgmt+ ABWMgmt-
SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+
Slot #1, PowerLimit 10.000W; Interlock- NoCompl+
SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt-
HPIrq- LinkChg-
Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
Changed: MRL- PresDet- LinkState-
RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
RootCap: CRSVisible-
RootSta: PME ReqID 0000, PMEStatus- PMEPending-
DevCap2: Completion Timeout: Range BC, TimeoutDis+, LTR-, OBFF
Not Supported ARIFwd-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis+, LTR-,
OBFF Disabled ARIFwd-
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB,
EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
Address: 00000000 Data: 0000
Capabilities: [90] Subsystem: Toshiba America Info Systems Atom
Processor E3800 Series PCI Express Root Port 2
Capabilities: [a0] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1c.2 PCI bridge: Intel Corporation Atom Processor E3800 Series PCI
Express Root Port 3 (rev 0a) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin C routed to IRQ 18
Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
I/O behind bridge: 0000e000-0000efff
Memory behind bridge: c0600000-c06fffff
Prefetchable memory behind bridge: 00000000e0000000-00000000e00fffff
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ <SERR- <PERR-
BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0
ExtTag- RBE+
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 128 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
LnkCap: Port #3, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <512ns, L1 <4us
ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive+ BWMgmt+ ABWMgmt-
SltCap: AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+
Slot #2, PowerLimit 10.000W; Interlock- NoCompl+
SltCtl: Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt-
HPIrq- LinkChg-
Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
SltSta: Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
Changed: MRL- PresDet- LinkState-
RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
RootCap: CRSVisible-
RootSta: PME ReqID 0000, PMEStatus- PMEPending-
DevCap2: Completion Timeout: Range BC, TimeoutDis+, LTR-, OBFF
Not Supported ARIFwd-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis+, LTR-,
OBFF Disabled ARIFwd-
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -3.5dB,
EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
Address: 00000000 Data: 0000
Capabilities: [90] Subsystem: Toshiba America Info Systems Atom
Processor E3800 Series PCI Express Root Port 3
Capabilities: [a0] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: pcieport
Kernel modules: shpchp
00:1f.0 ISA bridge: Intel Corporation Atom Processor Z36xxx/Z37xxx
Series Power Control Unit (rev 0a)
Subsystem: Toshiba America Info Systems Atom Processor
Z36xxx/Z37xxx Series Power Control Unit
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Capabilities: [e0] Vendor Specific Information: Len=0c <?>
Kernel driver in use: lpc_ich
Kernel modules: lpc_ich
00:1f.3 SMBus: Intel Corporation Atom Processor E3800 Series SMBus
Controller (rev 0a)
Subsystem: Toshiba America Info Systems Atom Processor E3800
Series SMBus Controller
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin B routed to IRQ 255
Region 0: Memory at c0814000 (32-bit, non-prefetchable) [size=32]
Region 4: I/O ports at f000 [size=32]
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Kernel modules: i2c_i801
02:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless
Network Adapter (rev 01)
Subsystem: XAVi Technologies Corp. QCA9565 / AR9565 Wireless Network Adapter
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 17
Region 0: Memory at c0700000 (64-bit, non-prefetchable) [size=512K]
Expansion ROM at c0780000 [disabled] [size=64K]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
Address: 0000000000000000 Data: 0000
Masking: 00000000 Pending: 00000000
Capabilities: [70] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
unlimited, L1 <64us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <4us, L1 <64us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-,
OBFF Not Supported
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis+, LTR-,
OBFF Disabled
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB,
EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
Capabilities: [140 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
Status: NegoPending- InProgress-
Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
Kernel driver in use: ath9k
Kernel modules: ath9k
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller (rev 07)
Subsystem: Toshiba America Info Systems RTL8101/2/6E PCI Express
Fast/Gigabit Ethernet controller
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 89
Region 0: I/O ports at e000 [size=256]
Region 2: Memory at e0004000 (64-bit, prefetchable) [size=4K]
Region 4: Memory at e0000000 (64-bit, prefetchable) [size=16K]
Expansion ROM at c0600000 [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee0300c Data: 41c1
Capabilities: [70] Express (v2) Endpoint, MSI 01
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
unlimited, L1 <64us
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s unlimited, L1 <64us
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR+,
OBFF Via message/WAKE#
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis+, LTR+,
OBFF Disabled
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB,
EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
Vector table: BAR=4 offset=00000000
PBA: BAR=4 offset=00000800
Capabilities: [d0] Vital Product Data
Not readable
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [140 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=01
Status: NegoPending- InProgress-
Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
Capabilities: [170 v1] Latency Tolerance Reporting
Max snoop latency: 71680ns
Max no snoop latency: 71680ns
Kernel driver in use: r8169
Kernel modules: r8169
2017-04-27 17:31 GMT+02:00 Piotr Gabriel Kosinski <pg.kosinski@gmail.com>:
> The Realtek RTL8101E PCI Express ethernet controller does not work
> with the r8169 driver, on kernel 4.10 (it also did not work on earlier
> kernels). These are the messages from the kernel log:
>
> [ 11.359593] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> [ 11.359611] r8169 0000:03:00.0: can't disable ASPM; OS doesn't have
> ASPM control
> [ 11.359803] r8169 0000:03:00.0 (unnamed net_device)
> (uninitialized): unknown MAC, using family default
> [ 11.369802] r8169 0000:03:00.0 (unnamed net_device)
> (uninitialized): rtl_chipcmd_cond == 1 (loop: 100, delay: 100).
> [ 11.406668] r8169 0000:03:00.0 eth0: rtl_counters_cond == 1 (loop:
> 1000, delay: 10).
> [ 11.406815] r8169 0000:03:00.0 eth0: RTL8101e at
> 0xffffb3140068d000, ff:ff:ff:ff:ff:ff, XID 9cf0f8ff IRQ 89
> [ 11.482740] r8169 0000:03:00.0 enp3s0: renamed from eth0
> [ 11.501187] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
> (loop: 1000, delay: 10).
> [ 33.348246] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
> (loop: 1000, delay: 10).
> [ 34.273602] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
> (loop: 1000, delay: 10).
> [ 35.195420] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
> (loop: 1000, delay: 10).
> [ 35.678908] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
> (loop: 1000, delay: 10).
> [ 36.401291] IPv6: ADDRCONF(NETDEV_UP): enp3s0: link is not ready
> [ 36.411989] r8169 0000:03:00.0 enp3s0: rtl_counters_cond == 1
> (loop: 1000, delay: 10).
>
> the rtl_counters_cond message is then regularly repeated.
>
> ifconfig's ether address shows ff:ff:ff:ff:ff:ff
>
>
> If that is of any help - the controller works on FreeBSD's re driver,
> but only when the following two loader options are set:
> hw.re.msix_disable=1
> hw.re.prefer_iomap=1
>
> Both of these options must be set to 1. If prefer_iomap is not set,
> there are messages like:
> re0: reset never completed!
> re0: PHY write failed
> re0: attaching PHYs failed
> device_attach: re0 attach returned 6
>
> If msix_disable is not set (msix is enabled), there are no error
> messages and mac address is read correctly, but the controller does
> not work (no connection can be established, e.g. DHCP).
>
> If both of the above options are set to 1, the controller works fine,
> with the following messages:
> re0: <RealTek 810xE PCIe 10/100baseTX> port 0xe000-0xe0ff mem
> 0xe0004000-0xe0004fff,0xe0000000-0xe0003fff at device 0.0 on pci2
> re0: Using 1 MSI message
> re0: Chip rev. 0x44800000
> re0: MAC rev. 0x00100000
> miibus0: <MII bus> on re0
> rlphy0: <RTL8201E 10/100 media interface> PHY 1 on miibus0
> rlphy0: 10baseT, 100baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
> re0: Using defaults for TSO: 65518/35/2048
> re0: netmap queues/slots: TX 1/256, RX 1/256
> re0: link state changed to DOWN
> re0: link state changed to UP
>
> The problem occurs e.g. on Intel Atom-based Toshiba NB10-A-104 Netbook.
> In the next mail I will attach lspci -vvv output.
>
> Thank you,
> Piotr.
^ permalink raw reply
* Re: [PATCH v2 01/21] scatterlist: Introduce sg_map helper functions
From: Logan Gunthorpe @ 2017-04-27 15:44 UTC (permalink / raw)
To: Christoph Hellwig
Cc: dri-devel, Stephen Bates, dm-devel, target-devel, Sumit Semwal,
devel, James E.J. Bottomley, linux-scsi, linux-nvdimm, linux-rdma,
Ross Zwisler, open-iscsi, linux-media, intel-gfx, sparmaintainer,
linux-raid, Dan Williams, megaraidlinux.pdl, Jens Axboe,
Martin K. Petersen, netdev, Matthew Wilcox, linux-mmc,
linux-kernel, linux-crypto, Greg Kroah-Hartman
In-Reply-To: <20170427065338.GA20677@lst.de>
On 27/04/17 12:53 AM, Christoph Hellwig wrote:
> I think you'll need to follow the existing kmap semantics and never
> fail the iomem version either. Otherwise you'll have a special case
> that's almost never used that has a different error path.
>
> Again, wrong way. Suddenly making things fail for your special case
> that normally don't fail is a receipe for bugs.
I don't disagree but these restrictions make the problem impossible to
solve? If there is iomem behind a page in an SGL and someone tries to
map it, we either have to fail or we break iomem safety which was your
original concern.
Logan
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH v2 07/21] crypto: shash, caam: Make use of the new sg_map helper function
From: Logan Gunthorpe @ 2017-04-27 15:45 UTC (permalink / raw)
To: Herbert Xu
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
dm-devel-H+wXaHxf7aLQT0dZR+AlfA,
target-devel-u79uwXL29TY76Z2rM5mHXA, Christoph Hellwig,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, James E.J. Bottomley,
linux-scsi-u79uwXL29TY76Z2rM5mHXA,
linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sumit Semwal,
open-iscsi-/JYPxA39Uh5TLH3MbocFFw,
linux-media-u79uwXL29TY76Z2rM5mHXA,
intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
sparmaintainer-GLv8BlqOqDDQT0dZR+AlfA,
linux-raid-u79uwXL29TY76Z2rM5mHXA,
megaraidlinux.pdl-dY08KVG/lbpWk0Htik3J/w, Jens Axboe,
Martin K. Petersen, netdev-u79uwXL29TY76Z2rM5mHXA, Matthew Wilcox,
linux-mmc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-crypto-u79uwXL29TY76Z2rM5mHXA, Greg Kroah-Hartman,
David S. Miller
In-Reply-To: <20170427035603.GA32212-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
On 26/04/17 09:56 PM, Herbert Xu wrote:
> On Tue, Apr 25, 2017 at 12:20:54PM -0600, Logan Gunthorpe wrote:
>> Very straightforward conversion to the new function in the caam driver
>> and shash library.
>>
>> Signed-off-by: Logan Gunthorpe <logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
>> Cc: Herbert Xu <herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
>> Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
>> ---
>> crypto/shash.c | 9 ++++++---
>> drivers/crypto/caam/caamalg.c | 8 +++-----
>> 2 files changed, 9 insertions(+), 8 deletions(-)
>>
>> diff --git a/crypto/shash.c b/crypto/shash.c
>> index 5e31c8d..5914881 100644
>> --- a/crypto/shash.c
>> +++ b/crypto/shash.c
>> @@ -283,10 +283,13 @@ int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc)
>> if (nbytes < min(sg->length, ((unsigned int)(PAGE_SIZE)) - offset)) {
>> void *data;
>>
>> - data = kmap_atomic(sg_page(sg));
>> - err = crypto_shash_digest(desc, data + offset, nbytes,
>> + data = sg_map(sg, 0, SG_KMAP_ATOMIC);
>> + if (IS_ERR(data))
>> + return PTR_ERR(data);
>> +
>> + err = crypto_shash_digest(desc, data, nbytes,
>> req->result);
>> - kunmap_atomic(data);
>> + sg_unmap(sg, data, 0, SG_KMAP_ATOMIC);
>> crypto_yield(desc->flags);
>> } else
>> err = crypto_shash_init(desc) ?:
>
> Nack. This is an optimisation for the special case of a single
> SG list entry. In fact in the common case the kmap_atomic should
> disappear altogether in the no-highmem case. So replacing it
> with sg_map is not acceptable.
What you seem to have missed is that sg_map is just a thin wrapper
around kmap_atomic. Perhaps with a future check for a mappable page.
This change should have zero impact on performance.
Logan
^ permalink raw reply
* Re: [PATCH net-next] tcp: tcp_rack_reo_timeout() must update tp->tcp_mstamp
From: David Miller @ 2017-04-27 15:46 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, soheil, ncardwell, ycheng
In-Reply-To: <1493266255.6453.103.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 26 Apr 2017 21:10:55 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> I wrongly assumed tp->tcp_mstamp was up to date at the time
> tcp_rack_reo_timeout() was called.
>
> It is not true, since we only update tcp->tcp_mstamp when receiving
> a packet (as initially done in commit 69e996c58a35 ("tcp: add
> tp->tcp_mstamp field")
>
> tcp_rack_reo_timeout() being called by a timer and not an incoming
> packet, we need to refresh tp->tcp_mstamp
>
> Fixes: 7c1c7308592f ("tcp: do not pass timestamp to tcp_rack_detect_loss()")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ 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