All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/4] net: qualcomm: rmnet: Updates 2018-03-12
@ 2018-03-14 19:01 Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 1/4] net: qualcomm: rmnet: Fix casting issues Subash Abhinov Kasiviswanathan
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Subash Abhinov Kasiviswanathan @ 2018-03-14 19:01 UTC (permalink / raw)
  To: davem, joe, netdev; +Cc: Subash Abhinov Kasiviswanathan

This series contains some minor updates for rmnet driver.

Patch 1 contains fixes for sparse warnings.
Patch 2 updates the copyright date to 2018.
Patch 3 is a cleanup in receive path.
Patch 4 has the implementation of the fill_info operation.

v1->v2: Remove the force casts since the data type is changed to __be 
types as mentioned by David.
v3>-v3: Update copyright in files which actually had changes as
mentioned by Joe.

Subash Abhinov Kasiviswanathan (4):
  net: qualcomm: rmnet: Fix casting issues
  net: qualcomm: rmnet: Update copyright year to 2018
  net: qualcomm: rmnet: Remove unnecessary device assignment
  net: qualcomm: rmnet: Implement fill_info

 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 32 +++++++++++++++++++++-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h |  2 +-
 .../net/ethernet/qualcomm/rmnet/rmnet_handlers.c   |  2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h    |  8 +++---
 .../ethernet/qualcomm/rmnet/rmnet_map_command.c    |  2 +-
 .../net/ethernet/qualcomm/rmnet/rmnet_map_data.c   |  3 +-
 .../net/ethernet/qualcomm/rmnet/rmnet_private.h    |  2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c    |  2 +-
 8 files changed, 41 insertions(+), 12 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 1/4] net: qualcomm: rmnet: Fix casting issues
  2018-03-14 19:01 [PATCH net-next v3 0/4] net: qualcomm: rmnet: Updates 2018-03-12 Subash Abhinov Kasiviswanathan
@ 2018-03-14 19:01 ` Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 2/4] net: qualcomm: rmnet: Update copyright year to 2018 Subash Abhinov Kasiviswanathan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Subash Abhinov Kasiviswanathan @ 2018-03-14 19:01 UTC (permalink / raw)
  To: davem, joe, netdev; +Cc: Subash Abhinov Kasiviswanathan

Fix warnings which were reported when running with sparse
(make C=1 CF=-D__CHECK_ENDIAN__)

drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:81:15:
warning: cast to restricted __be16
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:271:37:
warning: incorrect type in assignment (different base types)
expected unsigned short [unsigned] [usertype] pkt_len
got restricted __be16 [usertype] <noident>
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:287:29:
warning: incorrect type in assignment (different base types)
expected unsigned short [unsigned] [usertype] pkt_len
got restricted __be16 [usertype] <noident>
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:310:22:
warning: cast to restricted __be16
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:319:13:
warning: cast to restricted __be16
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c:49:18:
warning: cast to restricted __be16
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c:50:18:
warning: cast to restricted __be32
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c:74:21:
warning: cast to restricted __be16

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
index 6ce31e2..4f362df 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
@@ -23,8 +23,8 @@ struct rmnet_map_control_command {
 		struct {
 			u16 ip_family:2;
 			u16 reserved:14;
-			u16 flow_control_seq_num;
-			u32 qos_id;
+			__be16 flow_control_seq_num;
+			__be32 qos_id;
 		} flow_control;
 		u8 data[0];
 	};
@@ -44,7 +44,7 @@ struct rmnet_map_header {
 	u8  reserved_bit:1;
 	u8  cd_bit:1;
 	u8  mux_id;
-	u16 pkt_len;
+	__be16 pkt_len;
 }  __aligned(1);
 
 struct rmnet_map_dl_csum_trailer {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 2/4] net: qualcomm: rmnet: Update copyright year to 2018
  2018-03-14 19:01 [PATCH net-next v3 0/4] net: qualcomm: rmnet: Updates 2018-03-12 Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 1/4] net: qualcomm: rmnet: Fix casting issues Subash Abhinov Kasiviswanathan
@ 2018-03-14 19:01 ` Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 3/4] net: qualcomm: rmnet: Remove unnecessary device assignment Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 4/4] net: qualcomm: rmnet: Implement fill_info Subash Abhinov Kasiviswanathan
  3 siblings, 0 replies; 6+ messages in thread
From: Subash Abhinov Kasiviswanathan @ 2018-03-14 19:01 UTC (permalink / raw)
  To: davem, joe, netdev; +Cc: Subash Abhinov Kasiviswanathan

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c      | 2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h      | 2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c    | 2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h         | 2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c | 2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c    | 2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_private.h     | 2 +-
 drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c         | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index c494918..096301a 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
index 00e4634..0b5b5da 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, 2016-2017 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, 2016-2018 The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index 601edec..c758248 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
index 4f362df..884f1f5 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
index b0dbca0..afa2b86 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index c74a6c5..49e420e 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_private.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_private.h
index de0143e..98365ef 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_private.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_private.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, 2016-2017 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2014, 2016-2018 The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
index 346d310..2ea16a0 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 3/4] net: qualcomm: rmnet: Remove unnecessary device assignment
  2018-03-14 19:01 [PATCH net-next v3 0/4] net: qualcomm: rmnet: Updates 2018-03-12 Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 1/4] net: qualcomm: rmnet: Fix casting issues Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 2/4] net: qualcomm: rmnet: Update copyright year to 2018 Subash Abhinov Kasiviswanathan
