Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-20 Thread Herbert Xu
_SKB_PAD) if needed. Yes I agree. It doesn't hurt to dump more data. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-19 Thread Herbert Xu
checksum fault if the checksum turns out to be correct in that case but it's not really a big deal. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-11-18 Thread Herbert Xu
On Mon, Nov 19, 2018 at 11:56:35AM +0800, Herbert Xu wrote: > > I take that back. Because of your shift which cancels out the > shift in NULLS_MARKER, it would appear that this should work just > fine with RHT_NULLS_MARRKER(0), no? IOW, it would appear that > >

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-18 Thread Herbert Xu
e is no validation of the original skb->csum. > So this check should be still inverted there?? > > Or am I still missing anything here? What do you mean? My copy of nf_ip_checksum seems to be doing the right thing as far as verifying CHECKSUM_COMPLETED goes. Cheers, -- Emai

Re: [PATCH] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-11-18 Thread Herbert Xu
On Mon, Nov 19, 2018 at 11:54:15AM +0800, Herbert Xu wrote: > > > >> diff --git a/lib/rhashtable.c b/lib/rhashtable.c > > >> index 30526afa8343..852ffa5160f1 100644 > > >> --- a/lib/rhashtable.c > > >> +++ b/lib/rhashtable.c > > >> @@

Re: [PATCH] rhashtable: detect when object movement between tables might have invalidated a lookup

2018-11-18 Thread Herbert Xu
_head __rcu *rhnull; > > > > I don't understand why you can't continue to do NULLS_MARKER(0) or > > RHT_NULLS_MARKER(0). > > Because then the test > > + } while (he != RHT_NULLS_MARKER(head)); > > in __rhashtable_lookup() would always succeed, and it would loop &g

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-15 Thread Herbert Xu
te packet plus the hardware-generated checksum. That would make debugging these rare hardware faults much easier. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-15 Thread Herbert Xu
6647601721=2 Can you please provide your backtrace? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Patch net] net: invert the check of detecting hardware RX checksum fault

2018-11-15 Thread Herbert Xu
no warning or InCsumErrors after 1 hour. > > Fixes: fb286bb2990a ("[NET]: Detect hardware rx checksum faults correctly") > Cc: Herbert Xu > Cc: Tom Herbert > Cc: Eric Dumazet > Signed-off-by: Cong Wang > --- > net/core/datagram.c | 4 ++-- > net/core/dev

Re: [PATCH] net-xfrm: add build time cfg option to PF_KEY SHA256 to use RFC4868-compliant truncation

2018-10-17 Thread Herbert Xu
ecided at run-time. In fact you can already do this at run-time anyway through the xfrm interface. So please please please just ditch whatever that you're using that's still glued to the long-obsolete (more than a decade) af_key interface and switch it over to xfrm. Thanks, -- Email: Herbert X

Re: [PATCH net] inet: frags: rework rhashtable dismantle

2018-10-01 Thread Herbert Xu
igned to handle read-only iteration through the hash table. While this probably works since the actual freeing is delayed by RCU, it seems to be rather fragile. How about using the dead flag but instead of putting it in the rhashtable put it in netns_frags and have the timers check on tha

Re: [PATCH net] rhashtable: prevent work queue schedule while dismantling

2018-10-01 Thread Herbert Xu
nvoking the normal rhashtable remove function. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH - revised] rhashtable: detect when object movement might have invalidated a lookup

2018-07-15 Thread Herbert Xu
e to another. I'm relucant to add semantics that would restrain on how rhashtable works unless we have real and valid use-cases for it. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2] rhashtable: add restart routine in rhashtable_free_and_destroy()

2018-07-08 Thread Herbert Xu
_init+0x130/0x130 [nfnetlink] > [ 200.975525] ? debug_show_all_locks+0x290/0x290 > [ 200.980363] ? debug_show_all_locks+0x290/0x290 > [ 200.986356] ? sched_clock_cpu+0x132/0x170 > [ 200.990352] ? find_held_lock+0x39/0x1b0 > [ 200.994355] ? sched_clock_local+0x10d/0x130 > [ 200.999531] ? memset+0x1f/0x40 > > V2: > - free all tables requested by Herbert Xu > > Signed-off-by: Taehee Yoo Acked-by: Herbert Xu Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] rhashtable: add restart routine in rhashtable_free_and_destroy()

