Skip to content

Commit 0cb1a2d

Browse files
committed
tgupdate: merge t/DO-NOT-MERGE-mptcp-enabled-by-default into t/upstream base
2 parents 939d812 + 7f6d5c6 commit 0cb1a2d

File tree

15 files changed

+127
-60
lines changed

15 files changed

+127
-60
lines changed

MAINTAINERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21924,10 +21924,13 @@ F: sound/soc/uniphier/
2192421924

2192521925
SOCKET TIMESTAMPING
2192621926
M: Willem de Bruijn <[email protected]>
21927+
R: Jason Xing <[email protected]>
2192721928
S: Maintained
2192821929
F: Documentation/networking/timestamping.rst
2192921930
F: include/linux/net_tstamp.h
2193021931
F: include/uapi/linux/net_tstamp.h
21932+
F: tools/testing/selftests/bpf/*/net_timestamping*
21933+
F: tools/testing/selftests/net/*timestamp*
2193121934
F: tools/testing/selftests/net/so_txtime.c
2193221935

2193321936
SOEKRIS NET48XX LED SUPPORT

drivers/net/ethernet/freescale/enetc/enetc.c

Lines changed: 74 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,24 @@ static bool enetc_skb_is_tcp(struct sk_buff *skb)
167167
return skb->csum_offset == offsetof(struct tcphdr, check);
168168
}
169169

170+
/**
171+
* enetc_unwind_tx_frame() - Unwind the DMA mappings of a multi-buffer Tx frame
172+
* @tx_ring: Pointer to the Tx ring on which the buffer descriptors are located
173+
* @count: Number of Tx buffer descriptors which need to be unmapped
174+
* @i: Index of the last successfully mapped Tx buffer descriptor
175+
*/
176+
static void enetc_unwind_tx_frame(struct enetc_bdr *tx_ring, int count, int i)
177+
{
178+
while (count--) {
179+
struct enetc_tx_swbd *tx_swbd = &tx_ring->tx_swbd[i];
180+
181+
enetc_free_tx_frame(tx_ring, tx_swbd);
182+
if (i == 0)
183+
i = tx_ring->bd_count;
184+
i--;
185+
}
186+
}
187+
170188
static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
171189
{
172190
bool do_vlan, do_onestep_tstamp = false, do_twostep_tstamp = false;
@@ -279,9 +297,11 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
279297
}
280298

281299
if (do_onestep_tstamp) {
282-
u32 lo, hi, val;
283-
u64 sec, nsec;
300+
__be32 new_sec_l, new_nsec;
301+
u32 lo, hi, nsec, val;
302+
__be16 new_sec_h;
284303
u8 *data;
304+
u64 sec;
285305

286306
lo = enetc_rd_hot(hw, ENETC_SICTR0);
287307
hi = enetc_rd_hot(hw, ENETC_SICTR1);
@@ -295,13 +315,38 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
295315
/* Update originTimestamp field of Sync packet
296316
* - 48 bits seconds field
297317
* - 32 bits nanseconds field
318+
*
319+
* In addition, the UDP checksum needs to be updated
320+
* by software after updating originTimestamp field,
321+
* otherwise the hardware will calculate the wrong
322+
* checksum when updating the correction field and
323+
* update it to the packet.
298324
*/
299325
data = skb_mac_header(skb);
300-
*(__be16 *)(data + offset2) =
301-
htons((sec >> 32) & 0xffff);
302-
*(__be32 *)(data + offset2 + 2) =
303-
htonl(sec & 0xffffffff);
304-
*(__be32 *)(data + offset2 + 6) = htonl(nsec);
326+
new_sec_h = htons((sec >> 32) & 0xffff);
327+
new_sec_l = htonl(sec & 0xffffffff);
328+
new_nsec = htonl(nsec);
329+
if (udp) {
330+
struct udphdr *uh = udp_hdr(skb);
331+
__be32 old_sec_l, old_nsec;
332+
__be16 old_sec_h;
333+
334+
old_sec_h = *(__be16 *)(data + offset2);
335+
inet_proto_csum_replace2(&uh->check, skb, old_sec_h,
336+
new_sec_h, false);
337+
338+
old_sec_l = *(__be32 *)(data + offset2 + 2);
339+
inet_proto_csum_replace4(&uh->check, skb, old_sec_l,
340+
new_sec_l, false);
341+
342+
old_nsec = *(__be32 *)(data + offset2 + 6);
343+
inet_proto_csum_replace4(&uh->check, skb, old_nsec,
344+
new_nsec, false);
345+
}
346+
347+
*(__be16 *)(data + offset2) = new_sec_h;
348+
*(__be32 *)(data + offset2 + 2) = new_sec_l;
349+
*(__be32 *)(data + offset2 + 6) = new_nsec;
305350

306351
/* Configure single-step register */
307352
val = ENETC_PM0_SINGLE_STEP_EN;
@@ -372,25 +417,20 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
372417
dma_err:
373418
dev_err(tx_ring->dev, "DMA map error");
374419

375-
do {
376-
tx_swbd = &tx_ring->tx_swbd[i];
377-
enetc_free_tx_frame(tx_ring, tx_swbd);
378-
if (i == 0)
379-
i = tx_ring->bd_count;
380-
i--;
381-
} while (count--);
420+
enetc_unwind_tx_frame(tx_ring, count, i);
382421

383422
return 0;
384423
}
385424

