Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH]: Third (final?) release of Sun Neptune driver
From: Jeff Garzik @ 2007-10-05 21:14 UTC (permalink / raw)
  To: David Miller
  Cc: shemminger, netdev, Ariel.Hendel, greg.onufer, Ashley.Saulsbury,
	Matheos.Worku
In-Reply-To: <20071005.141217.41646184.davem@davemloft.net>

David Miller wrote:
> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Fri, 5 Oct 2007 08:40:36 -0700
> 
>> WARNING: braces {} are not necessary for single statement blocks
>> #691: FILE: drivers/net/niu.c:603:
>> +	if (lp->loopback_mode == LOOPBACK_PHY) {
>> +		test_cfg_val |= ((ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_0_SHIFT) |
>> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_1_SHIFT) |
>> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_2_SHIFT) |
>> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_3_SHIFT));
>> +	}
> 
> This is why I don't run checkpatch on my work.

IMO it -is- useful.

You just have to ignore some of its complaints.  Part of my coding style 
includes the multiple assignment thing that checkpatch complains about:

	status =
	msi->status = br32(QDMA_STAT);

and I am not going to stop doing that just because checkpatch complains :)


> This statement is a "single statement" but it's broken up
> into multiple lines for readability, and it make perfect
> sense to put braces around this basic block so it's easier
> for humans to see what's going on.

Strongly agreed.

	Jeff




^ permalink raw reply

* Re: [PATCH]: Third (final?) release of Sun Neptune driver
From: David Miller @ 2007-10-05 21:12 UTC (permalink / raw)
  To: shemminger
  Cc: netdev, Ariel.Hendel, greg.onufer, jeff, Ashley.Saulsbury,
	Matheos.Worku
In-Reply-To: <20071005083924.4e7f5d59@freepuppy.rosehill>

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Fri, 5 Oct 2007 08:39:24 -0700

> Build failed on x86_64
> 
> ERROR: "__bad_udelay" [drivers/net/niu.ko] undefined!

Can you figure out which udelay() call is too big and
thus causing problems?

^ permalink raw reply

* Re: [PATCH]: Third (final?) release of Sun Neptune driver
From: David Miller @ 2007-10-05 21:12 UTC (permalink / raw)
  To: shemminger
  Cc: netdev, Ariel.Hendel, greg.onufer, jeff, Ashley.Saulsbury,
	Matheos.Worku
In-Reply-To: <20071005084036.52dc943c@freepuppy.rosehill>

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Fri, 5 Oct 2007 08:40:36 -0700

> WARNING: braces {} are not necessary for single statement blocks
> #691: FILE: drivers/net/niu.c:603:
> +	if (lp->loopback_mode == LOOPBACK_PHY) {
> +		test_cfg_val |= ((ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_0_SHIFT) |
> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_1_SHIFT) |
> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_2_SHIFT) |
> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_3_SHIFT));
> +	}

This is why I don't run checkpatch on my work.

This statement is a "single statement" but it's broken up
into multiple lines for readability, and it make perfect
sense to put braces around this basic block so it's easier
for humans to see what's going on.

^ permalink raw reply

* Re: e1000e oops
From: David Miller @ 2007-10-05 20:53 UTC (permalink / raw)
  To: max; +Cc: netdev, linux-kernel
In-Reply-To: <20071005131115.GA31453@stro.at>

From: maximilian attems <max@stro.at>
Date: Fri, 5 Oct 2007 15:11:15 +0200

> net eth1: device_rename: sysfs_create_symlink failed (-17)
 ...
> no idea if aboves belongs to netdev or sysfs dep.

I think the report belongs to udev.

It tries to rename network devices even if they already
have the name it desires.

^ permalink raw reply

* [PATCH net-2.6.24] s2io: sparse warnings fix (rev2)
From: Stephen Hemminger @ 2007-10-05 19:39 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: David S. Miller, Ramkrishna Vepa, Raapur Santosh,
	Sivakumar Subramani, Sreenivasa Honnur, netdev
In-Reply-To: <470679B7.2060901@pobox.com>

Fix warnings from sparse checker about shadowed definition and improperly
formatted ethtool_strings.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
  CHECK   drivers/net/s2io.c
drivers/net/s2io.c:2892:15: warning: symbol 'lro' shadows an earlier one
drivers/net/s2io.c:471:1: originally declared here
drivers/net/s2io.c:7021:13: warning: symbol 'lro' shadows an earlier one
drivers/net/s2io.c:471:1: originally declared here
drivers/net/s2io.c:279:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:280:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:281:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:282:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:283:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:284:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:285:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:286:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:287:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:288:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:289:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:290:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:291:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:292:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:293:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:294:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:295:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:296:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:297:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:298:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:299:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:300:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:301:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:302:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:303:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:304:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:305:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:306:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:307:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:308:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:309:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:310:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:311:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:312:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:313:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:314:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:315:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:316:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:317:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:318:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:1762:6: warning: symbol 'en_dis_err_alarms' was not declared. Should it be static?
include/linux/mm.h:587:9: warning: potentially expensive pointer subtraction
drivers/net/s2io.c:4231:5: warning: symbol 'do_s2io_chk_alarm_bit' was not declared. Should it be static?
drivers/net/s2io.c:7801:12: warning: symbol 's2io_starter' was not declared. Should it be static?


--- a/drivers/net/s2io.c	2007-10-05 11:53:55.000000000 -0700
+++ b/drivers/net/s2io.c	2007-10-05 11:58:44.000000000 -0700
@@ -38,7 +38,7 @@
  * Tx descriptors that can be associated with each corresponding FIFO.
  * intr_type: This defines the type of interrupt. The values can be 0(INTA),
  *     2(MSI_X). Default value is '2(MSI_X)'
- * lro: Specifies whether to enable Large Receive Offload (LRO) or not.
+ * lro_enable: Specifies whether to enable Large Receive Offload (LRO) or not.
  *     Possible values '1' for enable '0' for disable. Default is '0'
  * lro_max_pkts: This parameter defines maximum number of packets can be
  *     aggregated as a single large packet
