Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH iproute2 net-next 1/5] iplink: bridge: add support for IFLA_BR_FDB_FLUSH
From: Nikolay Aleksandrov @ 2017-01-17 10:36 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-2-git-send-email-liuhangbin@gmail.com>

On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_FDB_FLUSH attribute
> in iproute2 so it can flush bridge fdb dynamic entries.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  ip/iplink_bridge.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

^ permalink raw reply

* Re: [PATCH iproute2 net-next 5/5] iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
From: Nikolay Aleksandrov @ 2017-01-17 10:35 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-6-git-send-email-liuhangbin@gmail.com>

On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_MCAST_MLD_VERSION
> attribute in iproute2 so it can change the mcast mld version.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  ip/iplink_bridge.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

^ permalink raw reply

* Re: [PATCH iproute2 net-next 4/5] iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
From: Nikolay Aleksandrov @ 2017-01-17 10:34 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-5-git-send-email-liuhangbin@gmail.com>

On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_MCAST_IGMP_VERSION
> attribute in iproute2 so it can change the mcast igmp version.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  ip/iplink_bridge.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 

Reviewed-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

^ permalink raw reply

* Re: [PATCH] stmicro: rename it to dwc to improve future development
From: Joao Pinto @ 2017-01-17 10:16 UTC (permalink / raw)
  To: David Miller, Joao.Pinto; +Cc: peppe.cavallaro, alexandre.torgue, netdev
In-Reply-To: <20170116.135850.618334211623485798.davem@davemloft.net>

Hello,

Às 6:58 PM de 1/16/2017, David Miller escreveu:
> From: Joao Pinto <Joao.Pinto@synopsys.com>
> Date: Mon, 16 Jan 2017 13:26:31 +0000
> 
>> 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>
> 
> Sorry, I am not applying this.
> 
> This would mean that every single -stable backport of a fix to this
> driver would require fixing up the directory and/or file name of every
> single change without any exception.
> 
> This is an unreasonable burdon to put upon me, and every single person
> who has to backport bug fixes into older releases of the kernel.
> 
> Please stop submitting this rename change.  It is fine to leave the
> driver with the stmmac name, and there is zero user benefit to the
> rename and only negatives for people who have to work on backports.
> 
> I saw no agreement reached between yourself and anyone who voiced
> opposition to this driver rename.  Therefore it was entirely
> inappropriate for you to resubmit this change again.

Just submited an alternative to the initial rename patch with 0 impact to
STMicroelectronics, so I tried to find a better solution.

I respect your decision.

A new Designware Ethernet IP title driver is being developed at this moment.
Could you please suggest a suitable place to put it, in order to avoid problems
when we reach the upstream phase?

Thanks.

> 
> I heard very clearly your argument that you would help with the problem
> with the backports, but that is a completely empty gesture.  Here's why.
> 
> You cannot help with the problem, nor can any other developer working
> on this driver.  People all over the world are going to want to
> backport this patch or that, and I myself work in my own little
> routine and can't depend on having to have a back and forth with you
> over and over again for every single fix to this driver I decide is
> reasonable for a -stable backport.
> 

^ permalink raw reply

* Re: [PATCH net] vxlan: fix byte order of vxlan-gpe port number
From: Jiri Benc @ 2017-01-17 10:15 UTC (permalink / raw)
  To: Lance Richardson; +Cc: netdev
In-Reply-To: <1484609878-7288-1-git-send-email-lrichard@redhat.com>

On Mon, 16 Jan 2017 18:37:58 -0500, Lance Richardson wrote:
> vxlan->cfg.dst_port is in network byte order, so an htons()
> is needed here. Also reduced comment length to stay closer
> to 80 column width (still slightly over, however).

Ouch. A stupid mistake I made. I think it's still okay to fix this, I'm
not aware of anyone using VXLAN-GPE yet, it's main user is going to be
NSH which is still under development.

Acked-by: Jiri Benc <jbenc@redhat.com>

Please apply also to stable.

Thanks,

 Jiri

^ permalink raw reply

* Re: [PATCH iproute2 net-next 0/5] add latest bridge netlink options
From: Nikolay Aleksandrov @ 2017-01-17 10:03 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>

On 17/01/17 10:32, Hangbin Liu wrote:
> Add the bridge netlink attributes added to kernel recently.
> 
> Hangbin Liu (5):
>   iplink: bridge: add support for IFLA_BR_FDB_FLUSH
>   iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
>   iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
>   iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
>   iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
> 
>  ip/iplink_bridge.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 56 insertions(+), 1 deletion(-)
> 

Cool, I also have a version of all of these patches just didn't get around to send them yet. :-)
Anyway since you're at it, you should also add support for IFLA_BRPORT_FLUSH,
but TBH I don't think the flush attributes should be used via this command, they seem
like an action that you do rather than an option that you set. That is the reason I
didn't add support for them awhile back when I added the others. But I don't have a
strong feeling about doing it via ip link set or not, so if the others are fine, I'm good too.

Cheers,
 Nik

^ permalink raw reply

* Re: [PATCH iproute2 net-next 2/5] iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
From: Nikolay Aleksandrov @ 2017-01-17  9:52 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-3-git-send-email-liuhangbin@gmail.com>

On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_VLAN_STATS_ENABLED
> attribute in iproute2 so it can change the vlan state.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---

Again it is not state, it is _stats_. Please change the name to something like vlan_stats_enabled which is closer to the netlink attribute.

