* [PATCH next 0/2] Rename WORD_TRUNC/ROUND macros and use them
From: Marcelo Ricardo Leitner @ 2016-09-20 20:24 UTC (permalink / raw)
To: netdev; +Cc: linux-sctp, Neil Horman, Vlad Yasevich, David Miller,
David Laight
This patchset aims to rename these macros to a non-confusing name, as
reported by David Laight and David Miller, and to update all remaining
places to make use of it, which was 1 last remaining spot.
Details on the specific changelogs.
Thanks!
Marcelo Ricardo Leitner (2):
sctp: rename WORD_TRUNC/ROUND macros
sctp: make use of WORD_TRUNC macro
include/net/sctp/sctp.h | 10 +++++-----
net/netfilter/xt_sctp.c | 2 +-
net/sctp/associola.c | 2 +-
net/sctp/chunk.c | 13 +++++++------
net/sctp/input.c | 8 ++++----
net/sctp/inqueue.c | 2 +-
net/sctp/output.c | 12 ++++++------
net/sctp/sm_make_chunk.c | 26 +++++++++++++-------------
net/sctp/sm_statefuns.c | 6 +++---
net/sctp/transport.c | 4 ++--
net/sctp/ulpevent.c | 4 ++--
11 files changed, 45 insertions(+), 44 deletions(-)
--
2.7.4
^ permalink raw reply
* Re: [RFC PATCH] xdp: separate struct xdp_prog as container for bpf_prog
From: Daniel Borkmann @ 2016-09-20 20:21 UTC (permalink / raw)
To: Jesper Dangaard Brouer, netdev, tariqt
Cc: tom, bblanco, Alexei Starovoitov, Eric Dumazet
In-Reply-To: <20160920195458.21735.21873.stgit@firesoul>
On 09/20/2016 09:55 PM, Jesper Dangaard Brouer wrote:
> Currently the XDP program is simply a bpf_prog pointer. While it
> is good for simplicity, it is limiting extendability for upcoming
> features.
>
> Introducing a new struct xdp_prog, that can carry information
> related to the XDP program. Notice this approach does not affect
> performance (tested and benchmarked), because the extra dereference
> for the eBPF program only happens once per 64 packets in the poll
> function.
>
> The features that need this is:
>
> * Multi-port TX:
> Need to know own port index and port lookup table.
>
> * XDP program per RX queue:
> Need setup info about program type, global or specific, due to
> replace semantics.
>
> * Capabilities negotiation:
> Need to store information about features program want to use,
> in-order to validate this.
>
> I do realize this new struct xdp_prog features cannot go into the
> kernel before one of the three users of the struct is also implemented.
Yep, so this whole wrapper structure which adds yet another mgmt layer
with ref'counting etc is kind of hard to judge whether it's into the
right direction w/o showing a user of this struct. Each BPF prog does
have struct bpf_prog_aux, where we store auxiliary data, so I'd recommend
to try extending this with some private data, which can be for XDP type
etc since we know it's an XDP prog anyway. Or is there a specific reason
that this is impossible to do, resp. limiting?
^ permalink raw reply
* [PATCH 2/2] posix-timers: make it configurable
From: Nicolas Pitre @ 2016-09-20 19:56 UTC (permalink / raw)
To: John Stultz
Cc: Thomas Gleixner, Richard Cochran, Josh Triplett, netdev,
linux-kernel
In-Reply-To: <1474401400-18491-1-git-send-email-nicolas.pitre@linaro.org>
Many embedded systems typically don't need them. This removes about
22KB from the kernel binary size on ARM when configured out.
Corresponding syscalls are routed to a stub logging the attempt to
use those syscalls which should be enough of a clue if they were
disabled without proper consideration. They are: timer_create,
timer_gettime: timer_getoverrun, timer_settime, timer_delete,
clock_adjtime.
The clock_settime, clock_gettime, clock_getres and clock_nanosleep syscalls
are replaced by simple wrappers compatible with CLOCK_REALTIME,
CLOCK_MONOTONIC and CLOCK_BOOTTIME only.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
---
drivers/ptp/Kconfig | 2 +-
include/linux/posix-timers.h | 28 +++++++++-
include/linux/sched.h | 10 ++++
init/Kconfig | 17 +++++++
kernel/signal.c | 4 ++
kernel/time/Kconfig | 1 +
kernel/time/Makefile | 10 +++-
kernel/time/posix-stubs.c | 118 +++++++++++++++++++++++++++++++++++++++++++
8 files changed, 185 insertions(+), 5 deletions(-)
create mode 100644 kernel/time/posix-stubs.c
diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
index f34b3748c0..940fa10907 100644
--- a/drivers/ptp/Kconfig
+++ b/drivers/ptp/Kconfig
@@ -10,7 +10,7 @@ config PTP_1588_CLOCK_SELECTED
config PTP_1588_CLOCK
tristate "PTP clock support"
default PTP_1588_CLOCK_SELECTED
- depends on NET
+ depends on NET && POSIX_TIMERS
select PPS
select NET_PTP_CLASSIFY
help
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 62d44c1760..2288c5c557 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -118,6 +118,8 @@ struct k_clock {
extern struct k_clock clock_posix_cpu;
extern struct k_clock clock_posix_dynamic;
+#ifdef CONFIG_POSIX_TIMERS
+
void posix_timers_register_clock(const clockid_t clock_id, struct k_clock *new_clock);
/* function to call to trigger timer event */
@@ -131,8 +133,30 @@ void posix_cpu_timers_exit_group(struct task_struct *task);
void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
cputime_t *newval, cputime_t *oldval);
-long clock_nanosleep_restart(struct restart_block *restart_block);
-
void update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new);
+#else
+
+#include <linux/random.h>
+
+static inline void posix_timers_register_clock(const clockid_t clock_id,
+ struct k_clock *new_clock) {}
+static inline int posix_timer_event(struct k_itimer *timr, int si_private)
+{ return 0; }
+static inline void run_posix_cpu_timers(struct task_struct *task) {}
+static inline void posix_cpu_timers_exit(struct task_struct *task)
+{
+ add_device_randomness((const void*) &task->se.sum_exec_runtime,
+ sizeof(unsigned long long));
+}
+static inline void posix_cpu_timers_exit_group(struct task_struct *task) {}
+static inline void set_process_cpu_timer(struct task_struct *task,
+ unsigned int clock_idx, cputime_t *newval, cputime_t *oldval) {}
+static inline void update_rlimit_cpu(struct task_struct *task,
+ unsigned long rlim_new) {}
+
+#endif
+
+long clock_nanosleep_restart(struct restart_block *restart_block);
+
#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 54182d52a0..39a1d6d3f5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2924,8 +2924,13 @@ static inline void exit_thread(struct task_struct *tsk)
extern void exit_files(struct task_struct *);
extern void __cleanup_sighand(struct sighand_struct *);
+#ifdef CONFIG_POSIX_TIMERS
extern void exit_itimers(struct signal_struct *);
extern void flush_itimer_signals(void);
+#else
+static inline void exit_itimers(struct signal_struct *s) {}
+static inline void flush_itimer_signals(void) {}
+#endif
extern void do_group_exit(int);
@@ -3382,7 +3387,12 @@ static __always_inline bool need_resched(void)
* Thread group CPU time accounting.
*/
void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
+#ifdef CONFIG_POSIX_TIMERS
void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
+#else
+static inline void thread_group_cputimer(struct task_struct *tsk,
+ struct task_cputime *times) {}
+#endif
/*
* Reevaluate whether the task has signals pending delivery.
diff --git a/init/Kconfig b/init/Kconfig
index a117738afd..3fdea723dd 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1449,6 +1449,23 @@ config SYSCTL_SYSCALL
If unsure say N here.
+config POSIX_TIMERS
+ bool "Posix Clocks & timers" if EXPERT
+ default y
+ help
+ This includes native support for POSIX timers to the kernel.
+ Most embedded systems may have no use for them and therefore they
+ can be configured out to reduce the size of the kernel image.
+
+ When this option is disabled, the following syscalls won't be
+ available: timer_create, timer_gettime: timer_getoverrun,
+ timer_settime, timer_delete, clock_adjtime. Furthermore, the
+ clock_settime, clock_gettime, clock_getres and clock_nanosleep
+ syscalls will be limited to CLOCK_REALTIME and CLOCK_MONOTONIC
+ only.
+
+ If unsure say y.
+
config KALLSYMS
bool "Load all symbols for debugging/ksymoops" if EXPERT
default y
diff --git a/kernel/signal.c b/kernel/signal.c
index af21afc00d..ea75065e29 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -427,6 +427,7 @@ void flush_signals(struct task_struct *t)
spin_unlock_irqrestore(&t->sighand->siglock, flags);
}
+#ifdef CONFIG_POSIX_TIMERS
static void __flush_itimer_signals(struct sigpending *pending)
{
sigset_t signal, retain;
@@ -460,6 +461,7 @@ void flush_itimer_signals(void)
__flush_itimer_signals(&tsk->signal->shared_pending);
spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
}
+#endif
void ignore_signals(struct task_struct *t)
{
@@ -611,6 +613,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
*/
current->jobctl |= JOBCTL_STOP_DEQUEUED;
}
+#ifdef CONFIG_POSIX_TIMERS
if ((info->si_code & __SI_MASK) == __SI_TIMER && info->si_sys_private) {
/*
* Release the siglock to ensure proper locking order
@@ -622,6 +625,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
do_schedule_next_timer(info);
spin_lock(&tsk->sighand->siglock);
}
+#endif
return signr;
}
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 62824f2fe4..a3817ef652 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -195,3 +195,4 @@ config HIGH_RES_TIMERS
endmenu
endif
+
diff --git a/kernel/time/Makefile b/kernel/time/Makefile
index 49eca0beed..fc26c308f5 100644
--- a/kernel/time/Makefile
+++ b/kernel/time/Makefile
@@ -1,6 +1,12 @@
-obj-y += time.o timer.o hrtimer.o itimer.o posix-timers.o posix-cpu-timers.o
+obj-y += time.o timer.o hrtimer.o itimer.o
obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o
-obj-y += timeconv.o timecounter.o posix-clock.o alarmtimer.o
+obj-y += timeconv.o timecounter.o alarmtimer.o
+
+ifeq ($(CONFIG_POSIX_TIMERS),y)
+ obj-y += posix-timers.o posix-cpu-timers.o posix-clock.o
+else
+ obj-y += posix-stubs.o
+endif
obj-$(CONFIG_GENERIC_CLOCKEVENTS) += clockevents.o tick-common.o
ifeq ($(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST),y)
diff --git a/kernel/time/posix-stubs.c b/kernel/time/posix-stubs.c
new file mode 100644
index 0000000000..fe857bd4a0
--- /dev/null
+++ b/kernel/time/posix-stubs.c
@@ -0,0 +1,118 @@
+/*
+ * Dummy stubs used when CONFIG_POSIX_TIMERS=n
+ *
+ * Created by: Nicolas Pitre, July 2016
+ * Copyright: (C) 2016 Linaro Limited
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/linkage.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/syscalls.h>
+#include <linux/ktime.h>
+#include <linux/timekeeping.h>
+#include <linux/posix-timers.h>
+
+asmlinkage long sys_ni_posix_timers(void)
+{
+ pr_err_once("process %d (%s) attempted a POSIX timer syscall "
+ "while CONFIG_POSIX_TIMERS is not set\n",
+ current->pid, current->comm);
+ return -ENOSYS;
+}
+
+#define SYS_NI(name) SYSCALL_ALIAS(sys_##name, sys_ni_posix_timers)
+
+SYS_NI(timer_create);
+SYS_NI(timer_gettime);
+SYS_NI(timer_getoverrun);
+SYS_NI(timer_settime);
+SYS_NI(timer_delete);
+SYS_NI(clock_adjtime);
+
+/*
+ * We preserve minimal support for CLOCK_REALTIME and CLOCK_MONOTONIC
+ * as it is easy to remain compatible with little code. CLOCK_BOOTTIME
+ * is also included for convenience as at least systemd uses it.
+ */
+
+SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
+ const struct timespec __user *, tp)
+{
+ struct timespec new_tp;
+
+ if (which_clock != CLOCK_REALTIME)
+ return -EINVAL;
+ if (copy_from_user(&new_tp, tp, sizeof (*tp)))
+ return -EFAULT;
+ return do_sys_settimeofday(&new_tp, NULL);
+}
+
+SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
+ struct timespec __user *,tp)
+{
+ struct timespec kernel_tp;
+
+ switch (which_clock) {
+ case CLOCK_REALTIME: ktime_get_real_ts(&kernel_tp); break;
+ case CLOCK_MONOTONIC: ktime_get_ts(&kernel_tp); break;
+ case CLOCK_BOOTTIME: get_monotonic_boottime(&kernel_tp); break;
+ default: return -EINVAL;
+ }
+ if (copy_to_user(tp, &kernel_tp, sizeof (kernel_tp)))
+ return -EFAULT;
+ return 0;
+}
+
+SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp)
+{
+ struct timespec rtn_tp = {
+ .tv_sec = 0,
+ .tv_nsec = hrtimer_resolution,
+ };
+
+ switch (which_clock) {
+ case CLOCK_REALTIME:
+ case CLOCK_MONOTONIC:
+ case CLOCK_BOOTTIME:
+ if (copy_to_user(tp, &rtn_tp, sizeof(rtn_tp)))
+ return -EFAULT;
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
+ const struct timespec __user *, rqtp,
+ struct timespec __user *, rmtp)
+{
+ struct timespec t;
+
+ switch (which_clock) {
+ case CLOCK_REALTIME:
+ case CLOCK_MONOTONIC:
+ case CLOCK_BOOTTIME:
+ if (copy_from_user(&t, rqtp, sizeof (struct timespec)))
+ return -EFAULT;
+ if (!timespec_valid(&t))
+ return -EINVAL;
+ return hrtimer_nanosleep(&t, rmtp, flags & TIMER_ABSTIME ?
+ HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
+ which_clock);
+ default:
+ return -EINVAL;
+ }
+}
+
+#ifdef CONFIG_COMPAT
+long clock_nanosleep_restart(struct restart_block *restart_block)
+{
+ return hrtimer_nanosleep_restart(restart_block);
+}
+#endif
--
2.7.4
^ permalink raw reply related
* [PATCH 1/2] ptp_clock: allow for it to be optional
From: Nicolas Pitre @ 2016-09-20 19:56 UTC (permalink / raw)
To: John Stultz
Cc: Thomas Gleixner, Richard Cochran, Josh Triplett, netdev,
linux-kernel
In-Reply-To: <1474401400-18491-1-git-send-email-nicolas.pitre@linaro.org>
In order to break the hard dependency between the PTP clock subsystem and
ethernet drivers capable of being clock providers, this patch provides
simple PTP stub functions to allow linkage of those drivers into the
kernel even when the PTP subsystem is configured out.
And to make it possible for PTP to be configured out, the select statement
in the Kconfig entry for those ethernet drivers is changed from selecting
PTP_1588_CLOCK to PTP_1588_CLOCK_SELECTED whose purpose is to indicate the
default Kconfig value for the PTP subsystem.
This way the PTP subsystem may have Kconfig dependencies of its own, such
as POSIX_TIMERS, without making those ethernet drivers unavailable if
POSIX timers are cconfigured out. And when support for POSIX timers is
selected again then PTP clock support will also be selected accordingly.
Drivers must be ready to accept NULL from ptp_clock_register().
The pch_gbe driver is a bit special as it relies on extra code in
drivers/ptp/ptp_pch.c. Therefore we let the make process descend into
drivers/ptp/ even if PTP_1588_CLOCK is unselected.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Eugenia Emantayev <eugenia@mellanox.com>
---
drivers/Makefile | 2 +-
drivers/net/ethernet/adi/Kconfig | 8 ++-
drivers/net/ethernet/amd/Kconfig | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 6 +-
drivers/net/ethernet/broadcom/Kconfig | 4 +-
drivers/net/ethernet/cavium/Kconfig | 2 +-
drivers/net/ethernet/freescale/Kconfig | 2 +-
drivers/net/ethernet/intel/Kconfig | 10 ++--
drivers/net/ethernet/intel/e1000e/ptp.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_ptp.c | 2 +-
drivers/net/ethernet/intel/igb/igb_ptp.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/Kconfig | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_clock.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_clock.c | 2 +-
drivers/net/ethernet/renesas/Kconfig | 2 +-
drivers/net/ethernet/samsung/Kconfig | 2 +-
drivers/net/ethernet/sfc/Kconfig | 2 +-
drivers/net/ethernet/sfc/ptp.c | 14 ++---
drivers/net/ethernet/stmicro/stmmac/Kconfig | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 +-
drivers/net/ethernet/ti/Kconfig | 2 +-
drivers/net/ethernet/tile/Kconfig | 2 +-
drivers/ptp/Kconfig | 12 ++--
include/linux/ptp_clock_kernel.h | 64 ++++++++++++++++------
26 files changed, 97 insertions(+), 59 deletions(-)
diff --git a/drivers/Makefile b/drivers/Makefile
index 53abb4a5f7..8a538d0856 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -105,7 +105,7 @@ obj-$(CONFIG_INPUT) += input/
obj-$(CONFIG_RTC_LIB) += rtc/
obj-y += i2c/ media/
obj-$(CONFIG_PPS) += pps/
-obj-$(CONFIG_PTP_1588_CLOCK) += ptp/
+obj-y += ptp/
obj-$(CONFIG_W1) += w1/
obj-y += power/
obj-$(CONFIG_HWMON) += hwmon/
diff --git a/drivers/net/ethernet/adi/Kconfig b/drivers/net/ethernet/adi/Kconfig
index 6b94ba6103..67094a9cfe 100644
--- a/drivers/net/ethernet/adi/Kconfig
+++ b/drivers/net/ethernet/adi/Kconfig
@@ -55,10 +55,14 @@ config BFIN_RX_DESC_NUM
---help---
Set the number of buffer packets used in driver.
+config BFIN_MAC_HAS_HWSTAMP
+ def_tristate BFIN_MAC
+ depends on BF518
+ select PTP_1588_CLOCK_SELECTED
+
config BFIN_MAC_USE_HWSTAMP
bool "Use IEEE 1588 hwstamp"
- depends on BFIN_MAC && BF518
- select PTP_1588_CLOCK
+ depends on BFIN_MAC_HAS_HWSTAMP && PTP_1588_CLOCK
default y
---help---
To support the IEEE 1588 Precision Time Protocol (PTP), select y here
diff --git a/drivers/net/ethernet/amd/Kconfig b/drivers/net/ethernet/amd/Kconfig
index 0038709fd3..327e71a554 100644
--- a/drivers/net/ethernet/amd/Kconfig
+++ b/drivers/net/ethernet/amd/Kconfig
@@ -177,7 +177,7 @@ config AMD_XGBE
depends on ARM64 || COMPILE_TEST
select BITREVERSE
select CRC32
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports the AMD 10GbE Ethernet device found on an
AMD SoC.
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index 3eee3201b5..4aeeb018b6 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -773,7 +773,8 @@ static int xgbe_probe(struct platform_device *pdev)
goto err_wq;
}
- xgbe_ptp_register(pdata);
+ if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
+ xgbe_ptp_register(pdata);
xgbe_debugfs_init(pdata);
@@ -812,7 +813,8 @@ static int xgbe_remove(struct platform_device *pdev)
xgbe_debugfs_exit(pdata);
- xgbe_ptp_unregister(pdata);
+ if (IS_REACHABLE(CONFIG_PTP_1588_CLOCK))
+ xgbe_ptp_unregister(pdata);
flush_workqueue(pdata->an_workqueue);
destroy_workqueue(pdata->an_workqueue);
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index bd8c80c0b7..3db7eca92c 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -110,7 +110,7 @@ config TIGON3
depends on PCI
select PHYLIB
select HWMON
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
@@ -120,7 +120,7 @@ config TIGON3
config BNX2X
tristate "Broadcom NetXtremeII 10Gb support"
depends on PCI
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
select FW_LOADER
select ZLIB_INFLATE
select LIBCRC32C
diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
index e1b78b5003..5dd86cf683 100644
--- a/drivers/net/ethernet/cavium/Kconfig
+++ b/drivers/net/ethernet/cavium/Kconfig
@@ -53,7 +53,7 @@ config THUNDER_NIC_RGX
config LIQUIDIO
tristate "Cavium LiquidIO support"
depends on 64BIT
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
select FW_LOADER
select LIBCRC32C
---help---
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index d1ca45fbb1..775dbfeb7b 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -25,7 +25,7 @@ config FEC
ARCH_MXC || SOC_IMX28)
default ARCH_MXC || SOC_IMX28 if ARM
select PHYLIB
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
Say Y here if you want to use the built-in 10/100 Fast ethernet
controller on some Motorola ColdFire and Freescale i.MX processors.
diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index c0e17433f6..8bbfb43f09 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -58,7 +58,7 @@ config E1000E
tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
depends on PCI && (!SPARC32 || BROKEN)
select CRC32
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports the PCI-Express Intel(R) PRO/1000 gigabit
ethernet family of adapters. For PCI or PCI-X e1000 adapters,
@@ -83,7 +83,7 @@ config E1000E_HWTS
config IGB
tristate "Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support"
depends on PCI
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
select I2C
select I2C_ALGOBIT
---help---
@@ -156,7 +156,7 @@ config IXGBE
tristate "Intel(R) 10GbE PCI Express adapters support"
depends on PCI
select MDIO
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports Intel(R) 10GbE PCI Express family of
adapters. For more information on how to identify your adapter, go
@@ -213,7 +213,7 @@ config IXGBEVF
config I40E
tristate "Intel(R) Ethernet Controller XL710 Family support"
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
depends on PCI
---help---
This driver supports Intel(R) Ethernet Controller XL710 Family of
@@ -264,7 +264,7 @@ config FM10K
tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support"
default n
depends on PCI_MSI
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports Intel(R) FM10000 Ethernet Switch Host
Interface. For more information on how to identify your adapter,
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
index 2e1b17ad52..ad03763e00 100644
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -334,7 +334,7 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
if (IS_ERR(adapter->ptp_clock)) {
adapter->ptp_clock = NULL;
e_err("ptp_clock_register failed\n");
- } else {
+ } else if (adapter->ptp_clock) {
e_info("registered PHC clock\n");
}
}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index ed39cbad24..f1feceab75 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -669,7 +669,7 @@ void i40e_ptp_init(struct i40e_pf *pf)
pf->ptp_clock = NULL;
dev_err(&pf->pdev->dev, "%s: ptp_clock_register failed\n",
__func__);
- } else {
+ } else if (pf->ptp_clock) {
struct timespec64 ts;
u32 regval;
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 66dfa2085c..1dd14e166d 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -1159,7 +1159,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
if (IS_ERR(adapter->ptp_clock)) {
adapter->ptp_clock = NULL;
dev_err(&adapter->pdev->dev, "ptp_clock_register failed\n");
- } else {
+ } else if (adapter->ptp_clock) {
dev_info(&adapter->pdev->dev, "added PHC on %s\n",
adapter->netdev->name);
adapter->ptp_flags |= IGB_PTP_ENABLED;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index e5431bfe33..a92277683a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -1254,7 +1254,7 @@ static long ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
adapter->ptp_clock = NULL;
e_dev_err("ptp_clock_register failed\n");
return err;
- } else
+ } else if (adapter->ptp_clock)
e_dev_info("registered PHC device on %s\n", netdev->name);
/* set default timestamp mode to disabled here. We do this in
diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
index 5098e7f219..b2998bc5ab 100644
--- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
@@ -7,7 +7,7 @@ config MLX4_EN
depends on MAY_USE_DEVLINK
depends on PCI
select MLX4_CORE
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports Mellanox Technologies ConnectX Ethernet
devices.
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index 1494997c4f..08fc5fc56d 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -298,7 +298,7 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
if (IS_ERR(mdev->ptp_clock)) {
mdev->ptp_clock = NULL;
mlx4_err(mdev, "ptp_clock_register failed\n");
- } else {
+ } else if (mdev->ptp_clock) {
mlx4_info(mdev, "registered PHC clock\n");
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index aae46884bf..0d679346dc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -14,7 +14,7 @@ config MLX5_CORE
config MLX5_CORE_EN
bool "Mellanox Technologies ConnectX-4 Ethernet support"
depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
default n
---help---
Ethernet support in Mellanox Technologies ConnectX-4 NIC.
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c b/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c
index 847a8f3ac2..13dc388667 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_clock.c
@@ -273,7 +273,7 @@ void mlx5e_timestamp_init(struct mlx5e_priv *priv)
tstamp->ptp = ptp_clock_register(&tstamp->ptp_info,
&priv->mdev->pdev->dev);
- if (IS_ERR_OR_NULL(tstamp->ptp)) {
+ if (IS_ERR(tstamp->ptp)) {
mlx5_core_warn(priv->mdev, "ptp_clock_register failed %ld\n",
PTR_ERR(tstamp->ptp));
tstamp->ptp = NULL;
diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 4f132cf177..6862a9c1b6 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -37,7 +37,7 @@ config RAVB
select MII
select MDIO_BITBANG
select PHYLIB
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
help
Renesas Ethernet AVB device driver.
This driver supports the following SoCs:
diff --git a/drivers/net/ethernet/samsung/Kconfig b/drivers/net/ethernet/samsung/Kconfig
index 2360d81507..121b7e4426 100644
--- a/drivers/net/ethernet/samsung/Kconfig
+++ b/drivers/net/ethernet/samsung/Kconfig
@@ -21,7 +21,7 @@ config SXGBE_ETH
depends on HAS_IOMEM && HAS_DMA
select PHYLIB
select CRC32
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This is the driver for the SXGBE 10G Ethernet IP block found on
Samsung platforms.
diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig
index 4dd92b7b80..472152bd72 100644
--- a/drivers/net/ethernet/sfc/Kconfig
+++ b/drivers/net/ethernet/sfc/Kconfig
@@ -5,7 +5,7 @@ config SFC
select CRC32
select I2C
select I2C_ALGOBIT
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports 10/40-gigabit Ethernet cards based on
the Solarflare SFC4000, SFC9000-family and SFC9100-family
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index dd204d9704..77a5364f7a 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1269,13 +1269,13 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
if (IS_ERR(ptp->phc_clock)) {
rc = PTR_ERR(ptp->phc_clock);
goto fail3;
- }
-
- INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
- ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
- if (!ptp->pps_workwq) {
- rc = -ENOMEM;
- goto fail4;
+ } else if (ptp->phc_clock) {
+ INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
+ ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
+ if (!ptp->pps_workwq) {
+ rc = -ENOMEM;
+ goto fail4;
+ }
}
}
ptp->nic_ts_enabled = false;
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index 8f06a6621a..578e5a15cb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -4,7 +4,7 @@ config STMMAC_ETH
select MII
select PHYLIB
select CRC32
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
select RESET_CONTROLLER
---help---
This is the driver for the Ethernet IPs are built around a
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 170a18b612..6e3b82972c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -187,7 +187,7 @@ int stmmac_ptp_register(struct stmmac_priv *priv)
if (IS_ERR(priv->ptp_clock)) {
priv->ptp_clock = NULL;
pr_err("ptp_clock_register() failed on %s\n", priv->dev->name);
- } else
+ } else if (priv->ptp_clock)
pr_debug("Added PTP HW clock successfully on %s\n",
priv->dev->name);
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index 9904d740d5..bc895114c9 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -76,7 +76,7 @@ config TI_CPSW
config TI_CPTS
bool "TI Common Platform Time Sync (CPTS) Support"
depends on TI_CPSW
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
---help---
This driver supports the Common Platform Time Sync unit of
the CPSW Ethernet Switch. The unit can time stamp PTP UDP/IPv4
diff --git a/drivers/net/ethernet/tile/Kconfig b/drivers/net/ethernet/tile/Kconfig
index f59a6c2653..b6ba43c78c 100644
--- a/drivers/net/ethernet/tile/Kconfig
+++ b/drivers/net/ethernet/tile/Kconfig
@@ -9,7 +9,7 @@ config TILE_NET
select CRC32
select TILE_GXIO_MPIPE if TILEGX
select HIGH_RES_TIMERS if TILEGX
- select PTP_1588_CLOCK if TILEGX
+ select PTP_1588_CLOCK_SELECTED if TILEGX
---help---
This is a standard Linux network device driver for the
on-chip Tilera Gigabit Ethernet and XAUI interfaces.
diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
index ee3de3421f..f34b3748c0 100644
--- a/drivers/ptp/Kconfig
+++ b/drivers/ptp/Kconfig
@@ -4,8 +4,12 @@
menu "PTP clock support"
+config PTP_1588_CLOCK_SELECTED
+ tristate
+
config PTP_1588_CLOCK
tristate "PTP clock support"
+ default PTP_1588_CLOCK_SELECTED
depends on NET
select PPS
select NET_PTP_CLASSIFY
@@ -28,7 +32,7 @@ config PTP_1588_CLOCK
config PTP_1588_CLOCK_GIANFAR
tristate "Freescale eTSEC as PTP clock"
depends on GIANFAR
- select PTP_1588_CLOCK
+ depends on PTP_1588_CLOCK
default y
help
This driver adds support for using the eTSEC as a PTP
@@ -42,7 +46,7 @@ config PTP_1588_CLOCK_GIANFAR
config PTP_1588_CLOCK_IXP46X
tristate "Intel IXP46x as PTP clock"
depends on IXP4XX_ETH
- select PTP_1588_CLOCK
+ depends on PTP_1588_CLOCK
default y
help
This driver adds support for using the IXP46X as a PTP
@@ -60,7 +64,7 @@ config DP83640_PHY
tristate "Driver for the National Semiconductor DP83640 PHYTER"
depends on NETWORK_PHY_TIMESTAMPING
depends on PHYLIB
- select PTP_1588_CLOCK
+ depends on PTP_1588_CLOCK
---help---
Supports the DP83640 PHYTER with IEEE 1588 features.
@@ -76,7 +80,7 @@ config PTP_1588_CLOCK_PCH
tristate "Intel PCH EG20T as PTP clock"
depends on X86_32 || COMPILE_TEST
depends on HAS_IOMEM && NET
- select PTP_1588_CLOCK
+ select PTP_1588_CLOCK_SELECTED
help
This driver adds support for using the PCH EG20T as a PTP
clock. The hardware supports time stamping of PTP packets
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
index 6b15e16814..ee09206891 100644
--- a/include/linux/ptp_clock_kernel.h
+++ b/include/linux/ptp_clock_kernel.h
@@ -122,24 +122,6 @@ struct ptp_clock_info {
struct ptp_clock;
-/**
- * ptp_clock_register() - register a PTP hardware clock driver
- *
- * @info: Structure describing the new clock.
- * @parent: Pointer to the parent device of the new clock.
- */
-
-extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
- struct device *parent);
-
-/**
- * ptp_clock_unregister() - unregister a PTP hardware clock driver
- *
- * @ptp: The clock to remove from service.
- */
-
-extern int ptp_clock_unregister(struct ptp_clock *ptp);
-
enum ptp_clock_events {
PTP_CLOCK_ALARM,
@@ -166,6 +148,31 @@ struct ptp_clock_event {
};
};
+#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
+
+/**
+ * ptp_clock_register() - register a PTP hardware clock driver
+ *
+ * @info: Structure describing the new clock.
+ * @parent: Pointer to the parent device of the new clock.
+ *
+ * Returns a valid pointer on success or PTR_ERR on failure. If PHC
+ * support is missing at the configuration level, this function
+ * returns NULL, and drivers are expected to gracefully handle that
+ * case separately.
+ */
+
+extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
+ struct device *parent);
+
+/**
+ * ptp_clock_unregister() - unregister a PTP hardware clock driver
+ *
+ * @ptp: The clock to remove from service.
+ */
+
+extern int ptp_clock_unregister(struct ptp_clock *ptp);
+
/**
* ptp_clock_event() - notify the PTP layer about an event
*
@@ -197,4 +204,25 @@ extern int ptp_clock_index(struct ptp_clock *ptp);
int ptp_find_pin(struct ptp_clock *ptp,
enum ptp_pin_function func, unsigned int chan);
+#else
+static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
+ struct device *parent)
+{
+ if (IS_MODULE(CONFIG_PTP_1588_CLOCK))
+ pr_warn("%s is built-in while PTP clock subsystem is modular, "
+ "PTP clock ignored\n", KBUILD_MODNAME);
+ return NULL;
+}
+static inline int ptp_clock_unregister(struct ptp_clock *ptp)
+{ return 0; }
+static inline void ptp_clock_event(struct ptp_clock *ptp,
+ struct ptp_clock_event *event)
+{ (void)event; }
+static inline int ptp_clock_index(struct ptp_clock *ptp)
+{ return -1; }
+static inline int ptp_find_pin(struct ptp_clock *ptp,
+ enum ptp_pin_function func, unsigned int chan)
+{ return -1; }
+#endif
+
#endif
--
2.7.4
^ permalink raw reply related
* [PATCH v2 0/2] make POSIX timers optional
From: Nicolas Pitre @ 2016-09-20 19:56 UTC (permalink / raw)
To: John Stultz
Cc: Thomas Gleixner, Richard Cochran, Josh Triplett, netdev,
linux-kernel
Many embedded systems don't need the full POSIX timer support.
Configuring them out provides a nice kernel image size reduction.
When POSIX timers are configured out, the PTP clock subsystem should be
left out as well. However a bunch of ethernet drivers currently *select*
it in their Kconfig entries. Therefore some more tweaks were needed to
break that hard dependency for those drivers to still be configured in
if desired.
It was agreed that the best path upstream for those patches is via
John Stultz's timer tree.
Previous itterations of those patches and the discussion threads can be
found here:
https://lkml.org/lkml/2016/9/14/992
https://lkml.org/lkml/2016/9/14/803
https://lkml.org/lkml/2016/9/8/793
Changes from v1:
- Add a warning for the case where PTP clock subsystem is modular and a
driver providing a clock is built-in rather than silently ignoring it.
Suggested by Jiri Benc.
- Added Eugenia Emantayev's reviewed-by tag.
diffstat:
drivers/Makefile | 2 +-
drivers/net/ethernet/adi/Kconfig | 8 +-
drivers/net/ethernet/amd/Kconfig | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 6 +-
drivers/net/ethernet/broadcom/Kconfig | 4 +-
drivers/net/ethernet/cavium/Kconfig | 2 +-
drivers/net/ethernet/freescale/Kconfig | 2 +-
drivers/net/ethernet/intel/Kconfig | 10 +-
drivers/net/ethernet/intel/e1000e/ptp.c | 2 +-
drivers/net/ethernet/intel/i40e/i40e_ptp.c | 2 +-
drivers/net/ethernet/intel/igb/igb_ptp.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/Kconfig | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_clock.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 2 +-
.../net/ethernet/mellanox/mlx5/core/en_clock.c | 2 +-
drivers/net/ethernet/renesas/Kconfig | 2 +-
drivers/net/ethernet/samsung/Kconfig | 2 +-
drivers/net/ethernet/sfc/Kconfig | 2 +-
drivers/net/ethernet/sfc/ptp.c | 14 +--
drivers/net/ethernet/stmicro/stmmac/Kconfig | 2 +-
.../net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 +-
drivers/net/ethernet/ti/Kconfig | 2 +-
drivers/net/ethernet/tile/Kconfig | 2 +-
drivers/ptp/Kconfig | 14 ++-
include/linux/posix-timers.h | 28 ++++-
include/linux/ptp_clock_kernel.h | 64 +++++++---
include/linux/sched.h | 10 ++
init/Kconfig | 17 +++
kernel/signal.c | 4 +
kernel/time/Kconfig | 1 +
kernel/time/Makefile | 10 +-
kernel/time/posix-stubs.c | 118 ++++++++++++++++++
33 files changed, 282 insertions(+), 64 deletions(-)
^ permalink raw reply
* [RFC PATCH] xdp: separate struct xdp_prog as container for bpf_prog
From: Jesper Dangaard Brouer @ 2016-09-20 19:55 UTC (permalink / raw)
To: netdev, tariqt
Cc: tom, bblanco, Alexei Starovoitov, Eric Dumazet,
Jesper Dangaard Brouer
Currently the XDP program is simply a bpf_prog pointer. While it
is good for simplicity, it is limiting extendability for upcoming
features.
Introducing a new struct xdp_prog, that can carry information
related to the XDP program. Notice this approach does not affect
performance (tested and benchmarked), because the extra dereference
for the eBPF program only happens once per 64 packets in the poll
function.
The features that need this is:
* Multi-port TX:
Need to know own port index and port lookup table.
* XDP program per RX queue:
Need setup info about program type, global or specific, due to
replace semantics.
* Capabilities negotiation:
Need to store information about features program want to use,
in-order to validate this.
I do realize this new struct xdp_prog features cannot go into the
kernel before one of the three users of the struct is also implemented.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 12 +++---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 10 +++--
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 -
include/linux/filter.h | 14 +++++++
include/linux/netdevice.h | 2 -
net/core/dev.c | 15 +++++--
net/core/filter.c | 50 ++++++++++++++++++++++++
7 files changed, 89 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 62516f8369ba..f86f65b170f7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2622,11 +2622,11 @@ static int mlx4_en_set_tx_maxrate(struct net_device *dev, int queue_index, u32 m
return err;
}
-static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
+static int mlx4_xdp_set(struct net_device *dev, struct xdp_prog *prog)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
- struct bpf_prog *old_prog;
+ struct xdp_prog *old_prog;
int xdp_ring_num;
int port_up = 0;
int err;
@@ -2639,7 +2639,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
*/
if (priv->xdp_ring_num == xdp_ring_num) {
if (prog) {
- prog = bpf_prog_add(prog, priv->rx_ring_num - 1);
+ prog = xdp_prog_add(prog, priv->rx_ring_num);
if (IS_ERR(prog))
return PTR_ERR(prog);
}
@@ -2650,7 +2650,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
lockdep_is_held(&mdev->state_lock));
rcu_assign_pointer(priv->rx_ring[i]->xdp_prog, prog);
if (old_prog)
- bpf_prog_put(old_prog);
+ xdp_prog_put(old_prog);
}
mutex_unlock(&mdev->state_lock);
return 0;
@@ -2669,7 +2669,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
}
if (prog) {
- prog = bpf_prog_add(prog, priv->rx_ring_num - 1);
+ prog = xdp_prog_add(prog, priv->rx_ring_num);
if (IS_ERR(prog))
return PTR_ERR(prog);
}
@@ -2690,7 +2690,7 @@ static int mlx4_xdp_set(struct net_device *dev, struct bpf_prog *prog)
lockdep_is_held(&mdev->state_lock));
rcu_assign_pointer(priv->rx_ring[i]->xdp_prog, prog);
if (old_prog)
- bpf_prog_put(old_prog);
+ xdp_prog_put(old_prog);
}
if (port_up) {
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index c46355bce613..e1182879ea6f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -535,13 +535,13 @@ void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
{
struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_rx_ring *ring = *pring;
- struct bpf_prog *old_prog;
+ struct xdp_prog *old_prog;
old_prog = rcu_dereference_protected(
ring->xdp_prog,
lockdep_is_held(&mdev->state_lock));
if (old_prog)
- bpf_prog_put(old_prog);
+ xdp_prog_put(old_prog);
mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE);
vfree(ring->rx_info);
ring->rx_info = NULL;
@@ -783,7 +783,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
struct mlx4_en_rx_ring *ring = priv->rx_ring[cq->ring];
struct mlx4_en_rx_alloc *frags;
struct mlx4_en_rx_desc *rx_desc;
- struct bpf_prog *xdp_prog;
+ struct xdp_prog *xdp_prog;
+ struct bpf_prog *bpf_prog;
int doorbell_pending;
struct sk_buff *skb;
int tx_index;
@@ -805,6 +806,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
/* Protect accesses to: ring->xdp_prog, priv->mac_hash list */
rcu_read_lock();
xdp_prog = rcu_dereference(ring->xdp_prog);
+ bpf_prog = rcu_dereference(xdp_prog->bpf);
doorbell_pending = 0;
tx_index = (priv->tx_ring_num - priv->xdp_ring_num) + cq->ring;
@@ -897,7 +899,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
frags[0].page_offset;
xdp.data_end = xdp.data + length;
- act = bpf_prog_run_xdp(xdp_prog, &xdp);
+ act = bpf_prog_run_xdp(bpf_prog, &xdp);
switch (act) {
case XDP_PASS:
break;
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index a3528dd1e72e..8942201bcc38 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -340,7 +340,7 @@ struct mlx4_en_rx_ring {
u8 fcs_del;
void *buf;
void *rx_info;
- struct bpf_prog __rcu *xdp_prog;
+ struct xdp_prog __rcu *xdp_prog;
struct mlx4_en_page_cache page_cache;
unsigned long bytes;
unsigned long packets;
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 1f09c521adfe..f1eee2f0f70c 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -437,6 +437,20 @@ struct xdp_buff {
void *data_end;
};
+struct xdp_prog {
+ u64 flags;
+ struct bpf_prog *bpf;
+ atomic_t refcnt;
+ struct rcu_head rcu; // Do we need RCU freeing? likely right?
+
+ /* Data associated with XDP program goes here */
+
+} ____cacheline_aligned_in_smp;
+
+struct xdp_prog *xdp_prog_alloc(struct bpf_prog *bpf);
+struct xdp_prog *xdp_prog_add(struct xdp_prog *xdp, int users);
+void xdp_prog_put(struct xdp_prog *prog);
+
/* compute the linear packet data range [data, data_end) which
* will be accessed by cls_bpf and act_bpf programs
*/
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a10d8d18ce19..f9d900e62cd5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -825,7 +825,7 @@ struct netdev_xdp {
enum xdp_netdev_command command;
union {
/* XDP_SETUP_PROG */
- struct bpf_prog *prog;
+ struct xdp_prog *prog;
/* XDP_QUERY_PROG */
bool prog_attached;
};
diff --git a/net/core/dev.c b/net/core/dev.c
index 9dbece2f1296..df3f7d3cf62e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6643,23 +6643,30 @@ EXPORT_SYMBOL(dev_change_proto_down);
int dev_change_xdp_fd(struct net_device *dev, int fd)
{
const struct net_device_ops *ops = dev->netdev_ops;
- struct bpf_prog *prog = NULL;
+ struct xdp_prog *prog = NULL;
+ struct bpf_prog *bpf;
struct netdev_xdp xdp = {};
int err;
if (!ops->ndo_xdp)
return -EOPNOTSUPP;
if (fd >= 0) {
- prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP);
- if (IS_ERR(prog))
+ bpf = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP); /* inc refcnt */
+ if (IS_ERR(bpf))
+ return PTR_ERR(bpf);
+
+ prog = xdp_prog_alloc(bpf);
+ if (IS_ERR(prog)) {
+ bpf_prog_put(prog->bpf);
return PTR_ERR(prog);
+ }
}
xdp.command = XDP_SETUP_PROG;
xdp.prog = prog;
err = ops->ndo_xdp(dev, &xdp);
if (err < 0 && prog)
- bpf_prog_put(prog);
+ bpf_prog_put(prog->bpf);
return err;
}
diff --git a/net/core/filter.c b/net/core/filter.c
index 298b146b47e7..a61ca13b8eaa 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2912,3 +2912,53 @@ out:
release_sock(sk);
return ret;
}
+
+struct xdp_prog *xdp_prog_alloc(struct bpf_prog *bpf)
+{
+ struct xdp_prog *xdp;
+
+ xdp = kzalloc(sizeof(*xdp), GFP_KERNEL);
+ if (!xdp)
+ return ERR_PTR(-ENOMEM);
+
+ /* Note dev_change_xdp_fd() already refcnt inc on bpf prog */
+ xdp->bpf = bpf;
+
+ return xdp;
+}
+EXPORT_SYMBOL(xdp_prog_alloc);
+
+struct xdp_prog *xdp_prog_add(struct xdp_prog *xdp, int users)
+{
+ struct bpf_prog *bpf;
+
+ bpf = bpf_prog_add(xdp->bpf, users);
+ if (IS_ERR(bpf)) {
+ return (void*)bpf; /* it is already a PTR_ERR */
+ }
+ atomic_add(users, &xdp->refcnt);
+
+ return xdp;
+}
+EXPORT_SYMBOL(xdp_prog_add);
+
+void __xdp_prog_put_rcu(struct rcu_head *rcu)
+{
+ struct xdp_prog *xdp = container_of(rcu, struct xdp_prog, rcu);
+
+ /* Release reference to (future) xdp_port_table here */
+
+ /* Release refcnt from dev_change_xdp_fd() calling bpf_prog_get_type()*/
+ bpf_prog_put(xdp->bpf);
+
+ kfree(xdp);
+}
+
+void xdp_prog_put(struct xdp_prog *prog)
+{
+ bpf_prog_put(prog->bpf);
+ if (atomic_dec_and_test(&prog->refcnt)) {
+ call_rcu(&prog->rcu, __xdp_prog_put_rcu);
+ }
+}
+EXPORT_SYMBOL(xdp_prog_put);
^ permalink raw reply related
* Re: [PATCH net-next 3/3] net: ethernet: mediatek: add the dts property to set if TRGMII supported on GMAC0
From: Andrew Lunn @ 2016-09-20 19:37 UTC (permalink / raw)
To: sean.wang; +Cc: john, davem, nbd, netdev, linux-mediatek, keyhaede, objelf
In-Reply-To: <1474358360-29901-4-git-send-email-sean.wang@mediatek.com>
On Tue, Sep 20, 2016 at 03:59:20PM +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> Add the dts property for the capability if TRGMII supported on GAMC0
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
> Documentation/devicetree/bindings/net/mediatek-net.txt | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/mediatek-net.txt b/Documentation/devicetree/bindings/net/mediatek-net.txt
> index 6103e55..32f79d8 100644
> --- a/Documentation/devicetree/bindings/net/mediatek-net.txt
> +++ b/Documentation/devicetree/bindings/net/mediatek-net.txt
> @@ -31,7 +31,10 @@ Optional properties:
> Required properties:
> - compatible: Should be "mediatek,eth-mac"
> - reg: The number of the MAC
> -- phy-handle: see ethernet.txt file in the same directory.
> +- phy-handle: see ethernet.txt file in the same directory and
> + the additional phy-mode "tgrmii" is provided in order to connect
> + with the internal switch MT7530 which is only applicable when reg
> + is equal to 0.
Humm. How is the switch connected? Is it on the MDIO bus?
If it is on the mdio bus, the binding is going to look something like:
eth: ethernet@1b100000 {
compatible = "mediatek,mt7623-eth";
reg = <0 0x1b100000 0 0x20000>;
clocks = <&topckgen CLK_TOP_ETHIF_SEL>,
<ðsys CLK_ETHSYS_ESW>,
<ðsys CLK_ETHSYS_GP2>,
<ðsys CLK_ETHSYS_GP1>;
clock-names = "ethif", "esw", "gp2", "gp1";
interrupts = <GIC_SPI 200 IRQ_TYPE_LEVEL_LOW
GIC_SPI 199 IRQ_TYPE_LEVEL_LOW
GIC_SPI 198 IRQ_TYPE_LEVEL_LOW>;
power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>;
resets = <ðsys MT2701_ETHSYS_ETH_RST>;
reset-names = "eth";
mediatek,ethsys = <ðsys>;
mediatek,pctl = <&syscfg_pctl_a>;
#address-cells = <1>;
#size-cells = <0>;
gmac1: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
};
gmac2: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
};
mdio-bus {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
switch0: switch0@0 {
compatible = "marvell,mv88e6085";
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
dsa,member = <0 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
label = "lan0";
...
...
In this case the switch is an MDIO device, not an PHY. It will not
have an phy-mode. It cannot have a phy mode, it is not a PHY.
Or am i missing something here?
Thanks
Andrew
^ permalink raw reply
* Re: [RFC] PCI: Allow sysfs control over totalvfs
From: Jiri Pirko @ 2016-09-20 19:36 UTC (permalink / raw)
To: Yuval Mintz; +Cc: linux-pci, netdev, derek.chickles, Yuval Mintz
In-Reply-To: <1474386588-16337-1-git-send-email-Yuval.Mintz@qlogic.com>
Tue, Sep 20, 2016 at 05:49:48PM CEST, Yuval.Mintz@qlogic.com wrote:
>[Sorry in advance if this was already discussed in the past]
>
>Some of the HW capable of SRIOV has resource limitations, where the
>PF and VFs resources are drawn from a common pool.
>In some cases, these limitations have to be considered early during
>chip initialization and can only be changed by tearing down the
>configuration and re-initializing.
>As a result, drivers for such HWs sometimes have to make unfavorable
>compromises where they reserve sufficient resources to accomadate
>the maximal number of VFs that can be created - at the expanse of
>resources that could have been used by the PF.
>
>If users were able to provide 'hints' regarding the required number
>of VFs *prior* to driver attachment, then such compromises could be
>avoided. As we already have sysfs nodes that can be queried for the
>number of totalvfs, it makes sense to let the user reduce the number
>of said totalvfs using same infrastrucure.
>Then, we can have drivers supporting SRIOV take that value into account
>when deciding how much resources to reserve, allowing the PF to benefit
>from the difference between the configuration space value and the actual
>number needed by user.
One of the motivations for introducing devlink interface was to allow
user to pass some kind of well defined option parameters or as you call
it hints to driver module. That would allow to replace module options
and introduce similar possibility to pre-configure hardware on probe time.
We plan to use devlink to allow user to change resource allocation for
mlxsw devices.
The plan is to allow to pre-create devlink instance before driver module
is loaded. Then the user will use this placeholder to do the options
setting. Once the driver module is loaded, it will fetch the options
from devlink core and process it accordingly.
I believe this is exactly what you need.
>
>Signed-off-by: Yuval Mintz <Yuval.Mintz@caviumnetworks.com>
>---
> drivers/pci/pci-sysfs.c | 28 +++++++++++++++++++++++++++-
> 1 file changed, 27 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
>index bcd10c7..c1546f8 100644
>--- a/drivers/pci/pci-sysfs.c
>+++ b/drivers/pci/pci-sysfs.c
>@@ -449,6 +449,30 @@ static ssize_t sriov_totalvfs_show(struct device *dev,
> return sprintf(buf, "%u\n", pci_sriov_get_totalvfs(pdev));
> }
>
>+static ssize_t sriov_totalvfs_store(struct device *dev,
>+ struct device_attribute *attr,
>+ const char *buf, size_t count)
>+{
>+ struct pci_dev *pdev = to_pci_dev(dev);
>+ u16 max_vfs;
>+ int ret;
>+
>+ ret = kstrtou16(buf, 0, &max_vfs);
>+ if (ret < 0)
>+ return ret;
>+
>+ if (pdev->driver) {
>+ dev_info(&pdev->dev,
>+ "Can't change totalvfs while driver is attached\n");
>+ return -EUSERS;
>+ }
>+
>+ ret = pci_sriov_set_totalvfs(pdev, max_vfs);
>+ if (ret)
>+ return ret;
>+
>+ return count;
>+}
>
> static ssize_t sriov_numvfs_show(struct device *dev,
> struct device_attribute *attr,
>@@ -516,7 +540,9 @@ static ssize_t sriov_numvfs_store(struct device *dev,
> return count;
> }
>
>-static struct device_attribute sriov_totalvfs_attr = __ATTR_RO(sriov_totalvfs);
>+static struct device_attribute sriov_totalvfs_attr =
>+ __ATTR(sriov_totalvfs, (S_IRUGO|S_IWUSR|S_IWGRP),
>+ sriov_totalvfs_show, sriov_totalvfs_store);
> static struct device_attribute sriov_numvfs_attr =
> __ATTR(sriov_numvfs, (S_IRUGO|S_IWUSR|S_IWGRP),
> sriov_numvfs_show, sriov_numvfs_store);
>--
>1.9.3
>
^ permalink raw reply
* Re: [PATCH net-next 7/8] net/mlx5e: XDP TX forwarding support
From: Tom Herbert @ 2016-09-20 19:21 UTC (permalink / raw)
To: Jesper Dangaard Brouer
Cc: Eric Dumazet, Alexei Starovoitov, Tariq Toukan, Tariq Toukan,
David S. Miller, Linux Kernel Network Developers, Eran Ben Elisha,
Saeed Mahameed, Rana Shahout
In-Reply-To: <20160920205939.6a4522df@redhat.com>
On Tue, Sep 20, 2016 at 11:59 AM, Jesper Dangaard Brouer
<brouer@redhat.com> wrote:
> On Tue, 20 Sep 2016 10:39:20 -0700
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
>> On Tue, 2016-09-20 at 09:45 -0700, Alexei Starovoitov wrote:
>>
>> > because 'div by zero' is an abnormal situation that shouldn't be exploited.
>> > Meaning if xdp program is doing DoS prevention and it has a bug that
>> > attacker can now exploit by sending a crafted packet that causes
>> > 'div by zero' and kernel will warn then attack got successful.
>> > Therefore it has to be silent drop.
>>
>> A silent drop means a genuine error in a BPF program might be never
>> caught, since a tracepoint might never be enabled.
>
> I do see your point. But we can document our way out of it.
>
>> > tracpoint in such case is great, since the user can do debugging with it
>> > and even monitoring 24/7 and if suddenly the control plan sees a lot
>> > of such trace_xdp_abotred events, it can disable that tracepoint to avoid
>> > spam and adjust the program or act on attack some other way.
>> > Hardcoded warnings and counters are not generic enough for all
>> > the use cases people want to throw at XDP.
>> > The tracepoints idea is awesome, in a sense that it's optional.
>>
>>
>> Note that tracepoints are optional in a kernel.
>
> Well, that is a good thing, as it can be compiled out (as that provides
> an option for zero cost).
>
>
>> Many existing supervision infrastructures collect device snmp
>> counters, and run as unprivileged programs.
>
> A supervision infrastructures is a valid use-case. It again indicate
> that such XDP stats need to structured, not just a random driver
> specific ethtool counter, to make it easy for such collection daemons.
>
I am currently adding a structure to define an XDP hook (plan to post
patches shortly). Counters can be added to that in a uniform fashion
that doesn't need code in every driver.
Tom
>
>> tracepoints might not fit the need here, compared to a mere
>> tx_ring->tx_drops++
>
> I do see your point. I really liked the tracepoint idea, but now I'm
> uncertain again...
>
>
> I do have a use-case where I want to use the NIC HW-RX-ingress-overflow
> and TX-overflow drop indicators, but I don't want to tie it into this
> discussion. The abort and error indicators a not relevant for that
> use-case.
>
> --
> Best regards,
> Jesper Dangaard Brouer
> MSc.CS, Principal Kernel Engineer at Red Hat
> Author of http://www.iptv-analyzer.org
> LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: [PATCH net-next 7/8] net/mlx5e: XDP TX forwarding support
From: Jesper Dangaard Brouer @ 2016-09-20 18:59 UTC (permalink / raw)
To: Eric Dumazet
Cc: Alexei Starovoitov, Tom Herbert, Tariq Toukan, Tariq Toukan,
David S. Miller, Linux Kernel Network Developers, Eran Ben Elisha,
Saeed Mahameed, Rana Shahout, brouer
In-Reply-To: <1474393160.23058.39.camel@edumazet-glaptop3.roam.corp.google.com>
On Tue, 20 Sep 2016 10:39:20 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Tue, 2016-09-20 at 09:45 -0700, Alexei Starovoitov wrote:
>
> > because 'div by zero' is an abnormal situation that shouldn't be exploited.
> > Meaning if xdp program is doing DoS prevention and it has a bug that
> > attacker can now exploit by sending a crafted packet that causes
> > 'div by zero' and kernel will warn then attack got successful.
> > Therefore it has to be silent drop.
>
> A silent drop means a genuine error in a BPF program might be never
> caught, since a tracepoint might never be enabled.
I do see your point. But we can document our way out of it.
> > tracpoint in such case is great, since the user can do debugging with it
> > and even monitoring 24/7 and if suddenly the control plan sees a lot
> > of such trace_xdp_abotred events, it can disable that tracepoint to avoid
> > spam and adjust the program or act on attack some other way.
> > Hardcoded warnings and counters are not generic enough for all
> > the use cases people want to throw at XDP.
> > The tracepoints idea is awesome, in a sense that it's optional.
>
>
> Note that tracepoints are optional in a kernel.
Well, that is a good thing, as it can be compiled out (as that provides
an option for zero cost).
> Many existing supervision infrastructures collect device snmp
> counters, and run as unprivileged programs.
A supervision infrastructures is a valid use-case. It again indicate
that such XDP stats need to structured, not just a random driver
specific ethtool counter, to make it easy for such collection daemons.
> tracepoints might not fit the need here, compared to a mere
> tx_ring->tx_drops++
I do see your point. I really liked the tracepoint idea, but now I'm
uncertain again...
I do have a use-case where I want to use the NIC HW-RX-ingress-overflow
and TX-overflow drop indicators, but I don't want to tie it into this
discussion. The abort and error indicators a not relevant for that
use-case.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCH net-next V2] net/vxlan: Avoid unaligned access in vxlan_build_skb()
From: Sowmini Varadhan @ 2016-09-20 18:57 UTC (permalink / raw)
To: netdev; +Cc: sowmini.varadhan, jbenc, davem, hannes
The vxlan header may not be aligned to 4 bytes in
vxlan_build_skb (e.g., for MLD packets). This patch
avoids unaligned access traps from vxlan_build_skb
(in platforms like sparc) by making struct vxlanhdr __packed.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
include/net/vxlan.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 0255613..1ec56f4 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -18,7 +18,7 @@
struct vxlanhdr {
__be32 vx_flags;
__be32 vx_vni;
-};
+} __packed;
/* VXLAN header flags. */
#define VXLAN_HF_VNI cpu_to_be32(BIT(27))
--
1.7.1
^ permalink raw reply related
* Re: [PATCH v4 net-next 16/16] tcp_bbr: add BBR congestion control
From: Neal Cardwell @ 2016-09-20 18:50 UTC (permalink / raw)
To: Stephen Hemminger
Cc: David Miller, Netdev, Van Jacobson, Yuchung Cheng,
Nandita Dukkipati, Eric Dumazet, Soheil Hassas Yeganeh
In-Reply-To: <20160920114814.04f0f394@xeon-e3>
On Tue, Sep 20, 2016 at 2:48 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Mon, 19 Sep 2016 23:39:23 -0400
> Neal Cardwell <ncardwell@google.com> wrote:
>
> > +/* INET_DIAG_BBRINFO */
> > +
> > +struct tcp_bbr_info {
> > + /* u64 bw: max-filtered BW (app throughput) estimate in Byte per sec: */
> > + __u32 bbr_bw_lo; /* lower 32 bits of bw */
> > + __u32 bbr_bw_hi; /* upper 32 bits of bw */
> > + __u32 bbr_min_rtt; /* min-filtered RTT in uSec */
> > + __u32 bbr_pacing_gain; /* pacing gain shifted left 8 bits */
> > + __u32 bbr_cwnd_gain; /* cwnd gain shifted left 8 bits */
> > +};
> > +
>
> I assume there is a change to iproute (ss) to dump this info?
Yes, we have a patch for iproute2 (inet_diag.h and ss.c), which we've
been using. We'll send that out ASAP.
thanks,
neal
^ permalink raw reply
* Re: [PATCH v4 net-next 16/16] tcp_bbr: add BBR congestion control
From: Yuchung Cheng @ 2016-09-20 18:50 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Neal Cardwell, David Miller, netdev, Van Jacobson,
Nandita Dukkipati, Eric Dumazet, Soheil Hassas Yeganeh
In-Reply-To: <20160920114814.04f0f394@xeon-e3>
On Tue, Sep 20, 2016 at 11:48 AM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Mon, 19 Sep 2016 23:39:23 -0400
> Neal Cardwell <ncardwell@google.com> wrote:
>
>> +/* INET_DIAG_BBRINFO */
>> +
>> +struct tcp_bbr_info {
>> + /* u64 bw: max-filtered BW (app throughput) estimate in Byte per sec: */
>> + __u32 bbr_bw_lo; /* lower 32 bits of bw */
>> + __u32 bbr_bw_hi; /* upper 32 bits of bw */
>> + __u32 bbr_min_rtt; /* min-filtered RTT in uSec */
>> + __u32 bbr_pacing_gain; /* pacing gain shifted left 8 bits */
>> + __u32 bbr_cwnd_gain; /* cwnd gain shifted left 8 bits */
>> +};
>> +
>
> I assume there is a change to iproute (ss) to dump this info?
Yes, should come right after :-)
^ permalink raw reply
* Re: [PATCH v4 net-next 16/16] tcp_bbr: add BBR congestion control
From: Stephen Hemminger @ 2016-09-20 18:48 UTC (permalink / raw)
To: Neal Cardwell
Cc: David Miller, netdev, Van Jacobson, Yuchung Cheng,
Nandita Dukkipati, Eric Dumazet, Soheil Hassas Yeganeh
In-Reply-To: <1474342763-16715-17-git-send-email-ncardwell@google.com>
On Mon, 19 Sep 2016 23:39:23 -0400
Neal Cardwell <ncardwell@google.com> wrote:
> +/* INET_DIAG_BBRINFO */
> +
> +struct tcp_bbr_info {
> + /* u64 bw: max-filtered BW (app throughput) estimate in Byte per sec: */
> + __u32 bbr_bw_lo; /* lower 32 bits of bw */
> + __u32 bbr_bw_hi; /* upper 32 bits of bw */
> + __u32 bbr_min_rtt; /* min-filtered RTT in uSec */
> + __u32 bbr_pacing_gain; /* pacing gain shifted left 8 bits */
> + __u32 bbr_cwnd_gain; /* cwnd gain shifted left 8 bits */
> +};
> +
I assume there is a change to iproute (ss) to dump this info?
^ permalink raw reply
* Re: [PATCH net-next 2/2] bnx2x: allocate mac filtering pending list in PAGE_SIZE increments
From: Jason Baron @ 2016-09-20 18:46 UTC (permalink / raw)
To: David Laight, Mintz, Yuval, davem@davemloft.net
Cc: netdev@vger.kernel.org, Ariel.Elior@qlogic.com
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB01046DB@AcuExch.aculab.com>
On 09/20/2016 07:30 AM, David Laight wrote:
> From: Jason Baron
>> Sent: 19 September 2016 19:34
> ...
>>
>> sizeof(struct bnx2x_mcast_list_elem) = 24. So there are 170 per
>> page on x86. So if we want to fit 2,048 elements, we need 12 pages.
>
> If you only need to save the mcast addresses you could use a 'heap'
> that requires no overhead per entry and gives you O(log) lookup.
> 6 bytes per entry is 682 in a 4k page.
>
> David
>
Indeed, that would save space here.
Based on Yuval's comments it sounds as though he agrees that it makes
sense to go beyond a page (even if we get 682 per page as you suggest),
when configuring these mac filters. So we would then have to allocate
and manage the page pointers. Currently, there is a list_head per entry
to manage the macs as a linked list. The patch I proposed continues to
use that same data structure, thus it will not add to the memory
footprint, it only proposes to break that footprint up into PAGE_SIZE
chunks.
So I think the change you suggest can be viewed as an additional
enhancement here, and also note that the memory allocations here are
short-lived. That is, they only exist in memory until the NIC is
re-configured.
Thanks,
-Jason
^ permalink raw reply
* Re: [PATCH v4 net-next 13/16] tcp: allow congestion control to expand send buffer differently
From: Yuchung Cheng @ 2016-09-20 18:43 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Neal Cardwell, David Miller, netdev, Van Jacobson,
Nandita Dukkipati, Eric Dumazet, Soheil Hassas Yeganeh
In-Reply-To: <20160920104801.67082004@xeon-e3>
On Tue, Sep 20, 2016 at 10:48 AM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Mon, 19 Sep 2016 23:39:20 -0400
> Neal Cardwell <ncardwell@google.com> wrote:
>
> > From: Yuchung Cheng <ycheng@google.com>
> >
> > Currently the TCP send buffer expands to twice cwnd, in order to allow
> > limited transmits in the CA_Recovery state. This assumes that cwnd
> > does not increase in the CA_Recovery.
> >
> > For some congestion control algorithms, like the upcoming BBR module,
> > if the losses in recovery do not indicate congestion then we may
> > continue to raise cwnd multiplicatively in recovery. In such cases the
> > current multiplier will falsely limit the sending rate, much as if it
> > were limited by the application.
> >
> > This commit adds an optional congestion control callback to use a
> > different multiplier to expand the TCP send buffer. For congestion
> > control modules that do not specificy this callback, TCP continues to
> > use the previous default of 2.
> >
> > Signed-off-by: Van Jacobson <vanj@google.com>
> > Signed-off-by: Neal Cardwell <ncardwell@google.com>
> > Signed-off-by: Yuchung Cheng <ycheng@google.com>
> > Signed-off-by: Nandita Dukkipati <nanditad@google.com>
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> > ---
> > include/net/tcp.h | 2 ++
> > net/ipv4/tcp_input.c | 4 +++-
> > 2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/net/tcp.h b/include/net/tcp.h
> > index 3492041..1aa9628 100644
> > --- a/include/net/tcp.h
> > +++ b/include/net/tcp.h
> > @@ -917,6 +917,8 @@ struct tcp_congestion_ops {
> > void (*pkts_acked)(struct sock *sk, const struct ack_sample *sample);
> > /* suggest number of segments for each skb to transmit (optional) */
> > u32 (*tso_segs_goal)(struct sock *sk);
> > + /* returns the multiplier used in tcp_sndbuf_expand (optional) */
> > + u32 (*sndbuf_expand)(struct sock *sk);
> > /* get info for inet_diag (optional) */
> > size_t (*get_info)(struct sock *sk, u32 ext, int *attr,
> > union tcp_cc_info *info);
> > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> > index 17de77d..5af0bf3 100644
> > --- a/net/ipv4/tcp_input.c
> > +++ b/net/ipv4/tcp_input.c
> > @@ -289,6 +289,7 @@ static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr
> > static void tcp_sndbuf_expand(struct sock *sk)
> > {
> > const struct tcp_sock *tp = tcp_sk(sk);
> > + const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
> > int sndmem, per_mss;
> > u32 nr_segs;
> >
> > @@ -309,7 +310,8 @@ static void tcp_sndbuf_expand(struct sock *sk)
> > * Cubic needs 1.7 factor, rounded to 2 to include
> > * extra cushion (application might react slowly to POLLOUT)
> > */
> > - sndmem = 2 * nr_segs * per_mss;
> > + sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2;
>
> You could avoid the conditional (if it mattered) by inheriting a default value
> that would mean changing all existing congestion control modules.
> So doing it this way makes life easier.
Good point. But we've not really tested raising it to 3 on other
C.C.s, esp loss-based ones tend to have big cwnd on bloated buffers.
so we like to change locally for now.
>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply
* Re: UBSAN reports issue in ip_idents_reserve
From: Eric Dumazet @ 2016-09-20 18:42 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev
In-Reply-To: <20160920174649.GN1843@nanopsycho.orion>
On Tue, 2016-09-20 at 19:46 +0200, Jiri Pirko wrote:
>
> This patch makes ubsan silent.
Thanks Jiri, I will post an official patch then ;)
^ permalink raw reply
* Re: Possible code defects: macros and precedence
From: Joe Perches @ 2016-09-20 18:03 UTC (permalink / raw)
To: Julia Lawall; +Cc: Dan Carpenter, LKML, Andrew Morton, netdev
In-Reply-To: <1474391253.1954.39.camel@perches.com>
On Tue, 2016-09-20 at 10:07 -0700, Joe Perches wrote:
> On Tue, 2016-09-20 at 15:14 +0200, Julia Lawall wrote:
> > The semantic patch below finds a binary operator in a macro and a binary
> > operator in the use of the macro, and checks if the priority of the
> > operator in the macro is higher (lower number) than the priority of the
> > operator in the use. If this is the case, it adds parentheses in the use,
> > which is not what one wants, but serves to show where the problem is
> Thanks, this works on the trivial example I suggested
> without an #include
>
> I've tried it on trivial files with --recursive-includes
> and it seems to work there too.
I tried it on drivers/net with --recursive-includes and got
just 1 hit on an old and probably relatively untested driver.
No hardware, can't test. It may be correct now. Who knows...
---
diff --urN a/drivers/net/ethernet/smsc/smc911x.h b/drivers/net/ethernet/smsc/smc911x.h
--- a/drivers/net/ethernet/smsc/smc911x.h
+++ b/drivers/net/ethernet/smsc/smc911x.h
@@ -700,8 +700,8 @@ static const struct chip_id chip_ids[] =
* capabilities. Please use those and not the in/out primitives.
*/
/* FIFO read/write macros */
-#define SMC_PUSH_DATA(lp, p, l) SMC_outsl( lp, TX_DATA_FIFO, p, (l) >> 2 )
-#define SMC_PULL_DATA(lp, p, l) SMC_insl ( lp, RX_DATA_FIFO, p, (l) >> 2 )
+#define SMC_PUSH_DATA(lp, p, l) SMC_outsl( lp, TX_DATA_FIFO, p, ((l) >> 2) )
+#define SMC_PULL_DATA(lp, p, l) SMC_insl ( lp, RX_DATA_FIFO, p, ((l) >> 2) )
#define SMC_SET_TX_FIFO(lp, x) SMC_outl( x, lp, TX_DATA_FIFO )
#define SMC_GET_RX_FIFO(lp) SMC_inl( lp, RX_DATA_FIFO )
^ permalink raw reply
* Re: [PATCH net-next 5/7] rhashtable: abstract out function to get hash
From: Thomas Graf @ 2016-09-20 17:58 UTC (permalink / raw)
To: Herbert Xu; +Cc: Tom Herbert, davem, netdev, roopa, kernel-team
In-Reply-To: <20160920093659.GA20975@gondor.apana.org.au>
On 09/20/16 at 05:36pm, Herbert Xu wrote:
> Tom Herbert <tom@herbertland.com> wrote:
> > Split out most of rht_key_hashfn which is calculating the hash into
> > its own function. This way the hash function can be called separately to
> > get the hash value.
> >
> > Acked-by: Thomas Graf <tgraf@suug.ch>
> > Signed-off-by: Tom Herbert <tom@herbertland.com>
>
> I don't get this one. You're just using jhash, right? Why not
> call jhash directly instead of rht_get_key_hashfn?
FYI, there is a v2 of this series, just so you don't have to do the
work twice.
I understand this particular patch as an effort not to duplicate
hash function selection such as jhash vs jhash2 based on key_len.
^ permalink raw reply
* Re: [PATCH v4 net-next 13/16] tcp: allow congestion control to expand send buffer differently
From: Stephen Hemminger @ 2016-09-20 17:48 UTC (permalink / raw)
To: Neal Cardwell
Cc: David Miller, netdev, Yuchung Cheng, Van Jacobson,
Nandita Dukkipati, Eric Dumazet, Soheil Hassas Yeganeh
In-Reply-To: <1474342763-16715-14-git-send-email-ncardwell@google.com>
On Mon, 19 Sep 2016 23:39:20 -0400
Neal Cardwell <ncardwell@google.com> wrote:
> From: Yuchung Cheng <ycheng@google.com>
>
> Currently the TCP send buffer expands to twice cwnd, in order to allow
> limited transmits in the CA_Recovery state. This assumes that cwnd
> does not increase in the CA_Recovery.
>
> For some congestion control algorithms, like the upcoming BBR module,
> if the losses in recovery do not indicate congestion then we may
> continue to raise cwnd multiplicatively in recovery. In such cases the
> current multiplier will falsely limit the sending rate, much as if it
> were limited by the application.
>
> This commit adds an optional congestion control callback to use a
> different multiplier to expand the TCP send buffer. For congestion
> control modules that do not specificy this callback, TCP continues to
> use the previous default of 2.
>
> Signed-off-by: Van Jacobson <vanj@google.com>
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Signed-off-by: Nandita Dukkipati <nanditad@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
> ---
> include/net/tcp.h | 2 ++
> net/ipv4/tcp_input.c | 4 +++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 3492041..1aa9628 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -917,6 +917,8 @@ struct tcp_congestion_ops {
> void (*pkts_acked)(struct sock *sk, const struct ack_sample *sample);
> /* suggest number of segments for each skb to transmit (optional) */
> u32 (*tso_segs_goal)(struct sock *sk);
> + /* returns the multiplier used in tcp_sndbuf_expand (optional) */
> + u32 (*sndbuf_expand)(struct sock *sk);
> /* get info for inet_diag (optional) */
> size_t (*get_info)(struct sock *sk, u32 ext, int *attr,
> union tcp_cc_info *info);
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 17de77d..5af0bf3 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -289,6 +289,7 @@ static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr
> static void tcp_sndbuf_expand(struct sock *sk)
> {
> const struct tcp_sock *tp = tcp_sk(sk);
> + const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
> int sndmem, per_mss;
> u32 nr_segs;
>
> @@ -309,7 +310,8 @@ static void tcp_sndbuf_expand(struct sock *sk)
> * Cubic needs 1.7 factor, rounded to 2 to include
> * extra cushion (application might react slowly to POLLOUT)
> */
> - sndmem = 2 * nr_segs * per_mss;
> + sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2;
You could avoid the conditional (if it mattered) by inheriting a default value
that would mean changing all existing congestion control modules.
So doing it this way makes life easier.
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply
* Re: UBSAN reports issue in ip_idents_reserve
From: Jiri Pirko @ 2016-09-20 17:46 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev
In-Reply-To: <1474381092.23058.10.camel@edumazet-glaptop3.roam.corp.google.com>
Tue, Sep 20, 2016 at 04:18:12PM CEST, eric.dumazet@gmail.com wrote:
>On Tue, 2016-09-20 at 07:11 -0700, Eric Dumazet wrote:
>> On Tue, 2016-09-20 at 15:39 +0200, Jiri Pirko wrote:
>>
>> > I see. So how to silent the warning?
>> >
>>
>> We can replace the atomic_add_return() and use a loop around
>> atomic_read() and atomic_cmpxhg()
>>
>> This would change the nice property of x86 xadd into a loop.
>>
>> Or we also could fallback to random generation if the atomic_cmpxchg()
>> fails.
>>
>> I'll provide a patch, thanks.
>>
>
>Could you try the following ?
>
>diff --git a/net/ipv4/route.c b/net/ipv4/route.c
>index
>b52496fd51075821c39435f50ac62f813967aecc..91dc108ef6dc75df80f0e73b6fa062d98dc9a58a 100644
>--- a/net/ipv4/route.c
>+++ b/net/ipv4/route.c
>@@ -476,12 +476,19 @@ u32 ip_idents_reserve(u32 hash, int segs)
> atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ;
> u32 old = ACCESS_ONCE(*p_tstamp);
> u32 now = (u32)jiffies;
>- u32 delta = 0;
>+ u32 new, delta = 0;
>
> if (old != now && cmpxchg(p_tstamp, old, now) == old)
> delta = prandom_u32_max(now - old);
>
>- return atomic_add_return(segs + delta, p_id) - segs;
>+ old = (u32)atomic_read(p_id);
>+ new = old + delta + segs;
>+ /* Do not try too hard, if multiple cpus are there,
>+ * just fallback to pseudo random number.
>+ */
>+ if (unlikely(atomic_cmpxchg(p_id, old, new) != old))
>+ new = prandom_u32();
>+ return new;
> }
> EXPORT_SYMBOL(ip_idents_reserve);
>
This patch makes ubsan silent.
>
>
^ permalink raw reply
* Re: [PATCH net-next 7/8] net/mlx5e: XDP TX forwarding support
From: Eric Dumazet @ 2016-09-20 17:39 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Jesper Dangaard Brouer, Tom Herbert, Tariq Toukan, Tariq Toukan,
David S. Miller, Linux Kernel Network Developers, Eran Ben Elisha,
Saeed Mahameed, Rana Shahout
In-Reply-To: <20160920164526.GB99429@ast-mbp.thefacebook.com>
On Tue, 2016-09-20 at 09:45 -0700, Alexei Starovoitov wrote:
> because 'div by zero' is an abnormal situation that shouldn't be exploited.
> Meaning if xdp program is doing DoS prevention and it has a bug that
> attacker can now exploit by sending a crafted packet that causes
> 'div by zero' and kernel will warn then attack got successful.
> Therefore it has to be silent drop.
A silent drop means a genuine error in a BPF program might be never
caught, since a tracepoint might never be enabled.
> tracpoint in such case is great, since the user can do debugging with it
> and even monitoring 24/7 and if suddenly the control plan sees a lot
> of such trace_xdp_abotred events, it can disable that tracepoint to avoid
> spam and adjust the program or act on attack some other way.
> Hardcoded warnings and counters are not generic enough for all
> the use cases people want to throw at XDP.
> The tracepoints idea is awesome, in a sense that it's optional.
Note that tracepoints are optional in a kernel.
Many existing supervision infrastructures collect device snmp counters,
and run as unprivileged programs.
tracepoints might not fit the need here, compared to a mere
tx_ring->tx_drops++
^ permalink raw reply
* Re: [PATCH net-next] net/vxlan: Avoid unaligned access in vxlan_build_skb()
From: Sowmini Varadhan @ 2016-09-20 17:24 UTC (permalink / raw)
To: Jiri Benc; +Cc: netdev, davem, hannes, aduyck, daniel, pabeni
In-Reply-To: <20160920190929.57ddaeb0@griffin>
On (09/20/16 19:09), Jiri Benc wrote:
>
> But the point stands, we have much greater problems here than VXLAN.
> And I don't think that wrapping all IP address accesses into
> get/put_unaligned all around the stack is the solution.
>
Agreed, and I think Tom made that point too.
For the immediate pain, Hannes' suggestion of making vxlanhdr
__packed takes care of the noise from vxlan_build_skb, so I will
spin out a v2 that takes care of this one, at least.
--Sowmini
^ permalink raw reply
* Re: [PATCH net-next] net/vxlan: Avoid unaligned access in vxlan_build_skb()
From: Tom Herbert @ 2016-09-20 17:19 UTC (permalink / raw)
To: Jiri Benc
Cc: Sowmini Varadhan, Linux Kernel Network Developers,
David S. Miller, Hannes Frederic Sowa, Alexander Duyck,
Daniel Borkmann, Paolo Abeni
In-Reply-To: <20160920190929.57ddaeb0@griffin>
On Tue, Sep 20, 2016 at 10:09 AM, Jiri Benc <jbenc@redhat.com> wrote:
> On Tue, 20 Sep 2016 18:43:33 +0200, Jiri Benc wrote:
>> On Tue, 20 Sep 2016 12:31:08 -0400, Sowmini Varadhan wrote:
>> > The vxlan header is after the ethernet header (14 bytes),
>> > IP header (20 bytes, assuming no options) and udp header (8 bytes).
>>
>> If the VXLAN header is not aligned to 4 bytes, then IP header is not
>> aligned to 4 bytes, too, and you have greater problems than just VXLAN.
>
> ...which is indeed the case. Sorry, I guess I'm too much focused on
> VXLAN-GPE nowadays and I missed that we're building this before the
> inner Ethernet header.
>
> But the point stands, we have much greater problems here than VXLAN.
> And I don't think that wrapping all IP address accesses into
> get/put_unaligned all around the stack is the solution.
>
RIght, this is problem with the encapsulations themselves. IP
protocols are supposed to be four-byte aligned and Ethernet
encapsulation is obviously breaking that. We can't address this in
existing standards like GRE-TEB, but for new encapsulations we should
make sure this avoided. I've posted on nvo3 list about this issue.
Tom
> Jiri
^ permalink raw reply
* Re: [PATCH net-next] net/vxlan: Avoid unaligned access in vxlan_build_skb()
From: Jiri Benc @ 2016-09-20 17:15 UTC (permalink / raw)
To: Sowmini Varadhan; +Cc: netdev, davem, hannes, aduyck, daniel, pabeni
In-Reply-To: <20160920170742.GR8920@oracle.com>
On Tue, 20 Sep 2016 13:07:42 -0400, Sowmini Varadhan wrote:
> I will try out Hannes' solution (which makes sense) in a moment,
> and report back.
No objections to marking the struct as packed. Will only push the
problem to a different place, though.
Jiri
^ permalink raw reply
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