Netdev List
 help / color / mirror / Atom feed
* [patch 5/5] obsolete config in kernel source: HSO_AUTOPM
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, akpm, siccegge

From: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>

CONFIG_HSO_AUTOPM is set by KConfig / set in the Kernel source, makefiles
and won't be ever set this way, therefor simply removing the protected
code.

Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/net/usb/hso.c |    3 ---
 1 file changed, 3 deletions(-)

diff -puN drivers/net/usb/hso.c~obsolete-config-in-kernel-source-hso_autopm drivers/net/usb/hso.c
--- a/drivers/net/usb/hso.c~obsolete-config-in-kernel-source-hso_autopm
+++ a/drivers/net/usb/hso.c
@@ -1155,9 +1155,6 @@ static void _hso_serial_set_termios(stru
 static void hso_resubmit_rx_bulk_urb(struct hso_serial *serial, struct urb *urb)
 {
 	int result;
-#ifdef CONFIG_HSO_AUTOPM
-	usb_mark_last_busy(urb->dev);
-#endif
 	/* We are done with this URB, resubmit it. Prep the USB to wait for
 	 * another frame */
 	usb_fill_bulk_urb(urb, serial->parent->usb,
_

^ permalink raw reply

* [patch 4/5] obsolete config in kernel source: USE_INTERNAL_TIMER
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, akpm, siccegge, roel.kluin

From: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>

CONFIG_USE_INTERNAL_TIMER seems to be the remainings of some experiment. 
It is explicitely #undef-ed as not working, only referenced from one
source file and rather aged.

Hereby cleaning it from the kernel tree.

Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Acked-by: Roel Kluin <roel.kluin@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/net/irda/w83977af_ir.c |   36 -------------------------------
 1 file changed, 36 deletions(-)

diff -puN drivers/net/irda/w83977af_ir.c~obsolete-config-in-kernel-source-use_internal_timer drivers/net/irda/w83977af_ir.c
--- a/drivers/net/irda/w83977af_ir.c~obsolete-config-in-kernel-source-use_internal_timer
+++ a/drivers/net/irda/w83977af_ir.c
@@ -65,7 +65,6 @@
 #undef  CONFIG_NETWINDER_TX_DMA_PROBLEMS /* Not needed */
 #define CONFIG_NETWINDER_RX_DMA_PROBLEMS /* Must have this one! */
 #endif
-#undef  CONFIG_USE_INTERNAL_TIMER  /* Just cannot make that timer work */
 #define CONFIG_USE_W977_PNP        /* Currently needed */
 #define PIO_MAX_SPEED       115200 
 
@@ -533,25 +532,6 @@ static netdev_tx_t w83977af_hard_xmit(st
 		self->tx_buff.len = skb->len;
 		
 		mtt = irda_get_mtt(skb);
-#ifdef CONFIG_USE_INTERNAL_TIMER
-	        if (mtt > 50) {
-			/* Adjust for timer resolution */
-			mtt /= 1000+1;
-
-			/* Setup timer */
-			switch_bank(iobase, SET4);
-			outb(mtt & 0xff, iobase+TMRL);
-			outb((mtt >> 8) & 0x0f, iobase+TMRH);
-			
-			/* Start timer */
-			outb(IR_MSL_EN_TMR, iobase+IR_MSL);
-			self->io.direction = IO_XMIT;
-			
-			/* Enable timer interrupt */
-			switch_bank(iobase, SET0);
-			outb(ICR_ETMRI, iobase+ICR);
-		} else {
-#endif
 			IRDA_DEBUG(4, "%s(%ld), mtt=%d\n", __func__ , jiffies, mtt);
 			if (mtt)
 				udelay(mtt);
@@ -560,9 +540,6 @@ static netdev_tx_t w83977af_hard_xmit(st
 			switch_bank(iobase, SET0);
 	 		outb(ICR_EDMAI, iobase+ICR);
 	     		w83977af_dma_write(self, iobase);
-#ifdef CONFIG_USE_INTERNAL_TIMER
-		}
-#endif
 	} else {
 		self->tx_buff.data = self->tx_buff.head;
 		self->tx_buff.len = async_wrap_skb(skb, self->tx_buff.data, 
@@ -876,20 +853,7 @@ static int w83977af_dma_receive_complete
 			/* Check if we have transferred all data to memory */
 			switch_bank(iobase, SET0);
 			if (inb(iobase+USR) & USR_RDR) {
-#ifdef CONFIG_USE_INTERNAL_TIMER
-				/* Put this entry back in fifo */
-				st_fifo->head--;
-				st_fifo->len++;
-				st_fifo->entries[st_fifo->head].status = status;
-				st_fifo->entries[st_fifo->head].len = len;
-				
-				/* Restore set register */
-				outb(set, iobase+SSR);
-			
-				return FALSE; 	/* I'll be back! */
-#else
 				udelay(80); /* Should be enough!? */
-#endif
 			}
 						
 			skb = dev_alloc_skb(len+1);
_

^ permalink raw reply

* [patch 3/5] LL TEMAC driver: add non-Virtex 5 support
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, akpm, jtyner, afleming, grant.likely

From: John Tyner <jtyner@cs.ucr.edu>

Add support for using the LL TEMAC Ethernet driver on non-Virtex 5
platforms by adding support for accessing the Soft DMA registers as if
they were memory mapped instead of solely through the DCR's (available on
the Virtex 5).

Signed-off-by: John Tyner <jtyner@cs.ucr.edu>
Cc: Andy Fleming <afleming@freescale.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/net/ll_temac.h      |    1 +
 drivers/net/ll_temac_main.c |   31 ++++++++++++++++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff -puN drivers/net/ll_temac.h~ll-temac-driver-add-non-virtex-5-support drivers/net/ll_temac.h
--- a/drivers/net/ll_temac.h~ll-temac-driver-add-non-virtex-5-support
+++ a/drivers/net/ll_temac.h
@@ -338,6 +338,7 @@ struct temac_local {
 	/* IO registers and IRQs */
 	void __iomem *regs;
 	dcr_host_t sdma_dcrs;
+	u32 __iomem *sdma_regs;
 	int tx_irq;
 	int rx_irq;
 	int emac_num;
diff -puN drivers/net/ll_temac_main.c~ll-temac-driver-add-non-virtex-5-support drivers/net/ll_temac_main.c
--- a/drivers/net/ll_temac_main.c~ll-temac-driver-add-non-virtex-5-support
+++ a/drivers/net/ll_temac_main.c
@@ -20,9 +20,6 @@
  *   or rx, so this should be okay.
  *
  * TODO:
- * - Fix driver to work on more than just Virtex5.  Right now the driver
- *   assumes that the locallink DMA registers are accessed via DCR
- *   instructions.
  * - Factor out locallink DMA code into separate driver
  * - Fix multicast assignment.
  * - Fix support for hardware checksumming.
@@ -117,12 +114,20 @@ void temac_indirect_out32(struct temac_l
 
 static u32 temac_dma_in32(struct temac_local *lp, int reg)
 {
-	return dcr_read(lp->sdma_dcrs, reg);
+	if (lp->sdma_regs) {
+		return __raw_readl(lp->sdma_regs + reg);
+	} else {
+		return dcr_read(lp->sdma_dcrs, reg);
+	}
 }
 
 static void temac_dma_out32(struct temac_local *lp, int reg, u32 value)
 {
-	dcr_write(lp->sdma_dcrs, reg, value);
+	if (lp->sdma_regs) {
+		__raw_writel(value, lp->sdma_regs + reg);
+	} else {
+		dcr_write(lp->sdma_dcrs, reg, value);
+	}
 }
 
 /**
@@ -870,13 +875,17 @@ temac_of_probe(struct of_device *op, con
 		goto nodev;
 	}
 
-	dcrs = dcr_resource_start(np, 0);
-	if (dcrs == 0) {
-		dev_err(&op->dev, "could not get DMA register address\n");
+	lp->sdma_regs = NULL;
+
+	if ((dcrs = dcr_resource_start(np, 0)) != 0) {
+		lp->sdma_dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
+		dev_dbg(&op->dev, "DCR base: %x\n", dcrs);
+	} else if ((lp->sdma_regs = of_iomap(np, 0))) {
+		dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs);
+	} else {
+		dev_err(&op->dev, "unable to map DMA registers\n");
 		goto nodev;
 	}
-	lp->sdma_dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
-	dev_dbg(&op->dev, "DCR base: %x\n", dcrs);
 
 	lp->rx_irq = irq_of_parse_and_map(np, 0);
 	lp->tx_irq = irq_of_parse_and_map(np, 1);
@@ -903,7 +912,7 @@ temac_of_probe(struct of_device *op, con
 
 	lp->phy_node = of_parse_phandle(op->node, "phy-handle", 0);
 	if (lp->phy_node)
-		dev_dbg(lp->dev, "using PHY node %s (%p)\n", np->full_name, np);
+		dev_dbg(lp->dev, "using PHY node %s (%p)\n", lp->phy_node->full_name, lp->phy_node);
 
 	/* Add the device attributes */
 	rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group);
_

^ permalink raw reply

* [patch 1/5] phonet: use for_each_set_bit()
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, akpm, akinobu.mita

From: Akinobu Mita <akinobu.mita@gmail.com>

Replace open-coded loop with for_each_set_bit().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 net/phonet/pn_dev.c     |    3 +--
 net/phonet/pn_netlink.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff -puN net/phonet/pn_dev.c~phonet-use-for_each_set_bit net/phonet/pn_dev.c
--- a/net/phonet/pn_dev.c~phonet-use-for_each_set_bit
+++ a/net/phonet/pn_dev.c
@@ -107,8 +107,7 @@ static void phonet_device_destroy(struct
 	if (pnd) {
 		u8 addr;
 
-		for (addr = find_first_bit(pnd->addrs, 64); addr < 64;
-			addr = find_next_bit(pnd->addrs, 64, 1+addr))
+		for_each_set_bit(addr, pnd->addrs, 64)
 			phonet_address_notify(RTM_DELADDR, dev, addr);
 		kfree(pnd);
 	}
diff -puN net/phonet/pn_netlink.c~phonet-use-for_each_set_bit net/phonet/pn_netlink.c
--- a/net/phonet/pn_netlink.c~phonet-use-for_each_set_bit
+++ a/net/phonet/pn_netlink.c
@@ -141,8 +141,7 @@ static int getaddr_dumpit(struct sk_buff
 			continue;
 
 		addr_idx = 0;
-		for (addr = find_first_bit(pnd->addrs, 64); addr < 64;
-			addr = find_next_bit(pnd->addrs, 64, 1+addr)) {
+		for_each_set_bit(addr, pnd->addrs, 64) {
 			if (addr_idx++ < addr_start_idx)
 				continue;
 
_

^ permalink raw reply

* [patch 3/3] i4l: change magic numbers in Eicon DIVA ISDN driver to symbolic names
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
  To: isdn; +Cc: netdev, akpm, imunsie, mac, sgayda2

From: Ian Munsie <imunsie@au.ibm.com>

Replace references to the '20' magic number found throughout the Eicon
ISDN driver for the length of the station_id field in the T30_INFO struct
with the T30_MAX_STATION_ID_LENGTH symbolic constant.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
Cc: Armin Schindler <mac@melware.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/isdn/hardware/eicon/message.c |   32 ++++++++++++------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff -puN drivers/isdn/hardware/eicon/message.c~i4l-change-magic-numbers-in-eicon-diva-isdn-driver-to-symbolic-names drivers/isdn/hardware/eicon/message.c
--- a/drivers/isdn/hardware/eicon/message.c~i4l-change-magic-numbers-in-eicon-diva-isdn-driver-to-symbolic-names
+++ a/drivers/isdn/hardware/eicon/message.c
@@ -2754,7 +2754,7 @@ static byte connect_b3_req(dword Id, wor
                     for (i = 0; i < w; i++)
                       ((T30_INFO   *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i];
                     ((T30_INFO   *)(plci->fax_connect_info_buffer))->head_line_len = 0;
-                    len = offsetof(T30_INFO, station_id) + 20;
+                    len = offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH;
                     w = fax_parms[5].length;
                     if (w > 20)
                       w = 20;
@@ -2892,7 +2892,7 @@ static byte connect_b3_res(dword Id, wor
     && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF)
     && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP))
    {
-            len = offsetof(T30_INFO, station_id) + 20;
+            len = offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH;
             if (plci->fax_connect_info_length < len)
             {
               ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
@@ -3802,7 +3802,7 @@ static byte manufacturer_res(dword Id, w
       break;
     }
     ncpi = &m_parms[1];
-    len = offsetof(T30_INFO, station_id) + 20;
+    len = offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH;
     if (plci->fax_connect_info_length < len)
     {
       ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
@@ -6830,7 +6830,7 @@ static void nl_ind(PLCI *plci)
         if(((T30_INFO   *)plci->NL.RBuffer->P)->station_id_len)
         {
           plci->ncpi_buffer[len] = 20;
-          for (i = 0; i < 20; i++)
+          for (i = 0; i < T30_MAX_STATION_ID_LENGTH; i++)
             plci->ncpi_buffer[++len] = ((T30_INFO   *)plci->NL.RBuffer->P)->station_id[i];
         }
         if (((plci->NL.Ind & 0x0f) == N_DISC) || ((plci->NL.Ind & 0x0f) == N_DISC_ACK))
@@ -6844,7 +6844,7 @@ static void nl_ind(PLCI *plci)
         if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1])
           & ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD)))
         {
-          i = offsetof(T30_INFO, station_id) + 20 + ((T30_INFO   *)plci->NL.RBuffer->P)->head_line_len;
+          i = offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + ((T30_INFO   *)plci->NL.RBuffer->P)->head_line_len;
           while (i < plci->NL.RBuffer->length)
             plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++];
         }
@@ -8400,7 +8400,7 @@ static word add_b23(PLCI *plci, API_PARS
         }
       }
       /* copy station id to NLC */
-      for(i=0; i<20; i++)
+      for(i=0; i < T30_MAX_STATION_ID_LENGTH; i++)
       {
         if(i<b3_config_parms[2].length)
         {
@@ -8411,29 +8411,29 @@ static word add_b23(PLCI *plci, API_PARS
           ((T30_INFO *)&nlc[1])->station_id[i] = ' ';
         }
       }
-      ((T30_INFO *)&nlc[1])->station_id_len = 20;
+      ((T30_INFO *)&nlc[1])->station_id_len = T30_MAX_STATION_ID_LENGTH;
       /* copy head line to NLC */
       if(b3_config_parms[3].length)
       {
 
-        pos = (byte)(fax_head_line_time (&(((T30_INFO *)&nlc[1])->station_id[20])));
+        pos = (byte)(fax_head_line_time (&(((T30_INFO *)&nlc[1])->station_id[T30_MAX_STATION_ID_LENGTH])));
         if (pos != 0)
         {
           if (CAPI_MAX_DATE_TIME_LENGTH + 2 + b3_config_parms[3].length > CAPI_MAX_HEAD_LINE_SPACE)
             pos = 0;
           else
           {
-            nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
-            nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
+            nlc[1 + offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + pos++] = ' ';
+            nlc[1 + offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + pos++] = ' ';
             len = (byte)b3_config_parms[2].length;
             if (len > 20)
               len = 20;
             if (CAPI_MAX_DATE_TIME_LENGTH + 2 + len + 2 + b3_config_parms[3].length <= CAPI_MAX_HEAD_LINE_SPACE)
             {
               for (i = 0; i < len; i++)
-                nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ((byte   *)b3_config_parms[2].info)[1+i];
-              nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
-              nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
+                nlc[1 + offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + pos++] = ((byte   *)b3_config_parms[2].info)[1+i];
+              nlc[1 + offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + pos++] = ' ';
+              nlc[1 + offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + pos++] = ' ';
             }
           }
         }
@@ -8444,7 +8444,7 @@ static word add_b23(PLCI *plci, API_PARS
         ((T30_INFO *)&nlc[1])->head_line_len = (byte)(pos + len);
         nlc[0] += (byte)(pos + len);
         for (i = 0; i < len; i++)
-          nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] =  ((byte   *)b3_config_parms[3].info)[1+i];
+          nlc[1 + offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH + pos++] =  ((byte   *)b3_config_parms[3].info)[1+i];
       } else
         ((T30_INFO *)&nlc[1])->head_line_len = 0;
 
@@ -8472,7 +8472,7 @@ static word add_b23(PLCI *plci, API_PARS
             fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING;
           }
             len = nlc[0];
-          pos = offsetof(T30_INFO, station_id) + 20;
+          pos = offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH;
    if (pos < plci->fax_connect_info_length)
    {
      for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--)
@@ -8524,7 +8524,7 @@ static word add_b23(PLCI *plci, API_PARS
       }
 
       PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits);
-      len = offsetof(T30_INFO, station_id) + 20;
+      len = offsetof(T30_INFO, station_id) + T30_MAX_STATION_ID_LENGTH;
       for (i = 0; i < len; i++)
         plci->fax_connect_info_buffer[i] = nlc[1+i];
       ((T30_INFO   *) plci->fax_connect_info_buffer)->head_line_len = 0;
_

^ permalink raw reply

* [patch 2/3] i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
  To: isdn; +Cc: netdev, akpm, imunsie, mac, sgayda2

From: Ian Munsie <imunsie@au.ibm.com>

When compiling this driver, the compiler throws the following warnings:

drivers/isdn/hardware/eicon/message.c:8426: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8427: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8434: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8435: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8436: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8447: warning: array subscript is above array bounds

This arises from the particular semantics the driver is using to write to
the nlc array (static byte[256]).  The array has a length in byte 0
followed by a T30_INFO struct starting at byte 1.

The T30_INFO struct has a number of variable length strings after the
station_id entry, which cannot be explicitly defined in the struct and the
driver accesses them with an array index to station_id beyond the length
of station_id.

This patch merely changes the semantics that the driver uses to access the
entries after the station_id entry to use the original 256 byte nlc array
taking the offset and length of the station_id entry to calculate where to
write in the array, thereby silencing the warning.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
Cc: Armin Schindler <mac@melware.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/isdn/hardware/eicon/message.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff -puN drivers/isdn/hardware/eicon/message.c~i4l-silence-compiler-warnings-for-array-access-in-eicon-diva-isdn-driver drivers/isdn/hardware/eicon/message.c
--- a/drivers/isdn/hardware/eicon/message.c~i4l-silence-compiler-warnings-for-array-access-in-eicon-diva-isdn-driver
+++ a/drivers/isdn/hardware/eicon/message.c
@@ -8423,17 +8423,17 @@ static word add_b23(PLCI *plci, API_PARS
             pos = 0;
           else
           {
-            ((T30_INFO *)&nlc[1])->station_id[20 + pos++] = ' ';
-            ((T30_INFO *)&nlc[1])->station_id[20 + pos++] = ' ';
+            nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
+            nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
             len = (byte)b3_config_parms[2].length;
             if (len > 20)
               len = 20;
             if (CAPI_MAX_DATE_TIME_LENGTH + 2 + len + 2 + b3_config_parms[3].length <= CAPI_MAX_HEAD_LINE_SPACE)
             {
               for (i = 0; i < len; i++)
-                ((T30_INFO *)&nlc[1])->station_id[20 + pos++] = ((byte   *)b3_config_parms[2].info)[1+i];
-              ((T30_INFO *)&nlc[1])->station_id[20 + pos++] = ' ';
-              ((T30_INFO *)&nlc[1])->station_id[20 + pos++] = ' ';
+                nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ((byte   *)b3_config_parms[2].info)[1+i];
+              nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
+              nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] = ' ';
             }
           }
         }
@@ -8444,9 +8444,8 @@ static word add_b23(PLCI *plci, API_PARS
         ((T30_INFO *)&nlc[1])->head_line_len = (byte)(pos + len);
         nlc[0] += (byte)(pos + len);
         for (i = 0; i < len; i++)
-          ((T30_INFO *)&nlc[1])->station_id[20 + pos++] = ((byte   *)b3_config_parms[3].info)[1+i];
-        }
-      else
+          nlc[1 + offsetof(T30_INFO, station_id) + 20 + pos++] =  ((byte   *)b3_config_parms[3].info)[1+i];
+      } else
         ((T30_INFO *)&nlc[1])->head_line_len = 0;
 
       plci->nsf_control_bits = 0;
_

^ permalink raw reply

* [patch 1/3] isdn: misplaced parenthesis in pof_handle_data()
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
  To: isdn; +Cc: netdev, akpm, roel.kluin

From: Roel Kluin <roel.kluin@gmail.com>

The parenthesis was misplaced.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/isdn/hysdn/hysdn_boot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/isdn/hysdn/hysdn_boot.c~isdn-misplaced-parenthesis-in-pof_handle_data drivers/isdn/hysdn/hysdn_boot.c
--- a/drivers/isdn/hysdn/hysdn_boot.c~isdn-misplaced-parenthesis-in-pof_handle_data
+++ a/drivers/isdn/hysdn/hysdn_boot.c
@@ -143,7 +143,7 @@ pof_handle_data(hysdn_card * card, int d
 					     (boot->pof_recid == TAG_CABSDATA) ? "CABSDATA" : "ABSDATA",
 					     datlen, boot->pof_recoffset);
 
-			if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen) < 0))
+			if ((boot->last_error = card->writebootseq(card, boot->buf.BootBuf, datlen)) < 0)
 				return (boot->last_error);	/* error writing data */
 
 			if (boot->pof_recoffset + datlen >= boot->pof_reclen)
_

^ permalink raw reply

* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Stephen Hemminger @ 2010-03-11 22:04 UTC (permalink / raw)
  To: David Miller; +Cc: jengelh, netdev
In-Reply-To: <20100311.122639.258785986.davem@davemloft.net>

On Thu, 11 Mar 2010 12:26:39 -0800 (PST)
David Miller <davem@davemloft.net> wrote:

> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Thu, 11 Mar 2010 12:12:39 -0800
> 
> > On Thu, 11 Mar 2010 20:57:29 +0100
> > Jan Engelhardt <jengelh@medozas.de> wrote:
> > 
> >> `ip -s link` shows interface counters truncated to 32 bit. This is
> >> because interface statistics are transported only in 32-bit quantity
> >> to userspace. This commit adds a new IFLA_STATS64 attribute that
> >> exports them in full 64 bit.
> >> 
> >> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html
> >> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> >> 
> > 
> > What is the point since net_device_stats has only 32 bit counters.
> > The last time this came up the issue was is that is not possible
> > to atomically increment a 64 bit counter on most 32 bit platforms.
> 
> On 64-bit it has 64-bit counters, yet we only report 32-bit
> counters to userspace via netlink even in that case.

That make sense, but maybe we shouldn't send IFLA_STATS64 on
32bit platforms.


^ permalink raw reply

* Re: BNX2: Kernel crashes with 2.6.31 and 2.6.31.9
From: Brian Haley @ 2010-03-11 21:57 UTC (permalink / raw)
  To: Michael Chan
  Cc: David Miller, bonbons@linux-vserver.org, Benjamin Li,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <1268336848.9775.154.camel@nseg_linux_HP1.broadcom.com>

Michael Chan wrote:
> On Thu, 2010-03-11 at 11:40 -0800, Brian Haley wrote:
>> I can only reproduce this on one system out of many, so it's either a
>> race condition or bad hardware.  The only thing I can confirm at the
>> moment is that it's the code at the bottom of bnx2_set_coalesce()
>> that's causing it, I'm trying to go through all those codepaths now.
> 
> The NETDEV WATCHDOG is caused by stopping the TX queues with
> ->trans_start older than dev->watchdog_timeo which is set to 5 seconds
> in bnx2.  Please try this patch below to update the ->trans_start first
> before stopping the TX queues:

Well I'm an idiot.  Someone had cherry-picked commit 4529819c4 (that caused
the reset_task bnx2 crash), so it was bad code in bnx2_netif_stop()/start()
that's already been fixed upstream.  I'll merge our bnx2 code up to the
firmware commit and start testing again to see if we still see the watchdog
timeouts we've seen in the past.