@ 2018-03-14 19:01 ` Subash Abhinov Kasiviswanathan
  2018-03-14 19:01 ` [PATCH net-next v3 4/4] net: qualcomm: rmnet: Implement fill_info Subash Abhinov Kasiviswanathan
  3 siblings, 0 replies; 6+ messages in thread
From: Subash Abhinov Kasiviswanathan @ 2018-03-14 19:01 UTC (permalink / raw)
  To: davem, joe, netdev; +Cc: Subash Abhinov Kasiviswanathan

Device of the de-aggregated skb is correctly assigned after inspecting
the mux_id, so remove the assignment in rmnet_map_deaggregate().

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
 drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index 49e420e..e8f6c79 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -323,7 +323,6 @@ struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,
 	if (!skbn)
 		return NULL;
 
-	skbn->dev = skb->dev;
 	skb_reserve(skbn, RMNET_MAP_DEAGGR_HEADROOM);
 	skb_put(skbn, packet_len);
 	memcpy(skbn->data, skb->data, packet_len);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 4/4] net: qualcomm: rmnet: Implement fill_info
  2018-03-14 19:01 [PATCH net-next v3 0/4] net: qualcomm: rmnet: Updates 2018-03-12 Subash Abhinov Kasiviswanathan
                   ` (2 preceding siblings ...)
  2018-03-14 19:01 ` [PATCH net-next v3 3/4] net: qualcomm: rmnet: Remove unnecessary device assignment Subash Abhinov Kasiviswanathan
@ 2018-03-14 19:01 ` Subash Abhinov Kasiviswanathan
  2018-03-16 16:30   ` David Miller
  3 siblings, 1 reply; 6+ messages in thread
From: Subash Abhinov Kasiviswanathan @ 2018-03-14 19:01 UTC (permalink / raw)
  To: davem, joe, netdev; +Cc: Subash Abhinov Kasiviswanathan

This is needed to query the mux_id and flags of a rmnet device.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
 drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 096301a..d0f3e0f 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -331,6 +331,35 @@ static size_t rmnet_get_size(const struct net_device *dev)
 	       nla_total_size(sizeof(struct ifla_vlan_flags)); /* IFLA_VLAN_FLAGS */
 }
 
+static int rmnet_fill_info(struct sk_buff *skb, const struct net_device *dev)
+{
+	struct rmnet_priv *priv = netdev_priv(dev);
+	struct net_device *real_dev;
+	struct ifla_vlan_flags f;
+	struct rmnet_port *port;
+
+	real_dev = priv->real_dev;
+
+	if (!rmnet_is_real_dev_registered(real_dev))
+		return -ENODEV;
+
+	if (nla_put_u16(skb, IFLA_VLAN_ID, priv->mux_id))
+		goto nla_put_failure;
+
+	port = rmnet_get_port_rtnl(real_dev);
+
+	f.flags = port->data_format;
+	f.mask  = ~0;
+
+	if (nla_put(skb, IFLA_VLAN_FLAGS, sizeof(f), &f))
+		goto nla_put_failure;
+
+	return 0;
+
+nla_put_failure:
+	return -EMSGSIZE;
+}
+
 struct rtnl_link_ops rmnet_link_ops __read_mostly = {
 	.kind		= "rmnet",
 	.maxtype	= __IFLA_VLAN_MAX,
@@ -341,6 +370,7 @@ struct rtnl_link_ops rmnet_link_ops __read_mostly = {
 	.dellink	= rmnet_dellink,
 	.get_size	= rmnet_get_size,
 	.changelink     = rmnet_changelink,
+	.fill_info	= rmnet_fill_info,
 };
 
 /* Needs either rcu_read_lock() or rtnl lock */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v3 4/4] net: qualcomm: rmnet: Implement fill_info
  2018-03-14 19:01 ` [PATCH net-next v3 4/4] net: qualcomm: rmnet: Implement fill_info Subash Abhinov Kasiviswanathan
@ 2018-03-16 16:30   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-03-16 16:30 UTC (permalink / raw)
  To: subashab; +Cc: joe, netdev

From: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Date: Wed, 14 Mar 2018 13:01:04 -0600

> +	if (nla_put_u16(skb, IFLA_VLAN_ID, priv->mux_id))
> +		goto nla_put_failure;
> +
> +	port = rmnet_get_port_rtnl(real_dev);
> +
> +	f.flags = port->data_format;
> +	f.mask  = ~0;
> +
> +	if (nla_put(skb, IFLA_VLAN_FLAGS, sizeof(f), &f))
> +		goto nla_put_failure;

Please don't use VLAN netlink attributes to report rmnet device
specific values.

Instead, please add appropriate new netlink attributes which
clearly show that they are the rmnet mux_id and flags.  You'll
also need to provide UAPI definitions for these flag bits
to go along with the attribute name.

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-16 16:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 19:01 [PATCH net-next v3 0/4] net: qualcomm: rmnet: Updates 2018-03-12 Subash Abhinov Kasiviswanathan
2018-03-14 19:01 ` [PATCH net-next v3 1/4] net: qualcomm: rmnet: Fix casting issues Subash Abhinov Kasiviswanathan
2018-03-14 19:01 ` [PATCH net-next v3 2/4] net: qualcomm: rmnet: Update copyright year to 2018 Subash Abhinov Kasiviswanathan
2018-03-14 19:01 ` [PATCH net-next v3 3/4] net: qualcomm: rmnet: Remove unnecessary device assignment Subash Abhinov Kasiviswanathan
2018-03-14 19:01 ` [PATCH net-next v3 4/4] net: qualcomm: rmnet: Implement fill_info Subash Abhinov Kasiviswanathan
2018-03-16 16:30   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.