2018-07-03 Thread Herbert Xu
_tbl, ht); > + if (tbl) > + goto restart; > } > - > - bucket_table_free(tbl); > + bucket_table_free(rht_dereference(ht->tbl, ht)); Good catch. But don't we need to call bucket_table_free on all the tables too rather than just the first table?

Re: [PATCH] crypto: chtls: generic handling of data and hdr

2018-05-26 Thread Herbert Xu
; > Signed-off-by: Atul Gupta <atul.gu...@chelsio.com> > Signed-off-by: Harsh Jain <ha...@chelsio.com> Patch applied. Thanks. -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH] lib/rhashtable: reorder some inititalization sequences

2018-05-14 Thread Herbert Xu
gt; > > Also move the locking initialization down to the end. > > > > Signed-off-by: Davidlohr Bueso <dbu...@suse.de> > > The user potentially "doing something bogus" is why the most > expensive part of the initialization (the memory allocation

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-07 Thread Herbert Xu
Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-07 Thread Herbert Xu
must not be allowed to occur. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-07 Thread Herbert Xu
ork stack. As the aim is to convert as many existing hash tables to rhashtable as possible, we want to keep this. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-05 Thread Herbert Xu
r may not have even started from the same place. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-05 Thread Herbert Xu
to instantiate the same nested table. I think you missed the fact that when we use nested tables the spin lock table is limited to just a single page and hence corresponds to the first level in the nested table. Therefore it's always safe. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.a

Re: [PATCH 6/8] rhashtable: further improve stability of rhashtable_walk

2018-05-05 Thread Herbert Xu
status quo. On the other this does not work on rhltable and we do have a way of fixing it for both rhashtable and rhltable. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 8/8] rhashtable: don't hold lock on first table throughout insertion.

2018-05-05 Thread Herbert Xu
e. There can be multiple tables in existence. Unless you hold the lock on the first table, what is to stop two parallel inserters each from inserting into their "last" tables which may not be the same table? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/8] rhashtable: remove rhashtable_walk_peek()

2018-05-05 Thread Herbert Xu
ator, sometimes it doesn't. > > This function is not currently used and is not worth keeping, so > remove it. > > Signed-off-by: NeilBrown <ne...@suse.com> I don't have a problem with this. But it would be good to hear from Tom Herbert who added this. -- Email: Herbert Xu <herb.

Re: [PATCH 4/8] rhashtable: fix race in nested_table_alloc()

2018-05-05 Thread Herbert Xu
ock that's meant to be held around this operation? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 3/8] rhashtable: use cmpxchg() to protect ->future_tbl.

2018-05-05 Thread Herbert Xu
se.com> This looks nice. > - spin_unlock_bh(old_tbl->locks); > + rcu_assign_pointer(tmp, new_tbl); Do we need this barrier since cmpxchg is supposed to provide memory barrier semantics? > + if (cmpxchg(_tbl->future_tbl, NULL, tmp) != NULL) > + return

Re: [PATCH 2/8] rhashtable: remove nulls_base and related code.

2018-05-05 Thread Herbert Xu
know that there will be a use for this. As to the bug fix, please separate it out of the patch and resubmit. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 1/8] rhashtable: silence RCU warning in rhashtable_test.

2018-05-05 Thread Herbert Xu
om> I don't think the mutex is actually needed but since we don't have rht_dereference_raw and this is just test code: Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: ht

Re: [PATCH] net/xfrm: Fix lookups for states with spi == 0

2018-05-02 Thread Herbert Xu
and MIPv6 RO state. Such state should not be added to the SPI hash because we do not care about it on deleting path. Signed-off-by: Masahide NAKAMURA <na...@linux-ipv6.org> Signed-off-by: YOSHIFUJI Hideaki <yoshf...@linux-ipv6.org> I think it would be better to revert this.

Re: [PATCH] net/xfrm: Fix lookups for states with spi == 0

2018-05-02 Thread Herbert Xu
ible to workaround from userspace as > xfrm_id_proto_match() will be always true for ah/esp/comp protos. > > So, don't try looking up by hash if SPI == 0. > > Cc: Steffen Klassert <steffen.klass...@secunet.com> > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Cc: &q

Re: [PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-23 Thread Herbert Xu
t can be useful for the client to know whether it got the previous one > or not. I see. I'm OK with this provided that you will also remove/convert users of rhashtable_walk_peek. I don't think we need two functions that do almost the same thing. Thanks, -- Email: Herbert Xu <h

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-23 Thread Herbert Xu
alk_enter() > > Neither rhashtable_walk_enter() or rhltable_walk_enter() sleep, though > they do take a spinlock without irq protection. > So revise the comments to accurately state the contexts in which > these functions can be called. > > Signed-off-by: NeilBrown <ne...@suse.com&g

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread Herbert Xu
viously the not able to sleep part completely ruled out any ambiguity but the new wording could confuse people into thinking that this can be called from softirq context where it would be unsafe if mixed with process context usage. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home P

Re: [PATCH 6/6] rhashtable: add rhashtable_walk_prev()

2018-04-18 Thread Herbert Xu
u explain the need for this function and its difference from the existing rhashtable_walk_peek? Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 1/6] rhashtable: remove outdated comments about grow_decision etc

2018-04-18 Thread Herbert Xu
On Wed, Apr 18, 2018 at 04:47:01PM +1000, NeilBrown wrote: > grow_decision and shink_decision no longer exist, so remove > the remaining references to them. > > Signed-off-by: NeilBrown <ne...@suse.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> --

Re: [PATCH 2/6] rhashtable: remove incorrect comment on r{hl, hash}table_walk_enter()

2018-04-18 Thread Herbert Xu
with spin locks held. It does a naked spin lock so even though we removed the memory allocation you still mustn't call it from interrupt context. Why do you need to do that anyway? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-04-05 Thread Herbert Xu
too small. Automatic shrinking shouldn't be an issue because that's the slow kind of resizing that we punt to kthread context and it can afford to do a careful count. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [Cluster-devel] [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

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

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-04-02 Thread Herbert Xu
to just this after your patch then yes possibly. You also need to ensure that not only seqfs users continue to work but also netlink dump users which are slightly different. > It might be OK to have a function call instead of expecting people to > use iter.p directly. Yes that would definite

Re: [PATCH v3 net-next 07/12] rhashtable: add schedule points

2018-03-30 Thread Herbert Xu
Dumazet <eduma...@google.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 net-next 07/12] rhashtable: add schedule points

2018-03-30 Thread Herbert Xu
Dumazet <eduma...@google.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units

2018-03-30 Thread Herbert Xu
ns too: - nested_table_free - bucket_table_alloc - rhashtable_rehash_table Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units

2018-03-30 Thread Herbert Xu
gt; - spin_unlock(>chain_lock); > + struct inet_frag_queue *fq; > > - if (depth <= INETFRAGS_MAXDEPTH) > - return inet_frag_create(nf, f, key); > + rcu_read_lock(); > > - if (inet_frag_may_rebuild(f)) { > - if (!f->rebuild) > - f->rebuild = true; > - inet_frag_schedule_worker(f); > + fq = rhashtable_lookup(>rhashtable, key, nf->f->rhash_params); Ditto. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-03-29 Thread Herbert Xu
walk_peek. As otherwise the object that triggers the out-of-space condition will be skipped upon resumption. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-03-29 Thread Herbert Xu
in the face of removals. https://patchwork.ozlabs.org/patch/892534/ Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek

2018-03-29 Thread Herbert Xu
e must defer that to a work queue because dropping the last > reference may sleep. In light of Neil's latest patch, do we still need this? Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 2/2] rhashtable: improve rhashtable_walk stability when stop/start used.

2018-03-28 Thread Herbert Xu
> through the whole table again to be sure to see everything at least > once. > > Signed-off-by: NeilBrown <ne...@suse.com> Very nice! Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 1/2] rhashtable: fix insertion of in rhltable when duplicate found.

2018-03-28 Thread Herbert Xu
dcf8eb615537526bd42ff27a081d46d337816e -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-28 Thread Herbert Xu
t; the number of elements could exceed any given value. The only promise > we can provide is that it wont exceed N% of the table size for more than > T seconds. Sure. However, assuming we use an estimate that is hash-based, that *should* be fairly accurate assuming that your hash function i

