Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 1/9] drivers/net: remove unnecessary flush_scheduled_work() calls
From: Jon Mason @ 2010-12-15  0:54 UTC (permalink / raw)
  To: Tejun Heo
  Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	davem@davemloft.net, Wolfgang Grandegger, Stephen Hemminger,
	Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur
In-Reply-To: <1292169185-10579-2-git-send-email-tj@kernel.org>

On Sun, Dec 12, 2010 at 07:52:57AM -0800, Tejun Heo wrote:
> janz-ican3, sh_eth, skge and vxge don't use workqueue at all and there
> is no reason to flush the system_wq.  Drop flush_scheduled_work()
> calls and references to workqueue.

I believe you were referencing an older version of the vxge driver.
These is now a reset task that runs on the system workqueue.  Based on
your other patches, the flush_scheduled_work should be replaced with a
cancel_delayed_work_sync(&vdev->reset_task)

Thanks,
Jon

>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
> Cc: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
> Cc: Sivakumar Subramani <sivakumar.subramani@exar.com>
> Cc: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
> Cc: Jon Mason <jon.mason@exar.com>
> Cc: netdev@vger.kernel.org
> ---
>  drivers/net/can/janz-ican3.c |    9 ---------
>  drivers/net/sh_eth.c         |    1 -
>  drivers/net/sh_eth.h         |    1 -
>  drivers/net/skge.c           |    2 --
>  drivers/net/vxge/vxge-main.c |    2 --
>  5 files changed, 0 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
> index 6e533dc..b9a6d7a 100644
> --- a/drivers/net/can/janz-ican3.c
> +++ b/drivers/net/can/janz-ican3.c
> @@ -1114,11 +1114,6 @@ static bool ican3_txok(struct ican3_dev *mod)
>  /*
>   * Recieve one CAN frame from the hardware
>   *
> - * This works like the core of a NAPI function, but is intended to be called
> - * from workqueue context instead. This driver already needs a workqueue to
> - * process control messages, so we use the workqueue instead of using NAPI.
> - * This was done to simplify locking.
> - *
>   * CONTEXT: must be called from user context
>   */
>  static int ican3_recv_skb(struct ican3_dev *mod)
> @@ -1251,7 +1246,6 @@ static irqreturn_t ican3_irq(int irq, void *dev_id)
>   * Reset an ICAN module to its power-on state
>   *
>   * CONTEXT: no network device registered
> - * LOCKING: work function disabled
>   */
>  static int ican3_reset_module(struct ican3_dev *mod)
>  {
> @@ -1262,9 +1256,6 @@ static int ican3_reset_module(struct ican3_dev *mod)
>       /* disable interrupts so no more work is scheduled */
>       iowrite8(1 << mod->num, &mod->ctrl->int_disable);
>
> -     /* flush any pending work */
> -     flush_scheduled_work();
> -
>       /* the first unallocated page in the DPM is #9 */
>       mod->free_page = DPM_FREE_START;
>
> diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
> index b12660d..819c175 100644
> --- a/drivers/net/sh_eth.c
> +++ b/drivers/net/sh_eth.c
> @@ -1552,7 +1552,6 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
>
>       sh_mdio_release(ndev);
>       unregister_netdev(ndev);
> -     flush_scheduled_work();
>       pm_runtime_disable(&pdev->dev);
>       free_netdev(ndev);
>       platform_set_drvdata(pdev, NULL);
> diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h
> index 8b47763..efa6422 100644
> --- a/drivers/net/sh_eth.h
> +++ b/drivers/net/sh_eth.h
> @@ -26,7 +26,6 @@
>  #include <linux/module.h>
>  #include <linux/kernel.h>
>  #include <linux/spinlock.h>
> -#include <linux/workqueue.h>
>  #include <linux/netdevice.h>
>  #include <linux/phy.h>
>
> diff --git a/drivers/net/skge.c b/drivers/net/skge.c
> index 220e039..8c1404b 100644
> --- a/drivers/net/skge.c
> +++ b/drivers/net/skge.c
> @@ -4012,8 +4012,6 @@ static void __devexit skge_remove(struct pci_dev *pdev)
>       if (!hw)
>               return;
>
> -     flush_scheduled_work();
> -
>       dev1 = hw->dev[1];
>       if (dev1)
>               unregister_netdev(dev1);
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index b771e4b..537ad87 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
> @@ -3439,8 +3439,6 @@ static void vxge_device_unregister(struct __vxge_hw_device *hldev)
>
>       strncpy(buf, dev->name, IFNAMSIZ);
>
> -     flush_scheduled_work();
> -
>       /* in 2.6 will call stop() if device is up */
>       unregister_netdev(dev);
>
> --
> 1.7.1
>

The information and any attached documents contained in this message
may be confidential and/or legally privileged.  The message is
intended solely for the addressee(s).  If you are not the intended
recipient, you are hereby notified that any use, dissemination, or
reproduction is strictly prohibited and may be unlawful.  If you are
not the intended recipient, please contact the sender immediately by
return e-mail and destroy all copies of the original message.

^ permalink raw reply

* Re: [PATCHv2] fragment locally-generated IPsec6 packets that need it
From: Herbert Xu @ 2010-12-15  0:59 UTC (permalink / raw)
  To: David L Stevens; +Cc: davem, netdev
In-Reply-To: <1292351554.4720.7.camel@IBM-1B506CFC885>

On Tue, Dec 14, 2010 at 10:32:34AM -0800, David L Stevens wrote:
>
> @@ -88,8 +89,17 @@ static int xfrm6_output_finish(struct sk
>  	return xfrm_output(skb);
>  }
>  
> -int xfrm6_output(struct sk_buff *skb)
> +static int __xfrm6_output(struct sk_buff *skb)
>  {
>  	return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL,
>  		       skb_dst(skb)->dev, xfrm6_output_finish);
>  }
> +
> +int xfrm6_output(struct sk_buff *skb)
> +{
> +	if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
> +		dst_allfrag(skb_dst(skb))) {
> +			return ip6_fragment(skb, __xfrm6_output);
> +	}
> +	return __xfrm6_output(skb);
> +}

Oops, I didn't notice this the first time around.  The fragmentation
call should occur after POST_ROUTING.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [PATCH] fix IPv6 queries for bridge multicast snooping
From: Herbert Xu @ 2010-12-15  1:00 UTC (permalink / raw)
  To: David L Stevens; +Cc: davem, netdev
In-Reply-To: <1292352136.4720.11.camel@IBM-1B506CFC885>

On Tue, Dec 14, 2010 at 10:42:16AM -0800, David L Stevens wrote:
> This patch fixes a missing ntohs() for bridge IPv6 multicast snooping.
> 
> Signed-off-by: David L Stevens <dlstevens@us.ibm.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

I had wanted to fix this but forgot :)

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* [PATCH 3/3] net: Fix drivers advertising HW_CSUM feature to use csum_start
From: Michał Mirosław @ 2010-12-15  1:24 UTC (permalink / raw)
  To: netdev
  Cc: Roopa Prabhu, Eric Dumazet, Jiri Pirko, e1000-devel,
	Shreyas Bhatewara, Jie Yang, Vasanthy Kolluri, VMware, Inc.,
	Brice Goglin, Andrew Gallatin, Joe Perches, David Wang,
	Stephen Hemminger, David S. Miller, H Hartley Sweeten
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>

Some drivers are using skb_transport_offset(skb) instead of skb->csum_start
for NETIF_F_HW_CSUM offload.  This does not matter now, but if someone
implements checksumming of encapsulated packets then this will break silently.