>  ip/iplink_bridge.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
> index 85e6597..8caf53a 100644
> --- a/ip/iplink_bridge.c
> +++ b/ip/iplink_bridge.c
> @@ -34,6 +34,7 @@ static void print_explain(FILE *f)
>  		"                  [ vlan_filtering VLAN_FILTERING ]\n"
>  		"                  [ vlan_protocol VLAN_PROTOCOL ]\n"
>  		"                  [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
> +		"                  [ vlan_state VLAN_STATE ]\n"
>  		"                  [ mcast_snooping MULTICAST_SNOOPING ]\n"
>  		"                  [ mcast_router MULTICAST_ROUTER ]\n"
>  		"                  [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
> @@ -157,6 +158,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
>  
>  			addattr16(n, 1024, IFLA_BR_VLAN_DEFAULT_PVID,
>  				  default_pvid);
> +		} else if (matches(*argv, "vlan_state") == 0) {
> +			__u8 vlan_state;
> +
> +			NEXT_ARG();
> +			if (get_u8(&vlan_state, *argv, 0))
> +				invarg("invalid vlan_state", *argv);
> +			addattr8(n, 1024, IFLA_BR_VLAN_STATS_ENABLED,
> +				  vlan_state);
>  		} else if (matches(*argv, "mcast_router") == 0) {
>  			__u8 mcast_router;
>  
> @@ -442,6 +451,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
>  		fprintf(f, "vlan_default_pvid %u ",
>  			rta_getattr_u16(tb[IFLA_BR_VLAN_DEFAULT_PVID]));
>  
> +	if (tb[IFLA_BR_VLAN_STATS_ENABLED])
> +		fprintf(f, "vlan_state %u ",
> +			rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_ENABLED]));
> +
>  	if (tb[IFLA_BR_GROUP_FWD_MASK])
>  		fprintf(f, "group_fwd_mask %#x ",
>  			rta_getattr_u16(tb[IFLA_BR_GROUP_FWD_MASK]));
> 

^ permalink raw reply

* Re: [PATCH iproute2 net-next 3/5] iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
From: Nikolay Aleksandrov @ 2017-01-17  9:51 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stephen Hemminger
In-Reply-To: <1484645552-29440-4-git-send-email-liuhangbin@gmail.com>

On 17/01/17 10:32, Hangbin Liu wrote:
> This patch implements support for the IFLA_BR_MCAST_STATS_ENABLED
> attribute in iproute2 so it can change the mcast state.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---

It is not state, it is _stats_. Calling it mcast_state is completely wrong, please
change the name to something like mcast_stats_enabled which is closer to the sysfs
and netlink attribute.

>  ip/iplink_bridge.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
> index 8caf53a..622bd07 100644
> --- a/ip/iplink_bridge.c
> +++ b/ip/iplink_bridge.c
> @@ -49,6 +49,7 @@ static void print_explain(FILE *f)
>  		"                  [ mcast_query_interval QUERY_INTERVAL ]\n"
>  		"                  [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
>  		"                  [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
> +		"                  [ mcast_state MCAST_STATE ]\n"
>  		"                  [ nf_call_iptables NF_CALL_IPTABLES ]\n"
>  		"                  [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
>  		"                  [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
> @@ -299,6 +300,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
>  
>  			addattr64(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
>  				  mcast_startup_query_intvl);
> +		} else if (matches(*argv, "mcast_state") == 0) {
> +			__u8 mcast_state;
> +
> +			NEXT_ARG();
> +			if (get_u8(&mcast_state, *argv, 0))
> +				invarg("invalid mcast_state", *argv);
> +			addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED,
> +				  mcast_state);
>  		} else if (matches(*argv, "nf_call_iptables") == 0) {
>  			__u8 nf_call_ipt;
>  
> @@ -524,6 +533,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
>  		fprintf(f, "mcast_startup_query_interval %llu ",
>  			rta_getattr_u64(tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL]));
>  
> +	if (tb[IFLA_BR_MCAST_STATS_ENABLED])
> +		fprintf(f, "mcast_state %u ",
> +			rta_getattr_u8(tb[IFLA_BR_MCAST_STATS_ENABLED]));
> +
>  	if (tb[IFLA_BR_NF_CALL_IPTABLES])
>  		fprintf(f, "nf_call_iptables %u ",
>  			rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
> 

^ permalink raw reply

* [PATCH iproute2 net-next 4/5] iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
From: Hangbin Liu @ 2017-01-17  9:32 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>

This patch implements support for the IFLA_BR_MCAST_IGMP_VERSION
attribute in iproute2 so it can change the mcast igmp version.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 ip/iplink_bridge.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 622bd07..6611a85 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -50,6 +50,7 @@ static void print_explain(FILE *f)
 		"                  [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
 		"                  [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
 		"                  [ mcast_state MCAST_STATE ]\n"
+		"                  [ mcast_igmp_version IGMP_VERSION ]\n"
 		"                  [ nf_call_iptables NF_CALL_IPTABLES ]\n"
 		"                  [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
 		"                  [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -308,6 +309,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
 				invarg("invalid mcast_state", *argv);
 			addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED,
 				  mcast_state);
