Netdev List
 help / color / mirror / Atom feed
* Re: [net 0/2][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2013-01-16 19:27 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1358327029-13340-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 16 Jan 2013 01:03:47 -0800

> This series contains updates to ixgbe only.
> 
> The following are changes since commit daf3ec688e057f6060fb9bb0819feac7a8bbf45c:
>   tg3: Fix crc errors on jumbo frame receive
> and are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net master

Pulled, thanks Jeff.

^ permalink raw reply

* Re: Redefinition of struct in6_addr in <netinet/in.h> and <linux/in6.h>
From: Mike Frysinger @ 2013-01-16 19:29 UTC (permalink / raw)
  To: David Miller
  Cc: libc-alpha, bhutchings, yoshfuji, amwang, tmb, eblake, netdev,
	linux-kernel, libvirt-list, tgraf, schwab, carlos
In-Reply-To: <20130116.135744.697469565804508454.davem@davemloft.net>

[-- Attachment #1: Type: Text/Plain, Size: 1916 bytes --]

On Wednesday 16 January 2013 13:57:44 David Miller wrote:
> From: Mike Frysinger <vapier@gentoo.org>
> > certainly true, but the current expectation is that you don't mix your
> > ABIs. if you're programming with the C library API, then use the C
> > library headers. if you're banging directly on the kernel, then use the
> > kernel headers.  not saying it's a perfect solution, but it works for
> > the vast majority of use cases.
> 
> This isn't how real life works.
> 
> GLIBC itself brings in some of the kernel headers, as do various library
> headers for libraries other than glibc.
> 
> So you can get these conflicting headers included indirectly, and it is
> of no fault of any of the various parties involved.

the headers glibc includes tend to be pretty stand alone specifically so that 
it doesn't matter

> We have to make them work when included at the same time somehow, and
> this is totally unavoidable.

"them" is vague.  saying that every kernel header has to be usable in the same 
compilation unit as every C library header regardless of order is unrealistic 
(at least it is today).  there are cases where they define the same structure 
different because the structure as the C library expects is different from what 
the kernel syscall expects.  you could avoid that on the kernel side by giving 
them all prefixes (like __kernel_), but that didn't seem entirely palpable to 
the kernel folks.  i couldn't even get them to remove crap that breaks non-
glibc C libraries (e.g. uapi/linux/stat.h -- looks like someone inadvertently 
fixed uapi/linux/socket.h finally).

for many networking headers, the C library will provide enums & defines while 
the kernel only provides enums.  including the kernel after the C library one 
leads to parsing errors as the defines expand in the enum and kill it.  like 
linux/in.h and netinet/in.h and IPPROTO_*.
-mike

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

^ permalink raw reply

* Re: [net-nexti v2 00/15][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2013-01-16 19:32 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
In-Reply-To: <1358327427-3146-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 16 Jan 2013 01:10:12 -0800

> This series contains updates to e1000e only.
> 
> v2- updates patch 09/15 "e1000e: resolve checkpatch PREFER_PR_LEVEL warning"
>     based on feedback from Joe Perches.
> 
> The following are changes since commit 247fa82be1301e4f89eaa5dc10be62a9cc84e8c5:
>   bnx2x: Introduce 2013 and advance version to 1.78.02
> and are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Pulled, thanks.

^ permalink raw reply

* Re: [PATCH 00/10] vmxnet3: patches
From: David Miller @ 2013-01-16 19:41 UTC (permalink / raw)
  To: stephen; +Cc: sbhatewara, pv-drivers, netdev
In-Reply-To: <1358270915-32758-1-git-send-email-stephen@networkplumber.org>

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 15 Jan 2013 09:28:25 -0800

> Minor VMXNET3 cleanup found while reviewing driver.

Series applied, thanks Stephen.

I agree with Ben that we should have a standard copy of that
default RSS key somewhere, but that's a follow-on rather
than a blocker for your changes.

Thanks.

^ permalink raw reply

* Re: [PATCH] MAINTAINERS: Stephen Hemminger email change
From: David Miller @ 2013-01-16 20:18 UTC (permalink / raw)
  To: stephen.hemminger; +Cc: netdev, greg
In-Reply-To: <20130116095557.4775ce5f@nehalam.linuxnetplumber.net>

From: Stephen Hemminger <stephen.hemminger@vyatta.com>
Date: Wed, 16 Jan 2013 09:55:57 -0800

> I changed my email because the vyatta.com mail server is now
> redirected to brocade.com; and the Brocade mail system
> is not friendly to Linux desktop users.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> Please apply to current release (-net) and if allowable put it
> in stable to reduce future mail issues.

Will do, applied, thanks Stephen.

^ permalink raw reply

* [PATCH v3 1/1] net: ethernet: davinci_cpdma: Add boundary for rx and tx descriptors
From: Mugunthan V N @ 2013-01-16 20:19 UTC (permalink / raw)
  To: netdev; +Cc: davem, s.hauer, Mugunthan V N

When there is heavy transmission traffic in the CPDMA, then Rx descriptors
memory is also utilized as tx desc memory looses all rx descriptors and the
driver stops working then.

This patch adds boundary for tx and rx descriptors in bd ram dividing the
descriptor memory to ensure that during heavy transmission tx doesn't use
rx descriptors.

This patch is already applied to davinci_emac driver, since CPSW and
davici_dmac shares the same CPDMA, moving the boundry seperation from
Davinci EMAC driver to CPDMA driver which was done in the following
commit

commit 86d8c07ff2448eb4e860e50f34ef6ee78e45c40c
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date:   Tue Jan 3 05:27:47 2012 +0000

    net/davinci: do not use all descriptors for tx packets

    The driver uses a shared pool for both rx and tx descriptors.
    During open it queues fixed number of 128 descriptors for receive
    packets. For each received packet it tries to queue another
    descriptor. If this fails the descriptor is lost for rx.
    The driver has no limitation on tx descriptors to use, so it
    can happen during a nmap / ping -f attack that the driver
    allocates all descriptors for tx and looses all rx descriptors.
    The driver stops working then.
    To fix this limit the number of tx descriptors used to half of
    the descriptors available, the rx path uses the other half.

    Tested on a custom board using nmap / ping -f to the board from
    two different hosts.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
Changes from v2
* Implemented stopping the network queue before running out of tx dma so that
  making sure that packets submitted to driver is not dropped due to tx desc
  overflow.
* Changed desciptor allocation index validation proper in cpdma_desc_alloc()

 drivers/net/ethernet/ti/cpsw.c          |   11 +++++++
 drivers/net/ethernet/ti/davinci_cpdma.c |   51 ++++++++++++++++++++++++++-----
 drivers/net/ethernet/ti/davinci_cpdma.h |    1 +
 drivers/net/ethernet/ti/davinci_emac.c  |   15 +++++----
 4 files changed, 65 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index bea736b..b92e08e 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -374,6 +374,10 @@ void cpsw_tx_handler(void *token, int len, int status)
 	struct net_device	*ndev = skb->dev;
 	struct cpsw_priv	*priv = netdev_priv(ndev);
 
+	/*
+	 * Check whether the queue is stopped due to stalled tx dma, if the
+	 * queue is stopped then start the queue as we have free desc for tx
+	 */
 	if (unlikely(netif_queue_stopped(ndev)))
 		netif_start_queue(ndev);
 	cpts_tx_timestamp(&priv->cpts, skb);
@@ -736,6 +740,13 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
 		goto fail;
 	}
 
+	/*
+	 * If there is no more tx desc left free then we need to
+	 * tell the kernel to stop sending us tx frames.
+	 */
+	if (unlikely(cpdma_check_free_tx_desc(priv->txch)))
+		netif_stop_queue(ndev);
+
 	return NETDEV_TX_OK;
 fail:
 	priv->stats.tx_dropped++;
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index 4995673..4f6d82f 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -105,13 +105,13 @@ struct cpdma_ctlr {
 };
 
 struct cpdma_chan {
+	struct cpdma_desc __iomem	*head, *tail;
+	void __iomem			*hdp, *cp, *rxfree;
 	enum cpdma_state		state;
 	struct cpdma_ctlr		*ctlr;
 	int				chan_num;
 	spinlock_t			lock;
-	struct cpdma_desc __iomem	*head, *tail;
 	int				count;
-	void __iomem			*hdp, *cp, *rxfree;
 	u32				mask;
 	cpdma_handler_fn		handler;
 	enum dma_data_direction		dir;
@@ -217,17 +217,29 @@ desc_from_phys(struct cpdma_desc_pool *pool, dma_addr_t dma)
 }
 
 static struct cpdma_desc __iomem *
-cpdma_desc_alloc(struct cpdma_desc_pool *pool, int num_desc)
+cpdma_desc_alloc(struct cpdma_desc_pool *pool, int num_desc, bool is_rx)
 {
 	unsigned long flags;
 	int index;
+	int desc_start;
+	int desc_end;
 	struct cpdma_desc __iomem *desc = NULL;
 
 	spin_lock_irqsave(&pool->lock, flags);
 
-	index = bitmap_find_next_zero_area(pool->bitmap, pool->num_desc, 0,
-					   num_desc, 0);
-	if (index < pool->num_desc) {
+	if (is_rx) {
+		desc_start = 0;
+		desc_end = pool->num_desc/2;
+		index = bitmap_find_next_zero_area(pool->bitmap,
+				pool->num_desc/2, 0, num_desc, 0);
+	 } else {
+		desc_start = pool->num_desc/2;
+		desc_end = pool->num_desc;
+	}
+
+	index = bitmap_find_next_zero_area(pool->bitmap,
+				desc_end, desc_start, num_desc, 0);
+	if (index < desc_end) {
 		bitmap_set(pool->bitmap, index, num_desc);
 		desc = pool->iomap + pool->desc_size * index;
 		pool->used_desc++;
@@ -660,6 +672,7 @@ int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
 	unsigned long			flags;
 	u32				mode;
 	int				ret = 0;
+	bool                            is_rx;
 
 	spin_lock_irqsave(&chan->lock, flags);
 
@@ -668,7 +681,8 @@ int cpdma_chan_submit(struct cpdma_chan *chan, void *token, void *data,
 		goto unlock_ret;
 	}
 
-	desc = cpdma_desc_alloc(ctlr->pool, 1);
+	is_rx = (chan->rxfree != 0);
+	desc = cpdma_desc_alloc(ctlr->pool, 1, is_rx);
 	if (!desc) {
 		chan->stats.desc_alloc_fail++;
 		ret = -ENOMEM;
@@ -704,6 +718,29 @@ unlock_ret:
 }
 EXPORT_SYMBOL_GPL(cpdma_chan_submit);
 
+bool cpdma_check_free_tx_desc(struct cpdma_chan *chan)
+{
+	unsigned long flags;
+	int index;
+	bool ret;
+	struct cpdma_ctlr	*ctlr = chan->ctlr;
+	struct cpdma_desc_pool	*pool = ctlr->pool;
+
+	spin_lock_irqsave(&pool->lock, flags);
+
+	index = bitmap_find_next_zero_area(pool->bitmap,
+				pool->num_desc, pool->num_desc/2, 1, 0);
+
+	if (index < pool->num_desc)
+		ret = true;
+	else
+		ret = false;
+
+	spin_unlock_irqrestore(&pool->lock, flags);
+	return ret;
+}
+EXPORT_SYMBOL_GPL(cpdma_check_free_tx_desc);
+
 static void __cpdma_chan_free(struct cpdma_chan *chan,
 			      struct cpdma_desc __iomem *desc,
 			      int outlen, int status)
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.h b/drivers/net/ethernet/ti/davinci_cpdma.h
index afa19a0..8d2aeb2 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.h
+++ b/drivers/net/ethernet/ti/davinci_cpdma.h
@@ -88,6 +88,7 @@ int cpdma_chan_process(struct cpdma_chan *chan, int quota);
 int cpdma_ctlr_int_ctrl(struct cpdma_ctlr *ctlr, bool enable);
 void cpdma_ctlr_eoi(struct cpdma_ctlr *ctlr);
 int cpdma_chan_int_ctrl(struct cpdma_chan *chan, bool enable);
+bool cpdma_check_free_tx_desc(struct cpdma_chan *chan);
 
 enum cpdma_control {
 	CPDMA_CMD_IDLE,			/* write-only */
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 6621ae3..68ffcaa 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -120,7 +120,6 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1";
 #define EMAC_DEF_TX_CH			(0) /* Default 0th channel */
 #define EMAC_DEF_RX_CH			(0) /* Default 0th channel */
 #define EMAC_DEF_RX_NUM_DESC		(128)
-#define EMAC_DEF_TX_NUM_DESC		(128)
 #define EMAC_DEF_MAX_TX_CH		(1) /* Max TX channels configured */
 #define EMAC_DEF_MAX_RX_CH		(1) /* Max RX channels configured */
 #define EMAC_POLL_WEIGHT		(64) /* Default NAPI poll weight */
@@ -342,7 +341,6 @@ struct emac_priv {
 	u32 mac_hash2;
 	u32 multicast_hash_cnt[EMAC_NUM_MULTICAST_BITS];
 	u32 rx_addr_type;
-	atomic_t cur_tx;
 	const char *phy_id;
 #ifdef CONFIG_OF
 	struct device_node *phy_node;
@@ -1050,10 +1048,11 @@ static void emac_tx_handler(void *token, int len, int status)
 {
 	struct sk_buff		*skb = token;
 	struct net_device	*ndev = skb->dev;
-	struct emac_priv	*priv = netdev_priv(ndev);
-
-	atomic_dec(&priv->cur_tx);
 
+	/*
+	 * Check whether the queue is stopped due to stalled tx dma, if the
+	 * queue is stopped then start the queue as we have free desc for tx
+	 */
 	if (unlikely(netif_queue_stopped(ndev)))
 		netif_start_queue(ndev);
 	ndev->stats.tx_packets++;
@@ -1101,7 +1100,11 @@ static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev)
 		goto fail_tx;
 	}
 
-	if (atomic_inc_return(&priv->cur_tx) >= EMAC_DEF_TX_NUM_DESC)
+	/*
+	 * If there is no more tx desc left free then we need to
+	 * tell the kernel to stop sending us tx frames.
+	 */
+	if (unlikely(cpdma_check_free_tx_desc(priv->txch)))
 		netif_stop_queue(ndev);
 
 	return NETDEV_TX_OK;
-- 
1.7.9.5

^ permalink raw reply related

* Re: [net-next PATCH] net: increase fragment memory usage limits
From: David Miller @ 2013-01-16 20:27 UTC (permalink / raw)
  To: brouer; +Cc: netdev, eric.dumazet
In-Reply-To: <20130115171635.23951.37626.stgit@dragon>

From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Tue, 15 Jan 2013 18:16:35 +0100

> Increase the amount of memory usage limits for incomplete
> IP fragments.
> 
> Arguing for new thresh high/low values:
> 
>  High threshold = 4 MBytes
>  Low  threshold = 3 MBytes
 ...
> An attack could send small fragments, the smallest packet I could send
> resulted in a truesize of 896 bytes (I'm a little surprised by this).

This 896 is probably 512 for the memory block used by the driver
to back the memory, plus the sk_buff et al. overhead.

 ...
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>

Applied, thanks.

^ permalink raw reply

* Re: [Patch net-next v4] netpoll: fix a rtnl lock assertion failure
From: David Miller @ 2013-01-16 20:27 UTC (permalink / raw)
  To: amwang; +Cc: netdev, eric.dumazet, jiri
In-Reply-To: <1358242446-4273-1-git-send-email-amwang@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Tue, 15 Jan 2013 17:34:06 +0800

> From: Cong Wang <amwang@redhat.com>
> 
> v4: hold rtnl lock for the whole netpoll_setup()
> v3: remove the comment
> v2: use RCU read lock
> 
> This patch fixes the following warning:
> 
> [   72.013864] RTNL: assertion failed at net/core/dev.c (4955)
> [   72.017758] Pid: 668, comm: netpoll-prep-v6 Not tainted 3.8.0-rc1+ #474
> [   72.019582] Call Trace:
> [   72.020295]  [<ffffffff8176653d>] netdev_master_upper_dev_get+0x35/0x58
> [   72.022545]  [<ffffffff81784edd>] netpoll_setup+0x61/0x340
> [   72.024846]  [<ffffffff815d837e>] store_enabled+0x82/0xc3
> [   72.027466]  [<ffffffff815d7e51>] netconsole_target_attr_store+0x35/0x37
> [   72.029348]  [<ffffffff811c3479>] configfs_write_file+0xe2/0x10c
> [   72.030959]  [<ffffffff8115d239>] vfs_write+0xaf/0xf6
> [   72.032359]  [<ffffffff81978a05>] ? sysret_check+0x22/0x5d
> [   72.033824]  [<ffffffff8115d453>] sys_write+0x5c/0x84
> [   72.035328]  [<ffffffff819789d9>] system_call_fastpath+0x16/0x1b
> 
> In case of other races, hold rtnl lock for the entire netpoll_setup() function.
> 
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.

^ permalink raw reply

* Re: [PATCH] cxgb4: set coalesce parameters on all queues
From: David Miller @ 2013-01-16 20:28 UTC (permalink / raw)
  To: cascardo; +Cc: netdev, dm, linux-kernel, steved, toml
In-Reply-To: <1358262910-23121-1-git-send-email-cascardo@linux.vnet.ibm.com>

From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Date: Tue, 15 Jan 2013 13:15:10 -0200

> The coalesce parameters was set only on the first queue, which caused
> interrupt rates to be larger on all the other queues.
> 
> This patch allows interrupt rates to be reduced for certain workloads
> and colaesce parameters by 41%.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>

Applied, thanks.

^ permalink raw reply

* Re: [RFC PATCH 1/3] Avoid making inappropriate requests of NETIF_F_V[46]_CSUM devices
From: David Miller @ 2013-01-16 20:54 UTC (permalink / raw)
  To: dwmw2; +Cc: netdev
In-Reply-To: <1358165431.27054.62.camel@shinybook.infradead.org>

From: David Woodhouse <dwmw2@infradead.org>
Date: Mon, 14 Jan 2013 12:10:31 +0000

> Devices with the NETIF_F_V[46]_CSUM feature(s) are *only* required to
> handle checksumming of UDP and TCP.
> 
> In netif_skb_features() we attempt to filter out the capabilities which
> are inappropriate for the device that the skb will actually be sent
> from... but there we assume that NETIF_F_V4_CSUM devices can handle
> *all* Legacy IP, and that NETIF_F_V6_CSUM devices can handle *all* IPv6.
> 
> This may have been OK in the days when CHECKSUM_PARTIAL packets would
> *only* be produced by the local stack, and we knew the local stack
> didn't generate them for anything but UDP and TCP. But these days that's
> not true. When a tun device receives a packet from userspace with
> VIRTIO_NET_HDR_F_NEEDS_CSUM, that translates fairly directly into
> setting CHECKSUM_PARTIAL on the resulting skb. Since virtio_net
> advertises NETIF_F_HW_CSUM to its guests, we should expect to be asked
> to checksum *anything*.

My opinion on this is that the injectors of packets are responsible
for ensuring checksum types are set on SKBs in an appropriate way.

So we ensure this in the local protocol stacks that generate packets,
and if foreign alien entities can inject SKBs with these checksum
settings (like the tun device can) the burdon of verification falls
upon whatever layer allows that to happen.

So really, the fix is in the tun device and the virtio layer.

^ permalink raw reply

* Re: [PATCH] usbnet: dm9601: Fix incorrect command
From: David Miller @ 2013-01-16 20:55 UTC (permalink / raw)
  To: tushar.behera
  Cc: linux-usb, linux-kernel, netdev, gregkh, jacmet, patches,
	ming.lei
In-Reply-To: <1358228341-2104-1-git-send-email-tushar.behera@linaro.org>

From: Tushar Behera <tushar.behera@linaro.org>
Date: Tue, 15 Jan 2013 11:09:01 +0530

> commit 24b1042c4eb2 ("usbnet: dm9601: apply introduced usb command
> APIs") removes the distiction between DM_WRITE_REG and DM_WRITE_REGS
> command. The distiction is reintroduced to the driver so that the
> functionality of the driver remains same.
> 
> CC: Ming Lei <ming.lei@canonical.com>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] ipv4: Remove output route check in ipv4_mtu
From: Julian Anastasov @ 2013-01-16 21:01 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: David Miller, timo.teras, luky-37, pupilla, netdev
In-Reply-To: <20130116095909.GD18940@secunet.com>


	Hello,

On Wed, 16 Jan 2013, Steffen Klassert wrote:

> On Wed, Jan 16, 2013 at 10:58:13AM +0200, Julian Anastasov wrote:
> > 
> > 	This fix looks good to me. But I see that we
> > have another problem here. doc/ip-cref.tex in iproute2
> > claims that a locked MTU value has priority and
> > PMTU should not be considered.
> > 
> > 	IIRC, rt_pmtu is valid only for output routes but
> > we do not check the lock flag here. What about such
> > variant:
> > 
> > static unsigned int ipv4_mtu(const struct dst_entry *dst)
> > {
> > 	const struct rtable *rt = (const struct rtable *) dst;
> > 	unsigned int mtu = rt->rt_pmtu;
> > 
> > 	if (unlikely(dst_metric_locked(dst, RTAX_MTU))) {
> > 		mtu = dst_metric_raw(dst, RTAX_MTU);
> > 		if (!mtu) {
> > 			mtu = dst->dev->mtu;
> > 			if (rt->rt_uses_gateway && mtu > 576)
> > 				mtu = 576;
> > 		}
> > 	} else if (!mtu || time_after_eq(jiffies, rt->dst.expires)) {
> > 		mtu = dst_metric_raw(dst, RTAX_MTU);
> > 		if (!mtu)
> > 			mtu = dst->dev->mtu;
> > 	}
> > 	if (mtu > IP_MAX_MTU)
> > 		mtu = IP_MAX_MTU;
> > 
> > 	return mtu;
> > }
> > 
> > 	I.e. order becomes:
> > 
> > mtu lock non-zero => fixed fib_mtu
> > mtu lock 0 => device MTU, up to 576 if via GW, ignore PMTU
> > PMTU (output routes)
> > mtu non-zero => fib_mtu
> > device MTU
> 
> If this is the desired order, I'm fine with the above variant.
> 
> > 
> > 	Also, it seems __ip_rt_update_pmtu should start
> > with such dst_metric_locked(dst, RTAX_MTU) check?
> > 
> 
> Not absolutely sure what you want to do if the mtu is locked.
> But if you don't want to genetate a nh exception and don't update
> rt->rt_pmtu in this case, rt->rt_pmtu is never set on routes with
> locked mtu. We probably would not need to change ipv4_mtu() to the
> above variant.

	Yes, we have to exit __ip_rt_update_pmtu if
fib_mtu is locked. Then rt_pmtu should stay 0 and
your variant of ipv4_mtu should be ok. I hope you
can simply extend your patch with such additional
check in __ip_rt_update_pmtu:

	if (dst_metric_locked(dst, RTAX_MTU))
		return;

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: [PATCH 2/5] soreuseport: TCP/IPv4 implementation
From: Vijay Subramanian @ 2013-01-16 21:09 UTC (permalink / raw)
  To: Tom Herbert; +Cc: netdev, davem, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.2.00.1301141140330.3472@pokey.mtv.corp.google.com>



> 	 * Unlike other sk lookup places we do not check
> @@ -73,8 +75,11 @@ int inet_csk_bind_conflict(const struct sock *sk,
> 		    (!sk->sk_bound_dev_if ||
> 		     !sk2->sk_bound_dev_if ||
> 		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
> -			if (!reuse || !sk2->sk_reuse ||
> -			    sk2->sk_state == TCP_LISTEN) {
> +			if ((!reuse || !sk2->sk_reuse ||
> +			    sk2->sk_state == TCP_LISTEN) &&
> +			    (!reuseport || !sk2->sk_reuseport ||
> +			    (sk2->sk_state != TCP_TIME_WAIT &&
> +			     uid != sock_i_uid(sk2)))) {
> 				const __be32 sk2_rcv_saddr = sk_rcv_saddr(sk2);
> 				if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
> 				    sk2_rcv_saddr == sk_rcv_saddr(sk))


How about introducing some helper functions to make 
inet_csk_bid_conflict() and inet6_csk_bind_conflict() more readable as in 
patch below? We can add another test for reuseport() for soreuseport 
patches.

udp.c already has ipv4_rcv_saddr_equal() but it seems to call 
ipv6_only_sock() and not inet_v6_ipv6only() which is needed in 
inet{6}_csk_bid_conflict().So I added sk_rcv_saddr_equal().

Also the bind_conflict functions can return bool instead of int (not 
implemented in patch below).


If patch idea below is ok, I will send it officially.

Thanks,
Vijay


diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 1832927..c15d2eb 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -22,6 +22,8 @@

  #include <net/inet_sock.h>
  #include <net/request_sock.h>
+#include <net/tcp_states.h>
+#include <net/inet_timewait_sock.h>

  #define INET_CSK_DEBUG 1

@@ -205,6 +207,37 @@ static inline void inet_csk_clear_xmit_timer(struct sock *sk, const int what)
  #endif
  }

+/* The port cannot be reused if the older socket is in LISTEN state or if
+ * either the old or new one does not allow reuse
+ */
+static inline bool sk_reuse_equal(int reuse, const struct sock *sk2)
+{
+	return !reuse || !sk2->sk_reuse || sk2->sk_state == TCP_LISTEN;
+}
+
+/* The port cannot be reused if both sockets are bound to the same device or
+ * if either one is not bound
+ */
+static inline bool sk_bound_dev_equal(const struct sock *sk,
+				      const struct sock *sk2)
+{
+	return !sk->sk_bound_dev_if || !sk2->sk_bound_dev_if ||
+	       sk->sk_bound_dev_if == sk2->sk_bound_dev_if;
+}
+
+/* The port cannot be reused if both sockets have the same rcv_saddr
+ * or if either rcv_saddr is NULL
+ */
+static inline bool sk_rcv_saddr_equal(const struct sock *sk1,
+				      const struct sock *sk2)
+{
+	__be32 sk1_rcv_saddr = sk_rcv_saddr(sk1);
+	__be32 sk2_rcv_saddr = sk_rcv_saddr(sk2);
+
+	return !sk2_rcv_saddr || !sk1_rcv_saddr ||
+	       sk2_rcv_saddr == sk1_rcv_saddr;
+}
+
  /*
   *	Reset the retransmission timer
   */
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index d0670f0..375cca3 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -68,26 +68,15 @@ int inet_csk_bind_conflict(const struct sock *sk,
  	 */

  	sk_for_each_bound(sk2, node, &tb->owners) {
-		if (sk != sk2 &&
-		    !inet_v6_ipv6only(sk2) &&
-		    (!sk->sk_bound_dev_if ||
-		     !sk2->sk_bound_dev_if ||
-		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
-			if (!reuse || !sk2->sk_reuse ||
-			    sk2->sk_state == TCP_LISTEN) {
-				const __be32 sk2_rcv_saddr = sk_rcv_saddr(sk2);
-				if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
-				    sk2_rcv_saddr == sk_rcv_saddr(sk))
-					break;
-			}
-			if (!relax && reuse && sk2->sk_reuse &&
-			    sk2->sk_state != TCP_LISTEN) {
-				const __be32 sk2_rcv_saddr = sk_rcv_saddr(sk2);
+		if (sk != sk2 && !inet_v6_ipv6only(sk2) &&
+		    sk_bound_dev_equal(sk, sk2)) {
+			if (sk_reuse_equal(reuse, sk2) &&
+			    sk_rcv_saddr_equal(sk, sk2))
+				break;

-				if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
-				    sk2_rcv_saddr == sk_rcv_saddr(sk))
-					break;
-			}
+			if (!relax && sk_reuse_equal(reuse, sk2) &&
+			    sk_rcv_saddr_equal(sk, sk2))
+				break;
  		}
  	}
  	return node != NULL;
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 3064785..8ebe20d 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -39,13 +39,9 @@ int inet6_csk_bind_conflict(const struct sock *sk,
  	 * vs net namespaces issues.
  	 */
  	sk_for_each_bound(sk2, node, &tb->owners) {
-		if (sk != sk2 &&
-		    (!sk->sk_bound_dev_if ||
-		     !sk2->sk_bound_dev_if ||
-		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if) &&
-		    (!sk->sk_reuse || !sk2->sk_reuse ||
-		     sk2->sk_state == TCP_LISTEN) &&
-		     ipv6_rcv_saddr_equal(sk, sk2))
+		if (sk != sk2 && sk_bound_dev_equal(sk, sk2) &&
+		    sk_reuse_equal(sk->sk_reuse, sk2) &&
+		    ipv6_rcv_saddr_equal(sk, sk2))
  			break;
  	}

^ permalink raw reply related

* Re: [PATCH 2/5] soreuseport: TCP/IPv4 implementation
From: David Miller @ 2013-01-16 21:10 UTC (permalink / raw)
  To: subramanian.vijay; +Cc: therbert, netdev, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.2.00.1301161259370.1764@cleese>

From: Vijay Subramanian <subramanian.vijay@gmail.com>
Date: Wed, 16 Jan 2013 13:09:10 -0800 (PST)

> 
> +/* The port cannot be reused if the older socket is in LISTEN state
> or if
> + * either the old or new one does not allow reuse
> + */

Please post patches without them being destroyed by your mailer.

^ permalink raw reply

* Re: [PATCH 2/2] e1000e: display a warning message when SmartSpeed works
From: Jeff Kirsher @ 2013-01-16 21:16 UTC (permalink / raw)
  To: Bjørn Mork
  Cc: Koki Sanagi, netdev, davem, jesse.brandeburg, bruce.w.allan,
	carolyn.wyborny, donald.c.skidmore, gregory.v.rose,
	peter.p.waskiewicz.jr, alexander.h.duyck, john.ronciak,
	tushar.n.dave, e1000-devel
In-Reply-To: <87sj61gu6j.fsf@nemi.mork.no>

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

On Wed, 2013-01-16 at 13:59 +0100, Bjørn Mork wrote:
> Koki Sanagi <sanagi.koki@jp.fujitsu.com> writes:
> 
> > +			if (phy->speed_downgraded)
> > +				netdev_warn(netdev, "Link Speed was "
> > +					"downgraded by SmartSpeed\n");
> > +
> 
> Could you please avoid breaking the string both here and in the igb
> patch?  This breaks the ability to grep for the warning.
> 
> Quoting Documentation/CodingStyle, Chapter 2:
> "However, never break user-visible strings such as printk messages,
>  because that breaks the ability to grep for them."
> 
> 
> Bjørn

I have fixed both patches that are in my queue, since the original
patches generated checkpatch.pl warnings on the strings being on 2
lines.

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

^ permalink raw reply

* Re: [PATCH net] net: qmi_wwan: add TP-LINK HSUPA Modem MA180
From: David Miller @ 2013-01-16 21:16 UTC (permalink / raw)
  To: bjorn-yOkvZcmFvRU
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	lhs-AjPhSE91YUE, tschaefer-zqRNUXuvxA0b1SvskN2V4Q
In-Reply-To: <1358241591-29553-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>

From: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
Date: Tue, 15 Jan 2013 10:19:50 +0100

> The driver description files gives these names to the vendor specific
> functions on this modem:
> 
>  Diagnostics VID_2357&PID_0201&MI_00
>  NMEA        VID_2357&PID_0201&MI_01
>  Modem       VID_2357&PID_0201&MI_03
>  Networkcard VID_2357&PID_0201&MI_04
> 
> The "Networkcard" function has been verified to support these QMI
> services:
>     ctl (1.3)
>     wds (1.3)
>     dms (1.2)
>     nas (1.0)
> 
> Reported-by: Thomas Schäfer <tschaefer-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
> Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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

* Re: [PATCH] CDC_NCM adding support IFF_NOARP for infineon modem platform
From: David Miller @ 2013-01-16 21:18 UTC (permalink / raw)
  To: bjorn-yOkvZcmFvRU
  Cc: dcbw-H+wXaHxf7aLQT0dZR+AlfA, cpuwolf-Re5JQEeQqe8AvxtiuMwx3w,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	alexey.orishko-0IS4wlFg1OjSUeElwK9/Pw,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <87hamikfpc.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>

From: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
Date: Tue, 15 Jan 2013 09:34:07 +0100

> The main problem is that these devices don't support ethernet.  They
> support IP (v4 and _maybe_ v6) with an ethernet header.  Many of them
> will do ARP (and IPv6 ND) as well to complete the picture, but some of
> them don't and that's what these drivers try to deal with.

Ok, in that case setting IFF_NOARP is in fact the right thing to do.
Thanks for describing the situation.

Someone please resubmit the patch to do that and I'll apply it.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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

* Re: [PATCH] sk-filter: Add ability to lock a socket filter program
From: David Miller @ 2013-01-16 21:20 UTC (permalink / raw)
  To: bernat; +Cc: netdev
In-Reply-To: <1358296955-30582-1-git-send-email-bernat@luffy.cx>

From: Vincent Bernat <bernat@luffy.cx>
Date: Wed, 16 Jan 2013 01:42:34 +0100

> While a privileged program can open a raw socket, attach some
> restrictive filter and drop its privileges (or send the socket to an
> unprivileged program through some Unix socket), the filter can still
> be removed or modified by the unprivileged program. This commit adds a
> socket option to lock the filter (SO_LOCK_FILTER) preventing any
> modification of a socket filter program.
> 
> This is similar to OpenBSD BIOCLOCK ioctl on bpf sockets, except even
> root is not allowed change/drop the filter.
> 
> The state of the lock can be read with getsockopt(). No error is
> triggered if the state is not changed. -EPERM is returned when a user
> tries to remove the lock or to change/remove the filter while the lock
> is active. The check is done directly in sk_attach_filter() and
> sk_detach_filter() and does not affect only setsockopt() syscall.
> 
> Signed-off-by: Vincent Bernat <bernat@luffy.cx>

I'm fine with this feature but:

> +SO_LOCK_FILTER ioctl allows to lock the filter attached to a

It's not an ioctl, it's a socket option.

^ permalink raw reply

* Re: [PATCH 2/2] 6lowpan: Handle uncompressed IPv6 packets over 6LoWPAN
From: David Miller @ 2013-01-16 21:22 UTC (permalink / raw)
  To: alan
  Cc: alex.bluesman.smirnov, dbaryshkov, linux-zigbee-devel, netdev,
	linux-kernel, tony.cheneau, eric.dumazet
In-Reply-To: <1358315037-10043-3-git-send-email-alan@signal11.us>

From: Alan Ott <alan@signal11.us>
Date: Wed, 16 Jan 2013 00:43:57 -0500

> +		local_skb = skb_copy_expand(skb, NET_SKB_PAD - 1,
> +						skb_tailroom(skb), GFP_ATOMIC);

This is not indented properly.

When a function call spans multiple lines, the second and subsequent
lines should be indented to the column right after the openning
parenthesis of the call itself, using a combination of TAB and
SPC characters as needed.

^ permalink raw reply

* Re: [PATCH] r8169: remove unneeded dirty_rx index
From: David Miller @ 2013-01-16 21:25 UTC (permalink / raw)
  To: timo.teras; +Cc: romieu, netdev
In-Reply-To: <1358319684-32364-1-git-send-email-timo.teras@iki.fi>

From: Timo Teräs <timo.teras@iki.fi>
Date: Wed, 16 Jan 2013 09:01:24 +0200

> @@ -6035,10 +6034,8 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
>  	unsigned int count;
>  
>  	cur_rx = tp->cur_rx;
> -	rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx;
> -	rx_left = min(rx_left, budget);
>  
> -	for (; rx_left > 0; rx_left--, cur_rx++) {
> +	for (rx_left = min(budget, NUM_RX_DESC); rx_left > 0; rx_left--, cur_rx++) {

Is this really equivalent?  I think cur_rx still needs to be
incorporated into whatever you use as the initial rx_left.

^ permalink raw reply

* Re: [PATCH] ipv6: do not create neighbor entries for local delivery
From: David Miller @ 2013-01-16 21:28 UTC (permalink / raw)
  To: mleitner; +Cc: netdev
In-Reply-To: <50F6ABCA.4020804@redhat.com>

From: Marcelo Ricardo Leitner <mleitner@redhat.com>
Date: Wed, 16 Jan 2013 11:31:54 -0200

> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index
> 7c34c01b515b7ac370f8021ba6f5ec4c654e9e41..b63e33bcbdfbc1bd78af0b98ffc2d211805214ea
> 100644

Patch corrupted by your email client.

Note also that YOSHIFUJI Hideaki's patches to remove the cached neighbour
entirely from ipv6 routes will have the same effect, so your patch won't
be needed.

^ permalink raw reply

* [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion
From: Fabio Baltieri @ 2013-01-16 21:30 UTC (permalink / raw)
  To: netdev, David S. Miller, Hideaki YOSHIFUJI
  Cc: linux-kernel, Alexey Kuznetsov, James Morris, Patrick McHardy,
	Fabio Baltieri

Fix the 64bit optimized version of ipv6_prefix_equal to convert the
bitmask to network byte order only after the bit-shift.

The bug was introduced in:

3867517 ipv6: 64bit version of ipv6_prefix_equal().

Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---
 include/net/ipv6.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index dfc1363..459a5a4 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -404,7 +404,7 @@ static inline bool __ipv6_prefix_equal64_half(const __be64 *a1,
 					      const __be64 *a2,
 					      unsigned int len)
 {
-	if (len && ((*a1 ^ *a2) & cpu_to_be64(~0UL) << (64 - len)))
+	if (len && ((*a1 ^ *a2) & cpu_to_be64((~0UL) << (64 - len))))
 		return false;
 	return true;
 }
-- 
1.7.12.1

^ permalink raw reply related

* Re: [PATCH 2/5] soreuseport: TCP/IPv4 implementation
From: Tom Herbert @ 2013-01-16 21:30 UTC (permalink / raw)
  To: Vijay Subramanian; +Cc: netdev, davem, netdev, eric.dumazet
In-Reply-To: <alpine.DEB.2.00.1301161259370.1764@cleese>

I'll send updated patches today fixing the issue raised so far.  You
might want to put these on top of those?

On Wed, Jan 16, 2013 at 1:09 PM, Vijay Subramanian
<subramanian.vijay@gmail.com> wrote:
>
>
>>          * Unlike other sk lookup places we do not check
>> @@ -73,8 +75,11 @@ int inet_csk_bind_conflict(const struct sock *sk,
>>                     (!sk->sk_bound_dev_if ||
>>                      !sk2->sk_bound_dev_if ||
>>                      sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
>> -                       if (!reuse || !sk2->sk_reuse ||
>> -                           sk2->sk_state == TCP_LISTEN) {
>> +                       if ((!reuse || !sk2->sk_reuse ||
>> +                           sk2->sk_state == TCP_LISTEN) &&
>> +                           (!reuseport || !sk2->sk_reuseport ||
>> +                           (sk2->sk_state != TCP_TIME_WAIT &&
>> +                            uid != sock_i_uid(sk2)))) {
>>                                 const __be32 sk2_rcv_saddr =
>> sk_rcv_saddr(sk2);
>>                                 if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
>>                                     sk2_rcv_saddr == sk_rcv_saddr(sk))
>
>
>
> How about introducing some helper functions to make inet_csk_bid_conflict()
> and inet6_csk_bind_conflict() more readable as in patch below? We can add
> another test for reuseport() for soreuseport patches.
>
> udp.c already has ipv4_rcv_saddr_equal() but it seems to call
> ipv6_only_sock() and not inet_v6_ipv6only() which is needed in
> inet{6}_csk_bid_conflict().So I added sk_rcv_saddr_equal().
>
> Also the bind_conflict functions can return bool instead of int (not
> implemented in patch below).
>
>
> If patch idea below is ok, I will send it officially.
>
> Thanks,
> Vijay
>
>
> diff --git a/include/net/inet_connection_sock.h
> b/include/net/inet_connection_sock.h
> index 1832927..c15d2eb 100644
> --- a/include/net/inet_connection_sock.h
> +++ b/include/net/inet_connection_sock.h
> @@ -22,6 +22,8 @@
>
>  #include <net/inet_sock.h>
>  #include <net/request_sock.h>
> +#include <net/tcp_states.h>
> +#include <net/inet_timewait_sock.h>
>
>  #define INET_CSK_DEBUG 1
>
> @@ -205,6 +207,37 @@ static inline void inet_csk_clear_xmit_timer(struct
> sock *sk, const int what)
>  #endif
>  }
>
> +/* The port cannot be reused if the older socket is in LISTEN state or if
> + * either the old or new one does not allow reuse
> + */
> +static inline bool sk_reuse_equal(int reuse, const struct sock *sk2)
> +{
> +       return !reuse || !sk2->sk_reuse || sk2->sk_state == TCP_LISTEN;
> +}
> +
> +/* The port cannot be reused if both sockets are bound to the same device
> or
> + * if either one is not bound
> + */
> +static inline bool sk_bound_dev_equal(const struct sock *sk,
> +                                     const struct sock *sk2)
> +{
> +       return !sk->sk_bound_dev_if || !sk2->sk_bound_dev_if ||
> +              sk->sk_bound_dev_if == sk2->sk_bound_dev_if;
> +}
> +
> +/* The port cannot be reused if both sockets have the same rcv_saddr
> + * or if either rcv_saddr is NULL
> + */
> +static inline bool sk_rcv_saddr_equal(const struct sock *sk1,
> +                                     const struct sock *sk2)
> +{
> +       __be32 sk1_rcv_saddr = sk_rcv_saddr(sk1);
> +       __be32 sk2_rcv_saddr = sk_rcv_saddr(sk2);
> +
> +       return !sk2_rcv_saddr || !sk1_rcv_saddr ||
> +              sk2_rcv_saddr == sk1_rcv_saddr;
> +}
> +
>  /*
>   *     Reset the retransmission timer
>   */
> diff --git a/net/ipv4/inet_connection_sock.c
> b/net/ipv4/inet_connection_sock.c
> index d0670f0..375cca3 100644
> --- a/net/ipv4/inet_connection_sock.c
> +++ b/net/ipv4/inet_connection_sock.c
> @@ -68,26 +68,15 @@ int inet_csk_bind_conflict(const struct sock *sk,
>          */
>
>         sk_for_each_bound(sk2, node, &tb->owners) {
> -               if (sk != sk2 &&
> -                   !inet_v6_ipv6only(sk2) &&
> -                   (!sk->sk_bound_dev_if ||
> -                    !sk2->sk_bound_dev_if ||
>
> -                    sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
> -                       if (!reuse || !sk2->sk_reuse ||
> -                           sk2->sk_state == TCP_LISTEN) {
> -                               const __be32 sk2_rcv_saddr =
> sk_rcv_saddr(sk2);
> -                               if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
> -                                   sk2_rcv_saddr == sk_rcv_saddr(sk))
> -                                       break;
> -                       }
> -                       if (!relax && reuse && sk2->sk_reuse &&
> -                           sk2->sk_state != TCP_LISTEN) {
> -                               const __be32 sk2_rcv_saddr =
> sk_rcv_saddr(sk2);
> +               if (sk != sk2 && !inet_v6_ipv6only(sk2) &&
> +                   sk_bound_dev_equal(sk, sk2)) {
> +                       if (sk_reuse_equal(reuse, sk2) &&
> +                           sk_rcv_saddr_equal(sk, sk2))
> +                               break;
>
> -                               if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
> -                                   sk2_rcv_saddr == sk_rcv_saddr(sk))
> -                                       break;
> -                       }
> +                       if (!relax && sk_reuse_equal(reuse, sk2) &&
> +                           sk_rcv_saddr_equal(sk, sk2))
> +                               break;
>                 }
>         }
>         return node != NULL;
> diff --git a/net/ipv6/inet6_connection_sock.c
> b/net/ipv6/inet6_connection_sock.c
> index 3064785..8ebe20d 100644
> --- a/net/ipv6/inet6_connection_sock.c
> +++ b/net/ipv6/inet6_connection_sock.c
> @@ -39,13 +39,9 @@ int inet6_csk_bind_conflict(const struct sock *sk,
>          * vs net namespaces issues.
>          */
>         sk_for_each_bound(sk2, node, &tb->owners) {
> -               if (sk != sk2 &&
> -                   (!sk->sk_bound_dev_if ||
> -                    !sk2->sk_bound_dev_if ||
> -                    sk->sk_bound_dev_if == sk2->sk_bound_dev_if) &&
> -                   (!sk->sk_reuse || !sk2->sk_reuse ||
> -                    sk2->sk_state == TCP_LISTEN) &&
> -                    ipv6_rcv_saddr_equal(sk, sk2))
> +               if (sk != sk2 && sk_bound_dev_equal(sk, sk2) &&
> +                   sk_reuse_equal(sk->sk_reuse, sk2) &&
> +                   ipv6_rcv_saddr_equal(sk, sk2))
>                         break;
>         }
>
>

^ permalink raw reply

* Re: [PATCH v3 1/1] net: ethernet: davinci_cpdma: Add boundary for rx and tx descriptors
From: David Miller @ 2013-01-16 21:31 UTC (permalink / raw)
  To: mugunthanvnm; +Cc: netdev, s.hauer
In-Reply-To: <1358367562-1697-1-git-send-email-mugunthanvnm@ti.com>

From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Thu, 17 Jan 2013 01:49:22 +0530

> +	/*
> +	 * If there is no more tx desc left free then we need to
> +	 * tell the kernel to stop sending us tx frames.
> +	 */

Please format multi-line comments:

	/* Like
	 * this.
	 */

in the networking.

Thanks.

^ permalink raw reply

* Re: [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion
From: David Miller @ 2013-01-16 21:37 UTC (permalink / raw)
  To: fabio.baltieri; +Cc: netdev, yoshfuji, linux-kernel, kuznet, jmorris, kaber
In-Reply-To: <1358371817-15378-1-git-send-email-fabio.baltieri@linaro.org>

From: Fabio Baltieri <fabio.baltieri@linaro.org>
Date: Wed, 16 Jan 2013 22:30:17 +0100

> Fix the 64bit optimized version of ipv6_prefix_equal to convert the
> bitmask to network byte order only after the bit-shift.
> 
> The bug was introduced in:
> 
> 3867517 ipv6: 64bit version of ipv6_prefix_equal().
> 
> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>

Applied, thanks.

^ 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