* Re: [PATCH mlx5-next] RDMA/mlx5: Don't use cached IRQ affinity mask
From: Steve Wise @ 2018-07-24 20:52 UTC (permalink / raw)
To: Max Gurtovoy, 'Sagi Grimberg', 'Leon Romanovsky'
Cc: 'Doug Ledford', 'Jason Gunthorpe',
'RDMA mailing list', 'Saeed Mahameed',
'linux-netdev'
In-Reply-To: <e32726b5-fbe5-178c-719e-8a71517977b0@opengridcomputing.com>
On 7/24/2018 10:24 AM, Steve Wise wrote:
>
> On 7/19/2018 8:25 PM, Max Gurtovoy wrote:
>>>>> [ 2032.194376] nvme nvme0: failed to connect queue: 9 ret=-18
>>>> queue 9 is not mapped (overlap).
>>>> please try the bellow:
>>>>
>>> This seems to work. Here are three mapping cases: each vector on its
>>> own cpu, each vector on 1 cpu within the local numa node, and each
>>> vector having all cpus in its numa node. The 2nd mapping looks kinda
>>> funny, but I think it achieved what you wanted? And all the cases
>>> resulted in successful connections.
>>>
>> Thanks for testing this.
>> I slightly improved the setting of the left CPUs and actually used
>> Sagi's initial proposal.
>>
>> Sagi,
>> please review the attached patch and let me know if I should add your
>> signature on it.
>> I'll run some perf test early next week on it (meanwhile I run
>> login/logout with different num_queues successfully and irq settings).
>>
>> Steve,
>> It will be great if you can apply the attached in your system and send
>> your findings.
> Sorry, I got side tracked. I'll try and test this today and report back.
>
> Steve.
### each vector gets a unique cpu, starting with node-local:
[ 754.976577] iw_cxgb4: comp_vector 0, irq 203 mask 0x100
[ 754.982378] iw_cxgb4: comp_vector 1, irq 204 mask 0x200
[ 754.988167] iw_cxgb4: comp_vector 2, irq 205 mask 0x400
[ 754.993935] iw_cxgb4: comp_vector 3, irq 206 mask 0x800
[ 754.999686] iw_cxgb4: comp_vector 4, irq 207 mask 0x1000
[ 755.005509] iw_cxgb4: comp_vector 5, irq 208 mask 0x2000
[ 755.011318] iw_cxgb4: comp_vector 6, irq 209 mask 0x4000
[ 755.017124] iw_cxgb4: comp_vector 7, irq 210 mask 0x8000
[ 755.022915] iw_cxgb4: comp_vector 8, irq 211 mask 0x1
[ 755.028437] iw_cxgb4: comp_vector 9, irq 212 mask 0x2
[ 755.033948] iw_cxgb4: comp_vector 10, irq 213 mask 0x4
[ 755.039543] iw_cxgb4: comp_vector 11, irq 214 mask 0x8
[ 755.045135] iw_cxgb4: comp_vector 12, irq 215 mask 0x10
[ 755.050801] iw_cxgb4: comp_vector 13, irq 216 mask 0x20
[ 755.056464] iw_cxgb4: comp_vector 14, irq 217 mask 0x40
[ 755.062117] iw_cxgb4: comp_vector 15, irq 218 mask 0x80
[ 755.067767] blk_mq_rdma_map_queues: set->mq_map[0] queue 8 vector 8
[ 755.067767] blk_mq_rdma_map_queues: set->mq_map[1] queue 9 vector 9
[ 755.067768] blk_mq_rdma_map_queues: set->mq_map[2] queue 10 vector 10
[ 755.067769] blk_mq_rdma_map_queues: set->mq_map[3] queue 11 vector 11
[ 755.067769] blk_mq_rdma_map_queues: set->mq_map[4] queue 12 vector 12
[ 755.067770] blk_mq_rdma_map_queues: set->mq_map[5] queue 13 vector 13
[ 755.067771] blk_mq_rdma_map_queues: set->mq_map[6] queue 14 vector 14
[ 755.067772] blk_mq_rdma_map_queues: set->mq_map[7] queue 15 vector 15
[ 755.067772] blk_mq_rdma_map_queues: set->mq_map[8] queue 0 vector 0
[ 755.067773] blk_mq_rdma_map_queues: set->mq_map[9] queue 1 vector 1
[ 755.067774] blk_mq_rdma_map_queues: set->mq_map[10] queue 2 vector 2
[ 755.067774] blk_mq_rdma_map_queues: set->mq_map[11] queue 3 vector 3
[ 755.067775] blk_mq_rdma_map_queues: set->mq_map[12] queue 4 vector 4
[ 755.067775] blk_mq_rdma_map_queues: set->mq_map[13] queue 5 vector 5
[ 755.067776] blk_mq_rdma_map_queues: set->mq_map[14] queue 6 vector 6
[ 755.067777] blk_mq_rdma_map_queues: set->mq_map[15] queue 7 vector 7
### each vector gets one cpu within the local node:
[ 777.590913] iw_cxgb4: comp_vector 0, irq 203 mask 0x400
[ 777.596588] iw_cxgb4: comp_vector 1, irq 204 mask 0x800
[ 777.602249] iw_cxgb4: comp_vector 2, irq 205 mask 0x1000
[ 777.607984] iw_cxgb4: comp_vector 3, irq 206 mask 0x2000
[ 777.613708] iw_cxgb4: comp_vector 4, irq 207 mask 0x4000
[ 777.619431] iw_cxgb4: comp_vector 5, irq 208 mask 0x8000
[ 777.625142] iw_cxgb4: comp_vector 6, irq 209 mask 0x100
[ 777.630762] iw_cxgb4: comp_vector 7, irq 210 mask 0x200
[ 777.636373] iw_cxgb4: comp_vector 8, irq 211 mask 0x400
[ 777.641982] iw_cxgb4: comp_vector 9, irq 212 mask 0x800
[ 777.647583] iw_cxgb4: comp_vector 10, irq 213 mask 0x1000
[ 777.653353] iw_cxgb4: comp_vector 11, irq 214 mask 0x2000
[ 777.659119] iw_cxgb4: comp_vector 12, irq 215 mask 0x4000
[ 777.664877] iw_cxgb4: comp_vector 13, irq 216 mask 0x8000
[ 777.670628] iw_cxgb4: comp_vector 14, irq 217 mask 0x100
[ 777.676289] iw_cxgb4: comp_vector 15, irq 218 mask 0x200
[ 777.681946] blk_mq_rdma_map_queues: set->mq_map[0] queue 8 vector 8
[ 777.681947] blk_mq_rdma_map_queues: set->mq_map[1] queue 9 vector 9
[ 777.681947] blk_mq_rdma_map_queues: set->mq_map[2] queue 10 vector 10
[ 777.681948] blk_mq_rdma_map_queues: set->mq_map[3] queue 11 vector 11
[ 777.681948] blk_mq_rdma_map_queues: set->mq_map[4] queue 12 vector 12
[ 777.681949] blk_mq_rdma_map_queues: set->mq_map[5] queue 13 vector 13
[ 777.681950] blk_mq_rdma_map_queues: set->mq_map[6] queue 14 vector 14
[ 777.681950] blk_mq_rdma_map_queues: set->mq_map[7] queue 15 vector 15
[ 777.681951] blk_mq_rdma_map_queues: set->mq_map[8] queue 6 vector 6
[ 777.681952] blk_mq_rdma_map_queues: set->mq_map[9] queue 7 vector 7
[ 777.681952] blk_mq_rdma_map_queues: set->mq_map[10] queue 0 vector 0
[ 777.681953] blk_mq_rdma_map_queues: set->mq_map[11] queue 1 vector 1
[ 777.681953] blk_mq_rdma_map_queues: set->mq_map[12] queue 2 vector 2
[ 777.681954] blk_mq_rdma_map_queues: set->mq_map[13] queue 3 vector 3
[ 777.681955] blk_mq_rdma_map_queues: set->mq_map[14] queue 4 vector 4
[ 777.681955] blk_mq_rdma_map_queues: set->mq_map[15] queue 5 vector 5
### each vector gets all cpus within the local node:
[ 838.251643] iw_cxgb4: comp_vector 0, irq 203 mask 0xff00
[ 838.257346] iw_cxgb4: comp_vector 1, irq 204 mask 0xff00
[ 838.263038] iw_cxgb4: comp_vector 2, irq 205 mask 0xff00
[ 838.268710] iw_cxgb4: comp_vector 3, irq 206 mask 0xff00
[ 838.274351] iw_cxgb4: comp_vector 4, irq 207 mask 0xff00
[ 838.279985] iw_cxgb4: comp_vector 5, irq 208 mask 0xff00
[ 838.285610] iw_cxgb4: comp_vector 6, irq 209 mask 0xff00
[ 838.291234] iw_cxgb4: comp_vector 7, irq 210 mask 0xff00
[ 838.296865] iw_cxgb4: comp_vector 8, irq 211 mask 0xff00
[ 838.302484] iw_cxgb4: comp_vector 9, irq 212 mask 0xff00
[ 838.308109] iw_cxgb4: comp_vector 10, irq 213 mask 0xff00
[ 838.313827] iw_cxgb4: comp_vector 11, irq 214 mask 0xff00
[ 838.319539] iw_cxgb4: comp_vector 12, irq 215 mask 0xff00
[ 838.325250] iw_cxgb4: comp_vector 13, irq 216 mask 0xff00
[ 838.330963] iw_cxgb4: comp_vector 14, irq 217 mask 0xff00
[ 838.336674] iw_cxgb4: comp_vector 15, irq 218 mask 0xff00
[ 838.342385] blk_mq_rdma_map_queues: set->mq_map[0] queue 8 vector 8
[ 838.342385] blk_mq_rdma_map_queues: set->mq_map[1] queue 9 vector 9
[ 838.342386] blk_mq_rdma_map_queues: set->mq_map[2] queue 10 vector 10
[ 838.342387] blk_mq_rdma_map_queues: set->mq_map[3] queue 11 vector 11
[ 838.342387] blk_mq_rdma_map_queues: set->mq_map[4] queue 12 vector 12
[ 838.342388] blk_mq_rdma_map_queues: set->mq_map[5] queue 13 vector 13
[ 838.342389] blk_mq_rdma_map_queues: set->mq_map[6] queue 14 vector 14
[ 838.342390] blk_mq_rdma_map_queues: set->mq_map[7] queue 15 vector 15
[ 838.342391] blk_mq_rdma_map_queues: set->mq_map[8] queue 0 vector 0
[ 838.342391] blk_mq_rdma_map_queues: set->mq_map[9] queue 1 vector 1
[ 838.342392] blk_mq_rdma_map_queues: set->mq_map[10] queue 2 vector 2
[ 838.342392] blk_mq_rdma_map_queues: set->mq_map[11] queue 3 vector 3
[ 838.342393] blk_mq_rdma_map_queues: set->mq_map[12] queue 4 vector 4
[ 838.342394] blk_mq_rdma_map_queues: set->mq_map[13] queue 5 vector 5
[ 838.342394] blk_mq_rdma_map_queues: set->mq_map[14] queue 6 vector 6
[ 838.342395] blk_mq_rdma_map_queues: set->mq_map[15] queue 7 vector 7
^ permalink raw reply
* Re: [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.
From: Cong Wang @ 2018-07-24 20:50 UTC (permalink / raw)
To: Paolo Abeni
Cc: Linux Kernel Network Developers, Jamal Hadi Salim, Jiri Pirko,
Daniel Borkmann, Marcelo Ricardo Leitner, Eyal Birger,
David Miller
In-Reply-To: <CAM_iQpUHjoohcMgXd8y9GVn8hdFwMRGJeCJ5wSfphModf0qZ-A@mail.gmail.com>
On Tue, Jul 24, 2018 at 1:38 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>
> On Tue, Jul 24, 2018 at 1:07 PM Paolo Abeni <pabeni@redhat.com> wrote:
> > +static inline void skb_tc_reinject(struct sk_buff *skb, struct tcf_result *res)
> > +{
> > + struct gnet_stats_queue *stats = res->qstats;
> > + int ret;
> > +
> > + if (res->ingress)
> > + ret = netif_receive_skb(skb);
> > + else
> > + ret = dev_queue_xmit(skb);
> > + if (ret && stats)
> > + qstats_overlimit_inc(res->qstats);
>
> Why increasing overlimit? Overlimit is typically increased
> by traffic shapers to indicate there is no bandwidth to send
> out the packet.
>
> I fail to understand why overlimit is increased in your case
> here. I guess you want to increase 'drops' instead.
Hmm, actually the current mirred code increases overlimit too.
But I still don't think it makes sense.
^ permalink raw reply
* Re: [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.
From: Cong Wang @ 2018-07-24 20:38 UTC (permalink / raw)
To: Paolo Abeni
Cc: Linux Kernel Network Developers, Jamal Hadi Salim, Jiri Pirko,
Daniel Borkmann, Marcelo Ricardo Leitner, Eyal Birger,
David Miller
In-Reply-To: <3c20787be0fd5d64728ffed46ae0a7dff10d7e05.1532437050.git.pabeni@redhat.com>
On Tue, Jul 24, 2018 at 1:07 PM Paolo Abeni <pabeni@redhat.com> wrote:
> +static inline void skb_tc_reinject(struct sk_buff *skb, struct tcf_result *res)
> +{
> + struct gnet_stats_queue *stats = res->qstats;
> + int ret;
> +
> + if (res->ingress)
> + ret = netif_receive_skb(skb);
> + else
> + ret = dev_queue_xmit(skb);
> + if (ret && stats)
> + qstats_overlimit_inc(res->qstats);
Why increasing overlimit? Overlimit is typically increased
by traffic shapers to indicate there is no bandwidth to send
out the packet.
I fail to understand why overlimit is increased in your case
here. I guess you want to increase 'drops' instead.
^ permalink raw reply
* Re: [RFC PATCH ghak90 (was ghak32) V3 05/10] audit: add containerid support for tty_audit
From: Paul Moore @ 2018-07-24 20:36 UTC (permalink / raw)
To: rgb
Cc: cgroups, containers, linux-api, linux-audit, linux-fsdevel,
linux-kernel, netdev, ebiederm, luto, jlayton, carlos, dhowells,
viro, simo, Eric Paris, serge
In-Reply-To: <20180724140721.yyi5e7y3czxsjwug@madcap2.tricolour.ca>
On Tue, Jul 24, 2018 at 10:10 AM Richard Guy Briggs <rgb@redhat.com> wrote:
> On 2018-07-20 18:14, Paul Moore wrote:
> > On Wed, Jun 6, 2018 at 1:04 PM Richard Guy Briggs <rgb@redhat.com> wrote:
> > > Add audit container identifier auxiliary record to tty logging rule
> > > event standalone records.
> > >
> > > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > > ---
> > > drivers/tty/tty_audit.c | 5 ++++-
> > > 1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
> > > index e30aa6b..66bd850 100644
> > > --- a/drivers/tty/tty_audit.c
> > > +++ b/drivers/tty/tty_audit.c
> > > @@ -66,8 +66,9 @@ static void tty_audit_log(const char *description, dev_t dev,
> > > uid_t uid = from_kuid(&init_user_ns, task_uid(tsk));
> > > uid_t loginuid = from_kuid(&init_user_ns, audit_get_loginuid(tsk));
> > > unsigned int sessionid = audit_get_sessionid(tsk);
> > > + struct audit_context *context = audit_alloc_local();
> >
> > We should be using current's audit_context in tty_audit_log().
> > Actually, we should probably just get rid of the tsk variable in
> > tty_audit_log() and use current directly to make things a bit more
> > obvious.
>
> Ok, agreed. At this point, it it current passed in anyways so no harm
> other than efficiency.
>
> > <time passes>
> >
> > I did some digging and I have a two year old, half-baked patch that
> > cleans up this tsk/current usage as well as a few others. I just
> > rebased it against audit/next and surprisingly it seems to pass a
> > basic smoke test (kernel boots and audit-testsuite passes); I'll post
> > it to the list as a RFC once I'm done reviewing these patches.
>
> I'll leave this patch the way it is since there should be no difference
> and trust this other patch will work its way through the system and
> solve that.
Yep, that's a merge issue I'll deal with when we get to that point.
Although, I would expect that when you post an updated patchset that
it applies cleanly to the then-current audit/next tree (or Linus'
tree, but audit/next is preferable). In other words, please rebase
your development branch before doing your final dev testing and
posting.
> > > - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_TTY);
> > > + ab = audit_log_start(context, GFP_KERNEL, AUDIT_TTY);
> > > if (ab) {
> > > char name[sizeof(tsk->comm)];
> > >
> > > @@ -80,6 +81,8 @@ static void tty_audit_log(const char *description, dev_t dev,
> > > audit_log_n_hex(ab, data, size);
> > > audit_log_end(ab);
> > > }
> > > + audit_log_contid(context, "tty", audit_get_contid(tsk));
> > > + audit_free_context(context);
> > > }
> >
> > --
> > paul moore
> > www.paul-moore.com
>
> - RGB
>
> --
> Richard Guy Briggs <rgb@redhat.com>
> Sr. S/W Engineer, Kernel Security, Base Operating Systems
> Remote, Ottawa, Red Hat Canada
> IRC: rgb, SunRaycer
> Voice: +1.647.777.2635, Internal: (81) 32635
--
paul moore
www.paul-moore.com
^ permalink raw reply
* Re: [PATCH rdma-next v2 0/8] Support mlx5 flow steering with RAW data
From: Jason Gunthorpe @ 2018-07-24 20:35 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Doug Ledford, RDMA mailing list, Yishai Hadas, Saeed Mahameed,
linux-netdev
In-Reply-To: <20180724201300.GQ532@ziepe.ca>
On Tue, Jul 24, 2018 at 02:13:00PM -0600, Jason Gunthorpe wrote:
> diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> index 5f08b69f8a4f60..ec8410d3c4eb2a 100644
> +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> @@ -1232,11 +1232,9 @@ int mlx5_ib_devx_create(struct mlx5_ib_dev *dev,
> void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev,
> struct mlx5_ib_ucontext *context);
> const struct uverbs_object_tree_def *mlx5_ib_get_devx_tree(void);
> -struct mlx5_ib_flow_handler *mlx5_ib_raw_fs_rule_add(struct mlx5_ib_dev *dev,
> - struct mlx5_ib_flow_matcher *fs_matcher,
> - void *cmd_in,
> - int inlen, int dest_id,
> - int dest_type);
> +struct mlx5_ib_flow_handler *mlx5_ib_raw_fs_rule_add(
> + struct mlx5_ib_dev *dev, struct mlx5_ib_flow_matcher *fs_matcher,
> + void *cmd_in, int inlen, int dest_id, int dest_type);
> bool mlx5_ib_devx_is_flow_dest(void *obj, int *dest_id, int *dest_type);
> int mlx5_ib_get_flow_trees(const struct uverbs_object_tree_def **root);
> #else
> @@ -1247,17 +1245,22 @@ static inline void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev,
> struct mlx5_ib_ucontext *context) {}
> static inline const struct uverbs_object_tree_def *
> mlx5_ib_get_devx_tree(void) { return NULL; }
> -static inline struct mlx5_ib_flow_handler *
> -mlx5_ib_raw_fs_rule_add(struct mlx5_ib_dev *dev,
> - struct mlx5_ib_flow_matcher *fs_matcher,
> - void *cmd_in,
> - int inlen, int dest_id,
> - int dest_type) { return -EOPNOTSUPP; };
> -static inline bool
> -mlx5_ib_devx_is_flow_dest(void *obj, int *dest_id,
> - int *dest_type) { return false; };
> +static inline struct mlx5_ib_flow_handler *mlx5_ib_raw_fs_rule_add(
> + struct mlx5_ib_dev *dev, struct mlx5_ib_flow_matcher *fs_matcher,
> + void *cmd_in, int inlen, int dest_id, int dest_type)
> +{
> + return ERR_PTR(-EOPNOTSUPP);
> +}
Bah, I botched the compile test for this - this entire static inline
should just be removed because the function is defined in main.c which
is always compiled.
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index ec8410d3c4eb2a..462505c8fa25a0 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -1245,12 +1245,6 @@ static inline void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev,
struct mlx5_ib_ucontext *context) {}
static inline const struct uverbs_object_tree_def *
mlx5_ib_get_devx_tree(void) { return NULL; }
-static inline struct mlx5_ib_flow_handler *mlx5_ib_raw_fs_rule_add(
- struct mlx5_ib_dev *dev, struct mlx5_ib_flow_matcher *fs_matcher,
- void *cmd_in, int inlen, int dest_id, int dest_type)
-{
- return ERR_PTR(-EOPNOTSUPP);
-}
static inline bool mlx5_ib_devx_is_flow_dest(void *obj, int *dest_id,
int *dest_type)
{
Jason
^ permalink raw reply related
* Re: [RFC PATCH ghak90 (was ghak32) V3 07/10] audit: add support for containerid to network namespaces
From: Paul Moore @ 2018-07-24 20:33 UTC (permalink / raw)
To: rgb
Cc: cgroups, containers, linux-api, linux-audit, linux-fsdevel,
linux-kernel, netdev, ebiederm, luto, jlayton, carlos, dhowells,
viro, simo, Eric Paris, serge
In-Reply-To: <20180724140309.i6o2yjdoif5krxtw@madcap2.tricolour.ca>
On Tue, Jul 24, 2018 at 10:06 AM Richard Guy Briggs <rgb@redhat.com> wrote:
> On 2018-07-20 18:14, Paul Moore wrote:
> > On Wed, Jun 6, 2018 at 1:03 PM Richard Guy Briggs <rgb@redhat.com> wrote:
> > > Audit events could happen in a network namespace outside of a task
> > > context due to packets received from the net that trigger an auditing
> > > rule prior to being associated with a running task. The network
> > > namespace could in use by multiple containers by association to the
> > > tasks in that network namespace. We still want a way to attribute
> > > these events to any potential containers. Keep a list per network
> > > namespace to track these audit container identifiiers.
> > >
> > > Add/increment the audit container identifier on:
> > > - initial setting of the audit container identifier via /proc
> > > - clone/fork call that inherits an audit container identifier
> > > - unshare call that inherits an audit container identifier
> > > - setns call that inherits an audit container identifier
> > > Delete/decrement the audit container identifier on:
> > > - an inherited audit container identifier dropped when child set
> > > - process exit
> > > - unshare call that drops a net namespace
> > > - setns call that drops a net namespace
> > >
> > > See: https://github.com/linux-audit/audit-kernel/issues/92
> > > See: https://github.com/linux-audit/audit-testsuite/issues/64
> > > See: https://github.com/linux-audit/audit-kernel/wiki/RFE-Audit-Container-ID
> > > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > > ---
> > > include/linux/audit.h | 23 ++++++++++++++++
> > > kernel/audit.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > > kernel/auditsc.c | 5 ++++
> > > kernel/nsproxy.c | 4 +++
> > > 4 files changed, 104 insertions(+)
...
> > > + }
> > > + if (!found)
> > > + return;
> > > + list_del(&cont->list);
> > > + if (refcount_dec_and_test(&cont->refcount))
> > > + kfree(cont);
> >
> > Don't you want to dec_and_test first and only remove it from the list
> > if there are no other references?
>
> I don't think so. Let me try to describe it in prose to see if I
> understood this properly and see if this makes more sense: I want to
> remove this audit_contid list member from this net's audit_contid list
> and decrement unconditionally this member's refcount so it knows there
> is one less thing pointing at it and when there is no longer anything
> pointing at it, free it.
Yep, sorry, my mistake, I was thinking the other way around (netns
going away) ... which actually, this patchset doesn't handle that does
it (I don't see any new code in audit_net_exit())? Is is in a later
patch? If so, it really should be in the same patch as this code to
prevent bisect nasties.
--
paul moore
www.paul-moore.com
^ permalink raw reply
* [PATCH net] r8169: restore previous behavior to accept BIOS WoL settings
From: Heiner Kallweit @ 2018-07-24 20:21 UTC (permalink / raw)
To: David Miller, Realtek linux nic maintainers
Cc: netdev@vger.kernel.org, Albert Astals Cid
Commit 7edf6d314cd0 tried to resolve an inconsistency (BIOS WoL
settings are accepted, but device isn't wakeup-enabled) resulting
from a previous broken-BIOS workaround by making disabled WoL the
default.
This however had some side effects, most likely due to a broken BIOS
some systems don't properly resume from suspend when the MagicPacket
WoL bit isn't set in the chip, see
https://bugzilla.kernel.org/show_bug.cgi?id=200195
Therefore restore the WoL behavior from 4.16.
Reported-by: Albert Astals Cid <aacid@kde.org>
Fixes: 7edf6d314cd0 ("r8169: disable WOL per default")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
This patch will cause a trivial merge conflict when merging net
to net-next.
---
drivers/net/ethernet/realtek/r8169.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index a3f69901..eaedc11e 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7734,8 +7734,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return rc;
}
- /* override BIOS settings, use userspace tools to enable WOL */
- __rtl8169_set_wol(tp, 0);
+ tp->saved_wolopts = __rtl8169_get_wol(tp);
if (rtl_tbi_enabled(tp)) {
tp->set_speed = rtl8169_set_speed_tbi;
--
2.18.0
^ permalink raw reply related
* Re: [PATCH net-next] tls: Fix improper revert in zerocopy_from_iter
From: Doron Roberts-Kedes @ 2018-07-24 20:19 UTC (permalink / raw)
To: Vakul Garg
Cc: David S . Miller, Dave Watson, Matt Mullins,
netdev@vger.kernel.org
In-Reply-To: <DB7PR04MB42523A802248A05DCD6A28CE8B550@DB7PR04MB4252.eurprd04.prod.outlook.com>
On Tue, Jul 24, 2018 at 05:13:26AM +0000, Vakul Garg wrote:
>
> > -----Original Message-----
> > From: Doron Roberts-Kedes [mailto:doronrk@fb.com]
> > Sent: Tuesday, July 24, 2018 3:50 AM
> > @@ -811,6 +809,7 @@ int tls_sw_recvmsg(struct sock *sk,
> > likely(!(flags & MSG_PEEK))) {
> > struct scatterlist sgin[MAX_SKB_FRAGS + 1];
> > int pages = 0;
> > + int orig_chunk = chunk;
> >
> > zc = true;
> > sg_init_table(sgin, MAX_SKB_FRAGS + 1);
> > @@ -820,9 +819,11 @@ int tls_sw_recvmsg(struct sock *sk,
> > err = zerocopy_from_iter(sk, &msg-
> > >msg_iter,
> > to_copy, &pages,
> > &chunk, &sgin[1],
> > - MAX_SKB_FRAGS,
> > false, true);
> > - if (err < 0)
> > + MAX_SKB_FRAGS,
> > false);
> > + if (err < 0) {
> > + iov_iter_revert(&msg->msg_iter,
> > chunk - orig_chunk);
> > goto fallback_to_reg_recv;
> > + }
>
> This assumes that msg_iter gets advanced even if zerocopy_from_iter() fails.
Not sure I see what you mean. If msg_iter is not advanced then chunk -
orig_chunk is 0, and the revert is a no-op.
> It is easier from code readability perspective if functions upon failure do not leave any side effects for the caller to clean-up.
> I suggest that iov_iter_revert() should be called from zerocopy_from_iter() itself if it is going to fail.
Agreed that zerocopy_from_iter() should call iov_iter_revert(). I didn't
do that because at first glace, the tx path seems to depend on the
iov_iter_revert() being called as a result of either failed
zerocopy_from_iter() or tls_push_record(). However, I think the latter path
cannot actually be taken because tls_push_record appears never to return
a positive value. This means that the code between
the continue and fallback_to_reg_send should probably just be replaced
with simply, goto send_end.
After that change, its clear that iov_iter_revert() can be safely moved
inside zerocopy_from_iter() in the error case.
Pending your input, I'll plan on putting up a 2 part patch addressing
each of these.
^ permalink raw reply
* Re: [PATCH rdma-next v2 0/8] Support mlx5 flow steering with RAW data
From: Jason Gunthorpe @ 2018-07-24 20:13 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Doug Ledford, RDMA mailing list, Yishai Hadas, Saeed Mahameed,
linux-netdev
In-Reply-To: <20180724055609.GG3189@mtr-leonro.mtl.com>
On Tue, Jul 24, 2018 at 08:56:09AM +0300, Leon Romanovsky wrote:
> On Mon, Jul 23, 2018 at 08:42:36PM -0600, Jason Gunthorpe wrote:
> > On Mon, Jul 23, 2018 at 03:25:04PM +0300, Leon Romanovsky wrote:
> > > From: Leon Romanovsky <leonro@mellanox.com>
> > >
> > > Changelog:
> > > v1->v2:
> > > * Fix matcher to use the correct size.
> > > * Rephrase commit log of the first patch.
> > > v0->v1:
> > > * Fixed ADD_UVERBS_ATTRIBUTES_SIMPLE macro to pass the real address.
> > > ?* Replaced UA_ALLOC_AND_COPY to regular copy_from
> > > * Added UVERBS_ATTR_NO_DATA new macro for cleaner code.
> > > * Used ib_dev from uobj when it exists.
> > > * ib_is_destroy_retryable was replaced by ib_destroy_usecnt
> > >
> > > >From Yishai:
> > >
> > > This series introduces vendor create and destroy flow methods on the
> > > uverbs flow object by using the KABI infra-structure.
> > >
> > > It's done in a way that enables the driver to get its specific device
> > > attributes in a raw data to match its underlay specification while still
> > > using the generic ib_flow object for cleanup and code sharing.
> > >
> > > In addition, a specific mlx5 matcher object and its create/destroy
> > > methods were introduced. This object matches the underlay flow steering
> > > mask specification and is used as part of mlx5 create flow input data.
> > >
> > > This series supports IB_QP/TIR as its flow steering destination as
> > > applicable today via the ib_create_flow API, however, it adds also an
> > > option to work with DEVX object which its destination can be both TIR
> > > and flow table.
> > >
> > > Few changes were done in the mlx5 core layer to support forward
> > > compatible for the device specification raw data and to support flow
> > > table when the DEVX destination is used.
> > >
> > > As part of this series the default IB destroy handler
> > > (i.e. uverbs_destroy_def_handler()) was exposed from IB core to be
> > > used by the drivers and existing code was refactored to use it.
> > >
> > > Thanks
> > >
> > > Yishai Hadas (8):
> > > net/mlx5: Add forward compatible support for the FTE match data
> > > net/mlx5: Add support for flow table destination number
> > > IB/mlx5: Introduce flow steering matcher object
> > > IB: Consider ib_flow creation by the KABI infrastructure
> > > IB/mlx5: Introduce vendor create and destroy flow methods
> > > IB/mlx5: Support adding flow steering rule by raw data
> > > IB/mlx5: Add support for a flow table destination
> > > IB/mlx5: Expose vendor flow trees
> >
> > This seems fine to me. Can you send the mlx5 shared branch for the
> > first two patches?
>
> I applied two first patches with Acked-by from Saeed to mlx5-next
>
> 664000b6bb43 net/mlx5: Add support for flow table destination number
> 2aada6c0c96e net/mlx5: Add forward compatible support for the FTE match data
Okay, I merged the mlx5 branch and applied the series to for-next.
There was a trivial build failure with !CONFIG_INFINIBAND_USER_ACCESS
and a bunch of annoying check patch warnings regarding tabs and
leading white space. While I was fixing those I fixed the long lines
too, they had no reason to be long.
Also, I would like to keep the specs consistently formatted according
to clang-format with 'BinPackParameters: true', so I reflowed them as
well.
Please check and let me know if I made an error, diff is below.
Jason
diff --git a/drivers/infiniband/hw/mlx5/flow.c b/drivers/infiniband/hw/mlx5/flow.c
index c94ee1a43e2c3f..ee398a9b5f26b0 100644
--- a/drivers/infiniband/hw/mlx5/flow.c
+++ b/drivers/infiniband/hw/mlx5/flow.c
@@ -50,8 +50,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)(
int inlen;
bool dest_devx, dest_qp;
struct ib_qp *qp = NULL;
- struct ib_uobject *uobj = uverbs_attr_get_uobject(attrs,
- MLX5_IB_ATTR_CREATE_FLOW_HANDLE);
+ struct ib_uobject *uobj =
+ uverbs_attr_get_uobject(attrs, MLX5_IB_ATTR_CREATE_FLOW_HANDLE);
struct mlx5_ib_dev *dev = to_mdev(uobj->context->device);
if (!capable(CAP_NET_RAW))
@@ -66,7 +66,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)(
return -EINVAL;
if (dest_devx) {
- devx_obj = uverbs_attr_get_obj(attrs, MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX);
+ devx_obj = uverbs_attr_get_obj(
+ attrs, MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX);
if (IS_ERR(devx_obj))
return PTR_ERR(devx_obj);
@@ -97,8 +98,8 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)(
if (dev->rep)
return -ENOTSUPP;
- cmd_in = uverbs_attr_get_alloced_ptr(attrs,
- MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE);
+ cmd_in = uverbs_attr_get_alloced_ptr(
+ attrs, MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE);
inlen = uverbs_attr_get_len(attrs,
MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE);
fs_matcher = uverbs_attr_get_obj(attrs,
@@ -127,9 +128,9 @@ static int flow_matcher_cleanup(struct ib_uobject *uobject,
return 0;
}
-static int UVERBS_HANDLER(MLX5_IB_METHOD_FLOW_MATCHER_CREATE)(struct ib_device *ib_dev,
- struct ib_uverbs_file *file,
- struct uverbs_attr_bundle *attrs)
+static int UVERBS_HANDLER(MLX5_IB_METHOD_FLOW_MATCHER_CREATE)(
+ struct ib_device *ib_dev, struct ib_uverbs_file *file,
+ struct uverbs_attr_bundle *attrs)
{
struct ib_uobject *uobj = uverbs_attr_get_uobject(
attrs, MLX5_IB_ATTR_FLOW_MATCHER_CREATE_HANDLE);
@@ -141,16 +142,16 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_FLOW_MATCHER_CREATE)(struct ib_device *
if (!obj)
return -ENOMEM;
- obj->mask_len = uverbs_attr_get_len(attrs,
- MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK);
+ obj->mask_len = uverbs_attr_get_len(
+ attrs, MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK);
err = uverbs_copy_from(&obj->matcher_mask,
attrs,
MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK);
if (err)
goto end;
- obj->flow_type = uverbs_attr_get_enum_id(attrs,
- MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE);
+ obj->flow_type = uverbs_attr_get_enum_id(
+ attrs, MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE);
if (obj->flow_type == MLX5_IB_FLOW_TYPE_NORMAL) {
err = uverbs_copy_from(&obj->priority,
@@ -182,21 +183,22 @@ DECLARE_UVERBS_NAMED_METHOD(
UVERBS_OBJECT_FLOW,
UVERBS_ACCESS_NEW,
UA_MANDATORY),
- UVERBS_ATTR_PTR_IN(MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE,
- UVERBS_ATTR_SIZE(1, sizeof(struct mlx5_ib_match_params)),
- UA_MANDATORY,
- UA_ALLOC_AND_COPY),
+ UVERBS_ATTR_PTR_IN(
+ MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE,
+ UVERBS_ATTR_SIZE(1, sizeof(struct mlx5_ib_match_params)),
+ UA_MANDATORY,
+ UA_ALLOC_AND_COPY),
UVERBS_ATTR_IDR(MLX5_IB_ATTR_CREATE_FLOW_MATCHER,
MLX5_IB_OBJECT_FLOW_MATCHER,
UVERBS_ACCESS_READ,
UA_MANDATORY),
- UVERBS_ATTR_IDR(MLX5_IB_ATTR_CREATE_FLOW_DEST_QP, UVERBS_OBJECT_QP,
+ UVERBS_ATTR_IDR(MLX5_IB_ATTR_CREATE_FLOW_DEST_QP,
+ UVERBS_OBJECT_QP,
UVERBS_ACCESS_READ),
UVERBS_ATTR_IDR(MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX,
MLX5_IB_OBJECT_DEVX_OBJ,
UVERBS_ACCESS_READ));
-
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
MLX5_IB_METHOD_DESTROY_FLOW,
UVERBS_ATTR_IDR(MLX5_IB_ATTR_CREATE_FLOW_HANDLE,
@@ -212,36 +214,34 @@ ADD_UVERBS_METHODS(mlx5_ib_fs,
DECLARE_UVERBS_NAMED_METHOD(
MLX5_IB_METHOD_FLOW_MATCHER_CREATE,
UVERBS_ATTR_IDR(MLX5_IB_ATTR_FLOW_MATCHER_CREATE_HANDLE,
- MLX5_IB_OBJECT_FLOW_MATCHER,
- UVERBS_ACCESS_NEW,
- UA_MANDATORY),
+ MLX5_IB_OBJECT_FLOW_MATCHER,
+ UVERBS_ACCESS_NEW,
+ UA_MANDATORY),
UVERBS_ATTR_PTR_IN(
MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK,
UVERBS_ATTR_SIZE(1, sizeof(struct mlx5_ib_match_params)),
UA_MANDATORY),
- UVERBS_ATTR_ENUM_IN(
- MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE,
- mlx5_ib_flow_type,
- UA_MANDATORY),
- UVERBS_ATTR_PTR_IN(
- MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
- UVERBS_ATTR_TYPE(u8),
- UA_MANDATORY));
+ UVERBS_ATTR_ENUM_IN(MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE,
+ mlx5_ib_flow_type,
+ UA_MANDATORY),
+ UVERBS_ATTR_PTR_IN(MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
+ UVERBS_ATTR_TYPE(u8),
+ UA_MANDATORY));
DECLARE_UVERBS_NAMED_METHOD_DESTROY(
MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,
UVERBS_ATTR_IDR(MLX5_IB_ATTR_FLOW_MATCHER_DESTROY_HANDLE,
- MLX5_IB_OBJECT_FLOW_MATCHER,
- UVERBS_ACCESS_DESTROY,
- UA_MANDATORY));
+ MLX5_IB_OBJECT_FLOW_MATCHER,
+ UVERBS_ACCESS_DESTROY,
+ UA_MANDATORY));
DECLARE_UVERBS_NAMED_OBJECT(MLX5_IB_OBJECT_FLOW_MATCHER,
- UVERBS_TYPE_ALLOC_IDR(flow_matcher_cleanup),
- &UVERBS_METHOD(MLX5_IB_METHOD_FLOW_MATCHER_CREATE),
- &UVERBS_METHOD(MLX5_IB_METHOD_FLOW_MATCHER_DESTROY));
+ UVERBS_TYPE_ALLOC_IDR(flow_matcher_cleanup),
+ &UVERBS_METHOD(MLX5_IB_METHOD_FLOW_MATCHER_CREATE),
+ &UVERBS_METHOD(MLX5_IB_METHOD_FLOW_MATCHER_DESTROY));
DECLARE_UVERBS_OBJECT_TREE(flow_objects,
- &UVERBS_OBJECT(MLX5_IB_OBJECT_FLOW_MATCHER));
+ &UVERBS_OBJECT(MLX5_IB_OBJECT_FLOW_MATCHER));
int mlx5_ib_get_flow_trees(const struct uverbs_object_tree_def **root)
{
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 5f08b69f8a4f60..ec8410d3c4eb2a 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -1232,11 +1232,9 @@ int mlx5_ib_devx_create(struct mlx5_ib_dev *dev,
void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev,
struct mlx5_ib_ucontext *context);
const struct uverbs_object_tree_def *mlx5_ib_get_devx_tree(void);
-struct mlx5_ib_flow_handler *mlx5_ib_raw_fs_rule_add(struct mlx5_ib_dev *dev,
- struct mlx5_ib_flow_matcher *fs_matcher,
- void *cmd_in,
- int inlen, int dest_id,
- int dest_type);
+struct mlx5_ib_flow_handler *mlx5_ib_raw_fs_rule_add(
+ struct mlx5_ib_dev *dev, struct mlx5_ib_flow_matcher *fs_matcher,
+ void *cmd_in, int inlen, int dest_id, int dest_type);
bool mlx5_ib_devx_is_flow_dest(void *obj, int *dest_id, int *dest_type);
int mlx5_ib_get_flow_trees(const struct uverbs_object_tree_def **root);
#else
@@ -1247,17 +1245,22 @@ static inline void mlx5_ib_devx_destroy(struct mlx5_ib_dev *dev,
struct mlx5_ib_ucontext *context) {}
static inline const struct uverbs_object_tree_def *
mlx5_ib_get_devx_tree(void) { return NULL; }
-static inline struct mlx5_ib_flow_handler *
-mlx5_ib_raw_fs_rule_add(struct mlx5_ib_dev *dev,
- struct mlx5_ib_flow_matcher *fs_matcher,
- void *cmd_in,
- int inlen, int dest_id,
- int dest_type) { return -EOPNOTSUPP; };
-static inline bool
-mlx5_ib_devx_is_flow_dest(void *obj, int *dest_id,
- int *dest_type) { return false; };
+static inline struct mlx5_ib_flow_handler *mlx5_ib_raw_fs_rule_add(
+ struct mlx5_ib_dev *dev, struct mlx5_ib_flow_matcher *fs_matcher,
+ void *cmd_in, int inlen, int dest_id, int dest_type)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+static inline bool mlx5_ib_devx_is_flow_dest(void *obj, int *dest_id,
+ int *dest_type)
+{
+ return false;
+}
static inline int
-mlx5_ib_get_flow_trees(const struct uverbs_object_tree_def **root) { return 0; };
+mlx5_ib_get_flow_trees(const struct uverbs_object_tree_def **root)
+{
+ return 0;
+}
#endif
static inline void init_query_mad(struct ib_smp *mad)
{
^ permalink raw reply related
* Re: [net-next v6 1/2] net/tls: Use socket data_ready callback on record availability
From: David Miller @ 2018-07-24 20:12 UTC (permalink / raw)
To: vakul.garg; +Cc: netdev, borisp, aviadye, davejwatson
In-Reply-To: <20180724101403.27040-2-vakul.garg@nxp.com>
From: Vakul Garg <vakul.garg@nxp.com>
Date: Tue, 24 Jul 2018 15:44:02 +0530
> On receipt of a complete tls record, use socket's saved data_ready
> callback instead of state_change callback.
>
> Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
I don't think this is correct.
Here, the stream parser has given us a complete TLS record.
But we haven't decrypted this packet yet. It sits on the
stream parser's queue to be processed by tls_sw_recvmsg(),
not the saved socket's receive queue.
^ permalink raw reply
* [PATCH net-next v3 5/5] act_mirred: use TC_ACT_REINJECT when possible
From: Paolo Abeni @ 2018-07-24 20:06 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Daniel Borkmann,
Marcelo Ricardo Leitner, Eyal Birger, David S. Miller
In-Reply-To: <cover.1532437050.git.pabeni@redhat.com>
When mirred is invoked from the ingress path, and it wants to redirect
the processed packet, it can now use the TC_ACT_REINJECT action,
filling the tcf_result accordingly, and avoiding a per packet
skb_clone().
Overall this gives a ~10% improvement in forwarding performance for the
TC S/W data path and TC S/W performances are now comparable to the
kernel openvswitch datapath.
v1 -> v2: use ACT_MIRRED instead of ACT_REDIRECT
v2 -> v3: updated after action rename, fixed a typo into the commit
message
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/sched/act_mirred.c | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index eeb335f03102..368187312136 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -25,6 +25,7 @@
#include <net/net_namespace.h>
#include <net/netlink.h>
#include <net/pkt_sched.h>
+#include <net/pkt_cls.h>
#include <linux/tc_act/tc_mirred.h>
#include <net/tc_act/tc_mirred.h>
@@ -171,10 +172,12 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
struct tcf_result *res)
{
struct tcf_mirred *m = to_mirred(a);
+ struct sk_buff *skb2 = skb;
bool m_mac_header_xmit;
struct net_device *dev;
- struct sk_buff *skb2;
int retval, err = 0;
+ bool want_ingress;
+ bool is_redirect;
int m_eaction;
int mac_len;
@@ -196,16 +199,19 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
goto out;
}
- skb2 = skb_clone(skb, GFP_ATOMIC);
- if (!skb2)
- goto out;
+ is_redirect = tcf_mirred_is_act_redirect(m_eaction);
+ if (!skb_at_tc_ingress(skb) || !is_redirect) {
+ skb2 = skb_clone(skb, GFP_ATOMIC);
+ if (!skb2)
+ goto out;
+ }
/* If action's target direction differs than filter's direction,
* and devices expect a mac header on xmit, then mac push/pull is
* needed.
*/
- if (skb_at_tc_ingress(skb) != tcf_mirred_act_wants_ingress(m_eaction) &&
- m_mac_header_xmit) {
+ want_ingress = tcf_mirred_act_wants_ingress(m_eaction);
+ if (skb_at_tc_ingress(skb) != want_ingress && m_mac_header_xmit) {
if (!skb_at_tc_ingress(skb)) {
/* caught at egress, act ingress: pull mac */
mac_len = skb_network_header(skb) - skb_mac_header(skb);
@@ -216,15 +222,23 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
}
}
+ skb2->skb_iif = skb->dev->ifindex;
+ skb2->dev = dev;
+
/* mirror is always swallowed */
- if (tcf_mirred_is_act_redirect(m_eaction)) {
+ if (is_redirect) {
skb2->tc_redirected = 1;
skb2->tc_from_ingress = skb2->tc_at_ingress;
+
+ /* let's the caller reinject the packet, if possible */
+ if (skb_at_tc_ingress(skb)) {
+ res->ingress = want_ingress;
+ res->qstats = this_cpu_ptr(m->common.cpu_qstats);
+ return TC_ACT_REINJECT;
+ }
}
- skb2->skb_iif = skb->dev->ifindex;
- skb2->dev = dev;
- if (!tcf_mirred_act_wants_ingress(m_eaction))
+ if (!want_ingress)
err = dev_queue_xmit(skb2);
else
err = netif_receive_skb(skb2);
--
2.17.1
^ permalink raw reply related
* [PATCH net-next v3 4/5] net/tc: introduce TC_ACT_REINJECT.
From: Paolo Abeni @ 2018-07-24 20:06 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Daniel Borkmann,
Marcelo Ricardo Leitner, Eyal Birger, David S. Miller
In-Reply-To: <cover.1532437050.git.pabeni@redhat.com>
This is similar TC_ACT_REDIRECT, but with a slightly different
semantic:
- on ingress the mirred skbs are passed to the target device
network stack without any additional check not scrubbing.
- the rcu-protected stats provided via the tcf_result struct
are updated on error conditions.
This new tcfa_action value is not exposed to the user-space
and can be used only internally by clsact.
v1 -> v2: do not touch TC_ACT_REDIRECT code path, introduce
a new action type instead
v2 -> v3:
- rename the new action value TC_ACT_REINJECT, update the
helper accordingly
- take care of uncloned reinjected packets in XDP generic
hook
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
include/net/pkt_cls.h | 3 +++
include/net/sch_generic.h | 19 +++++++++++++++++++
net/core/dev.c | 6 +++++-
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2081e4219f81..36ccfe2a303a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -7,6 +7,9 @@
#include <net/sch_generic.h>
#include <net/act_api.h>
+/* TC action not accessible from user space */
+#define TC_ACT_REINJECT (TC_ACT_VALUE_MAX + 1)
+
/* Basic packet classifier frontend definitions. */
struct tcf_walker {
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 056dc1083aa3..95e81a70f549 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -235,6 +235,12 @@ struct tcf_result {
u32 classid;
};
const struct tcf_proto *goto_tp;
+
+ /* used by the TC_ACT_REINJECT action */
+ struct {
+ bool ingress;
+ struct gnet_stats_queue *qstats;
+ };
};
};
@@ -1091,4 +1097,17 @@ void mini_qdisc_pair_swap(struct mini_Qdisc_pair *miniqp,
void mini_qdisc_pair_init(struct mini_Qdisc_pair *miniqp, struct Qdisc *qdisc,
struct mini_Qdisc __rcu **p_miniq);
+static inline void skb_tc_reinject(struct sk_buff *skb, struct tcf_result *res)
+{
+ struct gnet_stats_queue *stats = res->qstats;
+ int ret;
+
+ if (res->ingress)
+ ret = netif_receive_skb(skb);
+ else
+ ret = dev_queue_xmit(skb);
+ if (ret && stats)
+ qstats_overlimit_inc(res->qstats);
+}
+
#endif
diff --git a/net/core/dev.c b/net/core/dev.c
index 14a748ee8cc9..826ec74fe1d9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4252,7 +4252,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
/* Reinjected packets coming from act_mirred or similar should
* not get XDP generic processing.
*/
- if (skb_cloned(skb))
+ if (skb_cloned(skb) || skb->tc_redirected)
return XDP_PASS;
/* XDP packets must be linear and must have sufficient headroom
@@ -4602,6 +4602,10 @@ sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret,
__skb_push(skb, skb->mac_len);
skb_do_redirect(skb);
return NULL;
+ case TC_ACT_REINJECT:
+ /* this does not scrub the packet, and updates stats on error */
+ skb_tc_reinject(skb, &cl_res);
+ return NULL;
default:
break;
}
--
2.17.1
^ permalink raw reply related
* [PATCH net-next v3 3/5] tc/act: remove unneeded RCU lock in action callback
From: Paolo Abeni @ 2018-07-24 20:06 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Daniel Borkmann,
Marcelo Ricardo Leitner, Eyal Birger, David S. Miller
In-Reply-To: <cover.1532437050.git.pabeni@redhat.com>
Each lockless action currently does its own RCU locking in ->act().
This is allows using plain RCU accessor, even if the context
is really RCU BH.
This change drops the per action RCU lock, replace the accessors
with _bh variant, cleans up a bit the surronding code and documents
the RCU status in the relevant header.
No functional nor performance change is intended.
The goal of this patch is clarifying that the RCU critical section
used by the tc actions extends up to the classifier's caller.
v1 -> v2:
- preserve rcu lock in act_bpf: it's needed by eBPF helpers,
as pointed out by Daniel
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
include/net/act_api.h | 2 +-
include/net/sch_generic.h | 2 ++
net/sched/act_csum.c | 12 +++---------
net/sched/act_ife.c | 5 +----
net/sched/act_mirred.c | 4 +---
net/sched/act_sample.c | 4 +---
net/sched/act_skbedit.c | 10 +++-------
net/sched/act_skbmod.c | 21 +++++++++------------
net/sched/act_tunnel_key.c | 6 +-----
net/sched/act_vlan.c | 19 +++++++------------
10 files changed, 29 insertions(+), 56 deletions(-)
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 683ce41053d9..8c9bc02d05e1 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -85,7 +85,7 @@ struct tc_action_ops {
size_t size;
struct module *owner;
int (*act)(struct sk_buff *, const struct tc_action *,
- struct tcf_result *);
+ struct tcf_result *); /* called under RCU BH lock*/
int (*dump)(struct sk_buff *, struct tc_action *, int, int);
void (*cleanup)(struct tc_action *);
int (*lookup)(struct net *net, struct tc_action **a, u32 index,
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 7432100027b7..056dc1083aa3 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -275,6 +275,8 @@ struct tcf_proto {
/* Fast access part */
struct tcf_proto __rcu *next;
void __rcu *root;
+
+ /* called under RCU BH lock*/
int (*classify)(struct sk_buff *,
const struct tcf_proto *,
struct tcf_result *);
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
index bd232d3bd022..4f092fbd1e20 100644
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@ -561,15 +561,14 @@ static int tcf_csum(struct sk_buff *skb, const struct tc_action *a,
u32 update_flags;
int action;
- rcu_read_lock();
- params = rcu_dereference(p->params);
+ params = rcu_dereference_bh(p->params);
tcf_lastuse_update(&p->tcf_tm);
bstats_cpu_update(this_cpu_ptr(p->common.cpu_bstats), skb);
action = params->action;
if (unlikely(action == TC_ACT_SHOT))
- goto drop_stats;
+ goto drop;
update_flags = params->update_flags;
switch (tc_skb_protocol(skb)) {
@@ -583,16 +582,11 @@ static int tcf_csum(struct sk_buff *skb, const struct tc_action *a,
break;
}
-unlock:
- rcu_read_unlock();
return action;
drop:
- action = TC_ACT_SHOT;
-
-drop_stats:
qstats_drop_inc(this_cpu_ptr(p->common.cpu_qstats));
- goto unlock;
+ return TC_ACT_SHOT;
}
static int tcf_csum_dump(struct sk_buff *skb, struct tc_action *a, int bind,
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
index 3d6e265758c0..df4060e32d43 100644
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -820,14 +820,11 @@ static int tcf_ife_act(struct sk_buff *skb, const struct tc_action *a,
struct tcf_ife_params *p;
int ret;
- rcu_read_lock();
- p = rcu_dereference(ife->params);
+ p = rcu_dereference_bh(ife->params);
if (p->flags & IFE_ENCODE) {
ret = tcf_ife_encode(skb, a, res, p);
- rcu_read_unlock();
return ret;
}
- rcu_read_unlock();
return tcf_ife_decode(skb, a, res);
}
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 6afd89a36c69..eeb335f03102 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -181,11 +181,10 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
tcf_lastuse_update(&m->tcf_tm);
bstats_cpu_update(this_cpu_ptr(m->common.cpu_bstats), skb);
- rcu_read_lock();
m_mac_header_xmit = READ_ONCE(m->tcfm_mac_header_xmit);
m_eaction = READ_ONCE(m->tcfm_eaction);
retval = READ_ONCE(m->tcf_action);
- dev = rcu_dereference(m->tcfm_dev);
+ dev = rcu_dereference_bh(m->tcfm_dev);
if (unlikely(!dev)) {
pr_notice_once("tc mirred: target device is gone\n");
goto out;
@@ -236,7 +235,6 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
if (tcf_mirred_is_act_redirect(m_eaction))
retval = TC_ACT_SHOT;
}
- rcu_read_unlock();
return retval;
}
diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c
index 3079e7be5bde..2608ccc83e5e 100644
--- a/net/sched/act_sample.c
+++ b/net/sched/act_sample.c
@@ -140,8 +140,7 @@ static int tcf_sample_act(struct sk_buff *skb, const struct tc_action *a,
bstats_cpu_update(this_cpu_ptr(s->common.cpu_bstats), skb);
retval = READ_ONCE(s->tcf_action);
- rcu_read_lock();
- psample_group = rcu_dereference(s->psample_group);
+ psample_group = rcu_dereference_bh(s->psample_group);
/* randomly sample packets according to rate */
if (psample_group && (prandom_u32() % s->rate == 0)) {
@@ -165,7 +164,6 @@ static int tcf_sample_act(struct sk_buff *skb, const struct tc_action *a,
skb_pull(skb, skb->mac_len);
}
- rcu_read_unlock();
return retval;
}
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
index da56e6938c9e..a6db47ebec11 100644
--- a/net/sched/act_skbedit.c
+++ b/net/sched/act_skbedit.c
@@ -43,8 +43,7 @@ static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a,
tcf_lastuse_update(&d->tcf_tm);
bstats_cpu_update(this_cpu_ptr(d->common.cpu_bstats), skb);
- rcu_read_lock();
- params = rcu_dereference(d->params);
+ params = rcu_dereference_bh(d->params);
action = READ_ONCE(d->tcf_action);
if (params->flags & SKBEDIT_F_PRIORITY)
@@ -77,14 +76,11 @@ static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a,
}
if (params->flags & SKBEDIT_F_PTYPE)
skb->pkt_type = params->ptype;
-
-unlock:
- rcu_read_unlock();
return action;
+
err:
qstats_drop_inc(this_cpu_ptr(d->common.cpu_qstats));
- action = TC_ACT_SHOT;
- goto unlock;
+ return TC_ACT_SHOT;
}
static const struct nla_policy skbedit_policy[TCA_SKBEDIT_MAX + 1] = {
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c
index cdc6bacfb190..c437c6d51a71 100644
--- a/net/sched/act_skbmod.c
+++ b/net/sched/act_skbmod.c
@@ -41,20 +41,14 @@ static int tcf_skbmod_run(struct sk_buff *skb, const struct tc_action *a,
* then MAX_EDIT_LEN needs to change appropriately
*/
err = skb_ensure_writable(skb, MAX_EDIT_LEN);
- if (unlikely(err)) { /* best policy is to drop on the floor */
- qstats_overlimit_inc(this_cpu_ptr(d->common.cpu_qstats));
- return TC_ACT_SHOT;
- }
+ if (unlikely(err)) /* best policy is to drop on the floor */
+ goto drop;
- rcu_read_lock();
action = READ_ONCE(d->tcf_action);
- if (unlikely(action == TC_ACT_SHOT)) {
- qstats_overlimit_inc(this_cpu_ptr(d->common.cpu_qstats));
- rcu_read_unlock();
- return action;
- }
+ if (unlikely(action == TC_ACT_SHOT))
+ goto drop;
- p = rcu_dereference(d->skbmod_p);
+ p = rcu_dereference_bh(d->skbmod_p);
flags = p->flags;
if (flags & SKBMOD_F_DMAC)
ether_addr_copy(eth_hdr(skb)->h_dest, p->eth_dst);
@@ -62,7 +56,6 @@ static int tcf_skbmod_run(struct sk_buff *skb, const struct tc_action *a,
ether_addr_copy(eth_hdr(skb)->h_source, p->eth_src);
if (flags & SKBMOD_F_ETYPE)
eth_hdr(skb)->h_proto = p->eth_type;
- rcu_read_unlock();
if (flags & SKBMOD_F_SWAPMAC) {
u16 tmpaddr[ETH_ALEN / 2]; /* ether_addr_copy() requirement */
@@ -73,6 +66,10 @@ static int tcf_skbmod_run(struct sk_buff *skb, const struct tc_action *a,
}
return action;
+
+drop:
+ qstats_overlimit_inc(this_cpu_ptr(d->common.cpu_qstats));
+ return TC_ACT_SHOT;
}
static const struct nla_policy skbmod_policy[TCA_SKBMOD_MAX + 1] = {
diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c
index 3ec585d58762..1ab959ef3547 100644
--- a/net/sched/act_tunnel_key.c
+++ b/net/sched/act_tunnel_key.c
@@ -31,9 +31,7 @@ static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a,
struct tcf_tunnel_key_params *params;
int action;
- rcu_read_lock();
-
- params = rcu_dereference(t->params);
+ params = rcu_dereference_bh(t->params);
tcf_lastuse_update(&t->tcf_tm);
bstats_cpu_update(this_cpu_ptr(t->common.cpu_bstats), skb);
@@ -53,8 +51,6 @@ static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a,
break;
}
- rcu_read_unlock();
-
return action;
}
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c
index ad37f308175a..15a0ee214c9c 100644
--- a/net/sched/act_vlan.c
+++ b/net/sched/act_vlan.c
@@ -40,11 +40,9 @@ static int tcf_vlan(struct sk_buff *skb, const struct tc_action *a,
if (skb_at_tc_ingress(skb))
skb_push_rcsum(skb, skb->mac_len);
- rcu_read_lock();
-
action = READ_ONCE(v->tcf_action);
- p = rcu_dereference(v->vlan_p);
+ p = rcu_dereference_bh(v->vlan_p);
switch (p->tcfv_action) {
case TCA_VLAN_ACT_POP:
@@ -61,7 +59,7 @@ static int tcf_vlan(struct sk_buff *skb, const struct tc_action *a,
case TCA_VLAN_ACT_MODIFY:
/* No-op if no vlan tag (either hw-accel or in-payload) */
if (!skb_vlan_tagged(skb))
- goto unlock;
+ goto out;
/* extract existing tag (and guarantee no hw-accel tag) */
if (skb_vlan_tag_present(skb)) {
tci = skb_vlan_tag_get(skb);
@@ -86,18 +84,15 @@ static int tcf_vlan(struct sk_buff *skb, const struct tc_action *a,
BUG();
}
- goto unlock;
-
-drop:
- action = TC_ACT_SHOT;
- qstats_drop_inc(this_cpu_ptr(v->common.cpu_qstats));
-
-unlock:
- rcu_read_unlock();
+out:
if (skb_at_tc_ingress(skb))
skb_pull_rcsum(skb, skb->mac_len);
return action;
+
+drop:
+ qstats_drop_inc(this_cpu_ptr(v->common.cpu_qstats));
+ return TC_ACT_SHOT;
}
static const struct nla_policy vlan_policy[TCA_VLAN_MAX + 1] = {
--
2.17.1
^ permalink raw reply related
* [PATCH net-next v3 2/5] net/sched: user-space can't set unknown tcfa_action values
From: Paolo Abeni @ 2018-07-24 20:06 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Daniel Borkmann,
Marcelo Ricardo Leitner, Eyal Birger, David S. Miller
In-Reply-To: <cover.1532437050.git.pabeni@redhat.com>
Currently, when initializing an action, the user-space can specify
and use arbitrary values for the tcfa_action field. If the value
is unknown by the kernel, is implicitly threaded as TC_ACT_UNSPEC.
This change explicitly checks for unknown values at action creation
time, and explicitly convert them to TC_ACT_UNSPEC. No functional
changes are introduced, but this will allow introducing tcfa_action
values not exposed to user-space in a later patch.
Note: we can't use the above to hide TC_ACT_REDIRECT from user-space,
as the latter is already part of uAPI.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
include/uapi/linux/pkt_cls.h | 6 ++++--
net/sched/act_api.c | 10 +++++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index c4262d911596..c8a24861d4c8 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -45,6 +45,7 @@ enum {
* the skb and act like everything
* is alright.
*/
+#define TC_ACT_VALUE_MAX TC_ACT_TRAP
/* There is a special kind of actions called "extended actions",
* which need a value parameter. These have a local opcode located in
@@ -55,11 +56,12 @@ enum {
#define __TC_ACT_EXT_SHIFT 28
#define __TC_ACT_EXT(local) ((local) << __TC_ACT_EXT_SHIFT)
#define TC_ACT_EXT_VAL_MASK ((1 << __TC_ACT_EXT_SHIFT) - 1)
-#define TC_ACT_EXT_CMP(combined, opcode) \
- (((combined) & (~TC_ACT_EXT_VAL_MASK)) == opcode)
+#define TC_ACT_EXT_OPCODE(combined) ((combined) & (~TC_ACT_EXT_VAL_MASK))
+#define TC_ACT_EXT_CMP(combined, opcode) (TC_ACT_EXT_OPCODE(combined) == opcode)
#define TC_ACT_JUMP __TC_ACT_EXT(1)
#define TC_ACT_GOTO_CHAIN __TC_ACT_EXT(2)
+#define TC_ACT_EXT_OPCODE_MAX TC_ACT_GOTO_CHAIN
/* Action type identifiers*/
enum {
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 24b5534967fe..5044f4809b37 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -798,6 +798,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
char act_name[IFNAMSIZ];
struct nlattr *tb[TCA_ACT_MAX + 1];
struct nlattr *kind;
+ int opcode;
int err;
if (name == NULL) {
@@ -884,7 +885,8 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
if (err != ACT_P_CREATED)
module_put(a_o->owner);
- if (TC_ACT_EXT_CMP(a->tcfa_action, TC_ACT_GOTO_CHAIN)) {
+ opcode = TC_ACT_EXT_OPCODE(a->tcfa_action);
+ if (opcode == TC_ACT_GOTO_CHAIN) {
err = tcf_action_goto_chain_init(a, tp);
if (err) {
struct tc_action *actions[] = { a, NULL };
@@ -898,6 +900,12 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
if (a->tcfa_action == TC_ACT_REDIRECT) {
net_warn_ratelimited("TC_ACT_REDIRECT can't be used directly");
a->tcfa_action = TC_ACT_UNSPEC;
+ } else if ((!opcode && a->tcfa_action > TC_ACT_VALUE_MAX) ||
+ (opcode && opcode > TC_ACT_EXT_OPCODE_MAX &&
+ a->tcfa_action != TC_ACT_UNSPEC)) {
+ net_warn_ratelimited("invalid %d action value",
+ a->tcfa_action);
+ a->tcfa_action = TC_ACT_UNSPEC;
}
return a;
--
2.17.1
^ permalink raw reply related
* [PATCH net-next v3 1/5] tc/act: user space can't use TC_ACT_REDIRECT directly
From: Paolo Abeni @ 2018-07-24 20:06 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Daniel Borkmann,
Marcelo Ricardo Leitner, Eyal Birger, David S. Miller
In-Reply-To: <cover.1532437050.git.pabeni@redhat.com>
Only cls_bpf and act_bpf can safely use such value. If a generic
action is configured by user space to return TC_ACT_REDIRECT,
the usually visible behavior is passing the skb up the stack - as
for unknown action, but, with complex configuration, more random
results can be obtained.
This patch forcefully converts TC_ACT_REDIRECT to TC_ACT_UNSPEC
at action init time, making the kernel behavior more consistent.
v1 -> v3: use TC_ACT_UNSPEC instead of a newly definied act value
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/sched/act_api.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 148a89ab789b..24b5534967fe 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -895,6 +895,11 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
}
}
+ if (a->tcfa_action == TC_ACT_REDIRECT) {
+ net_warn_ratelimited("TC_ACT_REDIRECT can't be used directly");
+ a->tcfa_action = TC_ACT_UNSPEC;
+ }
+
return a;
err_mod:
--
2.17.1
^ permalink raw reply related
* [PATCH net-next v3 0/5] TC: refactor act_mirred packets re-injection
From: Paolo Abeni @ 2018-07-24 20:06 UTC (permalink / raw)
To: netdev
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Daniel Borkmann,
Marcelo Ricardo Leitner, Eyal Birger, David S. Miller
This series is aimed at improving the act_mirred redirect performances.
Such action is used by OVS to represent TC S/W flows, and it's current largest
bottle-neck is the need for a skb_clone() for each packet.
The first 3 patches introduce some cleanup and safeguards to allow extending
tca_result - we will use it to store RCU protected redirect information - and
introduce a clear separation between user-space accessible tcfa_action
value and internal values accessible only by the kernel.
Then a new tcfa_action value is introduced: TC_ACT_REINJECT, similar to
TC_ACT_REDIRECT, but preserving the mirred semantic. Such value is not
accessible from user-space.
The last patch exploits the newly introduced infrastructure in the act_mirred
action, to avoid a skb_clone, when possible.
Overall this the above gives a ~10% performance improvement in forwarding tput,
when using the TC S/W datapath.
v1 -> v2:
- preserve the rcu lock in act_bpf
- add and use a new action value to reinject the packets, preserving the mirred
semantic
v2 -> v3:
- renamed to new action as TC_ACT_REINJECT
- TC_ACT_REINJECT is not exposed to user-space
Paolo Abeni (5):
tc/act: user space can't use TC_ACT_REDIRECT directly
net/sched: user-space can't set unknown tcfa_action values
tc/act: remove unneeded RCU lock in action callback
net/tc: introduce TC_ACT_REINJECT.
act_mirred: use TC_ACT_REINJECT when possible
include/net/act_api.h | 2 +-
include/net/pkt_cls.h | 3 +++
include/net/sch_generic.h | 21 ++++++++++++++++++++
include/uapi/linux/pkt_cls.h | 6 ++++--
net/core/dev.c | 6 +++++-
net/sched/act_api.c | 15 +++++++++++++-
net/sched/act_csum.c | 12 +++---------
net/sched/act_ife.c | 5 +----
net/sched/act_mirred.c | 38 ++++++++++++++++++++++++------------
net/sched/act_sample.c | 4 +---
net/sched/act_skbedit.c | 10 +++-------
net/sched/act_skbmod.c | 21 +++++++++-----------
net/sched/act_tunnel_key.c | 6 +-----
net/sched/act_vlan.c | 19 +++++++-----------
14 files changed, 98 insertions(+), 70 deletions(-)
--
2.17.1
^ permalink raw reply
* Re: [PATCH 1/4] treewide: convert ISO_8859-1 text comments to utf-8
From: Randy Dunlap @ 2018-07-24 21:02 UTC (permalink / raw)
To: Andrew Morton, Arnd Bergmann
Cc: Joe Perches, Samuel Ortiz, David S. Miller, Rob Herring,
Michael Ellerman, Jonathan Cameron, linux-wireless, netdev,
devicetree, linux-kernel, linux-arm-kernel, linux-crypto,
linuxppc-dev, linux-iio, linux-pm, lvs-devel, netfilter-devel,
coreteam
In-Reply-To: <20180724140010.e24a9964fd340afe2d98a994@linux-foundation.org>
On 07/24/2018 02:00 PM, Andrew Morton wrote:
> On Tue, 24 Jul 2018 13:13:25 +0200 Arnd Bergmann <arnd@arndb.de> wrote:
>
>> Almost all files in the kernel are either plain text or UTF-8
>> encoded. A couple however are ISO_8859-1, usually just a few
>> characters in a C comments, for historic reasons.
>>
>> This converts them all to UTF-8 for consistency.
>
> Was "consistency" the only rationale? The discussion is now outside my
> memory horizon but I thought there were other reasons.
kconfig tools prefer ASCII or utf-8.
email tools probably likewise.
user sanity?
> Will we be getting a checkpatch rule to keep things this way?
--
~Randy
^ permalink raw reply
* Re: [PATCH 1/4] treewide: convert ISO_8859-1 text comments to utf-8
From: Andrew Morton @ 2018-07-24 21:00 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Joe Perches, Samuel Ortiz, David S. Miller, Rob Herring,
Michael Ellerman, Jonathan Cameron, linux-wireless, netdev,
devicetree, linux-kernel, linux-arm-kernel, linux-crypto,
linuxppc-dev, linux-iio, linux-pm, lvs-devel, netfilter-devel,
coreteam
In-Reply-To: <20180724111600.4158975-1-arnd@arndb.de>
On Tue, 24 Jul 2018 13:13:25 +0200 Arnd Bergmann <arnd@arndb.de> wrote:
> Almost all files in the kernel are either plain text or UTF-8
> encoded. A couple however are ISO_8859-1, usually just a few
> characters in a C comments, for historic reasons.
>
> This converts them all to UTF-8 for consistency.
Was "consistency" the only rationale? The discussion is now outside my
memory horizon but I thought there were other reasons.
Will we be getting a checkpatch rule to keep things this way?
^ permalink raw reply
* Re: [net-next 10/16] net/mlx5: Support PCIe buffer congestion handling via Devlink
From: Jakub Kicinski @ 2018-07-24 19:51 UTC (permalink / raw)
To: Eran Ben Elisha
Cc: Saeed Mahameed, Jiri Pirko, David S. Miller,
netdev@vger.kernel.org
In-Reply-To: <575e4a3a-af6f-aac4-fed6-fd4dad387105@mellanox.com>
On Tue, 24 Jul 2018 13:31:28 +0300, Eran Ben Elisha wrote:
> On 7/19/2018 4:49 AM, Jakub Kicinski wrote:
> > On Wed, 18 Jul 2018 18:01:01 -0700, Saeed Mahameed wrote:
> >> +static const struct devlink_param mlx5_devlink_params[] = {
> >> + DEVLINK_PARAM_DRIVER(MLX5_DEVLINK_PARAM_ID_CONGESTION_ACTION,
> >> + "congestion_action",
> >> + DEVLINK_PARAM_TYPE_U8,
> >> + BIT(DEVLINK_PARAM_CMODE_RUNTIME),
> >> + mlx5_devlink_get_congestion_action,
> >> + mlx5_devlink_set_congestion_action, NULL),
> >> + DEVLINK_PARAM_DRIVER(MLX5_DEVLINK_PARAM_ID_CONGESTION_MODE,
> >> + "congestion_mode",
> >> + DEVLINK_PARAM_TYPE_U8,
> >> + BIT(DEVLINK_PARAM_CMODE_RUNTIME),
> >> + mlx5_devlink_get_congestion_mode,
> >> + mlx5_devlink_set_congestion_mode, NULL),
> >> +};
> >
> > The devlink params haven't been upstream even for a full cycle and
> > already you guys are starting to use them to configure standard
> > features like queuing.
>
> We developed the devlink params in order to support non-standard
> configuration only. And for non-standard, there are generic and vendor
> specific options.
I thought it was developed for performing non-standard and possibly
vendor specific configuration. Look at DEVLINK_PARAM_GENERIC_* for
examples of well justified generic options for which we have no
other API. The vendor mlx4 options look fairly vendor specific if you
ask me, too.
Configuring queuing has an API. The question is it acceptable to enter
into the risky territory of controlling offloads via devlink parameters
or would we rather make vendors take the time and effort to model
things to (a subset) of existing APIs. The HW never fits the APIs
perfectly.
> The queuing model is a standard. However here we are configuring the
> outbound PCIe buffers on the receive path from NIC port toward the
> host(s) in Single / MultiHost environment.
That's why we have PF representors.
> (You can see the driver processing based on this param as part of the RX
> patch for the marked option here https://patchwork.ozlabs.org/patch/945998/)
>
> > I know your HW is not capable of doing full RED offload, it's a
> > snowflake.
>
> The algorithm which is applied here for the drop option is not the core
> of this feature.
>
> > You tell us you're doing custom DCB configuration hacks on
> > one side (previous argument we had) and custom devlink parameter
> > configuration hacks on PCIe.
> >
> > Perhaps the idea that we're trying to use the existing Linux APIs for
> > HW configuration only applies to forwarding behaviour.
>
> Hopefully I explained above well why it is not related.
Sure ;)
^ permalink raw reply
* Re: [PATCH] ipvs: fix race between ip_vs_conn_new() and ip_vs_del_dest()
From: Julian Anastasov @ 2018-07-24 19:47 UTC (permalink / raw)
To: Tan Hu
Cc: wensong, horms, pablo, kadlec, fw, davem, netdev, lvs-devel,
netfilter-devel, coreteam, linux-kernel, zhong.weidong,
jiang.biao2
In-Reply-To: <1532419953-5517-1-git-send-email-tan.hu@zte.com.cn>
Hello,
On Tue, 24 Jul 2018, Tan Hu wrote:
> We came across infinite loop in ipvs when using ipvs in docker
> env.
>
> When ipvs receives new packets and cannot find an ipvs connection,
> it will create a new connection, then if the dest is unavailable
> (i.e. IP_VS_DEST_F_AVAILABLE), the packet will be dropped sliently.
>
> But if the dropped packet is the first packet of this connection,
> the connection control timer never has a chance to start and the
> ipvs connection cannot be released. This will lead to memory leak, or
> infinite loop in cleanup_net() when net namespace is released like
> this:
>
> ip_vs_conn_net_cleanup at ffffffffa0a9f31a [ip_vs]
> __ip_vs_cleanup at ffffffffa0a9f60a [ip_vs]
> ops_exit_list at ffffffff81567a49
> cleanup_net at ffffffff81568b40
> process_one_work at ffffffff810a851b
> worker_thread at ffffffff810a9356
> kthread at ffffffff810b0b6f
> ret_from_fork at ffffffff81697a18
>
> race condition:
> CPU1 CPU2
> ip_vs_in()
> ip_vs_conn_new()
> ip_vs_del_dest()
> __ip_vs_unlink_dest()
> ~IP_VS_DEST_F_AVAILABLE
> cp->dest && !IP_VS_DEST_F_AVAILABLE
> __ip_vs_conn_put
> ...
> cleanup_net ---> infinite looping
>
> Fix this by checking whether the timer already started.
Looks like an old bug...
>
> Signed-off-by: Tan Hu <tan.hu@zte.com.cn>
> Reviewed-by: Jiang Biao <jiang.biao2@zte.com.cn>
> ---
> net/netfilter/ipvs/ip_vs_core.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index 0679dd1..ca9e7cc 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1972,13 +1972,17 @@ static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
> if (cp->dest && !(cp->dest->flags & IP_VS_DEST_F_AVAILABLE)) {
> /* the destination server is not available */
Add: u32 flags = cp->flags;
>
> + /* when timer already started, silently drop the packet.*/
> + if (timer_pending(&cp->timer))
> + __ip_vs_conn_put(cp);
> + else
> + ip_vs_conn_put(cp);
When ip_vs_conn_put is called for IP_VS_CONN_F_ONE_PACKET
it is possible to call ip_vs_conn_expire and to free cp with
ip_vs_conn_rcu_free immediately. What we can do is to avoid the
ip_vs_conn_expire_now call in such case by reading the flags
early (as above) and adding the needed check (as below).
> +
> if (sysctl_expire_nodest_conn(ipvs)) {
Add !(flags & IP_VS_CONN_F_ONE_PACKET) check in above 'if'.
> /* try to expire the connection immediately */
> ip_vs_conn_expire_now(cp);
> }
> - /* don't restart its timer, and silently
> - drop the packet. */
> - __ip_vs_conn_put(cp);
> +
> return NF_DROP;
> }
>
Regards
^ permalink raw reply
* Re: [RFC PATCH ghak90 (was ghak32) V3 08/10] audit: NETFILTER_PKT: record each container ID associated with a netNS
From: Richard Guy Briggs @ 2018-07-24 20:55 UTC (permalink / raw)
To: Paul Moore
Cc: cgroups, luto, jlayton, carlos, linux-api, containers,
linux-kernel, viro, dhowells, linux-audit, ebiederm, simo, netdev,
linux-fsdevel, Eric Paris, serge
In-Reply-To: <CAHC9VhRiqp5ttCfh1EttLgbpPowr5P_B7nC6sP4pq=XBfEYqJg@mail.gmail.com>
On 2018-07-24 16:22, Paul Moore wrote:
> On Tue, Jul 24, 2018 at 3:48 PM Steve Grubb <sgrubb@redhat.com> wrote:
> > On Friday, July 20, 2018 6:15:00 PM EDT Paul Moore wrote:
> > > On Wed, Jun 6, 2018 at 1:03 PM Richard Guy Briggs <rgb@redhat.com> wrote:
> > > > Add audit container identifier auxiliary record(s) to NETFILTER_PKT
> > > > event standalone records. Iterate through all potential audit container
> > > > identifiers associated with a network namespace.
> > > >
> > > > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > > > ---
> > > > include/linux/audit.h | 5 +++++
> > > > kernel/audit.c | 20 +++++++++++++++++++-
> > > > kernel/auditsc.c | 2 ++
> > > > net/netfilter/xt_AUDIT.c | 12 ++++++++++--
> > > > 4 files changed, 36 insertions(+), 3 deletions(-)
> > >
> > > ...
> > >
> > > > diff --git a/include/linux/audit.h b/include/linux/audit.h
> > > > index 7e2e51c..4560a4e 100644
> > > > --- a/include/linux/audit.h
> > > > +++ b/include/linux/audit.h
> > > > @@ -167,6 +167,8 @@ extern int audit_log_contid(struct audit_context
> > > > *context, extern void audit_contid_add(struct net *net, u64 contid);
> > > > extern void audit_contid_del(struct net *net, u64 contid);
> > > > extern void audit_switch_task_namespaces(struct nsproxy *ns, struct
> > > > task_struct *p); +extern void audit_log_contid_list(struct net *net,
> > > > + struct audit_context *context);
> > >
> > > See my comment in previous patches about changing the function name to
> > > better indicate it's dedicate use for network namespaces.
> > >
> > > > extern int audit_update_lsm_rules(void);
> > > >
> > > > @@ -231,6 +233,9 @@ static inline void audit_contid_del(struct net *net,
> > > > u64 contid) { }
> > > > static inline void audit_switch_task_namespaces(struct nsproxy *ns,
> > > > struct task_struct *p) { }
> > > > +static inline void audit_log_contid_list(struct net *net,
> > > > + struct audit_context *context)
> > > > +{ }
> > > >
> > > > #define audit_enabled 0
> > > > #endif /* CONFIG_AUDIT */
> > > > diff --git a/kernel/audit.c b/kernel/audit.c
> > > > index ecd2de4..8cca41a 100644
> > > > --- a/kernel/audit.c
> > > > +++ b/kernel/audit.c
> > > > @@ -382,6 +382,20 @@ void audit_switch_task_namespaces(struct nsproxy
> > > > *ns, struct task_struct *p) audit_contid_add(new->net_ns, contid);
> > > > }
> > > >
> > > > +void audit_log_contid_list(struct net *net, struct audit_context
> > > > *context) +{
> > > > + struct audit_contid *cont;
> > > > + int i = 0;
> > > > +
> > > > + list_for_each_entry(cont, audit_get_contid_list(net), list) {
> > > > + char buf[14];
> > > > +
> > > > + sprintf(buf, "net%u", i++);
> > > > + audit_log_contid(context, buf, cont->id);
> > >
> > > Hmm. It looks like this will generate multiple audit container ID
> > > records with "op=netX contid=Y" (X=netns number, Y=audit container
> > > ID), is that what we want? I've mentioned my concern around the "op"
> > > values in these records earlier in the patchset, that still applies
> > > here, but now I'm also concerned about the multiple records. I'm
> > > thinking we might be better served with a single record with either
> > > multiple "contid" fields, or a single "contid" field with a set of
> > > comma separated values (or some other delimiter that Steve's tools
> > > will tolerate).
> > >
> > > Steve, thoughts?
> >
> > A single record is best. Maybe pattern this after the args listed in an
> > execve record.
>
> I'm concerned that an execve-like approach might not scale very well
> as would could potentially have a lot of containers sharing a single
> network namespace ("a%d=%d" vs ",%d"). Further, with execve we log
> the argument position in addition to the argument itself, that isn't
> something we need to worry about with the audit container IDs.
I think a comma-separated list would be most efficient, but could
potentially overload one record. The "netX" labels are pretty
meaningless unless they are that netNS' inode number (with qualifying
dev, of course), but that would be elsewhere in another record.
> paul moore
- RGB
--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635
^ permalink raw reply
* [PATCH PATCH net-next 17/18] l2tp: remove trailing newline
From: Stephen Hemminger @ 2018-07-24 19:29 UTC (permalink / raw)
To: davem, ericvh, rminnich, lucho, ralf, jreuter, pablo, kadlec, fw,
alex.aring, stefan, kuznet, yoshfuji, johannes, jhs,
xiyou.wangcong, jiri, vyasevich, nhorman, marcelo.leitner,
trond.myklebust, anna.schumaker, steffen.klassert, herbert
Cc: netdev, v9fs-developer, linux-hams, ceph-devel, linux-decnet-user,
netfilter-devel, coreteam, linux-wpan, linux-s390, linux-wireless,
linux-rdma, linux-sctp, linux-nfs, linux-x25, Stephen Hemminger,
Stephen Hemminger
In-Reply-To: <20180724192918.31165-1-sthemmin@microsoft.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/l2tp/l2tp_core.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 1ea285bad84b..c8fc0f7f0b4b 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1795,4 +1795,3 @@ MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
MODULE_DESCRIPTION("L2TP core");
MODULE_LICENSE("GPL");
MODULE_VERSION(L2TP_DRV_VERSION);
-
--
2.18.0
^ permalink raw reply related
* [PATCH PATCH net-next 16/18] bpfilter: remove trailing newline
From: Stephen Hemminger @ 2018-07-24 19:29 UTC (permalink / raw)
To: davem, ericvh, rminnich, lucho, ralf, jreuter, pablo, kadlec, fw,
alex.aring, stefan, kuznet, yoshfuji, johannes, jhs,
xiyou.wangcong, jiri, vyasevich, nhorman, marcelo.leitner,
trond.myklebust, anna.schumaker, steffen.klassert, herbert
Cc: netdev, v9fs-developer, linux-hams, ceph-devel, linux-decnet-user,
netfilter-devel, coreteam, linux-wpan, linux-s390, linux-wireless,
linux-rdma, linux-sctp, linux-nfs, linux-x25, Stephen Hemminger,
Stephen Hemminger
In-Reply-To: <20180724192918.31165-1-sthemmin@microsoft.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/bpfilter/Kconfig | 1 -
net/ipv4/bpfilter/Makefile | 1 -
2 files changed, 2 deletions(-)
diff --git a/net/bpfilter/Kconfig b/net/bpfilter/Kconfig
index 76deb6615883..e558b46596c4 100644
--- a/net/bpfilter/Kconfig
+++ b/net/bpfilter/Kconfig
@@ -13,4 +13,3 @@ config BPFILTER_UMH
help
This builds bpfilter kernel module with embedded user mode helper
endif
-
diff --git a/net/ipv4/bpfilter/Makefile b/net/ipv4/bpfilter/Makefile
index ce262d76cc48..e9e42f99725e 100644
--- a/net/ipv4/bpfilter/Makefile
+++ b/net/ipv4/bpfilter/Makefile
@@ -1,2 +1 @@
obj-$(CONFIG_BPFILTER) += sockopt.o
-
--
2.18.0
^ permalink raw reply related
* [PATCH PATCH net-next 15/18] sunrpc: whitespace fixes
From: Stephen Hemminger @ 2018-07-24 19:29 UTC (permalink / raw)
To: davem, ericvh, rminnich, lucho, ralf, jreuter, pablo, kadlec, fw,
alex.aring, stefan, kuznet, yoshfuji, johannes, jhs,
xiyou.wangcong, jiri, vyasevich, nhorman, marcelo.leitner,
trond.myklebust, anna.schumaker, steffen.klassert, herbert
Cc: netdev, v9fs-developer, linux-hams, ceph-devel, linux-decnet-user,
netfilter-devel, coreteam, linux-wpan, linux-s390, linux-wireless,
linux-rdma, linux-sctp, linux-nfs, linux-x25, Stephen Hemminger,
Stephen Hemminger
In-Reply-To: <20180724192918.31165-1-sthemmin@microsoft.com>
Remove trailing whitespace and blank line at EOF
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/sunrpc/auth_gss/auth_gss.c | 2 +-
net/sunrpc/auth_gss/gss_generic_token.c | 1 -
net/sunrpc/auth_gss/gss_krb5_crypto.c | 1 -
net/sunrpc/auth_gss/gss_krb5_keys.c | 1 -
net/sunrpc/auth_gss/gss_krb5_seal.c | 1 -
net/sunrpc/auth_gss/gss_krb5_unseal.c | 1 -
net/sunrpc/auth_gss/gss_krb5_wrap.c | 1 -
net/sunrpc/auth_gss/svcauth_gss.c | 2 +-
net/sunrpc/backchannel_rqst.c | 1 -
net/sunrpc/clnt.c | 2 +-
net/sunrpc/rpcb_clnt.c | 2 +-
net/sunrpc/stats.c | 1 -
net/sunrpc/sunrpc.h | 1 -
net/sunrpc/xprt.c | 2 +-
net/sunrpc/xprtsock.c | 1 -
15 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index be8f103d22fd..b67ad98a36a6 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -1571,7 +1571,7 @@ static int gss_cred_is_negative_entry(struct rpc_cred *cred)
if (test_bit(RPCAUTH_CRED_NEGATIVE, &cred->cr_flags)) {
unsigned long now = jiffies;
unsigned long begin, expire;
- struct gss_cred *gss_cred;
+ struct gss_cred *gss_cred;
gss_cred = container_of(cred, struct gss_cred, gc_base);
begin = gss_cred->gc_upcall_timestamp;
diff --git a/net/sunrpc/auth_gss/gss_generic_token.c b/net/sunrpc/auth_gss/gss_generic_token.c
index 254defe446a7..fe97f3106536 100644
--- a/net/sunrpc/auth_gss/gss_generic_token.c
+++ b/net/sunrpc/auth_gss/gss_generic_token.c
@@ -231,4 +231,3 @@ g_verify_token_header(struct xdr_netobj *mech, int *body_size,
}
EXPORT_SYMBOL_GPL(g_verify_token_header);
-
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c
index 8654494b4d0a..a1acee106faa 100644
--- a/net/sunrpc/auth_gss/gss_krb5_crypto.c
+++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c
@@ -1077,4 +1077,3 @@ krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher,
dprintk("%s: returning %d\n", __func__, err);
return err;
}
-
diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c
index 870133146026..f7fe2d2b851f 100644
--- a/net/sunrpc/auth_gss/gss_krb5_keys.c
+++ b/net/sunrpc/auth_gss/gss_krb5_keys.c
@@ -324,4 +324,3 @@ u32 gss_krb5_aes_make_key(const struct gss_krb5_enctype *gk5e,
err_out:
return ret;
}
-
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
index 94a2b3f082a8..eaad9bc7a0bd 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
@@ -229,4 +229,3 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
return gss_get_mic_v2(ctx, text, token);
}
}
-
diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c
index b601a73cc9db..ef2b25b86d2f 100644
--- a/net/sunrpc/auth_gss/gss_krb5_unseal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c
@@ -225,4 +225,3 @@ gss_verify_mic_kerberos(struct gss_ctx *gss_ctx,
return gss_verify_mic_v2(ctx, message_buffer, read_token);
}
}
-
diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index a737c2da0837..286fd22404f2 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -623,4 +623,3 @@ gss_unwrap_kerberos(struct gss_ctx *gctx, int offset, struct xdr_buf *buf)
return gss_unwrap_kerberos_v2(kctx, offset, buf);
}
}
-
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 5089dbb96d58..860f2a1bbb67 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1389,7 +1389,7 @@ static void destroy_use_gss_proxy_proc_entry(struct net *net)
struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
if (sn->use_gssp_proc) {
- remove_proc_entry("use-gss-proxy", sn->proc_net_rpc);
+ remove_proc_entry("use-gss-proxy", sn->proc_net_rpc);
clear_gssp_clnt(sn);
}
}
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index c2c68a15b59d..3c15a99b9700 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -362,4 +362,3 @@ void xprt_complete_bc_request(struct rpc_rqst *req, uint32_t copied)
wake_up(&bc_serv->sv_cb_waitq);
spin_unlock(&bc_serv->sv_cb_lock);
}
-
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index d839c33ae7d9..3818e4d55c66 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -892,7 +892,7 @@ rpc_free_client(struct rpc_clnt *clnt)
/*
* Free an RPC client
*/
-static struct rpc_clnt *
+static struct rpc_clnt *
rpc_free_auth(struct rpc_clnt *clnt)
{
if (clnt->cl_auth == NULL)
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index c526f8fb37c9..c7872bc13860 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -213,7 +213,7 @@ static void rpcb_set_local(struct net *net, struct rpc_clnt *clnt,
sn->rpcb_local_clnt = clnt;
sn->rpcb_local_clnt4 = clnt4;
sn->rpcb_is_af_local = is_af_local ? 1 : 0;
- smp_wmb();
+ smp_wmb();
sn->rpcb_users = 1;
dprintk("RPC: created new rpcb local clients (rpcb_local_clnt: "
"%p, rpcb_local_clnt4: %p) for net %x%s\n",
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index f68aa46c9dd7..86f316503c7c 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -310,4 +310,3 @@ void rpc_proc_exit(struct net *net)
dprintk("RPC: unregistering /proc/net/rpc\n");
remove_proc_entry("rpc", net->proc_net);
}
-
diff --git a/net/sunrpc/sunrpc.h b/net/sunrpc/sunrpc.h
index 09a0315ea77b..c9bacb3c930f 100644
--- a/net/sunrpc/sunrpc.h
+++ b/net/sunrpc/sunrpc.h
@@ -57,4 +57,3 @@ int svc_send_common(struct socket *sock, struct xdr_buf *xdr,
int rpc_clients_notifier_register(void);
void rpc_clients_notifier_unregister(void);
#endif /* _NET_SUNRPC_SUNRPC_H */
-
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 3fabf9f6a0f9..a8db2e3f8904 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -880,7 +880,7 @@ static void xprt_wait_on_pinned_rqst(struct rpc_rqst *req)
__must_hold(&req->rq_xprt->recv_lock)
{
struct rpc_task *task = req->rq_task;
-
+
if (task && test_bit(RPC_TASK_MSG_RECV, &task->tk_runstate)) {
spin_unlock(&req->rq_xprt->recv_lock);
set_bit(RPC_TASK_MSG_RECV_WAIT, &task->tk_runstate);
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 9e1c5024aba9..6b7539c0466e 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -3375,4 +3375,3 @@ module_param_named(tcp_max_slot_table_entries, xprt_max_tcp_slot_table_entries,
max_slot_table_size, 0644);
module_param_named(udp_slot_table_entries, xprt_udp_slot_table_entries,
slot_table_size, 0644);
-
--
2.18.0
^ permalink raw reply related
* [PATCH PATCH net-next 14/18] decnet: whitespace fixes
From: Stephen Hemminger @ 2018-07-24 19:29 UTC (permalink / raw)
To: davem, ericvh, rminnich, lucho, ralf, jreuter, pablo, kadlec, fw,
alex.aring, stefan, kuznet, yoshfuji, johannes, jhs,
xiyou.wangcong, jiri, vyasevich, nhorman, marcelo.leitner,
trond.myklebust, anna.schumaker, steffen.klassert, herbert
Cc: netdev, v9fs-developer, linux-hams, ceph-devel, linux-decnet-user,
netfilter-devel, coreteam, linux-wpan, linux-s390, linux-wireless,
linux-rdma, linux-sctp, linux-nfs, linux-x25, Stephen Hemminger,
Stephen Hemminger
In-Reply-To: <20180724192918.31165-1-sthemmin@microsoft.com>
Remove trailing whitespace and extra lines at EOF
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
net/decnet/Kconfig | 1 -
net/decnet/Makefile | 1 -
net/decnet/TODO | 5 ++---
net/decnet/dn_fib.c | 2 --
net/decnet/dn_nsp_in.c | 1 -
net/decnet/dn_nsp_out.c | 1 -
net/decnet/dn_route.c | 1 -
net/decnet/dn_rules.c | 2 --
net/decnet/netfilter/Makefile | 1 -
net/decnet/netfilter/dn_rtmsg.c | 1 -
10 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/net/decnet/Kconfig b/net/decnet/Kconfig
index f3393e154f0f..dcc74956badd 100644
--- a/net/decnet/Kconfig
+++ b/net/decnet/Kconfig
@@ -40,4 +40,3 @@ config DECNET_ROUTER
to work.
See <file:Documentation/networking/decnet.txt> for more information.
-
diff --git a/net/decnet/Makefile b/net/decnet/Makefile
index 9e38122d942b..07b38e441b2d 100644
--- a/net/decnet/Makefile
+++ b/net/decnet/Makefile
@@ -8,4 +8,3 @@ decnet-$(CONFIG_DECNET_ROUTER) += dn_fib.o dn_rules.o dn_table.o
decnet-y += sysctl_net_decnet.o
obj-$(CONFIG_NETFILTER) += netfilter/
-
diff --git a/net/decnet/TODO b/net/decnet/TODO
index ebb5ac69d128..358e9eb49016 100644
--- a/net/decnet/TODO
+++ b/net/decnet/TODO
@@ -16,14 +16,14 @@ Steve's quick list of things that need finishing off:
o Verify errors etc. against POSIX 1003.1g (draft)
- o Using send/recvmsg() to get at connect/disconnect data (POSIX 1003.1g)
+ o Using send/recvmsg() to get at connect/disconnect data (POSIX 1003.1g)
[maybe this should be done at socket level... the control data in the
send/recvmsg() calls should simply be a vector of set/getsockopt()
calls]
o check MSG_CTRUNC is set where it should be.
- o Find all the commonality between DECnet and IPv4 routing code and extract
+ o Find all the commonality between DECnet and IPv4 routing code and extract
it into a small library of routines. [probably a project for 2.7.xx]
o Add perfect socket hashing - an idea suggested by Paul Koning. Currently
@@ -38,4 +38,3 @@ Steve's quick list of things that need finishing off:
o DECnet sendpages() function
o AIO for DECnet
-
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index fce94cbd4378..f78fe58eafc8 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -797,5 +797,3 @@ void __init dn_fib_init(void)
rtnl_register_module(THIS_MODULE, PF_DECnet, RTM_DELROUTE,
dn_fib_rtm_delroute, NULL, 0);
}
-
-
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index 34aba55ed573..2fb5e055ba25 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -912,4 +912,3 @@ int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
return NET_RX_SUCCESS;
}
-
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 56a52a004c56..a1779de6bd9c 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -701,4 +701,3 @@ void dn_nsp_send_conninit(struct sock *sk, unsigned char msgflg)
dn_nsp_send(skb);
}
-
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index e74765024d88..3107a2e24e6b 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1925,4 +1925,3 @@ void __exit dn_route_cleanup(void)
remove_proc_entry("decnet_cache", init_net.proc_net);
dst_entries_destroy(&dn_dst_ops);
}
-
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index 72236695db3d..4a4e3c17740c 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -256,5 +256,3 @@ void __exit dn_fib_rules_cleanup(void)
rtnl_unlock();
rcu_barrier();
}
-
-
diff --git a/net/decnet/netfilter/Makefile b/net/decnet/netfilter/Makefile
index 255c1ae9daeb..b579e52130aa 100644
--- a/net/decnet/netfilter/Makefile
+++ b/net/decnet/netfilter/Makefile
@@ -3,4 +3,3 @@
#
obj-$(CONFIG_DECNET_NF_GRABULATOR) += dn_rtmsg.o
-
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c
index ab395e55cd78..a4faacadd8a8 100644
--- a/net/decnet/netfilter/dn_rtmsg.c
+++ b/net/decnet/netfilter/dn_rtmsg.c
@@ -158,4 +158,3 @@ MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_DNRTMSG);
module_init(dn_rtmsg_init);
module_exit(dn_rtmsg_fini);
-
--
2.18.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox