Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] s390/qeth: updates 2017-12-27
From: Julian Wiedmann @ 2017-12-27 16:44 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
	Stefan Raspl, Ursula Braun, Julian Wiedmann

Hi Dave,

please apply some post-christmas leftovers for 4.16.
Two patches to improve IP address management on L3, and two that add
support to auto-config the transport mode on z/VM VNICs.
Note that one patch in the series touches arch/s390 (acked by Martin).

Thanks,
Julian


Julian Wiedmann (4):
  s390/qeth: improve error reporting on IP add/removal
  s390/qeth: use common helper to display rxip/vipa
  s390/diag: add diag26c support for VNIC info
  s390/qeth: support early setup for z/VM NICs

 arch/s390/include/asm/diag.h      |  44 +++++++++++++++-
 drivers/s390/net/qeth_core_main.c |  86 ++++++++++++++++++++++++++++----
 drivers/s390/net/qeth_l3.h        |  12 +++--
 drivers/s390/net/qeth_l3_main.c   |  36 ++++++++------
 drivers/s390/net/qeth_l3_sys.c    | 102 +++++++++++---------------------------
 5 files changed, 179 insertions(+), 101 deletions(-)

-- 
2.13.5

^ permalink raw reply

* [PATCH net-next 1/4] s390/qeth: improve error reporting on IP add/removal
From: Julian Wiedmann @ 2017-12-27 16:44 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, linux-s390, Martin Schwidefsky, Heiko Carstens,
	Stefan Raspl, Ursula Braun, Julian Wiedmann
In-Reply-To: <20171227164431.17118-1-jwi@linux.vnet.ibm.com>

When adding & removing IP entries for rxip/vipa/ipato/hsuid, forward any
resulting errors back to the sysfs-level caller.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
---
 drivers/s390/net/qeth_l3.h      | 12 +++++++-----
 drivers/s390/net/qeth_l3_main.c | 36 ++++++++++++++++++++++--------------
 drivers/s390/net/qeth_l3_sys.c  | 12 ++++++------
 3 files changed, 35 insertions(+), 25 deletions(-)

diff --git a/drivers/s390/net/qeth_l3.h b/drivers/s390/net/qeth_l3.h
index 49f92ebbc5ad..bdd45f4dcace 100644
--- a/drivers/s390/net/qeth_l3.h
+++ b/drivers/s390/net/qeth_l3.h
@@ -74,13 +74,15 @@ void qeth_l3_remove_device_attributes(struct device *);
 int qeth_l3_setrouting_v4(struct qeth_card *);
 int qeth_l3_setrouting_v6(struct qeth_card *);
 int qeth_l3_add_ipato_entry(struct qeth_card *, struct qeth_ipato_entry *);
-void qeth_l3_del_ipato_entry(struct qeth_card *, enum qeth_prot_versions,
-			u8 *, int);
+int qeth_l3_del_ipato_entry(struct qeth_card *card,
+			    enum qeth_prot_versions proto, u8 *addr,
+			    int mask_bits);
 int qeth_l3_add_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
-void qeth_l3_del_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
+int qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
+		     const u8 *addr);
 int qeth_l3_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
-void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions,
-			const u8 *);
+int qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
+		     const u8 *addr);
 void qeth_l3_update_ipato(struct qeth_card *card);
 struct qeth_ipaddr *qeth_l3_get_addr_buffer(enum qeth_prot_versions);
 int qeth_l3_add_ip(struct qeth_card *, struct qeth_ipaddr *);
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 92bcb02671bc..b0c888e86cd4 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -588,10 +588,12 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card,
 	return rc;
 }
 
-void qeth_l3_del_ipato_entry(struct qeth_card *card,
-		enum qeth_prot_versions proto, u8 *addr, int mask_bits)
+int qeth_l3_del_ipato_entry(struct qeth_card *card,
+			    enum qeth_prot_versions proto, u8 *addr,
+			    int mask_bits)
 {
 	struct qeth_ipato_entry *ipatoe, *tmp;
+	int rc = -ENOENT;
 
 	QETH_CARD_TEXT(card, 2, "delipato");
 
@@ -606,10 +608,12 @@ void qeth_l3_del_ipato_entry(struct qeth_card *card,
 			list_del(&ipatoe->entry);
 			qeth_l3_update_ipato(card);
 			kfree(ipatoe);
+			rc = 0;
 		}
 	}
 
 	spin_unlock_bh(&card->ip_lock);
