Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next v2] tcp: use tcp_flags in tcp_data_queue()
From: Eric Dumazet @ 2014-09-24 13:22 UTC (permalink / raw)
  To: Weiping Pan; +Cc: netdev, edumazet
In-Reply-To: <c02ed73dc0aa5bf5bdd479ec49403728db8e73c6.1411562110.git.panweiping3@gmail.com>

On Wed, 2014-09-24 at 20:42 +0800, Weiping Pan wrote:
> Follow the idea in commit e11ecddf5128 (tcp: use TCP_SKB_CB(skb)->tcp_flags in
> input path), we can use tcp_flags to avoid cache miss.
> 

Well, there is no cache miss here. Lets try to have precise changelogs.

We access tcp_hdr(skb)->doff right before, so the tcp header is in cpu
cache.

So this patch is a cleanup and a way to help compiler to reduce register
pressure since skb->cb[] access is fast (skb is probably in a register)

Thanks.

^ permalink raw reply

* Re: [PATCH] usb: gadget: f_rndis: fix usb_interface_descriptor for rndis
From: Heiko Schocher @ 2014-09-24 13:12 UTC (permalink / raw)
  To: Lars Melin
  Cc: linux-usb, Felipe Balbi, Greg Kroah-Hartman, linux-kernel, netdev,
	linux-api, Andrzej Pietrasiewicz, Michal Nazarewicz,
	Kyungmin Park, Dan Carpenter, Macpaul Lin
In-Reply-To: <5422B83A.8030406@gmail.com>

Hello Lars,

Am 24.09.2014 14:25, schrieb Lars Melin:
> On 2014-09-24 13:48, Heiko Schocher wrote:
>> use the values for RNDIS over Ethernet as defined in
>> http://www.usb.org/developers/defined_class
>> (search for RDNIS):
>>
>> - baseclass: 0xef (miscellaneous)
>> - subclass: 0x04
>> - protocol: 0x01
>>
> That is usb class, it is not the same thing as communication device class.
>> --- a/include/uapi/linux/usb/cdc.h
>> +++ b/include/uapi/linux/usb/cdc.h
>> @@ -12,6 +12,7 @@
>> #include <linux/types.h>
>> #define USB_CDC_SUBCLASS_ACM 0x02
>> +#define USB_CDC_SUBCLASS_RNDIS 0x04
> No, no, no.
> There is no CDC_SUBCLASS_RNDIS and you can not define one over an already used cdc subclass number, 0x04 is Multi-Channel Control Model

Ah, ok, so I have to define this values in a new header file, as there
is no current file for the USB_CLASS_MISC defines? Or is there a proper
place for them?

BTW: where do I find the "cdc subclass number, 0x04 is Multi-Channel
Control Model" define?

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply

* Re: [PATCH] usb: gadget: f_rndis: fix usb_interface_descriptor for rndis
From: Heiko Schocher @ 2014-09-24 13:12 UTC (permalink / raw)
  To: Michal Nazarewicz
  Cc: linux-usb, Felipe Balbi, Greg Kroah-Hartman, linux-kernel, netdev,
	linux-api, Andrzej Pietrasiewicz, Kyungmin Park, Dan Carpenter,
	Macpaul Lin
In-Reply-To: <xa1tbnq59x3z.fsf@mina86.com>

Hello Michal,

Am 24.09.2014 11:38, schrieb Michal Nazarewicz:
> On Wed, Sep 24 2014, Heiko Schocher<hs@denx.de>  wrote:
>> use the values for RNDIS over Ethernet as defined in
>> http://www.usb.org/developers/defined_class
>> (search for RDNIS):
>>
>> - baseclass: 0xef (miscellaneous)
>> - subclass: 0x04
>> - protocol: 0x01
>>
>> with this setings the file in Documentation/usb/linux.inf is
>> obsolete.
>>
>> Signed-off-by: Heiko Schocher<hs@denx.de>
>>
>> ---
>>
>> Cc: Felipe Balbi<balbi@ti.com>
>> Cc: Greg Kroah-Hartman<gregkh@suse.de>
>> Cc: linux-usb@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: Oliver Neukum<oliver@neukum.name>
>> Cc: netdev@vger.kernel.org
>> Cc: linux-api@vger.kernel.org
>> Cc: Andrzej Pietrasiewicz<andrzej.p@samsung.com>
>> Cc: Michal Nazarewicz<mina86@mina86.com>
>> Cc: Kyungmin Park<kyungmin.park@samsung.com>
>> Cc: Dan Carpenter<dan.carpenter@oracle.com>
>> Cc: Macpaul Lin<macpaul@gmail.com>
>>
>> Tested with the "USB Compliance test suite which runs Windows", see:
>> http://www.usb.org/developers/tools/usb20_tools/#usb20cv
>>
>>   drivers/net/usb/cdc_ether.c           | 6 +++---
>>   drivers/usb/core/generic.c            | 6 +++---
>>   drivers/usb/gadget/function/f_rndis.c | 6 +++---
>>   include/uapi/linux/usb/cdc.h          | 3 +++
>>   4 files changed, 12 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
>> index 2a32d91..9c216c2 100644
>> --- a/drivers/net/usb/cdc_ether.c
>> +++ b/drivers/net/usb/cdc_ether.c
>> @@ -35,9 +35,9 @@
>>
>>   static int is_rndis(struct usb_interface_descriptor *desc)
>>   {
>> -	return (desc->bInterfaceClass == USB_CLASS_COMM&&
>> -		desc->bInterfaceSubClass == 2&&
>> -		desc->bInterfaceProtocol == 0xff);
>> +	return (desc->bInterfaceClass == USB_CLASS_MISC&&
>> +		desc->bInterfaceSubClass == USB_CDC_SUBCLASS_RNDIS&&
>> +		desc->bInterfaceProtocol == USB_CDC_RNDIS_PROTO_ETH);
>>   }
>
> Does that mean that new kernels will stop working with old RNDIs
> gadgets because they stop recognising them as RNDIS?  I feel like this
> function should accept both, i.e.:

Hmm.. I am not a usb guru ... but I think, yes, you are right.
I add this to a v2 (if this patch has a chance to go in mainline).

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply

* Re: [PATCH v1 4/5] drivers: net: xgene: Add 10GbE support
From: Arnd Bergmann @ 2014-09-24 13:10 UTC (permalink / raw)
  To: Iyappan Subramanian; +Cc: davem, netdev, devicetree, kchudgar, patches
In-Reply-To: <1411530688-2939-5-git-send-email-isubramanian@apm.com>

