Skip to content

Commit 2261b2e

Browse files
author
NipaLocal
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Signed-off-by: NipaLocal <nipa@local>
2 parents 7d0da8f + 47e55e4 commit 2261b2e

File tree

14 files changed

+62
-64
lines changed

14 files changed

+62
-64
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4708,7 +4708,7 @@ void bnxt_set_ring_params(struct bnxt *bp)
47084708
/* Changing allocation mode of RX rings.
47094709
* TODO: Update when extending xdp_rxq_info to support allocation modes.
47104710
*/
4711-
int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
4711+
static void __bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
47124712
{
47134713
struct net_device *dev = bp->dev;
47144714

@@ -4729,15 +4729,30 @@ int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
47294729
bp->rx_skb_func = bnxt_rx_page_skb;
47304730
}
47314731
bp->rx_dir = DMA_BIDIRECTIONAL;
4732-
/* Disable LRO or GRO_HW */
4733-
netdev_update_features(dev);
47344732
} else {
47354733
dev->max_mtu = bp->max_mtu;
47364734
bp->flags &= ~BNXT_FLAG_RX_PAGE_MODE;
47374735
bp->rx_dir = DMA_FROM_DEVICE;
47384736
bp->rx_skb_func = bnxt_rx_skb;
47394737
}
4740-
return 0;
4738+
}
4739+
4740+
void bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
4741+
{
4742+
__bnxt_set_rx_skb_mode(bp, page_mode);
4743+
4744+
if (!page_mode) {
4745+
int rx, tx;
4746+
4747+
bnxt_get_max_rings(bp, &rx, &tx, true);
4748+
if (rx > 1) {
4749+
bp->flags &= ~BNXT_FLAG_NO_AGG_RINGS;
4750+
bp->dev->hw_features |= NETIF_F_LRO;
4751+
}
4752+
}
4753+
4754+
/* Update LRO and GRO_HW availability */
4755+
netdev_update_features(bp->dev);
47414756
}
47424757

47434758
static void bnxt_free_vnic_attributes(struct bnxt *bp)
@@ -16259,7 +16274,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1625916274
if (bp->max_fltr < BNXT_MAX_FLTR)
1626016275
bp->max_fltr = BNXT_MAX_FLTR;
1626116276
bnxt_init_l2_fltr_tbl(bp);
16262-
bnxt_set_rx_skb_mode(bp, false);
16277+
__bnxt_set_rx_skb_mode(bp, false);
1626316278
bnxt_set_tpa_flags(bp);
1626416279
bnxt_set_ring_params(bp);
1626516280
bnxt_rdma_aux_device_init(bp);

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2859,7 +2859,7 @@ u32 bnxt_fw_health_readl(struct bnxt *bp, int reg_idx);
28592859
bool bnxt_bs_trace_avail(struct bnxt *bp, u16 type);
28602860
void bnxt_set_tpa_flags(struct bnxt *bp);
28612861
void bnxt_set_ring_params(struct bnxt *);
2862-
int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode);
2862+
void bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode);
28632863
void bnxt_insert_usr_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr);
28642864
void bnxt_del_one_usr_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr);
28652865
int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap,

drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,8 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
422422
bnxt_set_rx_skb_mode(bp, true);
423423
xdp_features_set_redirect_target(dev, true);
424424
} else {
425-
int rx, tx;
426-
427425
xdp_features_clear_redirect_target(dev);
428426
bnxt_set_rx_skb_mode(bp, false);
429-
bnxt_get_max_rings(bp, &rx, &tx, true);
430-
if (rx > 1) {
431-
bp->flags &= ~BNXT_FLAG_NO_AGG_RINGS;
432-
bp->dev->hw_features |= NETIF_F_LRO;
433-
}
434427
}
435428
bp->tx_nr_rings_xdp = tx_xdp;
436429
bp->tx_nr_rings = bp->tx_nr_rings_per_tc * tc + tx_xdp;

drivers/net/ethernet/microsoft/mana/gdma_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,9 +1656,9 @@ static int __init mana_driver_init(void)
16561656

16571657
static void __exit mana_driver_exit(void)
16581658
{
1659-
debugfs_remove(mana_debugfs_root);
1660-
16611659
pci_unregister_driver(&mana_driver);
1660+
1661+
debugfs_remove(mana_debugfs_root);
16621662
}
16631663

16641664
module_init(mana_driver_init);

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,6 +2763,7 @@ static const struct ravb_hw_info ravb_rzv2m_hw_info = {
27632763
.net_features = NETIF_F_RXCSUM,
27642764
.stats_len = ARRAY_SIZE(ravb_gstrings_stats),
27652765
.tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3,
2766+
.tx_max_frame_size = SZ_2K,
27662767
.rx_max_frame_size = SZ_2K,
27672768
.rx_buffer_size = SZ_2K +
27682769
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),

drivers/net/ethernet/ti/cpsw_ale.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ struct cpsw_ale_dev_id {
127127

128128
static inline int cpsw_ale_get_field(u32 *ale_entry, u32 start, u32 bits)
129129
{
130-
int idx, idx2;
130+
int idx, idx2, index;
131131
u32 hi_val = 0;
132132

133133
idx = start / 32;
134134
idx2 = (start + bits - 1) / 32;
135135
/* Check if bits to be fetched exceed a word */
136136
if (idx != idx2) {
137-
idx2 = 2 - idx2; /* flip */
138-
hi_val = ale_entry[idx2] << ((idx2 * 32) - start);
137+
index = 2 - idx2; /* flip */
138+
hi_val = ale_entry[index] << ((idx2 * 32) - start);
139139
}
140140
start -= idx * 32;
141141
idx = 2 - idx; /* flip */
@@ -145,16 +145,16 @@ static inline int cpsw_ale_get_field(u32 *ale_entry, u32 start, u32 bits)
145145
static inline void cpsw_ale_set_field(u32 *ale_entry, u32 start, u32 bits,
146146
u32 value)
147147
{
148-
int idx, idx2;
148+
int idx, idx2, index;
149149

150150
value &= BITMASK(bits);
151151
idx = start / 32;
152152
idx2 = (start + bits - 1) / 32;
153153
/* Check if bits to be set exceed a word */
154154
if (idx != idx2) {
155-
idx2 = 2 - idx2; /* flip */
156-
ale_entry[idx2] &= ~(BITMASK(bits + start - (idx2 * 32)));
157-
ale_entry[idx2] |= (value >> ((idx2 * 32) - start));
155+
index = 2 - idx2; /* flip */
156+
ale_entry[index] &= ~(BITMASK(bits + start - (idx2 * 32)));
157+
ale_entry[index] |= (value >> ((idx2 * 32) - start));
158158
}
159159
start -= idx * 32;
160160
idx = 2 - idx; /* flip */

include/net/busy_poll.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,4 @@ static inline void sk_mark_napi_id_once(struct sock *sk,
174174
#endif
175175
}
176176

177-
static inline void sk_mark_napi_id_once_xdp(struct sock *sk,
178-
const struct xdp_buff *xdp)
179-
{
180-
#ifdef CONFIG_NET_RX_BUSY_POLL
181-
__sk_mark_napi_id_once(sk, xdp->rxq->napi_id);
182-
#endif
183-
}
184-
185177
#endif /* _LINUX_NET_BUSY_POLL_H */

include/net/xdp.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ struct xdp_rxq_info {
6464
u32 queue_index;
6565
u32 reg_state;
6666
struct xdp_mem_info mem;
67-
unsigned int napi_id;
6867
u32 frag_size;
6968
} ____cacheline_aligned; /* perf critical, avoid false-sharing */
7069

include/net/xdp_sock_drv.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ static inline void xsk_pool_fill_cb(struct xsk_buff_pool *pool,
5959
xp_fill_cb(pool, desc);
6060
}
6161

62-
static inline unsigned int xsk_pool_get_napi_id(struct xsk_buff_pool *pool)
63-
{
64-
#ifdef CONFIG_NET_RX_BUSY_POLL
65-
return pool->heads[0].xdp.rxq->napi_id;
66-
#else
67-
return 0;
68-
#endif
69-
}
70-
7162
static inline void xsk_pool_dma_unmap(struct xsk_buff_pool *pool,
7263
unsigned long attrs)
7364
{
@@ -317,11 +308,6 @@ static inline void xsk_pool_fill_cb(struct xsk_buff_pool *pool,
317308
{
318309
}
319310

320-
static inline unsigned int xsk_pool_get_napi_id(struct xsk_buff_pool *pool)
321-
{
322-
return 0;
323-
}
324-
325311
static inline void xsk_pool_dma_unmap(struct xsk_buff_pool *pool,
326312
unsigned long attrs)
327313
{

net/core/filter.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11251,42 +11251,48 @@ BPF_CALL_4(sk_select_reuseport, struct sk_reuseport_kern *, reuse_kern,
1125111251
bool is_sockarray = map->map_type == BPF_MAP_TYPE_REUSEPORT_SOCKARRAY;
1125211252
struct sock_reuseport *reuse;
1125311253
struct sock *selected_sk;
11254+
int err;
1125411255

1125511256
selected_sk = map->ops->map_lookup_elem(map, key);
1125611257
if (!selected_sk)
1125711258
return -ENOENT;
1125811259

1125911260
reuse = rcu_dereference(selected_sk->sk_reuseport_cb);
1126011261
if (!reuse) {
11261-
/* Lookup in sock_map can return TCP ESTABLISHED sockets. */
11262-
if (sk_is_refcounted(selected_sk))
11263-
sock_put(selected_sk);
11264-
1126511262
/* reuseport_array has only sk with non NULL sk_reuseport_cb.
1126611263
* The only (!reuse) case here is - the sk has already been
1126711264
* unhashed (e.g. by close()), so treat it as -ENOENT.
1126811265
*
1126911266
* Other maps (e.g. sock_map) do not provide this guarantee and
1127011267
* the sk may never be in the reuseport group to begin with.
1127111268
*/
11272-
return is_sockarray ? -ENOENT : -EINVAL;
11269+
err = is_sockarray ? -ENOENT : -EINVAL;
11270+
goto error;
1127311271
}
1127411272

1127511273
if (unlikely(reuse->reuseport_id != reuse_kern->reuseport_id)) {
1127611274
struct sock *sk = reuse_kern->sk;
1127711275

11278-
if (sk->sk_protocol != selected_sk->sk_protocol)
11279-
return -EPROTOTYPE;
11280-
else if (sk->sk_family != selected_sk->sk_family)
11281-
return -EAFNOSUPPORT;
11282-
11283-
/* Catch all. Likely bound to a different sockaddr. */
11284-
return -EBADFD;
11276+
if (sk->sk_protocol != selected_sk->sk_protocol) {
11277+
err = -EPROTOTYPE;
11278+
} else if (sk->sk_family != selected_sk->sk_family) {
11279+
err = -EAFNOSUPPORT;
11280+
} else {
11281+
/* Catch all. Likely bound to a different sockaddr. */
11282+
err = -EBADFD;
11283+
}
11284+
goto error;
1128511285
}
1128611286

1128711287
reuse_kern->selected_sk = selected_sk;
1128811288

1128911289
return 0;
11290+
error:
11291+
/* Lookup in sock_map can return TCP ESTABLISHED sockets. */
11292+
if (sk_is_refcounted(selected_sk))
11293+
sock_put(selected_sk);
11294+
11295+
return err;
1129011296
}
1129111297

1129211298
static const struct bpf_func_proto sk_select_reuseport_proto = {

0 commit comments

Comments
 (0)