Netdev List
 help / color / mirror / Atom feed
* (unknown), 
From: Mr.Vincent Cheng @ 2011-12-07  0:24 UTC (permalink / raw)





I am Mr.Vincent Cheng, GBS, JP Chairman of the Hong Kong and Shanghai
BankingCorporation Limited. I have a business proposal of USD
$10,500,000.00. Your
earliest response to this letter will be appreciated, upon the confirmation
of your response all further details and document will be issued to you.

Endeavour to let me know your decision rather than keep me waiting

Email:vincentcheng048@yahoo.co.jp

Best Regards,
Mr.Vincent Cheng

^ permalink raw reply

* [PATCH] add netpoll support for 802.1q vlans
From: Benjamin LaHaise @ 2011-12-07  1:04 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

Add netpoll support to 802.1q vlan devices.  Based on the netpoll support 
in the bridging code.  Tested on a forced_eth device with netconsole.

Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>

diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h
index 9fd45f3..df562b5 100644
--- a/net/8021q/vlan.h
+++ b/net/8021q/vlan.h
@@ -40,6 +40,8 @@ struct vlan_pcpu_stats {
 	u32			tx_dropped;
 };
 
+struct netpoll;
+
 /**
  *	struct vlan_dev_info - VLAN private device data
  *	@nr_ingress_mappings: number of ingress priority mappings
@@ -67,6 +69,9 @@ struct vlan_dev_info {
 
 	struct proc_dir_entry			*dent;
 	struct vlan_pcpu_stats __percpu		*vlan_pcpu_stats;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	struct netpoll				*netpoll;
+#endif
 };
 
 static inline struct vlan_dev_info *vlan_dev_info(const struct net_device *dev)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 2b5fcde..98417ff 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -33,6 +33,7 @@
 #include "vlan.h"
 #include "vlanproc.h"
 #include <linux/if_vlan.h>
+#include <linux/netpoll.h>
 
 /*
  *	Rebuild the Ethernet MAC header. This is called after an ARP
@@ -158,6 +159,8 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
 
 	skb_set_dev(skb, vlan_dev_info(dev)->real_dev);
 	len = skb->len;
+	if (netpoll_tx_running(dev))
+		return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev);
 	ret = dev_queue_xmit(skb);
 
 	if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {
@@ -660,6 +663,60 @@ static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, st
 	return stats;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+void vlan_dev_poll_controller(struct net_device *dev)
+{
+	struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
+
+	if (real_dev->netdev_ops->ndo_poll_controller)
+		real_dev->netdev_ops->ndo_poll_controller(real_dev);
+}
+
+int vlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info *npinfo)
+{
+	struct vlan_dev_info *info = vlan_dev_info(dev);
+	struct net_device *real_dev = info->real_dev;
+	struct netpoll *netpoll;
+	int err = 0;
+
+	netpoll = kzalloc(sizeof(*netpoll), GFP_KERNEL);
+	err = -ENOMEM;
+	if (!netpoll)
+		goto out;
+
+	netpoll->dev = real_dev;
+	strlcpy(netpoll->dev_name, real_dev->name, IFNAMSIZ);
+
+	err = __netpoll_setup(netpoll);
+	if (err) {
+		kfree(netpoll);
+		goto out;
+	}
+
+	info->netpoll = netpoll;
+
+out:
+	return err;
+}
+
+void vlan_dev_netpoll_cleanup(struct net_device *dev)
+{
+	struct vlan_dev_info *info = vlan_dev_info(dev);
+	struct netpoll *netpoll = info->netpoll;
+
+	if (!netpoll)
+		return;
+
+	info->netpoll = NULL;
+
+        /* Wait for transmitting packets to finish before freeing. */
+        synchronize_rcu_bh();
+
+        __netpoll_cleanup(netpoll);
+        kfree(netpoll);
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 static const struct ethtool_ops vlan_ethtool_ops = {
 	.get_settings	        = vlan_ethtool_get_settings,
 	.get_drvinfo	        = vlan_ethtool_get_drvinfo,
@@ -688,6 +745,11 @@ static const struct net_device_ops vlan_netdev_ops = {
 	.ndo_fcoe_get_wwn	= vlan_dev_fcoe_get_wwn,
 	.ndo_fcoe_ddp_target	= vlan_dev_fcoe_ddp_target,
 #endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller	= vlan_dev_poll_controller,
+	.ndo_netpoll_setup	= vlan_dev_netpoll_setup,
+	.ndo_netpoll_cleanup	= vlan_dev_netpoll_cleanup,
+#endif
 	.ndo_fix_features	= vlan_dev_fix_features,
 };
 

^ permalink raw reply related

* Re: v6: faster tree-based sysctl implementation
From: Lucian Adrian Grijincu @ 2011-12-07  1:44 UTC (permalink / raw)
  To: Anca Emanuel
  Cc: Eric W . Biederman, linux-kernel, netdev, Octavian Purdila,
	David S . Miller, Alexey Dobriyan, Damien Millescamps,
	Stephen Rothwell
In-Reply-To: <CAJL_dMvbL0LBrJ4irP3vd_PA458i0YefWpmvMgphuT+TnF2O5Q@mail.gmail.com>

On Wed, Dec 7, 2011 at 2:08 AM, Anca Emanuel <anca.emanuel@gmail.com> wrote:
> You can ask Stephen Rothwell to include your tree in next.
> git://github.com/luciang/linux-2.6-new-sysctl.git  v6-new-sysctl-alg


Thank you Anca, but I don't want to pollute Stephen's linux-next tree ATM.
I'd wait until a maintainer chimes in and agrees that this approach is sound.

-- 
 .
..: Lucian

^ permalink raw reply

* [PATCH] ppp: fix pptp double release_sock in pptp_bind()
From: Djalal Harouni @ 2011-12-07  1:47 UTC (permalink / raw)
  To: Dmitry Kozlov; +Cc: netdev, linux-kernel


Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
---
 drivers/net/ppp/pptp.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 89f829f..f8a6853 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -423,10 +423,8 @@ static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,
 	lock_sock(sk);
 
 	opt->src_addr = sp->sa_addr.pptp;
-	if (add_chan(po)) {
-		release_sock(sk);
+	if (add_chan(po))
 		error = -EBUSY;
-	}
 
 	release_sock(sk);
 	return error;
-- 
1.7.1

^ permalink raw reply related

* [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Michael Wang @ 2011-12-07  2:33 UTC (permalink / raw)
  To: e1000-devel@lists.sourceforge.net
  Cc: netdev@vger.kernel.org, Michael Wang, Jeff Kirsher,
	wangyunlinux@gmail.com, Jesse Brandeburg

From: Michael Wang <wangyun@linux.vnet.ibm.com>

Use true and false instead of 1 and 0 when assign value to a bool type
variable.

This patch is try to keep the style of driver, and according to David's
suggestion on patch "e1000e: Avoid wrong check on TX hang":

http://marc.info/?l=linux-netdev&m=132296931201839&w=2

v2: add more description

Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
---
 drivers/net/ethernet/intel/e1000e/netdev.c |   34
++++++++++++++--------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c
b/drivers/net/ethernet/intel/e1000e/netdev.c
index a855db1..2e5e423 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -875,7 +875,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter
*adapter,
 	u32 length, staterr;
 	unsigned int i;
 	int cleaned_count = 0;
-	bool cleaned = 0;
+	bool cleaned = false;
 	unsigned int total_rx_bytes = 0, total_rx_packets = 0;

 	i = rx_ring->next_to_clean;
@@ -904,7 +904,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter
*adapter,

 		next_buffer = &rx_ring->buffer_info[i];

-		cleaned = 1;
+		cleaned = true;
 		cleaned_count++;
 		dma_unmap_single(&pdev->dev,
 				 buffer_info->dma,
@@ -1150,7 +1150,7 @@ static bool e1000_clean_tx_irq(struct
e1000_adapter *adapter)
 		 * Detect a transmit hang in hardware, this serializes the
 		 * check with the clearing of time_stamp and movement of i
 		 */
-		adapter->detect_tx_hung = 0;
+		adapter->detect_tx_hung = false;
 		if (tx_ring->buffer_info[i].time_stamp &&
 		    time_after(jiffies, tx_ring->buffer_info[i].time_stamp
 			       + (adapter->tx_timeout_factor * HZ)) &&
@@ -1185,7 +1185,7 @@ static bool e1000_clean_rx_irq_ps(struct
e1000_adapter *adapter,
 	unsigned int i, j;
 	u32 length, staterr;
 	int cleaned_count = 0;
-	bool cleaned = 0;
+	bool cleaned = false;
 	unsigned int total_rx_bytes = 0, total_rx_packets = 0;

 	i = rx_ring->next_to_clean;
@@ -1211,7 +1211,7 @@ static bool e1000_clean_rx_irq_ps(struct
e1000_adapter *adapter,

 		next_buffer = &rx_ring->buffer_info[i];

-		cleaned = 1;
+		cleaned = true;
 		cleaned_count++;
 		dma_unmap_single(&pdev->dev, buffer_info->dma,
 				 adapter->rx_ps_bsize0, DMA_FROM_DEVICE);
@@ -1628,7 +1628,7 @@ static irqreturn_t e1000_intr_msi(int irq, void *data)
 	 */

 	if (icr & E1000_ICR_LSC) {
-		hw->mac.get_link_status = 1;
+		hw->mac.get_link_status = true;
 		/*
 		 * ICH8 workaround-- Call gig speed drop workaround on cable
 		 * disconnect (LSC) before accessing any PHY registers
@@ -1694,7 +1694,7 @@ static irqreturn_t e1000_intr(int irq, void *data)
 	 */

 	if (icr & E1000_ICR_LSC) {
-		hw->mac.get_link_status = 1;
+		hw->mac.get_link_status = true;
 		/*
 		 * ICH8 workaround-- Call gig speed drop workaround on cable
 		 * disconnect (LSC) before accessing any PHY registers
@@ -1751,7 +1751,7 @@ static irqreturn_t e1000_msix_other(int irq, void
*data)
 	if (icr & E1000_ICR_OTHER) {
 		if (!(icr & E1000_ICR_LSC))
 			goto no_link_interrupt;
-		hw->mac.get_link_status = 1;
+		hw->mac.get_link_status = true;
 		/* guard against interrupt when we're going down */
 		if (!test_bit(__E1000_DOWN, &adapter->state))
 			mod_timer(&adapter->watchdog_timer, jiffies + 1);
@@ -3327,7 +3327,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
 		fc->pause_time = 0xFFFF;
 	else
 		fc->pause_time = E1000_FC_PAUSE_TIME;
-	fc->send_xon = 1;
+	fc->send_xon = true;
 	fc->current_mode = fc->requested_mode;

 	switch (hw->mac.type) {
@@ -4183,7 +4183,7 @@ static void e1000_print_link_info(struct
e1000_adapter *adapter)
 static bool e1000e_has_link(struct e1000_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
-	bool link_active = 0;
+	bool link_active = false;
 	s32 ret_val = 0;

 	/*
@@ -4198,7 +4198,7 @@ static bool e1000e_has_link(struct e1000_adapter
*adapter)
 			ret_val = hw->mac.ops.check_for_link(hw);
 			link_active = !hw->mac.get_link_status;
 		} else {
-			link_active = 1;
+			link_active = true;
 		}
 		break;
 	case e1000_media_type_fiber:
@@ -4297,7 +4297,7 @@ static void e1000_watchdog_task(struct work_struct
*work)

 	if (link) {
 		if (!netif_carrier_ok(netdev)) {
-			bool txb2b = 1;
+			bool txb2b = true;

 			/* Cancel scheduled suspend requests. */
 			pm_runtime_resume(netdev->dev.parent);
@@ -4333,11 +4333,11 @@ static void e1000_watchdog_task(struct
work_struct *work)
 			adapter->tx_timeout_factor = 1;
 			switch (adapter->link_speed) {
 			case SPEED_10:
-				txb2b = 0;
+				txb2b = false;
 				adapter->tx_timeout_factor = 16;
 				break;
 			case SPEED_100:
-				txb2b = 0;
+				txb2b = false;
 				adapter->tx_timeout_factor = 10;
 				break;
 			}
@@ -4473,7 +4473,7 @@ link_up:
 	e1000e_flush_descriptors(adapter);

 	/* Force detection of hung controller every watchdog period */
-	adapter->detect_tx_hung = 1;
+	adapter->detect_tx_hung = true;

 	/*
 	 * With 82571 controllers, LAA may be overwritten due to controller
@@ -6134,8 +6134,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 	INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);

 	/* Initialize link parameters. User can change them with ethtool */
-	adapter->hw.mac.autoneg = 1;
-	adapter->fc_autoneg = 1;
+	adapter->hw.mac.autoneg = true;
+	adapter->fc_autoneg = true;
 	adapter->hw.fc.requested_mode = e1000_fc_default;
 	adapter->hw.fc.current_mode = e1000_fc_default;
 	adapter->hw.phy.autoneg_advertised = 0x2f;
-- 
1.7.4.1

^ permalink raw reply related

* Re: [net-next RFC PATCH 5/5] virtio-net: flow director support
From: Jason Wang @ 2011-12-07  3:03 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: krkumar2, kvm, mst, netdev, virtualization, levinsasha928,
	bhutchings
In-Reply-To: <CAJSP0QXsLwvH5xYj6h0E_V4VLg6DuUc-GKXu9esEYzL2MFcFGw@mail.gmail.com>

On 12/06/2011 09:15 PM, Stefan Hajnoczi wrote:
> On Tue, Dec 6, 2011 at 10:21 AM, Jason Wang<jasowang@redhat.com>  wrote:
>> On 12/06/2011 05:18 PM, Stefan Hajnoczi wrote:
>>> On Tue, Dec 6, 2011 at 6:33 AM, Jason Wang<jasowang@redhat.com>    wrote:
>>>> On 12/05/2011 06:55 PM, Stefan Hajnoczi wrote:
>>>>> On Mon, Dec 5, 2011 at 8:59 AM, Jason Wang<jasowang@redhat.com>
>>>>>   wrote:
>>> The vcpus are just threads and may not be bound to physical CPUs, so
>>> what is the big picture here?  Is the guest even in the position to
>>> set the best queue mappings today?
>>
>> Not sure it could publish the best mapping but the idea is to make sure the
>> packets of a flow were handled by the same guest vcpu and may be the same
>> vhost thread in order to eliminate the packet reordering and lock
>> contention. But this assumption does not take the bouncing of vhost or vcpu
>> threads which would also affect the result.
> Okay, this is why I'd like to know what the big picture here is.  What
> solution are you proposing?  How are we going to have everything from
> guest application, guest kernel, host threads, and host NIC driver
> play along so we get the right steering up the entire stack.  I think
> there needs to be an answer to that before changing virtio-net to add
> any steering mechanism.

Consider the complexity of the host nic each with their own steering 
features,  this series make the first step with minimal effort to try to 
let guest driver and host tap/macvtap co-operate like what physical nic 
does. There may be other method, but performance numbers is also needed 
to give the answer.
>
> Stefan
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Jeff Kirsher @ 2011-12-07  3:43 UTC (permalink / raw)
  To: Michael Wang
  Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <4EDED071.40900@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 724 bytes --]

On Tue, 2011-12-06 at 18:33 -0800, Michael Wang wrote:
> From: Michael Wang <wangyun@linux.vnet.ibm.com>
> 
> Use true and false instead of 1 and 0 when assign value to a bool type
> variable.
> 
> This patch is try to keep the style of driver, and according to
> David's
> suggestion on patch "e1000e: Avoid wrong check on TX hang":
> 
> http://marc.info/?l=linux-netdev&m=132296931201839&w=2
> 
> v2: add more description
> 
> Signed-off-by: Michael Wang <wangyun@linux.vnet.ibm.com>
> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c |   34
> ++++++++++++++--------------
>  1 files changed, 17 insertions(+), 17 deletions(-) 

Thanks Michael, I have added your patch to my queue of e1000e patches.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Joe Perches @ 2011-12-07  4:14 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: Michael Wang, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <1323229439.2415.23.camel@jtkirshe-mobl>

On Tue, 2011-12-06 at 19:43 -0800, Jeff Kirsher wrote:
> On Tue, 2011-12-06 at 18:33 -0800, Michael Wang wrote:
> > From: Michael Wang <wangyun@linux.vnet.ibm.com>
> > Use true and false instead of 1 and 0 when assign value to a bool type
> > variable.
> Thanks Michael, I have added your patch to my queue of e1000e patches.

There are more of these uses in intel drivers.

Perhaps you could run this cocci/spatch
on drivers/net/ethernet/intel/...

$ cat bool.cocci
@@
bool b;
@@

-b = 0;
+b = false;

@@
bool b;
@@

-b = 1;
+b = true;

$ git ls-files drivers/net/ethernet/intel/ | grep "\.c$" | while read file ; do spatch -in_place -sp_file bool.cocci $file ; done

^ permalink raw reply

* Re: r8169 performance?
From: Chris Adams @ 2011-12-07  4:19 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, hayeswang
In-Reply-To: <20111206082247.GA29089@electric-eye.fr.zoreil.com>

Once upon a time, Francois Romieu <romieu@fr.zoreil.com> said:
> It will disappear once http://marc.info/?l=linux-netdev&m=132306718323579
> is applied. You may apply http://marc.info/?l=linux-netdev&m=132306715823570
> too but I doubt it will make much difference for you.

I'll give it a try to double-check (it'll probably be a few days before
I can get to it).

> > Also, they load different firmware (so I guess my problem could be firmware
> > related, which I guess only RealTek could find/fix).
> >
> > I guess my question is this: is there a chance this can be solved with
> > driver changes, or should I just accept that the on-board NIC has poor
> > performance and install an add-in NIC?
> 
> (I understand that the systems (CPU, bus...) are not necessary the same.)
> 
> Did you check if Tx checksumming is enabled ?
> 
> It could make a noticeable difference.

That is off on both of my r8169 systems.  Enabling it on the "good"
system killed networking (even my existing SSH session was hung) until I
re-disabled it.  Enabling it on the "problem" system didn't appear to
make any significant difference.

The otherwise "good" system is running an older kernel (Fedora 14,
2.6.35.14); maybe some changes have been made so that "tx on" works on a
newer driver?  Or maybe the slightly different chip revision is the
difference.
-- 
Chris Adams <cmadams@hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

^ permalink raw reply

* [PATCH 1/1] xfrm: Apply commit 4203223a1aed862b4445fdcd260d6139603a51d9 to 2.6.32 stable series
From: Calvin Owens @ 2011-12-07  4:37 UTC (permalink / raw)
  To: stable; +Cc: David S. Miller, Calvin Owens, netdev, linux-kernel

From: Calvin Owens <calvinow@Beethoven.(none)>

This fix was applied to 3.0.3, but was not applied to earlier series. Distros based
on this (Debian Squeeze, among others) likely haven't got it in, which prevents
AES-CTR from being used for IPsec.

Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
Signed-off-by: Calvin Owens <calvinow@Beethoven.(none)>
---
 net/xfrm/xfrm_algo.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index faf54c6..9bd850a 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -411,8 +411,8 @@ static struct xfrm_algo_desc ealg_list[] = {
 	.desc = {
 		.sadb_alg_id = SADB_X_EALG_AESCTR,
 		.sadb_alg_ivlen	= 8,
-		.sadb_alg_minbits = 128,
-		.sadb_alg_maxbits = 256
+		.sadb_alg_minbits = 160,
+		.sadb_alg_maxbits = 288
 	}
 },
 };
-- 
1.7.4.1

^ permalink raw reply related

* Re: [PATCH 1/1] xfrm: Apply commit 4203223a1aed862b4445fdcd260d6139603a51d9 to 2.6.32 stable series
From: Calvin Owens @ 2011-12-07  4:42 UTC (permalink / raw)
  To: stable; +Cc: David S. Miller, netdev, linux-kernel
In-Reply-To: <1323232633-4307-1-git-send-email-jcalvinowens@gmail.com>

On Tue, 2011-12-06 at 22:37 -0600, Calvin Owens wrote:
> Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
> Signed-off-by: Calvin Owens <calvinow@Beethoven.(none)>

Apologies for the double "Signed-off-by:" line...

^ permalink raw reply

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Michael Wang @ 2011-12-07  4:49 UTC (permalink / raw)
  To: Joe Perches
  Cc: jeffrey.t.kirsher, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <1323231268.1762.19.camel@joe2Laptop>

On 12/07/2011 12:14 PM, Joe Perches wrote:

> On Tue, 2011-12-06 at 19:43 -0800, Jeff Kirsher wrote:
>> On Tue, 2011-12-06 at 18:33 -0800, Michael Wang wrote:
>>> From: Michael Wang <wangyun@linux.vnet.ibm.com>
>>> Use true and false instead of 1 and 0 when assign value to a bool type
>>> variable.
>> Thanks Michael, I have added your patch to my queue of e1000e patches.
> 
> There are more of these uses in intel drivers.
> 
> Perhaps you could run this cocci/spatch
> on drivers/net/ethernet/intel/...
> 
> $ cat bool.cocci
> @@
> bool b;
> @@
> 
> -b = 0;
> +b = false;
> 
> @@
> bool b;
> @@
> 
> -b = 1;
> +b = true;
> 
> $ git ls-files drivers/net/ethernet/intel/ | grep "\.c$" | while read file ; do spatch -in_place -sp_file bool.cocci $file ; done
> 
> 

Hi, Joe

I think there are lots of such cases in kernel, and I think it is a
legacy issue with some story in it.

The reason I only change the e1000e is that the patch I send before will
broken the style of e1000e, because it's using true and false, not 1 and 0.

I think this will be a huge work if we want to correct all these cases,
and I think the good way is to separate the work to small pieces and
finish them slowly.

Thanks,
Michael Wang

^ permalink raw reply

* Re: [PATCH] ppp: fix pptp double release_sock in pptp_bind()
From: Eric Dumazet @ 2011-12-07  4:59 UTC (permalink / raw)
  To: Djalal Harouni; +Cc: Dmitry Kozlov, netdev, linux-kernel
In-Reply-To: <20111207014712.GB25869@dztty>

Le mercredi 07 décembre 2011 à 02:47 +0100, Djalal Harouni a écrit :
> Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
> ---
>  drivers/net/ppp/pptp.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
> index 89f829f..f8a6853 100644
> --- a/drivers/net/ppp/pptp.c
> +++ b/drivers/net/ppp/pptp.c
> @@ -423,10 +423,8 @@ static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,
>  	lock_sock(sk);
>  
>  	opt->src_addr = sp->sa_addr.pptp;
> -	if (add_chan(po)) {
> -		release_sock(sk);
> +	if (add_chan(po))
>  		error = -EBUSY;
> -	}
>  
>  	release_sock(sk);
>  	return error;

Nice catch !

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

^ permalink raw reply

* Re: [PATCH] fsl_pq_mdio: Clean up tbi address configuration
From: Kumar Gala @ 2011-12-07  5:35 UTC (permalink / raw)
  To: David Miller; +Cc: afleming, netdev
In-Reply-To: <20111206.004121.1820319056329214972.davem@davemloft.net>


On Dec 5, 2011, at 11:41 PM, David Miller wrote:

> From: Kumar Gala <galak@kernel.crashing.org>
> Date: Mon, 5 Dec 2011 23:38:14 -0600
> 
>> Any comment on getting this patch pulled into net.git?
> 
> It requires a DT patch or related set of changes which have need
> to be done differently as per feedback.
> 
> My understanding is there are two patches required, this revert plus
> the changes to add the tbi property to the DT which are missing it.
> 
> That's why these tbi changes went in to begin with, to handle DT
> which lack the property, or something like that.  So you can't
> just revert this thing without also fixing the DT that lack the
> tbi property, or else you break those systems.

We need this patch in 3.2 regardless of DT.  Currently we get the oops on 3.2 on ALL systems.  Andy should be working up a device tree patch to fix the subset of .dts that are missing the tbi property.

What happens in 'next' is slightly different issue.

- k

^ permalink raw reply

* pull request: batman-adv 2011-12-07
From: Marek Lindner @ 2011-12-07  5:36 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r

David,

we have to more fixes that we would like to get pulled into net-next/linux-3.2.
Both patches address TT protocol misbehavior. Upon merging these patches into
net-next you'll run into merge conflicts.

Patch1:
++<<<<<<< 
 +              tt_global_entry->common.flags |= TT_CLIENT_PENDING;
 +              send_roam_adv(bat_priv, tt_global_entry->common.addr,
++=======
+               tt_global_entry->flags |= TT_CLIENT_ROAM;
+               tt_global_entry->roam_at = jiffies;
+ 
+               send_roam_adv(bat_priv, tt_global_entry->addr,
++>>>>>>> 

Resolution1:
+======
		tt_global_entry->common.flags |= TT_CLIENT_ROAM;
		tt_global_entry->roam_at = jiffies;
		send_roam_adv(bat_priv, tt_global_entry->common.addr,
+======

Patch2:
++<<<<<<< 
 +                      tt_global_entry->common.flags |= TT_CLIENT_ROAM;
 +                      tt_global_entry->roam_at = jiffies;
 +                      goto out;
++=======
+                       /* if we are deleting a global entry due to a roam
+                        * event, there are two possibilities:
+                        * 1) the client roamed from node A to node B => we mark
+                        *    it with TT_CLIENT_ROAM, we start a timer and we
+                        *    wait for node B to claim it. In case of timeout
+                        *    the entry is purged.
+                        * 2) the client roamed to us => we can directly delete
+                        *    the global entry, since it is useless now. */
+                       tt_local_entry = tt_local_hash_find(bat_priv,
+                                                       tt_global_entry->addr);
+                       if (!tt_local_entry) {
+                               tt_global_entry->flags |= TT_CLIENT_ROAM;
+                               tt_global_entry->roam_at = jiffies;
+                               goto out;
+                       }
++>>>>>>>

Resolution2:
+======
			 /* if we are deleting a global entry due to a roam
			 * event, there are two possibilities:
			 * 1) the client roamed from node A to node B => we mark
			 *    it with TT_CLIENT_ROAM, we start a timer and we
			 *    wait for node B to claim it. In case of timeout
			 *    the entry is purged.
			 * 2) the client roamed to us => we can directly delete
			 *    the global entry, since it is useless now. */
			tt_local_entry = tt_local_hash_find(bat_priv,
						tt_global_entry->common.addr);
			if (!tt_local_entry) {
				tt_global_entry->common.flags |= TT_CLIENT_ROAM;
				tt_global_entry->roam_at = jiffies;
				goto out;
			}
+======

Let me know if you have any further question.

Thanks,
Marek

The following changes since commit 1ea6b8f48918282bdca0b32a34095504ee65bab5:

  Linux 3.2-rc1 (2011-11-07 16:16:02 -0800)

are available in the git repository at:
  git://git.open-mesh.org/linux-merge.git batman-adv/maint

Antonio Quartulli (2):
      batman-adv: in case of roaming mark the client with TT_CLIENT_ROAM
      batman-adv: delete global entry in case of roaming

 net/batman-adv/translation-table.c |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

^ permalink raw reply

* [PATCH 1/2] batman-adv: in case of roaming mark the client with TT_CLIENT_ROAM
From: Marek Lindner @ 2011-12-07  5:42 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
	stable-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1323236203-24711-1-git-send-email-lindner_marek-LWAfsSFWpa4@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

In case of a client roaming from node A to node B, the latter have to mark the
corresponding global entry with TT_CLIENT_ROAM (instead of TT_CLIENT_PENDING).

Marking a global entry with TT_CLIENT_PENDING will end up in keeping such entry
forever (because this flag is only meant to be used with local entries and it is
never checked on global ones).

In the worst case (all the clients roaming to the same node A) the local and the
global table will contain exactly the same clients. Batman-adv will continue to
work, but the memory usage is duplicated.

Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
---
 net/batman-adv/translation-table.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index c7aafc7..c46b140 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -245,9 +245,11 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr,
 	if (tt_global_entry) {
 		/* This node is probably going to update its tt table */
 		tt_global_entry->orig_node->tt_poss_change = true;
-		/* The global entry has to be marked as PENDING and has to be
+		/* The global entry has to be marked as ROAMING and has to be
 		 * kept for consistency purpose */
-		tt_global_entry->flags |= TT_CLIENT_PENDING;
+		tt_global_entry->flags |= TT_CLIENT_ROAM;
+		tt_global_entry->roam_at = jiffies;
+
 		send_roam_adv(bat_priv, tt_global_entry->addr,
 			      tt_global_entry->orig_node);
 	}
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 2/2] batman-adv: delete global entry in case of roaming
From: Marek Lindner @ 2011-12-07  5:42 UTC (permalink / raw)
  To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1323236203-24711-1-git-send-email-lindner_marek-LWAfsSFWpa4@public.gmane.org>

From: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>

When receiving a DEL change for a client due to a roaming event (change is
marked with TT_CLIENT_ROAM), each node  has to check if the client roamed
to itself or somewhere else.

In the latter case the global entry is kept to avoid having no route at all
otherwise we can safely delete the global entry

Signed-off-by: Antonio Quartulli <ordex-GaUfNO9RBHfsrOwW+9ziJQ@public.gmane.org>
---
 net/batman-adv/translation-table.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index c46b140..5f09a57 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -696,6 +696,7 @@ void tt_global_del(struct bat_priv *bat_priv,
 		   const char *message, bool roaming)
 {
 	struct tt_global_entry *tt_global_entry = NULL;
+	struct tt_local_entry *tt_local_entry = NULL;
 
 	tt_global_entry = tt_global_hash_find(bat_priv, addr);
 	if (!tt_global_entry)
@@ -703,15 +704,29 @@ void tt_global_del(struct bat_priv *bat_priv,
 
 	if (tt_global_entry->orig_node == orig_node) {
 		if (roaming) {
-			tt_global_entry->flags |= TT_CLIENT_ROAM;
-			tt_global_entry->roam_at = jiffies;
-			goto out;
+			/* if we are deleting a global entry due to a roam
+			 * event, there are two possibilities:
+			 * 1) the client roamed from node A to node B => we mark
+			 *    it with TT_CLIENT_ROAM, we start a timer and we
+			 *    wait for node B to claim it. In case of timeout
+			 *    the entry is purged.
+			 * 2) the client roamed to us => we can directly delete
+			 *    the global entry, since it is useless now. */
+			tt_local_entry = tt_local_hash_find(bat_priv,
+							tt_global_entry->addr);
+			if (!tt_local_entry) {
+				tt_global_entry->flags |= TT_CLIENT_ROAM;
+				tt_global_entry->roam_at = jiffies;
+				goto out;
+			}
 		}
 		_tt_global_del(bat_priv, tt_global_entry, message);
 	}
 out:
 	if (tt_global_entry)
 		tt_global_entry_free_ref(tt_global_entry);
+	if (tt_local_entry)
+		tt_local_entry_free_ref(tt_local_entry);
 }
 
 void tt_global_del_orig(struct bat_priv *bat_priv,
-- 
1.7.5.4

^ permalink raw reply related

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Joe Perches @ 2011-12-07  6:01 UTC (permalink / raw)
  To: Michael Wang
  Cc: jeffrey.t.kirsher, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <4EDEF05F.4020901@linux.vnet.ibm.com>

On Wed, 2011-12-07 at 12:49 +0800, Michael Wang wrote:
> On 12/07/2011 12:14 PM, Joe Perches wrote:
> 
> > On Tue, 2011-12-06 at 19:43 -0800, Jeff Kirsher wrote:
> >> On Tue, 2011-12-06 at 18:33 -0800, Michael Wang wrote:
> >>> From: Michael Wang <wangyun@linux.vnet.ibm.com>
> >>> Use true and false instead of 1 and 0 when assign value to a bool type
> >>> variable.
> >> Thanks Michael, I have added your patch to my queue of e1000e patches.
> > 
> > There are more of these uses in intel drivers.
> > 
> > Perhaps you could run this cocci/spatch
> > on drivers/net/ethernet/intel/...
> > 
> > $ cat bool.cocci
> > @@
> > bool b;
> > @@
> > 
> > -b = 0;
> > +b = false;
> > 
> > @@
> > bool b;
> > @@
> > 
> > -b = 1;
> > +b = true;
> > 
> > $ git ls-files drivers/net/ethernet/intel/ | grep "\.c$" | while read file ; do spatch -in_place -sp_file bool.cocci $file ; done
> > 
> > 
> 
> Hi, Joe
> 
> I think there are lots of such cases in kernel, and I think it is a
> legacy issue with some story in it.

Actually, there are relatively few bool = 0|1; uses.

> The reason I only change the e1000e is that the patch I send before will
> broken the style of e1000e, because it's using true and false, not 1 and 0.

Scriptable fixes are easy.

> I think this will be a huge work if we want to correct all these cases,

Perhaps you're thinking of int uses that could be
converted to bool? There are a lot of those.

This is the diffstat I get for drivers/net/ethernet
for the current uses of bool foo = 0|1;

$ git diff --stat drivers/net
 drivers/net/ethernet/broadcom/tg3.c           |    8 ++++----
 drivers/net/ethernet/brocade/bna/bnad.c       |    4 ++--
 drivers/net/ethernet/dec/tulip/de4x5.c        |    4 ++--
 drivers/net/ethernet/intel/e1000/e1000_main.c |   10 +++++-----
 drivers/net/ethernet/intel/e1000e/netdev.c    |   16 ++++++++--------
 drivers/net/ethernet/intel/ixgb/ixgb_main.c   |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  |    4 ++--
 drivers/net/ethernet/sfc/falcon.c             |    2 +-
 drivers/net/ethernet/sfc/mtd.c                |    6 +++---
 drivers/net/ethernet/tile/tilepro.c           |    4 ++--
 drivers/net/ethernet/xilinx/xilinx_emaclite.c |    4 ++--
 12 files changed, 33 insertions(+), 33 deletions(-)

> and I think the good way is to separate the work to small pieces and
> finish them slowly.

I think that's true for the int->bool conversions.

^ permalink raw reply

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Michael Wang @ 2011-12-07  6:08 UTC (permalink / raw)
  To: Joe Perches
  Cc: jeffrey.t.kirsher, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <1323237700.1762.24.camel@joe2Laptop>

On 12/07/2011 02:01 PM, Joe Perches wrote:

> On Wed, 2011-12-07 at 12:49 +0800, Michael Wang wrote:
>> On 12/07/2011 12:14 PM, Joe Perches wrote:
>>
>>> On Tue, 2011-12-06 at 19:43 -0800, Jeff Kirsher wrote:
>>>> On Tue, 2011-12-06 at 18:33 -0800, Michael Wang wrote:
>>>>> From: Michael Wang <wangyun@linux.vnet.ibm.com>
>>>>> Use true and false instead of 1 and 0 when assign value to a bool type
>>>>> variable.
>>>> Thanks Michael, I have added your patch to my queue of e1000e patches.
>>>
>>> There are more of these uses in intel drivers.
>>>
>>> Perhaps you could run this cocci/spatch
>>> on drivers/net/ethernet/intel/...
>>>
>>> $ cat bool.cocci
>>> @@
>>> bool b;
>>> @@
>>>
>>> -b = 0;
>>> +b = false;
>>>
>>> @@
>>> bool b;
>>> @@
>>>
>>> -b = 1;
>>> +b = true;
>>>
>>> $ git ls-files drivers/net/ethernet/intel/ | grep "\.c$" | while read file ; do spatch -in_place -sp_file bool.cocci $file ; done
>>>
>>>
>>
>> Hi, Joe
>>
>> I think there are lots of such cases in kernel, and I think it is a
>> legacy issue with some story in it.
> 
> Actually, there are relatively few bool = 0|1; uses.
> 
>> The reason I only change the e1000e is that the patch I send before will
>> broken the style of e1000e, because it's using true and false, not 1 and 0.
> 
> Scriptable fixes are easy.

Hi, Joe

I'm not good at script, if you are interested, we can work together to
fix all the remain cases, and send out some patches.

Thanks,
Michael Wang

> 
>> I think this will be a huge work if we want to correct all these cases,
> 
> Perhaps you're thinking of int uses that could be
> converted to bool? There are a lot of those.
> 
> This is the diffstat I get for drivers/net/ethernet
> for the current uses of bool foo = 0|1;
> 
> $ git diff --stat drivers/net
>  drivers/net/ethernet/broadcom/tg3.c           |    8 ++++----
>  drivers/net/ethernet/brocade/bna/bnad.c       |    4 ++--
>  drivers/net/ethernet/dec/tulip/de4x5.c        |    4 ++--
>  drivers/net/ethernet/intel/e1000/e1000_main.c |   10 +++++-----
>  drivers/net/ethernet/intel/e1000e/netdev.c    |   16 ++++++++--------
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c   |    2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  |    4 ++--
>  drivers/net/ethernet/sfc/falcon.c             |    2 +-
>  drivers/net/ethernet/sfc/mtd.c                |    6 +++---
>  drivers/net/ethernet/tile/tilepro.c           |    4 ++--
>  drivers/net/ethernet/xilinx/xilinx_emaclite.c |    4 ++--
>  12 files changed, 33 insertions(+), 33 deletions(-)
> 
>> and I think the good way is to separate the work to small pieces and
>> finish them slowly.
> 
> I think that's true for the int->bool conversions.
> 

^ permalink raw reply

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Joe Perches @ 2011-12-07  6:19 UTC (permalink / raw)
  To: Michael Wang
  Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <4EDF02CC.4010407@linux.vnet.ibm.com>

On Wed, 2011-12-07 at 14:08 +0800, Michael Wang wrote:
> I'm not good at script, if you are interested, we can work together to
> fix all the remain cases, and send out some patches.

You should try coccinelle and spatch.

If you run the script, this is the intel output.

 drivers/net/ethernet/intel/e1000/e1000_main.c |   10 +++++-----
 drivers/net/ethernet/intel/ixgb/ixgb_main.c   |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  |    4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 82f4ef1..5526881 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1185,7 +1185,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 		if (global_quad_port_a != 0)
 			adapter->eeprom_wol = 0;
 		else
-			adapter->quad_port_a = 1;
+			adapter->quad_port_a = true;
 		/* Reset for multiple quad port adapters */
 		if (++global_quad_port_a == 4)
 			global_quad_port_a = 0;
@@ -1679,7 +1679,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
 	 * need this to apply a workaround later in the send path. */
 	if (hw->mac_type == e1000_82544 &&
 	    hw->bus_type == e1000_bus_type_pcix)
-		adapter->pcix_82544 = 1;
+		adapter->pcix_82544 = true;
 
 	ew32(TCTL, tctl);
 
@@ -2002,7 +2002,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
 
 	tx_ring->next_to_use = 0;
 	tx_ring->next_to_clean = 0;
-	tx_ring->last_tx_tso = 0;
+	tx_ring->last_tx_tso = false;
 
 	writel(0, hw->hw_addr + tx_ring->tdh);
 	writel(0, hw->hw_addr + tx_ring->tdt);
@@ -2851,7 +2851,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
 		 * DMA'd to the controller */
 		if (!skb->data_len && tx_ring->last_tx_tso &&
 		    !skb_is_gso(skb)) {
-			tx_ring->last_tx_tso = 0;
+			tx_ring->last_tx_tso = false;
 			size -= 4;
 		}
 
@@ -3219,7 +3219,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 
 	if (likely(tso)) {
 		if (likely(hw->mac_type != e1000_82544))
-			tx_ring->last_tx_tso = 1;
+			tx_ring->last_tx_tso = true;
 		tx_flags |= E1000_TX_FLAGS_TSO;
 	} else if (likely(e1000_tx_csum(adapter, tx_ring, skb)))
 		tx_flags |= E1000_TX_FLAGS_CSUM;
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 247cf92..7fc6073 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -228,7 +228,7 @@ ixgb_up(struct ixgb_adapter *adapter)
 	if (IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_PCIX_MODE) {
 		err = pci_enable_msi(adapter->pdev);
 		if (!err) {
-			adapter->have_msi = 1;
+			adapter->have_msi = true;
 			irq_flags = 0;
 		}
 		/* proceed to try to request regular interrupt */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 1b28ed9..e8da825 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4019,7 +4019,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
 
 		/* Mark all the VFs as inactive */
 		for (i = 0 ; i < adapter->num_vfs; i++)
-			adapter->vfinfo[i].clear_to_send = 0;
+			adapter->vfinfo[i].clear_to_send = false;
 
 		/* ping all the active vfs to let them know we are going down */
 		ixgbe_ping_all_vfs(adapter);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index 9a56fd7..2c2a341 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -1646,9 +1646,9 @@ static bool ixgbe_get_i2c_data(u32 *i2cctl)
 	bool data;
 
 	if (*i2cctl & IXGBE_I2C_DATA_IN)
-		data = 1;
+		data = true;
 	else
-		data = 0;
+		data = false;
 
 	return data;
 }



------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related

* Re: [PATCH 1/1] IPVS: Modify the SH scheduler to use weights
From: Simon Horman @ 2011-12-07  6:20 UTC (permalink / raw)
  To: Michael Maxim
  Cc: Wensong Zhang, Julian Anastasov, Pablo Neira Ayuso,
	Patrick McHardy, David S. Miller, netdev, lvs-devel
In-Reply-To: <1322604142-15514-1-git-send-email-mike@okcupid.com>

On Tue, Nov 29, 2011 at 05:02:22PM -0500, Michael Maxim wrote:
> Modify the algorithm to build the source hashing hash table to add
> extra slots for destinations with higher weight. This has the effect
> of allowing an IPVS SH user to give more connections to hosts that
> have been configured to have a higher weight.

Thanks, applied.

^ permalink raw reply

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Michael Wang @ 2011-12-07  6:36 UTC (permalink / raw)
  To: Joe Perches
  Cc: jeffrey.t.kirsher, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <1323238749.1762.27.camel@joe2Laptop>

On 12/07/2011 02:19 PM, Joe Perches wrote:

> On Wed, 2011-12-07 at 14:08 +0800, Michael Wang wrote:
>> I'm not good at script, if you are interested, we can work together to
>> fix all the remain cases, and send out some patches.
> 
> You should try coccinelle and spatch.
> 

Hi, Joe

I have not used coccinelle and spatch before, I will study on them later.

> If you run the script, this is the intel output.
> 
>  drivers/net/ethernet/intel/e1000/e1000_main.c |   10 +++++-----
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c   |    2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    2 +-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  |    4 ++--
>  4 files changed, 9 insertions(+), 9 deletions(-)


We can try to fix them, thanks for the suggestion.

Regards,
Michael Wang

> 
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index 82f4ef1..5526881 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -1185,7 +1185,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
>  		if (global_quad_port_a != 0)
>  			adapter->eeprom_wol = 0;
>  		else
> -			adapter->quad_port_a = 1;
> +			adapter->quad_port_a = true;
>  		/* Reset for multiple quad port adapters */
>  		if (++global_quad_port_a == 4)
>  			global_quad_port_a = 0;
> @@ -1679,7 +1679,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
>  	 * need this to apply a workaround later in the send path. */
>  	if (hw->mac_type == e1000_82544 &&
>  	    hw->bus_type == e1000_bus_type_pcix)
> -		adapter->pcix_82544 = 1;
> +		adapter->pcix_82544 = true;
> 
>  	ew32(TCTL, tctl);
> 
> @@ -2002,7 +2002,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
> 
>  	tx_ring->next_to_use = 0;
>  	tx_ring->next_to_clean = 0;
> -	tx_ring->last_tx_tso = 0;
> +	tx_ring->last_tx_tso = false;
> 
>  	writel(0, hw->hw_addr + tx_ring->tdh);
>  	writel(0, hw->hw_addr + tx_ring->tdt);
> @@ -2851,7 +2851,7 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
>  		 * DMA'd to the controller */
>  		if (!skb->data_len && tx_ring->last_tx_tso &&
>  		    !skb_is_gso(skb)) {
> -			tx_ring->last_tx_tso = 0;
> +			tx_ring->last_tx_tso = false;
>  			size -= 4;
>  		}
> 
> @@ -3219,7 +3219,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
> 
>  	if (likely(tso)) {
>  		if (likely(hw->mac_type != e1000_82544))
> -			tx_ring->last_tx_tso = 1;
> +			tx_ring->last_tx_tso = true;
>  		tx_flags |= E1000_TX_FLAGS_TSO;
>  	} else if (likely(e1000_tx_csum(adapter, tx_ring, skb)))
>  		tx_flags |= E1000_TX_FLAGS_CSUM;
> diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
> index 247cf92..7fc6073 100644
> --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
> +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
> @@ -228,7 +228,7 @@ ixgb_up(struct ixgb_adapter *adapter)
>  	if (IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_PCIX_MODE) {
>  		err = pci_enable_msi(adapter->pdev);
>  		if (!err) {
> -			adapter->have_msi = 1;
> +			adapter->have_msi = true;
>  			irq_flags = 0;
>  		}
>  		/* proceed to try to request regular interrupt */
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 1b28ed9..e8da825 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -4019,7 +4019,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
> 
>  		/* Mark all the VFs as inactive */
>  		for (i = 0 ; i < adapter->num_vfs; i++)
> -			adapter->vfinfo[i].clear_to_send = 0;
> +			adapter->vfinfo[i].clear_to_send = false;
> 
>  		/* ping all the active vfs to let them know we are going down */
>  		ixgbe_ping_all_vfs(adapter);
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
> index 9a56fd7..2c2a341 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
> @@ -1646,9 +1646,9 @@ static bool ixgbe_get_i2c_data(u32 *i2cctl)
>  	bool data;
> 
>  	if (*i2cctl & IXGBE_I2C_DATA_IN)
> -		data = 1;
> +		data = true;
>  	else
> -		data = 0;
> +		data = false;
> 
>  	return data;
>  }
> 
> 

^ permalink raw reply

* Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0
From: Al Viro @ 2011-12-07  7:20 UTC (permalink / raw)
  To: Michael Wang
  Cc: Joe Perches, jeffrey.t.kirsher, e1000-devel@lists.sourceforge.net,
	netdev@vger.kernel.org, wangyunlinux@gmail.com, Brandeburg, Jesse
In-Reply-To: <4EDF0964.3080509@linux.vnet.ibm.com>

On Wed, Dec 07, 2011 at 02:36:20PM +0800, Michael Wang wrote:
> On 12/07/2011 02:19 PM, Joe Perches wrote:

[snip]
> >  	if (*i2cctl & IXGBE_I2C_DATA_IN)
> > -		data = 1;
> > +		data = true;
> >  	else
> > -		data = 0;
> > +		data = false;
> > 
> >  	return data;

Yuck...

bool f(whatever)
{
	bool data;
	if (expression)
		data = true;
	else
		data = false;
	return data;
}

is amazingly unidiomatic.  Hell, if nothing else it's
	bool data = expression;
	return data;
if not an outright
	return expression;
or
	return (bool)expression;
if you want to underline that it's treated as boolean...  What tool
has produced that patch?

^ permalink raw reply

* [PATCH] ipv6: Fix for adding multicast route for loopback device automatically.
From: Li Wei @ 2011-12-07  7:23 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, yoshfuji

There is no obvious reason to add a default multicast route for loopback
devices, otherwise there would be a route entry whose dst.error set to
-ENETUNREACH that would blocking all multicast packets.

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
---
 net/ipv6/addrconf.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index cf88df8..36806de 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1805,7 +1805,8 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
 		return ERR_PTR(-EACCES);
 
 	/* Add default multicast route */
-	addrconf_add_mroute(dev);
+	if (!(dev->flags & IFF_LOOPBACK))
+		addrconf_add_mroute(dev);
 
 	/* Add link local route */
 	addrconf_add_lroute(dev);
-- 
1.7.3.2

^ permalink raw reply related

* Re: [PATCH net-next v6 4/4] powerpc: tqm8548/tqm8xx: add and update CAN device nodes
From: Benjamin Herrenschmidt @ 2011-12-07  7:34 UTC (permalink / raw)
  To: Wolfgang Grandegger
  Cc: netdev, devicetree-discuss, linux-can, linuxppc-dev,
	socketcan-users
In-Reply-To: <1322732481-2255-5-git-send-email-wg@grandegger.com>

On Thu, 2011-12-01 at 10:41 +0100, Wolfgang Grandegger wrote:
> This patch enables or updates support for the CC770 and AN82527
> CAN controller on the TQM8548 and TQM8xx boards.

I'm a bit confused by the net-next prefix here. Those patches seem to
be only touching arch/powerpc and seem to be sent primarily toward
netdev with a net-next prefix.

Also there have been at least 3 versions in a couple of days already
without comments nor indication of what was changed...

Can you clarify things a bit please ? It looks like they really should
go to linuxppc-dev (and you can probably drop a bunch of other lists) or
am I missing an important piece of the puzzle ? (Such as patch 1/4 and
2/4 ...)

Let me know if I should just remove them from powerpc patchwork.

Cheers,
Ben.

> CC: devicetree-discuss@lists.ozlabs.org
> CC: linuxppc-dev@ozlabs.org
> CC: Kumar Gala <galak@kernel.crashing.org>
> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
> ---
>  arch/powerpc/boot/dts/tqm8548-bigflash.dts |   19 ++++++++++++++-----
>  arch/powerpc/boot/dts/tqm8548.dts          |   19 ++++++++++++++-----
>  arch/powerpc/boot/dts/tqm8xx.dts           |   25 +++++++++++++++++++++++++
>  3 files changed, 53 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/powerpc/boot/dts/tqm8548-bigflash.dts b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
> index 9452c3c..d918752 100644
> --- a/arch/powerpc/boot/dts/tqm8548-bigflash.dts
> +++ b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
> @@ -352,7 +352,7 @@
>  		ranges = <
>  			0 0x0 0xfc000000 0x04000000	// NOR FLASH bank 1
>  			1 0x0 0xf8000000 0x08000000	// NOR FLASH bank 0
> -			2 0x0 0xa3000000 0x00008000	// CAN (2 x i82527)
> +			2 0x0 0xa3000000 0x00008000	// CAN (2 x CC770)
>  			3 0x0 0xa3010000 0x00008000	// NAND FLASH
>  
>  		>;
> @@ -393,18 +393,27 @@
>  		};
>  
>  		/* Note: CAN support needs be enabled in U-Boot */
> -		can0@2,0 {
> -			compatible = "intel,82527"; // Bosch CC770
> +		can@2,0 {
> +			compatible = "bosch,cc770"; // Bosch CC770
>  			reg = <2 0x0 0x100>;
>  			interrupts = <4 1>;
>  			interrupt-parent = <&mpic>;
> +			bosch,external-clock-frequency = <16000000>;
> +			bosch,disconnect-rx1-input;
> +			bosch,disconnect-tx1-output;
> +			bosch,iso-low-speed-mux;
> +			bosch,clock-out-frequency = <16000000>;
>  		};
>  
> -		can1@2,100 {
> -			compatible = "intel,82527"; // Bosch CC770
> +		can@2,100 {
> +			compatible = "bosch,cc770"; // Bosch CC770
>  			reg = <2 0x100 0x100>;
>  			interrupts = <4 1>;
>  			interrupt-parent = <&mpic>;
> +			bosch,external-clock-frequency = <16000000>;
> +			bosch,disconnect-rx1-input;
> +			bosch,disconnect-tx1-output;
> +			bosch,iso-low-speed-mux;
>  		};
>  
>  		/* Note: NAND support needs to be enabled in U-Boot */
> diff --git a/arch/powerpc/boot/dts/tqm8548.dts b/arch/powerpc/boot/dts/tqm8548.dts
> index 619776f..988d887 100644
> --- a/arch/powerpc/boot/dts/tqm8548.dts
> +++ b/arch/powerpc/boot/dts/tqm8548.dts
> @@ -352,7 +352,7 @@
>  		ranges = <
>  			0 0x0 0xfc000000 0x04000000	// NOR FLASH bank 1
>  			1 0x0 0xf8000000 0x08000000	// NOR FLASH bank 0
> -			2 0x0 0xe3000000 0x00008000	// CAN (2 x i82527)
> +			2 0x0 0xe3000000 0x00008000	// CAN (2 x CC770)
>  			3 0x0 0xe3010000 0x00008000	// NAND FLASH
>  
>  		>;
> @@ -393,18 +393,27 @@
>  		};
>  
>  		/* Note: CAN support needs be enabled in U-Boot */
> -		can0@2,0 {
> -			compatible = "intel,82527"; // Bosch CC770
> +		can@2,0 {
> +			compatible = "bosch,cc770"; // Bosch CC770
>  			reg = <2 0x0 0x100>;
>  			interrupts = <4 1>;
>  			interrupt-parent = <&mpic>;
> +			bosch,external-clock-frequency = <16000000>;
> +			bosch,disconnect-rx1-input;
> +			bosch,disconnect-tx1-output;
> +			bosch,iso-low-speed-mux;
> +			bosch,clock-out-frequency = <16000000>;
>  		};
>  
> -		can1@2,100 {
> -			compatible = "intel,82527"; // Bosch CC770
> +		can@2,100 {
> +			compatible = "bosch,cc770"; // Bosch CC770
>  			reg = <2 0x100 0x100>;
>  			interrupts = <4 1>;
>  			interrupt-parent = <&mpic>;
> +			bosch,external-clock-frequency = <16000000>;
> +			bosch,disconnect-rx1-input;
> +			bosch,disconnect-tx1-output;
> +			bosch,iso-low-speed-mux;
>  		};
>  
>  		/* Note: NAND support needs to be enabled in U-Boot */
> diff --git a/arch/powerpc/boot/dts/tqm8xx.dts b/arch/powerpc/boot/dts/tqm8xx.dts
> index f6da7ec..c3dba25 100644
> --- a/arch/powerpc/boot/dts/tqm8xx.dts
> +++ b/arch/powerpc/boot/dts/tqm8xx.dts
> @@ -57,6 +57,7 @@
>  
>  		ranges = <
>  			0x0 0x0 0x40000000 0x800000
> +			0x3 0x0 0xc0000000 0x200
>  		>;
>  
>  		flash@0,0 {
> @@ -67,6 +68,30 @@
>  			bank-width = <4>;
>  			device-width = <2>;
>  		};
> +
> +		/* Note: CAN support needs be enabled in U-Boot */
> +		can@3,0 {
> +			compatible = "intc,82527";
> +			reg = <3 0x0 0x80>;
> +			interrupts = <8 1>;
> +			interrupt-parent = <&PIC>;
> +			bosch,external-clock-frequency = <16000000>;
> +			bosch,disconnect-rx1-input;
> +			bosch,disconnect-tx1-output;
> +			bosch,iso-low-speed-mux;
> +			bosch,clock-out-frequency = <16000000>;
> +		};
> +
> +		can@3,100 {
> +			compatible = "intc,82527";
> +			reg = <3 0x100 0x80>;
> +			interrupts = <8 1>;
> +			interrupt-parent = <&PIC>;
> +			bosch,external-clock-frequency = <16000000>;
> +			bosch,disconnect-rx1-input;
> +			bosch,disconnect-tx1-output;
> +			bosch,iso-low-speed-mux;
> +		};
>  	};
>  
>  	soc@fff00000 {



^ 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