build: move intel NIC patches
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
src/{netdev.c.orig => netdev.c} | 18 +++++++++---------
|
||||
src/{ptp.c.orig => ptp.c} | 4 ++--
|
||||
2 files changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/netdev.c.orig b/src/netdev.c
|
||||
index 73b0f9a..480265b 100644
|
||||
--- a/src/netdev.c.orig
|
||||
+++ b/src/netdev.c
|
||||
@@ -4833,24 +4833,24 @@ void e1000e_reinit_locked(struct e1000_adapter *adapter)
|
||||
/**
|
||||
* e1000e_sanitize_systim - sanitize raw cycle counter reads
|
||||
* @hw: pointer to the HW structure
|
||||
- * @systim: cycle_t value read, sanitized and returned
|
||||
+ * @systim: u64 value read, sanitized and returned
|
||||
*
|
||||
* Errata for 82574/82583 possible bad bits read from SYSTIMH/L:
|
||||
* check to see that the time is incrementing at a reasonable
|
||||
* rate and is a multiple of incvalue.
|
||||
**/
|
||||
-static cycle_t e1000e_sanitize_systim(struct e1000_hw *hw, cycle_t systim)
|
||||
+static u64 e1000e_sanitize_systim(struct e1000_hw *hw, u64 systim)
|
||||
{
|
||||
u64 time_delta, rem, temp;
|
||||
- cycle_t systim_next;
|
||||
+ u64 systim_next;
|
||||
u32 incvalue;
|
||||
int i;
|
||||
|
||||
incvalue = er32(TIMINCA) & E1000_TIMINCA_INCVALUE_MASK;
|
||||
for (i = 0; i < E1000_MAX_82574_SYSTIM_REREADS; i++) {
|
||||
/* latch SYSTIMH on read of SYSTIML */
|
||||
- systim_next = (cycle_t)er32(SYSTIML);
|
||||
- systim_next |= (cycle_t)er32(SYSTIMH) << 32;
|
||||
+ systim_next = (u64)er32(SYSTIML);
|
||||
+ systim_next |= (u64)er32(SYSTIMH) << 32;
|
||||
|
||||
time_delta = systim_next - systim;
|
||||
temp = time_delta;
|
||||
@@ -4872,13 +4872,13 @@ static cycle_t e1000e_sanitize_systim(struct e1000_hw *hw, cycle_t systim)
|
||||
* e1000e_cyclecounter_read - read raw cycle counter (used by time counter)
|
||||
* @cc: cyclecounter structure
|
||||
**/
|
||||
-static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
|
||||
+static u64 e1000e_cyclecounter_read(const struct cyclecounter *cc)
|
||||
{
|
||||
struct e1000_adapter *adapter = container_of(cc, struct e1000_adapter,
|
||||
cc);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
u32 systimel, systimeh;
|
||||
- cycle_t systim;
|
||||
+ u64 systim;
|
||||
/* SYSTIMH latching upon SYSTIML read does not work well.
|
||||
* This means that if SYSTIML overflows after we read it but before
|
||||
* we read SYSTIMH, the value of SYSTIMH has been incremented and we
|
||||
@@ -4899,8 +4899,8 @@ static cycle_t e1000e_cyclecounter_read(const struct cyclecounter *cc)
|
||||
systimel = systimel_2;
|
||||
}
|
||||
}
|
||||
- systim = (cycle_t)systimel;
|
||||
- systim |= (cycle_t)systimeh << 32;
|
||||
+ systim = (u64)systimel;
|
||||
+ systim |= (u64)systimeh << 32;
|
||||
|
||||
if (adapter->flags2 & FLAG2_CHECK_SYSTIM_OVERFLOW)
|
||||
systim = e1000e_sanitize_systim(hw, systim);
|
||||
|
||||
diff --git a/src/ptp.c.orig b/src/ptp.c
|
||||
index 00c419f..228adce 100644
|
||||
--- a/src/ptp.c.orig
|
||||
+++ b/src/ptp.c
|
||||
@@ -136,8 +136,8 @@ static int e1000e_phc_get_syncdevicetime(ktime_t * device,
|
||||
unsigned long flags;
|
||||
int i;
|
||||
u32 tsync_ctrl;
|
||||
- cycle_t dev_cycles;
|
||||
- cycle_t sys_cycles;
|
||||
+ u64 dev_cycles;
|
||||
+ u64 sys_cycles;
|
||||
|
||||
tsync_ctrl = er32(TSYNCTXCTL);
|
||||
tsync_ctrl |= E1000_TSYNCTXCTL_START_SYNC |
|
||||
@@ -0,0 +1,37 @@
|
||||
diff --git a/src/netdev.c b/src/netdev.c
|
||||
index 73b0f9a..aef1bc2 100644
|
||||
--- a/src/netdev.c
|
||||
+++ b/src/netdev.c
|
||||
@@ -6724,19 +6724,12 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
int max_frame = new_mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
|
||||
|
||||
/* Jumbo frame support */
|
||||
- if ((max_frame > (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)) &&
|
||||
+ if ((new_mtu > ETH_DATA_LEN) &&
|
||||
!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
|
||||
e_err("Jumbo Frames not supported.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- /* Supported frame sizes */
|
||||
- if ((new_mtu < (VLAN_ETH_ZLEN + ETH_FCS_LEN)) ||
|
||||
- (max_frame > adapter->max_hw_frame_size)) {
|
||||
- e_err("Unsupported MTU setting\n");
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
/* Jumbo frame workaround on 82579 and newer requires CRC be stripped */
|
||||
if ((adapter->hw.mac.type >= e1000_pch2lan) &&
|
||||
!(adapter->flags2 & FLAG2_CRC_STRIPPING) &&
|
||||
@@ -8262,6 +8255,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
#endif /* HAVE_NETDEV_VLAN_FEATURES */
|
||||
}
|
||||
|
||||
+ /* MTU range: 68 - max_hw_frame_size */
|
||||
+ netdev->min_mtu = ETH_MIN_MTU;
|
||||
+ netdev->max_mtu = adapter->max_hw_frame_size -
|
||||
+ (VLAN_ETH_HLEN + ETH_FCS_LEN);
|
||||
+
|
||||
if (e1000e_enable_mng_pass_thru(&adapter->hw))
|
||||
adapter->flags |= FLAG_MNG_PT_ENABLED;
|
||||
|
||||
Reference in New Issue
Block a user