Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next] tcp: Return bool instead of int where appropriate
From: Eric Dumazet @ 2012-07-20  8:02 UTC (permalink / raw)
  To: Vijay Subramanian; +Cc: netdev, davem
In-Reply-To: <1342769538-4039-1-git-send-email-subramanian.vijay@gmail.com>

On Fri, 2012-07-20 at 00:32 -0700, Vijay Subramanian wrote:
> Applied to a set of static inline functions in tcp_input.c
> 
> Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
> ---
>  net/ipv4/tcp_input.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply

* Re: [PATCH net-next 4/7] sfc: Add support for IEEE-1588 PTP
From: Richard Cochran @ 2012-07-20  7:37 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Stuart Hodgson, David Miller, netdev, linux-net-drivers,
	Andrew Jackson
In-Reply-To: <1342713051.2617.40.camel@bwh-desktop.uk.solarflarecom.com>

On Thu, Jul 19, 2012 at 04:50:51PM +0100, Ben Hutchings wrote:
> On Thu, 2012-07-19 at 16:29 +0100, Stuart Hodgson wrote:
> > On 19/07/12 15:25, Richard Cochran wrote:
> [...]
> > > I am trying to purge the whole SYS thing (only blackfin is left)
> > > because there is a much better way to go about this, namely
> > > synchronizing the system time to the PHC time via an internal PPS
> > > signal.
> > 
> > This may be possible in future. But leads us to another problem
> > where the PPS event that is generated by the PHC subsystem to the 
> > PPS subsystem is stamped with the current system_time. That may
> > be fine for a PPS signal generated from an interrupt but not when
> > the internal PPS event has implicit jitter from the handler/event_queue
> > that we have in the driver.
> [...]
> 
> We can certainly take a timestamp in the hard interrupt handler; in fact
> that's what I originally expected we would do since we have a separate
> MSI-X vector for PTP.  But even hard interrupt handling can be subject
> to substantial jitter.

What kind of jitter do you see or expect?

I did a study of synching system to PHC on a PowerPC system, where the
PPS timestamps varied from about 10 usec (on average under light load)
to over 30 usec (under heavy load).

Even so, it was easy to synchronize the system clock to within about a
microsecond under light load, with heavy load producing about an
additional 6 usec error.

Thanks,
Richard

^ permalink raw reply

* [PATCH net-next] tcp: Return bool instead of int where appropriate
From: Vijay Subramanian @ 2012-07-20  7:32 UTC (permalink / raw)
  To: netdev; +Cc: davem, Vijay Subramanian

Applied to a set of static inline functions in tcp_input.c

Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
---
 net/ipv4/tcp_input.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e67d685..21d7f8f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2521,7 +2521,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag)
 /* Nothing was retransmitted or returned timestamp is less
  * than timestamp of the first retransmission.
  */
-static inline int tcp_packet_delayed(const struct tcp_sock *tp)
+static inline bool tcp_packet_delayed(const struct tcp_sock *tp)
 {
 	return !tp->retrans_stamp ||
 		(tp->rx_opt.saw_tstamp && tp->rx_opt.rcv_tsecr &&
@@ -2582,7 +2582,7 @@ static void tcp_undo_cwr(struct sock *sk, const bool undo_ssthresh)
 	tp->snd_cwnd_stamp = tcp_time_stamp;
 }
 
-static inline int tcp_may_undo(const struct tcp_sock *tp)
+static inline bool tcp_may_undo(const struct tcp_sock *tp)
 {
 	return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp));
 }
@@ -3371,13 +3371,13 @@ static void tcp_ack_probe(struct sock *sk)
 	}
 }
 
-static inline int tcp_ack_is_dubious(const struct sock *sk, const int flag)
+static inline bool tcp_ack_is_dubious(const struct sock *sk, const int flag)
 {
 	return !(flag & FLAG_NOT_DUP) || (flag & FLAG_CA_ALERT) ||
 		inet_csk(sk)->icsk_ca_state != TCP_CA_Open;
 }
 
