Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net] be2net: add dma_mapping_error() check for dma_map_page()
From: Ivan Vecera @ 2014-01-15 10:08 UTC (permalink / raw)
  To: Sathya Perla, netdev@vger.kernel.org
  Cc: Subramanian Seetharaman, Ajit Khaparde
In-Reply-To: <89af1a0a-785c-4dfd-93c5-b1be112d5f60@CMEXHTCAS1.ad.emulex.com>

On 01/15/2014 08:36 AM, Sathya Perla wrote:
>> -----Original Message-----
>> From: Ivan Vecera [mailto:ivecera@redhat.com]
>>
>> The driver does not check value returned by dma_map_page. The patch
>> fixes this as well as one additional bug. The prev_page_info is
>> dereferenced after 'for' loop but if the 1st be_alloc_pages fails its
>> value is NULL.
>>
>> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>> ---
>>   drivers/net/ethernet/emulex/benet/be_main.c | 13 ++++++++++---
>>   1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c
>> b/drivers/net/ethernet/emulex/benet/be_main.c
>> index bf40fda..f2811b5 100644
>> --- a/drivers/net/ethernet/emulex/benet/be_main.c
>> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
>> @@ -1776,6 +1776,7 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
>>   	struct be_rx_page_info *page_info = NULL, *prev_page_info = NULL;
>>   	struct be_queue_info *rxq = &rxo->q;
>>   	struct page *pagep = NULL;
>> +	struct device *dev = &adapter->pdev->dev;
>>   	struct be_eth_rx_d *rxd;
>>   	u64 page_dmaaddr = 0, frag_dmaaddr;
>>   	u32 posted, page_offset = 0;
>> @@ -1788,9 +1789,15 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
>>   				rx_stats(rxo)->rx_post_fail++;
>>   				break;
>>   			}
>> -			page_dmaaddr = dma_map_page(&adapter->pdev->dev, pagep,
>> -						    0, adapter->big_page_size,
>> +			page_dmaaddr = dma_map_page(dev, pagep, 0,
>> +						    adapter->big_page_size,
>>   						    DMA_FROM_DEVICE);
>> +			if (dma_mapping_error(dev, page_dmaaddr)) {
>> +				put_page(pagep);
>> +				pagep = NULL;
>> +				rx_stats(rxo)->rx_post_fail++;
>> +				break;
>> +			}
>>   			page_info->page_offset = 0;
>>   		} else {
>>   			get_page(pagep);
>> @@ -1816,7 +1823,7 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
>>   		queue_head_inc(rxq);
>>   		page_info = &rxo->page_info_tbl[rxq->head];
>>   	}
>> -	if (pagep)
>> +	if (pagep && prev_page_info)
>>   		prev_page_info->last_page_user = true;
>
> Ivan, if the 1st be_alloc_pages() fails, won't "pagep" be NULL aswell.
> In that case, "prev_page_info" will not be dereferenced.
>
Sure Sathya, sorry... my bad eyes... Will post 2nd version.

Ivan

^ permalink raw reply

* Re: [Xen-devel][PATCH net-next] xen-netfront: clean up code in xennet_release_rx_bufs
From: Wei Liu @ 2014-01-15 10:07 UTC (permalink / raw)
  To: Annie Li; +Cc: xen-devel, netdev, konrad.wilk, ian.campbell, wei.liu2
In-Reply-To: <1389307718-2845-1-git-send-email-Annie.li@oracle.com>

On Fri, Jan 10, 2014 at 06:48:38AM +0800, Annie Li wrote:
> Current netfront only grants pages for grant copy, not for grant transfer, so
> remove corresponding transfer code and add receiving copy code in
> xennet_release_rx_bufs.
> 

This path seldom gets call -- not that many people unload xen-netfront
driver. If Annie has tested this patch and it works as expected I think
it's fine.

I'm not netfront maintainer but I'm happy to add
Acked-by: Wei Liu <wei.liu2@citrix.com>
if Annie confirms she's tested this patch.

Wei.

^ permalink raw reply

* [PATCH net] bnx2x: Don't release PCI bars on shutdown
From: Yuval Mintz @ 2014-01-15 10:05 UTC (permalink / raw)
  To: davem, netdev; +Cc: Yuval Mintz, Ariel Elior

The bnx2x driver in its pci shutdown() callback releases its pci bars (in the
same manner it does during its pci remove() callback).
During a system reboot while VFs are enabled, its possible for the VF's remove
to be called (as a result of pci_disable_sriov()) after its shutdown callback
has already finished running; This will cause a paging request fault as the VF
tries to access the pci bar which it has previously released, crashing the
system.

This patch further differentiates the shutdown and remove callbacks, preventing the
pci release procedures from being called during shutdown.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
Hi Dave,

Please accept this patch to `net'.

Thanks,
Yuval
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 29 ++++++++++++------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 8b3107b..7b3b5cc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12942,25 +12942,26 @@ static void __bnx2x_remove(struct pci_dev *pdev,
 		pci_set_power_state(pdev, PCI_D3hot);
 	}
 
-	if (bp->regview)
-		iounmap(bp->regview);
+	if (remove_netdev) {
+		if (bp->regview)
+			iounmap(bp->regview);
 
-	/* for vf doorbells are part of the regview and were unmapped along with
-	 * it. FW is only loaded by PF.
-	 */
-	if (IS_PF(bp)) {
-		if (bp->doorbells)
-			iounmap(bp->doorbells);
+		/* For vfs, doorbells are part of the regview and were unmapped
+		 * along with it. FW is only loaded by PF.
+		 */
+		if (IS_PF(bp)) {
+			if (bp->doorbells)
+				iounmap(bp->doorbells);
 
-		bnx2x_release_firmware(bp);
-	}
-	bnx2x_free_mem_bp(bp);
+			bnx2x_release_firmware(bp);
+		}
+		bnx2x_free_mem_bp(bp);
 
-	if (remove_netdev)
 		free_netdev(dev);
 
-	if (atomic_read(&pdev->enable_cnt) == 1)
-		pci_release_regions(pdev);
+		if (atomic_read(&pdev->enable_cnt) == 1)
+			pci_release_regions(pdev);
+	}
 
 	pci_disable_device(pdev);
 }
-- 
1.8.1.227.g44fe835

^ permalink raw reply related

* Re: [PATCH net-next] IPv6: add option to use anycast addresses as source addresses in icmp error messages
From: François-Xavier Le Bail @ 2014-01-15  9:46 UTC (permalink / raw)
  To: netdev, Bill Fink, David S. Miller, Alexey Kuznetsov,
	James Morris, Hideaki Yoshifuji, Patrick McHardy,
	Hannes Frederic Sowa

On Tue, Jan 14, 2014 at 02:13:44PM +0100, Hannes Frederic Sowa wrote:
> > On Mon, Jan 13, 2014 at 06:22:44PM +0100, Francois-Xavier Le Bail wrote:
> > > - Add "anycast_src_icmp_error" sysctl to control the use of anycast addresses
> > >   as source addresses for ICMPv6 error messages. This sysctl is false by
> > >   default to preserve existing behavior.
> > > - Use it in icmp6_send().
> > > 
> > > Suggested-by: Bill Fink <billfink@mindspring.com>
> > > Signed-off-by: Francois-Xavier Le Bail <fx.lebail@yahoo.com>
> > 
> > Regarding the anycast patches, I contacted someone from IETF.
> > 
> > The number of sysctls needed to get introduced to have all the flexibility
> > regarding source address selection and don't break backward compatibility
> > concerns me a bit.
> > 
> > Especially on end hosts, where those switches will be important, I think we
> > really have to think about sensible defaults without breaking current
> > software.
> > 
> > I currently consider a per-address flag, if those anycast addresses
> > should be available in source address selection (also with an enhancement to
> > current IPV6_JOIN_ANYCAST logic).
> 
> Francois, we should really think about this. Also if we should just
> make the pre-defined subnet address just a normal anycast address in the
> long-term (which just happens to get automatically added to an interface
> if forwarding is enabled) and bundle all the source address selection
> logic on the per-address state.

Hi Hannes,

Please submit patches with your solution, so that we can have a basis
for discussion.

> If that would be the case, we could revert
> 509aba3b0d366b7f16a9a2eebac1156b25f5f622 ("IPv6: add the option to use
> anycast addresses as source addresses in echo reply") and thus would
> eliminate one sysctl.

If your solution achieve the same goal without this sysctl, I agree with you.

> It would be fine if we can make this decision before David merges with
> Linus.  I guess we can still do this decision while in -rc phase. But
> as soon as the knob is in a released version of linux we can never take
> it back (I really don't like sysctls).

Sure.

Cheers,
François-Xavier

^ permalink raw reply

* Re: linux-next: Tree for Jan 14 (lowpan, 802.15.4)
From: Alexander Aring @ 2014-01-15  9:45 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov
  Cc: Randy Dunlap, David S. Miller, Marcel Holtmann, Stephen Rothwell,
	linux-next, kernel list, linux-zigbee-devel, Alexander Smirnov,
	netdev@vger.kernel.org, Jukka Rissanen
In-Reply-To: <CALT56yPzfkz7=WdT0p6EYXdsQJUT+Ld9gdd72z6_czn0YaKUWA@mail.gmail.com>

Hi Dmitry,

On Wed, Jan 15, 2014 at 02:54:56AM +0400, Dmitry Eremin-Solenikov wrote:
> Hello,
> 
> 
> On Tue, Jan 14, 2014 at 9:49 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> >
> > On 01/13/2014 09:51 PM, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > This tree fails (more than usual) the powerpc allyesconfig build.
> > >
> > > Changes since 20140113:
> > >
> >
> >
> > on i386:
> >
> > net/built-in.o: In function `header_create':
> > 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
> > net/built-in.o: In function `bt_6lowpan_recv':
> > (.text+0x166b3c): undefined reference to `lowpan_process_data'
> 
> Ah, nice Makefile hack there.
> David, Marcel, could you please consider the attached patch.