386-
static void enetc_map_tx_tso_hdr(struct enetc_bdr *tx_ring, struct sk_buff *skb,
387-
struct enetc_tx_swbd *tx_swbd,
388-
union enetc_tx_bd *txbd, int *i, int hdr_len,
389-
int data_len)
425+
static int enetc_map_tx_tso_hdr(struct enetc_bdr *tx_ring, struct sk_buff *skb,
426+
struct enetc_tx_swbd *tx_swbd,
427+
union enetc_tx_bd *txbd, int *i, int hdr_len,
428+
int data_len)
390429
{
391430
union enetc_tx_bd txbd_tmp;
392431
u8 flags = 0, e_flags = 0;
393432
dma_addr_t addr;
433+
int count = 1;
394434

395435
enetc_clear_tx_bd(&txbd_tmp);
396436
addr = tx_ring->tso_headers_dma + *i * TSO_HEADER_SIZE;
@@ -433,7 +473,10 @@ static void enetc_map_tx_tso_hdr(struct enetc_bdr *tx_ring, struct sk_buff *skb,
433473
/* Write the BD */
434474
txbd_tmp.ext.e_flags = e_flags;
435475
*txbd = txbd_tmp;
476+
count++;
436477
}
478+
479+
return count;
437480
}
438481

439482
static int enetc_map_tx_tso_data(struct enetc_bdr *tx_ring, struct sk_buff *skb,
@@ -790,9 +833,9 @@ static int enetc_map_tx_tso_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb
790833

791834
/* compute the csum over the L4 header */
792835
csum = enetc_tso_hdr_csum(&tso, skb, hdr, hdr_len, &pos);
793-
enetc_map_tx_tso_hdr(tx_ring, skb, tx_swbd, txbd, &i, hdr_len, data_len);
836+
count += enetc_map_tx_tso_hdr(tx_ring, skb, tx_swbd, txbd,
837+
&i, hdr_len, data_len);
794838
bd_data_num = 0;
795-
count++;
796839

797840
while (data_len > 0) {
798841
int size;
@@ -816,8 +859,13 @@ static int enetc_map_tx_tso_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb
816859
err = enetc_map_tx_tso_data(tx_ring, skb, tx_swbd, txbd,
817860
tso.data, size,
818861
size == data_len);
819-
if (err)
862+
if (err) {
863+
if (i == 0)
864+
i = tx_ring->bd_count;
865+
i--;
866+
820867
goto err_map_data;
868+
}
821869

822870
data_len -= size;
823871
count++;
@@ -846,13 +894,7 @@ static int enetc_map_tx_tso_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb
846894
dev_err(tx_ring->dev, "DMA map error");
847895

848896
err_chained_bd:
849-
do {
850-
tx_swbd = &tx_ring->tx_swbd[i];
851-
enetc_free_tx_frame(tx_ring, tx_swbd);
852-
if (i == 0)
853-
i = tx_ring->bd_count;
854-
i--;
855-
} while (count--);
897+
enetc_unwind_tx_frame(tx_ring, count, i);
856898

857899
return 0;
858900
}
@@ -1901,7 +1943,7 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring,
19011943
enetc_xdp_drop(rx_ring, orig_i, i);
19021944
tx_ring->stats.xdp_tx_drops++;
19031945
} else {
1904-
tx_ring->stats.xdp_tx += xdp_tx_bd_cnt;
1946+
tx_ring->stats.xdp_tx++;
19051947
rx_ring->xdp.xdp_tx_in_flight += xdp_tx_bd_cnt;
19061948
xdp_tx_frm_cnt++;
19071949
/* The XDP_TX enqueue was successful, so we
@@ -3228,6 +3270,9 @@ static int enetc_hwtstamp_set(struct net_device *ndev, struct ifreq *ifr)
32283270
new_offloads |= ENETC_F_TX_TSTAMP;
32293271
break;
32303272
case HWTSTAMP_TX_ONESTEP_SYNC:
3273+
if (!enetc_si_is_pf(priv->si))
3274+
return -EOPNOTSUPP;
3275+
32313276
new_offloads &= ~ENETC_F_TX_TSTAMP_MASK;
32323277
new_offloads |= ENETC_F_TX_ONESTEP_SYNC_TSTAMP;
32333278
break;

drivers/net/ethernet/freescale/enetc/enetc4_pf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ static int enetc4_pf_netdev_create(struct enetc_si *si)
672672
err_alloc_msix:
673673
err_config_si:
674674
err_clk_get:
675-
mutex_destroy(&priv->mm_lock);
676675
free_netdev(ndev);
677676

678677
return err;
@@ -684,6 +683,7 @@ static void enetc4_pf_netdev_destroy(struct enetc_si *si)
684683
struct net_device *ndev = si->ndev;
685684

686685
unregister_netdev(ndev);
686+
enetc4_link_deinit(priv);
687687
enetc_free_msix(priv);
688688
free_netdev(ndev);
689689
}

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ static int enetc_set_coalesce(struct net_device *ndev,
832832
static int enetc_get_ts_info(struct net_device *ndev,
833833
struct kernel_ethtool_ts_info *info)
834834
{
835+
struct enetc_ndev_priv *priv = netdev_priv(ndev);
835836
int *phc_idx;
836837

837838
phc_idx = symbol_get(enetc_phc_index);
@@ -852,8 +853,10 @@ static int enetc_get_ts_info(struct net_device *ndev,
852853
SOF_TIMESTAMPING_TX_SOFTWARE;
853854

854855
info->tx_types = (1 << HWTSTAMP_TX_OFF) |
855-
(1 << HWTSTAMP_TX_ON) |
856-
(1 << HWTSTAMP_TX_ONESTEP_SYNC);
856+
(1 << HWTSTAMP_TX_ON);
857+
858+
if (enetc_si_is_pf(priv->si))
859+
info->tx_types |= (1 << HWTSTAMP_TX_ONESTEP_SYNC);
857860

858861
info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
859862
(1 << HWTSTAMP_FILTER_ALL);

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ static int iavf_reinit_interrupt_scheme(struct iavf_adapter *adapter, bool runni
20292029
static void iavf_finish_config(struct work_struct *work)
20302030
{
20312031
struct iavf_adapter *adapter;
2032-
bool netdev_released = false;
2032+
bool locks_released = false;
20332033
int pairs, err;
20342034

20352035
adapter = container_of(work, struct iavf_adapter, finish_config);
@@ -2058,19 +2058,22 @@ static void iavf_finish_config(struct work_struct *work)
20582058
netif_set_real_num_tx_queues(adapter->netdev, pairs);
20592059

20602060
if (adapter->netdev->reg_state != NETREG_REGISTERED) {
2061+
mutex_unlock(&adapter->crit_lock);
20612062
netdev_unlock(adapter->netdev);
2062-
netdev_released = true;
2063+
locks_released = true;
20632064
err = register_netdevice(adapter->netdev);
20642065
if (err) {
20652066
dev_err(&adapter->pdev->dev, "Unable to register netdev (%d)\n",
20662067
err);
20672068

20682069
/* go back and try again.*/
2070+
mutex_lock(&adapter->crit_lock);
20692071
iavf_free_rss(adapter);
20702072
iavf_free_misc_irq(adapter);
20712073
iavf_reset_interrupt_capability(adapter);
20722074
iavf_change_state(adapter,
20732075
__IAVF_INIT_CONFIG_ADAPTER);
2076+
mutex_unlock(&adapter->crit_lock);
20742077
goto out;
20752078
}
20762079
}
@@ -2086,9 +2089,10 @@ static void iavf_finish_config(struct work_struct *work)
20862089
}
20872090