+	return rc;
 }
 
 /*
@@ -619,7 +623,7 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
 	      const u8 *addr)
 {
 	struct qeth_ipaddr *ipaddr;
-	int rc = 0;
+	int rc;
 
 	ipaddr = qeth_l3_get_addr_buffer(proto);
 	if (ipaddr) {
@@ -643,7 +647,7 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
 	if (qeth_l3_ip_from_hash(card, ipaddr))
 		rc = -EEXIST;
 	else
-		qeth_l3_add_ip(card, ipaddr);
+		rc = qeth_l3_add_ip(card, ipaddr);
 
 	spin_unlock_bh(&card->ip_lock);
 
@@ -652,10 +656,11 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
 	return rc;
 }
 
-void qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
-	      const u8 *addr)
+int qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
+		     const u8 *addr)
 {
 	struct qeth_ipaddr *ipaddr;
+	int rc;
 
 	ipaddr = qeth_l3_get_addr_buffer(proto);
 	if (ipaddr) {
@@ -670,13 +675,14 @@ void qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
 		}
 		ipaddr->type = QETH_IP_TYPE_VIPA;
 	} else
-		return;
+		return -ENOMEM;
 
 	spin_lock_bh(&card->ip_lock);
-	qeth_l3_delete_ip(card, ipaddr);
+	rc = qeth_l3_delete_ip(card, ipaddr);
 	spin_unlock_bh(&card->ip_lock);
 
 	kfree(ipaddr);
+	return rc;
 }
 
 /*
@@ -686,7 +692,7 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
 	      const u8 *addr)
 {
 	struct qeth_ipaddr *ipaddr;
-	int rc = 0;
+	int rc;
 
 	ipaddr = qeth_l3_get_addr_buffer(proto);
 	if (ipaddr) {
@@ -711,7 +717,7 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
 	if (qeth_l3_ip_from_hash(card, ipaddr))
 		rc = -EEXIST;
 	else
-		qeth_l3_add_ip(card, ipaddr);
+		rc = qeth_l3_add_ip(card, ipaddr);
 
 	spin_unlock_bh(&card->ip_lock);
 
@@ -720,10 +726,11 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
 	return rc;
 }
 
-void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
-			const u8 *addr)
+int qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
+		     const u8 *addr)
 {
 	struct qeth_ipaddr *ipaddr;
+	int rc;
 
 	ipaddr = qeth_l3_get_addr_buffer(proto);
 	if (ipaddr) {
@@ -738,13 +745,14 @@ void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
 		}
 		ipaddr->type = QETH_IP_TYPE_RXIP;
 	} else
-		return;
+		return -ENOMEM;
 
 	spin_lock_bh(&card->ip_lock);
-	qeth_l3_delete_ip(card, ipaddr);
+	rc = qeth_l3_delete_ip(card, ipaddr);
 	spin_unlock_bh(&card->ip_lock);
 
 	kfree(ipaddr);
+	return rc;
 }
 
 static int qeth_l3_register_addr_entry(struct qeth_card *card,
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index 00a10b66c01f..f8e74b384980 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -274,7 +274,7 @@ static ssize_t qeth_l3_dev_hsuid_store(struct device *dev,
 	struct qeth_card *card = dev_get_drvdata(dev);
 	struct qeth_ipaddr *addr;
 	char *tmp;
-	int i;
+	int rc, i;
 
 	if (!card)
 		return -EINVAL;
@@ -343,11 +343,11 @@ static ssize_t qeth_l3_dev_hsuid_store(struct device *dev,
 		return -ENOMEM;
 
 	spin_lock_bh(&card->ip_lock);
-	qeth_l3_add_ip(card, addr);
+	rc = qeth_l3_add_ip(card, addr);
 	spin_unlock_bh(&card->ip_lock);
 	kfree(addr);
 
-	return count;
+	return rc ? rc : count;
 }
 
 static DEVICE_ATTR(hsuid, 0644, qeth_l3_dev_hsuid_show,
@@ -585,7 +585,7 @@ static ssize_t qeth_l3_dev_ipato_del_store(const char *buf, size_t count,
 	mutex_lock(&card->conf_mutex);
 	rc = qeth_l3_parse_ipatoe(buf, proto, addr, &mask_bits);
 	if (!rc)
-		qeth_l3_del_ipato_entry(card, proto, addr, mask_bits);
+		rc = qeth_l3_del_ipato_entry(card, proto, addr, mask_bits);
 	mutex_unlock(&card->conf_mutex);
 	return rc ? rc : count;
 }
@@ -796,7 +796,7 @@ static ssize_t qeth_l3_dev_vipa_del_store(const char *buf, size_t count,
 	mutex_lock(&card->conf_mutex);
 	rc = qeth_l3_parse_vipae(buf, proto, addr);
 	if (!rc)
-		qeth_l3_del_vipa(card, proto, addr);
+		rc = qeth_l3_del_vipa(card, proto, addr);
 	mutex_unlock(&card->conf_mutex);
 	return rc ? rc : count;
 }
@@ -976,7 +976,7 @@ static ssize_t qeth_l3_dev_rxip_del_store(const char *buf, size_t count,
 	mutex_lock(&card->conf_mutex);
 	rc = qeth_l3_parse_rxipe(buf, proto, addr);
 	if (!rc)
-		qeth_l3_del_rxip(card, proto, addr);
+		rc = qeth_l3_del_rxip(card, proto, addr);
 	mutex_unlock(&card->conf_mutex);
 	return rc ? rc : count;
 }
-- 
2.13.5

^ permalink raw reply related

* Re: [patch net-next v2 00/10] Add support for resource abstraction
From: David Ahern @ 2017-12-27 16:38 UTC (permalink / raw)
  To: Jiri Pirko, Andrew Lunn
  Cc: netdev, davem, arkadis, mlxsw, vivien.didelot, f.fainelli,
	michael.chan, ganeshgr, saeedm, matanb, leonro, idosch,
	jakub.kicinski, ast, daniel, simon.horman, pieter.jansenvanvuuren,
	john.hurley, alexander.h.duyck, linville, gospo, steven.lin1,
	yuvalm, ogerlitz, roopa
In-Reply-To: <20171227131531.GE1997@nanopsycho>

On 12/27/17 7:15 AM, Jiri Pirko wrote:
> Wed, Dec 27, 2017 at 02:08:03PM CET, andrew@lunn.ch wrote:
>>> This is misunderstanding I believe. This is not about ABI. That is well
>>> defined by the netlink attributes. This is about meaning of particular
>>> ASIC-specific internal resources.
>>
>> I would agree that the netlink attributed are clearly defined. But the
>> meta information, what this ASIC specific internal resource means when
>> you combine these attributes, is unclear. This meta information is
>> also part of the ABI, and documenting giving users a hit what it
>> means, and why they should change it, would be good practice.
>>
>> Look at sysfs. open/read/write are clearly defined, which is the
>> equivalent of the netlink attributes. The meta information we document
>> in Documentation/ABI/, what a file name means, what a value means,
>> what other values it can take, etc.
> 
> Hmm. That documents mainly sysfs. No mention of Netlink at all. But
> maybe I missed it. Also, that defines the interface as is. However we
> are talking about the data exchanged over the interface, not the
> interface itself. I don't see how ASIC/HW specific thing, like for
> example KVD in our case could be part of kernel ABI. That makes 0 sense
> to me, sorry.
> 

IMO, kernel documentation is not much better than vendor docs. A general
networking admin may not have access to a kernel tree or have vendor
docs at their finger tips. As I mentioned in the previous response,
devlink attributes have self-documenting capabilities making that
information available inline. That to me is the right place for a short,
but reasonably sized description. For in-depth details users can
cross-reference vendor docs.

^ permalink raw reply

* Re: [patch net-next v2 00/10] Add support for resource abstraction
From: David Ahern @ 2017-12-27 16:34 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: netdev, davem, arkadis, mlxsw, andrew, vivien.didelot, f.fainelli,
	michael.chan, ganeshgr, saeedm, matanb, leonro, idosch,
	jakub.kicinski, ast, daniel, simon.horman, pieter.jansenvanvuuren,
	john.hurley, alexander.h.duyck, linville, gospo, steven.lin1,
	yuvalm, ogerlitz, roopa
In-Reply-To: <20171227080902.GA1997@nanopsycho>

On 12/27/17 2:09 AM, Jiri Pirko wrote:
> Wed, Dec 27, 2017 at 05:05:09AM CET, dsa@cumulusnetworks.com wrote:
>> On 12/26/17 5:23 AM, Jiri Pirko wrote:
>>> From: Jiri Pirko <jiri@mellanox.com>
>>>
>>> Many of the ASIC's internal resources are limited and are shared between
>>> several hardware procedures. For example, unified hash-based memory can
>>> be used for many lookup purposes, like FDB and LPM. In many cases the user
>>> can provide a partitioning scheme for such a resource in order to perform
>>> fine tuning for his application. In such cases performing driver reload is
>>> needed for the changes to take place, thus this patchset also adds support
>>> for hot reload.
>>>
>>> Such an abstraction can be coupled with devlink's dpipe interface, which
>>> models the ASIC's pipeline as a graph of match/action tables. By modeling
>>> the hardware resource object, and by coupling it to several dpipe tables,
>>> further visibility can be achieved in order to debug ASIC-wide issues.
>>>
>>> The proposed interface will provide the user the ability to understand the
>>> limitations of the hardware, and receive notification regarding its occupancy.
>>> Furthermore, monitoring the resource occupancy can be done in real-time and
>>> can be useful in many cases.
>>
>> In the last RFC (not v1, but RFC) I asked for some kind of description
>> for each resource, and you and Arkadi have pushed back. Let's walk
>> through an example to see what I mean:
>>
>> $ devlink resource show pci/0000:03:00.0
>> pci/0000:03:00.0:
>>  name kvd size 245760 size_valid true
>>  resources:
>>    name linear size 98304 occ 0
>>    name hash_double size 60416
>>    name hash_single size 87040
>>
>> So this 2700 has 3 resources that can be managed -- some table or
>> resource or something named 'kvd' with linear, hash_double and
>> hash_single sub-resources. What are these names referring too? The above
>> output gives no description, and 'kvd' is not an industry term. Further,
> 
> This are internal resources specific to the ASIC. Would you like some
> description to each or something like that?

devlink has some nice self-documenting capabilities. What's missing here
is a description of what the resource is used for in standard terms --
ipv4 host routes, fdb, nexthops, rifs, etc. Even if the description is a
short list versus an exhaustive list of everything it is used for. e.g.,
Why would a user decrease linear and increase hash_single or vice versa?

> 
> 
>> what are these sizes that a user can control? The output contains no
>> units, no description, nothing. In short, the above output provides
>> random numbers associated with random names.
> 
> Units are now exposed from kernel, just this version of iproute2 patch
> does not display it.

please provide an iproute2 patch that does so the full context if this
patch set can be reviewed from a user perspective.

> 
> 
>>
>> I can see dpipe tables exported by this device:
>>
>> $ devlink dpipe header show pci/0000:03:00.0
>>
>> pci/0000:03:00.0:
>>  name mlxsw_meta
>>  field:
>>    name erif_port bitwidth 32 mapping_type ifindex
>>    name l3_forward bitwidth 1
>>    name l3_drop bitwidth 1
>>    name adj_index bitwidth 32
>>    name adj_size bitwidth 32
>>    name adj_hash_index bitwidth 32
>>
>>  name ipv6
>>  field:
>>    name destination ip bitwidth 128
>>
>>  name ipv4
>>  field:
>>    name destination ip bitwidth 32
>>
>>  name ethernet
>>  field:
>>    name destination mac bitwidth 48
>>
>> but none mention 'kvd' or 'linear' or 'hash" and none of the other
>> various devlink options:
>>
>> $ devlink
>> Usage: devlink [ OPTIONS ] OBJECT { COMMAND | help }
>> where  OBJECT := { dev | port | sb | monitor | dpipe }
>>
>> seem to related to resources.
>>
>> So how does a user know what they are controlling by this 'resource'
>> option? Is the user expected to have a PRM or user guide on hand for the
>> specific device model that is being configured?
> 
> The relation of specific dpipe table to specific resource is exposed by
> the kernel as well. Probably the iproute2 patch just does not display
> it.

please provide an iproute2 patch that does so the full context if this
patch set can be reviewed from a user perspective.

> 
> 
>>
>> Again, I have no objections to kvd, linear, hash, etc terms as they do
>> relate to Mellanox products. But kvd/linear, for example, does correlate
>> to industry standard concepts in some way. My request is that the
>> resource listing guide the user in some way, stating what these
>> resources mean.
> 
> So the showed relation to dpipe table would be enougn or you would still
> like to see some description? I don't like the description concept here
> as the relations to dpipe table should tell user exactly what he needs
> to know.

I believe it is useful to have a 1-line, short description that gives
the user some memory jogger as to what the resource is used for. It does
not have to be an exhaustive list, but the user should not have to do
mental jumping jacks running a bunch of commands to understand the
resources for vendor specific asics.

^ permalink raw reply

* Re: [PATCH v3 1/4] security: Add support for SCTP security hooks
From: Richard Haines @ 2017-12-27 16:22 UTC (permalink / raw)
  To: Marcelo Ricardo Leitner, Casey Schaufler, paul
  Cc: selinux, netdev, linux-sctp, linux-security-module, vyasevich,
	nhorman, sds, eparis
In-Reply-To: <20171222174510.GB6123@localhost.localdomain>

On Fri, 2017-12-22 at 15:45 -0200, Marcelo Ricardo Leitner wrote:
> On Fri, Dec 22, 2017 at 09:20:45AM -0800, Casey Schaufler wrote:
> > On 12/22/2017 5:05 AM, Marcelo Ricardo Leitner wrote:
> > > From: Richard Haines <richard_c_haines@btinternet.com>
> > > 
> > > The SCTP security hooks are explained in:
> > > Documentation/security/LSM-sctp.rst
> 
> Thanks Casey for your comments. However, I'm not that acquainted with
> these area of codes and I cannot work on them. I'll just wait for
> Richard then.

I'm back online and will post a V4 set of patches within a week. These
will address Paul's comments as per [1] and Casey's regarding the
documentation.
Sorry for the delay


[1] https://marc.info/?l=selinux&m=151274018809822&w=2

> 
>   Marcelo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH net 0/3] update on copyright and couple of fixes
From: David Miller @ 2017-12-27 16:09 UTC (permalink / raw)
  To: siva.kallam; +Cc: netdev, michael.chan, prashant, satish.baddipadige
In-Reply-To: <1513938929-115972-1-git-send-email-siva.kallam@broadom.com>

From: Siva Reddy Kallam <siva.kallam@broadom.com>
Date: Fri, 22 Dec 2017 16:05:26 +0530

> First patch:
> 	Update copyright
> 
> Second patch:
> 	Add workaround to restrict 5762 MRRS
> 
> Third patch:
> 	Add PHY reset in change MTU path for 5720

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH net-next] phylib: rename reset-(post-)delay-us to reset-(de)assert-us
From: David Miller @ 2017-12-27 16:07 UTC (permalink / raw)
  To: dev-M/VWbR8SM2SsTnJN9+BGXg
  Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	andrew-g2DYL2Zd6BY, f.fainelli-Re5JQEeQqe8AvxtiuMwx3w,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	richard.leitner-WcANXNA0UjBBDgjK7y7TUQ,
	geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ, lukma-ynQEQJNshbs,
	sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8,
	martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg,
	david.wu-TNX95d0MmH7DzftRWevZcw, baruch-NswTu9S1W3P6gbPvEgmw2w,
	devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20171222100809.18826-1-dev-M/VWbR8SM2SsTnJN9+BGXg@public.gmane.org>

From: Richard Leitner <dev-M/VWbR8SM2SsTnJN9+BGXg@public.gmane.org>
Date: Fri, 22 Dec 2017 11:08:09 +0100

> From: Richard Leitner <richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
> 
> As suggested by Rob Herring [1] rename the previously introduced
> reset-{,post-}delay-us bindings to the clearer reset-{,de}assert-us
> 
> [1] https://patchwork.kernel.org/patch/10104905/
> 
> Signed-off-by: Richard Leitner <richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: pull request (net): ipsec 2017-12-22
From: David Miller @ 2017-12-27 16:00 UTC (permalink / raw)
  To: steffen.klassert; +Cc: herbert, netdev
In-Reply-To: <20171222094501.23345-1-steffen.klassert@secunet.com>

From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Fri, 22 Dec 2017 10:44:53 +0100

> 1) Check for valid id proto in validate_tmpl(), otherwise
>    we may trigger a warning in xfrm_state_fini().
>    From Cong Wang.
> 
> 2) Fix a typo on XFRMA_OUTPUT_MARK policy attribute.
>    From Michal Kubecek.
> 
> 3) Verify the state is valid when encap_type < 0,
>    otherwise we may crash on IPsec GRO .
>    From Aviv Heller.
> 
> 4) Fix stack-out-of-bounds read on socket policy lookup.
>    We access the flowi of the wrong address family in the
>    IPv4 mapped IPv6 case, fix this by catching address
>    family missmatches before we do the lookup.
> 
> 5) fix xfrm_do_migrate() with AEAD to copy the geniv
>    field too. Otherwise the state is not fully initialized
>    and migration fails. From Antony Antony.
> 
> 6) Fix stack-out-of-bounds with misconfigured transport
>    mode policies. Our policy template validation is not
>    strict enough. It is possible to configure policies
>    with transport mode template where the address family
>    of the template does not match the selectors address
>    family. Fix this by refusing such a configuration,
>    address family can not change on transport mode.
> 
> 7) Fix a policy reference leak when reusing pcpu xdst
>    entry. From Florian Westphal.
> 
> 8) Reinject transport-mode packets through tasklet,
>    otherwise it is possible to reate a recursion
>    loop. From Herbert Xu.
> 
> Please pull or let me know if there are problems.

Pulled, thank you very much!

^ permalink raw reply

* Re: [PATCH net,stable 1/1] net: fec: unmap the xmit buffer that are not transferred by DMA
From: David Miller @ 2017-12-27 15:57 UTC (permalink / raw)
  To: fugang.duan; +Cc: netdev
In-Reply-To: <1513933929-24985-1-git-send-email-fugang.duan@nxp.com>

From: Fugang Duan <fugang.duan@nxp.com>
Date: Fri, 22 Dec 2017 17:12:09 +0800

> The enet IP only support 32 bit, it will use swiotlb buffer to do dma
> mapping when xmit buffer DMA memory address is bigger than 4G in i.MX
> platform. After stress suspend/resume test, it will print out:
> 
> log:
> [12826.352864] fec 5b040000.ethernet: swiotlb buffer is full (sz: 191 bytes)
> [12826.359676] DMA: Out of SW-IOMMU space for 191 bytes at device 5b040000.ethernet
> [12826.367110] fec 5b040000.ethernet eth0: Tx DMA memory map failed
> 
> The issue is that the ready xmit buffers that are dma mapped but DMA still
> don't copy them into fifo, once MAC restart, these DMA buffers are not unmapped.
> So it should check the dma mapping buffer and unmap them.
> 
> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH net 2/2] tipc: fix tipc_mon_delete() oops in tipc_enable_bearer() error path
From: David Miller @ 2017-12-27 15:56 UTC (permalink / raw)
  To: tommi.t.rantala; +Cc: netdev, jon.maloy, ying.xue, tipc-discussion
In-Reply-To: <20171222073517.8773-2-tommi.t.rantala@nokia.com>

From: Tommi Rantala <tommi.t.rantala@nokia.com>
Date: Fri, 22 Dec 2017 09:35:17 +0200

> Calling tipc_mon_delete() before the monitor has been created will oops.
> This can happen in tipc_enable_bearer() error path if tipc_disc_create()
> fails.
 ...
> Acked-by: Ying Xue <ying.xue@windriver.com>
> Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>

Applied.

^ permalink raw reply

* Re: [PATCH net 1/2] tipc: error path leak fixes in tipc_enable_bearer()
From: David Miller @ 2017-12-27 15:56 UTC (permalink / raw)
  To: tommi.t.rantala; +Cc: netdev, jon.maloy, ying.xue, tipc-discussion
In-Reply-To: <20171222073517.8773-1-tommi.t.rantala@nokia.com>

From: Tommi Rantala <tommi.t.rantala@nokia.com>
Date: Fri, 22 Dec 2017 09:35:16 +0200

> Fix memory leak in tipc_enable_bearer() if enable_media() fails, and
> cleanup with bearer_disable() if tipc_mon_create() fails.
> 
> Acked-by: Ying Xue <ying.xue@windriver.com>
> Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>

Applied.

^ permalink raw reply

* Re: [PATCH V5 net-next 00/17] add some features and fix some bugs for HNS3 driver
From: David Miller @ 2017-12-27 15:53 UTC (permalink / raw)
  To: lipeng321; +Cc: netdev, linux-kernel, linuxarm, salil.mehta
In-Reply-To: <1513916516-104591-1-git-send-email-lipeng321@huawei.com>

From: Peng Li <lipeng321@huawei.com>
Date: Fri, 22 Dec 2017 12:21:39 +0800

> This patchset adds some new feature support and fixes some bugs:
> [Patch 1/17 - 5/17] add the support to modify/query the tqp number
> through ethtool -L/l command, and also fix some related bugs for
> change tqp number.
> [Patch 6/17 - 9-17] add support vlan tag offload on tx&&rx direction
> for pf, and fix some related bugs.
> [patch 10/17 - 11/17] fix bugs for auto negotiation.
> [patch 12/17] adds support for ethtool command set_pauseparam.
> [patch 13/17 - 14/17] add support to update flow control settings after
> autoneg.
> [patch 15/17 - 17/17] fix some other bugs in net-next.

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH iproute2 3/3] ip/tunnel: Document "external" parameter
From: William Tu @ 2017-12-27 15:45 UTC (permalink / raw)
  To: Serhey Popovych; +Cc: Linux Kernel Network Developers
In-Reply-To: <1514374096-1473-4-git-send-email-serhe.popovych@gmail.com>

Hi Serhey,

On Wed, Dec 27, 2017 at 3:28 AM, Serhey Popovych
<serhe.popovych@gmail.com> wrote:
> Also add "noexternal" variant to be inline
> with geneve and vxlan tunnel types.
>
> Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
> ---
>  ip/link_gre.c         |    3 +++
>  ip/link_ip6tnl.c      |    4 +++-
>  ip/link_iptnl.c       |    4 +++-
>  man/man8/ip-link.8.in |    6 ++++++
>  4 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/ip/link_gre.c b/ip/link_gre.c
> index 896bb19..b383061 100644
> --- a/ip/link_gre.c
> +++ b/ip/link_gre.c
> @@ -43,6 +43,7 @@ static void print_usage(FILE *f)
>                 "                            [ [no]encap-csum ]\n"
>                 "                            [ [no]encap-csum6 ]\n"
>                 "                            [ [no]encap-remcsum ]\n"
> +               "                            [ [no]external ]\n"
>                 "                            [ fwmark MARK ]\n"
>                 "                            [ erspan IDX ]\n"
>                 "\n"
> @@ -288,6 +289,8 @@ get_failed:
>                         encapflags &= ~TUNNEL_ENCAP_FLAG_REMCSUM;
>                 } else if (strcmp(*argv, "external") == 0) {
>                         metadata = 1;
> +               } else if (strcmp(*argv, "noexternal") == 0) {
> +                       metadata = 0;
>                 } else if (strcmp(*argv, "ignore-df") == 0) {
>                         ignore_df = 1;
>                 } else if (strcmp(*argv, "noignore-df") == 0) {

What's the use case of noexternal?
AFAIK, setting 'noexternal' to the existing external device won't
change it to noexternal.
And if the device is created first time, then the default is noexternal.

William

^ permalink raw reply

* Re: [PATCH iproute2-next 00/10] RDMAtool cleanup and refactoring code
From: David Ahern @ 2017-12-27 15:45 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: Leon Romanovsky, netdev, Stephen Hemminger
In-Reply-To: <20171227075759.15289-1-leon@kernel.org>

On 12/27/17 1:57 AM, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> Hi,
> 
> The following patchset comes as a preparation to more complex code,
> which will add resource tracking visibility to the rdmatool, where
> the kernel part is under review of RDMA community.
> 
> Thanks
> 
> [1] https://marc.info/?l=linux-rdma&m=151412508816802&w=2
> 
> Leon Romanovsky (10):
>   rdma: Reduce scope of _dev_map_lookup call
>   rdma: Protect dev_map_lookup from wrong input
>   rdma: Move per-device handler function to generic code
>   rdma: Fix misspelled SYS_IMAGE_GUID
>   rdma: Check that port index exists before operate on link layer
>   rdma: Print supplied device name in case of wrong name
>   rdma: Get rid of dev_map_free call
>   rdma: Rename free function to be rd_cleanup
>   rdma: Rename rd_free_devmap to be rd_free
>   rdma: Move link execution logic to common code
> 
>  rdma/dev.c   |  28 +----------------
>  rdma/link.c  |  51 +++---------------------------
>  rdma/rdma.c  |   7 ++---
>  rdma/rdma.h  |   5 +--
>  rdma/utils.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
>  5 files changed, 100 insertions(+), 91 deletions(-)
> 
> --
> 2.15.1
> 


Applied to net-next. Thanks, Leon.

^ permalink raw reply

* Re: [patch iproute2 v3 3/4] tc: Add -bs option to batch mode
From: David Ahern @ 2017-12-27 15:39 UTC (permalink / raw)
  To: Chris Mi, netdev; +Cc: gerlitz.or, stephen
In-Reply-To: <20171225084658.24076-4-chrism@mellanox.com>

On 12/25/17 2:46 AM, Chris Mi wrote:
> Signed-off-by: Chris Mi <chrism@mellanox.com>
> ---
>  tc/m_action.c  |  91 +++++++++++++++++++++++++++++++++----------
>  tc/tc.c        |  47 ++++++++++++++++++----
>  tc/tc_common.h |   8 +++-
>  tc/tc_filter.c | 121 +++++++++++++++++++++++++++++++++++++++++----------------
>  4 files changed, 204 insertions(+), 63 deletions(-)
> 
> diff --git a/tc/m_action.c b/tc/m_action.c
> index fc422364..c4c3b862 100644
> --- a/tc/m_action.c
> +++ b/tc/m_action.c
> @@ -23,6 +23,7 @@
>  #include <arpa/inet.h>
>  #include <string.h>
>  #include <dlfcn.h>
> +#include <errno.h>
>  
>  #include "utils.h"
>  #include "tc_common.h"
> @@ -546,40 +547,88 @@ bad_val:
>  	return ret;
>  }
>  
> +typedef struct {
> +	struct nlmsghdr		n;
> +	struct tcamsg		t;
> +	char			buf[MAX_MSG];
> +} tc_action_req;
> +
> +static tc_action_req *action_reqs;
> +static struct iovec msg_iov[MSG_IOV_MAX];
> +
> +void free_action_reqs(void)
> +{
> +	free(action_reqs);
> +}
> +
> +static tc_action_req *get_action_req(int batch_size, int index)
> +{
> +	tc_action_req *req;
> +
> +	if (action_reqs == NULL) {
> +		action_reqs = malloc(batch_size * sizeof (tc_action_req));
> +		if (action_reqs == NULL)
> +			return NULL;
> +	}
> +	req = &action_reqs[index];
> +	memset(req, 0, sizeof (*req));
> +
> +	return req;
> +}
> +
>  static int tc_action_modify(int cmd, unsigned int flags,
> -			    int *argc_p, char ***argv_p)
> +			    int *argc_p, char ***argv_p,
> +			    int batch_size, int index, bool send)
>  {
>  	int argc = *argc_p;
>  	char **argv = *argv_p;
>  	int ret = 0;
> -	struct {
> -		struct nlmsghdr         n;
> -		struct tcamsg           t;
> -		char                    buf[MAX_MSG];
> -	} req = {
> -		.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcamsg)),
> -		.n.nlmsg_flags = NLM_F_REQUEST | flags,
> -		.n.nlmsg_type = cmd,
> -		.t.tca_family = AF_UNSPEC,
> +	tc_action_req *req;
> +	struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK };
> +	struct iovec *iov = &msg_iov[index];
> +
> +	req = get_action_req(batch_size, index);
> +	if (req == NULL) {
> +		fprintf(stderr, "get_action_req error: not enough buffer\n");
> +		return -ENOMEM;
> +	}
> +
> +	req->n.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcamsg));
> +	req->n.nlmsg_flags = NLM_F_REQUEST | flags;
> +	req->n.nlmsg_type = cmd;
> +	req->t.tca_family = AF_UNSPEC;
> +	struct rtattr *tail = NLMSG_TAIL(&req->n);
> +
> +	struct msghdr msg = {
> +		.msg_name = &nladdr,
> +		.msg_namelen = sizeof(nladdr),
> +		.msg_iov = msg_iov,
> +		.msg_iovlen = index + 1,
>  	};
> -	struct rtattr *tail = NLMSG_TAIL(&req.n);
>  
>  	argc -= 1;
>  	argv += 1;
> -	if (parse_action(&argc, &argv, TCA_ACT_TAB, &req.n)) {
> +	if (parse_action(&argc, &argv, TCA_ACT_TAB, &req->n)) {
>  		fprintf(stderr, "Illegal \"action\"\n");
>  		return -1;
>  	}
> -	tail->rta_len = (void *) NLMSG_TAIL(&req.n) - (void *) tail;
> +	tail->rta_len = (void *) NLMSG_TAIL(&req->n) - (void *) tail;
> +
> +	*argc_p = argc;
> +	*argv_p = argv;
> +
> +	iov->iov_base = &req->n;
> +	iov->iov_len = req->n.nlmsg_len;
> +
> +	if (!send)
> +		return 0;
>  
> -	if (rtnl_talk(&rth, &req.n, NULL) < 0) {
> +	ret = rtnl_talk_msg(&rth, &msg, NULL);
> +	if (ret < 0) {
>  		fprintf(stderr, "We have an error talking to the kernel\n");
>  		ret = -1;
>  	}
>  
> -	*argc_p = argc;
> -	*argv_p = argv;
> -
>  	return ret;
>  }
>  
> @@ -679,7 +728,7 @@ bad_val:
>  	return ret;
>  }
>  
> -int do_action(int argc, char **argv)
> +int do_action(int argc, char **argv, int batch_size, int index, bool send)
>  {
>  
>  	int ret = 0;
> @@ -689,12 +738,14 @@ int do_action(int argc, char **argv)
>  		if (matches(*argv, "add") == 0) {
>  			ret =  tc_action_modify(RTM_NEWACTION,
>  						NLM_F_EXCL | NLM_F_CREATE,
> -						&argc, &argv);
> +						&argc, &argv, batch_size,
> +						index, send);
>  		} else if (matches(*argv, "change") == 0 ||
>  			  matches(*argv, "replace") == 0) {
>  			ret = tc_action_modify(RTM_NEWACTION,
>  					       NLM_F_CREATE | NLM_F_REPLACE,
> -					       &argc, &argv);
> +					       &argc, &argv, batch_size,
> +					       index, send);
>  		} else if (matches(*argv, "delete") == 0) {
>  			argc -= 1;
>  			argv += 1;
> diff --git a/tc/tc.c b/tc/tc.c
> index ad9f07e9..7ea2fc89 100644
> --- a/tc/tc.c
> +++ b/tc/tc.c
> @@ -189,20 +189,20 @@ static void usage(void)
>  	fprintf(stderr, "Usage: tc [ OPTIONS ] OBJECT { COMMAND | help }\n"
>  			"       tc [-force] -batch filename\n"
>  			"where  OBJECT := { qdisc | class | filter | action | monitor | exec }\n"
> -	                "       OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -b[atch] [filename] | -n[etns] name |\n"
> +	                "       OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -p[retty] | -b[atch] [filename] | -bs | -batchsize [size] | -n[etns] name |\n"
>  			"                    -nm | -nam[es] | { -cf | -conf } path } | -j[son]\n");
>  }
>  
> -static int do_cmd(int argc, char **argv)
> +static int do_cmd(int argc, char **argv, int batch_size, int index, bool send)
>  {
>  	if (matches(*argv, "qdisc") == 0)
>  		return do_qdisc(argc-1, argv+1);
>  	if (matches(*argv, "class") == 0)
>  		return do_class(argc-1, argv+1);
>  	if (matches(*argv, "filter") == 0)
> -		return do_filter(argc-1, argv+1);
> +		return do_filter(argc-1, argv+1, batch_size, index, send);
>  	if (matches(*argv, "actions") == 0)
> -		return do_action(argc-1, argv+1);
> +		return do_action(argc-1, argv+1, batch_size, index, send);
>  	if (matches(*argv, "monitor") == 0)
>  		return do_tcmonitor(argc-1, argv+1);
>  	if (matches(*argv, "exec") == 0)
> @@ -217,11 +217,16 @@ static int do_cmd(int argc, char **argv)
>  	return -1;
>  }
>  
> -static int batch(const char *name)
> +static int batch(const char *name, int batch_size)
>  {
> +	int msg_iov_index = 0;
>  	char *line = NULL;
>  	size_t len = 0;
>  	int ret = 0;
> +	bool send;
> +
> +	if (batch_size > 1)
> +		setcmdlinetotal(name);
>  
>  	batch_mode = 1;
>  	if (name && strcmp(name, "-") != 0) {
> @@ -248,15 +253,30 @@ static int batch(const char *name)
>  		if (largc == 0)
>  			continue;	/* blank line */
>  
> -		if (do_cmd(largc, largv)) {
> +		/*
> +		 * In batch mode, if we haven't accumulated enough commands
> +		 * and this is not the last command, don't send the message
> +		 * immediately.
> +		 */
> +		if (batch_size > 1 && msg_iov_index + 1 != batch_size
> +		    && cmdlineno != cmdlinetotal)
> +			send = false;
> +		else
> +			send = true;
> +
> +		ret = do_cmd(largc, largv, batch_size, msg_iov_index++, send);

What happens if tc commands are interlaced in the file -- qdisc add,
class add, filter add, then a delete, show, exec, etc.? Right now each
command is handled one at a time so an add followed by a delete will
work. Your proposed batching loop won't work for this case as some
commands are executed when that line is reached and others are batched
for later send. Not all of the tc commands need to be batched in a
single message so perhaps those commands cause the queue to be flushed
(ie, message sent), then that command is executed and you start the
batching over.

Further, I really think the batching can be done without the global
variables and without the command handlers knowing it is batching or
part of an iov. e.g., in the case of batching try having the commands
malloc the request buffer and return the pointer back to this loop in
which case this loop calls rtnl_talk_msg and frees the buffers.

> +		if (ret < 0) {
>  			fprintf(stderr, "Command failed %s:%d\n", name, cmdlineno);
>  			ret = 1;
>  			if (!force)
>  				break;
>  		}
> +		msg_iov_index %= batch_size;
>  	}
>  	if (line)
>  		free(line);
> +	free_filter_reqs();
> +	free_action_reqs();
>  
>  	rtnl_close(&rth);
>  	return ret;