Thanks for your help.

-Brian

^ permalink raw reply

* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: David Miller @ 2010-03-11 21:30 UTC (permalink / raw)
  To: jengelh; +Cc: shemminger, netdev
In-Reply-To: <alpine.LSU.2.01.1003112205360.24500@obet.zrqbmnf.qr>

From: Jan Engelhardt <jengelh@medozas.de>
Date: Thu, 11 Mar 2010 22:07:07 +0100 (CET)

> On a side note, is it perhaps possible to use jiffies-like magic to
> also have 64-bit counters on 32-bit, or is that still too expensive?

I think there might still be atomicity issues.

We've been telling people to poll periodically in userspace to avoid
these problems, but that has limitations as network speeds increase.

^ permalink raw reply

* Re: [PATCH 33/37] sound/soc: use .dev.of_node instead of .node in struct of_device
From: Grant Likely @ 2010-03-11 21:22 UTC (permalink / raw)
  To: Mark Brown
  Cc: monstr, gregkh, benh, akpm, davem, sfr, jgarzik, ben-linux, dwmw2,
	jeremy.kerr, James.Bottomley, microblaze-uclinux, linux-kernel,
	linuxppc-dev, sparclinux, linux-ide, netdev, linux-i2c,
	devicetree-discuss, linux-scsi, alsa-devel, timur, lrg
In-Reply-To: <20100311193458.GA13289@opensource.wolfsonmicro.com>

On Thu, Mar 11, 2010 at 12:34 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Thu, Mar 11, 2010 at 11:06:50AM -0700, Grant Likely wrote:
>> .node is being removed
>>
>> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> but please ensure that Liam and especially Timur also check this (both
> CCed).
>
> For enormous patch serieses like this it's really nice if you can ensure
> that each person is only CCed on the patches that they need to review.
> Much less stuff in the inbox.

Yeah, sorry about that (and to everyone receiving this thread, I'm
really sorry.  I won't do it again).  I've already been yelled at for
that.  What happened is that on a previous series I was yelled at for
not sending all patches to everyone (so that the patches could be
reviewed in context).  So, naturally, I made sure to include everyone
on the whole series this time....  doh.

Next time I post I'll constrain it to small chunks.

Thanks for the review.

g.

^ permalink raw reply

* Re: [PATCH] iproute2: detect iptables modules dir in configure.
From: Andreas Henriksson @ 2010-03-11 20:47 UTC (permalink / raw)
  To: shemminger; +Cc: netdev
In-Reply-To: <20100311190740.GA28425@amd64.fatal.se>

On tor, 2010-03-11 at 20:07 +0100, Andreas Henriksson wrote:
[...]
> --- a/tc/Makefile
> +++ b/tc/Makefile
> @@ -77,6 +77,9 @@ TCLIB += tc_estimator.o
>  TCLIB += tc_stab.o
>  
>  CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB
> +ifneq ($(IPT_LIB_DIR),)
> +	CFLAGS += -DIPT_LIB_DIR="$(IPT_LIB_DIR)"
> +endif
>  

Sorry, I missed to escape the "'s above. I'll send a v2 in a few
seconds.



-- 
Regards,
Andreas Henriksson

^ permalink raw reply

* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Jan Engelhardt @ 2010-03-11 21:07 UTC (permalink / raw)
  To: David Miller; +Cc: shemminger, netdev
In-Reply-To: <20100311.122639.258785986.davem@davemloft.net>


On Thursday 2010-03-11 21:26, David Miller wrote:
>> On Thu, 11 Mar 2010 20:57:29 +0100
>> Jan Engelhardt <jengelh@medozas.de> wrote:
>> 
>>> `ip -s link` shows interface counters truncated to 32 bit. This is
>>> because interface statistics are transported only in 32-bit quantity
>>> to userspace. This commit adds a new IFLA_STATS64 attribute that
>>> exports them in full 64 bit.
>>> 
>>> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html
>>> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
>>> 
>> 
>> What is the point since net_device_stats has only 32 bit counters.
>> The last time this came up the issue was is that is not possible
>> to atomically increment a 64 bit counter on most 32 bit platforms.
>
>On 64-bit it has 64-bit counters, yet we only report 32-bit
>counters to userspace via netlink even in that case.
>
>That's what Jan is fixing here.

On a side note, is it perhaps possible to use jiffies-like magic to
also have 64-bit counters on 32-bit, or is that still too expensive?

^ permalink raw reply

* [PATCH v2] iproute2: detect iptables modules dir in configure.
From: Andreas Henriksson @ 2010-03-11 20:54 UTC (permalink / raw)
  To: shemminger; +Cc: netdev
In-Reply-To: <20100311190740.GA28425@amd64.fatal.se>

Try to automatically detect iptables modules directory.

Make the configure script look for iptables modules.
This also makes it possible to specify it on the
command line while building via "make IPT_LIB_DIR=/foo/bar".

Signed-off-by: Andreas Henriksson <andreas@fatal.se>

---

Possibly the ifndef check in include/iptables.h
should be turned into an #error to force the person
building to manually specify it instead of just silently
using a probably incorrect path.

This is version 2 of the patch,
in v1 the escaping of the "'s in tc/Makefile was forgotten.


diff --git a/configure b/configure
index 92a0b48..600fa96 100755
--- a/configure
+++ b/configure
@@ -3,6 +3,8 @@
 #
 INCLUDE=${1:-"$PWD/include"}
 
+TABLES=
+
 check_atm()
 {
 cat >/tmp/atmtest.c <<EOF
@@ -139,9 +141,28 @@ check_ipt()
 	if ! grep TC_CONFIG_XT Config > /dev/null
 	then
 		echo "using iptables"
+		TABLES="iptables"
+	else
+		TABLES="xtables"
 	fi
 }
 
+check_ipt_lib_dir()
+{
+	IPT_LIB_DIR=""
+	for dir in /lib /usr/lib /usr/local/lib
+	do
+		for file in $dir/$TABLES/lib*t_*so ; do
+			if [ -f $file ]; then
+				echo $dir/$TABLES
+				echo "IPT_LIB_DIR:=$dir/$TABLES" >> Config
+				return
+			fi
+		done
+	done
+	echo "not found!"
+}
+
 echo "# Generated config based on" $INCLUDE >Config
 
 echo "TC schedulers"
@@ -155,3 +176,5 @@ check_xt_old
 check_xt_old_internal_h
 check_ipt
 
+echo -n "iptables modules directory: "
+check_ipt_lib_dir
diff --git a/tc/Makefile b/tc/Makefile
index 0b5d7d3..805c108 100644
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -77,6 +77,9 @@ TCLIB += tc_estimator.o
 TCLIB += tc_stab.o
 
 CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB
+ifneq ($(IPT_LIB_DIR),)
+	CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
+endif
 
 TCSO :=
 ifeq ($(TC_CONFIG_ATM),y)

^ permalink raw reply related

* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: David Miller @ 2010-03-11 20:26 UTC (permalink / raw)
  To: shemminger; +Cc: jengelh, netdev
In-Reply-To: <20100311121239.14944fd5@nehalam>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 11 Mar 2010 12:12:39 -0800

> On Thu, 11 Mar 2010 20:57:29 +0100
> Jan Engelhardt <jengelh@medozas.de> wrote:
> 
>> `ip -s link` shows interface counters truncated to 32 bit. This is
>> because interface statistics are transported only in 32-bit quantity
>> to userspace. This commit adds a new IFLA_STATS64 attribute that
>> exports them in full 64 bit.
>> 
>> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html
>> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
>> 
> 
> What is the point since net_device_stats has only 32 bit counters.
> The last time this came up the issue was is that is not possible
> to atomically increment a 64 bit counter on most 32 bit platforms.

On 64-bit it has 64-bit counters, yet we only report 32-bit
counters to userspace via netlink even in that case.

That's what Jan is fixing here.

^ permalink raw reply

* [PATCH] ip: correctly report tunnel link type
From: Jan Engelhardt @ 2010-03-11 20:22 UTC (permalink / raw)
  To: stephen.hemminger; +Cc: davem, netdev

Up until now, "tun" tunnels were displayed as link/[65534].

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 lib/ll_types.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/ll_types.c b/lib/ll_types.c
index 9d75bd2..846cdb0 100644
--- a/lib/ll_types.c
+++ b/lib/ll_types.c
@@ -125,6 +125,9 @@ __PF(IEEE80211_PRISM,ieee802.11/prism)
 #ifdef ARPHRD_IEEE80211_RADIOTAP
 __PF(IEEE80211_RADIOTAP,ieee802.11/radiotap)
 #endif
+#ifdef ARPHRD_NONE
+__PF(NONE, none)
+#endif
 #ifdef ARPHRD_VOID
 __PF(VOID,void)
 #endif
-- 
1.7.0


^ permalink raw reply related

* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Stephen Hemminger @ 2010-03-11 20:12 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: davem, netdev
In-Reply-To: <1268337450-6749-4-git-send-email-jengelh@medozas.de>

On Thu, 11 Mar 2010 20:57:29 +0100
Jan Engelhardt <jengelh@medozas.de> wrote:

> `ip -s link` shows interface counters truncated to 32 bit. This is
> because interface statistics are transported only in 32-bit quantity
> to userspace. This commit adds a new IFLA_STATS64 attribute that
> exports them in full 64 bit.
> 
> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html
> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> 

What is the point since net_device_stats has only 32 bit counters.
The last time this came up the issue was is that is not possible
to atomically increment a 64 bit counter on most 32 bit platforms.

^ permalink raw reply

* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Eric Dumazet @ 2010-03-11 20:19 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: davem, netdev
In-Reply-To: <1268337450-6749-4-git-send-email-jengelh@medozas.de>

Le jeudi 11 mars 2010 à 20:57 +0100, Jan Engelhardt a écrit :
> `ip -s link` shows interface counters truncated to 32 bit. This is
> because interface statistics are transported only in 32-bit quantity
> to userspace. This commit adds a new IFLA_STATS64 attribute that
> exports them in full 64 bit.
> 
> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html

oh oh, back to  2003 :)

> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> ---
>  
>  static inline int rtnl_vfinfo_size(const struct net_device *dev)
>  {
> @@ -698,6 +730,14 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
>  	stats = dev_get_stats(dev);

OK, stats is up2date with device stats

>  	copy_rtnl_link_stats(nla_data(attr), stats);
>  
> +	attr = nla_reserve(skb, IFLA_STATS64,
> +			sizeof(struct rtnl_link_stats64));
> +	if (attr == NULL)
> +		goto nla_put_failure;
> +
> +	stats = dev_get_stats(dev);

Why calling dev_get_stats(dev) a second time ?
Its can be pretty expensive on some devices.

> +	copy_rtnl_link_stats64(nla_data(attr), stats);
> +
>  	if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
>  		int i;
>  		struct ifla_vf_info ivi;
> -- 



^ permalink raw reply

* Re: [PATCH 1/3] net: tcp: make hybla selectable as default congestion module
From: Jan Engelhardt @ 2010-03-11 20:19 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: davem, netdev
In-Reply-To: <20100311121032.3b9213e1@nehalam>


On Thursday 2010-03-11 21:10, Stephen Hemminger wrote:
>> 
>> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
>> index 0c94a1a..731c47b 100644
>> --- a/net/ipv4/Kconfig
>> +++ b/net/ipv4/Kconfig
>> @@ -587,6 +587,9 @@ choice
>>  	config DEFAULT_HTCP
>>  		bool "Htcp" if TCP_CONG_HTCP=y
>>  
>> +	config DEFAULT_HYBLA
>> +		bool "Hybla" if TCP_CONG_HYBLA=y
>> +
>>  	config DEFAULT_VEGAS
>>  		bool "Vegas" if TCP_CONG_VEGAS=y
>>  
>> @@ -610,6 +613,7 @@ config DEFAULT_TCP_CONG
>>  	default "bic" if DEFAULT_BIC
>>  	default "cubic" if DEFAULT_CUBIC
>>  	default "htcp" if DEFAULT_HTCP
>> +	default "hybla" if DEFAULT_HYBLA
>>  	default "vegas" if DEFAULT_VEGAS
>>  	default "westwood" if DEFAULT_WESTWOOD
>>  	default "reno" if DEFAULT_RENO
>
>Hybla seems too experimental to be made default.

I run Hybla since 2006 on anything that is not connected via
wireless and I did not notice any pressing issues.

Also, the patch does not make hybla the default default (reno remains),
just the default once explicitly selected in a two-step process:

1. CONFIG_TCP_CONG_HYBLA=y
*and*
2. choosing Hybla in CONFIG_DEFAULT_TCP_CONG

I think that is enough of a "safety measure" against any potential
unsuspecting users.

^ permalink raw reply

* Re: [PATCH 1/3] net: tcp: make hybla selectable as default congestion module
From: Stephen Hemminger @ 2010-03-11 20:10 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: davem, netdev
In-Reply-To: <1268337450-6749-2-git-send-email-jengelh@medozas.de>

On Thu, 11 Mar 2010 20:57:27 +0100
Jan Engelhardt <jengelh@medozas.de> wrote:

> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
> ---
>  net/ipv4/Kconfig |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
> index 0c94a1a..731c47b 100644
> --- a/net/ipv4/Kconfig
> +++ b/net/ipv4/Kconfig
> @@ -587,6 +587,9 @@ choice
>  	config DEFAULT_HTCP
>  		bool "Htcp" if TCP_CONG_HTCP=y
>  
> +	config DEFAULT_HYBLA
> +		bool "Hybla" if TCP_CONG_HYBLA=y
> +
>  	config DEFAULT_VEGAS
>  		bool "Vegas" if TCP_CONG_VEGAS=y
>  
> @@ -610,6 +613,7 @@ config DEFAULT_TCP_CONG
>  	default "bic" if DEFAULT_BIC
>  	default "cubic" if DEFAULT_CUBIC
>  	default "htcp" if DEFAULT_HTCP
> +	default "hybla" if DEFAULT_HYBLA
>  	default "vegas" if DEFAULT_VEGAS
>  	default "westwood" if DEFAULT_WESTWOOD
>  	default "reno" if DEFAULT_RENO

Hybla seems too experimental to be made default.

^ permalink raw reply

* [PATCH] Add IFLA_STATS64 support
From: Jan Engelhardt @ 2010-03-11 20:00 UTC (permalink / raw)
  To: stephen.hemminger; +Cc: davem, netdev
In-Reply-To: <1268337635-7031-1-git-send-email-jengelh@medozas.de>

`ip -s link` shows interface counters truncated to 32 bit. This is
because interface statistics are transported only in 32-bit quantity
to userspace. This commit adds recognition for the new IFLA_STATS64
attribute that exports them in full 64 bit.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 include/linux/if_link.h |   33 ++++++++++++++++++++++++++++
 ip/ipaddress.c          |   55 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 87 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 5110b96..8772719 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -37,6 +37,38 @@ struct rtnl_link_stats {
 	__u32	tx_compressed;
 };
 
+struct rtnl_link_stats64 {
+	__u64	rx_packets;		/* total packets received	*/
+	__u64	tx_packets;		/* total packets transmitted	*/
+	__u64	rx_bytes;		/* total bytes received 	*/
+	__u64	tx_bytes;		/* total bytes transmitted	*/
+	__u64	rx_errors;		/* bad packets received		*/
+	__u64	tx_errors;		/* packet transmit problems	*/
+	__u64	rx_dropped;		/* no space in linux buffers	*/
+	__u64	tx_dropped;		/* no space available in linux	*/
+	__u64	multicast;		/* multicast packets received	*/
+	__u64	collisions;
+
+	/* detailed rx_errors: */
+	__u64	rx_length_errors;
+	__u64	rx_over_errors;		/* receiver ring buff overflow	*/
+	__u64	rx_crc_errors;		/* recved pkt with crc error	*/
+	__u64	rx_frame_errors;	/* recv'd frame alignment error */
+	__u64	rx_fifo_errors;		/* recv'r fifo overrun		*/
+	__u64	rx_missed_errors;	/* receiver missed packet	*/
+
+	/* detailed tx_errors */
+	__u64	tx_aborted_errors;
+	__u64	tx_carrier_errors;
+	__u64	tx_fifo_errors;
+	__u64	tx_heartbeat_errors;
+	__u64	tx_window_errors;
+
+	/* for cslip etc */
+	__u64	rx_compressed;
+	__u64	tx_compressed;
+};
+
 /* The struct should be in sync with struct ifmap */
 struct rtnl_link_ifmap {
 	__u64	mem_start;
@@ -83,6 +115,7 @@ enum {
 	IFLA_VF_VLAN,
 	IFLA_VF_TX_RATE,	/* TX Bandwidth Allocation */
 	IFLA_VFINFO,
+	IFLA_STATS64,
 	__IFLA_MAX
 };
 
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 48f7b1e..33fc606 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -284,7 +284,60 @@ int print_linkinfo(const struct sockaddr_nl *who,
 		fprintf(fp,"\n    alias %s", 
 			(const char *) RTA_DATA(tb[IFLA_IFALIAS]));
 
-	if (do_link && tb[IFLA_STATS] && show_stats) {
+	if (do_link && tb[IFLA_STATS64] && show_stats) {
+		struct rtnl_link_stats64 slocal;
+		struct rtnl_link_stats64 *s = RTA_DATA(tb[IFLA_STATS64]);
+		if (((unsigned long)s) & (sizeof(unsigned long)-1)) {
+			memcpy(&slocal, s, sizeof(slocal));
+			s = &slocal;
+		}
+		fprintf(fp, "%s", _SL_);
+		fprintf(fp, "    RX: bytes  packets  errors  dropped overrun mcast   %s%s",
+			s->rx_compressed ? "compressed" : "", _SL_);
+		fprintf(fp, "    %-10llu %-8llu %-7llu %-7llu %-7llu %-7llu",
+			(unsigned long long)s->rx_bytes,
+			(unsigned long long)s->rx_packets,
+			(unsigned long long)s->rx_errors,
+			(unsigned long long)s->rx_dropped,
+			(unsigned long long)s->rx_over_errors,
+			(unsigned long long)s->multicast);
+		if (s->rx_compressed)
+			fprintf(fp, " %-7llu",
+				(unsigned long long)s->rx_compressed);
+		if (show_stats > 1) {
+			fprintf(fp, "%s", _SL_);
+			fprintf(fp, "    RX errors: length  crc     frame   fifo    missed%s", _SL_);
+			fprintf(fp, "               %-7llu  %-7llu %-7llu %-7llu %-7llu",
+				(unsigned long long)s->rx_length_errors,
+				(unsigned long long)s->rx_crc_errors,
+				(unsigned long long)s->rx_frame_errors,
+				(unsigned long long)s->rx_fifo_errors,
+				(unsigned long long)s->rx_missed_errors);
+		}
+		fprintf(fp, "%s", _SL_);
+		fprintf(fp, "    TX: bytes  packets  errors  dropped carrier collsns %s%s",
+			s->tx_compressed ? "compressed" : "", _SL_);
+		fprintf(fp, "    %-10llu %-8llu %-7llu %-7llu %-7llu %-7llu",
+			(unsigned long long)s->tx_bytes,
+			(unsigned long long)s->tx_packets,
+			(unsigned long long)s->tx_errors,
+			(unsigned long long)s->tx_dropped,
+			(unsigned long long)s->tx_carrier_errors,
+			(unsigned long long)s->collisions);
+		if (s->tx_compressed)
+			fprintf(fp, " %-7llu",
+				(unsigned long long)s->tx_compressed);
+		if (show_stats > 1) {
+			fprintf(fp, "%s", _SL_);
+			fprintf(fp, "    TX errors: aborted fifo    window  heartbeat%s", _SL_);
+			fprintf(fp, "               %-7llu  %-7llu %-7llu %-7llu",
+				(unsigned long long)s->tx_aborted_errors,
+				(unsigned long long)s->tx_fifo_errors,
+				(unsigned long long)s->tx_window_errors,
+				(unsigned long long)s->tx_heartbeat_errors);
+		}
+	}
+	if (do_link && !tb[IFLA_STATS64] && tb[IFLA_STATS] && show_stats) {
 		struct rtnl_link_stats slocal;
 		struct rtnl_link_stats *s = RTA_DATA(tb[IFLA_STATS]);
 		if (((unsigned long)s) & (sizeof(unsigned long)-1)) {
-- 
1.7.0


^ permalink raw reply related

* iproute2: IFLA_STATS64
From: Jan Engelhardt @ 2010-03-11 20:00 UTC (permalink / raw)
  To: stephen.hemminger; +Cc: davem, netdev



Just a small compose filler here to mark it as iproute2 stuff.

---
 include/linux/if_link.h |   33 +++++++++++++++++++++++
 ip/ipaddress.c          |   55 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 87 insertions(+), 1 deletions(-)

^ permalink raw reply

* Re: [PATCH 25/37] drivers/infiniband: use .dev.of_node instead of .node in struct of_device
From: Roland Dreier @ 2010-03-11 19:57 UTC (permalink / raw)
  To: Grant Likely
  Cc: Hoang-Nam Nguyen, Christoph Raisch, monstr, gregkh, benh, akpm,
	davem, sfr, jgarzik, ben-linux, dwmw2, jeremy.kerr,
	James.Bottomley, broonie, microblaze-uclinux, linux-kernel,
	linuxppc-dev, sparclinux, linux-ide, netdev, linux-i2c,
	devicetree-discuss, linux-scsi, alsa-devel
In-Reply-To: <20100311180605.4824.3613.stgit@angua>

Seems fine... adding EHCA guys just to make sure.

 > .node is being removed
 > 
 > Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
 > ---
 > 
 >  drivers/infiniband/hw/ehca/ehca_main.c |   11 ++++++-----
 >  1 files changed, 6 insertions(+), 5 deletions(-)
 > 
 > diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
 > index 129a6be..2639185 100644
 > --- a/drivers/infiniband/hw/ehca/ehca_main.c
 > +++ b/drivers/infiniband/hw/ehca/ehca_main.c
 > @@ -291,8 +291,9 @@ static int ehca_sense_attributes(struct ehca_shca *shca)
 >  	};
 >  
 >  	ehca_gen_dbg("Probing adapter %s...",
 > -		     shca->ofdev->node->full_name);
 > -	loc_code = of_get_property(shca->ofdev->node, "ibm,loc-code", NULL);
 > +		     shca->ofdev->dev.of_node->full_name);
 > +	loc_code = of_get_property(shca->ofdev->dev.of_node, "ibm,loc-code",
 > +				   NULL);
 >  	if (loc_code)
 >  		ehca_gen_dbg(" ... location lode=%s", loc_code);
 >  
 > @@ -720,16 +721,16 @@ static int __devinit ehca_probe(struct of_device *dev,
 >  	int ret, i, eq_size;
 >  	unsigned long flags;
 >  
 > -	handle = of_get_property(dev->node, "ibm,hca-handle", NULL);
 > +	handle = of_get_property(dev->dev.of_node, "ibm,hca-handle", NULL);
 >  	if (!handle) {
 >  		ehca_gen_err("Cannot get eHCA handle for adapter: %s.",
 > -			     dev->node->full_name);
 > +			     dev->dev.of_node->full_name);
 >  		return -ENODEV;
 >  	}
 >  
 >  	if (!(*handle)) {
 >  		ehca_gen_err("Wrong eHCA handle for adapter: %s.",
 > -			     dev->node->full_name);
 > +			     dev->dev.of_node->full_name);
 >  		return -ENODEV;
 >  	}
 >  
 > 
 > -- 
Roland Dreier  <rolandd@cisco.com>
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html

^ permalink raw reply

* [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Jan Engelhardt @ 2010-03-11 19:57 UTC (permalink / raw)
  To: davem; +Cc: netdev
In-Reply-To: <1268337450-6749-1-git-send-email-jengelh@medozas.de>

`ip -s link` shows interface counters truncated to 32 bit. This is
because interface statistics are transported only in 32-bit quantity
to userspace. This commit adds a new IFLA_STATS64 attribute that
exports them in full 64 bit.

References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 include/linux/if_link.h |   33 +++++++++++++++++++++++++++++++++
 net/core/rtnetlink.c    |   42 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 74 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index c9bf92c..cfd420b 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -37,6 +37,38 @@ struct rtnl_link_stats {
 	__u32	tx_compressed;
 };
 
+struct rtnl_link_stats64 {
+	__u64	rx_packets;		/* total packets received	*/
+	__u64	tx_packets;		/* total packets transmitted	*/
+	__u64	rx_bytes;		/* total bytes received 	*/
+	__u64	tx_bytes;		/* total bytes transmitted	*/
+	__u64	rx_errors;		/* bad packets received		*/
+	__u64	tx_errors;		/* packet transmit problems	*/
+	__u64	rx_dropped;		/* no space in linux buffers	*/
+	__u64	tx_dropped;		/* no space available in linux	*/
+	__u64	multicast;		/* multicast packets received	*/
+	__u64	collisions;
+
+	/* detailed rx_errors: */
+	__u64	rx_length_errors;
+	__u64	rx_over_errors;		/* receiver ring buff overflow	*/
+	__u64	rx_crc_errors;		/* recved pkt with crc error	*/
+	__u64	rx_frame_errors;	/* recv'd frame alignment error */
+	__u64	rx_fifo_errors;		/* recv'r fifo overrun		*/
+	__u64	rx_missed_errors;	/* receiver missed packet	*/
+
+	/* detailed tx_errors */
+	__u64	tx_aborted_errors;
+	__u64	tx_carrier_errors;
+	__u64	tx_fifo_errors;
+	__u64	tx_heartbeat_errors;
+	__u64	tx_window_errors;
+
+	/* for cslip etc */
+	__u64	rx_compressed;
+	__u64	tx_compressed;
+};
+
 /* The struct should be in sync with struct ifmap */
 struct rtnl_link_ifmap {
 	__u64	mem_start;
@@ -83,6 +115,7 @@ enum {
 	IFLA_VF_VLAN,
 	IFLA_VF_TX_RATE,	/* TX Bandwidth Allocation */
 	IFLA_VFINFO,
+	IFLA_STATS64,
 	__IFLA_MAX
 };
 
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 4568120..e1121f0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -600,7 +600,39 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
 
 	a->rx_compressed = b->rx_compressed;
 	a->tx_compressed = b->tx_compressed;
-};
+}
+
+static void copy_rtnl_link_stats64(struct rtnl_link_stats64 *a,
+				   const struct net_device_stats *b)
+{
+	a->rx_packets = b->rx_packets;
+	a->tx_packets = b->tx_packets;
+	a->rx_bytes = b->rx_bytes;
+	a->tx_bytes = b->tx_bytes;
+	a->rx_errors = b->rx_errors;
+	a->tx_errors = b->tx_errors;
+	a->rx_dropped = b->rx_dropped;
+	a->tx_dropped = b->tx_dropped;
+
+	a->multicast = b->multicast;
+	a->collisions = b->collisions;
+
+	a->rx_length_errors = b->rx_length_errors;
+	a->rx_over_errors = b->rx_over_errors;
+	a->rx_crc_errors = b->rx_crc_errors;
+	a->rx_frame_errors = b->rx_frame_errors;
+	a->rx_fifo_errors = b->rx_fifo_errors;
+	a->rx_missed_errors = b->rx_missed_errors;
+
+	a->tx_aborted_errors = b->tx_aborted_errors;
+	a->tx_carrier_errors = b->tx_carrier_errors;
+	a->tx_fifo_errors = b->tx_fifo_errors;
+	a->tx_heartbeat_errors = b->tx_heartbeat_errors;
+	a->tx_window_errors = b->tx_window_errors;
+
+	a->rx_compressed = b->rx_compressed;
+	a->tx_compressed = b->tx_compressed;
+}
 
 static inline int rtnl_vfinfo_size(const struct net_device *dev)
 {
@@ -698,6 +730,14 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
 	stats = dev_get_stats(dev);
 	copy_rtnl_link_stats(nla_data(attr), stats);
 
+	attr = nla_reserve(skb, IFLA_STATS64,
+			sizeof(struct rtnl_link_stats64));
+	if (attr == NULL)
+		goto nla_put_failure;
+
+	stats = dev_get_stats(dev);
+	copy_rtnl_link_stats64(nla_data(attr), stats);
+
 	if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
 		int i;
 		struct ifla_vf_info ivi;
-- 
1.7.0


^ permalink raw reply related

* [PATCH 2/3] net: tcp: make veno selectable as default congestion module
From: Jan Engelhardt @ 2010-03-11 19:57 UTC (permalink / raw)
  To: davem; +Cc: netdev
In-Reply-To: <1268337450-6749-1-git-send-email-jengelh@medozas.de>

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
 net/ipv4/Kconfig |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index 731c47b..c9a1c68 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -593,6 +593,9 @@ choice
 	config DEFAULT_VEGAS
 		bool "Vegas" if TCP_CONG_VEGAS=y
 
+	config DEFAULT_VENO
+		bool "Veno" if TCP_CONG_VENO=y
+
 	config DEFAULT_WESTWOOD
 		bool "Westwood" if TCP_CONG_WESTWOOD=y
 
@@ -616,6 +619,7 @@ config DEFAULT_TCP_CONG
 	default "hybla" if DEFAULT_HYBLA
 	default "vegas" if DEFAULT_VEGAS
 	default "westwood" if DEFAULT_WESTWOOD
+	default "veno" if DEFAULT_VENO
 	default "reno" if DEFAULT_RENO
 	default "cubic"
 
-- 
1.7.0


^ 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