20882091
out:
2089-
mutex_unlock(&adapter->crit_lock);
2090-
if (!netdev_released)
2092+
if (!locks_released) {
2093+
mutex_unlock(&adapter->crit_lock);
20912094
netdev_unlock(adapter->netdev);
2095+
}
20922096
rtnl_unlock();
20932097
}
20942098

drivers/net/ethernet/intel/ice/ice_eswitch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)
3838
if (ice_vsi_add_vlan_zero(uplink_vsi))
3939
goto err_vlan_zero;
4040

41-
if (ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, true,
42-
ICE_FLTR_RX))
41+
if (ice_set_dflt_vsi(uplink_vsi))
4342
goto err_def_rx;
4443

4544
if (ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, true,

drivers/net/ethernet/intel/ice/ice_sriov.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static void ice_free_vf_entries(struct ice_pf *pf)
3636

3737
hash_for_each_safe(vfs->table, bkt, tmp, vf, entry) {
3838
hash_del_rcu(&vf->entry);
39+
ice_deinitialize_vf_entry(vf);
3940
ice_put_vf(vf);
4041
}
4142
}
@@ -173,10 +174,6 @@ void ice_free_vfs(struct ice_pf *pf)
173174
wr32(hw, GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
174175
}
175176

176-
/* clear malicious info since the VF is getting released */
177-
if (!ice_is_feature_supported(pf, ICE_F_MBX_LIMIT))
178-
list_del(&vf->mbx_info.list_entry);
179-
180177
mutex_unlock(&vf->cfg_lock);
181178
}
182179