+		} else if (matches(*argv, "mcast_igmp_version") == 0) {
+			__u8 igmp_version;
+
+			NEXT_ARG();
+			if (get_u8(&igmp_version, *argv, 0))
+				invarg("invalid mcast_igmp_version", *argv);
+			addattr8(n, 1024, IFLA_BR_MCAST_IGMP_VERSION,
+				  igmp_version);
 		} else if (matches(*argv, "nf_call_iptables") == 0) {
 			__u8 nf_call_ipt;
 
@@ -537,6 +546,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 		fprintf(f, "mcast_state %u ",
 			rta_getattr_u8(tb[IFLA_BR_MCAST_STATS_ENABLED]));
 
+	if (tb[IFLA_BR_MCAST_IGMP_VERSION])
+		fprintf(f, "mcast_igmp_version %u ",
+			rta_getattr_u8(tb[IFLA_BR_MCAST_IGMP_VERSION]));
+
 	if (tb[IFLA_BR_NF_CALL_IPTABLES])
 		fprintf(f, "nf_call_iptables %u ",
 			rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
-- 
2.5.5

^ permalink raw reply related

* [PATCH iproute2 net-next 2/5] iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
From: Hangbin Liu @ 2017-01-17  9:32 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>

This patch implements support for the IFLA_BR_VLAN_STATS_ENABLED
attribute in iproute2 so it can change the vlan state.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 ip/iplink_bridge.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 85e6597..8caf53a 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -34,6 +34,7 @@ static void print_explain(FILE *f)
 		"                  [ vlan_filtering VLAN_FILTERING ]\n"
 		"                  [ vlan_protocol VLAN_PROTOCOL ]\n"
 		"                  [ vlan_default_pvid VLAN_DEFAULT_PVID ]\n"
+		"                  [ vlan_state VLAN_STATE ]\n"
 		"                  [ mcast_snooping MULTICAST_SNOOPING ]\n"
 		"                  [ mcast_router MULTICAST_ROUTER ]\n"
 		"                  [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ]\n"
@@ -157,6 +158,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
 
 			addattr16(n, 1024, IFLA_BR_VLAN_DEFAULT_PVID,
 				  default_pvid);
+		} else if (matches(*argv, "vlan_state") == 0) {
+			__u8 vlan_state;
+
+			NEXT_ARG();
+			if (get_u8(&vlan_state, *argv, 0))
+				invarg("invalid vlan_state", *argv);
+			addattr8(n, 1024, IFLA_BR_VLAN_STATS_ENABLED,
+				  vlan_state);
 		} else if (matches(*argv, "mcast_router") == 0) {
 			__u8 mcast_router;
 
@@ -442,6 +451,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 		fprintf(f, "vlan_default_pvid %u ",
 			rta_getattr_u16(tb[IFLA_BR_VLAN_DEFAULT_PVID]));
 
+	if (tb[IFLA_BR_VLAN_STATS_ENABLED])
+		fprintf(f, "vlan_state %u ",
+			rta_getattr_u8(tb[IFLA_BR_VLAN_STATS_ENABLED]));
+
 	if (tb[IFLA_BR_GROUP_FWD_MASK])
 		fprintf(f, "group_fwd_mask %#x ",
 			rta_getattr_u16(tb[IFLA_BR_GROUP_FWD_MASK]));
-- 
2.5.5

^ permalink raw reply related

* [PATCH iproute2 net-next 3/5] iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
From: Hangbin Liu @ 2017-01-17  9:32 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>

This patch implements support for the IFLA_BR_MCAST_STATS_ENABLED
attribute in iproute2 so it can change the mcast state.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 ip/iplink_bridge.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 8caf53a..622bd07 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -49,6 +49,7 @@ static void print_explain(FILE *f)
 		"                  [ mcast_query_interval QUERY_INTERVAL ]\n"
 		"                  [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ]\n"
 		"                  [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
+		"                  [ mcast_state MCAST_STATE ]\n"
 		"                  [ nf_call_iptables NF_CALL_IPTABLES ]\n"
 		"                  [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
 		"                  [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -299,6 +300,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
 
 			addattr64(n, 1024, IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
 				  mcast_startup_query_intvl);
+		} else if (matches(*argv, "mcast_state") == 0) {
+			__u8 mcast_state;
+
+			NEXT_ARG();
+			if (get_u8(&mcast_state, *argv, 0))
+				invarg("invalid mcast_state", *argv);
+			addattr8(n, 1024, IFLA_BR_MCAST_STATS_ENABLED,
+				  mcast_state);
 		} else if (matches(*argv, "nf_call_iptables") == 0) {
 			__u8 nf_call_ipt;
 
@@ -524,6 +533,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 		fprintf(f, "mcast_startup_query_interval %llu ",
 			rta_getattr_u64(tb[IFLA_BR_MCAST_STARTUP_QUERY_INTVL]));
 
+	if (tb[IFLA_BR_MCAST_STATS_ENABLED])
+		fprintf(f, "mcast_state %u ",
+			rta_getattr_u8(tb[IFLA_BR_MCAST_STATS_ENABLED]));
+
 	if (tb[IFLA_BR_NF_CALL_IPTABLES])
 		fprintf(f, "nf_call_iptables %u ",
 			rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
-- 
2.5.5

^ permalink raw reply related

* [PATCH iproute2 net-next 5/5] iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION
From: Hangbin Liu @ 2017-01-17  9:32 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>

This patch implements support for the IFLA_BR_MCAST_MLD_VERSION
attribute in iproute2 so it can change the mcast mld version.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 ip/iplink_bridge.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index 6611a85..f484d05 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -51,6 +51,7 @@ static void print_explain(FILE *f)
 		"                  [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ]\n"
 		"                  [ mcast_state MCAST_STATE ]\n"
 		"                  [ mcast_igmp_version IGMP_VERSION ]\n"
+		"                  [ mcast_mld_version MLD_VERSION ]\n"
 		"                  [ nf_call_iptables NF_CALL_IPTABLES ]\n"
 		"                  [ nf_call_ip6tables NF_CALL_IP6TABLES ]\n"
 		"                  [ nf_call_arptables NF_CALL_ARPTABLES ]\n"
@@ -317,6 +318,14 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
 				invarg("invalid mcast_igmp_version", *argv);
 			addattr8(n, 1024, IFLA_BR_MCAST_IGMP_VERSION,
 				  igmp_version);
+		} else if (matches(*argv, "mcast_mld_version") == 0) {
+			__u8 mld_version;
+
+			NEXT_ARG();
+			if (get_u8(&mld_version, *argv, 0))
+				invarg("invalid mcast_mld_version", *argv);
+			addattr8(n, 1024, IFLA_BR_MCAST_MLD_VERSION,
+				  mld_version);
 		} else if (matches(*argv, "nf_call_iptables") == 0) {
 			__u8 nf_call_ipt;
 
@@ -550,6 +559,10 @@ static void bridge_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 		fprintf(f, "mcast_igmp_version %u ",
 			rta_getattr_u8(tb[IFLA_BR_MCAST_IGMP_VERSION]));
 
+	if (tb[IFLA_BR_MCAST_MLD_VERSION])
+		fprintf(f, "mcast_mld_version %u ",
+			rta_getattr_u8(tb[IFLA_BR_MCAST_MLD_VERSION]));
+
 	if (tb[IFLA_BR_NF_CALL_IPTABLES])
 		fprintf(f, "nf_call_iptables %u ",
 			rta_getattr_u8(tb[IFLA_BR_NF_CALL_IPTABLES]));
-- 
2.5.5

^ permalink raw reply related

* [PATCH iproute2 net-next 1/5] iplink: bridge: add support for IFLA_BR_FDB_FLUSH
From: Hangbin Liu @ 2017-01-17  9:32 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Hangbin Liu
In-Reply-To: <1484645552-29440-1-git-send-email-liuhangbin@gmail.com>

This patch implements support for the IFLA_BR_FDB_FLUSH attribute
in iproute2 so it can flush bridge fdb dynamic entries.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 ip/iplink_bridge.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
index d2d4202..85e6597 100644
--- a/ip/iplink_bridge.c
+++ b/ip/iplink_bridge.c
@@ -22,7 +22,8 @@
 static void print_explain(FILE *f)
 {
 	fprintf(f,
-		"Usage: ... bridge [ forward_delay FORWARD_DELAY ]\n"
+		"Usage: ... bridge [ fdb_flush ]\n"
+		"                  [ forward_delay FORWARD_DELAY ]\n"
 		"                  [ hello_time HELLO_TIME ]\n"
 		"                  [ max_age MAX_AGE ]\n"
 		"                  [ ageing_time AGEING_TIME ]\n"
@@ -145,6 +146,8 @@ static int bridge_parse_opt(struct link_util *lu, int argc, char **argv,
 			if (len < 0)
 				return -1;
 			addattr_l(n, 1024, IFLA_BR_GROUP_ADDR, llabuf, len);
+		} else if (matches(*argv, "fdb_flush") == 0) {
+			addattr(n, 1024, IFLA_BR_FDB_FLUSH);
 		} else if (matches(*argv, "vlan_default_pvid") == 0) {
 			__u16 default_pvid;
 
-- 
2.5.5

^ permalink raw reply related

* [PATCH iproute2 net-next 0/5] add latest bridge netlink options
From: Hangbin Liu @ 2017-01-17  9:32 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Hangbin Liu

Add the bridge netlink attributes added to kernel recently.

Hangbin Liu (5):
  iplink: bridge: add support for IFLA_BR_FDB_FLUSH
  iplink: bridge: add support for IFLA_BR_VLAN_STATS_ENABLED
  iplink: bridge: add support for IFLA_BR_MCAST_STATS_ENABLED
  iplink: bridge: add support for IFLA_BR_MCAST_IGMP_VERSION
  iplink: bridge: add support for IFLA_BR_MCAST_MLD_VERSION

 ip/iplink_bridge.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 56 insertions(+), 1 deletion(-)

-- 
2.5.5

^ permalink raw reply

* Re: [PATCH v4 0/4] vsock: cancel connect packets when failing to connect
From: Jorgen S. Hansen @ 2017-01-17  9:25 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Peng Tao, David Miller, netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org, Stefan Hajnoczi,
	kvm@vger.kernel.org
In-Reply-To: <20170109100607.GA30228@stefanha-x1.localdomain>


> On Jan 9, 2017, at 11:06 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> 
> On Fri, Jan 06, 2017 at 10:22:56AM +0800, Peng Tao wrote:
>> On Tue, Dec 13, 2016 at 5:50 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>>> On Mon, Dec 12, 2016 at 08:21:05PM +0800, Peng Tao wrote:
>>>> Currently, if a connect call fails on a signal or timeout (e.g., guest is still
>>>> in the process of starting up), we'll just return to caller and leave the connect
>>>> packet queued and they are sent even though the connection is considered a failure,
>>>> which can confuse applications with unwanted false connect attempt.
>>>> 
>>>> The patchset enables vsock (both host and guest) to cancel queued packets when
>>>> a connect attempt is considered to fail.
>>>> 
>>>> v4 changelog:
>>>>  - drop two unnecessary void * cast
>>>>  - update new callback commnet
>>>> v3 changelog:
>>>>  - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport
>>>>  - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token
>>>> v2 changelog:
>>>>  - fix queued_replies counting and resume tx/rx when necessary
>>>> 
>>>> Cheers,
>>>> Tao
>>>> 
>>>> Peng Tao (4):
>>>>  vsock: track pkt owner vsock
>>>>  vhost-vsock: add pkt cancel capability
>>>>  vsock: add pkt cancel capability
>>>>  vsock: cancel packets when failing to connect
>>>> 
>>>> drivers/vhost/vsock.c                   | 41 ++++++++++++++++++++++++++++++++
>>>> include/linux/virtio_vsock.h            |  2 ++
>>>> include/net/af_vsock.h                  |  3 +++
>>>> net/vmw_vsock/af_vsock.c                | 14 +++++++++++
>>>> net/vmw_vsock/virtio_transport.c        | 42 +++++++++++++++++++++++++++++++++
>>>> net/vmw_vsock/virtio_transport_common.c |  7 ++++++
>>>> 6 files changed, 109 insertions(+)
>>>> 
>>>> --
>>>> 2.7.4
>>>> 
>>>> _______________________________________________
>>>> Virtualization mailing list
>>>> Virtualization@lists.linux-foundation.org
>>>> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
>>> 
>>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>> ping~
>> 
>> It looks like the patchsets are reviewed but not merged. Is there any blocker?
> 
> If Jorgen is sending pull requests then it should go through him.
> 
> Otherwise David Miller could apply it.

We are usually not involved in applying changes from outside VMware; those are applied by David Miller.

Thanks,
Jørgen

^ permalink raw reply

* Re: [PATCH] bpf: Fix test_lru_sanity5() in test_lru_map.c
From: Daniel Borkmann @ 2017-01-17  9:07 UTC (permalink / raw)
  To: Martin KaFai Lau, netdev; +Cc: Alexei Starovoitov, Kernel Team
In-Reply-To: <1484633849-2742833-1-git-send-email-kafai@fb.com>

On 01/17/2017 07:17 AM, Martin KaFai Lau wrote:
> test_lru_sanity5() fails when the number of online cpus
> is fewer than the number of possible cpus.  It can be
> reproduced with qemu by using cmd args "--smp cpus=2,maxcpus=8".
>
> The problem is the loop in test_lru_sanity5() is testing
> 'i' which is incorrect.
>
> This patch:
> 1. Make sched_next_online() always return -1 if it cannot
>     find a next cpu to schedule the process.
> 2. In test_lru_sanity5(), the parent process does
>     sched_setaffinity() first (through sched_next_online())
>     and the forked process will inherit it according to
>     the 'man sched_setaffinity'.
>
> Fixes: 5db58faf989f ("bpf: Add tests for the LRU bpf_htab")
> Reported-by: Daniel Borkmann <daniel@iogearbox.net>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>

Looks good, thanks for fixing!

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

(Patch is against -net tree.)

^ permalink raw reply

* [PATCH net-next] cxgb4: Implement ndo_get_phys_port_id for mgmt dev
From: Ganesh Goudar @ 2017-01-17  8:39 UTC (permalink / raw)
  To: netdev, davem; +Cc: nirranjan, hariprasad, Ganesh Goudar

Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 27 +++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index e95bb6a..668acfc 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2583,6 +2583,19 @@ static int cxgb_get_vf_config(struct net_device *dev,
 	ether_addr_copy(ivi->mac, adap->vfinfo[vf].vf_mac_addr);
 	return 0;
 }
+
+static int cxgb_get_phys_port_id(struct net_device *dev,
+				 struct netdev_phys_item_id *ppid)
+{
+	struct port_info *pi = netdev_priv(dev);
+	unsigned int phy_port_id;
+
+	phy_port_id = pi->adapter->adap_idx * 10 + pi->port_id;
+	ppid->id_len = sizeof(phy_port_id);
+	memcpy(ppid->id, &phy_port_id, ppid->id_len);
+	return 0;
+}
+
 #endif
 
 static int cxgb_set_mac_addr(struct net_device *dev, void *p)
@@ -2762,6 +2775,7 @@ static const struct net_device_ops cxgb4_mgmt_netdev_ops = {
 	.ndo_open             = dummy_open,
 	.ndo_set_vf_mac       = cxgb_set_vf_mac,
 	.ndo_get_vf_config    = cxgb_get_vf_config,
+	.ndo_get_phys_port_id = cxgb_get_phys_port_id,
 };
 #endif
 
@@ -4523,6 +4537,7 @@ static int config_mgmt_dev(struct pci_dev *pdev)
 
 	pi = netdev_priv(netdev);
 	pi->adapter = adap;
+	pi->port_id = adap->pf % adap->params.nports;
 	SET_NETDEV_DEV(netdev, &pdev->dev);
 
 	adap->port[0] = netdev;
@@ -4612,6 +4627,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	u32 whoami, pl_rev;
 	enum chip_type chip;
 	static int adap_idx = 1;
+	u32 v, port_vec;
 
 	printk_once(KERN_INFO "%s - version %s\n", DRV_DESC, DRV_VERSION);
 
@@ -4993,6 +5009,17 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 	spin_lock_init(&adapter->mbox_lock);
 	INIT_LIST_HEAD(&adapter->mlist.list);
+
+	v = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
+	    FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_PORTVEC);
+	err = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, 1,
+			      &v, &port_vec);
+	if (err < 0) {
+		dev_err(adapter->pdev_dev, "Could not fetch port params\n");
+		goto free_adapter;
+	}
+
+	adapter->params.nports = hweight32(port_vec);
 	pci_set_drvdata(pdev, adapter);
 	return 0;
 
-- 
2.1.0

^ permalink raw reply related

* Re: [patch net-next] stmmac: indent an if statement
From: Alexandre Torgue @ 2017-01-17  8:28 UTC (permalink / raw)
  To: David Miller, dan.carpenter
  Cc: julia.lawall, peppe.cavallaro, Joao.Pinto, netdev, linux-kernel,
	kernel-janitors
In-Reply-To: <20170116.170012.547874320348560448.davem@davemloft.net>

Dear David

On 01/16/2017 11:00 PM, David Miller wrote:
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Date: Tue, 17 Jan 2017 00:56:15 +0300
>
>> (It would be better if one of the stmmac people were responding here
>> insead of a random fix the indenting weenie like myself.)
>
> They are all too busy trying to rename the driver, because that's so
> much more important.

No, we don't spend all our times to deals with stmmac renaming. Just 
busy on other topic and we continue to do our best with Peppe to review 
stmmac patch.

Regards
Alexandre

>

^ permalink raw reply

* Re: [patch net-next] stmmac: indent an if statement
From: Alexandre Torgue @ 2017-01-17  8:25 UTC (permalink / raw)
  To: Julia Lawall, Dan Carpenter
  Cc: David Miller, peppe.cavallaro, Joao.Pinto, netdev, linux-kernel,
	kernel-janitors
In-Reply-To: <alpine.DEB.2.20.1701162308540.2031@hadrien>

Hi Julia

On 01/16/2017 11:10 PM, Julia Lawall wrote:
>
>
> On Tue, 17 Jan 2017, Dan Carpenter wrote:
>
>> On Mon, Jan 16, 2017 at 10:46:22PM +0100, Julia Lawall wrote:
>>>
>>>
>>> On Mon, 16 Jan 2017, Dan Carpenter wrote:
>>>
>>>> On Mon, Jan 16, 2017 at 12:19:24PM +0300, Dan Carpenter wrote:
>>>>> On Sun, Jan 15, 2017 at 10:14:38PM -0500, David Miller wrote:
>>>>>> From: Dan Carpenter <dan.carpenter@oracle.com>
>>>>>> Date: Thu, 12 Jan 2017 21:46:32 +0300
>>>>>>
>>>>>>> The break statement should be indented one more tab.
>>>>>>>
>>>>>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>>>>>
>>>>>> Applied, but like Julia I think we might have a missing of_node_put()
>>>>>> here.
>>>>>
>>>>> Of course, sorry for dropping the ball on this.  I'll send a patch for
>>>>> that.
>>>>>
>>>>
>>>> Actually, I've looked at it some more and I think this function is OK.
>>>> We're supposed to do an of_node_put() later...  I can't find where that
>>>> happens, but presumably that's because I don't know stmmac well.  This
>>>> code here, though, is fine.
>>>
>>> Why do you think it is fine?  Does anyone in the calling context know
>>> which child would have caused the break?
>>
>> Yeah.  It's saved in plat->mdio_node and we expect to be holding on
>> either path through the function.
>>
>> (It would be better if one of the stmmac people were responding here
>> insead of a random fix the indenting weenie like myself.)
>
> OK, I agree that there should not be an of_node_put with the break.
>
> Perhaps there should be an of_node_put on plat->mdio_node in
> stmmac_remove_config_dt, like there is an of_node_put on plat->phy_node.
> But it would certainly be helpful to hear from someone who knows the code
> better.

I also think it's missing! Can you propose a patch ?

br
Alex

>
> julia
>

^ permalink raw reply

* Re: [PATCH 1/1] ip: fix igmp parsing when iface is long
From: Petr Vorel @ 2017-01-17  8:08 UTC (permalink / raw)
  To: netdev
In-Reply-To: <20170116232550.7764-1-pvorel@suse.cz>

Hi,

> Entries with long vhost names in /proc/net/igmp have no whitespace
> between name and colon, so sscanf() adds it to vhost and
> 'ip maddr show iface' doesn't include inet result.

Bug was also reported to bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=192741),
with updated comment in the patch.


Kind regards,
Petr

^ permalink raw reply

* [PATCH] net: phy: dp83848: add DP83620 PHY support
From: Alvaro Gamez Machado @ 2017-01-17  8:08 UTC (permalink / raw)
  To: Florian Fainelli, netdev; +Cc: Alvaro Gamez Machado

This PHY with fiber support is register compatible with DP83848,
so add support for it.

Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
---
 drivers/net/phy/dp83848.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/dp83848.c b/drivers/net/phy/dp83848.c
index 800b39f06279..a10d0e7fc5f7 100644
--- a/drivers/net/phy/dp83848.c
+++ b/drivers/net/phy/dp83848.c
@@ -17,6 +17,7 @@
 #include <linux/phy.h>
 
 #define TI_DP83848C_PHY_ID		0x20005ca0
+#define TI_DP83620_PHY_ID		0x20005ce0
 #define NS_DP83848C_PHY_ID		0x20005c90
 #define TLK10X_PHY_ID			0x2000a210
 #define TI_DP83822_PHY_ID		0x2000a240
@@ -77,6 +78,7 @@ static int dp83848_config_intr(struct phy_device *phydev)
 static struct mdio_device_id __maybe_unused dp83848_tbl[] = {
 	{ TI_DP83848C_PHY_ID, 0xfffffff0 },
 	{ NS_DP83848C_PHY_ID, 0xfffffff0 },
+	{ TI_DP83620_PHY_ID, 0xfffffff0 },
 	{ TLK10X_PHY_ID, 0xfffffff0 },
 	{ TI_DP83822_PHY_ID, 0xfffffff0 },
 	{ }
@@ -106,6 +108,7 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
 static struct phy_driver dp83848_driver[] = {
 	DP83848_PHY_DRIVER(TI_DP83848C_PHY_ID, "TI DP83848C 10/100 Mbps PHY"),
 	DP83848_PHY_DRIVER(NS_DP83848C_PHY_ID, "NS DP83848C 10/100 Mbps PHY"),
+	DP83848_PHY_DRIVER(TI_DP83620_PHY_ID, "TI DP83620 10/100 Mbps PHY"),
 	DP83848_PHY_DRIVER(TLK10X_PHY_ID, "TI TLK10X 10/100 Mbps PHY"),
 	DP83848_PHY_DRIVER(TI_DP83822_PHY_ID, "TI DP83822 10/100 Mbps PHY"),
 };
-- 
2.11.0

^ permalink raw reply related

* Re: fs, net: deadlock between bind/splice on af_unix
From: Eric W. Biederman @ 2017-01-17  8:07 UTC (permalink / raw)
  To: Al Viro
  Cc: Cong Wang, Dmitry Vyukov, linux-fsdevel@vger.kernel.org, LKML,
	David Miller, Rainer Weikusat, Hannes Frederic Sowa, netdev,
	Eric Dumazet, syzkaller
In-Reply-To: <20161209064144.GZ1555@ZenIV.linux.org.uk>

Al Viro <viro@ZenIV.linux.org.uk> writes:

> On Thu, Dec 08, 2016 at 10:32:00PM -0800, Cong Wang wrote:
>
>> > Why do we do autobind there, anyway, and why is it conditional on
>> > SOCK_PASSCRED?  Note that e.g. for SOCK_STREAM we can bloody well get
>> > to sending stuff without autobind ever done - just use socketpair()
>> > to create that sucker and we won't be going through the connect()
>> > at all.
>> 
>> In the case Dmitry reported, unix_dgram_sendmsg() calls unix_autobind(),
>> not SOCK_STREAM.
>
> Yes, I've noticed.  What I'm asking is what in there needs autobind triggered
> on sendmsg and why doesn't the same need affect the SOCK_STREAM case?

With respect to the conditionality on SOCK_PASSCRED those are the linux
semantics.  Semantically that is the way the code has behaved since
2.1.15 when support for passing credentials was added to the code.
So I presume someone thought it was a good idea to have a name for
a socket that is sending credentials to another socket.  It certainly
seems reasonable at first glance.

With socketpair the only path that doesn't enforce this with
SOCK_STREAM and SOCK_PASSCRED that is either an oversight or a don't
care because we already know who is at the other end.

I can imagine two possible fixes:
1) Declare that splice is non-sense in the presence of SOCK_PASSCRED.
2) Someone adds a preparation operation that can be called on
   af_unix sockets that will ensure the autobind happens before
   any problematic locks are taken.

Eric

^ permalink raw reply

* [PATCH] net: fec: Fixed panic problem with non-tso
From: Yuusuke Ashiduka @ 2017-01-17  7:48 UTC (permalink / raw)
  To: fugang.duan; +Cc: netdev, Yuusuke Ashiduka

If highmem and 2GB or more of memory are valid,
"this_frag-> page.p" indicates the highmem area,
so the result of page_address() is NULL and panic occurs.

This commit fixes this by using the skb_frag_dma_map() helper,
which takes care of mapping the skb fragment properly. Additionally,
the type of mapping is now tracked, so it can be unmapped using
dma_unmap_page or dma_unmap_single when appropriate.
---
 drivers/net/ethernet/freescale/fec.h      |  1 +
 drivers/net/ethernet/freescale/fec_main.c | 48 +++++++++++++++++++++++--------
 2 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 5ea740b4cf14..5b187e8aacf0 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -463,6 +463,7 @@ struct bufdesc_prop {
 struct fec_enet_priv_tx_q {
 	struct bufdesc_prop bd;
 	unsigned char *tx_bounce[TX_RING_SIZE];
+	int tx_page_mapping[TX_RING_SIZE];
 	struct  sk_buff *tx_skbuff[TX_RING_SIZE];
 
 	unsigned short tx_stop_threshold;
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 38160c2bebcb..b1562107e337 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -60,6 +60,7 @@
 #include <linux/if_vlan.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/prefetch.h>
+#include <linux/highmem.h>
 #include <soc/imx/cpuidle.h>
 
 #include <asm/cacheflush.h>
@@ -377,20 +378,28 @@ fec_enet_txq_submit_frag_skb(struct fec_enet_priv_tx_q *txq,
 			ebdp->cbd_esc = cpu_to_fec32(estatus);
 		}
 
-		bufaddr = page_address(this_frag->page.p) + this_frag->page_offset;
-
 		index = fec_enet_get_bd_index(bdp, &txq->bd);
-		if (((unsigned long) bufaddr) & fep->tx_align ||
+		txq->tx_page_mapping[index] = 0;
+		if (this_frag->page_offset & fep->tx_align ||
 			fep->quirks & FEC_QUIRK_SWAP_FRAME) {
+			bufaddr = kmap_atomic(this_frag->page.p) +
+						this_frag->page_offset;
 			memcpy(txq->tx_bounce[index], bufaddr, frag_len);
+			kunmap_atomic(bufaddr);
 			bufaddr = txq->tx_bounce[index];
 
 			if (fep->quirks & FEC_QUIRK_SWAP_FRAME)
 				swap_buffer(bufaddr, frag_len);
+			addr = dma_map_single(&fep->pdev->dev,
+					      bufaddr,
+					      frag_len,
+					      DMA_TO_DEVICE);
+		} else {
+			txq->tx_page_mapping[index] = 1;
+			addr = skb_frag_dma_map(&fep->pdev->dev, this_frag, 0,
+						frag_len, DMA_TO_DEVICE);
 		}
 
-		addr = dma_map_single(&fep->pdev->dev, bufaddr, frag_len,
-				      DMA_TO_DEVICE);
 		if (dma_mapping_error(&fep->pdev->dev, addr)) {
 			if (net_ratelimit())
 				netdev_err(ndev, "Tx DMA memory map failed\n");
@@ -411,8 +420,16 @@ fec_enet_txq_submit_frag_skb(struct fec_enet_priv_tx_q *txq,
 	bdp = txq->bd.cur;
 	for (i = 0; i < frag; i++) {
 		bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
-		dma_unmap_single(&fep->pdev->dev, fec32_to_cpu(bdp->cbd_bufaddr),
-				 fec16_to_cpu(bdp->cbd_datlen), DMA_TO_DEVICE);
+		if (txq->tx_page_mapping[index])
+			dma_unmap_page(&fep->pdev->dev,
+				       fec32_to_cpu(bdp->cbd_bufaddr),
+				       fec16_to_cpu(bdp->cbd_datlen),
+				       DMA_TO_DEVICE);
+		else
+			dma_unmap_single(&fep->pdev->dev,
+					 fec32_to_cpu(bdp->cbd_bufaddr),
+					 fec16_to_cpu(bdp->cbd_datlen),
+					 DMA_TO_DEVICE);
 	}
 	return ERR_PTR(-ENOMEM);
 }
@@ -1201,11 +1218,18 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
 
 		skb = txq->tx_skbuff[index];
 		txq->tx_skbuff[index] = NULL;
-		if (!IS_TSO_HEADER(txq, fec32_to_cpu(bdp->cbd_bufaddr)))
-			dma_unmap_single(&fep->pdev->dev,
-					 fec32_to_cpu(bdp->cbd_bufaddr),
-					 fec16_to_cpu(bdp->cbd_datlen),
-					 DMA_TO_DEVICE);
+		if (!IS_TSO_HEADER(txq, fec32_to_cpu(bdp->cbd_bufaddr))) {
+			if (txq->tx_page_mapping[index])
+				dma_unmap_page(&fep->pdev->dev,
+					       fec32_to_cpu(bdp->cbd_bufaddr),
+					       fec16_to_cpu(bdp->cbd_datlen),
+					       DMA_TO_DEVICE);
+			else
+				dma_unmap_single(&fep->pdev->dev,
+						 fec32_to_cpu(bdp->cbd_bufaddr),
+						 fec16_to_cpu(bdp->cbd_datlen),
+						 DMA_TO_DEVICE);
+		}
 		bdp->cbd_bufaddr = cpu_to_fec32(0);
 		if (!skb)
 			goto skb_done;
-- 
2.11.0

^ permalink raw reply related

* Re: [PATCH net-next 6/9] net/mlx4_en: Adding support of turning off link autonegotiation via ethtool
From: Or Gerlitz @ 2017-01-17  7:20 UTC (permalink / raw)
  To: Ariel Levkovich
  Cc: Tariq Toukan, David S. Miller, Linux Netdev List, Eran Ben Elisha
In-Reply-To: <DB3PR05MB21933E49B3A1B8CC0C37A32BA7D0@DB3PR05MB219.eurprd05.prod.outlook.com>

On Tue, Jan 17, 2017 at 1:08 AM, Ariel Levkovich <lariel@mellanox.com> wrote:
> +       MLX4_PTYS_AN_DISABLE_CAP   = 1 << 5,
>
> It's there.

I'll look, but please bring a cake to the office, we started doing
that in order to prevent people from
replying in top posting to linux mailing list.

Or.

^ permalink raw reply

* Re: [PATCH net-next 6/9] net/mlx4_en: Adding support of turning off link autonegotiation via ethtool
From: Or Gerlitz @ 2017-01-17  7:21 UTC (permalink / raw)
  To: Ariel Levkovich
  Cc: Tariq Toukan, David S. Miller, Linux Netdev List, Eran Ben Elisha
In-Reply-To: <DB3PR05MB21933E49B3A1B8CC0C37A32BA7D0@DB3PR05MB219.eurprd05.prod.outlook.com>

On Tue, Jan 17, 2017 at 1:08 AM, Ariel Levkovich <lariel@mellanox.com> wrote:
> +       MLX4_PTYS_AN_DISABLE_CAP   = 1 << 5,
>
> It's there.

It would be good to spare few words on that aspect in the change log.

^ 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