TSO output paths are left as they are, since they are for IP+TCP only
(might be worth converting though).

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/net/atl1c/atl1c_main.c    |    2 +-
 drivers/net/atl1e/atl1e_main.c    |    2 +-
 drivers/net/cassini.c             |    2 +-
 drivers/net/e1000/e1000_main.c    |    2 +-
 drivers/net/e1000e/netdev.c       |    2 +-
 drivers/net/enic/enic_main.c      |    2 +-
 drivers/net/ixgb/ixgb_main.c      |    2 +-
 drivers/net/ll_temac_main.c       |    2 +-
 drivers/net/myri10ge/myri10ge.c   |    2 +-
 drivers/net/niu.c                 |    2 +-
 drivers/net/skge.c                |    2 +-
 drivers/net/sungem.c              |    2 +-
 drivers/net/sunhme.c              |    2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c |    4 ++--
 14 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index 09b099b..e48ea95 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -2078,7 +2078,7 @@ static int atl1c_tso_csum(struct atl1c_adapter *adapter,
 check_sum:
 	if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
 		u8 css, cso;
-		cso = skb_transport_offset(skb);
+		cso = skb_checksum_start_offset(skb);
 
 		if (unlikely(cso & 0x1)) {
 			if (netif_msg_tx_err(adapter))
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index ef6349b..e28f8ba 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -1649,7 +1649,7 @@ check_sum:
 	if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
 		u8 css, cso;
 
-		cso = skb_transport_offset(skb);
+		cso = skb_checksum_start_offset(skb);
 		if (unlikely(cso & 0x1)) {
 			netdev_err(adapter->netdev,
 				   "payload offset should not ant event number\n");
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index a8a32bc..73502fe 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -2788,7 +2788,7 @@ static inline int cas_xmit_tx_ringN(struct cas *cp, int ring,
 
 	ctrl = 0;
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		const u64 csum_start_off = skb_transport_offset(skb);
+		const u64 csum_start_off = skb_checksum_start_offset(skb);
 		const u64 csum_stuff_off = csum_start_off + skb->csum_offset;
 
 		ctrl =  TX_DESC_CSUM_EN |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 491bf2a..340e12d 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2726,7 +2726,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter,
 		break;
 	}
 
-	css = skb_transport_offset(skb);
+	css = skb_checksum_start_offset(skb);
 
 	i = tx_ring->next_to_use;
 	buffer_info = &tx_ring->buffer_info[i];
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 02d093d..a45dafd 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4473,7 +4473,7 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb)
 		break;
 	}
 
-	css = skb_transport_offset(skb);
+	css = skb_checksum_start_offset(skb);
 
 	i = tx_ring->next_to_use;
 	buffer_info = &tx_ring->buffer_info[i];
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 77d9138..9710047 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -702,7 +702,7 @@ static inline void enic_queue_wq_skb_csum_l4(struct enic *enic,
 {
 	unsigned int head_len = skb_headlen(skb);
 	unsigned int len_left = skb->len - head_len;
-	unsigned int hdr_len = skb_transport_offset(skb);
+	unsigned int hdr_len = skb_checksum_start_offset(skb);
 	unsigned int csum_offset = hdr_len + skb->csum_offset;
 	int eop = (len_left == 0);
 
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index b021798..5639ccc 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1262,7 +1262,7 @@ ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb)
 
 	if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
 		struct ixgb_buffer *buffer_info;
-		css = skb_transport_offset(skb);
+		css = skb_checksum_start_offset(skb);
 		cso = css + skb->csum_offset;
 
 		i = adapter->tx_ring.next_to_use;
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index 9f8e702..e2c2a72 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -692,7 +692,7 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
 	cur_p->app0 = 0;
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		unsigned int csum_start_off = skb_transport_offset(skb);
+		unsigned int csum_start_off = skb_checksum_start_offset(skb);
 		unsigned int csum_index_off = csum_start_off + skb->csum_offset;
 
 		cur_p->app0 |= 1; /* TX Checksum Enabled */
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 1ce0207..a37fcf1 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -2736,7 +2736,7 @@ again:
 	odd_flag = 0;
 	flags = (MXGEFW_FLAGS_NO_TSO | MXGEFW_FLAGS_FIRST);
 	if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
-		cksum_offset = skb_transport_offset(skb);
+		cksum_offset = skb_checksum_start_offset(skb);
 		pseudo_hdr_offset = cksum_offset + skb->csum_offset;
 		/* If the headers are excessively large, then we must
 		 * fall back to a software checksum */
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f64c424..2541321 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6589,7 +6589,7 @@ static u64 niu_compute_tx_flags(struct sk_buff *skb, struct ethhdr *ehdr,
 			     (ip_proto == IPPROTO_UDP ?
 			      TXHDR_CSUM_UDP : TXHDR_CSUM_SCTP));
 
-		start = skb_transport_offset(skb) -
+		start = skb_checksum_start_offset(skb) -
 			(pad_bytes + sizeof(struct tx_pkt_hdr));
 		stuff = start + skb->csum_offset;
 
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8c1404b..50815fb 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2764,7 +2764,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
 	td->dma_hi = map >> 32;
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		const int offset = skb_transport_offset(skb);
+		const int offset = skb_checksum_start_offset(skb);
 
 		/* This seems backwards, but it is what the sk98lin
 		 * does.  Looks like hardware is wrong?
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 9e992ca..1c5408f 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1004,7 +1004,7 @@ static netdev_tx_t gem_start_xmit(struct sk_buff *skb,
 
 	ctrl = 0;
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		const u64 csum_start_off = skb_transport_offset(skb);
+		const u64 csum_start_off = skb_checksum_start_offset(skb);
 		const u64 csum_stuff_off = csum_start_off + skb->csum_offset;
 
 		ctrl = (TXDCTRL_CENAB |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 5e28c41..55bbb9c 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2266,7 +2266,7 @@ static netdev_tx_t happy_meal_start_xmit(struct sk_buff *skb,
 
 	tx_flags = TXFLAG_OWN;
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-		const u32 csum_start_off = skb_transport_offset(skb);
+		const u32 csum_start_off = skb_checksum_start_offset(skb);
 		const u32 csum_stuff_off = csum_start_off + skb->csum_offset;
 
 		tx_flags = (TXFLAG_OWN | TXFLAG_CSENABLE |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 0169be7..d87a230 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -798,7 +798,7 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
 {
 	struct Vmxnet3_TxDataDesc *tdd;
 
-	if (ctx->mss) {
+	if (ctx->mss) {	/* TSO */
 		ctx->eth_ip_hdr_size = skb_transport_offset(skb);
 		ctx->l4_hdr_size = ((struct tcphdr *)
 				   skb_transport_header(skb))->doff * 4;
@@ -807,7 +807,7 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
 		unsigned int pull_size;
 
 		if (skb->ip_summed == CHECKSUM_PARTIAL) {
-			ctx->eth_ip_hdr_size = skb_transport_offset(skb);
+			ctx->eth_ip_hdr_size = skb_checksum_start_offset(skb);
 
 			if (ctx->ipv4) {
 				struct iphdr *iph = (struct iphdr *)
-- 
1.7.2.3


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
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

* [PATCH 1/3] net: Introduce skb_checksum_start_offset()
From: Michał Mirosław @ 2010-12-15  1:24 UTC (permalink / raw)
  To: netdev
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>

Introduce skb_checksum_start_offset() to replace repetitive calculation.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 include/linux/skbuff.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 19f37a6..0491da5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1355,6 +1355,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
 }
 #endif /* NET_SKBUFF_DATA_USES_OFFSET */
 
+static inline int skb_checksum_start_offset(const struct sk_buff *skb)
+{
+	return skb->csum_start - skb_headroom(skb);
+}
+
 static inline int skb_transport_offset(const struct sk_buff *skb)
 {
 	return skb_transport_header(skb) - skb->data;
-- 
1.7.2.3


^ permalink raw reply related

* [PATCH 0/3] Fix NETIF_F_HW_CSUM implementations [v2]
From: Michał Mirosław @ 2010-12-15  1:24 UTC (permalink / raw)
  To: netdev

This is a split version of a patch fixing NETIF_F_HW_CSUM implementations
in network drivers. For easier review, this is split into three patches:

 1. introduce skb_checksum_start_offset() helper
 2. convert correct implementations to use the helper from #1
 3. fix bad uses of skb_transport_offset() using helper from #1

Patches are against net-next, commit 0dbaee3b37e118a96bb7b8eb0d9bbaeeb46264be

	net: Abstract default ADVMSS behind an accessor.

Best Regards,
Michał Mirosław

---

Michał Mirosław (3):
  net: Introduce skb_checksum_start_offset()
  net: Use skb_checksum_start_offset()
  net: Fix drivers advertising HW_CSUM feature to use csum_start

 drivers/net/atl1c/atl1c_main.c    |    2 +-
 drivers/net/atl1e/atl1e_main.c    |    2 +-
 drivers/net/atlx/atl1.c           |    2 +-
 drivers/net/cassini.c             |    2 +-
 drivers/net/e1000/e1000_main.c    |    2 +-
 drivers/net/e1000e/netdev.c       |    2 +-
 drivers/net/enic/enic_main.c      |    2 +-
 drivers/net/ixgb/ixgb_main.c      |    2 +-
 drivers/net/ll_temac_main.c       |    2 +-
 drivers/net/macvtap.c             |    3 +--
 drivers/net/myri10ge/myri10ge.c   |    2 +-
 drivers/net/niu.c                 |    2 +-
 drivers/net/skge.c                |    2 +-
 drivers/net/sungem.c              |    2 +-
 drivers/net/sunhme.c              |    2 +-
 drivers/net/tun.c                 |    2 +-
 drivers/net/usb/smsc95xx.c        |    7 +++----
 drivers/net/virtio_net.c          |    2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c |    4 ++--
 include/linux/skbuff.h            |    5 +++++
 net/core/dev.c                    |    6 +++---
 net/core/skbuff.c                 |    2 +-
 net/ipv4/udp.c                    |    2 +-
 net/packet/af_packet.c            |    3 +--
 24 files changed, 33 insertions(+), 31 deletions(-)

-- 
1.7.2.3


^ permalink raw reply

* [PATCH 2/3] net: Use skb_checksum_start_offset()
From: Michał Mirosław @ 2010-12-15  1:24 UTC (permalink / raw)
  To: netdev
  Cc: Jay Cliburn, Chris Snook, Jie Yang, Steve Glendinning,
	Greg Kroah-Hartman, Patrick McHardy, David S. Miller,
	Alexey Kuznetsov, James Morris
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>

Replace skb->csum_start - skb_headroom(skb) with skb_checksum_start_offset().

Note for usb/smsc95xx: skb->data - skb->head == skb_headroom(skb).

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

---
 drivers/net/atlx/atl1.c    |    2 +-
 drivers/net/macvtap.c      |    3 +--
 drivers/net/tun.c          |    2 +-
 drivers/net/usb/smsc95xx.c |    7 +++----
 drivers/net/virtio_net.c   |    2 +-
 net/core/dev.c             |    6 +++---
 net/core/skbuff.c          |    2 +-
 net/ipv4/udp.c             |    2 +-
 net/packet/af_packet.c     |    3 +--
 9 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 5336310..def8df8 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2174,7 +2174,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
 	u8 css, cso;
 
 	if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
-		css = (u8) (skb->csum_start - skb_headroom(skb));
+		css = skb_checksum_start_offset(skb);
 		cso = css + (u8) skb->csum_offset;
 		if (unlikely(css & 0x1)) {
 			/* L1 hardware requires an even number here */
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 4256727..21845af 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -504,8 +504,7 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
-		vnet_hdr->csum_start = skb->csum_start -
-					skb_headroom(skb);
+		vnet_hdr->csum_start = skb_checksum_start_offset(skb);
 		vnet_hdr->csum_offset = skb->csum_offset;
 	} /* else everything is zero */
 
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 55f3a3e..7599c45 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -757,7 +757,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
 
 		if (skb->ip_summed == CHECKSUM_PARTIAL) {
 			gso.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
-			gso.csum_start = skb->csum_start - skb_headroom(skb);
+			gso.csum_start = skb_checksum_start_offset(skb);
 			gso.csum_offset = skb->csum_offset;
 		} /* else everything is zero */
 
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 65cb1ab..bc86f4b 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1163,9 +1163,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 
 static u32 smsc95xx_calc_csum_preamble(struct sk_buff *skb)
 {
-	int len = skb->data - skb->head;
-	u16 high_16 = (u16)(skb->csum_offset + skb->csum_start - len);
-	u16 low_16 = (u16)(skb->csum_start - len);
+	u16 low_16 = (u16)skb_checksum_start_offset(skb);
+	u16 high_16 = low_16 + skb->csum_offset;
 	return (high_16 << 16) | low_16;
 }
 
@@ -1193,7 +1192,7 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
 		if (skb->len <= 45) {
 			/* workaround - hardware tx checksum does not work
 			 * properly with extremely small packets */
-			long csstart = skb->csum_start - skb_headroom(skb);
+			long csstart = skb_checksum_start_offset(skb);
 			__wsum calc = csum_partial(skb->data + csstart,
 				skb->len - csstart, 0);
 			*((__sum16 *)(skb->data + csstart
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b6d4028..90a23e4 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -519,7 +519,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		hdr->hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
-		hdr->hdr.csum_start = skb->csum_start - skb_headroom(skb);
+		hdr->hdr.csum_start = skb_checksum_start_offset(skb);
 		hdr->hdr.csum_offset = skb->csum_offset;
 	} else {
 		hdr->hdr.flags = 0;
diff --git a/net/core/dev.c b/net/core/dev.c
index d28b3a0..f937726 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1761,7 +1761,7 @@ int skb_checksum_help(struct sk_buff *skb)
 		goto out_set_summed;
 	}
 
-	offset = skb->csum_start - skb_headroom(skb);
+	offset = skb_checksum_start_offset(skb);
 	BUG_ON(offset >= skb_headlen(skb));
 	csum = skb_checksum(skb, offset, skb->len - offset, 0);
 
@@ -2058,8 +2058,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
 			 * checksumming here.
 			 */
 			if (skb->ip_summed == CHECKSUM_PARTIAL) {
-				skb_set_transport_header(skb, skb->csum_start -
-					      skb_headroom(skb));
+				skb_set_transport_header(skb,
+					skb_checksum_start_offset(skb));
 				if (!dev_can_checksum(dev, skb) &&
 				     skb_checksum_help(skb))
 					goto out_kfree_skb;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 8814a9a..19d6c21 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1824,7 +1824,7 @@ void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to)
 	long csstart;
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL)
-		csstart = skb->csum_start - skb_headroom(skb);
+		csstart = skb_checksum_start_offset(skb);
 	else
 		csstart = skb_headlen(skb);
 
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index b37181d..1198adf 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2226,7 +2226,7 @@ struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features)
 	/* Do software UFO. Complete and fill in the UDP checksum as HW cannot
 	 * do checksum of UDP packets sent as multiple IP fragments.
 	 */
-	offset = skb->csum_start - skb_headroom(skb);
+	offset = skb_checksum_start_offset(skb);
 	csum = skb_checksum(skb, offset, skb->len - offset, 0);
 	offset += skb->csum_offset;
 	*(__sum16 *)(skb->data + offset) = csum_fold(csum);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index e79efaf..91cb1d7 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1650,8 +1650,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
 
 		if (skb->ip_summed == CHECKSUM_PARTIAL) {
 			vnet_hdr.flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
-			vnet_hdr.csum_start = skb->csum_start -
-							skb_headroom(skb);
+			vnet_hdr.csum_start = skb_checksum_start_offset(skb);
 			vnet_hdr.csum_offset = skb->csum_offset;
 		} /* else everything is zero */
 
-- 
1.7.2.3


^ permalink raw reply related

* Re: [PATCH 0/3] Fix NETIF_F_HW_CSUM implementations [v2]
From: David Miller @ 2010-12-15  1:29 UTC (permalink / raw)
  To: mirq-linux; +Cc: netdev
In-Reply-To: <cover.1292372504.git.mirq-linux@rere.qmqm.pl>

From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Date: Wed, 15 Dec 2010 02:24:08 +0100 (CET)

> This is a split version of a patch fixing NETIF_F_HW_CSUM implementations
> in network drivers. For easier review, this is split into three patches:
> 
>  1. introduce skb_checksum_start_offset() helper
>  2. convert correct implementations to use the helper from #1
>  3. fix bad uses of skb_transport_offset() using helper from #1

I don't have any idea why you'd CC: as the networking maintainer only
on some of these patches.

That doesn't make any sense at all.

Either CC: me on all of them, or none.  Don't partially CC: as that
makes it painful for me to manage my inbox.

Thank you.


^ permalink raw reply

* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Matt Carlson @ 2010-12-15  1:34 UTC (permalink / raw)
  To: Michael Leun
  Cc: Matthew Carlson, Jesse Gross, Michael Chan, Eric Dumazet,
	David Miller, Ben Greear, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
In-Reply-To: <20101215012430.120fd47f@xenia.leun.net>

On Tue, Dec 14, 2010 at 04:24:30PM -0800, Michael Leun wrote:
> On Tue, 14 Dec 2010 11:15:00 -0800
> "Matt Carlson" <mcarlson@broadcom.com> wrote:
> > Michael, I'm wondering if the difference in behavior can be explained
> > by the presence or absence of management firmware.  Can you look at
> > the driver sign-on messages in your syslogs for ASF[]?  I'm half
> > expecting the 5752 to show "ASF[0]" and the 5714 to show "ASF[1]".
> > If you see this, and the below patch doesn't fix the problem, let me
> > know.  I have another test I'd like you to run.
> 
> Do I understand this correct? "Management firmware" or ASF is some
> feature, vendor decides to built into network card (firmware) or not?

Right.

> If so, would'nt one expect two oneboard network cards in one server
> to look alike?

Mostly, yes.  Except for.....

> HP Proliant DL320G5
> 
> <6>tg3.c:v3.113 (August 2, 2010)
> <6>tg3 0000:03:04.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> <6>tg3 0000:03:04.0: eth0: Tigon3 [partno(N/A) rev 9003] (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx
> <6>tg3 0000:03:04.0: eth0: attached PHY is 5714 (10/100/1000Base-T Ethernet) (WireSpeed[1])
> <6>tg3 0000:03:04.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] TSOcap[1]
                                                      This =>  ^^^^^^
> <6>tg3 0000:03:04.0: eth0: dma_rwctrl[76148000] dma_mask[64-bit]
> <6>tg3 0000:03:04.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
> <6>tg3 0000:03:04.1: eth1: Tigon3 [partno(N/A) rev 9003] (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx
> <6>tg3 0000:03:04.1: eth1: attached PHY is 5714 (10/100/1000Base-T Ethernet) (WireSpeed[1])
> <6>tg3 0000:03:04.1: eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
                                                  And this =>  ^^^^^^
> <6>tg3 0000:03:04.1: eth1: dma_rwctrl[76148000] dma_mask[64-bit]

So management firmware is turned off on the second port.

> Lenovo ThinkPad z61m
> 
> [    2.679130] tg3.c:v3.113 (August 2, 2010)
> [    2.679176] tg3 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> [    2.679188] tg3 0000:02:00.0: setting latency timer to 64
> [    2.728572] tg3 0000:02:00.0: eth0: Tigon3 [partno(BCM95752m) rev 6002] (PCI Express) MAC address xx:xx:xx:xx:xx:xx
> [    2.728577] tg3 0000:02:00.0: eth0: attached PHY is 5752 (10/100/1000Base-T Ethernet) (WireSpeed[1])
> [    2.728581] tg3 0000:02:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
                                                                           ^^^^^^
And it isn't present on the 5752.

> [    2.728585] tg3 0000:02:00.0: eth0: dma_rwctrl[76180000]
> dma_mask[64-bit]
> 
> 
> > ----
> > 
> > [PATCH] tg3: Use new VLAN code
> 
> Unfortunately had'nt time to try much now, but with 2.6.37-rc5 / your
> patch on the DL320, single user mode (nothing configured on eth) just
> after ifconfig eth0/eth1 up I see NO vlan tags on eth0 but I see vlan
> tags on eth1, so there clearly is a difference.
> 
> I should have checked if I still see vlan tags on eth1 if I configure
> some vlan there - if helpful maybe I can do this (have to look, when I
> can effort another downtime).

This would be helpful, just to solidify our findings.

> I wonder, if the difference in that both onboard cards is really there
> or if there is some malfunction in detecion?

Please run the above test first, but afterwards, can you apply the below
patch on top of your current sources.  I suspect eth1 will begin to act
like eth0.

This patch is just a test.

[PATCH] tg3: Always strip VLAN tags

This patch configures the hardware to always strip VLAN tags from
incoming packets.
---
 drivers/net/tg3.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 3682205..964293f 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9505,8 +9505,10 @@ static void __tg3_set_rx_mode(struct net_device *dev)
 	/* When ASF is in use, we always keep the RX_MODE_KEEP_VLAN_TAG
 	 * flag clear.
 	 */
+#if 0
 	if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
 		rx_mode |= RX_MODE_KEEP_VLAN_TAG;
+#endif
 
 	if (dev->flags & IFF_PROMISC) {
 		/* Promiscuous mode. */
-- 
1.7.2.2

^ permalink raw reply related

* [PATCH] sctp: fix the return value of getting the sctp partial delivery point
From: Wei Yongjun @ 2010-12-15  2:10 UTC (permalink / raw)
  To: Vlad Yasevich, David Miller; +Cc: linux-sctp, netdev@vger.kernel.org

Get the sctp partial delivery point using SCTP_PARTIAL_DELIVERY_POINT
socket option should return 0 if success, not -ENOTSUPP.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 1bc5203..8628e8e 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5050,7 +5050,7 @@ static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len,
 	if (copy_to_user(optval, &val, len))
 		return -EFAULT;
 
-	return -ENOTSUPP;
+	return 0;
 }
 
 /*
-- 
1.6.5.2



^ permalink raw reply related

* Re: [PATCH v3 21/22] netoops: Add user-programmable boot_id
From: Ted Ts'o @ 2010-12-15  2:16 UTC (permalink / raw)
  To: Mike Waychison
  Cc: Matt Mackall, simon.kagstrom-vI6UBbBVNY+JA8cjQkG2/g,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q, nhorman-2XuSBdqkA4R54TAoqtyWWQ,
	adurbin-hpIqsD4AKlfQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	chavey-hpIqsD4AKlfQT0dZR+AlfA, Greg KH,
	netdev-u79uwXL29TY76Z2rM5mHXA, Américo Wang,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-api-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <AANLkTinugLaeuHjOAY6s=Vhwo-VOYr9dz7OE7GZFH+xK-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Dec 14, 2010 at 03:19:50PM -0800, Mike Waychison wrote:
> 
> I'm not sure there is a _good_ way to support this, is there?  I just
> read through RFC 4122 and UUIDs seem to be pretty well structured;
> it's probably not such a great idea to allow folks to override
> portions of it.  Like I mentioned in my last email though, I'm okay
> pushing this boot sequence ID down into the user blob which acts like
> a place for "vendor extensions" if there isn't a good place for it in
> the kernel.

If you really wanted to do it I could imagine using a time-based UUID
(see RFC 4122, section 4.2), where the boot sequence number could be
mapped into the 14-bit clock sequence, and using the time read from
the hardware counter and the ethernet MAC address from... umm the
"first" ethernet port (depending on how you define that) to form a
UUID.  I'm not convinced it's really worth it, though, unless someone
really wants a good per-boot session UUID generated some other way
than a random number generator that may not be all that adequately
seed at the time when you first sample the boot session UUID.

I suspect pushing the boot sequence ID into its own special field with
the semantics that you want is probably the better way to go.

     	     	    	      	  	- Ted

^ permalink raw reply

* Re: [PATCH 5/5] net: add skb.old_queue_mapping
From: Changli Gao @ 2010-12-15  2:59 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <AANLkTinz-3HWnin8OhxxLuCncKgU_Fh8Wq9CcGe2jjXE@mail.gmail.com>

On Tue, Dec 14, 2010 at 7:58 AM, Changli Gao <xiaosuo@gmail.com> wrote:
>
> skb->cb can only be used in the same layer, so we can't use it to save
> a value crossing layers. A quick grep finds sch_netem just uses
> skb->cb. Maybe we can put all the skb->cb in the qdisc layer and
> old_queue_mapping in a structure as a new skb->cb. Is it OK? Thanks.
>

I can't do that. Below the qdisc layer, there is another user of
skb->cb GSO. Though we can set the GSO features of ifb to skip
gso_segments(), it is too tricky and weak.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply

* Re: [PATCH 3/3] net: Fix drivers advertising HW_CSUM feature to use csum_start
From: Stephen Hemminger @ 2010-12-15  3:07 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Roopa Prabhu, Dumazet, Jiri Pirko, e1000-devel, netdev, Vasanthy,
	Jie Yang, Eric, Kolluri, VMware, Inc., Brice Goglin, H,
	Andrew Gallatin, Joe Perches, David Wang, Shreyas Bhatewara,
	David S. Miller, Sweeten
In-Reply-To: <aa9d85fa4961e87c38aec922913cbc95465fc082.1292372504.git.mirq-linux@rere.qmqm.pl>

On Wed, 15 Dec 2010 02:24:08 +0100 (CET)
Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> Some drivers are using skb_transport_offset(skb) instead of skb->csum_start
> for NETIF_F_HW_CSUM offload.  This does not matter now, but if someone
> implements checksumming of encapsulated packets then this will break silently.
> 
> TSO output paths are left as they are, since they are for IP+TCP only
> (might be worth converting though).
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

Which if any of these drivers did you test on real hardware?


-- 

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
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

* Re: [PATCH v2] kptr_restrict for hiding kernel pointers from unprivileged users
From: Eugene Teo @ 2010-12-15  4:18 UTC (permalink / raw)
  To: Dan Rosenberg
  Cc: netdev, linux-security-module, David S. Miller, Ingo Molnar,
	Kees Cook, Eugene Teo, James Morris
In-Reply-To: <1292385983.9764.5.camel@Dan>

On 12/15/2010 12:06 PM, Dan Rosenberg wrote:
> The below patch adds the %pK format specifier, the
> CONFIG_SECURITY_KPTR_RESTRICT configuration option, and the
> kptr_restrict sysctl.
>
> The %pK format specifier is designed to hide exposed kernel pointers
> from unprivileged users, specifically via /proc interfaces.  Its
> behavior depends on the kptr_restrict sysctl, whose default value
> depends on CONFIG_SECURITY_KPTR_RESTRICT.  If kptr_restrict is set to 0,
> no deviation from the standard %p behavior occurs.  If kptr_restrict is
> set to 1, if the current user (intended to be a reader via seq_printf(),
> etc.) does not have CAP_SYSLOG (which is currently in the LSM tree),
> kernel pointers using %pK are printed as 0's.  This was chosen over the
> default "(null)", which cannot be parsed by userland %p, which expects
> "(nil)".
>
> v2 improves checking for inappropriate context, on suggestion by Peter
> Zijlstra.  Thanks to Thomas Graf for suggesting use of a centralized
> format specifier.
>
> Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
> CC: James Morris <jmorris@namei.org>
> CC: Eugene Teo <eugeneteo@kernel.org>
> CC: Kees Cook <kees.cook@canonical.com>
> CC: Ingo Molnar <mingo@elte.hu>
> CC: David S. Miller <davem@davemloft.net>
> CC: linux-security-module@vger.kernel.org
> CC: netdev@vger.kernel.org

Acked-by: Eugene Teo <eugeneteo@kernel.org>

Eugene

^ permalink raw reply

* Re: Using net_devices with ATM/DSL
From: Philip Prindeville @ 2010-12-15  4:36 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev
In-Reply-To: <201012131350.10206.florian@openwrt.org>

On 12/13/10 4:50 AM, Florian Fainelli wrote:
> Hello,
>
> On Monday 13 December 2010 07:53:07 Philip Prindeville wrote:
>> I was trying to get this discussion rolling on linux-atm-general but didn't
>> have much luck.
>>
>> I was wondering what the downside to having ATM/DSL interfaces use
>> net_devices would be?
> I think you would have to add ATM/DSL-specific extensions (ala wext) just to
> extend it, specializing an atm_dev would make more sense to me.

As long as it's symmetrical/consistent for br2684, PPPoE, and PPPoA, that would be good.

>> Part of the reason for wanting to do this is to have an end-point to
>> send/receive netlink messages to, so that the interface can report carrier
>> state transitions, bit rates, bit-error rates, SNR, attenuation,
>> constellations, transmitter gain, etc.
>>
>> Seems simple enough.
> If you want to be able to report informations from the DSL PHY, I would rather
> specialize an interface called, say dsl_phy which has a list of operations for
> setting/getting the DSL PHY state, low-level counters ...

Yes and no.  Carrier, bit rates, bit-error rates, are generic to ATM (because I might have an OC3c or OC12).

SNR, attenuation, constellations, transmitter gain, etc. are specific to DSL.


> The atm stack more or less already supports an ATM PHY with
> atmphy_ops, but is in my opinion too limited to query chip-speficic infos.

And I think it's only visible when you use br2684, right?  I also don't understand why the PPPoE code doesn't leverage br2684 more...


> Once that interface is well defined, adding netlink support to it should be
> rather straight forward.
>
>> Why not do this?
>>
>> Thanks,
>>
>> -Philip


^ permalink raw reply

* [PATCH 5/5 v2] net: add old_queue_mapping into skb->cb
From: Changli Gao @ 2010-12-15  5:23 UTC (permalink / raw)
  To: Jamal Hadi Salim
  Cc: David S. Miller, Stephen Hemminger, Eric Dumazet, Tom Herbert,
	Jiri Pirko, netdev, netem, Changli Gao

For the skbs returned from ifb, we should use the queue_mapping
saved before ifb.

We save old queue_mapping in old_queue_mapping just before calling 
dev_queue_xmit, and restore the old_queue_mapping to queue_mapping
just before reinjecting the skb.

dev_pick_tx() use the current queue_mapping for the skbs reinjected
by ifb.

A new struct dev_skb_cb is added, and valid in qdisc and gso layer.
The original qdisc_skb_cb and DEV_GSO_CB are placed after dev_skb_cb.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
v2: save old_queue_mapping in skb->cb
 drivers/net/ifb.c         |    1 +
 include/linux/netdevice.h |   11 +++++++++++
 include/net/sch_generic.h |    6 ++++--
 net/core/dev.c            |   18 ++++++++++++++----
 net/sched/act_mirred.c    |    1 +
 net/sched/sch_netem.c     |    5 +++--
 6 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 918a38e..ff01795 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -92,6 +92,7 @@ static void ri_tasklet(unsigned long arg)
 		u64_stats_update_end(&qp->syncp);
 		skb->skb_iif = dev->ifindex;
 
+		skb->queue_mapping = dev_skb_cb(skb)->old_queue_mapping;
 		if (from & AT_EGRESS) {
 			dev_queue_xmit(skb);
 		} else if (from & AT_INGRESS) {
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d31bc3c..9820a48 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1295,6 +1295,17 @@ struct napi_gro_cb {
 
 #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
 
+struct dev_skb_cb {
+	u16		old_queue_mapping;
+	unsigned long	data[];
+};
+
+static inline struct dev_skb_cb *dev_skb_cb(struct sk_buff *skb)
+{
+	BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct dev_skb_cb));
+	return (struct dev_skb_cb *)skb->cb;
+}
+
 struct packet_type {
 	__be16			type;	/* This is really htons(ether_type). */
 	struct net_device	*dev;	/* NULL is wildcarded here	     */
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index ea1f8a8..1089938 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -199,7 +199,7 @@ struct tcf_proto {
 
 struct qdisc_skb_cb {
 	unsigned int		pkt_len;
-	char			data[];
+	unsigned long		data[];
 };
 
 static inline int qdisc_qlen(struct Qdisc *q)
@@ -209,7 +209,9 @@ static inline int qdisc_qlen(struct Qdisc *q)
 
 static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb)
 {
-	return (struct qdisc_skb_cb *)skb->cb;
+	BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct dev_skb_cb) +
+				       sizeof(struct qdisc_skb_cb));
+	return (struct qdisc_skb_cb *)dev_skb_cb(skb)->data;
 }
 
 static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
diff --git a/net/core/dev.c b/net/core/dev.c
index d28b3a0..11a5a13 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1904,7 +1904,12 @@ struct dev_gso_cb {
 	void (*destructor)(struct sk_buff *skb);
 };
 
-#define DEV_GSO_CB(skb) ((struct dev_gso_cb *)(skb)->cb)
+static inline struct dev_gso_cb *dev_gso_cb(struct sk_buff *skb)
+{
+	BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct dev_skb_cb) +
+				       sizeof(struct dev_gso_cb));
+	return (struct dev_gso_cb *)dev_skb_cb(skb)->data;
+}
 
 static void dev_gso_skb_destructor(struct sk_buff *skb)
 {
@@ -1918,7 +1923,7 @@ static void dev_gso_skb_destructor(struct sk_buff *skb)
 		kfree_skb(nskb);
 	} while (skb->next);
 
-	cb = DEV_GSO_CB(skb);
+	cb = dev_gso_cb(skb);
 	if (cb->destructor)
 		cb->destructor(skb);
 }