@@ -276,46 +276,46 @@ static char ethtool_driver_stats_keys[][
 	{"ring_5_full_cnt"},
 	{"ring_6_full_cnt"},
 	{"ring_7_full_cnt"},
-	("alarm_transceiver_temp_high"),
-	("alarm_transceiver_temp_low"),
-	("alarm_laser_bias_current_high"),
-	("alarm_laser_bias_current_low"),
-	("alarm_laser_output_power_high"),
-	("alarm_laser_output_power_low"),
-	("warn_transceiver_temp_high"),
-	("warn_transceiver_temp_low"),
-	("warn_laser_bias_current_high"),
-	("warn_laser_bias_current_low"),
-	("warn_laser_output_power_high"),
-	("warn_laser_output_power_low"),
-	("lro_aggregated_pkts"),
-	("lro_flush_both_count"),
-	("lro_out_of_sequence_pkts"),
-	("lro_flush_due_to_max_pkts"),
-	("lro_avg_aggr_pkts"),
-	("mem_alloc_fail_cnt"),
-	("pci_map_fail_cnt"),
-	("watchdog_timer_cnt"),
-	("mem_allocated"),
-	("mem_freed"),
-	("link_up_cnt"),
-	("link_down_cnt"),
-	("link_up_time"),
-	("link_down_time"),
-	("tx_tcode_buf_abort_cnt"),
-	("tx_tcode_desc_abort_cnt"),
-	("tx_tcode_parity_err_cnt"),
-	("tx_tcode_link_loss_cnt"),
-	("tx_tcode_list_proc_err_cnt"),
-	("rx_tcode_parity_err_cnt"),
-	("rx_tcode_abort_cnt"),
-	("rx_tcode_parity_abort_cnt"),
-	("rx_tcode_rda_fail_cnt"),
-	("rx_tcode_unkn_prot_cnt"),
-	("rx_tcode_fcs_err_cnt"),
-	("rx_tcode_buf_size_err_cnt"),
-	("rx_tcode_rxd_corrupt_cnt"),
-	("rx_tcode_unkn_err_cnt"),
+	{"alarm_transceiver_temp_high"},
+	{"alarm_transceiver_temp_low"},
+	{"alarm_laser_bias_current_high"},
+	{"alarm_laser_bias_current_low"},
+	{"alarm_laser_output_power_high"},
+	{"alarm_laser_output_power_low"},
+	{"warn_transceiver_temp_high"},
+	{"warn_transceiver_temp_low"},
+	{"warn_laser_bias_current_high"},
+	{"warn_laser_bias_current_low"},
+	{"warn_laser_output_power_high"},
+	{"warn_laser_output_power_low"},
+	{"lro_aggregated_pkts"},
+	{"lro_flush_both_count"},
+	{"lro_out_of_sequence_pkts"},
+	{"lro_flush_due_to_max_pkts"},
+	{"lro_avg_aggr_pkts"},
+	{"mem_alloc_fail_cnt"},
+	{"pci_map_fail_cnt"},
+	{"watchdog_timer_cnt"},
+	{"mem_allocated"},
+	{"mem_freed"},
+	{"link_up_cnt"},
+	{"link_down_cnt"},
+	{"link_up_time"},
+	{"link_down_time"},
+	{"tx_tcode_buf_abort_cnt"},
+	{"tx_tcode_desc_abort_cnt"},
+	{"tx_tcode_parity_err_cnt"},
+	{"tx_tcode_link_loss_cnt"},
+	{"tx_tcode_list_proc_err_cnt"},
+	{"rx_tcode_parity_err_cnt"},
+	{"rx_tcode_abort_cnt"},
+	{"rx_tcode_parity_abort_cnt"},
+	{"rx_tcode_rda_fail_cnt"},
+	{"rx_tcode_unkn_prot_cnt"},
+	{"rx_tcode_fcs_err_cnt"},
+	{"rx_tcode_buf_size_err_cnt"},
+	{"rx_tcode_rxd_corrupt_cnt"},
+	{"rx_tcode_unkn_err_cnt"},
 	{"tda_err_cnt"},
 	{"pfc_err_cnt"},
 	{"pcc_err_cnt"},
@@ -468,7 +468,9 @@ S2IO_PARM_INT(rxsync_frequency, 3);
 /* Interrupt type. Values can be 0(INTA), 2(MSI_X) */
 S2IO_PARM_INT(intr_type, 2);
 /* Large receive offload feature */
-S2IO_PARM_INT(lro, 0);
+static unsigned int lro_enable;
+module_param_named(lro, lro_enable, uint, 0);
+
 /* Max pkts to be aggregated by LRO at one time. If not specified,
  * aggregation happens until we hit max IP pkt size(64K)
  */
@@ -1759,7 +1761,7 @@ static void do_s2io_write_bits(u64 value
 	writeq(temp64, addr);
 }
 
-void en_dis_err_alarms(struct s2io_nic *nic, u16 mask, int flag)
+static void en_dis_err_alarms(struct s2io_nic *nic, u16 mask, int flag)
 {
 	struct XENA_dev_config __iomem *bar0 = nic->bar0;
 	register u64 gen_int_mask = 0;
@@ -4228,7 +4230,7 @@ static void s2io_txpic_intr_handle(struc
  *  1 - if alarm bit set
  *  0 - if alarm bit is not set
  */
-int do_s2io_chk_alarm_bit(u64 value, void __iomem * addr,
+static int do_s2io_chk_alarm_bit(u64 value, void __iomem * addr,
 			  unsigned long long *cnt)
 {
 	u64 val64;
@@ -7135,7 +7137,8 @@ static int rx_osm_handler(struct ring_in
 				int ret = 0;
 
 				ret = s2io_club_tcp_session(skb->data, &tcp,
-						&tcp_len, &lro, rxdp, sp);
+							    &tcp_len, &lro,
+							    rxdp, sp);
 				switch (ret) {
 					case 3: /* Begin anew */
 						lro->parent = skb;
@@ -7451,7 +7454,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
 	else
 		sp->device_type = XFRAME_I_DEVICE;
 
-	sp->lro = lro;
+	sp->lro = lro_enable;
 
 	/* Initialize some PCI/PCI-X fields of the NIC. */
 	s2io_init_pci(sp);
@@ -7798,7 +7801,7 @@ static void __devexit s2io_rem_nic(struc
  * the module loadable parameters and initializes PCI configuration space.
  */
 
-int __init s2io_starter(void)
+static int __init s2io_starter(void)
 {
 	return pci_register_driver(&s2io_driver);
 }


-- 
Stephen Hemminger <shemminger@linux-foundation.org>

^ permalink raw reply

* [git patch] net driver fix
From: Jeff Garzik @ 2007-10-05 18:20 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: netdev, LKML


Fix a rather large performance regression.

Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git upstream-linus

to receive the following updates:

 drivers/net/r8169.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

Francois Romieu (1):
      r8169: revert part of 6dccd16b7c2703e8bbf8bca62b5cf248332afbe2

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c921ec3..c76dd29 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1918,7 +1918,11 @@ static void rtl_hw_start_8169(struct net_device *dev)
 
 	rtl_set_rx_max_size(ioaddr);
 
-	rtl_set_rx_tx_config_registers(tp);
+	if ((tp->mac_version == RTL_GIGA_MAC_VER_01) ||
+	    (tp->mac_version == RTL_GIGA_MAC_VER_02) ||
+	    (tp->mac_version == RTL_GIGA_MAC_VER_03) ||
+	    (tp->mac_version == RTL_GIGA_MAC_VER_04))
+		rtl_set_rx_tx_config_registers(tp);
 
 	tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
 
@@ -1941,6 +1945,14 @@ static void rtl_hw_start_8169(struct net_device *dev)
 
 	rtl_set_rx_tx_desc_registers(tp, ioaddr);
 
+	if ((tp->mac_version != RTL_GIGA_MAC_VER_01) &&
+	    (tp->mac_version != RTL_GIGA_MAC_VER_02) &&
+	    (tp->mac_version != RTL_GIGA_MAC_VER_03) &&
+	    (tp->mac_version != RTL_GIGA_MAC_VER_04)) {
+		RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+		rtl_set_rx_tx_config_registers(tp);
+	}
+
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 
 	/* Initially a 10 us delay. Turned it into a PCI commit. - FR */
@@ -1955,8 +1967,6 @@ static void rtl_hw_start_8169(struct net_device *dev)
 
 	/* Enable all known interrupts by setting the interrupt mask. */
 	RTL_W16(IntrMask, tp->intr_event);
-
-	RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
 }
 
 static void rtl_hw_start_8168(struct net_device *dev)

^ permalink raw reply related

* [git patches] net driver updates
From: Jeff Garzik @ 2007-10-05 18:20 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, LKML


Please pull from 'upstream-davem' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git upstream-davem

to receive the following updates:

Auke Kok (2):
      e1000e: fix debugging printout code
      e1000e: Fix ethtool register test code

Frank Blaschka (1):
      qeth: EDDP does not work on large MTUs

Klaus D. Wacker (2):
      qeth: HiperSockets layer-3 interface drop non IPv4 or non IPv6 packets
      lcs: Channel errors drive lcs_recovery which leads to kernel panic.

Ursula Braun (2):
      qeth: avoid duplicate deletion of multicast addresses
      qeth: discard inbound packets with unknown header id

 drivers/net/e1000e/ethtool.c |   14 ++++++++++----
 drivers/net/e1000e/hw.h      |    2 +-
 drivers/net/e1000e/netdev.c  |    4 +---
 drivers/s390/net/lcs.c       |   11 ++++++++---
 drivers/s390/net/lcs.h       |    1 +
 drivers/s390/net/qeth_eddp.c |   16 +++++++++-------
 drivers/s390/net/qeth_main.c |   19 +++++++++++++------
 7 files changed, 43 insertions(+), 24 deletions(-)

diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 3423f33..2e8218f 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -784,10 +784,16 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
 	REG_SET_AND_CHECK(E1000_RCTL, before, 0x003FFFFB);
 	REG_SET_AND_CHECK(E1000_TCTL, 0xFFFFFFFF, 0x00000000);
 
-	REG_SET_AND_CHECK(E1000_RCTL, 0xFFFFFFFF, 0x01FFFFFF);
-	REG_PATTERN_TEST(E1000_RDBAL, 0xFFFFF000, 0xFFFFFFFF);
-	REG_PATTERN_TEST(E1000_TXCW, 0x0000FFFF, 0x0000FFFF);
-	REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFF000, 0xFFFFFFFF);
+	REG_SET_AND_CHECK(E1000_RCTL, before, 0xFFFFFFFF);
+	REG_PATTERN_TEST(E1000_RDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
+	if ((mac->type != e1000_ich8lan) &&
+	    (mac->type != e1000_ich9lan))
+		REG_PATTERN_TEST(E1000_TXCW, 0xC000FFFF, 0x0000FFFF);
+	REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
+	REG_PATTERN_TEST(E1000_TIDV, 0x0000FFFF, 0x0000FFFF);
+	for (i = 0; i < mac->rar_entry_count; i++)
+		REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1),
+				       0x8003FFFF, 0xFFFFFFFF);
 
 	for (i = 0; i < mac->mta_reg_count; i++)
 		REG_PATTERN_TEST_ARRAY(E1000_MTA, i, 0xFFFFFFFF, 0xFFFFFFFF);
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 848217a..aa82f1a 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -852,7 +852,7 @@ struct e1000_hw {
 
 #ifdef DEBUG
 #define hw_dbg(hw, format, arg...) \
-	printk(KERN_DEBUG, "%s: " format, e1000_get_hw_dev_name(hw), ##arg);
+	printk(KERN_DEBUG, "%s: " format, e1000e_get_hw_dev_name(hw), ##arg);
 #else
 static inline int __attribute__ ((format (printf, 2, 3)))
 hw_dbg(struct e1000_hw *hw, const char *format, ...)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 4a21d7d..3a0bb2a 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -66,9 +66,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
  **/
 char *e1000e_get_hw_dev_name(struct e1000_hw *hw)
 {
-	struct e1000_adapter *adapter = hw->back;
-	struct net_device *netdev = adapter->netdev;
-	return netdev->name;
+	return hw->adapter->netdev->name;
 }
 #endif
 
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index e4b11af..0fd663b 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1400,11 +1400,14 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
 		PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n",
 			    cdev->dev.bus_id, dstat, cstat);
 		if (rc) {
-			lcs_schedule_recovery(card);
-			wake_up(&card->wait_q);
-			return;
+			channel->state = LCS_CH_STATE_ERROR;
 		}
 	}
+	if (channel->state == LCS_CH_STATE_ERROR) {
+		lcs_schedule_recovery(card);
+		wake_up(&card->wait_q);
+		return;
+	}
 	/* How far in the ccw chain have we processed? */
 	if ((channel->state != LCS_CH_STATE_INIT) &&
 	    (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
@@ -1708,6 +1711,8 @@ lcs_stopcard(struct lcs_card *card)
 
 	if (card->read.state != LCS_CH_STATE_STOPPED &&
 	    card->write.state != LCS_CH_STATE_STOPPED &&
+	    card->read.state != LCS_CH_STATE_ERROR &&
+	    card->write.state != LCS_CH_STATE_ERROR &&
 	    card->state == DEV_STATE_UP) {
 		lcs_clear_multicast_list(card);
 		rc = lcs_send_stoplan(card,LCS_INITIATOR_TCPIP);
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 0e1e4a0..8976fb0 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -138,6 +138,7 @@ enum lcs_channel_states {
 	LCS_CH_STATE_RUNNING,
 	LCS_CH_STATE_SUSPENDED,
 	LCS_CH_STATE_CLEARED,
+	LCS_CH_STATE_ERROR,
 };
 
 /**
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 70108fb..e3c268c 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -159,13 +159,15 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
 		buffer = buf->buffer;
 		/* fill one skb into buffer */
 		for (i = 0; i < ctx->elements_per_skb; ++i){
-			buffer->element[buf->next_element_to_fill].addr =
-				ctx->elements[element].addr;
-			buffer->element[buf->next_element_to_fill].length =
-				ctx->elements[element].length;
-			buffer->element[buf->next_element_to_fill].flags =
-				ctx->elements[element].flags;
-			buf->next_element_to_fill++;
+			if (ctx->elements[element].length != 0) {
+				buffer->element[buf->next_element_to_fill].
+				addr = ctx->elements[element].addr;
+				buffer->element[buf->next_element_to_fill].
+				length = ctx->elements[element].length;
+				buffer->element[buf->next_element_to_fill].
+				flags = ctx->elements[element].flags;
+				buf->next_element_to_fill++;
+			}
 			element++;
 			elements--;
 		}
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 778ddfb..c67e7df 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -823,14 +823,15 @@ __qeth_delete_all_mc(struct qeth_card *card, unsigned long *flags)
 again:
 	list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
 		if (addr->is_multicast) {
+			list_del(&addr->entry);
 			spin_unlock_irqrestore(&card->ip_lock, *flags);
 			rc = qeth_deregister_addr_entry(card, addr);
 			spin_lock_irqsave(&card->ip_lock, *flags);
 			if (!rc) {
-				list_del(&addr->entry);
 				kfree(addr);
 				goto again;
-			}
+			} else
+				list_add(&addr->entry, &card->ip_list);
 		}
 	}
 }
@@ -2701,10 +2702,15 @@ qeth_process_inbound_buffer(struct qeth_card *card,
 			qeth_layer2_rebuild_skb(card, skb, hdr);
 		else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3)
 			vlan_tag = qeth_rebuild_skb(card, skb, hdr);
-		else { /*in case of OSN*/
+		else if (hdr->hdr.osn.id == QETH_HEADER_TYPE_OSN) {
 			skb_push(skb, sizeof(struct qeth_hdr));
 			skb_copy_to_linear_data(skb, hdr,
 						sizeof(struct qeth_hdr));
+		} else { /* unknown header type */
+			dev_kfree_skb_any(skb);
+			QETH_DBF_TEXT(trace, 3, "inbunkno");
+			QETH_DBF_HEX(control, 3, hdr, QETH_DBF_CONTROL_LEN);
+			continue;
 		}
 		/* is device UP ? */
 		if (!(card->dev->flags & IFF_UP)){
@@ -4508,7 +4514,8 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
 			/* check if we have enough elements (including following
 			 * free buffers) to handle eddp context */
 			if (qeth_eddp_check_buffers_for_context(queue,ctx) < 0){
-				printk("eddp tx_dropped 1\n");
+				if (net_ratelimit())
+					PRINT_WARN("eddp tx_dropped 1\n");
 				rc = -EBUSY;
 				goto out;
 			}
@@ -4719,8 +4726,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
 		rc = qeth_do_send_packet(card, queue, new_skb, hdr,
 					 elements_needed, ctx);
 	else {
-		if ((skb->protocol == htons(ETH_P_ARP)) &&
-		    (card->dev->flags & IFF_NOARP)) {
+		if ((!card->options.layer2) &&
+		    (ipv == 0)) {
 			__qeth_free_new_skb(skb, new_skb);
 			return -EPERM;
 		}

^ permalink raw reply related

* Re: [PATCH] r8169: revert part of 6dccd16b7c2703e8bbf8bca62b5cf248332afbe2
From: Jeff Garzik @ 2007-10-05 18:05 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, jeti, David Miller, 許恆嘉
In-Reply-To: <20071003224250.GA22366@electric-eye.fr.zoreil.com>

Francois Romieu wrote:
> The 8169/8110SC currently announces itself as:
> [...]
> eth0: RTL8169sc/8110sc at 0x........, ..:..:..:..:..:.., XID 18000000 IRQ ..
>                                                              ^^^^^^^^
> It uses RTL_GIGA_MAC_VER_05 and this part of the changeset can cut
> its performance by a factor of 2~2.5 as reported by Timo.
> 
> (the driver includes code just before the hunk to write the ChipCmd
> register when mac_version == RTL_GIGA_MAC_VER_0[1-4])
> 
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Cc: Timo Jantunen <jeti@welho.com>

I'm applying this, but, please do copy Edward @ RealTek on patches like 
this, as a courtesy if nothing else.

Sometimes the kernel development process can be a bit impenetrable for 
newcomers, and I'd like to give as much visibility as possible to the 
process for the hardware vendor.

	Jeff




^ permalink raw reply

* Re: [PATCH] ethtool: Add e1000e reg dump support (using e1000 decode function)
From: Jeff Garzik @ 2007-10-05 18:01 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev
In-Reply-To: <20071004183731.31453.3670.stgit@localhost.localdomain>

Auke Kok wrote:
> The e1000 register dump code can print out e1000e register dump
> information as well, so enable it for e1000e devices.
> 
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>

applied



^ permalink raw reply

* Re: [PATCH V6 1/9] IB/ipoib: Bound the net device to the ipoib_neigh structue
From: Jeff Garzik @ 2007-10-05 17:57 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: Moni Shoua, Roland Dreier, netdev
In-Reply-To: <16822.1191538040@death>

Jay Vosburgh wrote:
> IPoIB uses a two layer neighboring scheme, such that for each struct neighbour
> whose device is an ipoib one, there is a struct ipoib_neigh buddy which is
> created on demand at the tx flow by an ipoib_neigh_alloc(skb->dst->neighbour)
> call.
> 
> When using the bonding driver, neighbours are created by the net stack on behalf
> of the bonding (master) device. On the tx flow the bonding code gets an skb such
> that skb->dev points to the master device, it changes this skb to point on the
> slave device and calls the slave hard_start_xmit function.
> 
> Under this scheme, ipoib_neigh_destructor assumption that for each struct
> neighbour it gets, n->dev is an ipoib device and hence netdev_priv(n->dev)
> can be casted to struct ipoib_dev_priv is buggy.
> 
> To fix it, this patch adds a dev field to struct ipoib_neigh which is used
> instead of the struct neighbour dev one, when n->dev->flags has the
> IFF_MASTER bit set.
> 
> Signed-off-by: Moni Shoua <monis at voltaire.com>
> Signed-off-by: Or Gerlitz <ogerlitz at voltaire.com>
> Acked-by: Roland Dreier <rdreier@cisco.com>

ACK, but patches do not apply to jgarzik/netdev-2.6.git#upstream nor 
davem/net-2.6.24.git, so I was forced to drop the patch series :(


^ permalink raw reply

* Re: [PATCH] e1000e: Fix ethtool register test code
From: Jeff Garzik @ 2007-10-05 17:56 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev
In-Reply-To: <20071004220008.3344.59536.stgit@localhost.localdomain>

Auke Kok wrote:
> A merge/cleanup code accidentally dropped 8254x code in and removed
> 8257x code here. Undo this mistake and use the pci-e relevant register
> test similar as to what is in e1000.
> 
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
> 
>  drivers/net/e1000e/ethtool.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)

applied



^ permalink raw reply

* Re: [PATCH] e1000e: fix debugging printout code
From: Jeff Garzik @ 2007-10-05 17:56 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev
In-Reply-To: <20071004183843.31540.23710.stgit@localhost.localdomain>

Auke Kok wrote:
> A small bug crawled in the -DDEBUG enabled code. Fix this to
> properly call the backreference device name.
> 
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
> 
>  drivers/net/e1000e/hw.h     |    2 +-
>  drivers/net/e1000e/netdev.c |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)

applied



^ permalink raw reply

* Re: [patch 1/5] qeth: HiperSockets layer-3 interface drop non IPv4 or non IPv6 packets
From: Jeff Garzik @ 2007-10-05 17:55 UTC (permalink / raw)
  To: Ursula Braun; +Cc: davem, netdev, linux-s390, Klaus D. Wacker
In-Reply-To: <20071005144822.229143000@linux.vnet.ibm.com>

applied 1-5



^ permalink raw reply

* Re: [PATCH] e1000e: fix debugging printout code
From: Jeff Garzik @ 2007-10-05 17:53 UTC (permalink / raw)
  To: Auke Kok; +Cc: netdev
In-Reply-To: <20071004183843.31540.23710.stgit@localhost.localdomain>

Auke Kok wrote:
> A small bug crawled in the -DDEBUG enabled code. Fix this to
> properly call the backreference device name.
> 
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
> ---
> 
>  drivers/net/e1000e/hw.h     |    2 +-
>  drivers/net/e1000e/netdev.c |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
> index 848217a..aa82f1a 100644
> --- a/drivers/net/e1000e/hw.h
> +++ b/drivers/net/e1000e/hw.h
> @@ -852,7 +852,7 @@ struct e1000_hw {
>  
>  #ifdef DEBUG
>  #define hw_dbg(hw, format, arg...) \
> -	printk(KERN_DEBUG, "%s: " format, e1000_get_hw_dev_name(hw), ##arg);
> +	printk(KERN_DEBUG, "%s: " format, e1000e_get_hw_dev_name(hw), ##arg);

I will apply this, but, I strongly encourage deletion of this in favor 
of the existing dev_dbg()

	Jeff




^ permalink raw reply

* Re: [PATCH net-2.6.24] s2io: sparse warnings fix
From: Jeff Garzik @ 2007-10-05 17:51 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David S. Miller, Ramkrishna Vepa, Raapur Santosh,
	Sivakumar Subramani, Sreenivasa Honnur, netdev
In-Reply-To: <20071005090725.09a80bc7@freepuppy.rosehill>

Stephen Hemminger wrote:
> Fix warnings from sparse checker about shadowed definition and improperly
> formatted ethtool_strings.
> 
> I chose to change module parameter rather than uglify the code by changing
> the variable name.

Changing the name of existing module parameters can potentially 
introduce breakage in the field.

Additionally, we have module_param_named() to account for this sort of 
thing, where the module parameter name differs from the internal 
variable name.

The rest looks OK.

Please resend, potentially moving the module parameter change(s) into a 
separate patch.


^ permalink raw reply

* Re: [PATCH]: Third (final?) release of Sun Neptune driver
From: Matheos Worku @ 2007-10-05 17:45 UTC (permalink / raw)
  To: Ingo Oeser
  Cc: David Miller, netdev, Ariel.Hendel, Greg.Onufer, jeff,
	Ashley.Saulsbury
In-Reply-To: <200710051846.19965.netdev@axxeo.de>

Ingo Oeser wrote:
> Hi David,
>
> some minor nits.
>
> Could this driver be split into more files. 8k lines per file
> is quite a lot. Although GCC might optimize it best this way :-)
>   

Ingo,

Some r info on  Neptune HW  to explains some of the constants ...
Regards
Matheos

>> +	ctrl_val = (ENET_SERDES_CTRL_SDET_0 |
>> +		    ENET_SERDES_CTRL_SDET_1 |
>> +		    ENET_SERDES_CTRL_SDET_2 |
>> +		    ENET_SERDES_CTRL_SDET_3 |
>> +		    (0x5 << ENET_SERDES_CTRL_EMPH_0_SHIFT) |
>> +		    (0x5 << ENET_SERDES_CTRL_EMPH_1_SHIFT) |
>> +		    (0x5 << ENET_SERDES_CTRL_EMPH_2_SHIFT) |
>> +		    (0x5 << ENET_SERDES_CTRL_EMPH_3_SHIFT) |
>> +		    (0x1 << ENET_SERDES_CTRL_LADJ_0_SHIFT) |
>> +		    (0x1 << ENET_SERDES_CTRL_LADJ_1_SHIFT) |
>> +		    (0x1 << ENET_SERDES_CTRL_LADJ_2_SHIFT) |
>> +		    (0x1 << ENET_SERDES_CTRL_LADJ_3_SHIFT));
>> +	test_cfg_val = 0;
>> +
>> +	if (lp->loopback_mode == LOOPBACK_PHY) {
>> +		test_cfg_val |= ((ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_0_SHIFT) |
>> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_1_SHIFT) |
>> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_2_SHIFT) |
>> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
>> +				  ENET_SERDES_TEST_MD_3_SHIFT));
>> +	}
>> +
>> +	nw64(ctrl_reg, ctrl_val);
>> +	nw64(test_cfg_reg, test_cfg_val);
>> +
>> +	for (i = 0; i < 4; i++) {
>>     
>
> why 4? (magic number)
>   
The MAC HW has 4 SERDES lanes. Need to configure each lane
>   
>   
>> +static void niu_set_max_burst(struct niu *np, struct tx_ring_info *rp)
>> +{
>> +	int mtu = np->dev->mtu;
>> +
>> +	rp->max_burst = mtu + 32;
>> +	if (rp->max_burst > 4096)
>> +		rp->max_burst = 4096;
>>     
>
> Why 32 and 4096? (Magic values)
>   
These values were recommended by the HW designers for fair utilization 
of DRR  feature among TX/RX rings.
>   
>> +}
>> +
>>     
>
> ... ok, I stop here, since this drivers is damn big :-)
>
> Best Regards
>
> Ingo Oeser
>   


^ permalink raw reply

* Re: [Bugme-new] [Bug 9128] New: PF_KEY SADB_GET messages return SADB_DUMP from the kernel
From: Andrew Morton @ 2007-10-05 17:37 UTC (permalink / raw)
  To: netdev, chardin
  Cc: bugme-daemon, Joy Latten, Eric Paris, James Morris, Herbert Xu
In-Reply-To: <bug-9128-10286@http.bugzilla.kernel.org/>


(Please reply via emailed reply-to-all, not via the bugzilla web interface)

On Fri,  5 Oct 2007 09:01:50 -0700 (PDT)
bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9128
> 
>            Summary: PF_KEY SADB_GET messages return SADB_DUMP from the
>                     kernel
>            Product: Networking
>            Version: 2.5
>      KernelVersion: 2.6.18
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Other
>         AssignedTo: acme@ghostprotocols.net
>         ReportedBy: chardin@2wire.com
> 
> 
> Most recent kernel where this bug did not occur:
> Distribution: Centos 5
> Hardware Environment: Dell 490
> Software Environment: Centos 5
> Problem Description:
> Sending an SADB_GET to the PF_KEY socket returns an SADB_DUMP in the out_hdr
> 
> Steps to reproduce:
> Send an SADB_GET to the PF_KEY socket and dump the returned packet
> 
> 
> This patch should fix the problem
> diff --git a/net/key/af_key.c b/net/key/af_key.c
> index 5502df1..7a5e993 100644
> --- a/net/key/af_key.c
> +++ b/net/key/af_key.c
> @@ -1546,7 +1546,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff
> *skb,
> 
>         out_hdr = (struct sadb_msg *) out_skb->data;
>         out_hdr->sadb_msg_version = hdr->sadb_msg_version;
> -       out_hdr->sadb_msg_type = SADB_DUMP;
> +       out_hdr->sadb_msg_type = SADB_GET;
>         out_hdr->sadb_msg_satype = pfkey_proto2satype(proto);
>         out_hdr->sadb_msg_errno = 0;
>         out_hdr->sadb_msg_reserved = 0;
> 

Please submit kernel patches via email, as per
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt.  Net patches
should be sent to netdev@vger.kernel.org and perhaps
linux-kernel@vger.kernel.org.

But whatever - I can convert this patch into a suitable one and send it in
to David if people think it is good?


^ permalink raw reply

* Re: [PATCH]: Third (final?) release of Sun Neptune driver
From: Jeff Garzik @ 2007-10-05 16:55 UTC (permalink / raw)
  To: Ingo Oeser
  Cc: David Miller, netdev, Ariel.Hendel, greg.onufer, Ashley.Saulsbury,
	Matheos.Worku
In-Reply-To: <200710051846.19965.netdev@axxeo.de>

Ingo Oeser wrote:
> Hi David,
> 
> some minor nits.
> 
> Could this driver be split into more files. 8k lines per file
> is quite a lot. Although GCC might optimize it best this way :-)

gcc does optimize it better this way, but overall, it's maintainer's 
preference.  It's far easier for many to have everything in a single 
file, when editing.


> David Miller schrieb:
>> +#define nr64(reg)		readq(np->regs + (reg))
>> +#define nw64(reg, val)		writeq((val), np->regs + (reg))
>> +
>> +#define nr64_mac(reg)		readq(np->mac_regs + (reg))
>> +#define nw64_mac(reg, val)	writeq((val), np->mac_regs + (reg))
>> +
>> +#define nr64_ipp(reg)		readq(np->regs + np->ipp_off + (reg))
>> +#define nw64_ipp(reg, val)	writeq((val), np->regs + np->ipp_off + (reg))
>> +
>> +#define nr64_pcs(reg)		readq(np->regs + np->pcs_off + (reg))
>> +#define nw64_pcs(reg, val)	writeq((val), np->regs + np->pcs_off + (reg))
>> +
>> +#define nr64_xpcs(reg)		readq(np->regs + np->xpcs_off + (reg))
>> +#define nw64_xpcs(reg, val)	writeq((val), np->regs + np->xpcs_off + (reg))
> 
> Can these be static inline and get the "struct niu *np" passed?

We have to answer this every single time...  :)  it makes the code more 
readable, and this is common practice all over the place.

	Jeff




^ permalink raw reply

* Re: [Devel] Re: [PATCH 5/5] make netlink user -> kernel interface synchronious
From: Denis V. Lunev @ 2007-10-05 16:56 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Denis V. Lunev, containers, netdev, davem, devel
In-Reply-To: <4706653B.3050000@trash.net>

Patrick McHardy wrote:
> Denis V. Lunev wrote:
>> This patch make processing netlink user -> kernel messages synchronious.
>> This change was inspired by the talk with Alexey Kuznetsov about current
>> netlink messages processing. He says that he was badly wrong when introduced 
>> asynchronious user -> kernel communication.
>>
>> The call netlink_unicast is the only path to send message to the kernel
>> netlink socket. But, unfortunately, it is also used to send data to the
>> user.
>>
>> Before this change the user message has been attached to the socket queue
>> and sk->sk_data_ready was called. The process has been blocked until all
>> pending messages were processed. The bad thing is that this processing
>> may occur in the arbitrary process context.
>>
>> This patch changes nlk->data_ready callback to get 1 skb and force packet
>> processing right in the netlink_unicast.
> 
> 
> I guess the process credential stuff in netlink_skb_params can now
> be removed as well.

Yes, but I think the patch should be tested by more people before.

Regards,
    Den

^ permalink raw reply

* Re: [PATCH]: Third (final?) release of Sun Neptune driver
From: Ingo Oeser @ 2007-10-05 16:49 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Ariel.Hendel, greg.onufer, jeff, Ashley.Saulsbury,
	Matheos.Worku
In-Reply-To: <200710051846.19965.netdev@axxeo.de>

Ingo Oeser schrieb:
> > +static void niu_init_xif(struct niu *);
> > +
> > +static int link_status_10g(struct niu *np, int *link_up_p)
> > +{
> > +	unsigned long flags;
> > +	int err, link_up;
> > +
> > +	if (np->link_config.loopback_mode != LOOPBACK_DISABLED)
> > +		return -EINVAL;
> > +
> > +	link_up = 0;
> > +
> > +	spin_lock_irqsave(&np->lock, flags);
> > +
> > +	err = mdio_read(np, np->phy_addr, BCM8704_PMA_PMD_DEV_ADDR,
> > +			BCM8704_PMD_RCV_SIGDET);
> > +	if (err < 0)
> > +		return err;
> 
> missing spin_unlock_irqsave()?

I mean spin_unlock_irqrestore()

> > +	if (!(err & PMD_RCV_SIGDET_GLOBAL))
> > +		goto out;
> > +
> > +	err = mdio_read(np, np->phy_addr, BCM8704_PCS_DEV_ADDR,
> > +			BCM8704_PCS_10G_R_STATUS);
> > +	if (err < 0)
> > +		return err;
> missing spin_unlock_irqsave()?

I mean spin_unlock_irqrestore()
 
> > +	if (!(err & PCS_10G_R_STATUS_BLK_LOCK))
> > +		goto out;
> > +
> > +	err = mdio_read(np, np->phy_addr, BCM8704_PHYXS_DEV_ADDR,
> > +			BCM8704_PHYXS_XGXS_LANE_STAT);
> > +	if (err < 0)
> > +		return err;
> > +
> > +	if (err != (PHYXS_XGXS_LANE_STAT_ALINGED |
> > +		    PHYXS_XGXS_LANE_STAT_MAGIC |
> > +		    PHYXS_XGXS_LANE_STAT_LANE3 |
> > +		    PHYXS_XGXS_LANE_STAT_LANE2 |
> > +		    PHYXS_XGXS_LANE_STAT_LANE1 |
> > +		    PHYXS_XGXS_LANE_STAT_LANE0))
> > +		goto out;
> > +
> > +	link_up = 1;
> > +	np->link_config.active_speed = SPEED_10000;
> > +	np->link_config.active_duplex = DUPLEX_FULL;
> > +
> > +out:
> > +	spin_unlock_irqrestore(&np->lock, flags);
> > +
> > +	*link_up_p = link_up;
> > +	return 0;
> > +}
> 

Ok, enough for today...

Best Regards

Ingo Oeser

^ permalink raw reply

* Re: [PATCH]: Third (final?) release of Sun Neptune driver
From: Ingo Oeser @ 2007-10-05 16:46 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Ariel.Hendel, greg.onufer, jeff, Ashley.Saulsbury,
	Matheos.Worku
In-Reply-To: <20071005.031209.57156822.davem@davemloft.net>

Hi David,

some minor nits.

Could this driver be split into more files. 8k lines per file
is quite a lot. Although GCC might optimize it best this way :-)

David Miller schrieb:
> +#define nr64(reg)		readq(np->regs + (reg))
> +#define nw64(reg, val)		writeq((val), np->regs + (reg))
> +
> +#define nr64_mac(reg)		readq(np->mac_regs + (reg))
> +#define nw64_mac(reg, val)	writeq((val), np->mac_regs + (reg))
> +
> +#define nr64_ipp(reg)		readq(np->regs + np->ipp_off + (reg))
> +#define nw64_ipp(reg, val)	writeq((val), np->regs + np->ipp_off + (reg))
> +
> +#define nr64_pcs(reg)		readq(np->regs + np->pcs_off + (reg))
> +#define nw64_pcs(reg, val)	writeq((val), np->regs + np->pcs_off + (reg))
> +
> +#define nr64_xpcs(reg)		readq(np->regs + np->xpcs_off + (reg))
> +#define nw64_xpcs(reg, val)	writeq((val), np->regs + np->xpcs_off + (reg))

Can these be static inline and get the "struct niu *np" passed?

> +#define niu_lock_parent(np, flags) \
> +	spin_lock_irqsave(&np->parent->lock, flags)
> +#define niu_unlock_parent(np, flags) \
> +	spin_unlock_irqrestore(&np->parent->lock, flags)

Maybe fold that into its callers.

> +static int serdes_init_10g(struct niu *np)
> +{
> +	struct niu_link_config *lp = &np->link_config;
> +	unsigned long ctrl_reg, test_cfg_reg, i;
> +	u64 ctrl_val, test_cfg_val, sig, mask, val;
> +	int err;
> +
> +	switch (np->port) {
> +	case 0:
> +		ctrl_reg = ENET_SERDES_0_CTRL_CFG;
> +		test_cfg_reg = ENET_SERDES_0_TEST_CFG;
> +		break;
> +	case 1:
> +		ctrl_reg = ENET_SERDES_1_CTRL_CFG;
> +		test_cfg_reg = ENET_SERDES_1_TEST_CFG;
> +		break;
> +
> +	default:
> +		return -EINVAL;
> +	}


Maybe small table?

> +	ctrl_val = (ENET_SERDES_CTRL_SDET_0 |
> +		    ENET_SERDES_CTRL_SDET_1 |
> +		    ENET_SERDES_CTRL_SDET_2 |
> +		    ENET_SERDES_CTRL_SDET_3 |
> +		    (0x5 << ENET_SERDES_CTRL_EMPH_0_SHIFT) |
> +		    (0x5 << ENET_SERDES_CTRL_EMPH_1_SHIFT) |
> +		    (0x5 << ENET_SERDES_CTRL_EMPH_2_SHIFT) |
> +		    (0x5 << ENET_SERDES_CTRL_EMPH_3_SHIFT) |
> +		    (0x1 << ENET_SERDES_CTRL_LADJ_0_SHIFT) |
> +		    (0x1 << ENET_SERDES_CTRL_LADJ_1_SHIFT) |
> +		    (0x1 << ENET_SERDES_CTRL_LADJ_2_SHIFT) |
> +		    (0x1 << ENET_SERDES_CTRL_LADJ_3_SHIFT));
> +	test_cfg_val = 0;
> +
> +	if (lp->loopback_mode == LOOPBACK_PHY) {
> +		test_cfg_val |= ((ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_0_SHIFT) |
> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_1_SHIFT) |
> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_2_SHIFT) |
> +				 (ENET_TEST_MD_PAD_LOOPBACK <<
> +				  ENET_SERDES_TEST_MD_3_SHIFT));
> +	}
> +
> +	nw64(ctrl_reg, ctrl_val);
> +	nw64(test_cfg_reg, test_cfg_val);
> +
> +	for (i = 0; i < 4; i++) {

why 4? (magic number)

> +		u32 rxtx_ctrl, glue0;
> +		int err;
> +
> +		err = esr_read_rxtx_ctrl(np, i, &rxtx_ctrl);
> +		if (err)
> +			return err;
> +		err = esr_read_glue0(np, i, &glue0);
> +		if (err)
> +			return err;
> +
> +		rxtx_ctrl &= ~(ESR_RXTX_CTRL_VMUXLO);
> +		rxtx_ctrl |= (ESR_RXTX_CTRL_ENSTRETCH |
> +			      (2 << ESR_RXTX_CTRL_VMUXLO_SHIFT));
> +
> +		glue0 &= ~(ESR_GLUE_CTRL0_SRATE |
> +			   ESR_GLUE_CTRL0_THCNT |
> +			   ESR_GLUE_CTRL0_BLTIME);
> +		glue0 |= (ESR_GLUE_CTRL0_RXLOSENAB |
> +			  (0xf << ESR_GLUE_CTRL0_SRATE_SHIFT) |
> +			  (0xff << ESR_GLUE_CTRL0_THCNT_SHIFT) |
> +			  (BLTIME_300_CYCLES <<
> +			   ESR_GLUE_CTRL0_BLTIME_SHIFT));
> +
> +		err = esr_write_rxtx_ctrl(np, i, rxtx_ctrl);
> +		if (err)
> +			return err;
> +		err = esr_write_glue0(np, i, glue0);
> +		if (err)
> +			return err;
> +	}
> +
> +	err = esr_reset(np);
> +	if (err)
> +		return err;
> +
> +	sig = nr64(ESR_INT_SIGNALS);
> +	switch (np->port) {
> +	case 0:
> +		mask = ESR_INT_SIGNALS_P0_BITS;
> +		val = (ESR_INT_SRDY0_P0 |
> +		       ESR_INT_DET0_P0 |
> +		       ESR_INT_XSRDY_P0 |
> +		       ESR_INT_XDP_P0_CH3 |
> +		       ESR_INT_XDP_P0_CH2 |
> +		       ESR_INT_XDP_P0_CH1 |
> +		       ESR_INT_XDP_P0_CH0);
> +		break;
> +
> +	case 1:
> +		mask = ESR_INT_SIGNALS_P1_BITS;
> +		val = (ESR_INT_SRDY0_P1 |
> +		       ESR_INT_DET0_P1 |
> +		       ESR_INT_XSRDY_P1 |
> +		       ESR_INT_XDP_P1_CH3 |
> +		       ESR_INT_XDP_P1_CH2 |
> +		       ESR_INT_XDP_P1_CH1 |
> +		       ESR_INT_XDP_P1_CH0);
> +		break;
> +
> +	default:
> +		return -EINVAL;
> +	}

maybe small table? (maybe combined with the other one suggsted above)

> +
> +	if ((sig & mask) != val) {
> +		printk(KERN_ERR PFX "Port %u signal bits [%08x] are not "
> +		       "[%08x]\n", np->port, (int) (sig & mask), (int) val);
> +		return -ENODEV;
> +	}
> +
> +	return 0;
> +}
> +
> +static int serdes_init_1g(struct niu *np)
> +{
> +	u64 val;
> +
> +	val = nr64(ENET_SERDES_1_PLL_CFG);
> +	val &= ~ENET_SERDES_PLL_FBDIV2;
> +	switch (np->port) {
> +	case 0:
> +		val |= ENET_SERDES_PLL_HRATE0;
> +		break;
> +	case 1:
> +		val |= ENET_SERDES_PLL_HRATE1;
> +		break;
> +	case 2:
> +		val |= ENET_SERDES_PLL_HRATE2;
> +		break;
> +	case 3:
> +		val |= ENET_SERDES_PLL_HRATE3;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}

Maybe small table.

> +	nw64(ENET_SERDES_1_PLL_CFG, val);
> +
> +	return 0;
> +}
> +

[...]

> +static int bcm8704_init_user_dev3(struct niu *np)
> +{
> +	int err;
> +
> +	err = mdio_write(np, np->phy_addr,
> +			 BCM8704_USER_DEV3_ADDR, BCM8704_USER_CONTROL,
> +			 (USER_CONTROL_OPTXRST_LVL |
> +			  USER_CONTROL_OPBIASFLT_LVL |
> +			  USER_CONTROL_OBTMPFLT_LVL |
> +			  USER_CONTROL_OPPRFLT_LVL |
> +			  USER_CONTROL_OPTXFLT_LVL |
> +			  USER_CONTROL_OPRXLOS_LVL |
> +			  USER_CONTROL_OPRXFLT_LVL |
> +			  USER_CONTROL_OPTXON_LVL |
> +			  (0x3f << USER_CONTROL_RES1_SHIFT)));
> +	if (err)
> +		return err;
> +
> +	err = mdio_write(np, np->phy_addr,
> +			 BCM8704_USER_DEV3_ADDR, BCM8704_USER_PMD_TX_CONTROL,
> +			 (USER_PMD_TX_CTL_XFP_CLKEN |
> +			  (1 << USER_PMD_TX_CTL_TX_DAC_TXD_SH) |
> +			  (2 << USER_PMD_TX_CTL_TX_DAC_TXCK_SH) |
> +			  USER_PMD_TX_CTL_TSCK_LPWREN));
> +	if (err)
> +		return err;
> +
> +	err = bcm8704_user_dev3_readback(np, BCM8704_USER_CONTROL);
> +	if (err)
> +		return err;
> +	err = bcm8704_user_dev3_readback(np, BCM8704_USER_PMD_TX_CONTROL);
> +	if (err)
> +		return err;
> +
> +	err = mdio_read(np, np->phy_addr, BCM8704_USER_DEV3_ADDR,
> +			BCM8704_USER_OPT_DIGITAL_CTRL);
> +	if (err < 0)
> +		return err;
> +	err &= ~USER_ODIG_CTRL_GPIOS;
> +	err |= (0x3 << USER_ODIG_CTRL_GPIOS_SHIFT);
> +	err = mdio_write(np, np->phy_addr, BCM8704_USER_DEV3_ADDR,
> +			 BCM8704_USER_OPT_DIGITAL_CTRL, err);
> +	if (err)
> +		return err;
> +
> +	udelay(1000000);

maybe convert to mdelay?

> +
> +	return 0;
> +}
> +

[...]

> +static void niu_init_xif(struct niu *);
> +
> +static int link_status_10g(struct niu *np, int *link_up_p)
> +{
> +	unsigned long flags;
> +	int err, link_up;
> +
> +	if (np->link_config.loopback_mode != LOOPBACK_DISABLED)
> +		return -EINVAL;
> +
> +	link_up = 0;
> +
> +	spin_lock_irqsave(&np->lock, flags);
> +
> +	err = mdio_read(np, np->phy_addr, BCM8704_PMA_PMD_DEV_ADDR,
> +			BCM8704_PMD_RCV_SIGDET);
> +	if (err < 0)
> +		return err;

missing spin_unlock_irqsave()?

> +	if (!(err & PMD_RCV_SIGDET_GLOBAL))
> +		goto out;
> +
> +	err = mdio_read(np, np->phy_addr, BCM8704_PCS_DEV_ADDR,
> +			BCM8704_PCS_10G_R_STATUS);
> +	if (err < 0)
> +		return err;
missing spin_unlock_irqsave()?

> +	if (!(err & PCS_10G_R_STATUS_BLK_LOCK))
> +		goto out;
> +
> +	err = mdio_read(np, np->phy_addr, BCM8704_PHYXS_DEV_ADDR,
> +			BCM8704_PHYXS_XGXS_LANE_STAT);
> +	if (err < 0)
> +		return err;
> +
> +	if (err != (PHYXS_XGXS_LANE_STAT_ALINGED |
> +		    PHYXS_XGXS_LANE_STAT_MAGIC |
> +		    PHYXS_XGXS_LANE_STAT_LANE3 |
> +		    PHYXS_XGXS_LANE_STAT_LANE2 |
> +		    PHYXS_XGXS_LANE_STAT_LANE1 |
> +		    PHYXS_XGXS_LANE_STAT_LANE0))
> +		goto out;
> +
> +	link_up = 1;
> +	np->link_config.active_speed = SPEED_10000;
> +	np->link_config.active_duplex = DUPLEX_FULL;
> +
> +out:
> +	spin_unlock_irqrestore(&np->lock, flags);
> +
> +	*link_up_p = link_up;
> +	return 0;
> +}

[...]

> +static void niu_set_primary_mac(struct niu *np, unsigned char *addr)
> +{
> +	u16 reg0 = addr[4] << 8 | addr[5];
> +	u16 reg1 = addr[2] << 8 | addr[3];
> +	u16 reg2 = addr[0] << 8 | addr[1];
> +
> +	if (np->flags & NIU_FLAGS_XMAC) {
> +		nw64_mac(XMAC_ADDR0, reg0);
> +		nw64_mac(XMAC_ADDR1, reg1);
> +		nw64_mac(XMAC_ADDR2, reg2);
> +	} else {
> +		nw64_mac(BMAC_ADDR0, reg0);
> +		nw64_mac(BMAC_ADDR1, reg1);
> +		nw64_mac(BMAC_ADDR2, reg2);
> +	}
> +}
> +
> +static int niu_num_alt_addr(struct niu *np)
static int niu_num_alt_addr(const struct niu *np)

> +{
> +	if (np->flags & NIU_FLAGS_XMAC)
> +		return XMAC_NUM_ALT_ADDR;
> +	else
> +		return BMAC_NUM_ALT_ADDR;
> +}
> +

[...]

> +static void niu_set_max_burst(struct niu *np, struct tx_ring_info *rp)
> +{
> +	int mtu = np->dev->mtu;
> +
> +	rp->max_burst = mtu + 32;
> +	if (rp->max_burst > 4096)
> +		rp->max_burst = 4096;

Why 32 and 4096? (Magic values)

> +}
> +

... ok, I stop here, since this drivers is damn big :-)

Best Regards

Ingo Oeser

^ permalink raw reply

* Re: e1000e oops, sysfs related?
From: Kok, Auke @ 2007-10-05 16:37 UTC (permalink / raw)
  To: maximilian attems; +Cc: netdev, linux-kernel, Greg KH
In-Reply-To: <20071005131115.GA31453@stro.at>

maximilian attems wrote:
> Linux tau 2.6.23-rc8-mm2-686 #1 SMP Wed Oct 3 23:56:32 CEST 2007 i686
> GNU/Linux
> 
> eth0 renamed to eth1
> sysfs: duplicate filename 'eth1' can not be created
> WARNING: at fs/sysfs/dir.c:433 sysfs_add_one()
>  [<c0104f9c>] dump_trace+0x68/0x1d5
>  [<c0105121>] show_trace_log_lvl+0x18/0x2c
>  [<c0105b9b>] show_trace+0xf/0x11
>  [<c0105c81>] dump_stack+0x12/0x14
>  [<c01ac02e>] sysfs_add_one+0x54/0xb8
>  [<c01acc2a>] sysfs_create_link+0xb3/0x125
>  [<c023c05f>] device_rename+0x13d/0x196
>  [<c025a970>] dev_change_name+0x137/0x205
>  [<c025b12c>] dev_ioctl+0x357/0x44f
>  [<c017b05f>] do_ioctl+0x1f/0x62
>  [<c017b2d9>] vfs_ioctl+0x237/0x249
>  [<c017b330>] sys_ioctl+0x45/0x5d
>  [<c0103eda>] syscall_call+0x7/0xb
>  [<b7edbde4>] 0xb7edbde4
>  =======================
> net eth1: device_rename: sysfs_create_symlink failed (-17)
> 
> 00:19.0 Ethernet controller [0200]: Intel Corporation 82801I (ICH9 Family) Gigabit Ethernet Controller [8086:294c] (rev 02)
>         Subsystem: Intel Corporation Unknown device [8086:0001]
>         Flags: bus master, fast devsel, latency 0, IRQ 218
>         Memory at 50380000 (32-bit, non-prefetchable) [size=128K]
>         Memory at 503a4000 (32-bit, non-prefetchable) [size=4K]
>         I/O ports at 20e0 [size=32]
>         Capabilities: [c8] Power Management version 2
>         Capabilities: [d0] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable+
>         Capabilities: [e0] Vendor Specific Information
> 
> 
> no idea if aboves belongs to netdev or sysfs dep.

I'm seeing the same when removing/inserting network drivers frequently, ixgbe does
the same thing: (git://davem/net-2.6.24)

ixgbe 0000:01:00.0: (PCI Express:2.5Gb/s:Width x8) 00:1a:64:3b:81:c3
ixgbe 0000:01:00.0: MAC: 0, PHY: 0, PBA No: d95854-003
ixgbe 0000:01:00.0: Intel(R) 10 Gigabit Network Connection
net eth2: device_rename: sysfs_create_symlink failed (-17)

but I can't make it throw a stack trace.

perhaps one of the sysfs knowledgeable people can take a look at this. We might be
doing something wrong in e1000e / ixgbe at setup time, but I have no idea what.

Auke

> 

^ permalink raw reply

* Re: [PATCH 5/5] make netlink user -> kernel interface synchronious
From: Patrick McHardy @ 2007-10-05 16:24 UTC (permalink / raw)
  To: Denis V. Lunev; +Cc: davem, netdev, kuznet, devel, containers
In-Reply-To: <20071005144844.GA7119@iris.sw.ru>

Denis V. Lunev wrote:
> This patch make processing netlink user -> kernel messages synchronious.
> This change was inspired by the talk with Alexey Kuznetsov about current
> netlink messages processing. He says that he was badly wrong when introduced 
> asynchronious user -> kernel communication.
> 
> The call netlink_unicast is the only path to send message to the kernel
> netlink socket. But, unfortunately, it is also used to send data to the
> user.
> 
> Before this change the user message has been attached to the socket queue
> and sk->sk_data_ready was called. The process has been blocked until all
> pending messages were processed. The bad thing is that this processing
> may occur in the arbitrary process context.
> 
> This patch changes nlk->data_ready callback to get 1 skb and force packet
> processing right in the netlink_unicast.


I guess the process credential stuff in netlink_skb_params can now
be removed as well.

^ permalink raw reply

* [PATCH net-2.6.24] s2io: sparse warnings fix
From: Stephen Hemminger @ 2007-10-05 16:07 UTC (permalink / raw)
  To: David S. Miller, Jeff Garzik, Ramkrishna Vepa, Raapur Santosh,
	Sivakumar 
  Cc: netdev

Fix warnings from sparse checker about shadowed definition and improperly
formatted ethtool_strings.

I chose to change module parameter rather than uglify the code by changing
the variable name.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
  CHECK   drivers/net/s2io.c
drivers/net/s2io.c:2892:15: warning: symbol 'lro' shadows an earlier one
drivers/net/s2io.c:471:1: originally declared here
drivers/net/s2io.c:7021:13: warning: symbol 'lro' shadows an earlier one
drivers/net/s2io.c:471:1: originally declared here
drivers/net/s2io.c:279:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:280:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:281:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:282:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:283:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:284:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:285:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:286:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:287:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:288:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:289:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:290:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:291:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:292:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:293:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:294:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:295:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:296:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:297:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:298:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:299:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:300:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:301:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:302:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:303:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:304:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:305:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:306:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:307:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:308:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:309:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:310:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:311:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:312:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:313:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:314:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:315:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:316:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:317:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:318:3: warning: array initialized from parenthesized string constant
drivers/net/s2io.c:1762:6: warning: symbol 'en_dis_err_alarms' was not declared. Should it be static?
include/linux/mm.h:587:9: warning: potentially expensive pointer subtraction
drivers/net/s2io.c:4231:5: warning: symbol 'do_s2io_chk_alarm_bit' was not declared. Should it be static?
drivers/net/s2io.c:7801:12: warning: symbol 's2io_starter' was not declared. Should it be static?


--- a/drivers/net/s2io.c	2007-10-05 08:09:07.000000000 -0700
+++ b/drivers/net/s2io.c	2007-10-05 09:06:40.000000000 -0700
@@ -38,7 +38,7 @@
  * Tx descriptors that can be associated with each corresponding FIFO.
  * intr_type: This defines the type of interrupt. The values can be 0(INTA),
  *     2(MSI_X). Default value is '2(MSI_X)'
- * lro: Specifies whether to enable Large Receive Offload (LRO) or not.
+ * lro_enable: Specifies whether to enable Large Receive Offload (LRO) or not.
  *     Possible values '1' for enable '0' for disable. Default is '0'
  * lro_max_pkts: This parameter defines maximum number of packets can be
  *     aggregated as a single large packet
@@ -276,46 +276,46 @@ static char ethtool_driver_stats_keys[][
 	{"ring_5_full_cnt"},
 	{"ring_6_full_cnt"},
 	{"ring_7_full_cnt"},
-	("alarm_transceiver_temp_high"),
-	("alarm_transceiver_temp_low"),
-	("alarm_laser_bias_current_high"),
-	("alarm_laser_bias_current_low"),
-	("alarm_laser_output_power_high"),
-	("alarm_laser_output_power_low"),
-	("warn_transceiver_temp_high"),
-	("warn_transceiver_temp_low"),
-	("warn_laser_bias_current_high"),
-	("warn_laser_bias_current_low"),
-	("warn_laser_output_power_high"),
-	("warn_laser_output_power_low"),
-	("lro_aggregated_pkts"),
-	("lro_flush_both_count"),
-	("lro_out_of_sequence_pkts"),
-	("lro_flush_due_to_max_pkts"),
-	("lro_avg_aggr_pkts"),
-	("mem_alloc_fail_cnt"),
-	("pci_map_fail_cnt"),
-	("watchdog_timer_cnt"),
-	("mem_allocated"),
-	("mem_freed"),
-	("link_up_cnt"),
-	("link_down_cnt"),
-	("link_up_time"),
-	("link_down_time"),
-	("tx_tcode_buf_abort_cnt"),
-	("tx_tcode_desc_abort_cnt"),
-	("tx_tcode_parity_err_cnt"),
-	("tx_tcode_link_loss_cnt"),
-	("tx_tcode_list_proc_err_cnt"),
-	("rx_tcode_parity_err_cnt"),
-	("rx_tcode_abort_cnt"),
-	("rx_tcode_parity_abort_cnt"),
-	("rx_tcode_rda_fail_cnt"),
-	("rx_tcode_unkn_prot_cnt"),
-	("rx_tcode_fcs_err_cnt"),
-	("rx_tcode_buf_size_err_cnt"),
-	("rx_tcode_rxd_corrupt_cnt"),
-	("rx_tcode_unkn_err_cnt"),
+	{"alarm_transceiver_temp_high"},
+	{"alarm_transceiver_temp_low"},
+	{"alarm_laser_bias_current_high"},
+	{"alarm_laser_bias_current_low"},
+	{"alarm_laser_output_power_high"},
+	{"alarm_laser_output_power_low"},
+	{"warn_transceiver_temp_high"},
+	{"warn_transceiver_temp_low"},
+	{"warn_laser_bias_current_high"},
+	{"warn_laser_bias_current_low"},
+	{"warn_laser_output_power_high"},
+	{"warn_laser_output_power_low"},
+	{"lro_aggregated_pkts"},
+	{"lro_flush_both_count"},
+	{"lro_out_of_sequence_pkts"},
+	{"lro_flush_due_to_max_pkts"},
+	{"lro_avg_aggr_pkts"},
+	{"mem_alloc_fail_cnt"},
+	{"pci_map_fail_cnt"},
+	{"watchdog_timer_cnt"},
+	{"mem_allocated"},
+	{"mem_freed"},
+	{"link_up_cnt"},
+	{"link_down_cnt"},
+	{"link_up_time"},
+	{"link_down_time"},
+	{"tx_tcode_buf_abort_cnt"},
+	{"tx_tcode_desc_abort_cnt"},
+	{"tx_tcode_parity_err_cnt"},
+	{"tx_tcode_link_loss_cnt"},
+	{"tx_tcode_list_proc_err_cnt"},
+	{"rx_tcode_parity_err_cnt"},
+	{"rx_tcode_abort_cnt"},
+	{"rx_tcode_parity_abort_cnt"},
+	{"rx_tcode_rda_fail_cnt"},
+	{"rx_tcode_unkn_prot_cnt"},
+	{"rx_tcode_fcs_err_cnt"},
+	{"rx_tcode_buf_size_err_cnt"},
+	{"rx_tcode_rxd_corrupt_cnt"},
+	{"rx_tcode_unkn_err_cnt"},
 	{"tda_err_cnt"},
 	{"pfc_err_cnt"},
 	{"pcc_err_cnt"},
@@ -468,7 +468,7 @@ S2IO_PARM_INT(rxsync_frequency, 3);
 /* Interrupt type. Values can be 0(INTA), 2(MSI_X) */
 S2IO_PARM_INT(intr_type, 2);
 /* Large receive offload feature */
-S2IO_PARM_INT(lro, 0);
+S2IO_PARM_INT(lro_enable, 0);
 /* Max pkts to be aggregated by LRO at one time. If not specified,
  * aggregation happens until we hit max IP pkt size(64K)
  */
@@ -1759,7 +1759,7 @@ static void do_s2io_write_bits(u64 value
 	writeq(temp64, addr);
 }
 
-void en_dis_err_alarms(struct s2io_nic *nic, u16 mask, int flag)
+static void en_dis_err_alarms(struct s2io_nic *nic, u16 mask, int flag)
 {
 	struct XENA_dev_config __iomem *bar0 = nic->bar0;
 	register u64 gen_int_mask = 0;
@@ -4228,7 +4228,7 @@ static void s2io_txpic_intr_handle(struc
  *  1 - if alarm bit set
  *  0 - if alarm bit is not set
  */
-int do_s2io_chk_alarm_bit(u64 value, void __iomem * addr,
+static int do_s2io_chk_alarm_bit(u64 value, void __iomem * addr,
 			  unsigned long long *cnt)
 {
 	u64 val64;
@@ -7135,7 +7135,8 @@ static int rx_osm_handler(struct ring_in
 				int ret = 0;
 
 				ret = s2io_club_tcp_session(skb->data, &tcp,
-						&tcp_len, &lro, rxdp, sp);
+							    &tcp_len, &lro,
+							    rxdp, sp);
 				switch (ret) {
 					case 3: /* Begin anew */
 						lro->parent = skb;
@@ -7451,7 +7452,7 @@ s2io_init_nic(struct pci_dev *pdev, cons
 	else
 		sp->device_type = XFRAME_I_DEVICE;
 
-	sp->lro = lro;
+	sp->lro = lro_enable;
 
 	/* Initialize some PCI/PCI-X fields of the NIC. */
 	s2io_init_pci(sp);
@@ -7798,7 +7799,7 @@ static void __devexit s2io_rem_nic(struc
  * the module loadable parameters and initializes PCI configuration space.
  */
 
-int __init s2io_starter(void)
+static int __init s2io_starter(void)
 {
 	return pci_register_driver(&s2io_driver);
 }

^ permalink raw reply

* Re: [RFC/PATCH 4/4] UDP memory usage accounting (take 4): memory limitation
From: Stephen Hemminger @ 2007-10-05 15:52 UTC (permalink / raw)
  To: Satoshi OSHIMA
  Cc: Andi Kleen, David Miller, Evgeniy Polyakov, Herbert Xu, netdev,
	?? ??, Yumiko SUGITA, ??@RedHat
In-Reply-To: <47065217.5050004@hitachi.com>

On Sat, 06 Oct 2007 00:02:47 +0900
Satoshi OSHIMA <satoshi.oshima.fk@hitachi.com> wrote:

> This patch introduces memory limitation for UDP.
> 
> 
> signed-off-by: Satoshi Oshima <satoshi.oshima.fk@hitachi.com>
> signed-off-by: Hideo Aoki <haoki@redhat.com>

> Index: 2.6.23-rc9-udp_limit/net/ipv4/sysctl_net_ipv4.c
> ===================================================================
> --- 2.6.23-rc9-udp_limit.orig/net/ipv4/sysctl_net_ipv4.c
> +++ 2.6.23-rc9-udp_limit/net/ipv4/sysctl_net_ipv4.c
> @@ -17,6 +17,7 @@
>  #include <net/ip.h>
>  #include <net/route.h>
>  #include <net/tcp.h>
> +#include <net/udp.h>
>  #include <net/cipso_ipv4.h>
>  
>  /* From af_inet.c */
> @@ -599,6 +600,14 @@ ctl_table ipv4_table[] = {
>  		.proc_handler	= &proc_dointvec
>  	},
>  	{
> +		.ctl_name	= NET_UDP_MEM,
> +		.procname	= "udp_mem",
> +		.data		= &sysctl_udp_mem,
> +		.maxlen		= sizeof(sysctl_udp_mem),
> +		.mode		= 0644,
> +		.proc_handler	= &proc_dointvec
> +	},
> +	{
>  		.ctl_name	= NET_TCP_APP_WIN,
>  		.procname	= "tcp_app_win",
>  		.data		= &sysctl_tcp_app_win,

if you use &proc_dointvec_minmax, then you could inforce min/max
values for udp_mem for the sysctl
-- 
Stephen Hemminger <shemminger@linux-foundation.org>

^ permalink raw reply


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