mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 07:34:06 +08:00
9952f6918d
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 228 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190528171438.107155473@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
58 lines
1.1 KiB
C
58 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2008, Intel Corporation.
|
|
*
|
|
* Author: Alexander Duyck <alexander.h.duyck@intel.com>
|
|
*/
|
|
|
|
#ifndef __NET_TC_SKBEDIT_H
|
|
#define __NET_TC_SKBEDIT_H
|
|
|
|
#include <net/act_api.h>
|
|
#include <linux/tc_act/tc_skbedit.h>
|
|
|
|
struct tcf_skbedit_params {
|
|
u32 flags;
|
|
u32 priority;
|
|
u32 mark;
|
|
u32 mask;
|
|
u16 queue_mapping;
|
|
u16 ptype;
|
|
struct rcu_head rcu;
|
|
};
|
|
|
|
struct tcf_skbedit {
|
|
struct tc_action common;
|
|
struct tcf_skbedit_params __rcu *params;
|
|
};
|
|
#define to_skbedit(a) ((struct tcf_skbedit *)a)
|
|
|
|
/* Return true iff action is mark */
|
|
static inline bool is_tcf_skbedit_mark(const struct tc_action *a)
|
|
{
|
|
#ifdef CONFIG_NET_CLS_ACT
|
|
u32 flags;
|
|
|
|
if (a->ops && a->ops->id == TCA_ID_SKBEDIT) {
|
|
rcu_read_lock();
|
|
flags = rcu_dereference(to_skbedit(a)->params)->flags;
|
|
rcu_read_unlock();
|
|
return flags == SKBEDIT_F_MARK;
|
|
}
|
|
#endif
|
|
return false;
|
|
}
|
|
|
|
static inline u32 tcf_skbedit_mark(const struct tc_action *a)
|
|
{
|
|
u32 mark;
|
|
|
|
rcu_read_lock();
|
|
mark = rcu_dereference(to_skbedit(a)->params)->mark;
|
|
rcu_read_unlock();
|
|
|
|
return mark;
|
|
}
|
|
|
|
#endif /* __NET_TC_SKBEDIT_H */
|