aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-05 20:46:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-05 20:46:42 -0400
commite7fda6c4c3c1a7d6996dd75fd84670fa0b5d448f (patch)
treedaa51c16462c318b890acf7f01fba5827275dd74 /drivers/net/ethernet/mellanox/mlx5
parent08d69a25714429850cf9ef71f22d8cdc9189d93f (diff)
parent953dec21aed4038464fec02f96a2f1b8701a5bce (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer and time updates from Thomas Gleixner: "A rather large update of timers, timekeeping & co - Core timekeeping code is year-2038 safe now for 32bit machines. Now we just need to fix all in kernel users and the gazillion of user space interfaces which rely on timespec/timeval :) - Better cache layout for the timekeeping internal data structures. - Proper nanosecond based interfaces for in kernel users. - Tree wide cleanup of code which wants nanoseconds but does hoops and loops to convert back and forth from timespecs. Some of it definitely belongs into the ugly code museum. - Consolidation of the timekeeping interface zoo. - A fast NMI safe accessor to clock monotonic for tracing. This is a long standing request to support correlated user/kernel space traces. With proper NTP frequency correction it's also suitable for correlation of traces accross separate machines. - Checkpoint/restart support for timerfd. - A few NOHZ[_FULL] improvements in the [hr]timer code. - Code move from kernel to kernel/time of all time* related code. - New clocksource/event drivers from the ARM universe. I'm really impressed that despite an architected timer in the newer chips SoC manufacturers insist on inventing new and differently broken SoC specific timers. [ Ed. "Impressed"? I don't think that word means what you think it means ] - Another round of code move from arch to drivers. Looks like most of the legacy mess in ARM regarding timers is sorted out except for a few obnoxious strongholds. - The usual updates and fixlets all over the place" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (114 commits) timekeeping: Fixup typo in update_vsyscall_old definition clocksource: document some basic timekeeping concepts timekeeping: Use cached ntp_tick_length when accumulating error timekeeping: Rework frequency adjustments to work better w/ nohz timekeeping: Minor fixup for timespec64->timespec assignment ftrace: Provide trace clocks monotonic timekeeping: Provide fast and NMI safe access to CLOCK_MONOTONIC seqcount: Add raw_write_seqcount_latch() seqcount: Provide raw_read_seqcount() timekeeping: Use tk_read_base as argument for timekeeping_get_ns() timekeeping: Create struct tk_read_base and use it in struct timekeeper timekeeping: Restructure the timekeeper some more clocksource: Get rid of cycle_last clocksource: Move cycle_last validation to core code clocksource: Make delta calculation a function wireless: ath9k: Get rid of timespec conversions drm: vmwgfx: Use nsec based interfaces drm: i915: Use nsec based interfaces timekeeping: Provide ktime_get_raw() hangcheck-timer: Use ktime_get_ns() ...
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/cmd.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index 87d1b018a9c3..67f8f5a1dc86 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -548,7 +548,7 @@ static void cmd_work_handler(struct work_struct *work)
548 lay->status_own = CMD_OWNER_HW; 548 lay->status_own = CMD_OWNER_HW;
549 set_signature(ent, !cmd->checksum_disabled); 549 set_signature(ent, !cmd->checksum_disabled);
550 dump_command(dev, ent, 1); 550 dump_command(dev, ent, 1);
551 ktime_get_ts(&ent->ts1); 551 ent->ts1 = ktime_get_ns();
552 552
553 /* ring doorbell after the descriptor is valid */ 553 /* ring doorbell after the descriptor is valid */
554 wmb(); 554 wmb();
@@ -637,7 +637,6 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
637{ 637{
638 struct mlx5_cmd *cmd = &dev->cmd; 638 struct mlx5_cmd *cmd = &dev->cmd;
639 struct mlx5_cmd_work_ent *ent; 639 struct mlx5_cmd_work_ent *ent;
640 ktime_t t1, t2, delta;
641 struct mlx5_cmd_stats *stats; 640 struct mlx5_cmd_stats *stats;
642 int err = 0; 641 int err = 0;
643 s64 ds; 642 s64 ds;
@@ -668,10 +667,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
668 if (err == -ETIMEDOUT) 667 if (err == -ETIMEDOUT)
669 goto out; 668 goto out;
670 669
671 t1 = timespec_to_ktime(ent->ts1); 670 ds = ent->ts2 - ent->ts1;
672 t2 = timespec_to_ktime(ent->ts2);
673 delta = ktime_sub(t2, t1);
674 ds = ktime_to_ns(delta);
675 op = be16_to_cpu(((struct mlx5_inbox_hdr *)in->first.data)->opcode); 671 op = be16_to_cpu(((struct mlx5_inbox_hdr *)in->first.data)->opcode);
676 if (op < ARRAY_SIZE(cmd->stats)) { 672 if (op < ARRAY_SIZE(cmd->stats)) {
677 stats = &cmd->stats[op]; 673 stats = &cmd->stats[op];
@@ -1135,7 +1131,6 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector)
1135 void *context; 1131 void *context;
1136 int err; 1132 int err;
1137 int i; 1133 int i;
1138 ktime_t t1, t2, delta;
1139 s64 ds; 1134 s64 ds;
1140 struct mlx5_cmd_stats *stats; 1135 struct mlx5_cmd_stats *stats;
1141 unsigned long flags; 1136 unsigned long flags;
@@ -1149,7 +1144,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector)
1149 sem = &cmd->pages_sem; 1144 sem = &cmd->pages_sem;
1150 else 1145 else
1151 sem = &cmd->sem; 1146 sem = &cmd->sem;
1152 ktime_get_ts(&ent->ts2); 1147 ent->ts2 = ktime_get_ns();
1153 memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); 1148 memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out));
1154 dump_command(dev, ent, 0); 1149 dump_command(dev, ent, 0);
1155 if (!ent->ret) { 1150 if (!ent->ret) {
@@ -1163,10 +1158,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector)
1163 } 1158 }
1164 free_ent(cmd, ent->idx); 1159 free_ent(cmd, ent->idx);
1165 if (ent->callback) { 1160 if (ent->callback) {
1166 t1 = timespec_to_ktime(ent->ts1); 1161 ds = ent->ts2 - ent->ts1;
1167 t2 = timespec_to_ktime(ent->ts2);
1168 delta = ktime_sub(t2, t1);
1169 ds = ktime_to_ns(delta);
1170 if (ent->op < ARRAY_SIZE(cmd->stats)) { 1162 if (ent->op < ARRAY_SIZE(cmd->stats)) {
1171 stats = &cmd->stats[ent->op]; 1163 stats = &cmd->stats[ent->op];
1172 spin_lock_irqsave(&stats->lock, flags); 1164 spin_lock_irqsave(&stats->lock, flags);