oops, thanks for fixing this fast!

- Alex

^ permalink raw reply

* [PATCH iproute2 0/2] two improvements in tc
From: Yang Yingliang @ 2014-01-15  9:42 UTC (permalink / raw)
  To: stephen; +Cc: netdev

Support sending burst/mtu to kernel directly in tbf.
Support 64bit rate in netem.

Yang Yingliang (2):
  tbf: support sending burst/mtu to kernel directly
  netem: add 64bit rates support

 tc/q_netem.c | 29 ++++++++++++++++++++++++-----
 tc/q_tbf.c   |  2 ++
 2 files changed, 26 insertions(+), 5 deletions(-)

-- 
1.8.0

^ permalink raw reply

* [PATCH iproute2 2/2] netem: add 64bit rates support
From: Yang Yingliang @ 2014-01-15  9:42 UTC (permalink / raw)
  To: stephen; +Cc: netdev
In-Reply-To: <1389778932-17404-1-git-send-email-yangyingliang@huawei.com>

netem support 64bit rates start from linux-3.13.
Add 64bit rates support in tc tools.

tc qdisc show dev eth0
qdisc netem 1: dev eth4 root refcnt 2 limit 1000 rate 35Gbit

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 tc/q_netem.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/tc/q_netem.c b/tc/q_netem.c
index 9dd8712..1312eb5 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -183,6 +183,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 	__s16 *dist_data = NULL;
 	__u16 loss_type = NETEM_LOSS_UNSPEC;
 	int present[__TCA_NETEM_MAX];
+	__u64 rate64 = 0;
 
 	memset(&cor, 0, sizeof(cor));
 	memset(&reorder, 0, sizeof(reorder));
@@ -391,7 +392,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 		} else if (matches(*argv, "rate") == 0) {
 			++present[TCA_NETEM_RATE];
 			NEXT_ARG();
-			if (get_rate(&rate.rate, *argv)) {
+			if (get_rate64(&rate64, *argv)) {
 				explain1("rate");
 				return -1;
 			}
@@ -496,9 +497,18 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 		addattr_nest_end(n, start);
 	}
 
-	if (present[TCA_NETEM_RATE] &&
-	    addattr_l(n, 1024, TCA_NETEM_RATE, &rate, sizeof(rate)) < 0)
-		return -1;
+	if (present[TCA_NETEM_RATE]) {
+		if (rate64 >= (1ULL << 32)) {
+			if (addattr_l(n, 1024,
+				      TCA_NETEM_RATE64, &rate64, sizeof(rate64)) < 0)
+				return -1;
+			rate.rate = ~0U;
+		} else {
+			rate.rate = rate64;
+		}
+		if (addattr_l(n, 1024, TCA_NETEM_RATE, &rate, sizeof(rate)) < 0)
+			return -1;
+	}
 
 	if (dist_data) {
 		if (addattr_l(n, MAX_DIST * sizeof(dist_data[0]),
@@ -522,6 +532,7 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	struct tc_netem_qopt qopt;
 	const struct tc_netem_rate *rate = NULL;
 	int len = RTA_PAYLOAD(opt) - sizeof(qopt);
+	__u64 *rate64 = NULL;
 	SPRINT_BUF(b1);
 
 	if (opt == NULL)
@@ -572,6 +583,11 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 				return -1;
 			ecn = RTA_DATA(tb[TCA_NETEM_ECN]);
 		}
+		if (tb[TCA_NETEM_RATE64]) {
+			if (RTA_PAYLOAD(tb[TCA_NETEM_RATE64]) < sizeof(*rate64))
+				return -1;
+			rate64 = RTA_DATA(tb[TCA_NETEM_RATE64]);
+		}
 	}
 
 	fprintf(f, "limit %d", qopt.limit);
@@ -632,7 +648,10 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 	}
 
 	if (rate && rate->rate) {
-		fprintf(f, " rate %s", sprint_rate(rate->rate, b1));
+		if (rate64)
+			fprintf(f, " rate %s", sprint_rate(*rate64, b1));
+		else
+			fprintf(f, " rate %s", sprint_rate(rate->rate, b1));
 		if (rate->packet_overhead)
 			fprintf(f, " packetoverhead %d", rate->packet_overhead);
 		if (rate->cell_size)
-- 
1.8.0

^ permalink raw reply related

* [PATCH iproute2 1/2] tbf: support sending burst/mtu to kernel directly
From: Yang Yingliang @ 2014-01-15  9:42 UTC (permalink / raw)
  To: stephen; +Cc: netdev
In-Reply-To: <1389778932-17404-1-git-send-email-yangyingliang@huawei.com>

To avoid loss when transforming burst to buffer in userspace, send
burst/mtu to kernel directly.

Kernel commit 2e04ad424b("sch_tbf: add TBF_BURST/TBF_PBURST attribute")
make it can handle burst/mtu.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 tc/q_tbf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tc/q_tbf.c b/tc/q_tbf.c
index 2fbfd3b..f3022b6 100644
--- a/tc/q_tbf.c
+++ b/tc/q_tbf.c
@@ -232,12 +232,14 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
 	tail = NLMSG_TAIL(n);
 	addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
 	addattr_l(n, 2024, TCA_TBF_PARMS, &opt, sizeof(opt));
+	addattr_l(n, 2124, TCA_TBF_BURST, &buffer, sizeof(buffer));
 	if (rate64 >= (1ULL << 32))
 		addattr_l(n, 2124, TCA_TBF_RATE64, &rate64, sizeof(rate64));
 	addattr_l(n, 3024, TCA_TBF_RTAB, rtab, 1024);
 	if (opt.peakrate.rate) {
 		if (prate64 >= (1ULL << 32))
 			addattr_l(n, 3124, TCA_TBF_PRATE64, &prate64, sizeof(prate64));
+		addattr_l(n, 3224, TCA_TBF_PBURST, &mtu, sizeof(mtu));
 		addattr_l(n, 4096, TCA_TBF_PTAB, ptab, 1024);
 	}
 	tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
-- 
1.8.0

^ permalink raw reply related

* Re: [PATCH v5 net-next 1/4] sh_eth: Use bool as return type of sh_eth_is_gether()
From: Joe Perches @ 2014-01-15  9:35 UTC (permalink / raw)
  To: Simon Horman
  Cc: David S. Miller, netdev, linux-sh, linux-arm-kernel, Magnus Damm,
	Sergei Shtylyov
In-Reply-To: <1389766341-14001-2-git-send-email-horms+renesas@verge.net.au>

On Wed, 2014-01-15 at 15:12 +0900, Simon Horman wrote:
> Return a boolean and use true and false.
[]
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
[]
> @@ -310,12 +310,12 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
>  	[TSU_ADRL31]	= 0x01fc,
>  };
>  
> -static int sh_eth_is_gether(struct sh_eth_private *mdp)
> +static bool sh_eth_is_gether(struct sh_eth_private *mdp)
>  {
>  	if (mdp->reg_offset == sh_eth_offset_gigabit)
> -		return 1;
> +		return true;
>  	else
> -		return 0;
> +		return false;
>  }

Or maybe:

static bool sh_eth_is_gether(struct sh_eth_private *mdp)
{
	return mdp->reg_offset == sh_eth_offset_gigabit;
}



^ permalink raw reply

* [PATCH net-next] sctp: create helper function to enable|disable sackdelay
From: Wang Weidong @ 2014-01-15  9:24 UTC (permalink / raw)
  To: Vlad Yasevich, Neil Horman, David Miller; +Cc: linux-sctp, netdev

add sctp_spp_sackdelay_{enable|disable} helper function for
avoiding code duplication. 

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/sctp/socket.c | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 7cc62b9..20dd417 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2527,6 +2527,16 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
 	return 0;
 }
 