drivers/net/ethernet/intel/ice/ice_vf_lib.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,14 @@ void ice_initialize_vf_entry(struct ice_vf *vf)
10361036
mutex_init(&vf->cfg_lock);
10371037
}
10381038

1039+
void ice_deinitialize_vf_entry(struct ice_vf *vf)
1040+
{
1041+
struct ice_pf *pf = vf->pf;
1042+
1043+
if (!ice_is_feature_supported(pf, ICE_F_MBX_LIMIT))
1044+
list_del(&vf->mbx_info.list_entry);
1045+
}
1046+
10391047
/**
10401048
* ice_dis_vf_qs - Disable the VF queues
10411049
* @vf: pointer to the VF structure

drivers/net/ethernet/intel/ice/ice_vf_lib_private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#endif
2525

2626
void ice_initialize_vf_entry(struct ice_vf *vf);
27+
void ice_deinitialize_vf_entry(struct ice_vf *vf);
2728
void ice_dis_vf_qs(struct ice_vf *vf);
2829
int ice_check_vf_init(struct ice_vf *vf);
2930
enum virtchnl_status_code ice_err_to_virt_err(int err);

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ static bool ixgbe_is_media_cage_present(struct ixgbe_hw *hw)
11221122
* returns error (ENOENT), then no cage present. If no cage present then
11231123
* connection type is backplane or BASE-T.
11241124
*/
1125-
return ixgbe_aci_get_netlist_node(hw, cmd, NULL, NULL);
1125+
return !ixgbe_aci_get_netlist_node(hw, cmd, NULL, NULL);
11261126
}
11271127

11281128
/**

0 commit comments

Comments
 (0)