* [PATCH 08/27] e1000e: Use timecounter_initialize interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Jeff Kirsher, intel-wired-lan,
netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update e1000e timecounter
init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/intel/e1000e/e1000.h | 4 ++++
drivers/net/ethernet/intel/e1000e/netdev.c | 31 +++++++++++++++++-------------
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index b59f82a..d6b0e59 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -341,6 +341,10 @@ struct e1000_adapter {
struct work_struct tx_hwtstamp_work;
spinlock_t systim_lock; /* protects SYSTIML/H regsters */
struct timecounter tc;
+ u64 (*cc_read)(const struct cyclecounter *cc);
+ u64 cc_mask;
+ u32 cc_mult;
+ u32 cc_shift;
struct ptp_clock *ptp_clock;
struct ptp_clock_info ptp_clock_info;
struct pm_qos_request pm_qos_req;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c9f7ba3..6be1327 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3536,7 +3536,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
incperiod = INCPERIOD_96MHZ;
incvalue = INCVALUE_96MHZ;
shift = INCVALUE_SHIFT_96MHZ;
- adapter->tc.cc.shift = shift + INCPERIOD_SHIFT_96MHZ;
+ adapter->cc_shift = shift + INCPERIOD_SHIFT_96MHZ;
break;
case e1000_pch_lpt:
if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
@@ -3544,13 +3544,13 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
incperiod = INCPERIOD_96MHZ;
incvalue = INCVALUE_96MHZ;
shift = INCVALUE_SHIFT_96MHZ;
- adapter->tc.cc.shift = shift + INCPERIOD_SHIFT_96MHZ;
+ adapter->cc_shift = shift + INCPERIOD_SHIFT_96MHZ;
} else {
/* Stable 25MHz frequency */
incperiod = INCPERIOD_25MHZ;
incvalue = INCVALUE_25MHZ;
shift = INCVALUE_SHIFT_25MHZ;
- adapter->tc.cc.shift = shift;
+ adapter->cc_shift = shift;
}
break;
case e1000_pch_spt:
@@ -3559,7 +3559,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
incperiod = INCPERIOD_24MHZ;
incvalue = INCVALUE_24MHZ;
shift = INCVALUE_SHIFT_24MHZ;
- adapter->tc.cc.shift = shift;
+ adapter->cc_shift = shift;
break;
}
return -EINVAL;
@@ -3569,13 +3569,13 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
incperiod = INCPERIOD_24MHZ;
incvalue = INCVALUE_24MHZ;
shift = INCVALUE_SHIFT_24MHZ;
- adapter->tc.cc.shift = shift;
+ adapter->cc_shift = shift;
} else {
/* Stable 38400KHz frequency */
incperiod = INCPERIOD_38400KHZ;
incvalue = INCVALUE_38400KHZ;
shift = INCVALUE_SHIFT_38400KHZ;
- adapter->tc.cc.shift = shift;
+ adapter->cc_shift = shift;
}
break;
case e1000_82574:
@@ -3584,7 +3584,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
incperiod = INCPERIOD_25MHZ;
incvalue = INCVALUE_25MHZ;
shift = INCVALUE_SHIFT_25MHZ;
- adapter->tc.cc.shift = shift;
+ adapter->cc_shift = shift;
break;
default:
return -EINVAL;
@@ -3953,9 +3953,14 @@ static void e1000e_systim_reset(struct e1000_adapter *adapter)
return;
}
- /* reset the systim ns time counter */
+ /* reinitialize the systim ns time counter */
spin_lock_irqsave(&adapter->systim_lock, flags);
- timecounter_init(&adapter->tc, ktime_to_ns(ktime_get_real()));
+ timecounter_initialize(&adapter->tc,
+ adapter->cc_read,
+ adapter->cc_mask,
+ adapter->cc_mult,
+ adapter->cc_shift,
+ ktime_to_ns(ktime_get_real()));
spin_unlock_irqrestore(&adapter->systim_lock, flags);
/* restore the previous hwtstamp configuration settings */
@@ -4448,10 +4453,10 @@ static int e1000_sw_init(struct e1000_adapter *adapter)
/* Setup hardware time stamping cyclecounter */
if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {
- adapter->tc.cc.read = e1000e_cyclecounter_read;
- adapter->tc.cc.mask = CYCLECOUNTER_MASK(64);
- adapter->tc.cc.mult = 1;
- /* tc.cc.shift set in e1000e_get_base_tininca() */
+ adapter->cc_read = e1000e_cyclecounter_read;
+ adapter->cc_mask = CYCLECOUNTER_MASK(64);
+ adapter->cc_mult = 1;
+ /* cc_shift set in e1000e_get_base_tininca() */
spin_lock_init(&adapter->systim_lock);
INIT_WORK(&adapter->tx_hwtstamp_work, e1000e_tx_hwtstamp_work);
--
1.9.1
^ permalink raw reply related
* [PATCH 10/27] ixgbe: Use timecounter_initialize interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Jeff Kirsher, intel-wired-lan,
netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update ixgbe ptp timecounter
init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 6 +++-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 +--
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 45 +++++++++++++++------------
3 files changed, 32 insertions(+), 23 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 5c391a0..67e8b5c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -739,6 +739,10 @@ struct ixgbe_adapter {
unsigned long last_rx_timestamp;
spinlock_t tmreg_lock;
struct timecounter hw_tc;
+ u64 (*cc_read)(const struct cyclecounter *cc);
+ u64 cc_mask;
+ u32 cc_mult;
+ u32 cc_shift;
u32 base_incval;
u32 tx_hwtstamp_timeouts;
u32 tx_hwtstamp_skipped;
@@ -994,7 +998,7 @@ static inline void ixgbe_ptp_rx_hwtstamp(struct ixgbe_ring *rx_ring,
int ixgbe_ptp_set_ts_config(struct ixgbe_adapter *adapter, struct ifreq *ifr);
int ixgbe_ptp_get_ts_config(struct ixgbe_adapter *adapter, struct ifreq *ifr);
-void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter);
+void ixgbe_ptp_start_timecounter(struct ixgbe_adapter *adapter);
void ixgbe_ptp_reset(struct ixgbe_adapter *adapter);
void ixgbe_ptp_check_pps_event(struct ixgbe_adapter *adapter);
#ifdef CONFIG_PCI_IOV
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 62a1891..86a337b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7332,7 +7332,7 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
adapter->last_rx_ptp_check = jiffies;
if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
- ixgbe_ptp_start_cyclecounter(adapter);
+ ixgbe_ptp_start_timecounter(adapter);
switch (link_speed) {
case IXGBE_LINK_SPEED_10GB_FULL:
@@ -7400,7 +7400,7 @@ static void ixgbe_watchdog_link_is_down(struct ixgbe_adapter *adapter)
adapter->flags2 |= IXGBE_FLAG2_SEARCH_FOR_SFP;
if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
- ixgbe_ptp_start_cyclecounter(adapter);
+ ixgbe_ptp_start_timecounter(adapter);
e_info(drv, "NIC Link is Down\n");
netif_carrier_off(netdev);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 6e9f2c0..073c1ef 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -1075,7 +1075,8 @@ static void ixgbe_ptp_link_speed_adjust(struct ixgbe_adapter *adapter,
}
/**
- * ixgbe_ptp_start_cyclecounter - create the cycle counter from hw
+ * ixgbe_ptp_start_timecounter - create the cycle counter from hw and
+ * initialize corresponding timecounter.
* @adapter: pointer to the adapter structure
*
* This function should be called to set the proper values for the TIMINCA
@@ -1084,10 +1085,9 @@ static void ixgbe_ptp_link_speed_adjust(struct ixgbe_adapter *adapter,
* structure. It should be called whenever a new TIMINCA value is necessary,
* such as during initialization or when the link speed changes.
*/
-void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
+void ixgbe_ptp_start_timecounter(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
- struct cyclecounter cc;
unsigned long flags;
u32 incval = 0;
u32 tsauxc = 0;
@@ -1104,9 +1104,9 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
* proper fix to this problem would require modification of the
* timecounter delta calculations.
*/
- cc.mask = CLOCKSOURCE_MASK(64);
- cc.mult = 1;
- cc.shift = 0;
+ adapter->cc_mask = CLOCKSOURCE_MASK(64);
+ adapter->cc_mult = 1;
+ adapter->cc_shift = 0;
switch (hw->mac.type) {
case ixgbe_mac_X550EM_x:
@@ -1118,13 +1118,13 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
*/
fuse0 = IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0));
if (!(fuse0 & IXGBE_FUSES0_300MHZ)) {
- cc.mult = 3;
- cc.shift = 2;
+ adapter->cc_mult = 3;
+ adapter->cc_shift = 2;
}
/* fallthrough */
case ixgbe_mac_x550em_a:
case ixgbe_mac_X550:
- cc.read = ixgbe_ptp_read_X550;
+ adapter->cc_read = ixgbe_ptp_read_X550;
/* enable SYSTIME counter */
IXGBE_WRITE_REG(hw, IXGBE_SYSTIMR, 0);
@@ -1139,17 +1139,21 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
IXGBE_WRITE_FLUSH(hw);
break;
case ixgbe_mac_X540:
- cc.read = ixgbe_ptp_read_82599;
+ adapter->cc_read = ixgbe_ptp_read_82599;
- ixgbe_ptp_link_speed_adjust(adapter, &cc.shift, &incval);
+ ixgbe_ptp_link_speed_adjust(adapter,
+ &adapter->cc_shift,
+ &incval);
IXGBE_WRITE_REG(hw, IXGBE_TIMINCA, incval);
break;
case ixgbe_mac_82599EB:
- cc.read = ixgbe_ptp_read_82599;
+ adapter->cc_read = ixgbe_ptp_read_82599;
- ixgbe_ptp_link_speed_adjust(adapter, &cc.shift, &incval);
+ ixgbe_ptp_link_speed_adjust(adapter,
+ &adapter->cc_shift,
+ &incval);
incval >>= IXGBE_INCVAL_SHIFT_82599;
- cc.shift -= IXGBE_INCVAL_SHIFT_82599;
+ adapter->cc_shift -= IXGBE_INCVAL_SHIFT_82599;
IXGBE_WRITE_REG(hw, IXGBE_TIMINCA,
BIT(IXGBE_INCPER_SHIFT_82599) | incval);
break;
@@ -1164,7 +1168,12 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
/* need lock to prevent incorrect read while modifying cyclecounter */
spin_lock_irqsave(&adapter->tmreg_lock, flags);
- memcpy(&adapter->hw_tc.cc, &cc, sizeof(adapter->hw_tc.cc));
+ timecounter_initialize(&adapter->tc,
+ adapter->cc_read,
+ adapter->cc_mask,
+ adapter->cc_mult,
+ adapter->cc_shift,
+ ktime_to_ns(ktime_get_real()));
spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
}
@@ -1192,11 +1201,7 @@ void ixgbe_ptp_reset(struct ixgbe_adapter *adapter)
if (hw->mac.type == ixgbe_mac_82598EB)
return;
- ixgbe_ptp_start_cyclecounter(adapter);
-
- spin_lock_irqsave(&adapter->tmreg_lock, flags);
- timecounter_init(&adapter->hw_tc, ktime_to_ns(ktime_get_real()));
- spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
+ ixgbe_ptp_start_timecounter(adapter);
adapter->last_overflow_check = jiffies;
--
1.9.1
^ permalink raw reply related
* [PATCH 11/27] net/mlx4: Use timecounter_initialize interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Tariq Toukan, netdev,
linux-rdma
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update mlx4 timecounter
init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: netdev@vger.kernel.org
Cc: linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/mellanox/mlx4/en_clock.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index 35987b5..dd736cc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -264,6 +264,7 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
{
struct mlx4_dev *dev = mdev->dev;
unsigned long flags;
+ u32 mult, shift;
/* mlx4_en_init_timestamp is called for each netdev.
* mdev->ptp_clock is common for all ports, skip initialization if
@@ -274,17 +275,17 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
seqlock_init(&mdev->clock_lock);
- memset(&mdev->clock.cc, 0, sizeof(mdev->clock.cc));
- mdev->clock.cc.read = mlx4_en_read_clock;
- mdev->clock.cc.mask = CLOCKSOURCE_MASK(48);
- mdev->clock.cc.shift = freq_to_shift(dev->caps.hca_core_clock);
- mdev->clock.cc.mult =
- clocksource_khz2mult(1000 * dev->caps.hca_core_clock,
- mdev->clock.cc.shift);
+ shift = freq_to_shift(dev->caps.hca_core_clock);
+ mult = clocksource_khz2mult(1000 * dev->caps.hca_core_clock, shift);
mdev->nominal_c_mult = mdev->clock.cc.mult;
write_seqlock_irqsave(&mdev->clock_lock, flags);
- timecounter_init(&mdev->clock, ktime_to_ns(ktime_get_real()));
+ timecounter_initialize(&mdev->clock,
+ mlx4_en_read_clock,
+ CLOCKSOURCE_MASK(48),
+ mult,
+ shift,
+ ktime_to_ns(ktime_get_real()));
write_sequnlock_irqrestore(&mdev->clock_lock, flags);
/* Configure the PHC */
--
1.9.1
^ permalink raw reply related
* [PATCH 13/27] qede: Use timecounter_initialize interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Ariel Elior, everest-linux-l2,
netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update qede timecounter
init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Ariel Elior <Ariel.Elior@cavium.com>
Cc: everest-linux-l2@cavium.com
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/qlogic/qede/qede_ptp.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_ptp.c b/drivers/net/ethernet/qlogic/qede/qede_ptp.c
index 95bb8a8..0d054dc 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_ptp.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_ptp.c
@@ -427,13 +427,12 @@ static int qede_ptp_init(struct qede_dev *edev, bool init_tc)
* unload / load (e.g. MTU change) while it is running.
*/
if (init_tc) {
- memset(&ptp->tc.cc, 0, sizeof(ptp->tc.cc));
- ptp->tc.cc.read = qede_ptp_read_cc;
- ptp->tc.cc.mask = CYCLECOUNTER_MASK(64);
- ptp->tc.cc.shift = 0;
- ptp->tc.cc.mult = 1;
-
- timecounter_init(&ptp->tc, ktime_to_ns(ktime_get_real()));
+ timecounter_initialize(&ptp->tc,
+ qede_ptp_read_cc,
+ CYCLECOUNTER_MASK(64),
+ 1,
+ 0,
+ ktime_to_ns(ktime_get_real()));
}
return rc;
--
1.9.1
^ permalink raw reply related
* [PATCH 14/27] net: cpts: Use timecounter_initialize interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, David S. Miller, Grygorii Strashko,
Richard Cochran, Bhumika Goyal, Thomas Gleixner, Ivan Khoronzhuk,
netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update cpts timecounter
init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/ti/cpts.c | 29 +++++++++++++++++------------
drivers/net/ethernet/ti/cpts.h | 3 +++
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index b8fe843..e6afc94 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -447,7 +447,12 @@ int cpts_register(struct cpts *cpts)
cpts_write32(cpts, CPTS_EN, control);
cpts_write32(cpts, TS_PEND_EN, int_enable);
- timecounter_init(&cpts->tc, ktime_to_ns(ktime_get_real()));
+ timecounter_initialize(&cpts->tc,
+ cpts_systim_read,
+ cpts->mask,
+ cpts->mult,
+ cpts->shift,
+ ktime_to_ns(ktime_get_real()));
cpts->clock = ptp_clock_register(&cpts->info, cpts->dev);
if (IS_ERR(cpts->clock)) {
@@ -484,7 +489,8 @@ void cpts_unregister(struct cpts *cpts)
}
EXPORT_SYMBOL_GPL(cpts_unregister);
-static void cpts_calc_mult_shift(struct cpts *cpts)
+static void cpts_calc_mult_shift(struct cpts *cpts, u64 mask,
+ u32 *mult, u32 *shift)
{
struct cyclecounter *cc = &cpts->tc.cc;
u64 frac, maxsec, ns;
@@ -495,7 +501,7 @@ static void cpts_calc_mult_shift(struct cpts *cpts)
/* Calc the maximum number of seconds which we can run before
* wrapping around.
*/
- maxsec = cc->mask;
+ maxsec = mask;
do_div(maxsec, freq);
/* limit conversation rate to 10 sec as higher values will produce
* too small mult factors and so reduce the conversion accuracy
@@ -508,18 +514,18 @@ static void cpts_calc_mult_shift(struct cpts *cpts)
dev_info(cpts->dev, "cpts: overflow check period %lu (jiffies)\n",
cpts->ov_check_period);
- if (cc->mult || cc->shift)
+ if (*mult || *shift)
return;
- clocks_calc_mult_shift(&cc->mult, &cc->shift,
+ clocks_calc_mult_shift(mult, shift,
freq, NSEC_PER_SEC, maxsec);
frac = 0;
- ns = cyclecounter_cyc2ns(cc, freq, cc->mask, &frac);
+ ns = cyclecounter_cyc2ns(cc, freq, mask, &frac);
dev_info(cpts->dev,
"CPTS: ref_clk_freq:%u calc_mult:%u calc_shift:%u error:%lld nsec/sec\n",
- freq, cc->mult, cc->shift,
+ freq, *mult, *shift,
(ns - NSEC_PER_SEC));
}
@@ -571,15 +577,14 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs,
clk_prepare(cpts->refclk);
- cpts->tc.cc.read = cpts_systim_read;
- cpts->tc.cc.mask = CLOCKSOURCE_MASK(32);
+ cpts->mask = CLOCKSOURCE_MASK(32);
cpts->info = cpts_info;
- cpts_calc_mult_shift(cpts);
- /* save tc.cc.mult original value as it can be modified
+ cpts_calc_mult_shift(cpts, cpts->mask, &cpts->mult, &cpts->shift);
+ /* save mult original value as it can be modified
* by cpts_ptp_adjfreq().
*/
- cpts->cc_mult = cpts->tc.cc.mult;
+ cpts->cc_mult = cpts->mult;
return cpts;
}
diff --git a/drivers/net/ethernet/ti/cpts.h b/drivers/net/ethernet/ti/cpts.h
index a7174eb..da50d34 100644
--- a/drivers/net/ethernet/ti/cpts.h
+++ b/drivers/net/ethernet/ti/cpts.h
@@ -118,6 +118,9 @@ struct cpts {
spinlock_t lock; /* protects time registers */
u32 cc_mult; /* for the nominal frequency */
struct timecounter tc;
+ u64 mask;
+ u32 mult;
+ u32 shift;
int phc_index;
struct clk *refclk;
struct list_head events;
--
1.9.1
^ permalink raw reply related
* [PATCH 17/27] amd-xgbe: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Sagar Arun Kamble, Richard Cochran, Tom Lendacky, netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update xgbe_config_tstamp and xgbe_settime with this new
function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 4 ++--
drivers/net/ethernet/amd/xgbe/xgbe-ptp.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
index 5005c87..aee99de 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
@@ -1621,8 +1621,8 @@ static int xgbe_config_tstamp(struct xgbe_prv_data *pdata,
xgbe_update_tstamp_addend(pdata, pdata->tstamp_addend);
xgbe_set_tstamp_time(pdata, 0, 0);
- /* Initialize the timecounter */
- timecounter_init(&pdata->tstamp_tc, ktime_to_ns(ktime_get_real()));
+ /* Reset the timecounter */
+ timecounter_reset(&pdata->tstamp_tc, ktime_to_ns(ktime_get_real()));
return 0;
}
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
index 486437b..5fcde50 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
@@ -211,7 +211,7 @@ static int xgbe_settime(struct ptp_clock_info *info,
spin_lock_irqsave(&pdata->tstamp_lock, flags);
- timecounter_init(&pdata->tstamp_tc, nsec);
+ timecounter_reset(&pdata->tstamp_tc, nsec);
spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
--
1.9.1
^ permalink raw reply related
* [PATCH 18/27] bnx2x: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Ariel Elior, everest-linux-l2,
netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update bnx2x_ptp_settime with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Ariel Elior <ariel.elior@cavium.com>
Cc: everest-linux-l2@cavium.com
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 1e10a81..e30e736 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -13849,8 +13849,8 @@ static int bnx2x_ptp_settime(struct ptp_clock_info *ptp,
DP(BNX2X_MSG_PTP, "PTP settime called, ns = %llu\n", ns);
- /* Re-init the timecounter */
- timecounter_init(&bp->timecounter, ns);
+ /* Reset the timecounter */
+ timecounter_reset(&bp->timecounter, ns);
return 0;
}
--
1.9.1
^ permalink raw reply related
* [PATCH 19/27] net: fec: ptp: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Sagar Arun Kamble, Richard Cochran, Fugang Duan, netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update fec_ptp_settime with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Fugang Duan <fugang.duan@nxp.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/freescale/fec_ptp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index 1ba7216..d03ea0e 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -419,7 +419,6 @@ static int fec_ptp_settime(struct ptp_clock_info *ptp,
{
struct fec_enet_private *fep =
container_of(ptp, struct fec_enet_private, ptp_caps);
-
u64 ns;
unsigned long flags;
u32 counter;
@@ -439,7 +438,7 @@ static int fec_ptp_settime(struct ptp_clock_info *ptp,
spin_lock_irqsave(&fep->tmreg_lock, flags);
writel(counter, fep->hwp + FEC_ATIME);
- timecounter_init(&fep->tc, ns);
+ timecounter_reset(&fep->tc, ns);
spin_unlock_irqrestore(&fep->tmreg_lock, flags);
mutex_unlock(&fep->ptp_clk_mutex);
return 0;
--
1.9.1
^ permalink raw reply related
* [PATCH 20/27] e1000e: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Jeff Kirsher, intel-wired-lan,
netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update e1000e_phc_settime with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/intel/e1000e/ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
index 03d5f2a..5b368aa 100644
--- a/drivers/net/ethernet/intel/e1000e/ptp.c
+++ b/drivers/net/ethernet/intel/e1000e/ptp.c
@@ -222,7 +222,7 @@ static int e1000e_phc_settime(struct ptp_clock_info *ptp,
/* reset the timecounter */
spin_lock_irqsave(&adapter->systim_lock, flags);
- timecounter_init(&adapter->tc, ns);
+ timecounter_reset(&adapter->tc, ns);
spin_unlock_irqrestore(&adapter->systim_lock, flags);
return 0;
--
1.9.1
^ permalink raw reply related
* [PATCH 22/27] ixgbe: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Jeff Kirsher, intel-wired-lan,
netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update ixgbe_ptp_settime with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 073c1ef..35f85ef 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -508,7 +508,7 @@ static int ixgbe_ptp_settime(struct ptp_clock_info *ptp,
/* reset the timecounter */
spin_lock_irqsave(&adapter->tmreg_lock, flags);
- timecounter_init(&adapter->hw_tc, ns);
+ timecounter_reset(&adapter->hw_tc, ns);
spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
if (adapter->ptp_setup_sdp)
--
1.9.1
^ permalink raw reply related
* [PATCH 23/27] net/mlx4: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Tariq Toukan, netdev,
linux-rdma
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update mlx4_en_phc_settime with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: netdev@vger.kernel.org
Cc: linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/mellanox/mlx4/en_clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index dd736cc..bfed4ac 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -207,7 +207,7 @@ static int mlx4_en_phc_settime(struct ptp_clock_info *ptp,
/* reset the timecounter */
write_seqlock_irqsave(&mdev->clock_lock, flags);
- timecounter_init(&mdev->clock, ns);
+ timecounter_reset(&mdev->clock, ns);
write_sequnlock_irqrestore(&mdev->clock_lock, flags);
return 0;
--
1.9.1
^ permalink raw reply related
* [PATCH 24/27] net/mlx5: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, Richard Cochran, Saeed Mahameed, Matan Barak,
Leon Romanovsky, Eugenia Emantayev, Eitan Rabin, Feras Daoud,
Tariq Toukan, Thomas Gleixner, netdev, linux-rdma
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update mlx5_ptp_settime with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Matan Barak <matanb@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>
Cc: Eugenia Emantayev <eugenia@mellanox.com>
Cc: Eitan Rabin <rabin@mellanox.com>
Cc: Feras Daoud <ferasda@mellanox.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: netdev@vger.kernel.org
Cc: linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
index 071f78a..e490522 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
@@ -122,7 +122,7 @@ static int mlx5_ptp_settime(struct ptp_clock_info *ptp,
unsigned long flags;
write_lock_irqsave(&clock->lock, flags);
- timecounter_init(&clock->tc, ns);
+ timecounter_reset(&clock->tc, ns);
write_unlock_irqrestore(&clock->lock, flags);
return 0;
--
1.9.1
^ permalink raw reply related
* [PATCH 26/27] net: cpts: Use timecounter_reset interface
From: Sagar Arun Kamble @ 2017-12-15 7:38 UTC (permalink / raw)
To: linux-kernel
Cc: Sagar Arun Kamble, David S. Miller, Grygorii Strashko,
Bhumika Goyal, Richard Cochran, Thomas Gleixner, netdev
In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com>
With new interface timecounter_reset we can update the start time for
timecounter. Update cpts_ptp_settime with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/ethernet/ti/cpts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index e6afc94..41bac4d 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -268,7 +268,7 @@ static int cpts_ptp_settime(struct ptp_clock_info *ptp,
ns = timespec64_to_ns(ts);
spin_lock_irqsave(&cpts->lock, flags);
- timecounter_init(&cpts->tc, ns);
+ timecounter_reset(&cpts->tc, ns);
spin_unlock_irqrestore(&cpts->lock, flags);
return 0;
--
1.9.1
^ permalink raw reply related
* [patch net] mlxsw: spectrum: Disable MAC learning for ovs port
From: Jiri Pirko @ 2017-12-15 7:44 UTC (permalink / raw)
To: netdev; +Cc: davem, yuvalm, idosch, mlxsw
From: Yuval Mintz <yuvalm@mellanox.com>
Learning is currently enabled for ports which are OVS slaves -
even though OVS doesn't need this indication.
Since we're not associating a fid with the port, HW would continuously
notify driver of learned [& aged] MACs which would be logged as errors.
Fixes: 2b94e58df58c ("mlxsw: spectrum: Allow ports to work under OVS master")
Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 2d0897b..9bd8d28 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -4300,6 +4300,7 @@ static int mlxsw_sp_port_stp_set(struct mlxsw_sp_port *mlxsw_sp_port,
static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
{
+ u16 vid = 1;
int err;
err = mlxsw_sp_port_vp_mode_set(mlxsw_sp_port, true);
@@ -4312,8 +4313,19 @@ static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
true, false);
if (err)
goto err_port_vlan_set;
+
+ for (; vid <= VLAN_N_VID - 1; vid++) {
+ err = mlxsw_sp_port_vid_learning_set(mlxsw_sp_port,
+ vid, false);
+ if (err)
+ goto err_vid_learning_set;
+ }
+
return 0;
+err_vid_learning_set:
+ for (vid--; vid >= 1; vid--)
+ mlxsw_sp_port_vid_learning_set(mlxsw_sp_port, vid, true);
err_port_vlan_set:
mlxsw_sp_port_stp_set(mlxsw_sp_port, false);
err_port_stp_set:
@@ -4323,6 +4335,12 @@ static int mlxsw_sp_port_ovs_join(struct mlxsw_sp_port *mlxsw_sp_port)
static void mlxsw_sp_port_ovs_leave(struct mlxsw_sp_port *mlxsw_sp_port)
{
+ u16 vid;
+
+ for (vid = VLAN_N_VID - 1; vid >= 1; vid--)
+ mlxsw_sp_port_vid_learning_set(mlxsw_sp_port,
+ vid, true);
+
mlxsw_sp_port_vlan_set(mlxsw_sp_port, 2, VLAN_N_VID - 1,
false, false);
mlxsw_sp_port_stp_set(mlxsw_sp_port, false);
--
2.9.5
^ permalink raw reply related
* Re: [PATCH net-next v4 4/5] bnx2x: Use NETIF_F_GRO_HW.
From: Michael Chan @ 2017-12-15 7:56 UTC (permalink / raw)
To: Chopra, Manish
Cc: davem@davemloft.net, netdev@vger.kernel.org,
andrew.gospodarek@broadcom.com, Elior, Ariel,
Dept-Eng Everest Linux L2
In-Reply-To: <BN3PR0701MB1412DAFEDB385E722073AD9F890B0@BN3PR0701MB1412.namprd07.prod.outlook.com>
On Thu, Dec 14, 2017 at 11:07 PM, Chopra, Manish
<Manish.Chopra@cavium.com> wrote:
> Michael, I checked it on again, I tried to set LRO in dev->features and dev->hw_features.
> Somehow, it gets disabled after register_netdevice(). Any idea why ? Although, I am not running any Bridge/bonding devices.
> Looks like, without this series also devices seems to have LRO disabled by default.
> Not sure why register_netdevice() disables LRO even driver populates this feature prior to register_netdevice().
May be you have ip forwarding enabled.
^ permalink raw reply
* Re: [PATCH net-next v6 1/2] dt-bindings: net: add DT bindings for Socionext UniPhier AVE
From: Kunihiko Hayashi @ 2017-12-15 8:03 UTC (permalink / raw)
To: Florian Fainelli
Cc: David Miller, netdev-u79uwXL29TY76Z2rM5mHXA, Andrew Lunn,
Rob Herring, Mark Rutland,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Masahiro Yamada,
Masami Hiramatsu, Jassi Brar
In-Reply-To: <7749e13a-56ef-0d43-1a41-dbd457227575-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Hello Florian,
On Thu, 14 Dec 2017 15:24:17 -0800 <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
> On 12/14/2017 02:05 AM, Kunihiko Hayashi wrote:
> > DT bindings for the AVE ethernet controller found on Socionext's
> > UniPhier platforms.
> >
> > Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
> > Signed-off-by: Jassi Brar <jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > ---
> > .../bindings/net/socionext,uniphier-ave4.txt | 48 ++++++++++++++++++++++
> > 1 file changed, 48 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
> >
> > diff --git a/Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt b/Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
> > new file mode 100644
> > index 0000000..4700377
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/socionext,uniphier-ave4.txt
> > @@ -0,0 +1,48 @@
> > +* Socionext AVE ethernet controller
> > +
> > +This describes the devicetree bindings for AVE ethernet controller
> > +implemented on Socionext UniPhier SoCs.
> > +
> > +Required properties:
> > + - compatible: Should be
> > + - "socionext,uniphier-pro4-ave4" : for Pro4 SoC
> > + - "socionext,uniphier-pxs2-ave4" : for PXs2 SoC
> > + - "socionext,uniphier-ld11-ave4" : for LD11 SoC
> > + - "socionext,uniphier-ld20-ave4" : for LD20 SoC
> > + - reg: Address where registers are mapped and size of region.
> > + - interrupts: Should contain the MAC interrupt.
> > + - phy-mode: See ethernet.txt in the same directory. Allow to choose
> > + "rgmii", "rmii", or "mii" according to the PHY.
> > + - phy-handle: Should point to the external phy device.
> > + See ethernet.txt file in the same directory.
> > + - clocks: A phandle to the clock for the MAC.
> > +
> > +Optional properties:
> > + - resets: A phandle to the reset control for the MAC
> > + - local-mac-address: See ethernet.txt in the same directory.
> > +
> > +Required subnode:
> > + - mdio: Device tree subnode with the following required properties:
> > + - #address-cells: Must be <1>.
> > + - #size-cells: Must be <0>.
> > + - reg: phy ID number, usually a small integer.
>
> Almost, the "reg" property applies to the MDIO child nodes: the Ethernet
> PHYs/MDIO devices. For the MDIO controller itself, the "reg" property,
> if specified, would be relative to the Ethernet controller's base
> register address.
>
> Please drop this property's description here.
Thank you for pointing out.
Surely this MDIO node doesn't have own "reg" property, and this description
shows "reg" property of PHY device connected to the MDIO bus.
I'll remove the description.
Thank you,
> > +
> > +Example:
> > +
> > + ether: ethernet@65000000 {
> > + compatible = "socionext,uniphier-ld20-ave4";
> > + reg = <0x65000000 0x8500>;
> > + interrupts = <0 66 4>;
> > + phy-mode = "rgmii";
> > + phy-handle = <ðphy>;
> > + clocks = <&sys_clk 6>;
> > + resets = <&sys_rst 6>;
> > + local-mac-address = [00 00 00 00 00 00];
> > + mdio {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + ethphy: ethphy@1 {
> > + reg = <1>;
> > + };
> > + };
> > + };
> >
>
> --
> Florian
---
Best Regards,
Kunihiko Hayashi
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2 iproute2 1/1] ss: add missing path MTU parameter
From: Stefano Brivio @ 2017-12-15 8:45 UTC (permalink / raw)
To: Roman Mashak; +Cc: stephen, netdev, jhs
In-Reply-To: <1513281551-31687-1-git-send-email-mrv@mojatatu.com>
Hi Roman,
On Thu, 14 Dec 2017 14:59:11 -0500
Roman Mashak <mrv@mojatatu.com> wrote:
> @@ -1959,6 +1960,8 @@ static void tcp_stats_print(struct tcpstat *s)
>
> if (s->mss)
> printf(" mss:%d", s->mss);
> + if (s->pmtu)
> + printf(" pmtu:%u", s->pmtu);
You'll simply need to change this to out() now, as this print will be
buffered.
--
Stefano
^ permalink raw reply
* Re: [PATCH net-next 1/1] net: dsa: microchip: Add Microchip KSZ8895 DSA driver
From: Andrew Lunn @ 2017-12-15 8:54 UTC (permalink / raw)
To: Pavel Machek
Cc: Tristram.Ha, f.fainelli, muvarov, nathan.leigh.conrad,
vivien.didelot, UNGLinuxDriver, netdev
In-Reply-To: <20171214211220.GB31098@amd>
> > I also have a simple utility to communicate with that registers file to read/write
> > register individually. Is there a standard Linux utility for that
> > function?
>
> I don't think standard utility exists. Binary file which can be
> written by userspace shoudl be enough.
mii-tool will allow you to read PHY registers. The kernel API it uses
allows you to read any register on the MDIO bus.
> spi@0 {
> compatible = "microchip,ksz8895";
> ...
> ports {
> port@4 {
> reg = <4>;
> label = "cpu";
> ethernet = <&mac0>;
> fixed-link {
> speed = <100>;
> full-duplex;
> };
> };
> };
> };
>
> On one side, and
>
> mac0: ethernet@800f0000 {
> phy-mode = "rmii";
> status = "okay";
> fixed-link {
> speed = <100>;
> full-duplex;
> };
> };
Are the MAC connected back-to-back, or do you have PHYs in the middle?
mac0 you have phy-mode = "rmii";. You can put the same in the port@4,
but i don't know if the driver looks for it, and configures the MAC as
needed.
Andrew
^ permalink raw reply
* Re: [patch net-next v3 05/10] net: sched: keep track of offloaded filters and check tc offload feature
From: Jiri Pirko @ 2017-12-15 9:09 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, davem, jhs, xiyou.wangcong, mlxsw, andrew, vivien.didelot,
f.fainelli, michael.chan, ganeshgr, saeedm, matanb, leonro,
idosch, simon.horman, pieter.jansenvanvuuren, john.hurley,
alexander.h.duyck, ogerlitz, john.fastabend, daniel
In-Reply-To: <20171214104941.2f051af1@cakuba.netronome.com>
Thu, Dec 14, 2017 at 07:49:41PM CET, jakub.kicinski@netronome.com wrote:
>On Thu, 14 Dec 2017 14:10:45 +0100, Jiri Pirko wrote:
>> >Why? Just a namechange?
>> >
>> >
>> >>IIUC the problem is we don't know whether the driver/callee of the new
>> >>port is aware of previous callbacks/filters and we can't replay them.
>>
>> Well, the problem is a bit different.
>> There are 2 scenarios when we need to fail here:
>> 1) tc offload feature is turned off, there are some filters offloaded in
>> the block. That is what I commented above.
>> 2) tc offload feature is turned on, there are some filters offloaded in
>> the block but the block is not accounted by the driver. This is
>> because of the lack or replay. This is taken care of in the beginning
>> of __tcf_block_cb_register function - see below, there is a comment
>> there.
>
>Restating in code terms, shouldn't this:
>
>+ tcf_block_offload_cmd(block, dev, ei, TC_BLOCK_BIND);
>+ return 0;
>
>return the error like this:
>
> return tcf_block_offload_cmd(block, dev, ei, TC_BLOCK_BIND);
>
>We expect simple drivers to do this:
>
> case TC_BLOCK_BIND:
> return tcf_block_cb_register(f->block, mycb,
> priv, priv);
>
>Which will return an error for shared offloaded block, just need to
>propagate it.
Got it. Will do. Thanks!
^ permalink raw reply
* Re: [patch net-next v3 05/10] net: sched: keep track of offloaded filters and check tc offload feature
From: Jiri Pirko @ 2017-12-15 9:09 UTC (permalink / raw)
To: Jakub Kicinski
Cc: netdev, davem, jhs, xiyou.wangcong, mlxsw, andrew, vivien.didelot,
f.fainelli, michael.chan, ganeshgr, saeedm, matanb, leonro,
idosch, simon.horman, pieter.jansenvanvuuren, john.hurley,
alexander.h.duyck, ogerlitz, john.fastabend, daniel
In-Reply-To: <20171214112243.14e72b11@cakuba.netronome.com>
Thu, Dec 14, 2017 at 08:22:43PM CET, jakub.kicinski@netronome.com wrote:
>On Wed, 13 Dec 2017 16:10:33 +0100, Jiri Pirko wrote:
>> diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
>> index 69d7e9a..9cf61e7 100644
>> --- a/net/sched/cls_bpf.c
>> +++ b/net/sched/cls_bpf.c
>> @@ -170,8 +170,10 @@ static int cls_bpf_offload_cmd(struct tcf_proto *tp, struct cls_bpf_prog *prog,
>> cls_bpf_offload_cmd(tp, prog, TC_CLSBPF_DESTROY);
>> return err;
>> } else if (err > 0) {
>> - prog->gen_flags |= TCA_CLS_FLAGS_IN_HW;
>> + tcf_block_offload_inc(block, &prog->gen_flags);
>> }
>> + } else {
>> + tcf_block_offload_dec(block, &prog->gen_flags);
>> }
>>
>> if (addorrep && skip_sw && !(prog->gen_flags & TCA_CLS_FLAGS_IN_HW))
>
>The in_hw reporting also seems broken.
>
>tools/testing/selftests/bpf/test_offload.py catches this.
Will check it. Thanks!
^ permalink raw reply
* Re: [PATCH net-next] net: phy: broadcom: Add entry for 5395 switch PHYs
From: Andrew Lunn @ 2017-12-15 9:10 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, cphealy
In-Reply-To: <1513302496-22888-1-git-send-email-f.fainelli@gmail.com>
On Thu, Dec 14, 2017 at 05:48:16PM -0800, Florian Fainelli wrote:
> Add an entry for the builtin PHYs present in the Broadcom BCM5395 switch. This
> allows us to retrieve the PHY statistics among other things.
> static struct phy_driver broadcom_drivers[] = {
> {
> .phy_id = PHY_ID_BCM5411,
> @@ -679,6 +710,16 @@ static struct phy_driver broadcom_drivers[] = {
> .config_init = brcm_fet_config_init,
> .ack_interrupt = brcm_fet_ack_interrupt,
> .config_intr = brcm_fet_config_intr,
> +}, {
> + .phy_id = PHY_ID_BCM5395,
> + .phy_id_mask = 0xfffffff0,
> + .name = "Broadcom BCM5395",
> + .flags = PHY_IS_INTERNAL,
> + .features = PHY_GBIT_FEATURES,
> + .get_sset_count = bcm_phy_get_sset_count,
> + .get_strings = bcm_phy_get_strings,
> + .get_stats = bcm53xx_phy_get_stats,
> + .probe = bcm53xx_phy_probe,
> } };
Hi Florian
Is this the only PHY supported by this driver which has statistics?
Andrew
^ permalink raw reply
* [PATCH RFC v2 0/5] Support asynchronous crypto for IPsec GSO.
From: Steffen Klassert @ 2017-12-15 9:13 UTC (permalink / raw)
To: netdev; +Cc: Steffen Klassert
This patchset implements asynchronous crypto handling
in the layer 2 TX path. With this we can allow IPsec
ESP GSO for software crypto. This also merges the IPsec
GSO and non-GSO paths to both use validate_xmit_xfrm().
1) Separate ESP handling from segmentation for GRO packets.
This unifies the IPsec GSO and non GSO codepath.
2) Add asynchronous callbacks for xfrm on layer 2. This
adds the necessary infrastructure to core networking.
3) Allow to use the layer2 IPsec GSO codepath for software
crypto, all infrastructure is there now.
4) Also allow IPsec GSO with software crypto for local sockets.
5) Don't require synchronous crypto fallback on IPsec offloading,
it is not needed anymore.
I plan to merge this to ipsec-next during this development cycle.
Changes from v1:
- Resolve conflicts with the lockless qdisc patchset.
- Fix compilation error when CONFIG_XFRM is not set.
- Order local local variables of new functions in reverse christmas
tree ordering.
^ permalink raw reply
* [PATCH RFC v2 3/5] xfrm: Allow to use the layer2 IPsec GSO codepath for software crypto.
From: Steffen Klassert @ 2017-12-15 9:13 UTC (permalink / raw)
To: netdev; +Cc: Steffen Klassert
In-Reply-To: <20171215091308.23626-1-steffen.klassert@secunet.com>
We now have support for asynchronous crypto operations in the layer 2 TX
path. This was the missing part to allow the GSO codepath for software
crypto, so allow this codepath now.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 3f91ccffbcc8..03f2bc61f1fc 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -202,8 +202,8 @@ bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x)
if (!x->type_offload || x->encap)
return false;
- if ((x->xso.offload_handle && (dev == xfrm_dst_path(dst)->dev)) &&
- !xdst->child->xfrm && x->type->get_mtu) {
+ if ((!dev || (x->xso.offload_handle && (dev == xfrm_dst_path(dst)->dev))) &&
+ (!xdst->child->xfrm && x->type->get_mtu)) {
mtu = x->type->get_mtu(x, xdst->child_mtu_cached);
if (skb->len <= mtu)
--
2.14.1
^ permalink raw reply related
* [PATCH RFC v2 4/5] xfrm: Allow IPsec GSO with software crypto for local sockets.
From: Steffen Klassert @ 2017-12-15 9:13 UTC (permalink / raw)
To: netdev; +Cc: Steffen Klassert
In-Reply-To: <20171215091308.23626-1-steffen.klassert@secunet.com>
With support of async crypto operations in the GSO codepath
we have everything in place to allow GSO for local sockets.
This patch enables the GSO codepath.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
include/net/xfrm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 2517c4f7781a..357764a2bb4e 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1910,6 +1910,8 @@ static inline bool xfrm_dst_offload_ok(struct dst_entry *dst)
return false;
xdst = (struct xfrm_dst *) dst;
+ if (!x->xso.offload_handle && !xdst->child->xfrm)
+ return true;
if (x->xso.offload_handle && (x->xso.dev == xfrm_dst_path(dst)->dev) &&
!xdst->child->xfrm)
return true;
--
2.14.1
^ permalink raw reply related
* [PATCH RFC v2 5/5] esp: Don't require synchronous crypto fallback on offloading anymore.
From: Steffen Klassert @ 2017-12-15 9:13 UTC (permalink / raw)
To: netdev; +Cc: Steffen Klassert
In-Reply-To: <20171215091308.23626-1-steffen.klassert@secunet.com>
We support asynchronous crypto on layer 2 ESP now.
So no need to force synchronous crypto fallback on
offloading anymore.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/ipv4/esp4.c | 12 ++----------
net/ipv6/esp6.c | 12 ++----------
2 files changed, 4 insertions(+), 20 deletions(-)
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 7948833dc204..6f00e43120a8 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -843,17 +843,13 @@ static int esp_init_aead(struct xfrm_state *x)
char aead_name[CRYPTO_MAX_ALG_NAME];
struct crypto_aead *aead;
int err;
- u32 mask = 0;
err = -ENAMETOOLONG;
if (snprintf(aead_name, CRYPTO_MAX_ALG_NAME, "%s(%s)",
x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME)
goto error;
- if (x->xso.offload_handle)
- mask |= CRYPTO_ALG_ASYNC;
-
- aead = crypto_alloc_aead(aead_name, 0, mask);
+ aead = crypto_alloc_aead(aead_name, 0, 0);
err = PTR_ERR(aead);
if (IS_ERR(aead))
goto error;
@@ -883,7 +879,6 @@ static int esp_init_authenc(struct xfrm_state *x)
char authenc_name[CRYPTO_MAX_ALG_NAME];
unsigned int keylen;
int err;
- u32 mask = 0;
err = -EINVAL;
if (!x->ealg)
@@ -909,10 +904,7 @@ static int esp_init_authenc(struct xfrm_state *x)
goto error;
}
- if (x->xso.offload_handle)
- mask |= CRYPTO_ALG_ASYNC;
-
- aead = crypto_alloc_aead(authenc_name, 0, mask);
+ aead = crypto_alloc_aead(authenc_name, 0, 0);
err = PTR_ERR(aead);
if (IS_ERR(aead))
goto error;
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 08a424fa8009..7c888c6e53a9 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -752,17 +752,13 @@ static int esp_init_aead(struct xfrm_state *x)
char aead_name[CRYPTO_MAX_ALG_NAME];
struct crypto_aead *aead;
int err;
- u32 mask = 0;
err = -ENAMETOOLONG;
if (snprintf(aead_name, CRYPTO_MAX_ALG_NAME, "%s(%s)",
x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME)
goto error;
- if (x->xso.offload_handle)
- mask |= CRYPTO_ALG_ASYNC;
-
- aead = crypto_alloc_aead(aead_name, 0, mask);
+ aead = crypto_alloc_aead(aead_name, 0, 0);
err = PTR_ERR(aead);
if (IS_ERR(aead))
goto error;
@@ -792,7 +788,6 @@ static int esp_init_authenc(struct xfrm_state *x)
char authenc_name[CRYPTO_MAX_ALG_NAME];
unsigned int keylen;
int err;
- u32 mask = 0;
err = -EINVAL;
if (!x->ealg)
@@ -818,10 +813,7 @@ static int esp_init_authenc(struct xfrm_state *x)
goto error;
}
- if (x->xso.offload_handle)
- mask |= CRYPTO_ALG_ASYNC;
-
- aead = crypto_alloc_aead(authenc_name, 0, mask);
+ aead = crypto_alloc_aead(authenc_name, 0, 0);
err = PTR_ERR(aead);
if (IS_ERR(aead))
goto error;
--
2.14.1
^ 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