+static inline __u32 sctp_spp_sackdelay_enable(__u32 param_flags)
+{
+	return (param_flags & ~SPP_SACKDELAY) | SPP_SACKDELAY_ENABLE;
+}
+
+static inline __u32 sctp_spp_sackdelay_disable(__u32 param_flags)
+{
+	return (param_flags & ~SPP_SACKDELAY) | SPP_SACKDELAY_DISABLE;
+}
+
 /*
  * 7.1.23.  Get or set delayed ack timer (SCTP_DELAYED_SACK)
  *
@@ -2610,37 +2620,31 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk,
 			asoc->sackdelay =
 				msecs_to_jiffies(params.sack_delay);
 			asoc->param_flags =
-				(asoc->param_flags & ~SPP_SACKDELAY) |
-				SPP_SACKDELAY_ENABLE;
+				sctp_spp_sackdelay_enable(asoc->param_flags);
 		} else {
 			sp->sackdelay = params.sack_delay;
 			sp->param_flags =
-				(sp->param_flags & ~SPP_SACKDELAY) |
-				SPP_SACKDELAY_ENABLE;
+				sctp_spp_sackdelay_enable(sp->param_flags);
 		}
 	}
 
 	if (params.sack_freq == 1) {
 		if (asoc) {
 			asoc->param_flags =
-				(asoc->param_flags & ~SPP_SACKDELAY) |
-				SPP_SACKDELAY_DISABLE;
+				sctp_spp_sackdelay_disable(asoc->param_flags);
 		} else {
 			sp->param_flags =
-				(sp->param_flags & ~SPP_SACKDELAY) |
-				SPP_SACKDELAY_DISABLE;
+				sctp_spp_sackdelay_disable(sp->param_flags);
 		}
 	} else if (params.sack_freq > 1) {
 		if (asoc) {
 			asoc->sackfreq = params.sack_freq;
 			asoc->param_flags =
-				(asoc->param_flags & ~SPP_SACKDELAY) |
-				SPP_SACKDELAY_ENABLE;
+				sctp_spp_sackdelay_enable(asoc->param_flags);
 		} else {
 			sp->sackfreq = params.sack_freq;
 			sp->param_flags =
-				(sp->param_flags & ~SPP_SACKDELAY) |
-				SPP_SACKDELAY_ENABLE;
+				sctp_spp_sackdelay_enable(sp->param_flags);
 		}
 	}
 
@@ -2652,18 +2656,15 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk,
 				trans->sackdelay =
 					msecs_to_jiffies(params.sack_delay);
 				trans->param_flags =
-					(trans->param_flags & ~SPP_SACKDELAY) |
-					SPP_SACKDELAY_ENABLE;
+					sctp_spp_sackdelay_enable(trans->param_flags);
 			}
 			if (params.sack_freq == 1) {
 				trans->param_flags =
-					(trans->param_flags & ~SPP_SACKDELAY) |
-					SPP_SACKDELAY_DISABLE;
+					sctp_spp_sackdelay_disable(trans->param_flags);
 			} else if (params.sack_freq > 1) {
 				trans->sackfreq = params.sack_freq;
 				trans->param_flags =
-					(trans->param_flags & ~SPP_SACKDELAY) |
-					SPP_SACKDELAY_ENABLE;
+					sctp_spp_sackdelay_enable(trans->param_flags);
 			}
 		}
 	}
-- 
1.7.12

^ permalink raw reply related

* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
From: Michael S. Tsirkin @ 2014-01-15  9:15 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
In-Reply-To: <CAMuHMdW4io2BcPvR-VwLMrCNReTEcUeNgO1ievVw+Eg=UdyeuA@mail.gmail.com>

On Wed, Jan 15, 2014 at 10:01:49AM +0100, Geert Uytterhoeven wrote:
> On Wed, Jan 15, 2014 at 9:46 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Wed, Jan 15, 2014 at 09:36:13AM +0100, Geert Uytterhoeven wrote:
> >> On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> >> > As a result of backporting a bugfix, virtio_net started passing void *
> >> > to page_address, assuming that it will get silently converted to struct
> >> > page *. But this does not happen on architectures where page_address is
> >> > a macro, the result is build failure as the macro tries to dereference
> >> > void*.
> >> >
> >> > Fix by reordering code slightly, so we always pass
> >> > struct page * to page_address.
> >>
> >> Thanks for the clue! I was just investigating a similar failure in -next.
> >>
> >> Gr{oetje,eeting}s,
> >>
> >>                         Geert
> >
> > You don't mean linux-next? And not in virtio-net? I don't see page_address
> > being used on void * anywhere there.
> 
> http://kisskb.ellerman.id.au/kisskb/buildresult/10469287/

Wew, so it's not my fault :)

> I'm making {,set}page_address() static inline to fix this.

Yes, I don't see why it has to be a macro.

> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply

* [PATCH net-next v3] ipv6: move IPV6_TCLASS_SHIFT into ipv6.h and define a helper
From: roy.qing.li @ 2014-01-15  9:03 UTC (permalink / raw)
  To: netdev

From: Li RongQing <roy.qing.li@gmail.com>

Two places defined IPV6_TCLASS_SHIFT, so we should move it into ipv6.h,
and use this macro as possible. And define ip6_tclass helper to return
tclass

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 include/net/ipv6.h       |    5 +++++
 net/ipv6/fib6_rules.c    |    2 +-
 net/ipv6/ip6_gre.c       |    2 --
 net/ipv6/ip6_tunnel.c    |    2 --
 net/ipv6/ipv6_sockglue.c |    3 ++-
 5 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 12079c6..2a4b2d7 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -239,6 +239,7 @@ struct ip6_flowlabel {
 #define IPV6_FLOWINFO_MASK	cpu_to_be32(0x0FFFFFFF)
 #define IPV6_FLOWLABEL_MASK	cpu_to_be32(0x000FFFFF)
 #define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK)
+#define IPV6_TCLASS_SHIFT	20
 
 struct ipv6_fl_socklist {
 	struct ipv6_fl_socklist	__rcu	*next;
@@ -681,6 +682,10 @@ static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
 	return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;
 }
 
+static inline u8 ip6_tclass(__be32 flowinfo)
+{
+	return ntohl(flowinfo & IPV6_TCLASS_MASK) >> IPV6_TCLASS_SHIFT;
+}
 /*
  *	Prototypes exported by ipv6
  */
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 3fd0a57..b4d5e1d 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -169,7 +169,7 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
 			return 0;
 	}
 