-static inline int tcp_may_raise_cwnd(const struct sock *sk, const int flag)
+static inline bool tcp_may_raise_cwnd(const struct sock *sk, const int flag)
 {
 	const struct tcp_sock *tp = tcp_sk(sk);
 	return (!(flag & FLAG_ECE) || tp->snd_cwnd < tp->snd_ssthresh) &&
@@ -3387,7 +3387,7 @@ static inline int tcp_may_raise_cwnd(const struct sock *sk, const int flag)
 /* Check that window update is acceptable.
  * The function assumes that snd_una<=ack<=snd_next.
  */
-static inline int tcp_may_update_window(const struct tcp_sock *tp,
+static inline bool tcp_may_update_window(const struct tcp_sock *tp,
 					const u32 ack, const u32 ack_seq,
 					const u32 nwin)
 {
@@ -4006,7 +4006,7 @@ static int tcp_disordered_ack(const struct sock *sk, const struct sk_buff *skb)
 		(s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) <= (inet_csk(sk)->icsk_rto * 1024) / HZ);
 }
 
-static inline int tcp_paws_discard(const struct sock *sk,
+static inline bool tcp_paws_discard(const struct sock *sk,
 				   const struct sk_buff *skb)
 {
 	const struct tcp_sock *tp = tcp_sk(sk);
@@ -4028,7 +4028,7 @@ static inline int tcp_paws_discard(const struct sock *sk,
  * (borrowed from freebsd)
  */
 
-static inline int tcp_sequence(const struct tcp_sock *tp, u32 seq, u32 end_seq)
+static inline bool tcp_sequence(const struct tcp_sock *tp, u32 seq, u32 end_seq)
 {
 	return	!before(end_seq, tp->rcv_wup) &&
 		!after(seq, tp->rcv_nxt + tcp_receive_window(tp));
@@ -5214,7 +5214,7 @@ static __sum16 __tcp_checksum_complete_user(struct sock *sk,
 	return result;
 }
 
-static inline int tcp_checksum_complete_user(struct sock *sk,
+static inline bool tcp_checksum_complete_user(struct sock *sk,
 					     struct sk_buff *skb)
 {
 	return !skb_csum_unnecessary(skb) &&
-- 
1.7.0.4

^ permalink raw reply related

* Re: [trivial PATCH resend 2/2] ixgbe: use PCI_VENDOR_ID_INTEL
From: Jeff Kirsher @ 2012-07-20  7:17 UTC (permalink / raw)
  To: Jon Mason
  Cc: trivial, netdev, linux-kernel, Jesse Brandeburg, Bruce Allan,
	Carolyn Wyborny, Don Skidmore, Greg Rose, Peter P Waskiewicz Jr,
	Alex Duyck, John Ronciak
In-Reply-To: <1342767729-17788-3-git-send-email-jdmason@kudzu.us>

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

On Fri, 2012-07-20 at 00:02 -0700, Jon Mason wrote:
> Use PCI_VENDOR_ID_INTEL from pci_ids.h instead of creating its own
> vendor ID #define.
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Cc: Bruce Allan <bruce.w.allan@intel.com>
> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Cc: Don Skidmore <donald.c.skidmore@intel.com>
> Cc: Greg Rose <gregory.v.rose@intel.com>
> Cc: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Cc: Alex Duyck <alexander.h.duyck@intel.com>
> Cc: John Ronciak <john.ronciak@intel.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |    4 ++--
>  drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |    8 ++++----
>  drivers/net/ethernet/intel/ixgbe/ixgbe_type.h  |    3 ---
>  3 files changed, 6 insertions(+), 9 deletions(-) 

This applies cleanly against my current net-next tree and looks fine.

Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

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

^ permalink raw reply

* RE: [RFC] r8169 : why SG / TX checksum are default disabled
From: hayeswang @ 2012-07-20  7:14 UTC (permalink / raw)
  To: 'David Miller', eric.dumazet; +Cc: romieu, netdev
In-Reply-To: <20120718.152405.1083396282134539674.davem@davemloft.net>

 Francois Romieu <romieu@fr.zoreil.com>

> >> > A NETDEV_TX_OK return means we accepted the SKB, it 
> doesn't look like
> >> > that's what you are doing in the skb_padto() failure path.
> >> 
> >> ?
> >> 
> >> - skb_padto fails
> >>   (original skb is implicitely freed)
> >> - skb_padto returns error status (!= 0)
> >> - rtl8169_tso_csum returns false
> >> - start_xmit returns NETDEV_TX_OK. 
> >> 
> >> I'll search the missing "!" after some sleep if that's 
> what you are talking
> >> about. Otherwise than that, I don't get it.
> >> 
> > 
> > 
> > Yes, I believe your patch is fine.
> > 
> > In fact many drivers dont account the error in their stats.
> 
> My bad, I forgot that skb_padto() frees the SKB on failure.
> 

I find that the total length field of IP header would be modified if the hw
checksum is enabled. Therefore, skb_padto + hw checksum wouldn't work. The
software checksum is necessary.
 
Best Regards,
Hayes

^ permalink raw reply

* Re: [trivial PATCH resend 2/2] ixgbe: use PCI_VENDOR_ID_INTEL
From: Jeff Kirsher @ 2012-07-20  7:14 UTC (permalink / raw)
  To: Jon Mason
  Cc: trivial, netdev, linux-kernel, Jesse Brandeburg, Bruce Allan,
	Carolyn Wyborny, Don Skidmore, Greg Rose, Peter P Waskiewicz Jr,
	Alex Duyck, John Ronciak
In-Reply-To: <1342767729-17788-3-git-send-email-jdmason@kudzu.us>

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

On Fri, 2012-07-20 at 00:02 -0700, Jon Mason wrote:
> Use PCI_VENDOR_ID_INTEL from pci_ids.h instead of creating its own
> vendor ID #define.
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Cc: Bruce Allan <bruce.w.allan@intel.com>
> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Cc: Don Skidmore <donald.c.skidmore@intel.com>
> Cc: Greg Rose <gregory.v.rose@intel.com>
> Cc: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Cc: Alex Duyck <alexander.h.duyck@intel.com>
> Cc: John Ronciak <john.ronciak@intel.com>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |    4 ++--
>  drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |    8 ++++----
>  drivers/net/ethernet/intel/ixgbe/ixgbe_type.h  |    3 ---
>  3 files changed, 6 insertions(+), 9 deletions(-) 

Same goes for this patch as well (not being trivial).

I already have several patches submitted for Dave against ixgbe
currently and I am not sure if there would be any issues with this patch
applying on top of the currently submitted patches.  I will verify this
applies cleanly with no issue to my current net-next tree before I send
my ACK.

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

^ permalink raw reply

* Re: [trivial PATCH resend 1/2] ixgb: use PCI_VENDOR_ID_INTEL
From: Jeff Kirsher @ 2012-07-20  7:11 UTC (permalink / raw)
  To: Jon Mason
  Cc: trivial, netdev, linux-kernel, Jesse Brandeburg, Bruce Allan,
	Carolyn Wyborny, Don Skidmore, Greg Rose, Peter P Waskiewicz Jr,
	Alex Duyck, John Ronciak
In-Reply-To: <1342767729-17788-2-git-send-email-jdmason@kudzu.us>

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

On Fri, 2012-07-20 at 00:02 -0700, Jon Mason wrote:
> Use PCI_VENDOR_ID_INTEL from pci_ids.h instead of creating its own
> vendor ID #define.
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Cc: Bruce Allan <bruce.w.allan@intel.com>
> Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Cc: Don Skidmore <donald.c.skidmore@intel.com>
> Cc: Greg Rose <gregory.v.rose@intel.com>
> Cc: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Cc: Alex Duyck <alexander.h.duyck@intel.com>
> Cc: John Ronciak <john.ronciak@intel.com>
> ---
>  drivers/net/ethernet/intel/ixgb/ixgb_hw.c   |    5 +++--
>  drivers/net/ethernet/intel/ixgb/ixgb_ids.h  |    5 -----
>  drivers/net/ethernet/intel/ixgb/ixgb_main.c |   10 +++++-----
>  3 files changed, 8 insertions(+), 12 deletions(-) 

Like I said before, I do not consider this patch "trivial" so it is
interesting that you submitted again as a trivial patch.  At least you
CC'd netdev like I asked.

Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

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

^ permalink raw reply

* [trivial PATCH resend 2/2] ixgbe: use PCI_VENDOR_ID_INTEL
From: Jon Mason @ 2012-07-20  7:02 UTC (permalink / raw)
  To: trivial
  Cc: netdev, linux-kernel, Jeff Kirsher, Jesse Brandeburg, Bruce Allan,
	Carolyn Wyborny, Don Skidmore, Greg Rose, Peter P Waskiewicz Jr,
	Alex Duyck, John Ronciak
In-Reply-To: <1342767729-17788-1-git-send-email-jdmason@kudzu.us>

Use PCI_VENDOR_ID_INTEL from pci_ids.h instead of creating its own
vendor ID #define.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
Cc: Don Skidmore <donald.c.skidmore@intel.com>
Cc: Greg Rose <gregory.v.rose@intel.com>
Cc: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Cc: Alex Duyck <alexander.h.duyck@intel.com>
Cc: John Ronciak <john.ronciak@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |    4 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |    8 ++++----
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h  |    3 ---
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 18ca3bc..8a3fafb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7516,11 +7516,11 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
 		}
 
 		/* Find the pci device of the offending VF */
-		vfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL);
+		vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, device_id, NULL);
 		while (vfdev) {
 			if (vfdev->devfn == (req_id & 0xFF))
 				break;
-			vfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
+			vfdev = pci_get_device(PCI_VENDOR_ID_INTEL,
 					       device_id, vfdev);
 		}
 		/*
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 2d971d1..28018d4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -65,13 +65,13 @@ static int ixgbe_find_enabled_vfs(struct ixgbe_adapter *adapter)
 	}
 
 	vf_devfn = pdev->devfn + 0x80;
-	pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL);
+	pvfdev = pci_get_device(PCI_VENDOR_ID_INTEL, device_id, NULL);
 	while (pvfdev) {
 		if (pvfdev->devfn == vf_devfn &&
 		    (pvfdev->bus->number >= pdev->bus->number))
 			vfs_found++;
 		vf_devfn += 2;
-		pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
+		pvfdev = pci_get_device(PCI_VENDOR_ID_INTEL,
 					device_id, pvfdev);
 	}
 
@@ -488,11 +488,11 @@ int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask)
 			break;
 		}
 
-		pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL);
+		pvfdev = pci_get_device(PCI_VENDOR_ID_INTEL, device_id, NULL);
 		while (pvfdev) {
 			if (pvfdev->devfn == thisvf_devfn)
 				break;
-			pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
+			pvfdev = pci_get_device(PCI_VENDOR_ID_INTEL,
 						device_id, pvfdev);
 		}
 		if (pvfdev)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 204848d..c8d8040 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -32,9 +32,6 @@
 #include <linux/mdio.h>
 #include <linux/netdevice.h>
 
-/* Vendor ID */
-#define IXGBE_INTEL_VENDOR_ID   0x8086
-
 /* Device IDs */
 #define IXGBE_DEV_ID_82598               0x10B6
 #define IXGBE_DEV_ID_82598_BX            0x1508
-- 
1.7.9.5

^ permalink raw reply related

* [trivial PATCH resend 1/2] ixgb: use PCI_VENDOR_ID_INTEL
From: Jon Mason @ 2012-07-20  7:02 UTC (permalink / raw)
  To: trivial
  Cc: netdev, linux-kernel, Jeff Kirsher, Jesse Brandeburg, Bruce Allan,
	Carolyn Wyborny, Don Skidmore, Greg Rose, Peter P Waskiewicz Jr,
	Alex Duyck, John Ronciak
In-Reply-To: <1342767729-17788-1-git-send-email-jdmason@kudzu.us>

Use PCI_VENDOR_ID_INTEL from pci_ids.h instead of creating its own
vendor ID #define.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: Carolyn Wyborny <carolyn.wyborny@intel.com>
Cc: Don Skidmore <donald.c.skidmore@intel.com>
Cc: Greg Rose <gregory.v.rose@intel.com>
Cc: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Cc: Alex Duyck <alexander.h.duyck@intel.com>
Cc: John Ronciak <john.ronciak@intel.com>
---
 drivers/net/ethernet/intel/ixgb/ixgb_hw.c   |    5 +++--
 drivers/net/ethernet/intel/ixgb/ixgb_ids.h  |    5 -----
 drivers/net/ethernet/intel/ixgb/ixgb_main.c |   10 +++++-----
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_hw.c b/drivers/net/ethernet/intel/ixgb/ixgb_hw.c
index 99b69ad..bf9a220 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_hw.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_hw.c
@@ -32,6 +32,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#include <linux/pci_ids.h>
 #include "ixgb_hw.h"
 #include "ixgb_ids.h"
 
@@ -96,7 +97,7 @@ static u32 ixgb_mac_reset(struct ixgb_hw *hw)
 	ASSERT(!(ctrl_reg & IXGB_CTRL0_RST));
 #endif
 
-	if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID) {
+	if (hw->subsystem_vendor_id == PCI_VENDOR_ID_SUN) {
 		ctrl_reg =  /* Enable interrupt from XFP and SerDes */
 			   IXGB_CTRL1_GPI0_EN |
 			   IXGB_CTRL1_SDP6_DIR |
@@ -271,7 +272,7 @@ ixgb_identify_phy(struct ixgb_hw *hw)
 	}
 
 	/* update phy type for sun specific board */
-	if (hw->subsystem_vendor_id == SUN_SUBVENDOR_ID)
+	if (hw->subsystem_vendor_id == PCI_VENDOR_ID_SUN)
 		phy_type = ixgb_phy_type_bcm;
 
 	return phy_type;
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_ids.h b/drivers/net/ethernet/intel/ixgb/ixgb_ids.h
index 2a58847..32c1b30 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_ids.h
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_ids.h
@@ -33,11 +33,6 @@
 ** The Device and Vendor IDs for 10 Gigabit MACs
 **********************************************************************/
 
-#define INTEL_VENDOR_ID             0x8086
-#define INTEL_SUBVENDOR_ID          0x8086
-#define SUN_VENDOR_ID               0x108E
-#define SUN_SUBVENDOR_ID            0x108E
-
 #define IXGB_DEVICE_ID_82597EX      0x1048
 #define IXGB_DEVICE_ID_82597EX_SR   0x1A48
 #define IXGB_DEVICE_ID_82597EX_LR   0x1B48
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 5fce363..4e5a060 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -54,13 +54,13 @@ MODULE_PARM_DESC(copybreak,
  *   Class, Class Mask, private data (not used) }
  */
 static DEFINE_PCI_DEVICE_TABLE(ixgb_pci_tbl) = {
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX,
+	{PCI_VENDOR_ID_INTEL, IXGB_DEVICE_ID_82597EX,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_CX4,
+	{PCI_VENDOR_ID_INTEL, IXGB_DEVICE_ID_82597EX_CX4,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR,
+	{PCI_VENDOR_ID_INTEL, IXGB_DEVICE_ID_82597EX_SR,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR,
+	{PCI_VENDOR_ID_INTEL, IXGB_DEVICE_ID_82597EX_LR,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 
 	/* required last entry */
@@ -195,7 +195,7 @@ ixgb_irq_enable(struct ixgb_adapter *adapter)
 {
 	u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 |
 		  IXGB_INT_TXDW | IXGB_INT_LSC;
-	if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID)
+	if (adapter->hw.subsystem_vendor_id == PCI_VENDOR_ID_SUN)
 		val |= IXGB_INT_GPI0;
 	IXGB_WRITE_REG(&adapter->hw, IMS, val);
 	IXGB_WRITE_FLUSH(&adapter->hw);
-- 
1.7.9.5

^ permalink raw reply related

* [trivial PATCH resend 0/2]
From: Jon Mason @ 2012-07-20  7:02 UTC (permalink / raw)
  To: trivial; +Cc: netdev, linux-kernel

Resending original patch #1 and sending a revised patch #2 to netdev per
Jeff Kirsher's request.  The rest of the original series of 7 is not
being resent.

^ permalink raw reply

* Re: [PATCH net-next 4/7] sfc: Add support for IEEE-1588 PTP
From: Richard Cochran @ 2012-07-20  6:31 UTC (permalink / raw)
  To: Stuart Hodgson
  Cc: Ben Hutchings, David Miller, netdev, linux-net-drivers,
	Andrew Jackson
In-Reply-To: <500827EF.208@solarflare.com>

On Thu, Jul 19, 2012 at 04:29:51PM +0100, Stuart Hodgson wrote:
> On 19/07/12 15:25, Richard Cochran wrote:
> > On Wed, Jul 18, 2012 at 07:21:33PM +0100, Ben Hutchings wrote:
> >> Add PTP IEEE-1588 support and make accesible via the PHC subsystem.

...

> >> +/* Process times received from MC.
> >> + *
> >> + * Extract times from returned results, and establish the minimum value
> >> + * seen.  The minimum value represents the "best" possible time and events
> >> + * too much greater than this are rejected - the machine is, perhaps, too
> >> + * busy. A number of readings are taken so that, hopefully, at least one good
> >> + * synchronisation will be seen in the results.
> >> + */
> > 
> > This code looks like it is trying to find the offset between two
> > clocks. Is there some reason why you cannot use <linux/timecompare.h>
> > to accomplish this?
> 
> This is what the code is doing. <linux/timecompare.h> states
> 
> "the assumption is that reading the source
> time is slow and involves equal time for sending the request and
> receiving the reply"
> 
> While in our case event though it is slow we cannot guarantee the second
> assumption. The code above takes into account some of the particulars of the sfc
> hardware and gives us good results. 

Fair enough, but then maybe a comment mentioning how timecompare is
unsuitable would be nice to have.

> > I am trying to purge the whole SYS thing (only blackfin is left)
> > because there is a much better way to go about this, namely
> > synchronizing the system time to the PHC time via an internal PPS
> > signal.
> 
> This may be possible in future. But leads us to another problem
> where the PPS event that is generated by the PHC subsystem to the 
> PPS subsystem is stamped with the current system_time. That may
> be fine for a PPS signal generated from an interrupt but not when
> the internal PPS event has implicit jitter from the handler/event_queue
> that we have in the driver.

Yes, both your driver and timecompare**  suffer from the same
defect, namely that the synchronization times are determined by
network traffic, and not at some regular frequency like 1 Hz.

Why not just offer a 1 PPS signal using the standard method?  If you
cannot produce a real interrupt for this, you can at least use a
synthetic one using a periodically scheduled work.

** Actually, timecompare is a bit better as it ensures that the
   measurements occur no more than once per second.

> Calling pps_event directly does not seem possible with the current
> header/structure layout preventing access to ptp_clock->pps_source.
> Including ptp_private.h seems wrong.

I don't understand what the issue is here. Can't you just call
ptp_clock_event, like you already have...

> >> +static void efx_ptp_pps_worker(struct work_struct *work)
> >> +{
> >> +	struct efx_ptp_data *ptp =
> >> +		container_of(work, struct efx_ptp_data, pps_work);
> >> +	struct efx_nic *efx = ptp->channel->efx;
> >> +	struct timespec event_gen_time;
> >> +	struct ptp_clock_event ptp_pps_evt;
> >> +	ktime_t gen_time_host;
> >> +
> >> +	if (efx_ptp_synchronize(efx, PTP_SYNC_ATTEMPTS))
> >> +		return;
> >> +
> >> +	gen_time_host = ktime_sub(ptp->mc_base_time,
> >> +				  ptp->host_base_time);
> >> +	event_gen_time = ktime_to_timespec(gen_time_host);
> >> +
> >> +	ptp_pps_evt.type = PTP_CLOCK_EXTTS;
> >> +	ptp_pps_evt.timestamp = ktime_to_ns(gen_time_host);
> >> +	ptp_clock_event(ptp->phc_clock, &ptp_pps_evt);
> >> +}

... here?

> >> +static int efx_phc_adjtime(struct ptp_clock_info *ptp, s64 delta)
> >> +{

You can set the time here somehow by doing, T' = T + offset, and so...

> >> +}

> >> +static int efx_phc_settime(struct ptp_clock_info *ptp,
> >> +			   const struct timespec *e_ts)
> >> +{
> >> +	/* We must provide this function, but we cannot actually set the time */
> > 
> > Huh? You can adjtime, so must be able to settime, too, right?
> > 
> > If you have enough range in the RAW timestamp in the MC firmware (like
> > 64 bits of nanoseconds), and you allow settime, then you can spare the
> > system time synchronization code altogether.
> > 
> 
> You will have to elaborate further on this point.

... why can't you also just set the time?

Thanks,
Richard

^ permalink raw reply

* [ethtool 2/2] ethtool: allow setting MDI-X state
From: Jeff Kirsher @ 2012-07-20  6:25 UTC (permalink / raw)
  To: bhutchings; +Cc: Jesse Brandeburg, netdev, davem, Jeff Kirsher
In-Reply-To: <1342765524-29711-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

A bit ago ethtool added support for reading MDI-X state, this
patch finishes the implementation, adding the complementary write
command.

Add support to ethtool for controlling the MDI-X (crossover)
state of a network port.  Most adapters correctly negotiate
MDI-X, but some ill-behaved switches have trouble and end up
picking the wrong MDI setting, which results in complete loss of
link.  Usually this error condition can be observed when multiple
ethtool -r ethX are required before link is achieved.

This patch allows the user to override the normal "auto" setting
and force the crossover state to on or off.

The set will fail if the driver doesn't support the get, as
suggested by Ben Hutchings.  Unfortunately there is no way to
tell the set isn't supported *if* the driver supports the get,
set just silently fails.

# ./ethtool -s p1p1 mdix off
setting MDI not supported

usage is ethtool -s eth0 mdix [auto|on|off]

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 ethtool.8.in |    8 ++++++++
 ethtool.c    |   26 ++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/ethtool.8.in b/ethtool.8.in
index ff3255b..44943a2 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -229,6 +229,7 @@ ethtool \- query or control network driver and hardware settings
 .BI speed \ N
 .B2 duplex half full
 .B4 port tp aui bnc mii fibre
+.B3 mdix auto on off
 .B2 autoneg on off
 .BN advertise
 .BN phyad
@@ -521,6 +522,13 @@ Sets full or half duplex mode.
 .A4 port tp aui bnc mii fibre
 Selects device port.
 .TP
+.A3 mdix auto on off
+Selects MDI-X mode for port. May be used to override the automatic detection
+feature of most adapters.  Auto means automatic detection of MDI status, on
+forces MDI-X (crossover) mode, while off means MDI (straight through) mode.
+The driver should guarantee that this command takes effect immediately, and
+if necessary may reset the link to cause the change to take effect.
+.TP
 .A2 autoneg on off
 Specifies whether autonegotiation should be enabled. Autonegotiation 
 is enabled by default, but in some network devices may have trouble
diff --git a/ethtool.c b/ethtool.c
index e573357..9effc60 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -18,6 +18,8 @@
  * Rx Network Flow Control configuration support <santwona.behera@sun.com>
  * Various features by Ben Hutchings <bhutchings@solarflare.com>;
  *	Copyright 2009, 2010 Solarflare Communications
+ * MDI-X set support by Jesse Brandeburg <jesse.brandeburg@intel.com>
+ * 	Copyright 2012 Intel Corporation
  *
  * TODO:
  *   * show settings for all devices
@@ -2199,6 +2201,7 @@ static int do_sset(struct cmd_context *ctx)
 	int speed_wanted = -1;
 	int duplex_wanted = -1;
 	int port_wanted = -1;
+	int mdix_wanted = -1;
 	int autoneg_wanted = -1;
 	int phyad_wanted = -1;
 	int xcvr_wanted = -1;
@@ -2259,6 +2262,19 @@ static int do_sset(struct cmd_context *ctx)
 				port_wanted = PORT_FIBRE;
 			else
 				exit_bad_args();
+		} else if (!strcmp(argp[i], "mdix")) {
+			gset_changed = 1;
+			i += 1;
+			if (i >= argc)
+				exit_bad_args();
+			if (!strcmp(argp[i], "auto"))
+				mdix_wanted = ETH_TP_MDI_AUTO;
+			else if (!strcmp(argp[i], "on"))
+				mdix_wanted = ETH_TP_MDI_X;
+			else if (!strcmp(argp[i], "off"))
+				mdix_wanted = ETH_TP_MDI;
+			else
+				exit_bad_args();
 		} else if (!strcmp(argp[i], "autoneg")) {
 			i += 1;
 			if (i >= argc)
@@ -2380,6 +2396,13 @@ static int do_sset(struct cmd_context *ctx)
 				ecmd.duplex = duplex_wanted;
 			if (port_wanted != -1)
 				ecmd.port = port_wanted;
+			if (mdix_wanted != -1) {
+				/* check driver supports MDI-X */
+				if (ecmd.eth_tp_mdix != ETH_TP_MDI_INVALID)
+					ecmd.eth_tp_mdix_ctrl = mdix_wanted;
+				else
+					fprintf(stderr, "setting MDI not supported\n");
+			}
 			if (autoneg_wanted != -1)
 				ecmd.autoneg = autoneg_wanted;
 			if (phyad_wanted != -1)
@@ -2439,6 +2462,8 @@ static int do_sset(struct cmd_context *ctx)
 				fprintf(stderr, "  not setting phy_address\n");
 			if (xcvr_wanted != -1)
 				fprintf(stderr, "  not setting transceiver\n");
+			if (mdix_wanted != -1)
+				fprintf(stderr, "  not setting mdix\n");
 		}
 	}
 
@@ -3604,6 +3629,7 @@ static const struct option {
 	  "		[ speed %d ]\n"
 	  "		[ duplex half|full ]\n"
 	  "		[ port tp|aui|bnc|mii|fibre ]\n"
+	  "		[ mdix auto|on|off ]\n"
 	  "		[ autoneg on|off ]\n"
 	  "		[ advertise %x ]\n"
 	  "		[ phyad %d ]\n"
-- 
1.7.10.4

^ permalink raw reply related

* [ethtool 1/2] ethtool.h: implement new MDI-X set defines
From: Jeff Kirsher @ 2012-07-20  6:25 UTC (permalink / raw)
  To: bhutchings; +Cc: Jesse Brandeburg, netdev, davem, Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

These changes implement the kernel side of the interface
for allowing drivers to set MDI-X state on twisted pair.

Changes implemented as suggested by Ben Hutchings, thanks Ben!

see ethtool patches titled:
ethtool: allow setting MDI-X state

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 ethtool-copy.h |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/ethtool-copy.h b/ethtool-copy.h
index 0e90e9b..6625eff 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -42,8 +42,10 @@ struct ethtool_cmd {
 				 * bits) in Mbps. Please use
 				 * ethtool_cmd_speed()/_set() to
 				 * access it */
-	__u8	eth_tp_mdix;
-	__u8	reserved2;
+	__u8	eth_tp_mdix;	/* twisted pair MDI-X status */
+	__u8	eth_tp_mdix_ctrl; /* twisted pair MDI-X control, when set,
+				   * link should be renegotiated if necessary
+				   */
 	__u32	lp_advertising;	/* Features the link partner advertises */
 	__u32	reserved[2];
 };
@@ -989,10 +991,13 @@ enum ethtool_sfeatures_retval_bits {
 #define AUTONEG_DISABLE		0x00
 #define AUTONEG_ENABLE		0x01
 
-/* Mode MDI or MDI-X */
-#define ETH_TP_MDI_INVALID	0x00
-#define ETH_TP_MDI		0x01
-#define ETH_TP_MDI_X		0x02
+/* MDI or MDI-X status/control - if MDI/MDI_X/AUTO is set then
+ * the driver is required to renegotiate link
+ */
+#define ETH_TP_MDI_INVALID	0x00 /* status: unknown; control: unsupported */
+#define ETH_TP_MDI		0x01 /* status: MDI;     control: force MDI */
+#define ETH_TP_MDI_X		0x02 /* status: MDI-X;   control: force MDI-X */
+#define ETH_TP_MDI_AUTO		0x03 /*                  control: auto-select */
 
 /* Wake-On-Lan options. */
 #define WAKE_PHY		(1 << 0)
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH net-next 4/7] sfc: Add support for IEEE-1588 PTP
From: Richard Cochran @ 2012-07-20  6:11 UTC (permalink / raw)
  To: Andrew Jackson; +Cc: Ben Hutchings, David Miller, netdev, linux-net-drivers
In-Reply-To: <50083059.7070700@solarflare.com>

On Thu, Jul 19, 2012 at 05:05:45PM +0100, Andrew Jackson wrote:
> On 19/07/2012 15:37, Ben Hutchings wrote:
> >On Thu, 2012-07-19 at 16:25 +0200, Richard Cochran wrote:
> >>
> >>I am trying to purge the whole SYS thing (only blackfin is left)
> >>because there is a much better way to go about this, namely
> >>synchronizing the system time to the PHC time via an internal PPS
> >>signal.
> >
> >Andrew, would that work for us?
> 
> I don't think so for the reason that Stu has pointed out (failed
> assumption).
> 
> The NIC's clock isn't directly accessible by the host from the PCIe
> bus and is "behind" the MC. Even when we process PPS events, we need
> a reliable way of determining the relationship between the two
> clocks (system <> NIC). We're trying to get that as accurately as we
> can but we know that some measurements will be incorrect/out of
> bounds because of loading on the system.

There is a better way to filter out bad measurements than to hard code
some black magic into the driver. Instead, just offer a PPS, and then
we can comfortably (and flexibly) filter using a user space program.

Thanks,
Richard

^ permalink raw reply

* [PATCH] myri10ge: update MAINTAINERS
From: Jon Mason @ 2012-07-20  6:11 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

Remove myself from myri10ge MAINTAINERS list

Signed-off-by: Jon Mason <jdmason@kudzu.us>
---
 MAINTAINERS |    1 -
 1 file changed, 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f93b8ff..fe57950 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4586,7 +4586,6 @@ S:	Maintained
 F:	drivers/usb/musb/
 
 MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE)
-M:	Jon Mason <mason@myri.com>
 M:	Andrew Gallatin <gallatin@myri.com>
 L:	netdev@vger.kernel.org
 W:	http://www.myri.com/scs/download-Myri10GE.html
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH net-next] tcp: fix ABC in tcp_slow_start()
From: Eric Dumazet @ 2012-07-20  5:40 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, Tom Herbert, Yuchung Cheng, Neal Cardwell,
	Nandita Dukkipati, John Heffner, Stephen Hemminger

From: Eric Dumazet <edumazet@google.com>

When/if sysctl_tcp_abc > 1, we expect to increase cwnd by 2 if the
received ACK acknowledges more than 2*MSS bytes, in tcp_slow_start()

Problem is this RFC 3465 statement is not correctly coded, as
the while () loop increases snd_cwnd one by one.

So to reach the "cwnd += 2" goal, we need to use "cnt = 2*cnt + 1"

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Nandita Dukkipati <nanditad@google.com>
Cc: John Heffner <johnwheffner@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
---
 net/ipv4/tcp_cong.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 04dbd7a..486379a 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -306,7 +306,7 @@ EXPORT_SYMBOL_GPL(tcp_is_cwnd_limited);
  */
 void tcp_slow_start(struct tcp_sock *tp)
 {
-	int cnt; /* increase in packets */
+	unsigned int cnt; /* increase in packets */
 
 	/* RFC3465: ABC Slow start
 	 * Increase only after a full MSS of bytes is acked
@@ -318,16 +318,19 @@ void tcp_slow_start(struct tcp_sock *tp)
 	if (sysctl_tcp_abc && tp->bytes_acked < tp->mss_cache)
 		return;
 
-	if (sysctl_tcp_max_ssthresh > 0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh)
+	cnt = tp->snd_cwnd;			/* exponential increase */
+	if (sysctl_tcp_max_ssthresh > 0 &&
+	    tp->snd_cwnd > sysctl_tcp_max_ssthresh)
 		cnt = sysctl_tcp_max_ssthresh >> 1;	/* limited slow start */
-	else
-		cnt = tp->snd_cwnd;			/* exponential increase */
 
 	/* RFC3465: ABC
 	 * We MAY increase by 2 if discovered delayed ack
+	 * The "+ 1" in the expression is needed if we want to increase
+	 * cwnd by 2, because the way is coded the following loop.
 	 */
 	if (sysctl_tcp_abc > 1 && tp->bytes_acked >= 2*tp->mss_cache)
-		cnt <<= 1;
+		cnt = 2*cnt + 1;
+
 	tp->bytes_acked = 0;
 
 	tp->snd_cwnd_cnt += cnt;

^ permalink raw reply related

* Re: [PATCH] b44: add 64 bit stats
From: Eric Dumazet @ 2012-07-20  5:24 UTC (permalink / raw)
  To: Kevin Groeneveld; +Cc: netdev
In-Reply-To: <1342759989.2626.5472.camel@edumazet-glaptop>

On Fri, 2012-07-20 at 06:53 +0200, Eric Dumazet wrote:
> On Thu, 2012-07-19 at 21:56 -0400, Kevin Groeneveld wrote:
> 
> > I am still trying to make sure I understand this fully.  I want to
> > update some other drivers with 64 bit stats as well.  What you said
> > seems to make sense, but...
> > 
> > I was looking at the virtio_net.c driver.  One spot in this driver
> > which updates the stats is the receive_buf function.  recive_buf is
> > called from virtnet_poll which is registered as a napi poll function.
> > According to Documentation/networking/netdevices.txt the poll function
> > is called in a softirq context.  However, the function which reads the
> > stats uses u64_stats_fetch_begin/u64_stats_fetch_retry.  Shouldn't
> > this be u64_stats_fetch_begin_bh/u64_stats_fetch_retry_bh for the
> > exact reasons you described for my b44 patch?
> 
> Absolutely. You can argue that probably nobody use this driver on a
> 32bit UP machine, but technically speaking the current implementation is
> racy.
> 

In fact all network drivers should use the _bh version.

Could you send a patch for all of them, based on net-next tree ?

Thanks !

^ permalink raw reply

* Re: [PATCH] b44: add 64 bit stats
From: Eric Dumazet @ 2012-07-20  4:53 UTC (permalink / raw)
  To: Kevin Groeneveld; +Cc: netdev
In-Reply-To: <CABF+-6XVCTDZedzcp-gWACYpG9NLmZUdwW2zsXC8WNKWk3dE5w@mail.gmail.com>

On Thu, 2012-07-19 at 21:56 -0400, Kevin Groeneveld wrote:

> I am still trying to make sure I understand this fully.  I want to
> update some other drivers with 64 bit stats as well.  What you said
> seems to make sense, but...
> 
> I was looking at the virtio_net.c driver.  One spot in this driver
> which updates the stats is the receive_buf function.  recive_buf is
> called from virtnet_poll which is registered as a napi poll function.
> According to Documentation/networking/netdevices.txt the poll function
> is called in a softirq context.  However, the function which reads the
> stats uses u64_stats_fetch_begin/u64_stats_fetch_retry.  Shouldn't
> this be u64_stats_fetch_begin_bh/u64_stats_fetch_retry_bh for the
> exact reasons you described for my b44 patch?

Absolutely. You can argue that probably nobody use this driver on a
32bit UP machine, but technically speaking the current implementation is
racy.

^ permalink raw reply

* Re: linux-next: build failure after merge of the net-next tree
From: Christian Riesch @ 2012-07-20  3:21 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: David Miller, netdev, linux-next, linux-kernel, Michael Neuling
In-Reply-To: <20120720120118.465056f267ab5c3ac5ea45c4@canb.auug.org.au>

[Sent again due to problems with email client]

Hi,

On 07/20/2012 04:01 AM, Stephen Rothwell wrote:
> Hi all,
>
> After merging the net-next tree, today's linux-next build (powerpc
> pmac32_defconfig) failed like this:
>
> ERROR: "phy_disconnect" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_stop" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_ethtool_gset" [drivers/net/usb/asix.ko] undefined!
> ERROR: "mdiobus_unregister" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_start_aneg" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_print_status" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_start" [drivers/net/usb/asix.ko] undefined!
> ERROR: "mdiobus_free" [drivers/net/usb/asix.ko] undefined!
> ERROR: "mdiobus_register" [drivers/net/usb/asix.ko] undefined!
> ERROR: "genphy_resume" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_connect" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_mii_ioctl" [drivers/net/usb/asix.ko] undefined!
> ERROR: "phy_ethtool_sset" [drivers/net/usb/asix.ko] undefined!
> ERROR: "mdiobus_alloc_size" [drivers/net/usb/asix.ko] undefined!
>
> Caused by commit 16626b0cc3d5 ("asix: Add a new driver for the AX88172A")
> and reverting that commit fixes the build.

Sorry about that. I missed the dependency of the new driver on phylib. A 
fix for this problem is already in net-next, see commit 215029375c83.

Thanks, Christian

>
> Thanks to Mikey for reporting this porblem.

^ permalink raw reply

* [PATCH] atl1c: fix issue of io access mode for AR8152 v2.1
From: cjren @ 2012-07-20  3:01 UTC (permalink / raw)
  To: davem, netdev, linux-kernel; +Cc: qca-linux-team, nic-devel

When io access mode is enabled by BOOTROM or BIOS for AR8152 v2.1,
the register can't be read/write by memory access mode.
Clearing Bit 8  of Register 0x21c could fixed the issue.

Signed-off-by: Cloud Ren <cjren@qca.qualcomm.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: xiong <xiong@qca.qualcomm.com>
---
 drivers/net/ethernet/atheros/atl1c/atl1c_hw.h   |    5 +++++
 drivers/net/ethernet/atheros/atl1c/atl1c_main.c |   16 +++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
index 17d935b..21d8c4d 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
@@ -74,6 +74,8 @@ void atl1c_post_phy_linkchg(struct atl1c_hw *hw, u16 link_speed);
 #define PCI_DEVICE_ID_ATHEROS_L1D_2_0	0x1083 /* AR8151 v2.0 Gigabit 1000 */
 #define L2CB_V10			0xc0
 #define L2CB_V11			0xc1
+#define L2CB_V20			0xc0
+#define L2CB_V21			0xc1
 
 /* register definition */
 #define REG_DEVICE_CAP              	0x5C
@@ -87,6 +89,9 @@ void atl1c_post_phy_linkchg(struct atl1c_hw *hw, u16 link_speed);
 #define LINK_CTRL_L1_EN			0x02
 #define LINK_CTRL_EXT_SYNC		0x80
 
+#define REG_PCIE_IND_ACC_ADDR		0x80
+#define REG_PCIE_IND_ACC_DATA		0x84
+
 #define REG_DEV_SERIALNUM_CTRL		0x200
 #define REG_DEV_MAC_SEL_MASK		0x0 /* 0:EUI; 1:MAC */
 #define REG_DEV_MAC_SEL_SHIFT		0
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 36d3783..1bf5bbf 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -727,6 +727,8 @@ static const struct atl1c_platform_patch plats[] __devinitdata = {
 
 static void __devinit atl1c_patch_assign(struct atl1c_hw *hw)
 {
+	struct pci_dev	*pdev = hw->adapter->pdev;
+	u32 misc_ctrl;
 	int i = 0;
 
 	hw->msi_lnkpatch = false;
@@ -741,6 +743,18 @@ static void __devinit atl1c_patch_assign(struct atl1c_hw *hw)
 		}
 		i++;
 	}
+
+	if (hw->device_id == PCI_DEVICE_ID_ATHEROS_L2C_B2 &&
+	    hw->revision_id == L2CB_V21) {
+		/* config acess mode */
+		pci_write_config_dword(pdev, REG_PCIE_IND_ACC_ADDR,
+				       REG_PCIE_DEV_MISC_CTRL);
+		pci_read_config_dword(pdev, REG_PCIE_IND_ACC_DATA, &misc_ctrl);
+		misc_ctrl &= ~0x100;
+		pci_write_config_dword(pdev, REG_PCIE_IND_ACC_ADDR,
+				       REG_PCIE_DEV_MISC_CTRL);
+		pci_write_config_dword(pdev, REG_PCIE_IND_ACC_DATA, misc_ctrl);
+	}
 }
 /**
  * atl1c_sw_init - Initialize general software structures (struct atl1c_adapter)
@@ -768,7 +782,7 @@ static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)
 	hw->device_id = pdev->device;
 	hw->subsystem_vendor_id = pdev->subsystem_vendor;
 	hw->subsystem_id = pdev->subsystem_device;
-	AT_READ_REG(hw, PCI_CLASS_REVISION, &revision);
+	pci_read_config_dword(pdev, PCI_CLASS_REVISION, &revision);
 	hw->revision_id = revision & 0xFF;
 	/* before link up, we assume hibernate is true */
 	hw->hibernate = true;
-- 
1.5.4.5

^ permalink raw reply related

* Re: linux-next: build failure after merge of the net-next tree
From: Stephen Rothwell @ 2012-07-20  2:48 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, Michael Neuling, Christian Riesch
In-Reply-To: <20120720120118.465056f267ab5c3ac5ea45c4@canb.auug.org.au>

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

On Fri, 20 Jul 2012 12:01:18 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the net-next tree, today's linux-next build (powerpc
> pmac32_defconfig) failed like this:

This was actually yesterday's linux-next - I guess it is fixed by commit
215029375c83 ("asix: AX88172A driver depends on phylib") in today's tree.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* RE: [RFC] r8169 : why SG / TX checksum are default disabled
From: hayeswang @ 2012-07-20  2:11 UTC (permalink / raw)
  To: 'Francois Romieu', 'David Miller'; +Cc: eric.dumazet, netdev
In-Reply-To: <20120718201201.GC14149@electric-eye.fr.zoreil.com>

 Francois Romieu [mailto:romieu@fr.zoreil.com] 
[...]
> A part of the apparent problem may stem from the fact that 
> Realtek's 8168
> driver claims a modified length but it does not really skb_padto... 
> 
> Hayes, would the patch below fix the original problem ?

According to the response from our hw engineer, it still has the problem even
though you pad the packet to 60 bytes with zeroes. I would still test this patch
to verify it.

>  static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
> @@ -5797,7 +5804,8 @@ static netdev_tx_t 
> rtl8169_start_xmit(struct sk_buff *skb,
>  	opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
>  	opts[0] = DescOwn;
>  
> -	rtl8169_tso_csum(tp, skb, opts);
> +	if (!rtl8169_tso_csum(tp, skb, opts))
> +		goto err_update_stats;
>  

I think you should check the length of opts1 of the descriptor, too. Besides,
how about the length of dma_map_xxx? Should it use the original length or the
modified length?

>  	frags = rtl8169_xmit_frags(tp, skb, opts);
>  	if (frags < 0)
> @@ -5853,6 +5861,7 @@ err_dma_1:
>  	rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd);
>  err_dma_0:
>  	dev_kfree_skb(skb);
> +err_update_stats:
>  	dev->stats.tx_dropped++;
>  	return NETDEV_TX_OK;
>  
 
Best Regards,
Hayes

^ permalink raw reply

* linux-next: build failure after merge of the net-next tree
From: Stephen Rothwell @ 2012-07-20  2:01 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, Michael Neuling, Christian Riesch

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

Hi all,

After merging the net-next tree, today's linux-next build (powerpc
pmac32_defconfig) failed like this:

ERROR: "phy_disconnect" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_stop" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_ethtool_gset" [drivers/net/usb/asix.ko] undefined!
ERROR: "mdiobus_unregister" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_start_aneg" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_print_status" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_start" [drivers/net/usb/asix.ko] undefined!
ERROR: "mdiobus_free" [drivers/net/usb/asix.ko] undefined!
ERROR: "mdiobus_register" [drivers/net/usb/asix.ko] undefined!
ERROR: "genphy_resume" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_connect" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_mii_ioctl" [drivers/net/usb/asix.ko] undefined!
ERROR: "phy_ethtool_sset" [drivers/net/usb/asix.ko] undefined!
ERROR: "mdiobus_alloc_size" [drivers/net/usb/asix.ko] undefined!

Caused by commit 16626b0cc3d5 ("asix: Add a new driver for the AX88172A")
and reverting that commit fixes the build.

Thanks to Mikey for reporting this porblem.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] b44: add 64 bit stats
From: Kevin Groeneveld @ 2012-07-20  1:56 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1342337165.3265.10640.camel@edumazet-glaptop>

Hi Eric,

On Sun, Jul 15, 2012 at 3:26 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> So you must use u64_stats_fetch_begin_bh()
>
> Because on 32bit, uniprocessor, u64_stats_fetch_begin() only disables
> preemption. (there is no seqlock in syncp)
>
> So softirq are allowed to interrupt you and corrupt your stats while you
> read them, and you dont notice you have to retry.

I am still trying to make sure I understand this fully.  I want to
update some other drivers with 64 bit stats as well.  What you said
seems to make sense, but...

I was looking at the virtio_net.c driver.  One spot in this driver
which updates the stats is the receive_buf function.  recive_buf is
called from virtnet_poll which is registered as a napi poll function.
According to Documentation/networking/netdevices.txt the poll function
is called in a softirq context.  However, the function which reads the
stats uses u64_stats_fetch_begin/u64_stats_fetch_retry.  Shouldn't
this be u64_stats_fetch_begin_bh/u64_stats_fetch_retry_bh for the
exact reasons you described for my b44 patch?


Kevin

^ permalink raw reply

* [PATCH V2 resend] ipv6: fix incorrect route 'expires' value passed to userspace
From: Li Wei @ 2012-07-20  1:42 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, shemminger
In-Reply-To: <20120719.104906.38765587582698093.davem@davemloft.net>


When userspace use RTM_GETROUTE to dump route table, with an already
expired route entry, we always got an 'expires' value(2147157)
calculated base on INT_MAX.

The reason of this problem is in the following satement:
	rt->dst.expires - jiffies < INT_MAX
gcc promoted the type of both sides of '<' to unsigned long, thus
a small negative value would be considered greater than INT_MAX.

This patch fix this by use the same trick as time_after macro to
avoid the 'unsigned long' type promotion and deal with jiffies
wrapping.

Also we should do some fix in rtnl_put_cacheinfo() which use
jiffies_to_clock_t(which take an unsigned long as parameter) to
convert jiffies to clock_t to handle the negative expires.

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
---
 net/core/rtnetlink.c |    3 ++-
 net/ipv6/route.c     |    7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 21318d1..f92f3d8 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -641,7 +641,8 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id,
 	};
 
 	if (expires)
-		ci.rta_expires = jiffies_to_clock_t(expires);
+		ci.rta_expires = expires > 0 ? jiffies_to_clock_t(expires)
+			: -jiffies_to_clock_t(-expires);
 
 	return nla_put(skb, RTA_CACHEINFO, sizeof(ci), &ci);
 }
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index becb048..7875255 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2516,10 +2516,11 @@ static int rt6_fill_node(struct net *net,
 		goto nla_put_failure;
 	if (!(rt->rt6i_flags & RTF_EXPIRES))
 		expires = 0;
-	else if (rt->dst.expires - jiffies < INT_MAX)
-		expires = rt->dst.expires - jiffies;
+	else if ((long)rt->dst.expires - (long)jiffies > INT_MIN
+			&& (long)rt->dst.expires - (long)jiffies < INT_MAX)
+		expires = (long)rt->dst.expires - (long)jiffies;
 	else
-		expires = INT_MAX;
+		expires = time_is_after_jiffies(rt->dst.expires) ? INT_MAX : INT_MIN;
 
 	peer = rt->rt6i_peer;
 	ts = tsage = 0;
-- 
1.7.1

^ permalink raw reply related


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