@@ -1947,7 +1952,7 @@ static int dev_gso_segment(struct sk_buff *skb)
 		return PTR_ERR(segs);
 
 	skb->next = segs;
-	DEV_GSO_CB(skb)->destructor = skb->destructor;
+	dev_gso_cb(skb)->destructor = skb->destructor;
 	skb->destructor = dev_gso_skb_destructor;
 
 	return 0;
@@ -2103,7 +2108,7 @@ gso:
 
 out_kfree_gso_skb:
 	if (likely(skb->next == NULL))
-		skb->destructor = DEV_GSO_CB(skb)->destructor;
+		skb->destructor = dev_gso_cb(skb)->destructor;
 out_kfree_skb:
 	kfree_skb(skb);
 out:
@@ -2190,6 +2195,11 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev,
 	int queue_index;
 	const struct net_device_ops *ops = dev->netdev_ops;
 
+#ifdef CONFIG_NET_CLS_ACT
+	if (skb->tc_verd & TC_NCLS)
+		queue_index = skb_get_queue_mapping(skb);
+	else
+#endif
 	if (dev->real_num_tx_queues == 1)
 		queue_index = 0;
 	else if (ops->ndo_select_queue) {
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 0c311be..419e82f 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -197,6 +197,7 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a,
 
 	skb2->skb_iif = skb->dev->ifindex;
 	skb2->dev = dev;
+	dev_skb_cb(skb2)->old_queue_mapping = skb->queue_mapping;
 	dev_queue_xmit(skb2);
 	err = 0;
 
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index e5593c0..df4ff89 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -82,8 +82,9 @@ struct netem_skb_cb {
 
 static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
 {
-	BUILD_BUG_ON(sizeof(skb->cb) <
-		sizeof(struct qdisc_skb_cb) + sizeof(struct netem_skb_cb));
+	BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct dev_skb_cb) +
+				       sizeof(struct qdisc_skb_cb) +
+				       sizeof(struct netem_skb_cb));
 	return (struct netem_skb_cb *)qdisc_skb_cb(skb)->data;
 }
 

