mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.18-rc5). Conflicts: drivers/net/wireless/ath/ath12k/mac.c9222582ec5("Revert "wifi: ath12k: Fix missing station power save configuration"")6917e268c4("wifi: ath12k: Defer vdev bring-up until CSA finalize to avoid stale beacon") https://lore.kernel.org/11cece9f7e36c12efd732baa5718239b1bf8c950.camel@sipsolutions.net Adjacent changes: drivers/net/ethernet/intel/Kconfigb1d16f7c00("libie: depend on DEBUG_FS when building LIBIE_FWLOG")93f53db9f9("ice: switch to Page Pool") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -910,17 +910,6 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
|
||||
goto ok;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify that we can indeed put this data into a skb.
|
||||
* This is here to handle cases when the device erroneously
|
||||
* tries to receive more than is possible. This is usually
|
||||
* the case of a broken device.
|
||||
*/
|
||||
if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) {
|
||||
net_dbg_ratelimited("%s: too much data\n", skb->dev->name);
|
||||
dev_kfree_skb(skb);
|
||||
return NULL;
|
||||
}
|
||||
BUG_ON(offset >= PAGE_SIZE);
|
||||
while (len) {
|
||||
unsigned int frag_size = min((unsigned)PAGE_SIZE - offset, len);
|
||||
@@ -2112,9 +2101,19 @@ static struct sk_buff *receive_big(struct net_device *dev,
|
||||
struct virtnet_rq_stats *stats)
|
||||
{
|
||||
struct page *page = buf;
|
||||
struct sk_buff *skb =
|
||||
page_to_skb(vi, rq, page, 0, len, PAGE_SIZE, 0);
|
||||
struct sk_buff *skb;
|
||||
|
||||
/* Make sure that len does not exceed the size allocated in
|
||||
* add_recvbuf_big.
|
||||
*/
|
||||
if (unlikely(len > (vi->big_packets_num_skbfrags + 1) * PAGE_SIZE)) {
|
||||
pr_debug("%s: rx error: len %u exceeds allocated size %lu\n",
|
||||
dev->name, len,
|
||||
(vi->big_packets_num_skbfrags + 1) * PAGE_SIZE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
skb = page_to_skb(vi, rq, page, 0, len, PAGE_SIZE, 0);
|
||||
u64_stats_add(&stats->bytes, len - vi->hdr_len);
|
||||
if (unlikely(!skb))
|
||||
goto err;
|
||||
@@ -2539,6 +2538,13 @@ err_buf:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline u32
|
||||
virtio_net_hash_value(const struct virtio_net_hdr_v1_hash *hdr_hash)
|
||||
{
|
||||
return __le16_to_cpu(hdr_hash->hash_value_lo) |
|
||||
(__le16_to_cpu(hdr_hash->hash_value_hi) << 16);
|
||||
}
|
||||
|
||||
static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
@@ -2565,7 +2571,7 @@ static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash,
|
||||
default:
|
||||
rss_hash_type = PKT_HASH_TYPE_NONE;
|
||||
}
|
||||
skb_set_hash(skb, __le32_to_cpu(hdr_hash->hash_value), rss_hash_type);
|
||||
skb_set_hash(skb, virtio_net_hash_value(hdr_hash), rss_hash_type);
|
||||
}
|
||||
|
||||
static void virtnet_receive_done(struct virtnet_info *vi, struct receive_queue *rq,
|
||||
@@ -3311,6 +3317,10 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb, bool orphan)
|
||||
|
||||
pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest);
|
||||
|
||||
/* Make sure it's safe to cast between formats */
|
||||
BUILD_BUG_ON(__alignof__(*hdr) != __alignof__(hdr->hash_hdr));
|
||||
BUILD_BUG_ON(__alignof__(*hdr) != __alignof__(hdr->hash_hdr.hdr));
|
||||
|
||||
can_push = vi->any_header_sg &&
|
||||
!((unsigned long)skb->data & (__alignof__(*hdr) - 1)) &&
|
||||
!skb_header_cloned(skb) && skb_headroom(skb) >= hdr_len;
|
||||
@@ -6750,7 +6760,7 @@ static int virtnet_xdp_rx_hash(const struct xdp_md *_ctx, u32 *hash,
|
||||
hash_report = VIRTIO_NET_HASH_REPORT_NONE;
|
||||
|
||||
*rss_type = virtnet_xdp_rss_type[hash_report];
|
||||
*hash = __le32_to_cpu(hdr_hash->hash_value);
|
||||
*hash = virtio_net_hash_value(hdr_hash);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user