^ permalink raw reply

* Re: [PATCH net] RDS: Check cmsg_len before dereferencing CMSG_DATA
From: David Miller @ 2017-12-27 15:37 UTC (permalink / raw)
  To: avinash.repaka-QHcLZuEGTsvQT0dZR+AlfA
  Cc: santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	rds-devel-N0ozoZBvEnrZJqsBc5GL+g,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1513916224-9445-1-git-send-email-avinash.repaka-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

From: Avinash Repaka <avinash.repaka-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Date: Thu, 21 Dec 2017 20:17:04 -0800

> RDS currently doesn't check if the length of the control message is
> large enough to hold the required data, before dereferencing the control
> message data. This results in following crash:
 ...
> To fix this, we verify that the cmsg_len is large enough to hold the
> data to be read, before proceeding further.
> 
> Reported-by: syzbot <syzkaller-bugs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> Signed-off-by: Avinash Repaka <avinash.repaka-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Pravin Shelar
From: Julia Lawall @ 2017-12-27 15:22 UTC (permalink / raw)
  To: netdev, dev

The email address pshelar@nicira.com listed for Pravin Shelar in
MAINTAINERS (OPENVSWITCH section) seems to bounce.

julia

^ permalink raw reply

* [PATCH 05/12] openvswitch: drop unneeded newline
From: Julia Lawall @ 2017-12-27 14:51 UTC (permalink / raw)
  To: Pravin Shelar
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA, David S. Miller,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1514386305-7402-1-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