^ permalink raw reply related

* [PATCHv3] fragment locally-generated IPsec6 packets that need it
From: David L Stevens @ 2010-12-15  6:18 UTC (permalink / raw)
  To: Herbert Xu, davem; +Cc: netdev

This patch modifies IPsec6 to fragment IPv6 packets that are
locally generated as needed.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>

diff -ruNp linux-2.6.36-rc8/include/net/ip6_route.h linux-2.6.36-rc8DLS/include/net/ip6_route.h
--- linux-2.6.36-rc8/include/net/ip6_route.h	2010-10-14 16:26:43.000000000 -0700
+++ linux-2.6.36-rc8DLS/include/net/ip6_route.h	2010-12-12 09:22:48.582141401 -0800
@@ -164,5 +164,15 @@ static inline int ipv6_unicast_destinati
 	return rt->rt6i_flags & RTF_LOCAL;
 }
 
+int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
+
+static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
+{
+	struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;
+
+	return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ?
+	       skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
+}
+
 #endif
 #endif
diff -ruNp linux-2.6.36-rc8/net/ipv6/ip6_output.c linux-2.6.36-rc8DLS/net/ipv6/ip6_output.c
--- linux-2.6.36-rc8/net/ipv6/ip6_output.c	2010-10-14 16:26:43.000000000 -0700
+++ linux-2.6.36-rc8DLS/net/ipv6/ip6_output.c	2010-12-14 09:51:45.260779308 -0800
@@ -56,7 +56,7 @@
 #include <net/checksum.h>
 #include <linux/mroute6.h>
 