-	if (r->tclass && r->tclass != ((ntohl(fl6->flowlabel) >> 20) & 0xff))
+	if (r->tclass && r->tclass != ip6_tclass(fl6->flowlabel))
 		return 0;
 
 	return 1;
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index e7a440d..f3ffb43 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -61,8 +61,6 @@ static bool log_ecn_error = true;
 module_param(log_ecn_error, bool, 0644);
 MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN");
 
-#define IPV6_TCLASS_SHIFT 20
-
 #define HASH_SIZE_SHIFT  5
 #define HASH_SIZE (1 << HASH_SIZE_SHIFT)
 
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 1e5e240..5db8d31 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -69,8 +69,6 @@ MODULE_ALIAS_NETDEV("ip6tnl0");
 #define IP6_TNL_TRACE(x...) do {;} while(0)
 #endif
 
-#define IPV6_TCLASS_SHIFT 20
-
 #define HASH_SIZE_SHIFT  5
 #define HASH_SIZE (1 << HASH_SIZE_SHIFT)
 
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index af0ecb9..2855b00 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -1019,7 +1019,8 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
 				put_cmsg(&msg, SOL_IPV6, IPV6_HOPLIMIT, sizeof(hlim), &hlim);
 			}
 			if (np->rxopt.bits.rxtclass) {
-				int tclass = ntohl(np->rcv_flowinfo & IPV6_TCLASS_MASK) >> 20;
+				int tclass = (int)ip6_tclass(np->rcv_flowinfo);
+
 				put_cmsg(&msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass);
 			}
 			if (np->rxopt.bits.rxoinfo) {
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
From: Geert Uytterhoeven @ 2014-01-15  9:01 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
In-Reply-To: <20140115084605.GF29177@redhat.com>

On Wed, Jan 15, 2014 at 9:46 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Wed, Jan 15, 2014 at 09:36:13AM +0100, Geert Uytterhoeven wrote:
>> On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> > As a result of backporting a bugfix, virtio_net started passing void *
>> > to page_address, assuming that it will get silently converted to struct
>> > page *. But this does not happen on architectures where page_address is
>> > a macro, the result is build failure as the macro tries to dereference
>> > void*.
>> >
>> > Fix by reordering code slightly, so we always pass
>> > struct page * to page_address.
>>
>> Thanks for the clue! I was just investigating a similar failure in -next.
>>
>> Gr{oetje,eeting}s,
>>
>>                         Geert
>
> You don't mean linux-next? And not in virtio-net? I don't see page_address
> being used on void * anywhere there.

http://kisskb.ellerman.id.au/kisskb/buildresult/10469287/

I'm making {,set}page_address() static inline to fix this.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH net-next 2/2] net: mvneta: make mvneta_txq_done() return void
From: Willy Tarreau @ 2014-01-15  8:56 UTC (permalink / raw)
  To: Arnaud Ebalard; +Cc: David Miller, Thomas Petazzoni, netdev, linux-arm-kernel
In-Reply-To: <1e35971f3ee9f4d120bff5fe98179160998ea0fa.1389742334.git.arno@natisbad.org>

On Wed, Jan 15, 2014 at 12:46:52AM +0100, Arnaud Ebalard wrote:
> 
> The function return parameter is not used in mvneta_tx_done_gbe(),
> where the function is called. This patch makes the function return
> void.
> 
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>

Reviewed-by: Willy Tarreau <w@1wt.eu>

^ permalink raw reply

* Re: [PATCH net-next 1/2] net: mvneta: mvneta_tx_done_gbe() cleanups
From: Willy Tarreau @ 2014-01-15  8:56 UTC (permalink / raw)
  To: Arnaud Ebalard; +Cc: David Miller, Thomas Petazzoni, netdev, linux-arm-kernel
In-Reply-To: <5880b38afc5884f5ed57c26824cc37666bd60b99.1389742334.git.arno@natisbad.org>

On Wed, Jan 15, 2014 at 12:45:49AM +0100, Arnaud Ebalard wrote:
> 
> mvneta_tx_done_gbe() return value and third parameter are no more
> used. This patch changes the function prototype and removes a useless
> variable where the function is called.
> 
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>

Reviewed-by: Willy Tarreau <w@1wt.eu>

Willy

^ permalink raw reply

* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
From: Michael S. Tsirkin @ 2014-01-15  8:46 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
In-Reply-To: <CAMuHMdV=qzDApabSiQj9up_RUW=PoVJA8oWaiWY7d2iQ22AfeQ@mail.gmail.com>

On Wed, Jan 15, 2014 at 09:36:13AM +0100, Geert Uytterhoeven wrote:
> On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > As a result of backporting a bugfix, virtio_net started passing void *
> > to page_address, assuming that it will get silently converted to struct
> > page *. But this does not happen on architectures where page_address is
> > a macro, the result is build failure as the macro tries to dereference
> > void*.
> >
> > Fix by reordering code slightly, so we always pass
> > struct page * to page_address.
> 
> Thanks for the clue! I was just investigating a similar failure in -next.
> 
> Gr{oetje,eeting}s,
> 
>                         Geert

You don't mean linux-next? And not in virtio-net? I don't see page_address
being used on void * anywhere there.

> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH stable-only] virtio-net: fix build on m68k and sparc64
From: Geert Uytterhoeven @ 2014-01-15  8:36 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization, Greg Kroah-Hartman, David Miller, Guenter Roeck
In-Reply-To: <1389774152-1526-1-git-send-email-mst@redhat.com>

On Wed, Jan 15, 2014 at 9:26 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> As a result of backporting a bugfix, virtio_net started passing void *
> to page_address, assuming that it will get silently converted to struct
> page *. But this does not happen on architectures where page_address is
> a macro, the result is build failure as the macro tries to dereference
> void*.
>
> Fix by reordering code slightly, so we always pass
> struct page * to page_address.

Thanks for the clue! I was just investigating a similar failure in -next.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* [PATCH stable-only] virtio-net: fix build on m68k and sparc64
From: Michael S. Tsirkin @ 2014-01-15  8:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: netdev, virtualization, Greg Kroah-Hartman, David Miller,
	Guenter Roeck

As a result of backporting a bugfix, virtio_net started passing void *
to page_address, assuming that it will get silently converted to struct
page *. But this does not happen on architectures where page_address is
a macro, the result is build failure as the macro tries to dereference
void*.

Fix by reordering code slightly, so we always pass
struct page * to page_address.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

David, Greg asked that this be put in stable ASAP to avoid
next release being broken.
I still didn't Cc stable directly as I know you prefer to do this
yourself.
Sorry about creating this mess, could you help fast-path it there please?

Thanks!

 drivers/net/virtio_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b8665588..c8d5ee1 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -330,9 +330,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
 					 void *buf,
 					 unsigned int len)
 {
-	struct skb_vnet_hdr *hdr = page_address(buf);
-	int num_buf = hdr->mhdr.num_buffers;
 	struct page *page = buf;
+	struct skb_vnet_hdr *hdr = page_address(page);
+	int num_buf = hdr->mhdr.num_buffers;
 	struct sk_buff *skb = page_to_skb(rq, page, len);
 	int i;
 
-- 
MST

^ permalink raw reply related

* Re: [PATCH net-next 0/6] mvneta driver performance improvements
From: Willy Tarreau @ 2014-01-15  8:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20140115.000540.2059947089292889482.davem@davemloft.net>

On Wed, Jan 15, 2014 at 12:05:40AM -0800, David Miller wrote:
> From: Willy Tarreau <w@1wt.eu>
> Date: Wed, 15 Jan 2014 08:48:31 +0100
> 
> > On Tue, Jan 14, 2014 at 05:00:26PM -0800, David Miller wrote:
> >> From: Willy Tarreau <w@1wt.eu>
> >> Date: Sun, 12 Jan 2014 12:24:02 +0100
> >> 
> >> > this patch series implements several performance improvements on the
> >> > mvneta driver.
> >> 
> >> Ignore that last email, I meant to say that this series did not apply
> >> cleanly to net-next, sorry for the confusion.
> > 
> > David, this is because the first series is not applied first. I can
> > understand it was not very clear (just mentionned in the e-mail's body).
> > Do you prefer me to send you the two series for net-next or is it better
> > to wait for the first series to be merged first before applying the
> > second one ?
> > 
> > Just tell me what you prefer and I'll adapt.
> 
> Hmmm, didn't I apply the first series?

Possible :-)

Willy

^ permalink raw reply

* Re: [PATCH net] bpf: do not use reciprocal divide
From: Martin Schwidefsky @ 2014-01-15  8:13 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Eric Dumazet, Hannes Frederic Sowa, netdev, dborkman,
	darkjames-ws, Mircea Gherzan, Russell King, Matt Evans
In-Reply-To: <20140115080007.GA6638@osiris>

On Wed, 15 Jan 2014 09:00:07 +0100
Heiko Carstens <heiko.carstens@de.ibm.com> wrote:

> On Tue, Jan 14, 2014 at 11:02:41PM -0800, Eric Dumazet wrote:
> > diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
> > index 16871da37371..e349dc7d0992 100644
> > --- a/arch/s390/net/bpf_jit_comp.c
> > +++ b/arch/s390/net/bpf_jit_comp.c
> > @@ -371,11 +371,11 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter,
> >  		/* dr %r4,%r12 */
> >  		EMIT2(0x1d4c);
> >  		break;
> > -	case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K) */
> > -		/* m %r4,<d(K)>(%r13) */
> > -		EMIT4_DISP(0x5c40d000, EMIT_CONST(K));
> > -		/* lr %r5,%r4 */
> > -		EMIT2(0x1854);
> > +	case BPF_S_ALU_DIV_K: /* A /= K */
> > +		/* lhi %r4,0 */
> > +		EMIT4(0xa7480000);
> > +		/* d %r4,<d(K)>(%r13) */
> > +		EMIT4_DISP(0x5d40d000, EMIT_CONST(K));
> >  		break;
> 
> The s390 part looks good.

Does it? The divide instruction is signed, for the special
case of K==1 this can now cause an exception if the quotient
gets too large. We should add a check for K==1 and do nothing
in this case. With a divisor of at least 2 the result will
stay in the limit.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

^ permalink raw reply

* Re: [PATCH net-next 0/6] mvneta driver performance improvements
From: David Miller @ 2014-01-15  8:05 UTC (permalink / raw)
  To: w; +Cc: netdev
In-Reply-To: <20140115074831.GD4605@1wt.eu>

From: Willy Tarreau <w@1wt.eu>
Date: Wed, 15 Jan 2014 08:48:31 +0100

> On Tue, Jan 14, 2014 at 05:00:26PM -0800, David Miller wrote:
>> From: Willy Tarreau <w@1wt.eu>
>> Date: Sun, 12 Jan 2014 12:24:02 +0100
>> 
>> > this patch series implements several performance improvements on the
>> > mvneta driver.
>> 
>> Ignore that last email, I meant to say that this series did not apply
>> cleanly to net-next, sorry for the confusion.
> 
> David, this is because the first series is not applied first. I can
> understand it was not very clear (just mentionned in the e-mail's body).
> Do you prefer me to send you the two series for net-next or is it better
> to wait for the first series to be merged first before applying the
> second one ?
> 
> Just tell me what you prefer and I'll adapt.

Hmmm, didn't I apply the first series?

^ permalink raw reply

* Re: [net-next 0/2] Intel Wired LAN Driver Updates
From: David Miller @ 2014-01-15  8:01 UTC (permalink / raw)
  To: aaron.f.brown; +Cc: netdev, gospo, sassmann
In-Reply-To: <1389658384-15825-1-git-send-email-aaron.f.brown@intel.com>

From: Aaron Brown <aaron.f.brown@intel.com>
Date: Mon, 13 Jan 2014 16:13:02 -0800

> This series contains updates to i40e from Greg Rose for VLAN filtering.

Series applied, thanks Aaron.

^ permalink raw reply

* Route exceptions for IPv6 routes?
From: Simon Schneider @ 2014-01-15  8:01 UTC (permalink / raw)
  To: netdev

Hi,
I learned that the routing cache was removed from the kernel for several reasons.

Some functions have been replaced with the route exceptions, e.g. storing the path MTU.

My question: is this valid for both IPv4 as well as IPv6 routing, i.e. do the route exceptions work in the same way for IPv6 routes as they work for IPv4 routes?

Maybe a trivial question, but Google didn't give me much information on the topic...

best regards, Simon

^ permalink raw reply

* Re: [PATCH net] bpf: do not use reciprocal divide
From: Heiko Carstens @ 2014-01-15  8:00 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Hannes Frederic Sowa, netdev, dborkman, darkjames-ws,
	Mircea Gherzan, Russell King, Matt Evans, Martin Schwidefsky
In-Reply-To: <1389769361.31367.325.camel@edumazet-glaptop2.roam.corp.google.com>

On Tue, Jan 14, 2014 at 11:02:41PM -0800, Eric Dumazet wrote:
> diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
> index 16871da37371..e349dc7d0992 100644
> --- a/arch/s390/net/bpf_jit_comp.c
> +++ b/arch/s390/net/bpf_jit_comp.c
> @@ -371,11 +371,11 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter,
>  		/* dr %r4,%r12 */
>  		EMIT2(0x1d4c);
>  		break;
> -	case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K) */
> -		/* m %r4,<d(K)>(%r13) */
> -		EMIT4_DISP(0x5c40d000, EMIT_CONST(K));
> -		/* lr %r5,%r4 */
> -		EMIT2(0x1854);
> +	case BPF_S_ALU_DIV_K: /* A /= K */
> +		/* lhi %r4,0 */
> +		EMIT4(0xa7480000);
> +		/* d %r4,<d(K)>(%r13) */
> +		EMIT4_DISP(0x5d40d000, EMIT_CONST(K));
>  		break;