OVS_NLERR prints a newline at the end of the message string, so the
message string does not need to include a newline explicitly.  Done
using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

---
 net/openvswitch/conntrack.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index b27c5c6..62f36cc9 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -1266,14 +1266,14 @@ static int parse_nat(const struct nlattr *attr,
 		/* Do not allow flags if no type is given. */
 		if (info->range.flags) {
 			OVS_NLERR(log,
-				  "NAT flags may be given only when NAT range (SRC or DST) is also specified.\n"
+				  "NAT flags may be given only when NAT range (SRC or DST) is also specified."
 				  );
 			return -EINVAL;
 		}
 		info->nat = OVS_CT_NAT;   /* NAT existing connections. */
 	} else if (!info->commit) {
 		OVS_NLERR(log,
-			  "NAT attributes may be specified only when CT COMMIT flag is also specified.\n"
+			  "NAT attributes may be specified only when CT COMMIT flag is also specified."
 			  );
 		return -EINVAL;
 	}

^ permalink raw reply related

* [PATCH 03/12] net: dccp: drop unneeded newline
From: Julia Lawall @ 2017-12-27 14:51 UTC (permalink / raw)
  To: Gerrit Renker
  Cc: kernel-janitors, David S. Miller, dccp, netdev, linux-kernel
In-Reply-To: <1514386305-7402-1-git-send-email-Julia.Lawall@lip6.fr>