Re: [PATCH 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-28 Thread Herbert Xu
differentiate between a walker, a normal object, and the end of the list. I think it should be doable. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-28 Thread Herbert Xu
the spinlock table approach and have a counter per bucket spinlock. This should be sufficient as you'll contend on the bucket spinlock table anyway. This also allows us to estimate the total table size and not have to always do a last-ditch growth when it's too late. Cheers, -- Email:

Re: [PATCH 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-28 Thread Herbert Xu
g like rht_marker so that normal traversal doesn't see it. That way the removal code can simply traverse that list and inform them that the iterator is invalid. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-28 Thread Herbert Xu
tely. Would that be acceptable to your use-case? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-27 Thread Herbert Xu
The current code should never fail an insertion until you actually run ouf memory. That is unless you're using rhashtable when you should be using rhlist instead. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-27 Thread Herbert Xu
n lost objects due to concurrent removals. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 4/6] rhashtable: allow a walk of the hash table without missing objects.

2018-03-27 Thread Herbert Xu
htable *ht = iter->ht; > > rcu_read_lock(); > > + if (!obj || iter->p != obj) > + iter->p = NULL; Why bother with this check at all? Couldn't we make it so that if you call continue then you continue with the cursor otherwise you set it to NULL as we curre

Re: [PATCH 3/6] rhashtable: reset intr when rhashtable_walk_start sees new table

2018-03-27 Thread Herbert Xu
for it to be true. > > Signed-off-by: NeilBrown <ne...@suse.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH 1/6] rhashtable: improve documentation for rhashtable_walk_peek()

2018-03-27 Thread Herbert Xu
ble_walk_start() > + * or when the iterator is reset. In this case there > + * is no previous object to return. > + */ > + return NULL; > > return __rhashtable_walk_find_next(iter); > } > > -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v11 crypto 00/12] Chelsio Inline TLS

2018-03-19 Thread Herbert Xu
On Sun, Mar 18, 2018 at 10:36:02AM -0400, David Miller wrote: > > Herbert, is it OK for this entire series to go via net-next? Sure, although there could be conflicts since the chelsio driver seems to be changing quite fast. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au&g

Re: [PATCH net] test_rhashtable: Add missing rcu_read_lock()

2018-03-09 Thread Herbert Xu
On Thu, Mar 08, 2018 at 07:10:47PM +0200, Paul Blakey wrote: > > I know but I wanted to show the inner structure for the failure case, iirc > walk doesn't provide this. Fair enough. Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana

Re: [PATCH] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-08 Thread Herbert Xu
On Thu, Mar 08, 2018 at 08:31:47AM -0800, Eric Dumazet wrote: > > Because that would not be nice. > > this_cpu_read() is faster than going through raw_smp_processor_id() and > per_cpu_ptr() I see. In that case I have no objections to this patch. Thanks, -- Email: H

Re: [PATCH net] test_rhashtable: Add missing rcu_read_lock()

2018-03-08 Thread Herbert Xu
gned-off-by: Paul Blakey <pa...@mellanox.com> This shouldn't be doing a table walk in the first place. You should convert it to using the table walk interface. Direct table walks are forbidden because they will break when you hit a resize. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au&g

Re: [PATCH v2 net] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-08 Thread Herbert Xu
the following kernel BUG while > fuzzing sendmsg: Please explain why we can't revert f7c83bcbfaf5 instead. Your patch contradicts the comment above the line that you're changing. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herb

Re: [PATCH] net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms()

2018-03-07 Thread Herbert Xu
have been tightened and > __this_cpu_read() cannot be used in a preemptible context. > > syzkaller reported this leading to the following kernel BUG while > fuzzing sendmsg: How about reverting f7c83bcbfaf5 instead? Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://

Re: [PATCH net v3 2/2] test_rhashtable: add test case for rhltable with duplicate objects

2018-03-05 Thread Herbert Xu
f-by: Paul Blakey <pa...@mellanox.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net v3 1/2] rhashtable: Fix rhlist duplicates insertion

2018-03-05 Thread Herbert Xu
e') > Signed-off-by: Paul Blakey <pa...@mellanox.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net v2 2/2] test_rhashtable: add test case for rhltable with duplicate objects

2018-03-04 Thread Herbert Xu
f-by: Paul Blakey <pa...@mellanox.com> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net v2 1/2] rhashtable: Fix rhlist duplicates insertion

2018-03-04 Thread Herbert Xu
to the wrong email. Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net 1/2] rhashtable: Fix rhltable duplicates insertion

2018-03-04 Thread Herbert Xu
I see, thanks for catching this! Acked-by: Herbert Xu <herb...@gondor.apana.org.au> Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net 1/2] rhashtable: Fix rhltable duplicates insertion

2018-03-04 Thread Herbert Xu
u must not insert objects with the same key through rhashtable. The reason is that we cannot reliably fetch all of the objects with the same key during a resize. If you need duplicate objects, you should use rhlist. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http:

Re: [PATCH 2/3] tcp: Add ESP encapsulation support

2018-01-17 Thread Herbert Xu
be done. I'm working on it. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[PATCH 3/3] ipsec: Add ESP over TCP encapsulation support

2018-01-11 Thread Herbert Xu
one. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- include/net/xfrm.h|7 + net/ipv4/esp4.c | 208 -- net/xfrm/xfrm_input.c | 21 +++-- net/xfrm/xfrm_state.c |3 4 files changed, 228 insertions(+), 11 deletions

[PATCH 2/3] tcp: Add ESP encapsulation support

2018-01-11 Thread Herbert Xu
with the encapsulation side. In particular, if encapsulation data comes in while the socket is owned by user-space, the packets will be stored in tp->encap_out and processed during release_sock. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- include/linux/tcp.h | 15 ++ include/

[PATCH 1/3] skbuff: Avoid sleeping in skb_send_sock_locked

2018-01-11 Thread Herbert Xu
when the socket send buffer is full. This patch fixes it by setting the MSG_DONTWAIT flag when calling kernel_sendmsg_locked. Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> --- net/core/skbuff.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/core/skbuff.c b/net/core/sk

[PATCH 0/3] ipsec: Add ESP over TCP encapsulation

2018-01-11 Thread Herbert Xu
CP, TCP_NODELAY, , sizeof(one)) < 0) error(-1, errno, "TCP_NODELAY"); if (setsockopt(s, SOL_TCP, TCP_ENCAP, NULL, 0) < 0) error(-1, errno, "TCP_ENCAP"); while ((err = read(s, buf, sizeof(buf))) > 0) ;

[PATCH v2] xfrm: Return error on unknown encap_type in init_state

2018-01-05 Thread Herbert Xu
his is harmless as the mode has already been checked further up the stack. This patch removes this anomaly by aligning the IPv6 behaviour with IPv4 and treating unknown modes (which cannot actually happen) as transport mode. Fixes: 38320c70d282 ("[IPSEC]: Use crypto_aead and authenc in ESP")

[PATCH v2] xfrm: Use __skb_queue_tail in xfrm_trans_queue

2018-01-04 Thread Herbert Xu
8ee859f ("xfrm: Reinject transport-mode packets...") Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 444fa37..9dbf425 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c @@ -508,7 +508,7 @@

xfrm: Return error on unknown switch in init_state

2018-01-04 Thread Herbert Xu
Currently esp will happily create an xfrm state with an unknown encap type for IPv4 or an unknown mode for IPv6, without setting the necessary state parameters. This patch fixes it by returning -EINVAL. Fixes: 38320c70d282 ("[IPSEC]: Use crypto_aead and authenc in ESP") Signed-off-by:

Re: [PATCH] xfrm: init skb_head lock for transport-mode packets

2018-01-04 Thread Herbert Xu
ches it to __skb_queue_tail instead. Reported-by: Artem Savkov <asav...@redhat.com> Fixes: acf568ee859f ("xfrm: Reinject transport-mode packets...") Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 0

xfrm: Forbid state updates from changing encap type

2017-12-25 Thread Herbert Xu
ate configuration. In practice key managers will never do a state update to change the encapsulation type. Only the port numbers need to be changed as the peer NAT entry is updated. Therefore this patch adds a check in xfrm_state_update to forbid any changes to the encap_type. Signed-off-by: Herbert

Re: [PATCH 2/3] rhashtable: Add rhashtable_walk_curr

2017-12-18 Thread Herbert Xu
all objects that have been fully converted so far. > Upon the next read from user-space, the object that didn't fit > previously will be revisited. > > Signed-off-by: Andreas Gruenbacher <agrue...@redhat.com> Doesn't the helper that Tom Herbert just added do exact

xfrm: Reinject transport-mode packets through tasklet

2017-12-14 Thread Herbert Xu
input hooks") Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> diff --git a/include/net/xfrm.h b/include/net/xfrm.h index dc28a98..ae35991 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1570,6 +1570,9 @@ struct xfrmk_spdinfo { int xfrm_prepare_input(struct xfrm_

Re: [PATCH v2 net-next 0/5] rhashtable: New features in walk and bucket

2017-12-11 Thread Herbert Xu
existing rhashtable users that dump through netlink to use the new peek interface. Thanks, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-12-11 Thread Herbert Xu
reached (walker.tbl being NULL is not a > sufficient condition for end of table). > > Signed-off-by: Tom Herbert <t...@quantonium.net> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.

Re: [PATCH v2 net-next 1/5] rhashtable: Change rhashtable_walk_start to return void

2017-12-11 Thread Herbert Xu
he function > rhashtable_walk_start_check has been added that returns -EAGAIN on a > resize event. > > Signed-off-by: Tom Herbert <t...@quantonium.net> Acked-by: Herbert Xu <herb...@gondor.apana.org.au> -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: Transport mode xfrm_gro

2017-12-05 Thread Herbert Xu
On Wed, Dec 06, 2017 at 02:37:17PM +1100, Herbert Xu wrote: > > So why is xfrm_input in the xfrm_gro case trying to reinject the > skb into the network stack? Nevermind, I see now that transport_finish has code to skip xfrm_gro packets. Cheers, -- Email: Herbert Xu <herb...@gondor.

Transport mode xfrm_gro

2017-12-05 Thread Herbert Xu
the skb into the network stack? Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH net-next 1/5] rhashtable: Don't reset walker table in rhashtable_walk_start

2017-12-01 Thread Herbert Xu
lways follow the start > of the walk so there should be no behavioral change in doing this. > > Signed-off-by: Tom Herbert <t...@quantonium.net> Doesn't this mean that if a walk encounters a rehash you may end up missing half or more of the hash table? Cheers, -- Email: He

Re: [PATCH net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-11-30 Thread Herbert Xu
> each pass. Thanks Tom! This information is very useful. It sounds like this problem isn't specific to ila and would exist for all rhashtable users that dump through netlink. Let me think about this a little bit more. Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gond

Re: [PATCH net-next 2/5] rhashtable: Add rhastable_walk_peek

2017-11-30 Thread Herbert Xu
eature into the patch description? As it is it's difficult to deduce why we would want to add something like this given that hashtable walks are always unstable and there is no guarantee that two calls to peek or a peek followed by a normal walk will see the same entry. Thanks, -- Email: Herbert Xu &

Re: [5/8] crypto: remove unused hardirq.h

2017-11-28 Thread Herbert Xu
alibaba-inc.com> > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Cc: "David S. Miller" <da...@davemloft.net> > Cc: linux-cry...@vger.kernel.org Patch applied. Thanks. -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [crypto v3 2/2] chcr: Add support for Inline IPSec

2017-11-28 Thread Herbert Xu
: Fixed a build warning and added flag for data packet Patch applied. Thanks. -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [crypto v3 1/2] cxgb4: Add support for Inline IPSec Tx

2017-11-28 Thread Herbert Xu
and added flag for data packet Patch applied. Thanks. -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: GRO disabled with IPv4 options

2017-11-16 Thread Herbert Xu
Cheers, -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: [PATCH v2 2/2] chcr: Add support for Inline IPSec

2017-11-15 Thread Herbert Xu
o/chcr_core.c:169: undefined reference to > >> `chcr_add_xfrmops' Atul, can you fix this and resubmit your patches please? Thanks! -- Email: Herbert Xu <herb...@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Re: kernel BUG at net/key/af_key.c:LINE!

2017-11-09 Thread Herbert Xu
On Fri, Nov 10, 2017 at 01:30:38PM +1100, Herbert Xu wrote: > > I found the problem. This crap is coming from clone_policy. Now > let me where this code came from. ---8<--- Subject: xfrm: Copy policy family in clone_policy The syzbot found an ancient bug in the IPsec code. Wh

Re: kernel BUG at net/key/af_key.c:LINE!

2017-11-09 Thread Herbert Xu
On Fri, Nov 10, 2017 at 01:11:45PM +1100, Herbert Xu wrote: > > Oh and this is an important clue. We have two policies with > identical index values. The index value is meant to be unique > so clearly something funny is going on. I found the problem. This crap is coming from clone_

Re: kernel BUG at net/key/af_key.c:LINE!

2017-11-09 Thread Herbert Xu
On Fri, Nov 10, 2017 at 01:04:59PM +1100, Herbert Xu wrote: > > By castrating the reproducer to not perform a pfkey dump I have > captured the corrupted policy via xfrm: > > src ???/0 dst ???/0 uid 0 > socket in action allow index 2083 priority 0 ptype main share any &

Re: kernel BUG at net/key/af_key.c:LINE!

2017-11-09 Thread Herbert Xu
On Thu, Nov 09, 2017 at 10:38:57PM +1100, Herbert Xu wrote: > > The xfrm code path is meant to forbid the creation of such a policy. > I don't currently see how this is bypassing that check. But > clearly it has found a way through the check since it's crashing. By castrating th

  1   2   3   4   5   6   7   8   9   10   >