* [PATCH net-next v2 1/2] net: AF-specific RTM_GETSTATS attributes
From: Robert Shearman @ 2017-01-16 14:16 UTC (permalink / raw)
To: davem; +Cc: netdev, David Ahern, ebiederm, Roopa Prabhu, Robert Shearman
In-Reply-To: <1484576197-19442-1-git-send-email-rshearma@brocade.com>
Add the functionality for including address-family-specific per-link
stats in RTM_GETSTATS messages. This is done through adding a new
IFLA_STATS_AF_SPEC attribute under which address family attributes are
nested and then the AF-specific attributes can be further nested. This
follows the model of IFLA_AF_SPEC on RTM_*LINK messages and it has the
advantage of presenting an easily extended hierarchy. The rtnl_af_ops
structure is extended to provide AFs with the opportunity to fill and
provide the size of their stats attributes.
One alternative would have been to provide AFs with the ability to add
attributes directly into the RTM_GETSTATS message without a nested
hierarchy. I discounted this approach as it increases the rate at
which the 32 attribute number space is used up and it makes
implementation a little more tricky for stats dump resuming (at the
moment the order in which attributes are added to the message has to
match the numeric order of the attributes).
Another alternative would have been to register per-AF RTM_GETSTATS
handlers. I discounted this approach as I perceived a common use-case
to be getting all the stats for an interface and this approach would
necessitate multiple requests/dumps to retrieve them all.
Signed-off-by: Robert Shearman <rshearma@brocade.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
include/net/rtnetlink.h | 4 ++++
include/uapi/linux/if_link.h | 1 +
net/core/rtnetlink.c | 50 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 55 insertions(+)
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 4113916cc1bb..106de5f7bf06 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -139,6 +139,10 @@ struct rtnl_af_ops {
const struct nlattr *attr);
int (*set_link_af)(struct net_device *dev,
const struct nlattr *attr);
+
+ int (*fill_stats_af)(struct sk_buff *skb,
+ const struct net_device *dev);
+ size_t (*get_stats_af_size)(const struct net_device *dev);
};
void __rtnl_af_unregister(struct rtnl_af_ops *ops);
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 6b13e591abc9..184b16ed2b84 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -847,6 +847,7 @@ enum {
IFLA_STATS_LINK_XSTATS,
IFLA_STATS_LINK_XSTATS_SLAVE,
IFLA_STATS_LINK_OFFLOAD_XSTATS,
+ IFLA_STATS_AF_SPEC,
__IFLA_STATS_MAX,
};
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 18b5aae99bec..4edc1bd7a735 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3829,6 +3829,39 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev,
*idxattr = 0;
}
+ if (stats_attr_valid(filter_mask, IFLA_STATS_AF_SPEC, *idxattr)) {
+ struct rtnl_af_ops *af_ops;
+
+ *idxattr = IFLA_STATS_AF_SPEC;
+ attr = nla_nest_start(skb, IFLA_STATS_AF_SPEC);
+ if (!attr)
+ goto nla_put_failure;
+
+ list_for_each_entry(af_ops, &rtnl_af_ops, list) {
+ if (af_ops->fill_stats_af) {
+ struct nlattr *af;
+ int err;
+
+ af = nla_nest_start(skb, af_ops->family);
+ if (!af)
+ goto nla_put_failure;
+
+ err = af_ops->fill_stats_af(skb, dev);
+
+ if (err == -ENODATA)
+ nla_nest_cancel(skb, af);
+ else if (err < 0)
+ goto nla_put_failure;
+
+ nla_nest_end(skb, af);
+ }
+ }
+
+ nla_nest_end(skb, attr);
+
+ *idxattr = 0;
+ }
+
nlmsg_end(skb, nlh);
return 0;
@@ -3885,6 +3918,23 @@ static size_t if_nlmsg_stats_size(const struct net_device *dev,
if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS, 0))
size += rtnl_get_offload_stats_size(dev);
+ if (stats_attr_valid(filter_mask, IFLA_STATS_AF_SPEC, 0)) {
+ struct rtnl_af_ops *af_ops;
+
+ /* for IFLA_STATS_AF_SPEC */
+ size += nla_total_size(0);
+
+ list_for_each_entry(af_ops, &rtnl_af_ops, list) {
+ if (af_ops->get_stats_af_size) {
+ size += nla_total_size(
+ af_ops->get_stats_af_size(dev));
+
+ /* for AF_* */
+ size += nla_total_size(0);
+ }
+ }
+ }
+
return size;
}
--
2.1.4
^ permalink raw reply related
* [PATCH net-next v2 0/2] mpls: Packet stats
From: Robert Shearman @ 2017-01-16 14:16 UTC (permalink / raw)
To: davem; +Cc: netdev, David Ahern, ebiederm, Roopa Prabhu, Robert Shearman
In-Reply-To: <1484331253-5908-1-git-send-email-rshearma@brocade.com>
This patchset records per-interface packet stats in the MPLS
forwarding path and exports them using a nest of attributes root at a
new IFLA_STATS_AF_SPEC attribute as part of RTM_GETSTATS messages:
[IFLA_STATS_AF_SPEC]
-> [AF_MPLS]
-> [MPLS_STATS_LINK]
-> struct mpls_link_stats
The first patch adds the rtnl infrastructure for this, including a new
callbacks to per-AF ops of fill_stats_af and get_stats_af_size. The
second patch records MPLS stats and makes use of the infrastructure to
export them. The rtnl infrastructure could also be used to export IPv6
stats in the future.
Changes in v2:
- make incrementing IPv6 stats in mpls_stats_inc_outucastpkts
conditional on CONFIG_IPV6 to fix build with CONFIG_IPV6=n
Robert Shearman (2):
net: AF-specific RTM_GETSTATS attributes
mpls: Packet stats
include/net/rtnetlink.h | 4 +
include/uapi/linux/if_link.h | 1 +
include/uapi/linux/mpls.h | 30 +++++++
net/core/rtnetlink.c | 50 ++++++++++++
net/mpls/af_mpls.c | 181 +++++++++++++++++++++++++++++++++++++------
net/mpls/internal.h | 58 +++++++++++++-
net/mpls/mpls_iptunnel.c | 11 ++-
7 files changed, 307 insertions(+), 28 deletions(-)
--
2.1.4
^ permalink raw reply
* [PATCH v2 0/3] xen: optimize xenbus performance
From: Juergen Gross @ 2017-01-16 14:15 UTC (permalink / raw)
To: linux-kernel, xen-devel
Cc: boris.ostrovsky, Juergen Gross, konrad.wilk, roger.pau, wei.liu2,
paul.durrant, netdev
The xenbus driver used for communication with Xenstore (all kernel
accesses to Xenstore and in case of Xenstore living in another domain
all accesses of the local domain to Xenstore) is rather simple
especially regarding multiple concurrent accesses: they are just being
serialized in spite of Xenstore being capable to handle multiple
parallel accesses.
Clean up the external interface(s) of xenbus and optimize its
performance by allowing multiple concurrent accesses to Xenstore.
V2:
- patch 1: update commit message, re-add lost copyright
- patch 3: address comments of Boris Ostrovsky:
- guard xs_request_id by lock
- move state struct definitions to the place where they are being
used
- rate limit some warnings
- use barrier() instead of cpu_relax()
- add/remove some comments
- minor changes like naming of variables
Juergen Gross (3):
xen: clean up xenbus internal headers
xen: modify xenstore watch event interface
xen: optimize xenbus driver for multiple concurrent xenstore accesses
drivers/block/xen-blkback/xenbus.c | 6 +-
drivers/net/xen-netback/xenbus.c | 8 +-
drivers/xen/cpu_hotplug.c | 5 +-
drivers/xen/manage.c | 6 +-
drivers/xen/xen-balloon.c | 2 +-
drivers/xen/xen-pciback/xenbus.c | 2 +-
drivers/xen/xenbus/xenbus.h | 135 +++++++
drivers/xen/xenbus/xenbus_client.c | 6 +-
drivers/xen/xenbus/xenbus_comms.c | 315 +++++++++++++++--
drivers/xen/xenbus/xenbus_comms.h | 51 ---
drivers/xen/xenbus/xenbus_dev_backend.c | 2 +-
drivers/xen/xenbus/xenbus_dev_frontend.c | 213 ++++++-----
drivers/xen/xenbus/xenbus_probe.c | 14 +-
drivers/xen/xenbus/xenbus_probe.h | 88 -----
drivers/xen/xenbus/xenbus_probe_backend.c | 11 +-
drivers/xen/xenbus/xenbus_probe_frontend.c | 17 +-
drivers/xen/xenbus/xenbus_xs.c | 547 +++++++++++++----------------
drivers/xen/xenfs/super.c | 2 +-
drivers/xen/xenfs/xenstored.c | 2 +-
include/xen/xenbus.h | 18 +-
20 files changed, 838 insertions(+), 612 deletions(-)
create mode 100644 drivers/xen/xenbus/xenbus.h
delete mode 100644 drivers/xen/xenbus/xenbus_comms.h
delete mode 100644 drivers/xen/xenbus/xenbus_probe.h
Cc: konrad.wilk@oracle.com
Cc: roger.pau@citrix.com
Cc: wei.liu2@citrix.com
Cc: paul.durrant@citrix.com
Cc: netdev@vger.kernel.org
--
2.10.2
^ permalink raw reply
* [PATCH v2 2/3] xen: modify xenstore watch event interface
From: Juergen Gross @ 2017-01-16 14:15 UTC (permalink / raw)
To: linux-kernel, xen-devel
Cc: Juergen Gross, wei.liu2, konrad.wilk, netdev, paul.durrant,
boris.ostrovsky, roger.pau
In-Reply-To: <20170116141533.8946-1-jgross@suse.com>
Today a Xenstore watch event is delivered via a callback function
declared as:
void (*callback)(struct xenbus_watch *,
const char **vec, unsigned int len);
As all watch events only ever come with two parameters (path and token)
changing the prototype to:
void (*callback)(struct xenbus_watch *,
const char *path, const char *token);
is the natural thing to do.
Apply this change and adapt all users.
Cc: konrad.wilk@oracle.com
Cc: roger.pau@citrix.com
Cc: wei.liu2@citrix.com
Cc: paul.durrant@citrix.com
Cc: netdev@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
drivers/block/xen-blkback/xenbus.c | 6 +++---
drivers/net/xen-netback/xenbus.c | 8 ++++----
drivers/xen/cpu_hotplug.c | 5 ++---
drivers/xen/manage.c | 6 +++---
drivers/xen/xen-balloon.c | 2 +-
drivers/xen/xen-pciback/xenbus.c | 2 +-
drivers/xen/xenbus/xenbus.h | 6 +++---
drivers/xen/xenbus/xenbus_client.c | 4 ++--
drivers/xen/xenbus/xenbus_dev_frontend.c | 21 ++++++++-------------
drivers/xen/xenbus/xenbus_probe.c | 11 ++++-------
drivers/xen/xenbus/xenbus_probe_backend.c | 8 ++++----
drivers/xen/xenbus/xenbus_probe_frontend.c | 14 +++++++-------
drivers/xen/xenbus/xenbus_xs.c | 29 ++++++++++++++---------------
include/xen/xenbus.h | 6 +++---
14 files changed, 59 insertions(+), 69 deletions(-)
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index 415e79b..8fe61b5 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -38,8 +38,8 @@ struct backend_info {
static struct kmem_cache *xen_blkif_cachep;
static void connect(struct backend_info *);
static int connect_ring(struct backend_info *);
-static void backend_changed(struct xenbus_watch *, const char **,
- unsigned int);
+static void backend_changed(struct xenbus_watch *, const char *,
+ const char *);
static void xen_blkif_free(struct xen_blkif *blkif);
static void xen_vbd_free(struct xen_vbd *vbd);
@@ -661,7 +661,7 @@ static int xen_blkbk_probe(struct xenbus_device *dev,
* ready, connect.
*/
static void backend_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
int err;
unsigned major;
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 3124eae..d8a40fa 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -723,7 +723,7 @@ static int xen_net_read_mac(struct xenbus_device *dev, u8 mac[])
}
static void xen_net_rate_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
struct xenvif *vif = container_of(watch, struct xenvif, credit_watch);
struct xenbus_device *dev = xenvif_to_xenbus_device(vif);
@@ -780,7 +780,7 @@ static void xen_unregister_credit_watch(struct xenvif *vif)
}
static void xen_mcast_ctrl_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
struct xenvif *vif = container_of(watch, struct xenvif,
mcast_ctrl_watch);
@@ -855,8 +855,8 @@ static void unregister_hotplug_status_watch(struct backend_info *be)
}
static void hotplug_status_changed(struct xenbus_watch *watch,
- const char **vec,
- unsigned int vec_size)
+ const char *path,
+ const char *token)
{
struct backend_info *be = container_of(watch,
struct backend_info,
diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
index 5676aef..7a4daa2 100644
--- a/drivers/xen/cpu_hotplug.c
+++ b/drivers/xen/cpu_hotplug.c
@@ -68,13 +68,12 @@ static void vcpu_hotplug(unsigned int cpu)
}
static void handle_vcpu_hotplug_event(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
unsigned int cpu;
char *cpustr;
- const char *node = vec[XS_WATCH_PATH];
- cpustr = strstr(node, "cpu/");
+ cpustr = strstr(path, "cpu/");
if (cpustr != NULL) {
sscanf(cpustr, "cpu/%u", &cpu);
vcpu_hotplug(cpu);
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 26e5e85..ca62c09 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -218,7 +218,7 @@ static struct shutdown_handler shutdown_handlers[] = {
};
static void shutdown_handler(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
char *str;
struct xenbus_transaction xbt;
@@ -266,8 +266,8 @@ static void shutdown_handler(struct xenbus_watch *watch,
}
#ifdef CONFIG_MAGIC_SYSRQ
-static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
- unsigned int len)
+static void sysrq_handler(struct xenbus_watch *watch, const char *path,
+ const char *token)
{
char sysrq_key = '\0';
struct xenbus_transaction xbt;
diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c
index 79865b8..e7715cb 100644
--- a/drivers/xen/xen-balloon.c
+++ b/drivers/xen/xen-balloon.c
@@ -55,7 +55,7 @@ static int register_balloon(struct device *dev);
/* React to a change in the target key */
static void watch_target(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
unsigned long long new_target;
int err;
diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
index 3f0aee0..3814b44 100644
--- a/drivers/xen/xen-pciback/xenbus.c
+++ b/drivers/xen/xen-pciback/xenbus.c
@@ -652,7 +652,7 @@ static int xen_pcibk_setup_backend(struct xen_pcibk_device *pdev)
}
static void xen_pcibk_be_watch(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
struct xen_pcibk_device *pdev =
container_of(watch, struct xen_pcibk_device, be_watch);
diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h
index a6b007d..5199527 100644
--- a/drivers/xen/xenbus/xenbus.h
+++ b/drivers/xen/xenbus/xenbus.h
@@ -40,8 +40,8 @@ struct xen_bus_type {
int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename);
int (*probe)(struct xen_bus_type *bus, const char *type,
const char *dir);
- void (*otherend_changed)(struct xenbus_watch *watch, const char **vec,
- unsigned int len);
+ void (*otherend_changed)(struct xenbus_watch *watch, const char *path,
+ const char *token);
struct bus_type bus;
};
@@ -84,7 +84,7 @@ int xenbus_dev_resume(struct device *dev);
int xenbus_dev_cancel(struct device *dev);
void xenbus_otherend_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len,
+ const char *path, const char *token,
int ignore_on_shutdown);
int xenbus_read_otherend_details(struct xenbus_device *xendev,
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c
index 23edf53..9586c24 100644
--- a/drivers/xen/xenbus/xenbus_client.c
+++ b/drivers/xen/xenbus/xenbus_client.c
@@ -115,7 +115,7 @@ EXPORT_SYMBOL_GPL(xenbus_strstate);
int xenbus_watch_path(struct xenbus_device *dev, const char *path,
struct xenbus_watch *watch,
void (*callback)(struct xenbus_watch *,
- const char **, unsigned int))
+ const char *, const char *))
{
int err;
@@ -153,7 +153,7 @@ EXPORT_SYMBOL_GPL(xenbus_watch_path);
int xenbus_watch_pathfmt(struct xenbus_device *dev,
struct xenbus_watch *watch,
void (*callback)(struct xenbus_watch *,
- const char **, unsigned int),
+ const char *, const char *),
const char *pathfmt, ...)
{
int err;
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
index e2bc9b3..e4b9847 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -258,26 +258,23 @@ static struct watch_adapter *alloc_watch_adapter(const char *path,
}
static void watch_fired(struct xenbus_watch *watch,
- const char **vec,
- unsigned int len)
+ const char *path,
+ const char *token)
{
struct watch_adapter *adap;
struct xsd_sockmsg hdr;
- const char *path, *token;
- int path_len, tok_len, body_len, data_len = 0;
+ const char *token_caller;
+ int path_len, tok_len, body_len;
int ret;
LIST_HEAD(staging_q);
adap = container_of(watch, struct watch_adapter, watch);
- path = vec[XS_WATCH_PATH];
- token = adap->token;
+ token_caller = adap->token;
path_len = strlen(path) + 1;
- tok_len = strlen(token) + 1;
- if (len > 2)
- data_len = vec[len] - vec[2] + 1;
- body_len = path_len + tok_len + data_len;
+ tok_len = strlen(token_caller) + 1;
+ body_len = path_len + tok_len;
hdr.type = XS_WATCH_EVENT;
hdr.len = body_len;
@@ -288,9 +285,7 @@ static void watch_fired(struct xenbus_watch *watch,
if (!ret)
ret = queue_reply(&staging_q, path, path_len);
if (!ret)
- ret = queue_reply(&staging_q, token, tok_len);
- if (!ret && len > 2)
- ret = queue_reply(&staging_q, vec[2], data_len);
+ ret = queue_reply(&staging_q, token_caller, tok_len);
if (!ret) {
/* success: pass reply list onto watcher */
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 6baffbb..74888ca 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -169,7 +169,7 @@ int xenbus_read_otherend_details(struct xenbus_device *xendev,
EXPORT_SYMBOL_GPL(xenbus_read_otherend_details);
void xenbus_otherend_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len,
+ const char *path, const char *token,
int ignore_on_shutdown)
{
struct xenbus_device *dev =
@@ -180,18 +180,15 @@ void xenbus_otherend_changed(struct xenbus_watch *watch,
/* Protect us against watches firing on old details when the otherend
details change, say immediately after a resume. */
if (!dev->otherend ||
- strncmp(dev->otherend, vec[XS_WATCH_PATH],
- strlen(dev->otherend))) {
- dev_dbg(&dev->dev, "Ignoring watch at %s\n",
- vec[XS_WATCH_PATH]);
+ strncmp(dev->otherend, path, strlen(dev->otherend))) {
+ dev_dbg(&dev->dev, "Ignoring watch at %s\n", path);
return;
}
state = xenbus_read_driver_state(dev->otherend);
dev_dbg(&dev->dev, "state is %d, (%s), %s, %s\n",
- state, xenbus_strstate(state), dev->otherend_watch.node,
- vec[XS_WATCH_PATH]);
+ state, xenbus_strstate(state), dev->otherend_watch.node, path);
/*
* Ignore xenbus transitions during shutdown. This prevents us doing
diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c
index f46b4dc..b0bed4f 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -181,9 +181,9 @@ static int xenbus_probe_backend(struct xen_bus_type *bus, const char *type,
}
static void frontend_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
- xenbus_otherend_changed(watch, vec, len, 0);
+ xenbus_otherend_changed(watch, path, token, 0);
}
static struct xen_bus_type xenbus_backend = {
@@ -204,11 +204,11 @@ static struct xen_bus_type xenbus_backend = {
};
static void backend_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
DPRINTK("");
- xenbus_dev_changed(vec[XS_WATCH_PATH], &xenbus_backend);
+ xenbus_dev_changed(path, &xenbus_backend);
}
static struct xenbus_watch be_watch = {
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index d7b77a6..19e45ce 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -86,9 +86,9 @@ static int xenbus_uevent_frontend(struct device *_dev,
static void backend_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
- xenbus_otherend_changed(watch, vec, len, 1);
+ xenbus_otherend_changed(watch, path, token, 1);
}
static void xenbus_frontend_delayed_resume(struct work_struct *w)
@@ -153,11 +153,11 @@ static struct xen_bus_type xenbus_frontend = {
};
static void frontend_changed(struct xenbus_watch *watch,
- const char **vec, unsigned int len)
+ const char *path, const char *token)
{
DPRINTK("");
- xenbus_dev_changed(vec[XS_WATCH_PATH], &xenbus_frontend);
+ xenbus_dev_changed(path, &xenbus_frontend);
}
@@ -332,13 +332,13 @@ static DECLARE_WAIT_QUEUE_HEAD(backend_state_wq);
static int backend_state;
static void xenbus_reset_backend_state_changed(struct xenbus_watch *w,
- const char **v, unsigned int l)
+ const char *path, const char *token)
{
- if (xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i",
+ if (xenbus_scanf(XBT_NIL, path, "", "%i",
&backend_state) != 1)
backend_state = XenbusStateUnknown;
printk(KERN_DEBUG "XENBUS: backend %s %s\n",
- v[XS_WATCH_PATH], xenbus_strstate(backend_state));
+ path, xenbus_strstate(backend_state));
wake_up(&backend_state_wq);
}
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index 4c49d87..ebc768f 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -64,8 +64,8 @@ struct xs_stored_msg {
/* Queued watch events. */
struct {
struct xenbus_watch *handle;
- char **vec;
- unsigned int vec_size;
+ const char *path;
+ const char *token;
} watch;
} u;
};
@@ -765,7 +765,7 @@ void unregister_xenbus_watch(struct xenbus_watch *watch)
if (msg->u.watch.handle != watch)
continue;
list_del(&msg->list);
- kfree(msg->u.watch.vec);
+ kfree(msg->u.watch.path);
kfree(msg);
}
spin_unlock(&watch_events_lock);
@@ -833,11 +833,10 @@ static int xenwatch_thread(void *unused)
if (ent != &watch_events) {
msg = list_entry(ent, struct xs_stored_msg, list);
- msg->u.watch.handle->callback(
- msg->u.watch.handle,
- (const char **)msg->u.watch.vec,
- msg->u.watch.vec_size);
- kfree(msg->u.watch.vec);
+ msg->u.watch.handle->callback(msg->u.watch.handle,
+ msg->u.watch.path,
+ msg->u.watch.token);
+ kfree(msg->u.watch.path);
kfree(msg);
}
@@ -903,24 +902,24 @@ static int process_msg(void)
body[msg->hdr.len] = '\0';
if (msg->hdr.type == XS_WATCH_EVENT) {
- msg->u.watch.vec = split(body, msg->hdr.len,
- &msg->u.watch.vec_size);
- if (IS_ERR(msg->u.watch.vec)) {
- err = PTR_ERR(msg->u.watch.vec);
+ if (count_strings(body, msg->hdr.len) != 2) {
+ err = -EINVAL;
kfree(msg);
+ kfree(body);
goto out;
}
+ msg->u.watch.path = (const char *)body;
+ msg->u.watch.token = (const char *)strchr(body, '\0') + 1;
spin_lock(&watches_lock);
- msg->u.watch.handle = find_watch(
- msg->u.watch.vec[XS_WATCH_TOKEN]);
+ msg->u.watch.handle = find_watch(msg->u.watch.token);
if (msg->u.watch.handle != NULL) {
spin_lock(&watch_events_lock);
list_add_tail(&msg->list, &watch_events);
wake_up(&watch_events_waitq);
spin_unlock(&watch_events_lock);
} else {
- kfree(msg->u.watch.vec);
+ kfree(body);
kfree(msg);
}
spin_unlock(&watches_lock);
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index 98f73a2..869c816 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -61,7 +61,7 @@ struct xenbus_watch
/* Callback (executed in a process context with no locks held). */
void (*callback)(struct xenbus_watch *,
- const char **vec, unsigned int len);
+ const char *path, const char *token);
};
@@ -193,11 +193,11 @@ void xenbus_probe(struct work_struct *);
int xenbus_watch_path(struct xenbus_device *dev, const char *path,
struct xenbus_watch *watch,
void (*callback)(struct xenbus_watch *,
- const char **, unsigned int));
+ const char *, const char *));
__printf(4, 5)
int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch,
void (*callback)(struct xenbus_watch *,
- const char **, unsigned int),
+ const char *, const char *),
const char *pathfmt, ...);
int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state);
--
2.10.2
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related
* Re: [PATCH] net/irda: fix lockdep annotation
From: kbuild test robot @ 2017-01-16 14:11 UTC (permalink / raw)
To: Dmitry Vyukov
Cc: kbuild-all, davej, samuel, davem, glider, andreyknvl,
Dmitry Vyukov, netdev
In-Reply-To: <20170116102503.23800-1-dvyukov@google.com>
[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]
Hi Dmitry,
[auto build test WARNING on net-next/master]
[also build test WARNING on v4.10-rc4 next-20170116]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Dmitry-Vyukov/net-irda-fix-lockdep-annotation/20170116-183405
config: x86_64-randconfig-s2-01161850 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
net/irda/irqueue.c: In function 'hashbin_delete':
>> net/irda/irqueue.c:393: warning: unused variable 'depth'
At top level:
cc1: warning: unrecognized command line option "-Wno-maybe-uninitialized"
vim +/depth +393 net/irda/irqueue.c
377
378
379 /*
380 * Function hashbin_delete (hashbin, free_func)
381 *
382 * Destroy hashbin, the free_func can be a user supplied special routine
383 * for deallocating this structure if it's complex. If not the user can
384 * just supply kfree, which should take care of the job.
385 */
386 #ifdef CONFIG_LOCKDEP
387 static atomic_t hashbin_lock_depth = ATOMIC_INIT(0);
388 #endif
389 int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
390 {
391 irda_queue_t* queue;
392 unsigned long flags = 0;
> 393 int i, depth = 0;
394
395 IRDA_ASSERT(hashbin != NULL, return -1;);
396 IRDA_ASSERT(hashbin->magic == HB_MAGIC, return -1;);
397
398 /* Synchronize */
399 if ( hashbin->hb_type & HB_LOCK ) {
400 #ifdef CONFIG_LOCKDEP
401 depth = atomic_inc_return(&hashbin_lock_depth) - 1;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25885 bytes --]
^ permalink raw reply
* [PATCH] ip/xfrm: Fix deleteall when having many policies installed
From: Alexander Heinlein @ 2017-01-16 14:09 UTC (permalink / raw)
To: netdev; +Cc: shemminger
Fix "Policy buffer overflow" error when trying to use deleteall with
many policies installed.
Signed-off-by: Alexander Heinlein <alexander.heinlein@secunet.com>
---
ip/xfrm_policy.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index cc9c0f1..451b982 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -732,10 +732,8 @@ static int xfrm_policy_keep(const struct
sockaddr_nl *who,
if (!xfrm_policy_filter_match(xpinfo, ptype))
return 0;
- if (xb->offset > xb->size) {
- fprintf(stderr, "Policy buffer overflow\n");
- return -1;
- }
+ if (xb->offset + NLMSG_LENGTH(sizeof(*xpid)) > xb->size)
+ return 0;
new_n = (struct nlmsghdr *)(xb->buf + xb->offset);
new_n->nlmsg_len = NLMSG_LENGTH(sizeof(*xpid));
--
2.1.4
^ permalink raw reply related
* Re: sctp: kernel memory overwrite attempt detected in sctp_getsockopt_assoc_stats
From: Dmitry Vyukov @ 2017-01-16 14:03 UTC (permalink / raw)
To: Neil Horman
Cc: Vladislav Yasevich, David Miller, linux-sctp, netdev, LKML,
Kees Cook, syzkaller
In-Reply-To: <20170116135743.GC30105@hmswarspite.think-freely.org>
On Mon, Jan 16, 2017 at 2:57 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
> On Mon, Jan 16, 2017 at 08:11:40AM +0100, Dmitry Vyukov wrote:
>> On Sun, Jan 15, 2017 at 9:35 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
>> > On Sun, Jan 15, 2017 at 06:29:59PM +0100, Dmitry Vyukov wrote:
>> >> Hello,
>> >>
>> >> I've enabled CONFIG_HARDENED_USERCOPY_PAGESPAN on syzkaller fuzzer and
>> >> now I am seeing lots of:
>> >>
>> > If I'm not mistaken, its because thats specifically what that option does. From
>> > the Kconfig:
>> > onfig HARDENED_USERCOPY_PAGESPAN
>> > bool "Refuse to copy allocations that span multiple pages"
>> > depends on HARDENED_USERCOPY
>> > depends on EXPERT
>> > help
>> > When a multi-page allocation is done without __GFP_COMP,
>> > hardened usercopy will reject attempts to copy it. There are,
>> > however, several cases of this in the kernel that have not all
>> > been removed. This config is intended to be used only while
>> > trying to find such users.
>> >
>> > So, if the fuzzer does a setsockopt and the data it passes crosses a page
>> > boundary, it seems like this will get triggered. Based on the fact that its
>> > only used to find users that do this, it seems like not the sort of thing that
>> > you want enabled while running a fuzzer that might do it arbitrarily.
>>
>>
>> The code also takes into account compound pages. As far as I
>> understand the intention of the check is to effectively find
>> out-of-bounds copies (e.g. goes beyond the current heap allocation). I
>> would expect that stacks are allocated as compound pages and don't
>> trigger this check. I don't see it is firing in other similar places.
>>
> Honestly, I'm not overly familiar with stack page allocation, at least not so
> far as compound vs. single page allocation is concerned. I suppose the question
> your really asking here is: Have you found a case in which the syscall fuzzer
> has forced the allocation of an insecure non-compound page on the stack, or is
> this a false positive warning. I can't provide the answer to that.
Yes. I added Kees, author of CONFIG_HARDENED_USERCOPY_PAGESPAN, to To line.
Kees, is this a false positive?
^ permalink raw reply
* Re: sctp: kernel memory overwrite attempt detected in sctp_getsockopt_assoc_stats
From: Neil Horman @ 2017-01-16 13:57 UTC (permalink / raw)
To: Dmitry Vyukov
Cc: Vladislav Yasevich, David Miller, linux-sctp, netdev, LKML,
Kees Cook, syzkaller
In-Reply-To: <CACT4Y+Zp4cruuKtf7fkSeLFbYLzTOD79Y2c+cCrHx-pbEXC_6A@mail.gmail.com>
On Mon, Jan 16, 2017 at 08:11:40AM +0100, Dmitry Vyukov wrote:
> On Sun, Jan 15, 2017 at 9:35 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
> > On Sun, Jan 15, 2017 at 06:29:59PM +0100, Dmitry Vyukov wrote:
> >> Hello,
> >>
> >> I've enabled CONFIG_HARDENED_USERCOPY_PAGESPAN on syzkaller fuzzer and
> >> now I am seeing lots of:
> >>
> > If I'm not mistaken, its because thats specifically what that option does. From
> > the Kconfig:
> > onfig HARDENED_USERCOPY_PAGESPAN
> > bool "Refuse to copy allocations that span multiple pages"
> > depends on HARDENED_USERCOPY
> > depends on EXPERT
> > help
> > When a multi-page allocation is done without __GFP_COMP,
> > hardened usercopy will reject attempts to copy it. There are,
> > however, several cases of this in the kernel that have not all
> > been removed. This config is intended to be used only while
> > trying to find such users.
> >
> > So, if the fuzzer does a setsockopt and the data it passes crosses a page
> > boundary, it seems like this will get triggered. Based on the fact that its
> > only used to find users that do this, it seems like not the sort of thing that
> > you want enabled while running a fuzzer that might do it arbitrarily.
>
>
> The code also takes into account compound pages. As far as I
> understand the intention of the check is to effectively find
> out-of-bounds copies (e.g. goes beyond the current heap allocation). I
> would expect that stacks are allocated as compound pages and don't
> trigger this check. I don't see it is firing in other similar places.
>
Honestly, I'm not overly familiar with stack page allocation, at least not so
far as compound vs. single page allocation is concerned. I suppose the question
your really asking here is: Have you found a case in which the syscall fuzzer
has forced the allocation of an insecure non-compound page on the stack, or is
this a false positive warning. I can't provide the answer to that.
Neil
>
>
> >> usercopy: kernel memory overwrite attempt detected to ffff8801a74f6f10
> >> (<spans multiple pages>) (256 bytes)
> >>
> >> kernel BUG at mm/usercopy.c:75!
> >> invalid opcode: 0000 [#1] SMP KASAN
> >> Dumping ftrace buffer:
> >> (ftrace buffer empty)
> >> Modules linked in:
> >> CPU: 1 PID: 15686 Comm: syz-executor3 Not tainted 4.9.0 #1
> >> Hardware name: Google Google Compute Engine/Google Compute Engine,
> >> BIOS Google 01/01/2011
> >> task: ffff8801c89b2500 task.stack: ffff8801a74f0000
> >> RIP: 0010:[<ffffffff81a1b041>] [<ffffffff81a1b041>] report_usercopy
> >> mm/usercopy.c:67 [inline]
> >> RIP: 0010:[<ffffffff81a1b041>] [<ffffffff81a1b041>]
> >> __check_object_size+0x2d1/0x9ec mm/usercopy.c:278
> >> RSP: 0018:ffff8801a74f6cd0 EFLAGS: 00010286
> >> RAX: 000000000000006b RBX: ffffffff84500120 RCX: 0000000000000000
> >> RDX: 000000000000006b RSI: ffffffff815a7791 RDI: ffffed0034e9ed8c
> >> RBP: ffff8801a74f6e48 R08: 0000000000000001 R09: 0000000000000000
> >> R10: 0000000000000000 R11: 0000000000000001 R12: ffff8801a74f6f10
> >> R13: 0000000000000100 R14: ffffffff845000e0 R15: ffff8801a74f700f
> >> FS: 00007f80918de700(0000) GS:ffff8801dc100000(0000) knlGS:0000000000000000
> >> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> >> CR2: 0000000020058ffc CR3: 00000001cc1cc000 CR4: 00000000001406e0
> >> Stack:
> >> ffffffff8598fcc8 0000000000000000 000077ff80000000 ffffea0005c99608
> >> ffffffff844fff40 ffffffff844fff40 0000000041b58ab3 ffffffff84ae0fa0
> >> ffffffff81a1ad70 ffff8801c89b2500 dead000000000100 ffffffff814d4425
> >> Call Trace:
> >> [<ffffffff83e4ece9>] check_object_size include/linux/thread_info.h:129 [inline]
> >> [<ffffffff83e4ece9>] copy_from_user arch/x86/include/asm/uaccess.h:692 [inline]
> >> [<ffffffff83e4ece9>] sctp_getsockopt_assoc_stats+0x169/0xa10
> >> net/sctp/socket.c:6182
> >> [<ffffffff83e5cc52>] sctp_getsockopt+0x1af2/0x66a0 net/sctp/socket.c:6556
> >> [<ffffffff834f92c5>] sock_common_getsockopt+0x95/0xd0 net/core/sock.c:2649
> >> [<ffffffff834f4910>] SYSC_getsockopt net/socket.c:1788 [inline]
> >> [<ffffffff834f4910>] SyS_getsockopt+0x240/0x380 net/socket.c:1770
> >> [<ffffffff81009798>] do_syscall_64+0x2e8/0x930 arch/x86/entry/common.c:280
> >> [<ffffffff84370a49>] entry_SYSCALL64_slow_path+0x25/0x25
> >> Code: b0 fe ff ff e8 e1 25 ce ff 48 8b 85 b0 fe ff ff 4d 89 e9 4c 89
> >> e1 4c 89 f2 48 89 de 48 c7 c7 a0 01 50 84 49 89 c0 e8 51 d9 e0 ff <0f>
> >> 0b e8 b8 25 ce ff 4c 89 f2 4c 89 ee 4c 89 e7 e8 6a 1b fc ff
> >> RIP [<ffffffff81a1b041>] report_usercopy mm/usercopy.c:67 [inline]
> >> RIP [<ffffffff81a1b041>] __check_object_size+0x2d1/0x9ec mm/usercopy.c:278
> >> RSP <ffff8801a74f6cd0>
> >> ---[ end trace 5e438996b2c0b35d ]---
> >>
> >>
> >> I am not sure why check_object_size flags this an a bug,
> >> copy_from_user copies into a stack object:
> >>
> >> static int sctp_getsockopt_assoc_stats(struct sock *sk, int len,
> >> char __user *optval,
> >> int __user *optlen)
> >> {
> >> struct sctp_assoc_stats sas;
> >> len = min_t(size_t, len, sizeof(sas));
> >> if (copy_from_user(&sas, optval, len))
> >> return -EFAULT;
> >>
> >> Kees, can this be a false positive?
> >>
> >> On commit f4d3935e4f4884ba80561db5549394afb8eef8f7.
> >>
>
^ permalink raw reply
* Re: [PATCH ipsec-next v3 0/2] IPsec: do not ignore crypto err in ah input
From: Steffen Klassert @ 2017-01-16 13:27 UTC (permalink / raw)
To: Gilad Ben-Yossef
Cc: herbert, davem, netdev, ofir.drang, gilad.benyossef,
Alexander Alemayhu
In-Reply-To: <1484565476-19371-1-git-send-email-gilad@benyossef.com>
On Mon, Jan 16, 2017 at 01:17:54PM +0200, Gilad Ben-Yossef wrote:
> ah input processing uses the asynchronous hash crypto API which
> supplies an error code as part of the operation completion but
> the error code was being ignored.
>
> Treat a crypto API error indication as a verification failure.
>
> While a crypto API reported error would almost certainly result
> in a memcpy of the digest failing anyway and thus the security
> risk seems minor, performing a memory compare on what might be
> uninitialized memory is wrong.
>
> Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
> CC: Alexander Alemayhu <alexander@alemayhu.com>
Both applied to ipsec-next, thanks a lot!
^ permalink raw reply
* Re: [PATCH] netfilter: Fix typo in NF_CONNTRACK Kconfig option description
From: Pablo Neira Ayuso @ 2017-01-16 13:27 UTC (permalink / raw)
To: William Breathitt Gray
Cc: Patrick McHardy, Jozsef Kadlecsik, David S. Miller,
netfilter-devel, coreteam, netdev, linux-kernel
In-Reply-To: <20170109222417.GA18253@sophia>
On Mon, Jan 09, 2017 at 05:24:18PM -0500, William Breathitt Gray wrote:
> The NF_CONNTRACK Kconfig option description makes an incorrect reference
> to the "meta" expression where the "ct" expression would be correct.This
> patch fixes the respective typographical error.
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] xfrm: state: fix potential null pointer dereference on afinfo
From: Steffen Klassert @ 2017-01-16 13:27 UTC (permalink / raw)
To: Colin King; +Cc: Herbert Xu, David S . Miller, netdev, linux-kernel
In-Reply-To: <20170113140703.20961-1-colin.king@canonical.com>
On Fri, Jan 13, 2017 at 02:07:03PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> afinfo is being null checked before a call afinfo->init_tempsel
> so afinfo may be potentially null. ifinfo may still be null in
> the case were it is not updated when family == tmpl->encap_family,
> hence we may hit a null pointer dereference in the call to
> afinfo->init_temprop.
>
> Fix this by adding a null ptr check before calling init_temprop.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
I've applied already a fix for this from Florian Westphal.
Thanks a lot anyway!
^ permalink raw reply
* [PATCH] stmicro: rename it to dwc to improve future development
From: Joao Pinto @ 2017-01-16 13:26 UTC (permalink / raw)
To: davem; +Cc: peppe.cavallaro, alexandre.torgue, netdev, Joao Pinto
The goal of this patch is to create an oficial Designware Ethernet place
to deploy new drivers based on this family of IPs. stmmac was left
untouched since it is a designware based driver. New ethernet designware
IP based drivers should be placed in this place, improving code organization
and it becomes clear to the kernel user the purpose and scope of each driver.
Signed-off-by: Joao Pinto <jpinto@synopsys.com>
---
drivers/net/ethernet/Kconfig | 2 +-
drivers/net/ethernet/Makefile | 2 +-
drivers/net/ethernet/{stmicro => dwc}/Kconfig | 7 ++++---
drivers/net/ethernet/dwc/Makefile | 5 +++++
drivers/net/ethernet/{stmicro => dwc}/stmmac/Kconfig | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/Makefile | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/altr_tse_pcs.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/altr_tse_pcs.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/chain_mode.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/common.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/descs.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/descs_com.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-dwc-qos-eth.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-generic.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-ipq806x.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-lpc18xx.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-meson.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-meson8b.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-oxnas.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-rk.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-socfpga.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-sti.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-stm32.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-sunxi.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac100.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac1000.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac1000_core.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac1000_dma.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac100_core.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac100_dma.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_core.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_descs.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_descs.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_dma.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_dma.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_lib.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac_dma.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac_lib.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/enh_desc.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/mmc.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/mmc_core.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/norm_desc.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/ring_mode.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_ethtool.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_hwtstamp.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_main.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_mdio.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_pci.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_pcs.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_platform.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_platform.h | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_ptp.c | 0
drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_ptp.h | 0
drivers/net/ethernet/stmicro/Makefile | 5 -----
56 files changed, 11 insertions(+), 10 deletions(-)
rename drivers/net/ethernet/{stmicro => dwc}/Kconfig (68%)
create mode 100644 drivers/net/ethernet/dwc/Makefile
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/Kconfig (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/Makefile (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/altr_tse_pcs.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/altr_tse_pcs.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/chain_mode.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/common.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/descs.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/descs_com.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-dwc-qos-eth.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-generic.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-ipq806x.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-lpc18xx.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-meson.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-meson8b.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-oxnas.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-rk.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-socfpga.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-sti.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-stm32.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac-sunxi.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac100.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac1000.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac1000_core.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac1000_dma.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac100_core.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac100_dma.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_core.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_descs.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_descs.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_dma.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_dma.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac4_lib.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac_dma.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/dwmac_lib.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/enh_desc.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/mmc.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/mmc_core.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/norm_desc.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/ring_mode.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_ethtool.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_hwtstamp.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_main.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_mdio.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_pci.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_pcs.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_platform.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_platform.h (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_ptp.c (100%)
rename drivers/net/ethernet/{stmicro => dwc}/stmmac/stmmac_ptp.h (100%)
delete mode 100644 drivers/net/ethernet/stmicro/Makefile
diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig
index afc07d4..33fa603 100644
--- a/drivers/net/ethernet/Kconfig
+++ b/drivers/net/ethernet/Kconfig
@@ -168,7 +168,7 @@ source "drivers/net/ethernet/sis/Kconfig"
source "drivers/net/ethernet/sfc/Kconfig"
source "drivers/net/ethernet/sgi/Kconfig"
source "drivers/net/ethernet/smsc/Kconfig"
-source "drivers/net/ethernet/stmicro/Kconfig"
+source "drivers/net/ethernet/dwc/Kconfig"
source "drivers/net/ethernet/sun/Kconfig"
source "drivers/net/ethernet/tehuti/Kconfig"
source "drivers/net/ethernet/ti/Kconfig"
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index e7861a8..fc81d9a 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -79,7 +79,7 @@ obj-$(CONFIG_SFC) += sfc/
obj-$(CONFIG_SFC_FALCON) += sfc/falcon/
obj-$(CONFIG_NET_VENDOR_SGI) += sgi/
obj-$(CONFIG_NET_VENDOR_SMSC) += smsc/
-obj-$(CONFIG_NET_VENDOR_STMICRO) += stmicro/
+obj-$(CONFIG_NET_VENDOR_STMICRO) += dwc/
obj-$(CONFIG_NET_VENDOR_SUN) += sun/
obj-$(CONFIG_NET_VENDOR_TEHUTI) += tehuti/
obj-$(CONFIG_NET_VENDOR_TI) += ti/
diff --git a/drivers/net/ethernet/stmicro/Kconfig b/drivers/net/ethernet/dwc/Kconfig
similarity index 68%
rename from drivers/net/ethernet/stmicro/Kconfig
rename to drivers/net/ethernet/dwc/Kconfig
index 1c1157d..fe3e630 100644
--- a/drivers/net/ethernet/stmicro/Kconfig
+++ b/drivers/net/ethernet/dwc/Kconfig
@@ -1,5 +1,5 @@
#
-# STMicroelectronics device configuration
+# Designware based device drivers configuration
#
config NET_VENDOR_STMICRO
@@ -7,7 +7,8 @@ config NET_VENDOR_STMICRO
default y
depends on HAS_IOMEM
---help---
- If you have a network (Ethernet) card belonging to this class, say Y.
+ If you have a network (Ethernet) card based on Designware
+ Ethernet 10/100/1G/QoS IPs, say Y.
Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
@@ -16,6 +17,6 @@ config NET_VENDOR_STMICRO
if NET_VENDOR_STMICRO
-source "drivers/net/ethernet/stmicro/stmmac/Kconfig"
+source "drivers/net/ethernet/dwc/stmmac/Kconfig"
endif # NET_VENDOR_STMICRO
diff --git a/drivers/net/ethernet/dwc/Makefile b/drivers/net/ethernet/dwc/Makefile
new file mode 100644
index 0000000..788b1ba
--- /dev/null
+++ b/drivers/net/ethernet/dwc/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for the Designware based device drivers.
+#
+
+obj-$(CONFIG_STMMAC_ETH) += stmmac/
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/dwc/stmmac/Kconfig
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/Kconfig
rename to drivers/net/ethernet/dwc/stmmac/Kconfig
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/dwc/stmmac/Makefile
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/Makefile
rename to drivers/net/ethernet/dwc/stmmac/Makefile
diff --git a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c b/drivers/net/ethernet/dwc/stmmac/altr_tse_pcs.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c
rename to drivers/net/ethernet/dwc/stmmac/altr_tse_pcs.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h b/drivers/net/ethernet/dwc/stmmac/altr_tse_pcs.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h
rename to drivers/net/ethernet/dwc/stmmac/altr_tse_pcs.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/dwc/stmmac/chain_mode.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/chain_mode.c
rename to drivers/net/ethernet/dwc/stmmac/chain_mode.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/dwc/stmmac/common.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/common.h
rename to drivers/net/ethernet/dwc/stmmac/common.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs.h b/drivers/net/ethernet/dwc/stmmac/descs.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/descs.h
rename to drivers/net/ethernet/dwc/stmmac/descs.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs_com.h b/drivers/net/ethernet/dwc/stmmac/descs_com.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/descs_com.h
rename to drivers/net/ethernet/dwc/stmmac/descs_com.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/dwc/stmmac/dwmac-dwc-qos-eth.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-dwc-qos-eth.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/dwc/stmmac/dwmac-generic.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-generic.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/dwc/stmmac/dwmac-ipq806x.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-ipq806x.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/dwc/stmmac/dwmac-lpc18xx.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-lpc18xx.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/dwc/stmmac/dwmac-meson.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-meson.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/dwc/stmmac/dwmac-meson8b.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-meson8b.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c b/drivers/net/ethernet/dwc/stmmac/dwmac-oxnas.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-oxnas.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/dwc/stmmac/dwmac-rk.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-rk.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/dwc/stmmac/dwmac-socfpga.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-socfpga.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/dwc/stmmac/dwmac-sti.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-sti.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/dwc/stmmac/dwmac-stm32.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-stm32.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/dwc/stmmac/dwmac-sunxi.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac-sunxi.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h b/drivers/net/ethernet/dwc/stmmac/dwmac100.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac100.h
rename to drivers/net/ethernet/dwc/stmmac/dwmac100.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/dwc/stmmac/dwmac1000.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac1000.h
rename to drivers/net/ethernet/dwc/stmmac/dwmac1000.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/dwc/stmmac/dwmac1000_core.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac1000_core.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/dwc/stmmac/dwmac1000_dma.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac1000_dma.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c b/drivers/net/ethernet/dwc/stmmac/dwmac100_core.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac100_core.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c b/drivers/net/ethernet/dwc/stmmac/dwmac100_dma.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac100_dma.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h b/drivers/net/ethernet/dwc/stmmac/dwmac4.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac4.h
rename to drivers/net/ethernet/dwc/stmmac/dwmac4.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/dwc/stmmac/dwmac4_core.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac4_core.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/dwc/stmmac/dwmac4_descs.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac4_descs.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h b/drivers/net/ethernet/dwc/stmmac/dwmac4_descs.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
rename to drivers/net/ethernet/dwc/stmmac/dwmac4_descs.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/dwc/stmmac/dwmac4_dma.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac4_dma.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h b/drivers/net/ethernet/dwc/stmmac/dwmac4_dma.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h
rename to drivers/net/ethernet/dwc/stmmac/dwmac4_dma.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c b/drivers/net/ethernet/dwc/stmmac/dwmac4_lib.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac4_lib.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h b/drivers/net/ethernet/dwc/stmmac/dwmac_dma.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
rename to drivers/net/ethernet/dwc/stmmac/dwmac_dma.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/dwc/stmmac/dwmac_lib.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
rename to drivers/net/ethernet/dwc/stmmac/dwmac_lib.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/dwc/stmmac/enh_desc.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/enh_desc.c
rename to drivers/net/ethernet/dwc/stmmac/enh_desc.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc.h b/drivers/net/ethernet/dwc/stmmac/mmc.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/mmc.h
rename to drivers/net/ethernet/dwc/stmmac/mmc.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/dwc/stmmac/mmc_core.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/mmc_core.c
rename to drivers/net/ethernet/dwc/stmmac/mmc_core.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/dwc/stmmac/norm_desc.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/norm_desc.c
rename to drivers/net/ethernet/dwc/stmmac/norm_desc.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/dwc/stmmac/ring_mode.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/ring_mode.c
rename to drivers/net/ethernet/dwc/stmmac/ring_mode.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/dwc/stmmac/stmmac.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac.h
rename to drivers/net/ethernet/dwc/stmmac/stmmac.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/dwc/stmmac/stmmac_ethtool.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
rename to drivers/net/ethernet/dwc/stmmac/stmmac_ethtool.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/dwc/stmmac/stmmac_hwtstamp.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
rename to drivers/net/ethernet/dwc/stmmac/stmmac_hwtstamp.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/dwc/stmmac/stmmac_main.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
rename to drivers/net/ethernet/dwc/stmmac/stmmac_main.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/dwc/stmmac/stmmac_mdio.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
rename to drivers/net/ethernet/dwc/stmmac/stmmac_mdio.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/dwc/stmmac/stmmac_pci.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
rename to drivers/net/ethernet/dwc/stmmac/stmmac_pci.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h b/drivers/net/ethernet/dwc/stmmac/stmmac_pcs.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h
rename to drivers/net/ethernet/dwc/stmmac/stmmac_pcs.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/dwc/stmmac/stmmac_platform.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
rename to drivers/net/ethernet/dwc/stmmac/stmmac_platform.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/dwc/stmmac/stmmac_platform.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
rename to drivers/net/ethernet/dwc/stmmac/stmmac_platform.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/dwc/stmmac/stmmac_ptp.c
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
rename to drivers/net/ethernet/dwc/stmmac/stmmac_ptp.c
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net/ethernet/dwc/stmmac/stmmac_ptp.h
similarity index 100%
rename from drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
rename to drivers/net/ethernet/dwc/stmmac/stmmac_ptp.h
diff --git a/drivers/net/ethernet/stmicro/Makefile b/drivers/net/ethernet/stmicro/Makefile
deleted file mode 100644
index 9b3bfdd..0000000
--- a/drivers/net/ethernet/stmicro/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Makefile for the STMicroelectronics device drivers.
-#
-
-obj-$(CONFIG_STMMAC_ETH) += stmmac/
--
2.9.3
^ permalink raw reply related
* Re: [PATCH ipsec-next] xfrm: fix possible null deref in xfrm_init_tempstate
From: Steffen Klassert @ 2017-01-16 13:24 UTC (permalink / raw)
To: Florian Westphal; +Cc: netdev, dan.carpenter
In-Reply-To: <1484315714-4840-1-git-send-email-fw@strlen.de>
On Fri, Jan 13, 2017 at 02:55:14PM +0100, Florian Westphal wrote:
> Dan reports following smatch warning:
> net/xfrm/xfrm_state.c:659
> error: we previously assumed 'afinfo' could be null (see line 651)
>
> 649 struct xfrm_state_afinfo *afinfo = xfrm_state_afinfo_get_rcu(family);
> 651 if (afinfo)
> ...
> 658 }
> 659 afinfo->init_temprop(x, tmpl, daddr, saddr);
>
> I am resonably sure afinfo cannot be NULL here.
>
> xfrm_state4.c and state6.c are both part of ipv4/ipv6 (depends on
> CONFIG_XFRM, a boolean) but even if ipv6 is a module state6.c can't
> be removed (ipv6 lacks module_exit so it cannot be removed).
>
> The only callers for xfrm6_fini that leads to state backend unregister
> are error unwinding paths that can be called during ipv6 init function.
>
> So after ipv6 module is loaded successfully the state backend cannot go
> away anymore.
>
> The family value from policy lookup path is taken from dst_entry, so
> that should always be AF_INET(6).
>
> However, since this silences the warning and avoids readers of this
> code wondering about possible null deref it seems preferrable to
> be defensive and just add the old check back.
>
> Fixes: 711059b9752ad0 ("xfrm: add and use xfrm_state_afinfo_get_rcu")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied to ipsec-next, thanks!
^ permalink raw reply
* Re: [PATCH net-next] sctp: remove useless code from sctp_apply_peer_addr_params
From: Neil Horman @ 2017-01-16 13:23 UTC (permalink / raw)
To: Marcelo Ricardo Leitner; +Cc: netdev, linux-sctp, Vlad Yasevich
In-Reply-To: <99bc9f227c4c857d2bb258391231231d46c1899d.1484336556.git.marcelo.leitner@gmail.com>
On Fri, Jan 13, 2017 at 06:31:15PM -0200, Marcelo Ricardo Leitner wrote:
> sctp_frag_point() doesn't store anything, and thus just calling it
> cannot do anything useful.
>
> sctp_apply_peer_addr_params is only called by
> sctp_setsockopt_peer_addr_params. When operating on an asoc,
> sctp_setsockopt_peer_addr_params will call sctp_apply_peer_addr_params
> once for the asoc, and then once for each transport this asoc has,
> meaning that the frag_point will be recomputed when updating the
> transports and calling it when updating the asoc is not necessary.
> IOW, no action is needed here and we can remove this call.
>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
> net/sctp/socket.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> index 318c6786d6539a301ac7b76d82a49a1af3818d10..635e0341269330187c78ba93a35689f5c5d6be02 100644
> --- a/net/sctp/socket.c
> +++ b/net/sctp/socket.c
> @@ -2430,7 +2430,6 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,
> sctp_assoc_sync_pmtu(sctp_opt2sk(sp), asoc);
> } else if (asoc) {
> asoc->pathmtu = params->spp_pathmtu;
> - sctp_frag_point(asoc, params->spp_pathmtu);
> } else {
> sp->pathmtu = params->spp_pathmtu;
> }
> --
> 2.9.3
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* [PATCH] cpmac: remove hopeless #warning
From: Arnd Bergmann @ 2017-01-16 13:20 UTC (permalink / raw)
To: Florian Fainelli
Cc: Arnd Bergmann, David S. Miller, Philippe Reynes, netdev,
linux-kernel
The #warning was present 10 years ago when the driver first got merged.
As the platform is rather obsolete by now, it seems very unlikely that
the warning will cause anyone to fix the code properly.
kernelci.org reports the warning for every build in the meantime, so
I think it's better to just turn it into a code comment to reduce
noise.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/ti/cpmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 77c88fcf2b86..9b8a30bf939b 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1210,7 +1210,7 @@ int cpmac_init(void)
goto fail_alloc;
}
-#warning FIXME: unhardcode gpio&reset bits
+ /* FIXME: unhardcode gpio&reset bits */
ar7_gpio_disable(26);
ar7_gpio_disable(27);
ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
--
2.9.0
^ permalink raw reply related
* Re: [PATCH net-next] sctp: remove unused var from sctp_process_asconf
From: Neil Horman @ 2017-01-16 13:13 UTC (permalink / raw)
To: Marcelo Ricardo Leitner; +Cc: netdev, linux-sctp, Vlad Yasevich
In-Reply-To: <5da2cda90a7489b22ae98703d7543c5316bae375.1484336552.git.marcelo.leitner@gmail.com>
On Fri, Jan 13, 2017 at 06:27:33PM -0200, Marcelo Ricardo Leitner wrote:
> Assigned but not used.
>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
> net/sctp/sm_make_chunk.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index a15d824a313d310ed03ba77055d22b1c7c9d0662..80a9088084ac0d1116bf983fad9a0cdfddeefe44 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -3210,7 +3210,6 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
> union sctp_params param;
> sctp_addiphdr_t *hdr;
> union sctp_addr_param *addr_param;
> - sctp_addip_param_t *asconf_param;
> struct sctp_chunk *asconf_ack;
> __be16 err_code;
> int length = 0;
> @@ -3230,7 +3229,6 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
> * asconf parameter.
> */
> length = ntohs(addr_param->p.length);
> - asconf_param = (void *)addr_param + length;
> chunk_len -= length;
>
> /* create an ASCONF_ACK chunk.
> --
> 2.9.3
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply
* Re: [PATCH net v3] ravb: do not use zero-length alignment DMA descriptor
From: Sergei Shtylyov @ 2017-01-16 13:01 UTC (permalink / raw)
To: Simon Horman, David Miller
Cc: Magnus Damm, netdev, linux-renesas-soc, Masaru Nagai
In-Reply-To: <1484563521-12009-1-git-send-email-horms+renesas@verge.net.au>
On 01/16/2017 01:45 PM, Simon Horman wrote:
> From: Masaru Nagai <masaru.nagai.vx@renesas.com>
>
> Due to alignment requirements of the hardware transmissions are split into
> two DMA descriptors, a small padding descriptor of 0 - 3 bytes in length
> followed by a descriptor for rest of the packet.
>
> In the case of IP packets the first descriptor will never be zero due to
> the way that the stack aligns buffers for IP packets. However, for non-IP
> packets it may be zero.
>
> In that case it has been reported that timeouts occur, presumably because
> transmission stops at the first zero-length DMA descriptor and thus the
> packet is not transmitted. However, in my environment a BUG is triggered as
> follows:
[...]
> Fixes: 2f45d1902acf ("ravb: minimize TX data copying")
> Signed-off-by: Masaru Nagai <masaru.nagai.vx@renesas.com
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
MBR, Sergei
^ permalink raw reply
* Re: [PATCH] net: add regs attribute to phy device for user diagnose
From: yuan linyu @ 2017-01-16 12:59 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Florian Fainelli, David S . Miller, netdev, yuan linyu
In-Reply-To: <20170115172150.GC5643@lunn.ch>
On 日, 2017-01-15 at 18:21 +0100, Andrew Lunn wrote:
> On Sun, Jan 15, 2017 at 09:51:03AM +0800, yuan linyu wrote:
> >
> > I hope user/developer can read this attribute file "regs" to do
> > a full check of all registers value, and they can write any register
> > inside PHY through this file.
> Since this is intended for debug, it should not be sysfs, but debugfs.
agree,
> However, in general, Linux does not allow user space to peek and poke
> device registers. Can you point me at examples where i can do the same
> to my GPU? SATA controller? Ethernet controller, I2C temperature
> sensor? Any device?
we can read registers of ethernet controller(memory register accessed) through devmem or ethtool
>
> Andrew
>
^ permalink raw reply
* [PATCH ipsec-next v3 2/2] IPsec: do not ignore crypto err in ah6 input
From: Gilad Ben-Yossef @ 2017-01-16 11:17 UTC (permalink / raw)
To: steffen.klassert, herbert, davem, netdev; +Cc: ofir.drang, gilad.benyossef
In-Reply-To: <1484565476-19371-1-git-send-email-gilad@benyossef.com>
ah6 input processing uses the asynchronous hash crypto API which
supplies an error code as part of the operation completion but
the error code was being ignored.
Treat a crypto API error indication as a verification failure.
While a crypto API reported error would almost certainly result
in a memcpy of the digest failing anyway and thus the security
risk seems minor, performing a memory compare on what might be
uninitialized memory is wrong.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
net/ipv6/ah6.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 189eb10..dda6035 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -474,6 +474,9 @@ static void ah6_input_done(struct crypto_async_request *base, int err)
int hdr_len = skb_network_header_len(skb);
int ah_hlen = (ah->hdrlen + 2) << 2;
+ if (err)
+ goto out;
+
work_iph = AH_SKB_CB(skb)->tmp;
auth_data = ah_tmp_auth(work_iph, hdr_len);
icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
--
2.1.4
^ permalink raw reply related
* [PATCH ipsec-next v3 1/2] IPsec: do not ignore crypto err in ah4 input
From: Gilad Ben-Yossef @ 2017-01-16 11:17 UTC (permalink / raw)
To: steffen.klassert, herbert, davem, netdev; +Cc: ofir.drang, gilad.benyossef
In-Reply-To: <1484565476-19371-1-git-send-email-gilad@benyossef.com>
ah4 input processing uses the asynchronous hash crypto API which
supplies an error code as part of the operation completion but
the error code was being ignored.
Treat a crypto API error indication as a verification failure.
While a crypto API reported error would almost certainly result
in a memcpy of the digest failing anyway and thus the security
risk seems minor, performing a memory compare on what might be
uninitialized memory is wrong.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
net/ipv4/ah4.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index f2a7102..22377c8 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -270,6 +270,9 @@ static void ah_input_done(struct crypto_async_request *base, int err)
int ihl = ip_hdrlen(skb);
int ah_hlen = (ah->hdrlen + 2) << 2;
+ if (err)
+ goto out;
+
work_iph = AH_SKB_CB(skb)->tmp;
auth_data = ah_tmp_auth(work_iph, ihl);
icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
--
2.1.4
^ permalink raw reply related
* [PATCH ipsec-next v3 0/2] IPsec: do not ignore crypto err in ah input
From: Gilad Ben-Yossef @ 2017-01-16 11:17 UTC (permalink / raw)
To: steffen.klassert, herbert, davem, netdev
Cc: ofir.drang, gilad.benyossef, Alexander Alemayhu
ah input processing uses the asynchronous hash crypto API which
supplies an error code as part of the operation completion but
the error code was being ignored.
Treat a crypto API error indication as a verification failure.
While a crypto API reported error would almost certainly result
in a memcpy of the digest failing anyway and thus the security
risk seems minor, performing a memory compare on what might be
uninitialized memory is wrong.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
CC: Alexander Alemayhu <alexander@alemayhu.com>
---
The change was boot tested on Arm64 but I did not exercise
the specific error code path in question.
Changes from v2:
- Added fix for same problem in IPv6 pointed out by Steffen Klassert
Changes from v1:
- Fixed typo in patch description pointed out by Alexander
Gilad Ben-Yossef (2):
IPsec: do not ignore crypto err in ah4 input
IPsec: do not ignore crypto err in ah6 input
net/ipv4/ah4.c | 3 +++
net/ipv6/ah6.c | 3 +++
2 files changed, 6 insertions(+)
--
2.1.4
^ permalink raw reply
* [PATCH net v3] ravb: do not use zero-length alignment DMA descriptor
From: Simon Horman @ 2017-01-16 10:45 UTC (permalink / raw)
To: David Miller, Sergei Shtylyov
Cc: Magnus Damm, netdev, linux-renesas-soc, Masaru Nagai,
Simon Horman
From: Masaru Nagai <masaru.nagai.vx@renesas.com>
Due to alignment requirements of the hardware transmissions are split into
two DMA descriptors, a small padding descriptor of 0 - 3 bytes in length
followed by a descriptor for rest of the packet.
In the case of IP packets the first descriptor will never be zero due to
the way that the stack aligns buffers for IP packets. However, for non-IP
packets it may be zero.
In that case it has been reported that timeouts occur, presumably because
transmission stops at the first zero-length DMA descriptor and thus the
packet is not transmitted. However, in my environment a BUG is triggered as
follows:
[ 20.381417] ------------[ cut here ]------------
[ 20.386054] kernel BUG at lib/swiotlb.c:495!
[ 20.390324] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[ 20.395805] Modules linked in:
[ 20.398862] CPU: 0 PID: 2089 Comm: mz Not tainted 4.10.0-rc3-00001-gf13ad2db193f #162
[ 20.406689] Hardware name: Renesas Salvator-X board based on r8a7796 (DT)
[ 20.413474] task: ffff80063b1f1900 task.stack: ffff80063a71c000
[ 20.419404] PC is at swiotlb_tbl_map_single+0x178/0x2ec
[ 20.424625] LR is at map_single+0x4c/0x98
[ 20.428629] pc : [<ffff00000839c4c0>] lr : [<ffff00000839c680>] pstate: 800001c5
[ 20.436019] sp : ffff80063a71f9b0
[ 20.439327] x29: ffff80063a71f9b0 x28: ffff80063a20d500
[ 20.444636] x27: ffff000008ed5000 x26: 0000000000000000
[ 20.449944] x25: 000000067abe2adc x24: 0000000000000000
[ 20.455252] x23: 0000000000200000 x22: 0000000000000001
[ 20.460559] x21: 0000000000175ffe x20: ffff80063b2a0010
[ 20.465866] x19: 0000000000000000 x18: 0000ffffcae6fb20
[ 20.471173] x17: 0000ffffa09ba018 x16: ffff0000087c8b70
[ 20.476480] x15: 0000ffffa084f588 x14: 0000ffffa09cfa14
[ 20.481787] x13: 0000ffffcae87ff0 x12: 000000000063abe2
[ 20.487098] x11: ffff000008096360 x10: ffff80063abe2adc
[ 20.492407] x9 : 0000000000000000 x8 : 0000000000000000
[ 20.497718] x7 : 0000000000000000 x6 : ffff000008ed50d0
[ 20.503028] x5 : 0000000000000000 x4 : 0000000000000001
[ 20.508338] x3 : 0000000000000000 x2 : 000000067abe2adc
[ 20.513648] x1 : 00000000bafff000 x0 : 0000000000000000
[ 20.518958]
[ 20.520446] Process mz (pid: 2089, stack limit = 0xffff80063a71c000)
[ 20.526798] Stack: (0xffff80063a71f9b0 to 0xffff80063a720000)
[ 20.532543] f9a0: ffff80063a71fa30 ffff00000839c680
[ 20.540374] f9c0: ffff80063b2a0010 ffff80063b2a0010 0000000000000001 0000000000000000
[ 20.548204] f9e0: 000000000000006e ffff80063b23c000 ffff80063b23c000 0000000000000000
[ 20.556034] fa00: ffff80063b23c000 ffff80063a20d500 000000013b1f1900 0000000000000000
[ 20.563864] fa20: ffff80063ffd18e0 ffff80063b2a0010 ffff80063a71fa60 ffff00000839cd10
[ 20.571694] fa40: ffff80063b2a0010 0000000000000000 ffff80063ffd18e0 000000067abe2adc
[ 20.579524] fa60: ffff80063a71fa90 ffff000008096380 ffff80063b2a0010 0000000000000000
[ 20.587353] fa80: 0000000000000000 0000000000000001 ffff80063a71fac0 ffff00000864f770
[ 20.595184] faa0: ffff80063b23caf0 0000000000000000 0000000000000000 0000000000000140
[ 20.603014] fac0: ffff80063a71fb60 ffff0000087e6498 ffff80063a20d500 ffff80063b23c000
[ 20.610843] fae0: 0000000000000000 ffff000008daeaf0 0000000000000000 ffff000008daeb00
[ 20.618673] fb00: ffff80063a71fc0c ffff000008da7000 ffff80063b23c090 ffff80063a44f000
[ 20.626503] fb20: 0000000000000000 ffff000008daeb00 ffff80063a71fc0c ffff000008da7000
[ 20.634333] fb40: ffff80063b23c090 0000000000000000 ffff800600000037 ffff0000087e63d8
[ 20.642163] fb60: ffff80063a71fbc0 ffff000008807510 ffff80063a692400 ffff80063a20d500
[ 20.649993] fb80: ffff80063a44f000 ffff80063b23c000 ffff80063a69249c 0000000000000000
[ 20.657823] fba0: 0000000000000000 ffff80063a087800 ffff80063b23c000 ffff80063a20d500
[ 20.665653] fbc0: ffff80063a71fc10 ffff0000087e67dc ffff80063a20d500 ffff80063a692400
[ 20.673483] fbe0: ffff80063b23c000 0000000000000000 ffff80063a44f000 ffff80063a69249c
[ 20.681312] fc00: ffff80063a5f1a10 000000103a087800 ffff80063a71fc70 ffff0000087e6b24
[ 20.689142] fc20: ffff80063a5f1a80 ffff80063a71fde8 000000000000000f 00000000000005ea
[ 20.696972] fc40: ffff80063a5f1a10 0000000000000000 000000000000000f ffff00000887fbd0
[ 20.704802] fc60: fffffff43a5f1a80 0000000000000000 ffff80063a71fc80 ffff000008880240
[ 20.712632] fc80: ffff80063a71fd90 ffff0000087c7a34 ffff80063afc7180 0000000000000000
[ 20.720462] fca0: 0000ffffcae6fe18 0000000000000014 0000000060000000 0000000000000015
[ 20.728292] fcc0: 0000000000000123 00000000000000ce ffff0000088d2000 ffff80063b1f1900
[ 20.736122] fce0: 0000000000008933 ffff000008e7cb80 ffff80063a71fd80 ffff0000087c50a4
[ 20.743951] fd00: 0000000000008933 ffff000008e7cb80 ffff000008e7cb80 000000100000000e
[ 20.751781] fd20: ffff80063a71fe4c 0000ffff00000300 0000000000000123 0000000000000000
[ 20.759611] fd40: 0000000000000000 ffff80063b1f0000 000000000000000e 0000000000000300
[ 20.767441] fd60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 20.775271] fd80: 0000000000000000 0000000000000000 ffff80063a71fda0 ffff0000087c8c20
[ 20.783100] fda0: 0000000000000000 ffff000008082f30 0000000000000000 0000800637260000
[ 20.790930] fdc0: ffffffffffffffff 0000ffffa0903078 0000000000000000 000000001ea87232
[ 20.798760] fde0: 000000000000000f ffff80063a71fe40 ffff800600000014 ffff000000000001
[ 20.806590] fe00: 0000000000000000 0000000000000000 ffff80063a71fde8 0000000000000000
[ 20.814420] fe20: 0000000000000000 0000000000000000 0000000000000000 0000000000000001
[ 20.822249] fe40: 0000000203000011 0000000000000000 0000000000000000 ffff80063a68aa00
[ 20.830079] fe60: ffff80063a68aa00 0000000000000003 0000000000008933 ffff0000081f1b9c
[ 20.837909] fe80: 0000000000000000 ffff000008082f30 0000000000000000 0000800637260000
[ 20.845739] fea0: ffffffffffffffff 0000ffffa07ca81c 0000000060000000 0000000000000015
[ 20.853569] fec0: 0000000000000003 000000001ea87232 000000000000000f 0000000000000000
[ 20.861399] fee0: 0000ffffcae6fe18 0000000000000014 0000000000000300 0000000000000000
[ 20.869228] ff00: 00000000000000ce 0000000000000000 00000000ffffffff 0000000000000000
[ 20.877059] ff20: 0000000000000002 0000ffffcae87ff0 0000ffffa09cfa14 0000ffffa084f588
[ 20.884888] ff40: 0000000000000000 0000ffffa09ba018 0000ffffcae6fb20 000000001ea87010
[ 20.892718] ff60: 0000ffffa09b9000 0000ffffcae6fe30 0000ffffcae6fe18 000000000000000f
[ 20.900548] ff80: 0000000000000003 000000001ea87232 0000000000000000 0000000000000000
[ 20.908378] ffa0: 0000000000000000 0000ffffcae6fdc0 0000ffffa09a7824 0000ffffcae6fdc0
[ 20.916208] ffc0: 0000ffffa0903078 0000000060000000 0000000000000003 00000000000000ce
[ 20.924038] ffe0: 0000000000000000 0000000000000000 ffffffffffffffff ffffffffffffffff
[ 20.931867] Call trace:
[ 20.934312] Exception stack(0xffff80063a71f7e0 to 0xffff80063a71f910)
[ 20.940750] f7e0: 0000000000000000 0001000000000000 ffff80063a71f9b0 ffff00000839c4c0
[ 20.948580] f800: ffff80063a71f840 ffff00000888a6e4 ffff80063a24c418 ffff80063a24c448
[ 20.956410] f820: 0000000000000000 ffff00000811cd54 ffff80063a71f860 ffff80063a24c458
[ 20.964240] f840: ffff80063a71f870 ffff00000888b258 ffff80063a24c418 0000000000000001
[ 20.972070] f860: ffff80063a71f910 ffff80063a7b7028 ffff80063a71f890 ffff0000088825e4
[ 20.979899] f880: 0000000000000000 00000000bafff000 000000067abe2adc 0000000000000000
[ 20.987729] f8a0: 0000000000000001 0000000000000000 ffff000008ed50d0 0000000000000000
[ 20.995560] f8c0: 0000000000000000 0000000000000000 ffff80063abe2adc ffff000008096360
[ 21.003390] f8e0: 000000000063abe2 0000ffffcae87ff0 0000ffffa09cfa14 0000ffffa084f588
[ 21.011219] f900: ffff0000087c8b70 0000ffffa09ba018
[ 21.016097] [<ffff00000839c4c0>] swiotlb_tbl_map_single+0x178/0x2ec
[ 21.022362] [<ffff00000839c680>] map_single+0x4c/0x98
[ 21.027411] [<ffff00000839cd10>] swiotlb_map_page+0xa4/0x138
[ 21.033072] [<ffff000008096380>] __swiotlb_map_page+0x20/0x7c
[ 21.038821] [<ffff00000864f770>] ravb_start_xmit+0x174/0x668
[ 21.044484] [<ffff0000087e6498>] dev_hard_start_xmit+0x8c/0x120
[ 21.050407] [<ffff000008807510>] sch_direct_xmit+0x108/0x1a0
[ 21.056064] [<ffff0000087e67dc>] __dev_queue_xmit+0x194/0x4cc
[ 21.061807] [<ffff0000087e6b24>] dev_queue_xmit+0x10/0x18
[ 21.067214] [<ffff000008880240>] packet_sendmsg+0xf40/0x1220
[ 21.072873] [<ffff0000087c7a34>] sock_sendmsg+0x18/0x2c
[ 21.078097] [<ffff0000087c8c20>] SyS_sendto+0xb0/0xf0
[ 21.083150] [<ffff000008082f30>] el0_svc_naked+0x24/0x28
[ 21.088462] Code: d34bfef7 2a1803f3 1a9f86d6 35fff878 (d4210000)
[ 21.094611] ---[ end trace 5bc544ad491f3814 ]---
[ 21.099234] Kernel panic - not syncing: Fatal exception in interrupt
[ 21.105587] Kernel Offset: disabled
[ 21.109073] Memory Limit: none
[ 21.112126] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
Fixes: 2f45d1902acf ("ravb: minimize TX data copying")
Signed-off-by: Masaru Nagai <masaru.nagai.vx@renesas.com
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v3 [Simon Horman]
* changelog and comment enhancements
v2 [Simon Horman]
* don't handle skb->len < 4; it is always at least 60
* add comment
* dropped RFC designation
v1 [Simon Horman]
* rewrote changelog
* handle skb->len < 4
v0 [Masaru Nagai]
---
drivers/net/ethernet/renesas/ravb_main.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 5e5ad978eab9..89ac1e3f6175 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1504,6 +1504,19 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev)
buffer = PTR_ALIGN(priv->tx_align[q], DPTR_ALIGN) +
entry / NUM_TX_DESC * DPTR_ALIGN;
len = PTR_ALIGN(skb->data, DPTR_ALIGN) - skb->data;
+ /* Zero length DMA descriptors are problematic as they seem to
+ * terminate DMA transfers. Avoid them by simply using a length of
+ * DPTR_ALIGN (4) when skb data is aligned to DPTR_ALIGN.
+ *
+ * As skb is guaranteed to have at least ETH_ZLEN (60) bytes of
+ * data by the call to skb_put_padto() above this is safe with
+ * respect to both the length of the first DMA descriptor (len)
+ * overflowing the available data and the length of the second DMA
+ * descriptor (skb->len - len) being negative.
+ */
+ if (len == 0)
+ len = DPTR_ALIGN;
+
memcpy(buffer, skb->data, len);
dma_addr = dma_map_single(ndev->dev.parent, buffer, len, DMA_TO_DEVICE);
if (dma_mapping_error(ndev->dev.parent, dma_addr))
--
2.7.0.rc3.207.g0ac5344
^ permalink raw reply related
* Re: [PATCH net-next 2/2] mpls: Packet stats
From: Robert Shearman @ 2017-01-16 10:30 UTC (permalink / raw)
To: kbuild test robot; +Cc: kbuild-all, davem, netdev, roopa, David Ahern, ebiederm
In-Reply-To: <201701141417.rz8yuy5o%fengguang.wu@intel.com>
On 14/01/17 06:41, kbuild test robot wrote:
> Hi Robert,
>
> [auto build test ERROR on net-next/master]
>
> url: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_0day-2Dci_linux_commits_Robert-2DShearman_net-2DAF-2Dspecific-2DRTM-5FGETSTATS-2Dattributes_20170114-2D095819&d=DwIBAg&c=IL_XqQWOjubgfqINi2jTzg&r=HbzsGgI7IidV3zRVGbZOYKAd0w1ch0IRBV2pqme4k9w&m=-FIZAjvyj_cLBHBTW14fNKp5IiJpkr1laQrxgxKnZ3g&s=_d4vequnI_QXJkUb0X3X8AUHdi6qD4R86g-mTBsEJ7g&e=
> config: x86_64-randconfig-u0-01141334 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=x86_64
>
> All error/warnings (new ones prefixed by >>):
>
> In file included from include/net/netns/mib.h:4:0,
> from include/net/net_namespace.h:14,
> from include/linux/netdevice.h:43,
> from include/uapi/linux/if_arp.h:26,
> from include/linux/if_arp.h:27,
> from net/mpls/af_mpls.c:7:
> net/mpls/af_mpls.c: In function 'mpls_stats_inc_outucastpkts':
>>> include/net/ipv6.h:163:35: error: 'struct netns_mib' has no member named 'ipv6_statistics'; did you mean 'ip_statistics'?
> mod##SNMP_UPD_PO_STATS((net)->mib.statname##_statistics, field, (val));\
Good catch kbuild test robot.
Expect to see a v2 shortly with this CONFIG_IPV6=n build failure fixed.
Thanks,
Rob
^ permalink raw reply
* [PATCH] net/irda: fix lockdep annotation
From: Dmitry Vyukov @ 2017-01-16 10:25 UTC (permalink / raw)
To: davej, samuel, davem; +Cc: glider, andreyknvl, Dmitry Vyukov, netdev
The current annotation uses a global variable as recursion counter.
The variable is not atomic nor protected with a mutex, but mutated
by multiple threads. This causes lockdep bug reports episodically:
BUG: looking up invalid subclass: 4294967295
...
_raw_spin_lock_irqsave_nested+0x120/0x180
hashbin_delete+0x4fe/0x750
__irias_delete_object+0xab/0x170
irias_delete_object+0x5f/0xc0
ircomm_tty_detach_cable+0x1d5/0x3f0
...
Make the hashbin_lock_depth variable atomic to prevent bug reports.
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Fixes: c7630a4b932af ("[IrDA]: irda lockdep annotation")
---
net/irda/irqueue.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c
index acbe61c7e683..b9fd74e6ca99 100644
--- a/net/irda/irqueue.c
+++ b/net/irda/irqueue.c
@@ -384,21 +384,23 @@ EXPORT_SYMBOL(hashbin_new);
* just supply kfree, which should take care of the job.
*/
#ifdef CONFIG_LOCKDEP
-static int hashbin_lock_depth = 0;
+static atomic_t hashbin_lock_depth = ATOMIC_INIT(0);
#endif
int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
{
irda_queue_t* queue;
unsigned long flags = 0;
- int i;
+ int i, depth = 0;
IRDA_ASSERT(hashbin != NULL, return -1;);
IRDA_ASSERT(hashbin->magic == HB_MAGIC, return -1;);
/* Synchronize */
if ( hashbin->hb_type & HB_LOCK ) {
- spin_lock_irqsave_nested(&hashbin->hb_spinlock, flags,
- hashbin_lock_depth++);
+#ifdef CONFIG_LOCKDEP
+ depth = atomic_inc_return(&hashbin_lock_depth) - 1;
+#endif
+ spin_lock_irqsave_nested(&hashbin->hb_spinlock, flags, depth);
}
/*
@@ -423,7 +425,7 @@ int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
if ( hashbin->hb_type & HB_LOCK) {
spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
#ifdef CONFIG_LOCKDEP
- hashbin_lock_depth--;
+ atomic_dec(&hashbin_lock_depth);
#endif
}
--
2.11.0.483.g087da7b7c-goog
^ permalink raw reply related
* Re: [PATCH net-next] net/sched: cls_flower: Add user specified data
From: Jiri Pirko @ 2017-01-16 9:51 UTC (permalink / raw)
To: Paul Blakey
Cc: John Fastabend, Jamal Hadi Salim, David S. Miller, netdev,
Jiri Pirko, Hadar Hen Zion, Or Gerlitz, Roi Dayan, Roman Mashak
In-Reply-To: <11bcf09a-0144-fd7f-369b-771962475c5e@mellanox.com>
Mon, Jan 16, 2017 at 08:54:18AM CET, paulb@mellanox.com wrote:
>
>
>On 15/01/2017 21:08, John Fastabend wrote:
>> On 17-01-15 09:36 AM, Paul Blakey wrote:
>> >
>> >
>> > On 08/01/2017 19:12, Jiri Pirko wrote:
>> > > Mon, Jan 02, 2017 at 03:59:49PM CET, jhs@mojatatu.com wrote:
>> > > >
>> > > > We have been using a cookie as well for actions (which we have been
>> > > > using but have been too lazy to submit so far). I am going to port
>> > > > it over to the newer kernels and post it.
>> > >
>> > > Hard to deal with something we can't look at :)
>> > >
>> > >
>> > > > In our case that is intended to be opaque to the kernel i.e kernel
>> > > > never inteprets it; in that case it is similar to the kernel
>> > > > FIB protocol field.
>> > >
>> > > In case of this patch, kernel also never interprets it. What makes you
>> > > think otherwise. Bot kernel, it is always a binary blob.
>> > >
>> > >
>> > > >
>> > > > In your case - could this cookie have been a class/flowid
>> > > > (a 32 bit)?
>> > > > And would it not make more sense for it the cookie to be
>> > > > generic to all classifiers? i.e why is it specific to flower?
>> > >
>> > > Correct, makes sense to have it generic for all cls and perhaps also
>> > > acts.
>> > >
>> > >
>> >
>> > Hi all,
>> > I've started implementing a general cookie for all classifiers,
>> > I added the cookie on tcf_proto struct but then I realized that it won't work as
>> > I want. What I want is cookie per internal element (those that are identified by
>> > handles), which we can have many per one tcf_proto:
>> >
>> > tc filter add dev <DEV> parent ffff: prio 1 cookie 0x123 basic action drop
>> > tc filter add dev <DEV> parent ffff: prio 1 cookie 0x456 "port6" basic action drop
>> > tc filter add dev <DEV> parent ffff: prio 1 cookie 0x777 basic action drop
>> >
>> > So there is three options to do that:
>> > 1) Implement it in each classifier, using some generic function. (kinda like
>> > stats, where classifiler_dump() calls tcf_exts_dump_stats())
>> > 2) Have a global hash table for cookies [prio,handle]->[cookie]
>> > 3) Have it on flower only for now :)
>> >
>> > With the first one we will have to change each classifier (or leave it
>> > unsupported as default).
>> > Second is less code to change (instead of changing each classifier), but might
>> > be slower. I'm afraid how it will affect dumping several filters.
>> > Third is this patch.
>> >
>> > Thanks,
>> > Paul.
>>
>> Avoid (2) it creates way more problems than its worth like is it locked/not
>> locked, how is it synced, collisions, etc. Seems way overkill.
+1
>>
>> I like the generic functionality of (1) but unless we see this pop up in
>> different filters I wouldn't require it for now. If you just do it in flower
>> (option 3) when its added to another classifier we can generalize it. As a
>> middle ground creating nice helper routines as needed goes a long way.
>>
>> .John
>>
>
>Hi all,
>So is everyone ok with leaving the commit as is, only adding user data
>to flower for now?
I think we should do it in a generic way, for every classifier, right
away. Same as Jamal is doing for actions. I think that first we should
get Jamal's patch merged and then do the same for classifiers.
^ 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