1. 11 10月, 2018 2 次提交
  2. 09 10月, 2018 35 次提交
  3. 08 10月, 2018 2 次提交
    • B
      xsk: proper AF_XDP socket teardown ordering · 541d7fdd
      Björn Töpel 提交于
      The AF_XDP socket struct can exist in three different, implicit
      states: setup, bound and released. Setup is prior the socket has been
      bound to a device. Bound is when the socket is active for receive and
      send. Released is when the process/userspace side of the socket is
      released, but the sock object is still lingering, e.g. when there is a
      reference to the socket in an XSKMAP after process termination.
      
      The Rx fast-path code uses the "dev" member of struct xdp_sock to
      check whether a socket is bound or relased, and the Tx code uses the
      struct xdp_umem "xsk_list" member in conjunction with "dev" to
      determine the state of a socket.
      
      However, the transition from bound to released did not tear the socket
      down in correct order.
      
      On the Rx side "dev" was cleared after synchronize_net() making the
      synchronization useless. On the Tx side, the internal queues were
      destroyed prior removing them from the "xsk_list".
      
      This commit corrects the cleanup order, and by doing so
      xdp_del_sk_umem() can be simplified and one synchronize_net() can be
      removed.
      
      Fixes: 965a9909 ("xsk: add support for bind for Rx")
      Fixes: ac98d8aa ("xsk: wire upp Tx zero-copy functions")
      Reported-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NBjörn Töpel <bjorn.topel@intel.com>
      Acked-by: NSong Liu <songliubraving@fb.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      541d7fdd
    • L
      net: sched: pie: fix coding style issues · ac4a02c5
      Leslie Monis 提交于
      Fix 5 warnings and 14 checks issued by checkpatch.pl:
      
      CHECK: Logical continuations should be on the previous line
      +	if ((q->vars.qdelay < q->params.target / 2)
      +	    && (q->vars.prob < MAX_PROB / 5))
      
      WARNING: line over 80 characters
      +		q->params.tupdate = usecs_to_jiffies(nla_get_u32(tb[TCA_PIE_TUPDATE]));
      
      CHECK: Blank lines aren't necessary after an open brace '{'
      +{
      +
      
      CHECK: braces {} should be used on all arms of this statement
      +			if (qlen < QUEUE_THRESHOLD)
      [...]
      +			else {
      [...]
      
      CHECK: Unbalanced braces around else statement
      +			else {
      
      CHECK: No space is necessary after a cast
      +	if (delta > (s32) (MAX_PROB / (100 / 2)) &&
      
      CHECK: Unnecessary parentheses around 'qdelay == 0'
      +	if ((qdelay == 0) && (qdelay_old == 0) && update_prob)
      
      CHECK: Unnecessary parentheses around 'qdelay_old == 0'
      +	if ((qdelay == 0) && (qdelay_old == 0) && update_prob)
      
      CHECK: Unnecessary parentheses around 'q->vars.prob == 0'
      +	if ((q->vars.qdelay < q->params.target / 2) &&
      +	    (q->vars.qdelay_old < q->params.target / 2) &&
      +	    (q->vars.prob == 0) &&
      +	    (q->vars.avg_dq_rate > 0))
      
      CHECK: Unnecessary parentheses around 'q->vars.avg_dq_rate > 0'
      +	if ((q->vars.qdelay < q->params.target / 2) &&
      +	    (q->vars.qdelay_old < q->params.target / 2) &&
      +	    (q->vars.prob == 0) &&
      +	    (q->vars.avg_dq_rate > 0))
      
      CHECK: Blank lines aren't necessary before a close brace '}'
      +
      +}
      
      CHECK: Comparison to NULL could be written "!opts"
      +	if (opts == NULL)
      
      CHECK: No space is necessary after a cast
      +			((u32) PSCHED_TICKS2NS(q->params.target)) /
      
      WARNING: line over 80 characters
      +	    nla_put_u32(skb, TCA_PIE_TUPDATE, jiffies_to_usecs(q->params.tupdate)) ||
      
      CHECK: Blank lines aren't necessary before a close brace '}'
      +
      +}
      
      CHECK: No space is necessary after a cast
      +		.delay		= ((u32) PSCHED_TICKS2NS(q->vars.qdelay)) /
      
      WARNING: Missing a blank line after declarations
      +	struct sk_buff *skb;
      +	skb = qdisc_dequeue_head(sch);
      
      WARNING: Missing a blank line after declarations
      +	struct pie_sched_data *q = qdisc_priv(sch);
      +	qdisc_reset_queue(sch);
      
      WARNING: Missing a blank line after declarations
      +	struct pie_sched_data *q = qdisc_priv(sch);
      +	q->params.tupdate = 0;
      Signed-off-by: NLeslie Monis <lesliemonis@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac4a02c5
  4. 06 10月, 2018 1 次提交