DCCP_CRIT prints some other text and then a newline after the message
string, so the message string does not need to include a newline
explicitly.  Done using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/dccp/ackvec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index 3de0d03..2a24f7d 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -228,7 +228,7 @@ static void dccp_ackvec_add_new(struct dccp_ackvec *av, u32 num_packets,
 	}
 
 	if (num_cells + dccp_ackvec_buflen(av) >= DCCPAV_MAX_ACKVEC_LEN) {
-		DCCP_CRIT("Ack Vector buffer overflow: dropping old entries\n");
+		DCCP_CRIT("Ack Vector buffer overflow: dropping old entries");
 		av->av_overflow = true;
 	}
 

^ permalink raw reply related

* [PATCH 00/12] drop unneeded newline
From: Julia Lawall @ 2017-12-27 14:51 UTC (permalink / raw)
  To: dri-devel
  Cc: dev, linux-s390, linux-scsi, dccp, Alexander Shishkin, netdev,
	kernel-janitors, linux-kernel, amd-gfx, cluster-devel,
	esc.storagedev, Namhyung Kim, linux-ext4, Jiri Olsa,
	linux-arm-kernel, linux-media

Drop newline at the end of a message string when the printing function adds
a newline.

The complete semantic patch that detects this issue is as shown below
(http://coccinelle.lip6.fr/).  It works in two phases - the first phase
counts how many uses of a function involve a newline and how many don't,
and then the second phase removes newlines in the case of calls where a
newline is used one fourth of the times or less.

This approach is only moderately reliable, and all patches have been
checked to ensure that the newline is not needed.

This also converts some cases of string concatenation to single strings in
modified code, as this improves greppability.

// <smpl>
virtual after_start

@initialize:ocaml@
@@

let withnl = Hashtbl.create 101
let withoutnl = Hashtbl.create 101

let ignore =
  ["strcpy";"strlcpy";"strcat";"strlcat";"strcmp";"strncmp";"strcspn";
    "strsep";"sprintf";"printf";"strncasecmp";"seq_printf";"strstr";"strspn";
    "strlen";"strpbrk";"strtok_r";"memcmp";"memcpy"]

let dignore = ["tools";"samples"]

let inc tbl k =
  let cell =
    try Hashtbl.find tbl k
    with Not_found ->
      let cell = ref 0 in
      Hashtbl.add tbl k cell;
      cell in
  cell := 1 + !cell

let endnl c =
  let len = String.length c in
  try
    String.get c (len-3) = '\\' && String.get c (len-2) = 'n' &&
    String.get c (len-1) = '"'
  with _ -> false

let clean_string s extra =
  let pieces = Str.split (Str.regexp "\" \"") s in
  let nonempty s =
    not (s = "") && String.get s 0 = '"' && not (String.get s 1 = '"') in
  let rec loop = function
      [] -> []
    | [x] -> [x]
    | x::y::rest ->
	if nonempty x && nonempty y
	then
	  let xend = String.get x (String.length x - 2) = ' ' in
	  let yend = String.get y 1 = ' ' in
	  match (xend,yend) with
	    (true,false) | (false,true) -> x :: (loop (y::rest))
	  | (true,true) ->
	      x :: (loop (((String.sub y 0 (String.length y - 2))^"\"")::rest))
	  | (false,false) ->
	      ((String.sub x 0 (String.length x - 1)) ^ " \"") ::
	      (loop (y::rest))
	else x :: (loop (y::rest)) in
  (String.concat "" (loop pieces))^extra

@r depends on !after_start@
constant char[] c;
expression list[n] es;
identifier f;
position p;
@@

f@p(es,c,...)

@script:ocaml@
f << r.f;
n << r.n;
p << r.p;
c << r.c;
@@

let pieces = Str.split (Str.regexp "/") (List.hd p).file in
if not (List.mem f ignore) &&
  List.for_all (fun x -> not (List.mem x pieces)) dignore
then
  (if endnl c
  then inc withnl (f,n)
  else inc withoutnl (f,n))

@finalize:ocaml depends on !after_start@
w1 << merge.withnl;
w2 << merge.withoutnl;
@@

let names = ref [] in
let incn tbl k v =
  let cell =
    try Hashtbl.find tbl k
    with Not_found ->
      begin
	let cell = ref 0 in
	Hashtbl.add tbl k cell;
	cell
      end in
  (if not (List.mem k !names) then names := k :: !names);
  cell := !v + !cell in
List.iter (function w -> Hashtbl.iter (incn withnl) w) w1;
List.iter (function w -> Hashtbl.iter (incn withoutnl) w) w2;

List.iter
  (function name ->
    let wth = try !(Hashtbl.find withnl name) with _ -> 0 in
    let wo = try !(Hashtbl.find withoutnl name) with _ -> 0 in
    if wth > 0 && wth <= wo / 3 then Hashtbl.remove withnl name
    else (Printf.eprintf "dropping %s %d %d\n" (fst name) wth wo; Hashtbl.remove withoutnl name; Hashtbl.remove withnl name))
  !names;

let it = new iteration() in
it#add_virtual_rule After_start;
it#register()

@s1 depends on after_start@
constant char[] c;
expression list[n] es;
identifier f;
position p;
@@

f(es,c@p,...)

@script:ocaml s2@
f << s1.f;
n << s1.n;
c << s1.c;
newc;
@@

try
  let _ = Hashtbl.find withnl (f,n) in
  if endnl c
  then Coccilib.include_match false
  else newc :=
    make_expr(clean_string (String.sub c 0 (String.length c - 1)) "\\n\"")
with Not_found ->
try
  let _ = Hashtbl.find withoutnl (f,n) in
  if endnl c
  then newc :=
    make_expr(clean_string (String.sub c 0 (String.length c - 3)) "\"")
  else Coccilib.include_match false
with Not_found -> Coccilib.include_match false

@@
constant char[] s1.c;
position s1.p;
expression s2.newc;
@@

- c@p
+ newc
// </smpl>

---

 arch/arm/mach-davinci/board-da850-evm.c                 |    4 ++--
 drivers/block/DAC960.c                                  |    4 ++--
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c        |   12 ++++++++----
 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c      |    2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c   |    2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c |    2 +-
 drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c     |    2 +-
 drivers/media/usb/pvrusb2/pvrusb2-hdw.c                 |    3 ++-
 drivers/s390/block/dasd_diag.c                          |    3 +--
 drivers/scsi/hpsa.c                                     |    2 +-
 fs/dlm/plock.c                                          |    3 +--
 fs/ext2/super.c                                         |    2 +-
 fs/hpfs/dnode.c                                         |    3 ++-
 net/dccp/ackvec.c                                       |    2 +-
 net/openvswitch/conntrack.c                             |    4 ++--
 tools/perf/tests/dso-data.c                             |    9 +++++----
 16 files changed, 32 insertions(+), 27 deletions(-)
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* Re: [patch iproute2 v3 2/4] utils: Add a function setcmdlinetotal
From: David Ahern @ 2017-12-27 14:34 UTC (permalink / raw)
  To: Chris Mi, netdev; +Cc: gerlitz.or, stephen
In-Reply-To: <20171225084658.24076-3-chrism@mellanox.com>

On 12/25/17 2:46 AM, Chris Mi wrote:
> This function calculates how many commands a batch file has and
> set it to global variable cmdlinetotal.
> 
> Signed-off-by: Chris Mi <chrism@mellanox.com>
> ---
>  include/utils.h |  4 ++++
>  lib/utils.c     | 20 ++++++++++++++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/include/utils.h b/include/utils.h
> index d3895d56..113a8c31 100644
> --- a/include/utils.h
> +++ b/include/utils.h
> @@ -235,6 +235,10 @@ void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n);
>  
>  extern int cmdlineno;
>  ssize_t getcmdline(char **line, size_t *len, FILE *in);
> +
> +extern int cmdlinetotal;
> +void setcmdlinetotal(const char *name);
> +
>  int makeargs(char *line, char *argv[], int maxargs);
>  int inet_get_addr(const char *src, __u32 *dst, struct in6_addr *dst6);
>  
> diff --git a/lib/utils.c b/lib/utils.c
> index 7ced8c06..53ca389f 100644
> --- a/lib/utils.c
> +++ b/lib/utils.c
> @@ -1202,6 +1202,26 @@ ssize_t getcmdline(char **linep, size_t *lenp, FILE *in)
>  	return cc;
>  }
>  
> +int cmdlinetotal;
> +
> +void setcmdlinetotal(const char *name)
> +{
> +	char *line = NULL;
> +	size_t len = 0;
> +
> +	if (name && strcmp(name, "-") != 0) {
> +		if (freopen(name, "r", stdin) == NULL) {
> +			fprintf(stderr, "Cannot open file \"%s\" for reading: %s\n",
> +				name, strerror(errno));
> +			return;
> +		}
> +	}
> +
> +	cmdlinetotal = 0;
> +	while (getcmdline(&line, &len, stdin) != -1)
> +		cmdlinetotal++;
> +}
> +
>  /* split command line into argument vector */
>  int makeargs(char *line, char *argv[], int maxargs)
>  {
> 

This helper should not be needed. There is no need to read what could be
a million+ line file multiple times.

^ permalink raw reply

* Re: [patch iproute2 v3 1/4] lib/libnetlink: Add a function rtnl_talk_msg
From: David Ahern @ 2017-12-27 14:33 UTC (permalink / raw)
  To: Chris Mi, netdev; +Cc: gerlitz.or, stephen
In-Reply-To: <20171225084658.24076-2-chrism@mellanox.com>

On 12/25/17 2:46 AM, Chris Mi wrote:
> diff --git a/lib/libnetlink.c b/lib/libnetlink.c
> index 00e6ce0c..f5f675cf 100644
> --- a/lib/libnetlink.c
> +++ b/lib/libnetlink.c
> @@ -581,36 +581,21 @@ static void rtnl_talk_error(struct nlmsghdr *h, struct nlmsgerr *err,
>  		strerror(-err->error));
>  }
>  
> -static int __rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
> -		       struct nlmsghdr **answer,
> -		       bool show_rtnl_err, nl_ext_ack_fn_t errfn)
> +static int __rtnl_check_ack(struct rtnl_handle *rtnl, struct nlmsghdr **answer,

Make this function __rtnl_talk_msg. Include the assignment of nlmsg_seq
and ack setting using the for loop below and sendmsg() call. All of that
code can be common for both the single and multiple iov case.


> +		       bool show_rtnl_err, nl_ext_ack_fn_t errfn,
> +		       unsigned int seq)
>  {
>  	int status;
> -	unsigned int seq;
> -	struct nlmsghdr *h;
> +	char *buf;

Please order variables in the reverse xmas tree style used in the net code.

>  	struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK };
> -	struct iovec iov = {
> -		.iov_base = n,
> -		.iov_len = n->nlmsg_len
> -	};
> +	struct nlmsghdr *h;
> +	struct iovec iov;
>  	struct msghdr msg = {
>  		.msg_name = &nladdr,
>  		.msg_namelen = sizeof(nladdr),
>  		.msg_iov = &iov,
>  		.msg_iovlen = 1,
>  	};
> -	char *buf;
> -
> -	n->nlmsg_seq = seq = ++rtnl->seq;
> -
> -	if (answer == NULL)
> -		n->nlmsg_flags |= NLM_F_ACK;
> -
> -	status = sendmsg(rtnl->fd, &msg, 0);
> -	if (status < 0) {
> -		perror("Cannot talk to rtnetlink");
> -		return -1;
> -	}
>  
>  	while (1) {
>  		status = rtnl_recvmsg(rtnl->fd, &msg, &buf);

^ permalink raw reply

* Re: [PATCH iproute2 net-next] erspan: add erspan usage description
From: David Ahern @ 2017-12-27 14:24 UTC (permalink / raw)
  To: William Tu, netdev
In-Reply-To: <1514313076-36470-1-git-send-email-u9012063@gmail.com>

On 12/26/17 12:31 PM, William Tu wrote:
> The patch adds erspan usage description, so 'ip link help erspan'
> and 'ip link help ip6erspan' shows the options.
> 
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
>  ip/link_gre.c  | 4 ++++
>  ip/link_gre6.c | 4 ++++
>  2 files changed, 8 insertions(+)

Applied to net-next. Thanks, William.

^ permalink raw reply

* Re: [patch net-next v2 00/10] Add support for resource abstraction
From: Jiri Pirko @ 2017-12-27 13:15 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: David Ahern, netdev, davem, arkadis, mlxsw, vivien.didelot,
	f.fainelli, michael.chan, ganeshgr, saeedm, matanb, leonro,
	idosch, jakub.kicinski, ast, daniel, simon.horman,
	pieter.jansenvanvuuren, john.hurley, alexander.h.duyck, linville,
	gospo, steven.lin1, yuvalm, ogerlitz, roopa
In-Reply-To: <20171227130803.GA31962@lunn.ch>

Wed, Dec 27, 2017 at 02:08:03PM CET, andrew@lunn.ch wrote:
>> This is misunderstanding I believe. This is not about ABI. That is well
>> defined by the netlink attributes. This is about meaning of particular
>> ASIC-specific internal resources.
>
>I would agree that the netlink attributed are clearly defined. But the
>meta information, what this ASIC specific internal resource means when
>you combine these attributes, is unclear. This meta information is
>also part of the ABI, and documenting giving users a hit what it
>means, and why they should change it, would be good practice.
>
>Look at sysfs. open/read/write are clearly defined, which is the
>equivalent of the netlink attributes. The meta information we document
>in Documentation/ABI/, what a file name means, what a value means,
>what other values it can take, etc.

Hmm. That documents mainly sysfs. No mention of Netlink at all. But
maybe I missed it. Also, that defines the interface as is. However we
are talking about the data exchanged over the interface, not the
interface itself. I don't see how ASIC/HW specific thing, like for
example KVD in our case could be part of kernel ABI. That makes 0 sense
to me, sorry.

^ permalink raw reply

* Re: [patch net-next v2 00/10] Add support for resource abstraction
From: Andrew Lunn @ 2017-12-27 13:08 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: David Ahern, netdev, davem, arkadis, mlxsw, vivien.didelot,
	f.fainelli, michael.chan, ganeshgr, saeedm, matanb, leonro,
	idosch, jakub.kicinski, ast, daniel, simon.horman,
	pieter.jansenvanvuuren, john.hurley, alexander.h.duyck, linville,
	gospo, steven.lin1, yuvalm, ogerlitz, roopa
In-Reply-To: <20171227093754.GB1997@nanopsycho>

> This is misunderstanding I believe. This is not about ABI. That is well
> defined by the netlink attributes. This is about meaning of particular
> ASIC-specific internal resources.

I would agree that the netlink attributed are clearly defined. But the
meta information, what this ASIC specific internal resource means when
you combine these attributes, is unclear. This meta information is
also part of the ABI, and documenting giving users a hit what it
means, and why they should change it, would be good practice.

Look at sysfs. open/read/write are clearly defined, which is the
equivalent of the netlink attributes. The meta information we document
in Documentation/ABI/, what a file name means, what a value means,
what other values it can take, etc.

     Andrew

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox