Skip to content

Commit 226c602

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-04-14 This series contains updates to ice driver only. Maciej adjusts implementation in __ice_alloc_rx_bufs_zc() for when ice_fill_rx_descs() does not return the entire buffer request and fixes a return value for !CONFIG_NET_SWITCHDEV configuration which was preventing VF creation. Wojciech prevents eswitch transmit when VFs are being removed which was causing NULL pointer dereference. Jianglei Nie fixes a memory leak on error path of getting OROM data. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 2cc7fb9 + 7c8881b commit 226c602

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ ice_eswitch_port_start_xmit(struct sk_buff *skb, struct net_device *netdev)
361361
np = netdev_priv(netdev);
362362
vsi = np->vsi;
363363

364-
if (ice_is_reset_in_progress(vsi->back->state))
364+
if (ice_is_reset_in_progress(vsi->back->state) ||
365+
test_bit(ICE_VF_DIS, vsi->back->state))
365366
return NETDEV_TX_BUSY;
366367

367368
repr = ice_netdev_to_repr(netdev);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static inline void ice_eswitch_update_repr(struct ice_vsi *vsi) { }
5252

5353
static inline int ice_eswitch_configure(struct ice_pf *pf)
5454
{
55-
return -EOPNOTSUPP;
55+
return 0;
5656
}
5757

5858
static inline int ice_eswitch_rebuild(struct ice_pf *pf)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank,
641641
status = ice_read_flash_module(hw, bank, ICE_SR_1ST_OROM_BANK_PTR, 0,
642642
orom_data, hw->flash.banks.orom_size);
643643
if (status) {
644+
vfree(orom_data);
644645
ice_debug(hw, ICE_DBG_NVM, "Unable to read Option ROM data\n");
645646
return status;
646647
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ static u16 ice_fill_rx_descs(struct xsk_buff_pool *pool, struct xdp_buff **xdp,
415415
*/
416416
static bool __ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count)
417417
{
418+
u32 nb_buffs_extra = 0, nb_buffs = 0;
418419
union ice_32b_rx_flex_desc *rx_desc;
419-
u32 nb_buffs_extra = 0, nb_buffs;
420420
u16 ntu = rx_ring->next_to_use;
421421
u16 total_count = count;
422422
struct xdp_buff **xdp;
@@ -428,6 +428,10 @@ static bool __ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count)
428428
nb_buffs_extra = ice_fill_rx_descs(rx_ring->xsk_pool, xdp,
429429
rx_desc,
430430
rx_ring->count - ntu);
431+
if (nb_buffs_extra != rx_ring->count - ntu) {
432+
ntu += nb_buffs_extra;
433+
goto exit;
434+
}
431435
rx_desc = ICE_RX_DESC(rx_ring, 0);
432436
xdp = ice_xdp_buf(rx_ring, 0);
433437
ntu = 0;
@@ -441,6 +445,7 @@ static bool __ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count)
441445
if (ntu == rx_ring->count)
442446
ntu = 0;
443447

448+
exit:
444449
if (rx_ring->next_to_use != ntu)
445450
ice_release_rx_desc(rx_ring, ntu);
446451

0 commit comments

Comments
 (0)