-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
+int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
 
 int __ip6_local_out(struct sk_buff *skb)
 {
@@ -145,14 +145,6 @@ static int ip6_finish_output2(struct sk_
 	return -EINVAL;
 }
 
-static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
-{
-	struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;
-
-	return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ?
-	       skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
-}
-
 static int ip6_finish_output(struct sk_buff *skb)
 {
 	if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
@@ -601,7 +593,7 @@ int ip6_find_1stfragopt(struct sk_buff *
 	return offset;
 }
 
-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
+int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
 {
 	struct sk_buff *frag;
 	struct rt6_info *rt = (struct rt6_info*)skb_dst(skb);
diff -ruNp linux-2.6.36-rc8/net/ipv6/xfrm6_output.c linux-2.6.36-rc8DLS/net/ipv6/xfrm6_output.c
--- linux-2.6.36-rc8/net/ipv6/xfrm6_output.c	2010-10-14 16:26:43.000000000 -0700
+++ linux-2.6.36-rc8DLS/net/ipv6/xfrm6_output.c	2010-12-14 18:26:37.466079877 -0800
@@ -17,6 +17,7 @@
 #include <linux/netfilter_ipv6.h>
 #include <net/dst.h>
 #include <net/ipv6.h>
+#include <net/ip6_route.h>
 #include <net/xfrm.h>
 
 int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
@@ -88,8 +89,17 @@ static int xfrm6_output_finish(struct sk
 	return xfrm_output(skb);
 }
 
+static int __xfrm6_output(struct sk_buff *skb)
+{
+	if ((skb->len > ip6_skb_dst_mtu(skb) && !skb_is_gso(skb)) ||
+		dst_allfrag(skb_dst(skb))) {
+			return ip6_fragment(skb, xfrm6_output_finish);
+	}
+	return xfrm6_output_finish(skb);
+}
+
 int xfrm6_output(struct sk_buff *skb)
 {
 	return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL,
-		       skb_dst(skb)->dev, xfrm6_output_finish);
+		       skb_dst(skb)->dev, __xfrm6_output);
 }




^ permalink raw reply

* [PATCH 1/3] net: kill unused macros
From: Shan Wei @ 2010-12-15  6:26 UTC (permalink / raw)
  To: paul.moore, David Miller, joe, jslaby, Eric Dumazet, tj, ebiederm,
	Alexey Dobriyan <a
  Cc: Network-Maillist

These macros never be used, so remove them.


Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
Include these changes to a patch for only netdev maillist,
Although these belong to different subsys.
---
 include/net/inet_connection_sock.h |    1 -
 include/net/tcp.h                  |    2 --
 net/atm/mpc.c                      |    2 --
 net/core/neighbour.c               |    1 -
 net/core/netpoll.c                 |    1 -
 net/netlabel/netlabel_cipso_v4.h   |    1 -
 net/netlabel/netlabel_mgmt.h       |    1 -
 net/netlabel/netlabel_unlabeled.h  |    1 -
 8 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 6c93a56..6ac4e3b 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -132,7 +132,6 @@ struct inet_connection_sock {
 #define ICSK_TIME_RETRANS	1	/* Retransmit timer */
 #define ICSK_TIME_DACK		2	/* Delayed ack timer */
 #define ICSK_TIME_PROBE0	3	/* Zero window probe timer */
-#define ICSK_TIME_KEEPOPEN	4	/* Keepalive timer */
 
 static inline struct inet_connection_sock *inet_csk(const struct sock *sk)
 {
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3f227ba..bd3c377 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1152,8 +1152,6 @@ struct tcp_md5sig_pool {
 	union tcp_md5sum_block	md5_blk;
 };
 
-#define TCP_MD5SIG_MAXKEYS	(~(u32)0)	/* really?! */
-
 /* - functions */
 extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
 			       struct sock *sk, struct request_sock *req,
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 74bcc66..644cdf0 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -64,8 +64,6 @@
 	do { if (0) printk(KERN_CONT format, ##args); } while (0)
 #endif
 
-#define MPOA_TAG_LEN 4
-
 /* mpc_daemon -> kernel */
 static void MPOA_trigger_rcvd(struct k_message *msg, struct mpoa_client *mpc);
 static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *mpc);
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 8cc8f9a..60a9029 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -41,7 +41,6 @@
 
 #define NEIGH_PRINTK(x...) printk(x)
 #define NEIGH_NOPRINTK(x...) do { ; } while(0)
-#define NEIGH_PRINTK0 NEIGH_PRINTK
 #define NEIGH_PRINTK1 NEIGH_NOPRINTK
 #define NEIGH_PRINTK2 NEIGH_NOPRINTK
 
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index ee38acb..72d9b50 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -35,7 +35,6 @@
 
 #define MAX_UDP_CHUNK 1460
 #define MAX_SKBS 32
-#define MAX_QUEUE_DEPTH (MAX_SKBS / 2)
 
 static struct sk_buff_head skb_pool;
 
diff --git a/net/netlabel/netlabel_cipso_v4.h b/net/netlabel/netlabel_cipso_v4.h
index c8a4079..af7f335 100644
--- a/net/netlabel/netlabel_cipso_v4.h
+++ b/net/netlabel/netlabel_cipso_v4.h
@@ -107,7 +107,6 @@ enum {
 	NLBL_CIPSOV4_C_LISTALL,
 	__NLBL_CIPSOV4_C_MAX,
 };
-#define NLBL_CIPSOV4_C_MAX (__NLBL_CIPSOV4_C_MAX - 1)
 
 /* NetLabel CIPSOv4 attributes */
 enum {
diff --git a/net/netlabel/netlabel_mgmt.h b/net/netlabel/netlabel_mgmt.h
index 05d9643..0a25838 100644
--- a/net/netlabel/netlabel_mgmt.h
+++ b/net/netlabel/netlabel_mgmt.h
@@ -173,7 +173,6 @@ enum {
 	NLBL_MGMT_C_VERSION,
 	__NLBL_MGMT_C_MAX,
 };
-#define NLBL_MGMT_C_MAX (__NLBL_MGMT_C_MAX - 1)
 
 /* NetLabel Management attributes */
 enum {
diff --git a/net/netlabel/netlabel_unlabeled.h b/net/netlabel/netlabel_unlabeled.h
index 7aba635..0bc8dc3 100644
--- a/net/netlabel/netlabel_unlabeled.h
+++ b/net/netlabel/netlabel_unlabeled.h
@@ -180,7 +180,6 @@ enum {
 	NLBL_UNLABEL_C_STATICLISTDEF,
 	__NLBL_UNLABEL_C_MAX,
 };
-#define NLBL_UNLABEL_C_MAX (__NLBL_UNLABEL_C_MAX - 1)
 
 /* NetLabel Unlabeled attributes */
 enum {
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 3/3] wireless:mac80211: kill unuse macro MESH_CFG_CMP_LEN in mesh.h
From: Shan Wei @ 2010-12-15  6:27 UTC (permalink / raw)
  To: johannes, linville, David Miller; +Cc: linux-wireless, Network-Maillist

Commit 00d3f14c has removed the references of this macro,
but left it only. So remove this definition.


commit 00d3f14cf9f12c21428121026a5e1d5f65926447
Author: Johannes Berg <johannes@sipsolutions.net>
Date:   Tue Feb 10 21:26:00 2009 +0100

    mac80211: use cfg80211s BSS infrastructure
    
    Remove all the code from mac80211 to keep track of BSSes
    and use the cfg80211-provided code completely.


Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
 net/mac80211/mesh.h |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 58e7411..8111c64 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -163,18 +163,6 @@ struct mesh_rmc {
 	u32 idx_mask;
 };
 
-
-/*
- * MESH_CFG_COMP_LEN Includes:
- * 	- Active path selection protocol ID.
- * 	- Active path selection metric ID.
- * 	- Congestion control mode identifier.
- * 	- Channel precedence.
- * Does not include mesh capabilities, which may vary across nodes in the same
- * mesh
- */
-#define MESH_CFG_CMP_LEN 	(IEEE80211_MESH_CONFIG_LEN - 2)
-
 /* Default values, timeouts in ms */
 #define MESH_TTL 		31
 #define MESH_MAX_RETR	 	3
-- 
1.6.3.3

^ permalink raw reply related

* Re: [PATCH 4/5 v2] ifb: add multiqueue support
From: Eric Dumazet @ 2010-12-15  6:37 UTC (permalink / raw)
  To: Changli Gao; +Cc: Jamal Hadi Salim, David S. Miller, netdev
In-Reply-To: <AANLkTikucnTO_+g2Fa=ZoMFQYbeiQSvqkJURF254So6d@mail.gmail.com>

Le mercredi 15 décembre 2010 à 08:20 +0800, Changli Gao a écrit :
> On Tue, Dec 14, 2010 at 11:59 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >
> >
> > There is a problem here.
> >
> > You should sum in the loop rx_counters only, (the counters syncp
> > protected), and use dev_txq_stats_fold() to get the tx_counters from
> > core network.
> 
> Hmm, in ifb, txq->tx_counters aren't used in ifb_xmit() but
> ri_tasklet(). IOW, rx and tx are reversed. Here I use txq->tx_counters
> to reduce duplicate counters in ifb_q_private. Unless these variables
> might be accessed outside of ifb, I can use them freely? Thanks.
> 

Yes, you are right, and the txq lock is not necessary to read their
values as well (I thought it was hold at write time)




^ permalink raw reply

* Re: [PATCHv3] fragment locally-generated IPsec6 packets that need it
From: Herbert Xu @ 2010-12-15  6:39 UTC (permalink / raw)
  To: David L Stevens; +Cc: davem, netdev
In-Reply-To: <1292393929.5112.2.camel@IBM-1B506CFC885>

On Tue, Dec 14, 2010 at 10:18:49PM -0800, David L Stevens wrote:
> This patch modifies IPsec6 to fragment IPv6 packets that are
> locally generated as needed.
> 
> Signed-off-by: David L Stevens <dlstevens@us.ibm.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks David!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* [PATCH 2/3] net: sunrpc: kill unused macros
From: Shan Wei @ 2010-12-15  6:47 UTC (permalink / raw)
  To: bfields-uC3wQj2KruNg9hUCZPvPmw, neilb-l3A5Bk7waGM,
	Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA,
	steved-H+wXaHxf7aLQT0dZR+AlfA, tj-DgEjT+Ai2ygdnm+yROfE0A
  Cc: David Miller, linux-nfs-u79uwXL29TY76Z2rM5mHXA, Network-Maillist

These macros never be used for several years.


Signed-off-by: Shan Wei <shanwei-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
---
 net/sunrpc/auth_gss/svcauth_gss.c |    2 --
 net/sunrpc/svcauth.c              |    1 -
 net/sunrpc/svcauth_unix.c         |    2 --
 3 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index dec2a6f..bcdae78 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -67,7 +67,6 @@ static int netobj_equal(struct xdr_netobj *a, struct xdr_netobj *b)
 
 #define	RSI_HASHBITS	6
 #define	RSI_HASHMAX	(1<<RSI_HASHBITS)
-#define	RSI_HASHMASK	(RSI_HASHMAX-1)
 
 struct rsi {
 	struct cache_head	h;
@@ -319,7 +318,6 @@ static struct rsi *rsi_update(struct rsi *new, struct rsi *old)
 
 #define	RSC_HASHBITS	10
 #define	RSC_HASHMAX	(1<<RSC_HASHBITS)
-#define	RSC_HASHMASK	(RSC_HASHMAX-1)
 
 #define GSS_SEQ_WIN	128
 
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index 4e9393c..7963569 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -118,7 +118,6 @@ EXPORT_SYMBOL_GPL(svc_auth_unregister);
 
 #define	DN_HASHBITS	6
 #define	DN_HASHMAX	(1<<DN_HASHBITS)
-#define	DN_HASHMASK	(DN_HASHMAX-1)
 
 static struct hlist_head	auth_domain_table[DN_HASHMAX];
 static spinlock_t	auth_domain_lock =
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 560677d..a04ac91 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -85,7 +85,6 @@ static void svcauth_unix_domain_release(struct auth_domain *dom)
  */
 #define	IP_HASHBITS	8
 #define	IP_HASHMAX	(1<<IP_HASHBITS)
-#define	IP_HASHMASK	(IP_HASHMAX-1)
 
 struct ip_map {
 	struct cache_head	h;
@@ -497,7 +496,6 @@ svcauth_unix_info_release(struct svc_xprt *xpt)
  */
 #define	GID_HASHBITS	8
 #define	GID_HASHMAX	(1<<GID_HASHBITS)
-#define	GID_HASHMASK	(GID_HASHMAX - 1)
 
 struct unix_gid {
 	struct cache_head	h;
-- 
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH 5/5 v2] net: add old_queue_mapping into skb->cb
From: Eric Dumazet @ 2010-12-15  7:13 UTC (permalink / raw)
  To: Changli Gao
  Cc: Jamal Hadi Salim, David S. Miller, Stephen Hemminger, Tom Herbert,
	Jiri Pirko, netdev, netem
In-Reply-To: <1292390636-3156-1-git-send-email-xiaosuo@gmail.com>

Le mercredi 15 décembre 2010 à 13:23 +0800, Changli Gao a écrit :
> For the skbs returned from ifb, we should use the queue_mapping
> saved before ifb.
> 
> We save old queue_mapping in old_queue_mapping just before calling 
> dev_queue_xmit, and restore the old_queue_mapping to queue_mapping
> just before reinjecting the skb.
> 
> dev_pick_tx() use the current queue_mapping for the skbs reinjected
> by ifb.
> 
> A new struct dev_skb_cb is added, and valid in qdisc and gso layer.
> The original qdisc_skb_cb and DEV_GSO_CB are placed after dev_skb_cb.
> 
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>

This is really ugly and error prone.

Could you just use a more normal way to express this ?


struct ifb_save_fields_cb {
	u16 queue_mapping;
};

struct napi_gro_cb {
	struct ifb_save_fields_cb ifb_cb; /* needed by ifb, must be first */
	...
}


struct qdisc_skb_cb {
	struct ifb_save_fields_cb ifb_cb; /* needed by ifb, must be first */
	unsigned int	pkt_len;
};




^ permalink raw reply

* Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used
From: Michael Leun @ 2010-12-15  7:16 UTC (permalink / raw)
  To: Matt Carlson
  Cc: Jesse Gross, Michael Chan, Eric Dumazet, David Miller, Ben Greear,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <20101215013431.GA21173@mcarlson.broadcom.com>

On Tue, 14 Dec 2010 17:34:31 -0800
"Matt Carlson" <mcarlson@broadcom.com> wrote:

> On Tue, Dec 14, 2010 at 04:24:30PM -0800, Michael Leun wrote:
> > On Tue, 14 Dec 2010 11:15:00 -0800
> > "Matt Carlson" <mcarlson@broadcom.com> wrote:
> > > Michael, I'm wondering if the difference in behavior can be
> > > explained by the presence or absence of management firmware.  Can
> > > you look at the driver sign-on messages in your syslogs for
> > > ASF[]?  I'm half expecting the 5752 to show "ASF[0]" and the 5714
> > > to show "ASF[1]". If you see this, and the below patch doesn't
> > > fix the problem, let me know.  I have another test I'd like you
> > > to run.
> > 
> > Do I understand this correct? "Management firmware" or ASF is some
> > feature, vendor decides to built into network card (firmware) or
> > not?
> 
> Right.
> 
> > If so, would'nt one expect two oneboard network cards in one server
> > to look alike?
> 
> Mostly, yes.  Except for.....
> 
> > HP Proliant DL320G5
> > 
> > <6>tg3.c:v3.113 (August 2, 2010)
> > <6>tg3 0000:03:04.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> > <6>tg3 0000:03:04.0: eth0: Tigon3 [partno(N/A) rev 9003]
> > (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx <6>tg3
> > 0000:03:04.0: eth0: attached PHY is 5714 (10/100/1000Base-T
> > Ethernet) (WireSpeed[1]) <6>tg3 0000:03:04.0: eth0: RXcsums[1]
> > LinkChgREG[0] MIirq[0] ASF[1] TSOcap[1]
>                                                       This =>  ^^^^^^
> > <6>tg3 0000:03:04.0: eth0: dma_rwctrl[76148000] dma_mask[64-bit]
> > <6>tg3 0000:03:04.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17
> > <6>tg3 0000:03:04.1: eth1: Tigon3 [partno(N/A) rev 9003]
> > (PCIX:133MHz:64-bit) MAC address xx:xx:xx:xx:xx:xx <6>tg3
> > 0000:03:04.1: eth1: attached PHY is 5714 (10/100/1000Base-T
> > Ethernet) (WireSpeed[1]) <6>tg3 0000:03:04.1: eth1: RXcsums[1]
> > LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
>                                                   And this =>  ^^^^^^
> > <6>tg3 0000:03:04.1: eth1: dma_rwctrl[76148000] dma_mask[64-bit]
> 
> So management firmware is turned off on the second port.
> 
> > Lenovo ThinkPad z61m
> > 
> > [    2.679130] tg3.c:v3.113 (August 2, 2010)
> > [    2.679176] tg3 0000:02:00.0: PCI INT A -> GSI 16 (level, low)
> > -> IRQ 16 [    2.679188] tg3 0000:02:00.0: setting latency timer to
> > 64 [    2.728572] tg3 0000:02:00.0: eth0: Tigon3 [partno(BCM95752m)
> > rev 6002] (PCI Express) MAC address xx:xx:xx:xx:xx:xx
> > [    2.728577] tg3 0000:02:00.0: eth0: attached PHY is 5752
> > (10/100/1000Base-T Ethernet) (WireSpeed[1]) [    2.728581] tg3
> > 0000:02:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0]
> > TSOcap[1]
>                                                                            ^^^^^^
> And it isn't present on the 5752.
> 
> > [    2.728585] tg3 0000:02:00.0: eth0: dma_rwctrl[76180000]
> > dma_mask[64-bit]
> > 
> > 
> > > ----
> > > 
> > > [PATCH] tg3: Use new VLAN code
> > 
> > Unfortunately had'nt time to try much now, but with 2.6.37-rc5 /
> > your patch on the DL320, single user mode (nothing configured on
> > eth) just after ifconfig eth0/eth1 up I see NO vlan tags on eth0
> > but I see vlan tags on eth1, so there clearly is a difference.
> > 
> > I should have checked if I still see vlan tags on eth1 if I
> > configure some vlan there - if helpful maybe I can do this (have to
> > look, when I can effort another downtime).
> 
> This would be helpful, just to solidify our findings.
> 
> > I wonder, if the difference in that both onboard cards is really
> > there or if there is some malfunction in detecion?
> 
> Please run the above test first, but afterwards, can you apply the
> below patch on top of your current sources.  I suspect eth1 will
> begin to act like eth0.
> 
> This patch is just a test.
> 
> [PATCH] tg3: Always strip VLAN tags
> 
> This patch configures the hardware to always strip VLAN tags from
> incoming packets.

OK - all tests done on that DL320G5:

For completeness, 2.6.37-rc5 unpatched:

eth0, no vlan configured: totally broken - see double tagged vlans
without tag, single or untagged packets missing at all

eth0, vlan configured: see packets without vlan tag (see double tagged
packets with one vlan tag)

eth1 same as originally reported:
without vlan configured see vlan tags (single and double tagged as
expected)
with vlan configured: see packets without vlan tag (see double tagged
packets with one vlan tag)


2.6.37-rc5, your tg3 use new vlan-code patch:

eth0, no vlan configured:  see packets without vlan tag (see double
tagged packets with one vlan tag)
eth1, no vlan configured: see vlan tags (single and double tagged as
expected)


eth0, vlan configured: as without vlan
eth1, vlan configured: as without vlan

2.6.37-rc5, your tg3 use new vlan-code patch with test patch ontop

eth1 no vlan configured: see packets without vlan tag (see double tagged
packets with one vlan tag)
eth1 with vlan: the same

Hope I did not miss a test I should have done - hope, I did not confuse
anything. If something is not what you would expect you might ask, I've
a script from that session and can look (but cannot post that, sorry).




-- 
MfG,

Michael Leun

^ permalink raw reply

* Re: [PATCH 5/5 v2] net: add old_queue_mapping into skb->cb
From: Changli Gao @ 2010-12-15  7:41 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Jamal Hadi Salim, David S. Miller, Stephen Hemminger, Tom Herbert,
	Jiri Pirko, netdev, netem
In-Reply-To: <1292397202.2377.13.camel@edumazet-laptop>

On Wed, Dec 15, 2010 at 3:13 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> This is really ugly and error prone.
>
> Could you just use a more normal way to express this ?
>
>
> struct ifb_save_fields_cb {
>        u16 queue_mapping;
> };
>
> struct napi_gro_cb {
>        struct ifb_save_fields_cb ifb_cb; /* needed by ifb, must be first */
>        ...
> }
>
>
> struct qdisc_skb_cb {
>        struct ifb_save_fields_cb ifb_cb; /* needed by ifb, must be first */
>        unsigned int    pkt_len;
> };
>

It seems a better way. I'll update netem_skb_cb too. Thanks.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ 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