The s390 part looks good.

> diff --git a/net/core/filter.c b/net/core/filter.c
> index 01b780856db2..ad30d626a5bd 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -166,7 +165,7 @@ unsigned int sk_run_filter(const struct sk_buff *skb,
>  			A /= X;
>  			continue;
>  		case BPF_S_ALU_DIV_K:
> -			A = reciprocal_divide(A, K);
> +			A /= K;
>  			continue;
>  		case BPF_S_ALU_MOD_X:
>  			if (X == 0)
> @@ -553,11 +552,6 @@ int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
>  		/* Some instructions need special checks */
>  		switch (code) {
>  		case BPF_S_ALU_DIV_K:
> -			/* check for division by zero */
> -			if (ftest->k == 0)
> -				return -EINVAL;
> -			ftest->k = reciprocal_value(ftest->k);
> -			break;

Are you sure you want to remove the k == 0 check? Is there something
else that would prevent a division by zero?

^ permalink raw reply

* [PATCH net-next 11/11] be2net: update driver version to 10.0.x
From: Sathya Perla @ 2014-01-15  7:53 UTC (permalink / raw)
  To: netdev
In-Reply-To: <1389772421-24925-1-git-send-email-sathya.perla@emulex.com>


Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 93826ae..8d09615 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -34,7 +34,7 @@
 #include "be_hw.h"
 #include "be_roce.h"
 
-#define DRV_VER			"4.9.224.0u"
+#define DRV_VER			"10.0.600.0u"
 #define DRV_NAME		"be2net"
 #define BE_NAME			"Emulex BladeEngine2"
 #define BE3_NAME		"Emulex BladeEngine3"
-- 
1.7.1

^ permalink raw reply related


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