On Tuesday 23 September 2014 20:51:27 Iyappan Subramanian wrote:
> -static void xgene_enet_wr_mcx_mac(struct xgene_enet_pdata *pdata,
> -                                 u32 wr_addr, u32 wr_data)
> +void xgene_enet_wr_mac(struct xgene_enet_pdata *pdata, u32 wr_addr, u32 wr_data)
>  {
>         void __iomem *addr, *wr, *cmd, *cmd_done;
>  
> -       addr = pdata->mcx_mac_addr + MAC_ADDR_REG_OFFSET;
> -       wr = pdata->mcx_mac_addr + MAC_WRITE_REG_OFFSET;
> -       cmd = pdata->mcx_mac_addr + MAC_COMMAND_REG_OFFSET;
> -       cmd_done = pdata->mcx_mac_addr + MAC_COMMAND_DONE_REG_OFFSET;
> +       addr = pdata->mac_addr + MAC_ADDR_REG_OFFSET;
> +       wr = pdata->mac_addr + MAC_WRITE_REG_OFFSET;
> +       cmd = pdata->mac_addr + MAC_COMMAND_REG_OFFSET;
> +       cmd_done = pdata->mac_addr + MAC_COMMAND_DONE_REG_OFFSET;
>  
>         if (!xgene_enet_wr_indirect(addr, wr, cmd, cmd_done, wr_addr, wr_data))
>                 netdev_err(pdata->ndev, "MCX mac write failed, addr: %04x\n",
>                            wr_addr);
>  }
>  
> -static void xgene_enet_rd_csr(struct xgene_enet_pdata *pdata,
> -                             u32 offset, u32 *val)
> +void xgene_enet_rd_csr(struct xgene_enet_pdata *pdata, u32 offset, u32 *val)
>  {
>         void __iomem *addr = pdata->eth_csr_addr + offset;
>  
> 

A lot of the changes in this patch seem to just rename existing interfaces.
Please split those out into a preparatory patch, to make it easier to
review the actual functional changes.

	Arnd

^ permalink raw reply

* [PATCH net-next v2] tcp: use tcp_flags in tcp_data_queue()
From: Weiping Pan @ 2014-09-24 12:42 UTC (permalink / raw)
  To: netdev; +Cc: edumazet
In-Reply-To: <1411556068.15395.10.camel@edumazet-glaptop2.roam.corp.google.com>

Follow the idea in commit e11ecddf5128 (tcp: use TCP_SKB_CB(skb)->tcp_flags in
input path), we can use tcp_flags to avoid cache miss.

v2: remove variable th

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 net/ipv4/tcp_input.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 13f3da4..a51663f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4339,7 +4339,6 @@ err:
 
 static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 {
-	const struct tcphdr *th = tcp_hdr(skb);
 	struct tcp_sock *tp = tcp_sk(sk);
 	int eaten = -1;
 	bool fragstolen = false;
@@ -4348,7 +4347,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 		goto drop;
 
 	skb_dst_drop(skb);
-	__skb_pull(skb, th->doff * 4);
+	__skb_pull(skb, tcp_hdr(skb)->doff * 4);
 
 	TCP_ECN_accept_cwr(tp, skb);
 
@@ -4392,7 +4391,7 @@ queue_and_out:
 		tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
 		if (skb->len)
 			tcp_event_data_recv(sk, skb);
-		if (th->fin)
+		if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
 			tcp_fin(sk);
 
 		if (!skb_queue_empty(&tp->out_of_order_queue)) {
-- 
1.7.4

^ permalink raw reply related

* Re: [PATCH] usb: gadget: f_rndis: fix usb_interface_descriptor for rndis
From: Lars Melin @ 2014-09-24 12:25 UTC (permalink / raw)
  To: Heiko Schocher, linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: Felipe Balbi, Greg Kroah-Hartman,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Oliver Neukum,
	netdev-u79uwXL29TY76Z2rM5mHXA, linux-api-u79uwXL29TY76Z2rM5mHXA,
	Andrzej Pietrasiewicz, Michal Nazarewicz, Kyungmin Park,
	Dan Carpenter, Macpaul Lin
In-Reply-To: <1411541339-32400-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org>

On 2014-09-24 13:48, Heiko Schocher wrote:
> use the values for RNDIS over Ethernet as defined in
> http://www.usb.org/developers/defined_class
> (search for RDNIS):
>
> - baseclass: 0xef (miscellaneous)
> - subclass: 0x04
> - protocol: 0x01
>
That is usb class, it is not the same thing as communication device class.
> --- a/include/uapi/linux/usb/cdc.h
> +++ b/include/uapi/linux/usb/cdc.h
> @@ -12,6 +12,7 @@
>   #include <linux/types.h>
>   
>   #define USB_CDC_SUBCLASS_ACM			0x02
> +#define USB_CDC_SUBCLASS_RNDIS			0x04
No, no, no.
There is no CDC_SUBCLASS_RNDIS and you can not define one over an 
already used cdc subclass number,  0x04 is  Multi-Channel Control Model

^ permalink raw reply

* FAMILY TREASURE FOR SALE
From: Nana Kojo @ 2014-09-24 12:14 UTC (permalink / raw)




Good Day,
 
We are village miners, we have AU Gold of 550kgs Dust/ Bars and 20,000 carats of Rough Uncut Diamonds available ready and willing to sell to use the proceeds to upgrade our mines by acquiring machinery ETC for increase in production. If you are interested to do business with us, respectfully contact me via my email or contact information below for details.
 
Waiting in anticipation for your soonest response.
 
Yours,


 Nana Kojo
 
Tel: +233-236999374
Skype: oceanic.gold
 



_____________________________________________________________________

Hladate vazny vztah? Zaregistrujte sa na - http://dvaja.sme.sk

^ permalink raw reply

* [PATCH net-next] tcp: change tcp_skb_pcount() location
From: Eric Dumazet @ 2014-09-24 11:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Neal Cardwell, Yuchung Cheng, Willem de Bruijn

From: Eric Dumazet <edumazet@google.com>

Our goal is to access no more than one cache line access per skb in
a write or receive queue when doing the various walks.

After recent TCP_SKB_CB() reorganizations, it is almost done.

Last part is tcp_skb_pcount() which currently uses
skb_shinfo(skb)->gso_segs, which is a terrible choice, because it needs
3 cache lines in current kernel (skb->head, skb->end, and
shinfo->gso_segs are all in 3 different cache lines, far from skb->cb)

This very simple patch reuses space currently taken by tcp_tw_isn
only in input path, as tcp_skb_pcount is only needed for skb stored in
write queue.

This considerably speeds up tcp_ack(), granted we avoid shinfo->tx_flags
to get SKBTX_ACK_TSTAMP, which seems possible.

This also speeds up all sack processing in general.

This speeds up tcp_sendmsg() because it no longer has to access/dirty
shinfo.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
Note : This patch applies cleanly after "tcp: better TCP_SKB_CB layout"
patch serie.

 include/net/tcp.h     |   23 +++++++++++++++++++++--
 net/ipv4/tcp.c        |    4 ++--
 net/ipv4/tcp_input.c  |    8 ++++----
 net/ipv4/tcp_output.c |    9 ++++++---
 4 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4dc6641ee990..222fd43b36c8 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -698,7 +698,16 @@ static inline u32 tcp_skb_timestamp(const struct sk_buff *skb)
 struct tcp_skb_cb {
 	__u32		seq;		/* Starting sequence number	*/
 	__u32		end_seq;	/* SEQ + FIN + SYN + datalen	*/
-	__u32		tcp_tw_isn;	/* isn chosen by tcp_timewait_state_process() */
+	union {
+		/* Note : tcp_tw_isn is used in input path only
+		 *	  (isn chosen by tcp_timewait_state_process())
+		 *
+		 * 	  tcp_gso_segs is used in write queue only,
+		 *	  cf tcp_skb_pcount()
+		 */
+		__u32		tcp_tw_isn;
+		__u32		tcp_gso_segs;
+	};
 	__u8		tcp_flags;	/* TCP header flags. (tcp[13])	*/
 
 	__u8		sacked;		/* State flags for SACK/FACK.	*/
@@ -746,7 +755,17 @@ TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb,
  */
 static inline int tcp_skb_pcount(const struct sk_buff *skb)
 {
-	return skb_shinfo(skb)->gso_segs;
+	return TCP_SKB_CB(skb)->tcp_gso_segs;
+}
+
+static inline void tcp_skb_pcount_set(struct sk_buff *skb, int segs)
+{
+	TCP_SKB_CB(skb)->tcp_gso_segs = segs;
+}
+
+static inline void tcp_skb_pcount_add(struct sk_buff *skb, int segs)
+{
+	TCP_SKB_CB(skb)->tcp_gso_segs += segs;
 }
 
 /* This is valid iff tcp_skb_pcount() > 1. */
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 070aeff1b131..414f590bfee4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -963,7 +963,7 @@ new_segment:
 		skb->ip_summed = CHECKSUM_PARTIAL;
 		tp->write_seq += copy;
 		TCP_SKB_CB(skb)->end_seq += copy;
-		skb_shinfo(skb)->gso_segs = 0;
+		tcp_skb_pcount_set(skb, 0);
 
 		if (!copied)
 			TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_PSH;
@@ -1261,7 +1261,7 @@ new_segment:
 
 			tp->write_seq += copy;
 			TCP_SKB_CB(skb)->end_seq += copy;
-			skb_shinfo(skb)->gso_segs = 0;
+			tcp_skb_pcount_set(skb, 0);
 
 			from += copy;
 			copied += copy;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 13f3da4762e3..da88c0bb287a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1295,9 +1295,9 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
 	TCP_SKB_CB(prev)->end_seq += shifted;
 	TCP_SKB_CB(skb)->seq += shifted;
 
-	skb_shinfo(prev)->gso_segs += pcount;
-	BUG_ON(skb_shinfo(skb)->gso_segs < pcount);
-	skb_shinfo(skb)->gso_segs -= pcount;
+	tcp_skb_pcount_add(prev, pcount);
+	BUG_ON(tcp_skb_pcount(skb) < pcount);
+	tcp_skb_pcount_add(skb, -pcount);
 
 	/* When we're adding to gso_segs == 1, gso_size will be zero,
 	 * in theory this shouldn't be necessary but as long as DSACK
@@ -1310,7 +1310,7 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
 	}
 
 	/* CHECKME: To clear or not to clear? Mimics normal skb currently */
-	if (skb_shinfo(skb)->gso_segs <= 1) {
+	if (tcp_skb_pcount(skb) <= 1) {
 		skb_shinfo(skb)->gso_size = 0;
 		skb_shinfo(skb)->gso_type = 0;
 	}
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 6c7949cafd99..b2869a078766 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -384,7 +384,7 @@ static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u8 flags)
 	TCP_SKB_CB(skb)->tcp_flags = flags;
 	TCP_SKB_CB(skb)->sacked = 0;
 
-	shinfo->gso_segs = 1;
+	tcp_skb_pcount_set(skb, 1);
 	shinfo->gso_size = 0;
 	shinfo->gso_type = 0;
 
@@ -972,6 +972,9 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
 		TCP_ADD_STATS(sock_net(sk), TCP_MIB_OUTSEGS,
 			      tcp_skb_pcount(skb));
 
+	/* OK, its time to fill skb_shinfo(skb)->gso_segs */
+	skb_shinfo(skb)->gso_segs = tcp_skb_pcount(skb);
+
 	/* Our usage of tstamp should remain private */
 	skb->tstamp.tv64 = 0;
 
@@ -1019,11 +1022,11 @@ static void tcp_set_skb_tso_segs(const struct sock *sk, struct sk_buff *skb,
 		/* Avoid the costly divide in the normal
 		 * non-TSO case.
 		 */
-		shinfo->gso_segs = 1;
+		tcp_skb_pcount_set(skb, 1);
 		shinfo->gso_size = 0;
 		shinfo->gso_type = 0;
 	} else {
-		shinfo->gso_segs = DIV_ROUND_UP(skb->len, mss_now);
+		tcp_skb_pcount_set(skb, DIV_ROUND_UP(skb->len, mss_now));
 		shinfo->gso_size = mss_now;
 		shinfo->gso_type = sk->sk_gso_type;
 	}

^ permalink raw reply related

* from Brian Neu
From: Brian Neu @ 2014-09-24 11:02 UTC (permalink / raw)
  To: David Smith, Taylor, ehart test, Theresa, Bind Users,
	Juliette Vara, Jennifer Waller, Polly Waters, oreilly,
	e1000 devel, Carolyn, netdev, Majordomo, Majordomo, Chris Mason,
	linux btrfs, pgsql novice, Tom Lane, majordomo, backuppc users


[-- Attachment #1.1: Type: text/plain, Size: 48 bytes --]

Hi! http://pksuae.com/reading.php




Brian Neu

[-- Attachment #2: Type: text/plain, Size: 430 bytes --]

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk

[-- Attachment #3: Type: text/plain, Size: 257 bytes --]

_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply

* [PATCH 5/5] ARCNET: enable eae arcnet card support
From: Michael Grzeschik @ 2014-09-24 11:02 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411556523-28100-1-git-send-email-m.grzeschik@pengutronix.de>

This patch adds support for the EAE arcnet cards
which has two Interfaces.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020-pci.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index 7437174c..d17e1c7 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -211,6 +211,16 @@ static struct com20020_pci_card_info card_info_sohard = {
 	.flags = ARC_CAN_10MBIT,
 };
 
+static struct com20020_pci_card_info card_info_eae = {
+	.name = "EAE PLX-PCI",
+	.devcount = 2,
+	.chan_map_tbl = {
+		{ 2, 0x00, 0x08 },
+		{ 2, 0x08, 0x08 }
+	},
+	.flags = ARC_CAN_10MBIT,
+};
+
 static DEFINE_PCI_DEVICE_TABLE(com20020pci_id_table) = {
 	{
 		0x1571, 0xa001,
@@ -345,6 +355,12 @@ static DEFINE_PCI_DEVICE_TABLE(com20020pci_id_table) = {
 		(kernel_ulong_t)&card_info_sohard
 	},
 	{
+		0x10B5, 0x9050,
+		0x10B5, 0x3292,
+		0, 0,
+		(kernel_ulong_t)&card_info_eae
+	},
+	{
 		0x14BA, 0x6000,
 		PCI_ANY_ID, PCI_ANY_ID,
 		0, 0,
-- 
2.1.0

^ permalink raw reply related

* [PATCH 4/5] ARCNET: add support for multi interfaces on com20020
From: Michael Grzeschik @ 2014-09-24 11:02 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411556523-28100-1-git-send-email-m.grzeschik@pengutronix.de>

The com20020-pci driver is currently designed to instance
one netdev with one pci device. This patch adds support to
instance many cards with one pci device, depending on the device
data in the private data.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020-pci.c | 149 ++++++++++++++++++++++++--------------
 include/linux/com20020.h          |  15 +++-
 2 files changed, 109 insertions(+), 55 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index d08d539..7437174c 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -38,6 +38,7 @@
 #include <linux/pci.h>
 #include <linux/arcdevice.h>
 #include <linux/com20020.h>
+#include <linux/list.h>
 
 #include <asm/io.h>
 
@@ -61,85 +62,125 @@ module_param(clockp, int, 0);
 module_param(clockm, int, 0);
 MODULE_LICENSE("GPL");
 
+static void com20020pci_remove(struct pci_dev *pdev);
+
 static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-	struct com20020_pci_channel_map *cm;
 	struct com20020_pci_card_info *ci;
 	struct net_device *dev;
 	struct arcnet_local *lp;
-	int ioaddr, err;
+	struct com20020_priv *priv;
+	int i, ioaddr, ret;
+	struct resource *r;
 
 	if (pci_enable_device(pdev))
 		return -EIO;
-	dev = alloc_arcdev(device);
-	if (!dev)
-		return -ENOMEM;
-
-	dev->netdev_ops = &com20020_netdev_ops;
 
+	priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv),
+			    GFP_KERNEL);
 	ci = (struct com20020_pci_card_info *)id->driver_data;
+	priv->ci = ci;
 
-	lp = netdev_priv(dev);
+	INIT_LIST_HEAD(&priv->list_dev);
 
-	pci_set_drvdata(pdev, dev);
 
-	cm = &ci->chan_map_tbl[0];
-	BUGMSG(D_NORMAL, "%s Controls\n", ci->name);
-	ioaddr = pci_resource_start(pdev, cm->bar);
+	for (i = 0; i < ci->devcount; i++) {
+		struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i];
+		struct com20020_dev *card;
 
-	if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com20020-pci")) {
-		BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
-		       ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
-		err = -EBUSY;
-		goto out_dev;
-	}
+		dev = alloc_arcdev(device);
+		if (!dev) {
+			ret = -ENOMEM;
+			goto out_port;
+		}
 
-	// Dummy access after Reset
-	// ARCNET controller needs this access to detect bustype
-	outb(0x00,ioaddr+1);
-	inb(ioaddr+1);
-
-	dev->base_addr = ioaddr;
-	dev->irq = pdev->irq;
-	dev->dev_addr[0] = node;
-	lp->card_name = "PCI COM20020";
-	lp->card_flags = ci->flags;
-	lp->backplane = backplane;
-	lp->clockp = clockp & 7;
-	lp->clockm = clockm & 3;
-	lp->timeout = timeout;
-	lp->hw.owner = THIS_MODULE;
-
-	if (ASTATUS() == 0xFF) {
-		BUGMSG(D_NORMAL, "IO address %Xh was reported by PCI BIOS, "
-		       "but seems empty!\n", ioaddr);
-		err = -EIO;
-		goto out_port;
-	}
-	if (com20020_check(dev)) {
-		err = -EIO;
-		goto out_port;
+		dev->netdev_ops = &com20020_netdev_ops;
+
+		lp = netdev_priv(dev);
+
+		BUGMSG(D_NORMAL, "%s Controls\n", ci->name);
+		ioaddr = pci_resource_start(pdev, cm->bar) + cm->offset;
+
+		r = devm_request_region(&pdev->dev, ioaddr, cm->size,
+					"com20020-pci");
+		if (!r) {
+			pr_err("IO region %xh-%xh already allocated.\n",
+			       ioaddr, ioaddr + cm->size - 1);
+			ret = -EBUSY;
+			goto out_port;
+		}
+
+		/* Dummy access after Reset
+		 * ARCNET controller needs
+		 * this access to detect bustype
+		 */
+		outb(0x00, ioaddr + 1);
+		inb(ioaddr + 1);
+
+		dev->base_addr = ioaddr;
+		dev->dev_addr[0] = node;
+		dev->irq = pdev->irq;
+		lp->card_name = "PCI COM20020";
+		lp->card_flags = ci->flags;
+		lp->backplane = backplane;
+		lp->clockp = clockp & 7;
+		lp->clockm = clockm & 3;
+		lp->timeout = timeout;
+		lp->hw.owner = THIS_MODULE;
+
+		if (ASTATUS() == 0xFF) {
+			pr_err("IO address %Xh is empty!\n", ioaddr);
+			ret = -EIO;
+			goto out_port;
+		}
+		if (com20020_check(dev)) {
+			ret = -EIO;
+			goto out_port;
+		}
+
+		card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev),
+				    GFP_KERNEL);
+		if (!card) {
+			pr_err("%s out of memory!\n", __func__);
+			return -ENOMEM;
+		}
+
+		card->index = i;
+		card->pci_priv = priv;
+		card->dev = dev;
+
+		dev_set_drvdata(&dev->dev, card);
+
+		ret = com20020_found(dev, IRQF_SHARED);
+		if (ret)
+			goto out_port;
+
+		list_add(&card->list, &priv->list_dev);
 	}
 
-	if ((err = com20020_found(dev, IRQF_SHARED)) != 0)
-	        goto out_port;
+	pci_set_drvdata(pdev, priv);
 
 	return 0;
 
 out_port:
-	release_region(ioaddr, ARCNET_TOTAL_SIZE);
-out_dev:
-	free_netdev(dev);
-	return err;
+	com20020pci_remove(pdev);
+	return ret;
 }
 
 static void com20020pci_remove(struct pci_dev *pdev)
 {
-	struct net_device *dev = pci_get_drvdata(pdev);
-	unregister_netdev(dev);
-	free_irq(dev->irq, dev);
-	release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
-	free_netdev(dev);
+	struct com20020_dev *card, *tmpcard;
+	struct com20020_priv *priv;
+
+	priv = pci_get_drvdata(pdev);
+
+	list_for_each_entry_safe(card, tmpcard, &priv->list_dev, list) {
+		struct net_device *dev = card->dev;
+
+		unregister_netdev(dev);
+		free_irq(dev->irq, dev);
+		free_netdev(dev);
+	}
 }
 
 static struct com20020_pci_card_info card_info_10mbit = {
diff --git a/include/linux/com20020.h b/include/linux/com20020.h
index 6a1ceca..8589899 100644
--- a/include/linux/com20020.h
+++ b/include/linux/com20020.h
@@ -41,7 +41,7 @@ extern const struct net_device_ops com20020_netdev_ops;
 #define BUS_ALIGN  1
 #endif
 
-#define PLX_PCI_MAX_CARDS 1
+#define PLX_PCI_MAX_CARDS 2
 
 struct com20020_pci_channel_map {
 	u32 bar;
@@ -58,6 +58,19 @@ struct com20020_pci_card_info {
 	unsigned int flags;
 };
 
+struct com20020_priv {
+	struct com20020_pci_card_info *ci;
+	struct list_head list_dev;
+};
+
+struct com20020_dev {
+	struct list_head list;
+	struct net_device *dev;
+
+	struct com20020_priv *pci_priv;
+	int index;
+};
+
 #define _INTMASK  (ioaddr+BUS_ALIGN*0)	/* writable */
 #define _STATUS   (ioaddr+BUS_ALIGN*0)	/* readable */
 #define _COMMAND  (ioaddr+BUS_ALIGN*1)	/* standard arcnet commands */
-- 
2.1.0

^ permalink raw reply related

* [PATCH 3/5] ARCNET: add com20020 PCI IDs with metadata
From: Michael Grzeschik @ 2014-09-24 11:02 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411556523-28100-1-git-send-email-m.grzeschik@pengutronix.de>

This patch adds metadata for the com20020 to prepare for devices with
multiple io address areas with multi card interfaces.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020-pci.c | 216 ++++++++++++++++++++++++++++++++------
 include/linux/com20020.h          |  16 +++
 2 files changed, 197 insertions(+), 35 deletions(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index cbc44f5..d08d539 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -63,6 +63,8 @@ MODULE_LICENSE("GPL");
 
 static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
+	struct com20020_pci_channel_map *cm;
+	struct com20020_pci_card_info *ci;
 	struct net_device *dev;
 	struct arcnet_local *lp;
 	int ioaddr, err;
@@ -75,19 +77,15 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 
 	dev->netdev_ops = &com20020_netdev_ops;
 
+	ci = (struct com20020_pci_card_info *)id->driver_data;
+
 	lp = netdev_priv(dev);
 
 	pci_set_drvdata(pdev, dev);
 
-	// SOHARD needs PCI base addr 4
-	if (pdev->vendor==0x10B5) {
-		BUGMSG(D_NORMAL, "SOHARD\n");
-		ioaddr = pci_resource_start(pdev, 4);
-	}
-	else {
-		BUGMSG(D_NORMAL, "Contemporary Controls\n");
-		ioaddr = pci_resource_start(pdev, 2);
-	}
+	cm = &ci->chan_map_tbl[0];
+	BUGMSG(D_NORMAL, "%s Controls\n", ci->name);
+	ioaddr = pci_resource_start(pdev, cm->bar);
 
 	if (!request_region(ioaddr, ARCNET_TOTAL_SIZE, "com20020-pci")) {
 		BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
@@ -105,7 +103,7 @@ static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 	dev->irq = pdev->irq;
 	dev->dev_addr[0] = node;
 	lp->card_name = "PCI COM20020";
-	lp->card_flags = id->driver_data;
+	lp->card_flags = ci->flags;
 	lp->backplane = backplane;
 	lp->clockp = clockp & 7;
 	lp->clockm = clockm & 3;
@@ -144,32 +142,180 @@ static void com20020pci_remove(struct pci_dev *pdev)
 	free_netdev(dev);
 }
 
+static struct com20020_pci_card_info card_info_10mbit = {
+	.name = "ARC-PCI",
+	.devcount = 1,
+	.chan_map_tbl = {
+		{ 2, 0x00, 0x08 },
+	},
+	.flags = ARC_CAN_10MBIT,
+};
+
+static struct com20020_pci_card_info card_info_5mbit = {
+	.name = "ARC-PCI",
+	.devcount = 1,
+	.chan_map_tbl = {
+		{ 2, 0x00, 0x08 },
+	},
+	.flags = ARC_IS_5MBIT,
+};
+
+static struct com20020_pci_card_info card_info_sohard = {
+	.name = "PLX-PCI",
+	.devcount = 1,
+	/* SOHARD needs PCI base addr 4 */
+	.chan_map_tbl = {
+		{4, 0x00, 0x08},
+	},
+	.flags = ARC_CAN_10MBIT,
+};
+
 static DEFINE_PCI_DEVICE_TABLE(com20020pci_id_table) = {
-	{ 0x1571, 0xa001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa007, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0x1571, 0xa009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa00e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_IS_5MBIT },
-	{ 0x1571, 0xa201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa202, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa203, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x10B5, 0x9030, 0x10B5,     0x2978,     0, 0, ARC_CAN_10MBIT },
-	{ 0x10B5, 0x9050, 0x10B5,     0x2273,     0, 0, ARC_CAN_10MBIT },
-	{ 0x14BA, 0x6000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{ 0x10B5, 0x2200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
-	{0,}
+	{
+		0x1571, 0xa001,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0,
+	},
+	{
+		0x1571, 0xa002,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0,
+	},
+	{
+		0x1571, 0xa003,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa004,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0,
+	},
+	{
+		0x1571, 0xa005,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa006,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa007,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa008,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		0
+	},
+	{
+		0x1571, 0xa009,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00a,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00b,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00c,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00d,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa00e,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_5mbit
+	},
+	{
+		0x1571, 0xa201,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa202,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa203,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa204,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa205,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x1571, 0xa206,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x10B5, 0x9030,
+		0x10B5, 0x2978,
+		0, 0,
+		(kernel_ulong_t)&card_info_sohard
+	},
+	{
+		0x10B5, 0x9050,
+		0x10B5, 0x2273,
+		0, 0,
+		(kernel_ulong_t)&card_info_sohard
+	},
+	{
+		0x14BA, 0x6000,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{
+		0x10B5, 0x2200,
+		PCI_ANY_ID, PCI_ANY_ID,
+		0, 0,
+		(kernel_ulong_t)&card_info_10mbit
+	},
+	{ 0, }
 };
 
 MODULE_DEVICE_TABLE(pci, com20020pci_id_table);
diff --git a/include/linux/com20020.h b/include/linux/com20020.h
index 5dcfb94..6a1ceca 100644
--- a/include/linux/com20020.h
+++ b/include/linux/com20020.h
@@ -41,6 +41,22 @@ extern const struct net_device_ops com20020_netdev_ops;
 #define BUS_ALIGN  1
 #endif
 
+#define PLX_PCI_MAX_CARDS 1
+
+struct com20020_pci_channel_map {
+	u32 bar;
+	u32 offset;
+	u32 size;               /* 0x00 - auto, e.g. length of entire bar */
+};
+
+struct com20020_pci_card_info {
+	const char *name;
+	int devcount;
+
+	struct com20020_pci_channel_map chan_map_tbl[PLX_PCI_MAX_CARDS];
+
+	unsigned int flags;
+};
 
 #define _INTMASK  (ioaddr+BUS_ALIGN*0)	/* writable */
 #define _STATUS   (ioaddr+BUS_ALIGN*0)	/* readable */
-- 
2.1.0

^ permalink raw reply related

* [PATCH 2/5] ARCNET: add com20020_set_hwddr to change address
From: Michael Grzeschik @ 2014-09-24 11:02 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411556523-28100-1-git-send-email-m.grzeschik@pengutronix.de>

This patch adds com20020_set_hwaddr to make
it possible to change the hwaddr on runtime.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/com20020.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c
index 7b96c5f..1a84378 100644
--- a/drivers/net/arcnet/com20020.c
+++ b/drivers/net/arcnet/com20020.c
@@ -149,11 +149,25 @@ int com20020_check(struct net_device *dev)
 	return 0;
 }
 
+static int com20020_set_hwaddr(struct net_device *dev, void *addr)
+{
+	int ioaddr = dev->base_addr;
+	struct arcnet_local *lp = netdev_priv(dev);
+	struct sockaddr *hwaddr = addr;
+
+	memcpy(dev->dev_addr, hwaddr->sa_data, 1);
+	SET_SUBADR(SUB_NODE);
+	outb(dev->dev_addr[0], _XREG);
+
+	return 0;
+}
+
 const struct net_device_ops com20020_netdev_ops = {
 	.ndo_open	= arcnet_open,
 	.ndo_stop	= arcnet_close,
 	.ndo_start_xmit = arcnet_send_packet,
 	.ndo_tx_timeout = arcnet_timeout,
+	.ndo_set_mac_address = com20020_set_hwaddr,
 	.ndo_set_rx_mode = com20020_set_mc_list,
 };
 
-- 
2.1.0

^ permalink raw reply related

* [PATCH 1/5] ARCNET: return IRQ_NONE if the interface isn't running
From: Michael Grzeschik @ 2014-09-24 11:01 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel
In-Reply-To: <1411556523-28100-1-git-send-email-m.grzeschik@pengutronix.de>

The interrupt handler needs to return IRQ_NONE in case
two devices are used with the shared interrupt handler.
Otherwise it could steal interrupts from the other
interface.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
 drivers/net/arcnet/arcnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index a956053..abcbd3c 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -776,7 +776,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
 			ACOMMAND(CFLAGScmd | RESETclear);
 		AINTMASK(0);
 		spin_unlock(&lp->lock);
-		return IRQ_HANDLED;
+		return retval;
 	}
 
 	BUGMSG(D_DURING, "in arcnet_inthandler (status=%Xh, intmask=%Xh)\n",
-- 
2.1.0

^ permalink raw reply related

* [PATCH 0/5] ARCNET: add support for EAE multi interfac card
From: Michael Grzeschik @ 2014-09-24 11:01 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel

This series adds support for the PLX bridge based multi interface
pci cards and adds support to change device address on com200xx chips
during runtime.

Thanks,
Michael

Michael Grzeschik (5):
  ARCNET: return IRQ_NONE if the interface isn't running
  ARCNET: add com20020_set_hwddr to change address
  ARCNET: add com20020 PCI IDs with metadata
  ARCNET: add support for multi interfaces on com20020
  ARCNET: enable eae arcnet card support

 drivers/net/arcnet/arcnet.c       |   2 +-
 drivers/net/arcnet/com20020-pci.c | 369 +++++++++++++++++++++++++++++---------
 drivers/net/arcnet/com20020.c     |  14 ++
 include/linux/com20020.h          |  29 +++
 4 files changed, 330 insertions(+), 84 deletions(-)

-- 
2.1.0

^ permalink raw reply

* Re: [PATCH net-next] tcp: use tcp_flags in tcp_data_queue()
From: Eric Dumazet @ 2014-09-24 10:54 UTC (permalink / raw)
  To: Weiping Pan; +Cc: netdev, edumazet
In-Reply-To: <08ce1deee03778416354009d6e11ded50e76fc2a.1411554808.git.panweiping3@gmail.com>

On Wed, 2014-09-24 at 18:35 +0800, Weiping Pan wrote:
> Follow the idea in commit e11ecddf5128 (tcp: use TCP_SKB_CB(skb)->tcp_flags in
> input path), we can use tcp_flags to avoid cache miss.
> 
> Signed-off-by: Weiping Pan <panweiping3@gmail.com>
> ---
>  net/ipv4/tcp_input.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 13f3da4..85298c9 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -4392,7 +4392,7 @@ queue_and_out:
>  		tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
>  		if (skb->len)
>  			tcp_event_data_recv(sk, skb);
> -		if (th->fin)
> +		if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
>  			tcp_fin(sk);
>  
>  		if (!skb_queue_empty(&tp->out_of_order_queue)) {

I thought of this, but my reasoning was that we needed th anyway, and
th->fin had the same cost.

But thinking more about this, its possible compiler can generate better
code, as tcp_hdr() will only be needed at the very beginning of the
function, and compiler no longer has to keep around th value.

Could you go one step further maybe ?

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index f3f016a15c5a..1a399737802b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4344,7 +4344,6 @@ err:
 
 static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 {
-	const struct tcphdr *th = tcp_hdr(skb);
 	struct tcp_sock *tp = tcp_sk(sk);
 	int eaten = -1;
 	bool fragstolen = false;
@@ -4353,7 +4352,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 		goto drop;
 
 	skb_dst_drop(skb);
-	__skb_pull(skb, th->doff * 4);
+	__skb_pull(skb, tcp_hdr(skb)->doff * 4);
 
 	TCP_ECN_accept_cwr(tp, skb);
 
@@ -4397,7 +4396,7 @@ queue_and_out:
 		tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
 		if (skb->len)
 			tcp_event_data_recv(sk, skb);
-		if (th->fin)
+		if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
 			tcp_fin(sk);
 
 		if (!skb_queue_empty(&tp->out_of_order_queue)) {

^ permalink raw reply related

* RE: [PATCH] net: stmmac: fix stmmac_pci_probe failed when CONFIG_HAVE_CLK is selected
From: Kweh, Hock Leong @ 2014-09-24 10:48 UTC (permalink / raw)
  To: Giuseppe CAVALLARO, David Miller
  Cc: rayagond@vayavyalabs.com, vbridgers2013@gmail.com, wens@csie.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ong, Boon Leong, tobias.johannes.klausmann@mni.thm.de
In-Reply-To: <54226020.50008@st.com>

> -----Original Message-----
> From: Giuseppe CAVALLARO [mailto:peppe.cavallaro@st.com]
> Sent: Wednesday, September 24, 2014 2:10 PM
> >
> > Hi peppe,
> >
> > Appreciate for the explanation. Just to clarify that I am not asking not to
> pass in the priv->stmmac_clk.
> > In fact, the fix will fail at case 2 if driver cannot obtain the priv->stmmac_clk,
> but just not the case 1.
> > For case 1, seem like it does not require the stmmac_clk then I think
> > it should be OK not to fail it when driver did not get stmmac_clk but have
> the clk_csr set.
> 
> ok we can do that but this clock is also managed when the iface is down.
> Maybe it could be convenient to manage it for power consumption.
> What do you think?

Hi peppe,

I don't really get what you mean here. Are you telling that you are OK with the fix?
Or you are referring to the bottom idea which introduce clock registration APIs to
stmmac_pci driver?

Regarding the power management, isn't this taking care by the PCI framework itself
for the PCI devices / PCI cards?

Sorry, may be would need you to provide a big picture to this. Thanks. :)

> 
> > Anyway, I can change the fix by adding the clock registration APIs
> > being call at the stmmac_pci.c probe there before calling
> > stmmac_dvr_probe. By doing this, it created a dependency to the pci
> > driver that must have CONFIG_HAVE_CLK to be turned on. Besides, I
> would need you guys to provide me information on other platforms about
> what is the best value to set? Can I just set to zero since the stmmac_pci
> driver is always using the priv->plat->clk_csr?
> >

^ permalink raw reply

* [PATCH net-next] tcp: use tcp_flags in tcp_data_queue()
From: Weiping Pan @ 2014-09-24 10:35 UTC (permalink / raw)
  To: netdev; +Cc: edumazet

Follow the idea in commit e11ecddf5128 (tcp: use TCP_SKB_CB(skb)->tcp_flags in
input path), we can use tcp_flags to avoid cache miss.

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 net/ipv4/tcp_input.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 13f3da4..85298c9 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4392,7 +4392,7 @@ queue_and_out:
 		tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
 		if (skb->len)
 			tcp_event_data_recv(sk, skb);
-		if (th->fin)
+		if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
 			tcp_fin(sk);
 
 		if (!skb_queue_empty(&tp->out_of_order_queue)) {
-- 
1.7.4

^ permalink raw reply related

* Re: [PATCH] usb: gadget: f_rndis: fix usb_interface_descriptor for rndis
From: Michal Nazarewicz @ 2014-09-24  9:38 UTC (permalink / raw)
  To: Heiko Schocher, linux-usb
  Cc: Heiko Schocher, Felipe Balbi, Greg Kroah-Hartman, linux-kernel,
	Oliver Neukum, netdev, linux-api, Andrzej Pietrasiewicz,
	Kyungmin Park, Dan Carpenter, Macpaul Lin
In-Reply-To: <1411541339-32400-1-git-send-email-hs@denx.de>

On Wed, Sep 24 2014, Heiko Schocher <hs@denx.de> wrote:
> use the values for RNDIS over Ethernet as defined in
> http://www.usb.org/developers/defined_class
> (search for RDNIS):
>
> - baseclass: 0xef (miscellaneous)
> - subclass: 0x04
> - protocol: 0x01
>
> with this setings the file in Documentation/usb/linux.inf is
> obsolete.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
>
> ---
>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: Oliver Neukum <oliver@neukum.name>
> Cc: netdev@vger.kernel.org
> Cc: linux-api@vger.kernel.org
> Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
> Cc: Michal Nazarewicz <mina86@mina86.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Macpaul Lin <macpaul@gmail.com>
>
> Tested with the "USB Compliance test suite which runs Windows", see:
> http://www.usb.org/developers/tools/usb20_tools/#usb20cv
>
>  drivers/net/usb/cdc_ether.c           | 6 +++---
>  drivers/usb/core/generic.c            | 6 +++---
>  drivers/usb/gadget/function/f_rndis.c | 6 +++---
>  include/uapi/linux/usb/cdc.h          | 3 +++
>  4 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
> index 2a32d91..9c216c2 100644
> --- a/drivers/net/usb/cdc_ether.c
> +++ b/drivers/net/usb/cdc_ether.c
> @@ -35,9 +35,9 @@
>  
>  static int is_rndis(struct usb_interface_descriptor *desc)
>  {
> -	return (desc->bInterfaceClass == USB_CLASS_COMM &&
> -		desc->bInterfaceSubClass == 2 &&
> -		desc->bInterfaceProtocol == 0xff);
> +	return (desc->bInterfaceClass == USB_CLASS_MISC &&
> +		desc->bInterfaceSubClass == USB_CDC_SUBCLASS_RNDIS &&
> +		desc->bInterfaceProtocol == USB_CDC_RNDIS_PROTO_ETH);
>  }

Does that mean that new kernels will stop working with old RNDIs
gadgets because they stop recognising them as RNDIS?  I feel like this
function should accept both, i.e.:

	return (desc->bInterfaceClass == USB_CLASS_COMM &&
		desc->bInterfaceSubClass == 2 &&
		desc->bInterfaceProtocol == 0xff) ||
	       (desc->bInterfaceClass == USB_CLASS_MISC &&
		desc->bInterfaceSubClass == USB_CDC_SUBCLASS_RNDIS &&
		desc->bInterfaceProtocol == USB_CDC_RNDIS_PROTO_ETH);

>  
>  static int is_activesync(struct usb_interface_descriptor *desc)
> diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
> index 358ca8d..a2a4e05 100644
> --- a/drivers/usb/core/generic.c
> +++ b/drivers/usb/core/generic.c
> @@ -28,9 +28,9 @@ static inline const char *plural(int n)
>  
>  static int is_rndis(struct usb_interface_descriptor *desc)
>  {
> -	return desc->bInterfaceClass == USB_CLASS_COMM
> -		&& desc->bInterfaceSubClass == 2
> -		&& desc->bInterfaceProtocol == 0xff;
> +	return desc->bInterfaceClass == USB_CLASS_MISC
> +		&& desc->bInterfaceSubClass == USB_CDC_SUBCLASS_RNDIS
> +		&& desc->bInterfaceProtocol == USB_CDC_RNDIS_PROTO_ETH;
>  }

Ditto.

>  
>  static int is_activesync(struct usb_interface_descriptor *desc)
> diff --git a/drivers/usb/gadget/function/f_rndis.c b/drivers/usb/gadget/function/f_rndis.c
> index ddb09dc..cc06046 100644
> --- a/drivers/usb/gadget/function/f_rndis.c
> +++ b/drivers/usb/gadget/function/f_rndis.c
> @@ -117,9 +117,9 @@ static struct usb_interface_descriptor rndis_control_intf = {
>  	/* .bInterfaceNumber = DYNAMIC */
>  	/* status endpoint is optional; this could be patched later */
>  	.bNumEndpoints =	1,
> -	.bInterfaceClass =	USB_CLASS_COMM,
> -	.bInterfaceSubClass =   USB_CDC_SUBCLASS_ACM,
> -	.bInterfaceProtocol =   USB_CDC_ACM_PROTO_VENDOR,
> +	.bInterfaceClass =	USB_CLASS_MISC,
> +	.bInterfaceSubClass =   USB_CDC_SUBCLASS_RNDIS,
> +	.bInterfaceProtocol =   USB_CDC_RNDIS_PROTO_ETH,
>  	/* .iInterface = DYNAMIC */
>  };
>  
> diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h
> index b6a9cdd..8e8fc85 100644
> --- a/include/uapi/linux/usb/cdc.h
> +++ b/include/uapi/linux/usb/cdc.h
> @@ -12,6 +12,7 @@
>  #include <linux/types.h>
>  
>  #define USB_CDC_SUBCLASS_ACM			0x02
> +#define USB_CDC_SUBCLASS_RNDIS			0x04
>  #define USB_CDC_SUBCLASS_ETHERNET		0x06
>  #define USB_CDC_SUBCLASS_WHCM			0x08
>  #define USB_CDC_SUBCLASS_DMM			0x09
> @@ -31,6 +32,8 @@
>  #define USB_CDC_ACM_PROTO_AT_CDMA		6
>  #define USB_CDC_ACM_PROTO_VENDOR		0xff
>  
> +#define USB_CDC_RNDIS_PROTO_ETH			1
> +
>  #define USB_CDC_PROTO_EEM			7
>  
>  #define USB_CDC_NCM_PROTO_NTB			1

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

^ permalink raw reply

* Re: [PATCH v1 3/5] dtb: Add 10GbE node to APM X-Gene SoC device tree
From: Mark Rutland @ 2014-09-24  9:37 UTC (permalink / raw)
  To: Iyappan Subramanian
  Cc: davem@davemloft.net, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, kchudgar@apm.com, patches@apm.com
In-Reply-To: <1411530688-2939-4-git-send-email-isubramanian@apm.com>

Hi,

For some reason, the below appears to use a mixture of spaces and tabs
for alignment. Assuming my local mailserver isn't responsible for that,
could you please correct that and for consistency use tabs?

Could you also please Cc the arm64 maintainers when submitting arm64
patches?

On Wed, Sep 24, 2014 at 04:51:26AM +0100, Iyappan Subramanian wrote:
> Added 10GbE interface and clock nodes.
> 
> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
> ---
>  arch/arm64/boot/dts/apm-mustang.dts |  4 ++++
>  arch/arm64/boot/dts/apm-storm.dtsi  | 24 ++++++++++++++++++++++++
>  2 files changed, 28 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/apm-mustang.dts b/arch/arm64/boot/dts/apm-mustang.dts
> index b2f5622..2ae782b 100644
> --- a/arch/arm64/boot/dts/apm-mustang.dts
> +++ b/arch/arm64/boot/dts/apm-mustang.dts
> @@ -32,3 +32,7 @@
>  &menet {
>  	status = "ok";
>  };
> +
> +&xgenet {
> +	status = "ok";
> +};
> diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi
> index c0aceef..ae814ef 100644
> --- a/arch/arm64/boot/dts/apm-storm.dtsi
> +++ b/arch/arm64/boot/dts/apm-storm.dtsi
> @@ -176,6 +176,16 @@
>  				clock-output-names = "menetclk";
>  			};
>  
> +                        xge0clk: xge0clk@1f61c000 {
> +				compatible = "apm,xgene-device-clock";
> +				#clock-cells = <1>;
> +				clocks = <&socplldiv2 0>;
> +				reg = <0x0 0x1f61c000 0x0 0x1000>;
> +				reg-names = "csr-reg";
> +				csr-mask = <0x3>;
> +				clock-output-names = "xge0clk";
> +                        };
> +
>  			sataphy1clk: sataphy1clk@1f21c000 {
>  				compatible = "apm,xgene-device-clock";
>  				#clock-cells = <1>;
> @@ -421,5 +431,19 @@
>  
>  			};
>  		};
> +
> +                xgenet: ethernet@1f610000 {
> +			compatible = "apm,xgene-enet";
> +                        status = "disabled";
> +                        reg = <0x0 0x1f610000 0x0 0xd100>,
> +                              <0x0 0x1f600000 0x0 0X400>,
> +                              <0x0 0x18000000 0x0 0X200>;
> +			reg-names = "enet_csr", "ring_csr", "ring_cmd";
> +                        interrupts = <0x0 0x60 0x4>;
> +			dma-coherent;
> +                        clocks = <&xge0clk 0>;

> +                        local-mac-address = [00 01 73 00 00 04];

Does it really make sense to hard-code the same mac address for all
mustang boards?

Mark.

> +			phy-connection-type = "xgmii";
> +                };
>  	};
>  };
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" 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: [RFC PATCH net-next v2 0/5] netns: allow to identify peer netns
From: Nicolas Dichtel @ 2014-09-24  9:31 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Network Development, Linux Containers,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Stephen Hemminger, Eric W. Biederman, Linux API, Andrew Morton,
	David S. Miller
In-Reply-To: <CALCETrWnZtWstBviDxcHpLpjHF3R+sgS48RYf2pbKBYeExZVOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Le 23/09/2014 21:26, Andy Lutomirski a écrit :
> On Tue, Sep 23, 2014 at 6:20 AM, Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
>> The goal of this serie is to be able to multicast netlink messages with an
>> attribute that identify a peer netns.
>> This is needed by the userland to interpret some informations contained in
>> netlink messages (like IFLA_LINK value, but also some other attributes in case
>> of x-netns netdevice (see also
>> http://thread.gmane.org/gmane.linux.network/315933/focus=316064 and
>> http://thread.gmane.org/gmane.linux.kernel.containers/28301/focus=4239)).
>>
>> Ids are stored in the parent user namespace. These ids are valid only inside
>> this user namespace. The user can retrieve these ids via a new netlink messages,
>> but only if peer netns are in the same user namespace.
>
> What about the parent / ancestors of the owning userns?  Can processes
> in those usernses see any form of netns id?
With this serie no. I'm not sure if ancestors really needs to be able to
get these ids. What is your opinion?
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/containers

^ permalink raw reply

* Re: [RFC PATCH net-next v2 0/5] netns: allow to identify peer netns
From: Nicolas Dichtel @ 2014-09-24  9:23 UTC (permalink / raw)
  To: Cong Wang
  Cc: netdev, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andy Lutomirski, Stephen Hemminger, Eric W. Biederman,
	linux-api-u79uwXL29TY76Z2rM5mHXA, Andrew Morton, David Miller
In-Reply-To: <CAHA+R7NnBJ=T3sukzzp-OD2am1nd318XbrXCX84LfSL=nu9ojw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Le 23/09/2014 21:22, Cong Wang a écrit :
> On Tue, Sep 23, 2014 at 6:20 AM, Nicolas Dichtel
> <nicolas.dichtel@6wind.com> wrote:
>>
>> Here is a small screenshot to show how it can be used by userland:
>> $ ip netns add foo
>> $ ip netns del foo
>> $ ip netns
>> $ touch /var/run/netns/init_net
>> $ mount --bind /proc/1/ns/net /var/run/netns/init_net
>> $ ip netns add foo
>> $ ip netns
>> foo (id: 3)
>> init_net (id: 1)
>> $ ip netns exec foo ip netns
>> foo (id: 3)
>> init_net (id: 1)
>> $ ip netns exec foo ip link add ipip1 link-netnsid 1 type ipip remote 10.16.0.121 local 10.16.0.249
>> $ ip netns exec foo ip l ls ipip1
>> 6: ipip1@NONE: <POINTOPOINT,NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default
>>      link/ipip 10.16.0.249 peer 10.16.0.121 link-netnsid 1
>>
>> The parameter link-netnsid shows us where the interface sends and receives
>> packets (and thus we know where encapsulated addresses are set).
>>
>
> So ipip1 is shown in netns foo but functioning in netns init_net? Getting the
> id of init_net in foo depends on your mount namespace, /var/run/netns/ may
> not visible inside foo, in this case, link-netnsid is meaningless. It
> is not your
> fault, network namespace already heavily relies on mount namespace (sysfs
> needs to be remount otherwise you can not create device with the same name.)
>
> On the other hand, what's the problem you are trying to solve? AFAIK,
> the ifindex
> issue is purely in output, IOW, the device still functions correctly
> even through
> its link ifindex is not correct after moving to another namespace. If
> not, it is bug
> we need to fix.
>
The problem is explained here:
http://thread.gmane.org/gmane.linux.network/315933/focus=316064
and here:
http://thread.gmane.org/gmane.linux.kernel.containers/28301/focus=4239


Regards,
Nicolas
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/containers

^ permalink raw reply

* [PATCH net] ip6gre: add a rtnl link alias for ip6gretap
From: Nicolas Dichtel @ 2014-09-24  9:03 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel

With this alias, we don't need to load manually the module before adding an
ip6gretap interface with iproute2.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/ip6_gre.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 5f19dfbc4c6a..d172ec4ec9d3 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1724,4 +1724,5 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("D. Kozlov (xeb@mail.ru)");
 MODULE_DESCRIPTION("GRE over IPv6 tunneling device");
 MODULE_ALIAS_RTNL_LINK("ip6gre");
+MODULE_ALIAS_RTNL_LINK("ip6gretap");
 MODULE_ALIAS_NETDEV("ip6gre0");
-- 
2.1.0

^ permalink raw reply related

* Re: [PATCH v2] et131x: Promote staging et131x driver to drivers/net
From: Mark Einon @ 2014-09-24  9:00 UTC (permalink / raw)
  To: Joe Perches; +Cc: devel, angus, gregkh, linux-kernel, netdev, davem
In-Reply-To: <1411506437.29268.13.camel@joe-AO725>

On Tue, Sep 23, 2014 at 02:07:17PM -0700, Joe Perches wrote:
> On Tue, 2014-09-23 at 21:05 +0100, Mark Einon wrote:
> > This patch moves the et131x gigabit ethernet driver from drivers/staging
> > to drivers/net/ethernet/agere.
> 
> checkpatch type modification you might consider:
> 
> Reduce logging line count by consolidating repeated dev_warn
> Use ether_addr_copy
> Line wrapping for 80 columns
> Remove unnecessary parentheses
> Remove unnecessary OOM message

Considered and done, thanks.

Mark

^ permalink raw reply

* [PATCH 4/4] staging: et131x: Remove unnecessary parentheses
From: Mark Einon @ 2014-09-24  8:54 UTC (permalink / raw)
  To: gregkh; +Cc: devel, angus, netdev, linux-kernel, joe, Mark Einon, davem
In-Reply-To: <1411548882-10639-1-git-send-email-mark.einon@gmail.com>

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
 drivers/staging/et131x/et131x.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index cd90831..0a927d2 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -2634,7 +2634,7 @@ static int nic_send_packet(struct et131x_adapter *adapter, struct tcb *tcb)
 				desc[frag].len_vlan = skb_headlen(skb) / 2;
 				dma_addr = dma_map_single(&adapter->pdev->dev,
 							  skb->data,
-							  (skb_headlen(skb) / 2),
+							  skb_headlen(skb) / 2,
 							  DMA_TO_DEVICE);
 				desc[frag].addr_lo = lower_32_bits(dma_addr);
 				desc[frag].addr_hi = upper_32_bits(dma_addr);
@@ -2643,8 +2643,8 @@ static int nic_send_packet(struct et131x_adapter *adapter, struct tcb *tcb)
 				desc[frag].len_vlan = skb_headlen(skb) / 2;
 				dma_addr = dma_map_single(&adapter->pdev->dev,
 							  skb->data +
-							  (skb_headlen(skb) / 2),
-							  (skb_headlen(skb) / 2),
+							  skb_headlen(skb) / 2,
+							  skb_headlen(skb) / 2,
 							  DMA_TO_DEVICE);
 				desc[frag].addr_lo = lower_32_bits(dma_addr);
 				desc[frag].addr_hi = upper_32_bits(dma_addr);
-- 
1.7.10.4

^ permalink raw reply related


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