* Re: [PATCH 3/3] net: mana: remove double CQ cleanup in mana_create_rxq error path
From: Aditya Garg @ 2026-04-30 4:14 UTC (permalink / raw)
To: Dipayaan Roy, kys, haiyangz, wei.liu, decui, andrew+netdev, davem,
edumazet, kuba, pabeni, leon, longli, kotaranov, horms,
shradhagupta, ssengar, ernis, shirazsaleem, linux-hyperv, netdev,
linux-kernel, linux-rdma, stephen, jacob.e.keller, dipayanroy,
leitao, kees, john.fastabend, hawk, bpf, daniel, ast, sdf,
yury.norov
In-Reply-To: <20260430035935.1859220-4-dipayanroy@linux.microsoft.com>
On 30-04-2026 09:27, Dipayaan Roy wrote:
> In mana_create_rxq(), the error cleanup path calls mana_destroy_rxq()
> followed by mana_deinit_cq(). This is incorrect for two reasons:
>
> 1. mana_destroy_rxq() already calls mana_deinit_cq() internally,
> so the CQ's GDMA queue is destroyed twice.
>
> 2. mana_destroy_rxq() frees the rxq via kfree(rxq) before returning.
> The subsequent mana_deinit_cq(apc, cq) then operates on freed memory
> since cq points to &rxq->rx_cq, which is embedded in the
> already-freed rxq structure — a use-after-free.
>
> Remove the redundant mana_deinit_cq() call from the error path since
> mana_destroy_rxq() already handles CQ cleanup. mana_deinit_cq() is
> itself safe for an uninitialized CQ as it checks for a NULL gdma_cq
> before proceeding.
>
> Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
> ---
> drivers/net/ethernet/microsoft/mana/mana_en.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index f2a6ea162dc3..9afc786b297a 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -2799,9 +2799,6 @@ static struct mana_rxq *mana_create_rxq(struct mana_port_context *apc,
>
> mana_destroy_rxq(apc, rxq, false);
>
> - if (cq)
> - mana_deinit_cq(apc, cq);
> -
> return NULL;
> }
>
Reviewed-by: Aditya Garg <gargaditya@linux.microsoft.com>
^ permalink raw reply
* Re: [PATCH v5 net 09/10] octeontx2-af: npc: cn20k: Tear down default MCAM rules explicitly on free
From: Ratheesh Kannoth @ 2026-04-30 4:15 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: sgoutham, davem, edumazet, kuba, pabeni, andrew+netdev
In-Reply-To: <20260429022722.1110289-10-rkannoth@marvell.com>
On 2026-04-29 at 07:57:21, Ratheesh Kannoth (rkannoth@marvell.com) wrote:
> npc_cn20k_dft_rules_free() used the NPC MCAM mbox "free all" path, which
> does not match how cn20k tracks default-rule MCAM slots indexes.
>
> Resolve the default-rule indices, then for each valid slot clear the bitmap
> entry, drop the PF/VF map, disable the MCAM line, clear the target
> function, and npc_cn20k_idx_free(). Remove any matching software mcam_rules
> nodes. On hard failure from idx_free, WARN and stop so the box stays up for
> analysis.
>
> In npc_mcam_free_all_entries(), prefetch the same default-rule indices and,
> on cn20k, skip bitmap clear and idx_free when the scanned entry is one of
> those reserved defaults (they are released by npc_cn20k_dft_rules_free).
>
> Fixes: 09d3b7a1403f ("octeontx2-af: npc: cn20k: Allocate default MCAM indexes")
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Patch 9: [PATCH v5 net 09/10] octeontx2-af: npc: cn20k: Tear down default MCAM rules explicitly on free
> free_rules:
> + blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
> + if (blkaddr < 0)
> + return;
>Can this lead to a resource leak if blkaddr < 0?
>The tracking entries are removed from xa_pf2dfl_rmap via xa_erase() earlier
>in the function, before validating the block address. If rvu_get_blkaddr()
>fails and returns early, the rules remain allocated but the tracking
>information is permanently lost.
This condition will never fail for NPC block. This condition is there because of legacy coding method where every function
has this check. We need to put an effort to remove all these check from all functions and should have only one check during probe time to
validate this. That should be a candidate for net-next.
> + for (int i = 0; i < 4; i++) {
> + if (ptr[i] == USHRT_MAX)
> + continue;
>
> - free_req.hdr.pcifunc = pcifunc;
> - free_req.all = 1;
> - rc = rvu_mbox_handler_npc_mcam_free_entry(rvu, &free_req, &rsp);
> - if (rc)
> - dev_err(rvu->dev,
> - "%s: Error deleting default entries (pcifunc=%#x\n",
> - __func__, pcifunc);
> + mutex_lock(&mcam->lock);
> + npc_mcam_clear_bit(mcam, ptr[i]);
> + mcam->entry2pfvf_map[ptr[i]] = NPC_MCAM_INVALID_MAP;
> + npc_cn20k_enable_mcam_entry(rvu, blkaddr, ptr[i], false);
> + mcam->entry2target_pffunc[ptr[i]] = 0x0;
> + mutex_unlock(&mcam->lock);
>Is it possible for another thread to allocate this index before the rules
>list is cleaned up?
>The mcam->lock is released immediately after npc_mcam_clear_bit() is called,
>which makes the index available in the software bitmap. If a concurrent
>thread allocates this same index and adds its own rule to mcam->mcam_rules,
>could the subsequent list_for_each_entry_safe() loop mistakenly delete and
>free the newly allocated rule?
No. These are allocated thru mbox messages and are processed serially by AF driver.
So multiple thread issue wont happen.
> +
> + rc = npc_cn20k_idx_free(rvu, &ptr[i], 1);
> + if (rc) {
> + /* Non recoverable error. Let us WARN and return. Keep system alive to
> + * enable debugging
> + */
> + WARN(1, "%s Error deleting default entries (pcifunc=%#x) mcam_idx=%u\n",
> + __func__, pcifunc, ptr[i]);
> + return;
>Does returning here leak the mcam_rules entries?
>If npc_cn20k_idx_free() fails, the function returns early. This skips the
>trailing list deletion loop, permanently leaking the rule structures for the
>failed index and any previously successful indices. Additionally, because
>npc_mcam_clear_bit() was already called for these indices, they appear
>available in the software bitmap, meaning subsequent allocations might get an
>index while the old rule node is still dangling.
Yes. we need that state to debug the issue if it ever happens than freeing mcam rule entries, as mcam rule entries
debugfs provide more information to debug. so lets keep this way.
> }
> +
> + /* Update entry2counter mapping */
> + cntr = mcam->entry2cntr_map[index];
> + if (cntr != NPC_MCAM_INVALID_MAP)
> + npc_unmap_mcam_entry_and_cntr(rvu, mcam,
> + blkaddr, index,
> + cntr);
>Does this unintentionally disable default rules in hardware?
>The calls to npc_enable_mcam_entry(..., false) and
>npc_unmap_mcam_entry_and_cntr(...) now occur before the cn20k_dft_rl check
>and the if (!cn20k_dft_rl) block. If a VF resets its filters (e.g., via an
>all=1 free request), its default rules (like UCAST or BCAST) appear to be
>permanently disabled in hardware and their counters unmapped, which might
>cause the VF to lose network connectivity until completely reinitialized.
> +
> + if (!is_cn20k(rvu->pdev) || cn20k_dft_rl)
> + continue;
> +
> + rc = npc_cn20k_idx_free(rvu, &index, 1);
> + if (rc)
> + dev_err(rvu->dev,
> + "Failed to free mcam idx=%u pcifunc=%#x\n",
> + index, pcifunc);
> }
> }
VF has only UCAST rules.
^ permalink raw reply
* Re: [PATCH v5 net 10/10] octeontx2-af: npc: cn20k: Reject missing default-rule MCAM indices
From: Ratheesh Kannoth @ 2026-04-30 4:17 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: sgoutham, davem, edumazet, kuba, pabeni, andrew+netdev,
Suman Ghosh
In-Reply-To: <20260429022722.1110289-11-rkannoth@marvell.com>
On 2026-04-29 at 07:57:22, Ratheesh Kannoth (rkannoth@marvell.com) wrote:
> When cn20k default L2 rules are not installed,
> npc_cn20k_dft_rules_idx_get() leaves broadcast, multicast, promiscuous, and
> unicast slots at USHRT_MAX. npc_get_nixlf_mcam_index() previously returned
> that sentinel as a valid MCAM index, so callers could program hardware with
> an invalid index.
>
> Return -EINVAL from the cn20k branches of npc_get_nixlf_mcam_index() when
> the requested slot is still USHRT_MAX. Harden cn20k NPC MCAM entry helpers
> to reject out-of-range indices before touching hardware.
>
> Drop the early bounds check in npc_enable_mcam_entry() for cn20k so invalid
> indices are validated inside npc_cn20k_enable_mcam_entry() instead of being
> silently ignored.
>
> In rvu_npc_update_flowkey_alg_idx(), treat negative MCAM indices like
> out-of-range values, and only update RSS actions for promiscuous and
> all-multi paths when the resolved index is non-negative.
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
> index 5d349d131fdb..3c814d157ab9 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
> @@ -163,14 +163,35 @@ int npc_get_nixlf_mcam_index(struct npc_mcam *mcam,
> if (rc)
> return -EFAULT;
>
> + if (is_lbk_vf(rvu, pcifunc)) {
> + if (promisc == USHRT_MAX)
> + return -EINVAL;
> + return promisc;
> + }
> +
[ ... ]
> @@ -3897,6 +4006,12 @@ int rvu_mbox_handler_npc_read_base_steer_rule(struct rvu *rvu,
> /* Read the default ucast entry if there is no pkt steering rule */
> index = npc_get_nixlf_mcam_index(mcam, pcifunc, nixlf,
> NIXLF_UCAST_ENTRY);
> + if (index < 0) {
> + mutex_unlock(&mcam->lock);
> + rc = NIX_AF_ERR_AF_LF_INVALID;
> + goto out;
> + }
> +
>Could this change cause a regression in the cn20k-specific base steer rule
>handler?
>While this generic handler correctly returns an explicit error when
>npc_get_nixlf_mcam_index() returns a negative value, it looks like
>rvu_mbox_handler_npc_cn20k_read_base_steer_rule() in
>drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c was missed.
>In that function, rc is 0 from the preceding successful call to
>nix_get_nixlf():
This is not an issue introduced by this fix patch. I agree that this is an issue, but should
be addressed as another net patch as fix.
>While this generic handler correctly returns an explicit error when
>npc_get_nixlf_mcam_index() returns a negative value, it looks like
>rvu_mbox_handler_npc_cn20k_read_base_steer_rule() in
>drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c was missed.
>In that function, rc is 0 from the preceding successful call to
>nix_get_nixlf():
>drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c:
>rvu_mbox_handler_npc_cn20k_read_base_steer_rule() {
...
rc = nix_get_nixlf(rvu, pcifunc, &nixlf, NULL);
if (rc < 0) {
mutex_unlock(&mcam->lock);
goto out;
}
rl_type = rvu_npc_get_base_steer_rule_type(rvu, pcifunc);
/* Read the default ucast entry if there is no pkt steering rule */
index = npc_get_nixlf_mcam_index(mcam, pcifunc, nixlf, rl_type);
if (index < 0) {
mutex_unlock(&mcam->lock);
goto out;
}
...
out:
return rc;
}
>Does this now silently return 0 (Success) instead of propagating the error
>when index < 0? This seems like it could leak an uninitialized or zeroed
>rsp->entry payload back to the VF.
This is not an issue introduced by this fix patch. I agree that this is an issue, but should
be addressed as another net patch as fix.
^ permalink raw reply
* Re: [PATCH ipsec] esp: Force skb_cow_data() on RX when the skb is non-linear
From: Herbert Xu @ 2026-04-30 4:26 UTC (permalink / raw)
To: Hyunwoo Kim
Cc: steffen.klassert, davem, dsahern, edumazet, kuba, pabeni, horms,
ilant, sowmini.varadhan, netdev
In-Reply-To: <afLDKSvAvMwGh7Fy@v4bel>
On Thu, Apr 30, 2026 at 11:49:13AM +0900, Hyunwoo Kim wrote:
> esp_input() and esp6_input() skip skb_cow_data() on uncloned skbs
> through two arms: one for fully linear skbs (nfrags = 1) and one for
> skbs carrying paged fragments without a frag_list, which sets
> nfrags = skb_shinfo(skb)->nr_frags + 1. In both arms the skb is mapped
> into a scatterlist via skb_to_sgvec() and passed as both src and dst of
> aead_request_set_crypt(), so the AEAD operates in place over the
> existing frag pages.
>
> Drop the paged-fragment arm so any non-linear inbound skb falls through
> to skb_cow_data(). The fully linear fast path is unchanged and the
> existing skb_cow_data() error handling that follows the gate is reused.
>
> Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible")
> Fixes: 03e2a30f6a27 ("esp6: Avoid skb_cow_data whenever possible")
> Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
> ---
> net/ipv4/esp4.c | 13 +++----------
> net/ipv6/esp6.c | 13 +++----------
> 2 files changed, 6 insertions(+), 20 deletions(-)
Good catch!
When a packet comes from a device driver, it's usually safe to
write to the fragments since they would have been allocated by
the driver.
But when a packet originates from our own stack, then it's not
safe to write to the fragments.
Unfortunately the two paths cross with the loopback driver (and
probably other means of creating loopback).
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH v3 2/2] pinctrl: qcom: add the TLMM driver for the Nord platforms
From: Maulik Shah (mkshah) @ 2026-04-30 4:46 UTC (permalink / raw)
To: Bartosz Golaszewski, Bjorn Andersson, Linus Walleij, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Richard Cochran,
Bartosz Golaszewski, Shawn Guo, Arnd Bergmann, Dmitry Baryshkov
Cc: linux-arm-msm, linux-gpio, devicetree, linux-kernel, netdev
In-Reply-To: <20260428-nord-tlmm-v3-2-f16f08d084cc@oss.qualcomm.com>
On 4/28/2026 7:18 PM, Bartosz Golaszewski wrote:
> Add support for the TLMM controller on the Qualcomm Nord platform.
> +
> +static const struct of_device_id nord_tlmm_of_match[] = {
> + { .compatible = "qcom,nord-tlmm", .data = &nord_tlmm },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, nord_tlmm_of_match);
[...]
MODULE_DEVICE_TABLE() seems to be kept as the last line in other pinctrl-<target> files.
if you are sending a new revision, better to keep at the end for uniformity.
> +
[...]
> +
> +MODULE_DESCRIPTION("Qualcomm Technologies Inc. Nordschleife TLMM driver");
Is Nordschleife expected name here or should it be just called Nord?
Also since all other pinctrl-<target> files have this description using "QTI <SoC> TLMM driver"
Do you need to replace Qualcomm Technologies Inc. with QTI to have uniformity across all SoCs?
Otherwise looks good to me,
Reviewed-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
Thanks,
Maulik
> +MODULE_LICENSE("GPL");
>
^ permalink raw reply
* Re: [PATCH net v1 1/3] net: introduce helper to resolve hardware timestamps from skb
From: Kohei Enju @ 2026-04-30 4:50 UTC (permalink / raw)
To: Willem de Bruijn
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Kuniyuki Iwashima, Willem de Bruijn,
David Ahern, Neal Cardwell, Gerhard Engleder, Jonathan Lemon,
Richard Cochran
In-Reply-To: <willemdebruijn.kernel.2d041a6261a02@gmail.com>
On 04/29 17:04, Willem de Bruijn wrote:
> Kohei Enju wrote:
> > Move the logic that resolves a hardware timestamp from an skb, including
> > late timestamp resolution via netdev_get_tstamp(), from net/socket.c to
> > a common helper.
> >
> > Let's allow other networking code to reuse the same resolution path.
> >
> > Signed-off-by: Kohei Enju <kohei@enjuk.jp>
>
> Thanks for the fix series.
>
> Fixes require a Fixes tag. See also https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html.
>
> I suggest merging this and the second patch, as this is not a
> standalone fix, and the other is a one-line change.
Thank you for the suggestion, and it looks good to me.
I'll do so in v2.
>
> > ---
> > include/linux/skbuff.h | 11 +++++++++++
> > net/core/skbuff.c | 27 +++++++++++++++++++++++++++
> > net/socket.c | 27 +++------------------------
> > 3 files changed, 41 insertions(+), 24 deletions(-)
> >
> > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> > index 2bcf78a4de7b..651a5ae8b11c 100644
> > --- a/include/linux/skbuff.h
> > +++ b/include/linux/skbuff.h
> > @@ -4731,6 +4731,17 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb, const struct sk_buff *ack_skb,
> > void skb_tstamp_tx(struct sk_buff *orig_skb,
> > struct skb_shared_hwtstamps *hwtstamps);
> >
> > +/**
> > + * skb_get_hwtstamp - resolve a hardware timestamp from an skb
> > + * @skb: skb carrying the timestamp
> > + * @cycles: true to request the free-running cycle-based timestamp
> > + * @if_index: optional return pointer for the originating netdev ifindex
> > + *
> > + * Return: resolved hardware timestamp, or the stored skb hwtstamp when no
> > + * device-specific late timestamp resolution is needed.
> > + */
> > +ktime_t skb_get_hwtstamp(struct sk_buff *skb, bool cycles, int *if_index);
> > +
> > /**
> > * skb_tx_timestamp() - Driver hook for transmit timestamping
> > *
> > diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> > index 7dad68e3b518..d11f4e2e9391 100644
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -5729,6 +5729,33 @@ void skb_tstamp_tx(struct sk_buff *orig_skb,
> > }
> > EXPORT_SYMBOL_GPL(skb_tstamp_tx);
> >
> > +ktime_t skb_get_hwtstamp(struct sk_buff *skb, bool cycles, int *if_index)
> > +{
> > + struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb);
> > + struct net_device *orig_dev;
> > + ktime_t hwtstamp;
> > +
> > + if (if_index)
> > + *if_index = 0;
> > +
> > + if (!(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP_NETDEV))
> > + return shhwtstamps->hwtstamp;
> > +
> > + rcu_read_lock();
> > + orig_dev = dev_get_by_napi_id(skb_napi_id(skb));
> > + if (orig_dev) {
> > + if (if_index)
> > + *if_index = orig_dev->ifindex;
> > + hwtstamp = netdev_get_tstamp(orig_dev, shhwtstamps, cycles);
> > + } else {
> > + hwtstamp = shhwtstamps->hwtstamp;
> > + }
> > + rcu_read_unlock();
> > +
> > + return hwtstamp;
> > +}
> > +EXPORT_SYMBOL_GPL(skb_get_hwtstamp);
> > +
> > #ifdef CONFIG_WIRELESS
> > void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
> > {
> > diff --git a/net/socket.c b/net/socket.c
> > index 22a412fdec07..95b21b16a0fc 100644
> > --- a/net/socket.c
> > +++ b/net/socket.c
> > @@ -876,21 +876,7 @@ static bool skb_is_swtx_tstamp(const struct sk_buff *skb, int false_tstamp)
> > static ktime_t get_timestamp(struct sock *sk, struct sk_buff *skb, int *if_index)
> > {
> > bool cycles = READ_ONCE(sk->sk_tsflags) & SOF_TIMESTAMPING_BIND_PHC;
> > - struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb);
> > - struct net_device *orig_dev;
> > - ktime_t hwtstamp;
> > -
> > - rcu_read_lock();
> > - orig_dev = dev_get_by_napi_id(skb_napi_id(skb));
> > - if (orig_dev) {
> > - *if_index = orig_dev->ifindex;
> > - hwtstamp = netdev_get_tstamp(orig_dev, shhwtstamps, cycles);
> > - } else {
> > - hwtstamp = shhwtstamps->hwtstamp;
> > - }
> > - rcu_read_unlock();
> > -
> > - return hwtstamp;
> > + return skb_get_hwtstamp(skb, cycles, if_index);
> > }
>
> At this point simpler to remove get_timestamp entirely. It's an
> unnecessary layer of indirection.
>
> Perhaps pass sk_tsflags rather than bool to skb_get_hwtstamp.
Good points. I'll rework this in v2.
Thanks,
Kohei
>
> > static void put_ts_pktinfo(struct msghdr *msg, struct sk_buff *skb,
> > @@ -940,7 +926,6 @@ int skb_get_tx_timestamp(struct sk_buff *skb, struct sock *sk,
> > {
> > u32 tsflags = READ_ONCE(sk->sk_tsflags);
> > ktime_t hwtstamp;
> > - int if_index = 0;
> >
> > if ((tsflags & SOF_TIMESTAMPING_SOFTWARE) &&
> > ktime_to_timespec64_cond(skb->tstamp, ts))
> > @@ -950,10 +935,7 @@ int skb_get_tx_timestamp(struct sk_buff *skb, struct sock *sk,
> > skb_is_swtx_tstamp(skb, false))
> > return -ENOENT;
> >
> > - if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP_NETDEV)
> > - hwtstamp = get_timestamp(sk, skb, &if_index);
> > - else
> > - hwtstamp = skb_hwtstamps(skb)->hwtstamp;
> > + hwtstamp = get_timestamp(sk, skb, NULL);
> >
> > if (tsflags & SOF_TIMESTAMPING_BIND_PHC)
> > hwtstamp = ptp_convert_timestamp(&hwtstamp,
> > @@ -1033,10 +1015,7 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
> > !(tsflags & SOF_TIMESTAMPING_OPT_RX_FILTER))) &&
> > !skb_is_swtx_tstamp(skb, false_tstamp)) {
> > if_index = 0;
> > - if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP_NETDEV)
> > - hwtstamp = get_timestamp(sk, skb, &if_index);
> > - else
> > - hwtstamp = shhwtstamps->hwtstamp;
> > + hwtstamp = get_timestamp(sk, skb, &if_index);
> >
> > if (tsflags & SOF_TIMESTAMPING_BIND_PHC)
> > hwtstamp = ptp_convert_timestamp(&hwtstamp,
> > --
> > 2.53.0
> >
>
>
^ permalink raw reply
* Re: [PATCH net v1 3/3] tcp: use skb_get_hwtstamp() for hardware timestamps
From: Kohei Enju @ 2026-04-30 5:07 UTC (permalink / raw)
To: Willem de Bruijn
Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Kuniyuki Iwashima, Willem de Bruijn,
David Ahern, Neal Cardwell, Gerhard Engleder, Jonathan Lemon,
Richard Cochran
In-Reply-To: <willemdebruijn.kernel.2345608a210cc@gmail.com>
On 04/29 17:09, Willem de Bruijn wrote:
> Kohei Enju wrote:
> > Since commit 97dc7cd92ac6 ("ptp: Support late timestamp determination"),
> > skb_shared_hwtstamps may contain netdev_data instead of hwtstamp. TCP
> > receive timestamping can then interpret the stored value as a ktime_t
> > and report bogus hardware timestamps to userspace.
> >
> > Use skb_get_hwtstamp() instead of reading hwtstamp directly, so TCP
> > sockets follow the same hardware timestamp resolution path as the socket
> > layer. When coalescing SKBs, resolve late timestamps before copying them
> > to the merged skb.
>
> Why? Does this preclude supporting SOF_TIMESTAMPING_BIND_PHC for such
> sockets at a later time?
You're right. If we want to keep the door open for
SOF_TIMESTAMPING_BIND_PHC on coalesced skbs, resolving the timestamp at
coalescing time is the wrong approach.
>
> It is just as easy to coalesce the cookie as the htwtstamp.
>
> That also avoids the need to mask out SKBTX_HW_TSTAMP_NETDEV.
Indeed. We should also carry the matching @napi_id, since
skb_get_hwtstamp() uses it for late resolution.
I'll update this in v2.
>
> > Additionally, recognize SKBTX_HW_TSTAMP_NETDEV as
> > indicating a receive timestamp is present.
>
> What is the reason for this extra condition?
With late timestamp determination, skb_shared_hwtstamps may hold
netdev_data instead of a resolved hwtstamp, and 0 can be a valid cookie
value. So checking only skb_hwtstamps(skb)->hwtstamp is not enough to
detect the presence of an RX hardware timestamp.
>
> > Note that skb_get_hwtstamp() is called with cycles == false, since TCP
> > hasn't honored SOF_TIMESTAMPING_BIND_PHC so far, and this patch doesn't
> > change that behavior.
> >
> > Fixes: 97dc7cd92ac6 ("ptp: Support late timestamp determination")
> > Signed-off-by: Kohei Enju <kohei@enjuk.jp>
> > ---
[...]
^ permalink raw reply
* Re: [PATCH net-next 3/4] r8152: Add irq mitigation for RTL8157/9
From: Michal Pecio @ 2026-04-30 5:44 UTC (permalink / raw)
To: Birger Koblitz
Cc: Andrew Lunn, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, linux-usb, netdev, linux-kernel,
Chih Kai Hsu
In-Reply-To: <4446ad8c-0f5f-4f5a-8166-557ce9cc91b7@birger-koblitz.de>
On Thu, 30 Apr 2026 05:36:06 +0200, Birger Koblitz wrote:
> Thanks Michal, for your explanations!
> On 29/04/2026 8:02 pm, Michal Pecio wrote:
> >>> What does interrupt mitigation do?
> >>>
> >>> Is this a different name for interrupt coalescence, where the MAC
> >>> delays interrupts for a period of time so more packets are in the
> >>> receive ring when it does interrupt, so reducing the number of
> >>> interrupts, and bigger bursts of packets are processed at once?
> >>>
> >>
> >> I do not understand what the mechanism behind this is, there is no
> >> more documentation in the original driver. I experimented with this
> >> for some time and the effect that I see is that it prevents
> >> interrupts after shutdown.
> >
> > What do you mean by "after shutdown", driver unbind? You shouldn't be
> > seeing URB completions then if the disconnect() method unlinks them.
> > And if it doesn't, completions may be using driver data after free.
> >
> > Or maybe you have pending URBs while calling set_configuration() or
> > set_interface(), which is dodgy too but at least not asking for panic.
> >
> > Other cause of ESHUTDOWN might be serious host controller failure, but
> > you would likely get other log noise with that, at least with xhci.
> >
> > What shows up if you repro with this enabled?
> > echo 'module usbcore +p' >/proc/dynamic_debug/control
> >
>
> With shutdown, I meant shutting down the driver: the error happens when
> unloading the driver using rmmod, e.g. when testing different driver
> versions.
Sorry, I remembered wrong. That UAF problem only applies to control
URBs on endpoint 0. All other URBs are removed by USB core *before*
rtl8152_disconnect() is called. So it doesn't need to unlink them
and it cannot predict when the URBs will be nuked by core.
> What I see when turning on debugging is this:
> [373042.499758] r8152 2-1:1.0 enx88c9b3b53125: carrier on
> [373104.440114] usbcore: deregistering interface driver r8152
> [373104.440141] xhci_hcd 0000:0c:00.0: shutdown urb 000000005501f8cc
> ep1in-bulk
> [373104.440146] xhci_hcd 0000:0c:00.0: shutdown urb 0000000066ae4a92
> ep1in-bulk
> [373104.440148] xhci_hcd 0000:0c:00.0: shutdown urb 00000000e9728025
> ep1in-bulk
> [373104.440151] xhci_hcd 0000:0c:00.0: shutdown urb 00000000fa874ca0
> ep1in-bulk
> [373104.440153] xhci_hcd 0000:0c:00.0: shutdown urb 000000006006ed5d
> ep1in-bulk
> [373104.440156] xhci_hcd 0000:0c:00.0: shutdown urb 00000000a5bee1e7
> ep1in-bulk
> [373104.440158] xhci_hcd 0000:0c:00.0: shutdown urb 00000000bc3a3ab0
> ep1in-bulk
> [373104.440160] xhci_hcd 0000:0c:00.0: shutdown urb 0000000080a63692
> ep1in-bulk
> [373104.440163] xhci_hcd 0000:0c:00.0: shutdown urb 0000000025af4e6e
> ep1in-bulk
> [373104.440165] xhci_hcd 0000:0c:00.0: shutdown urb 0000000056d7e76e
> ep1in-bulk
> [373104.440472] xhci_hcd 0000:0c:00.0: shutdown urb 00000000d8814536
> ep3in-intr
And that's what happens in the log above, for the reason below:
[ +0,000015] usb_hcd_flush_endpoint.cold+0xa/0x23 [usbcore]
[ +0,000050] usb_disable_endpoint+0x52/0xa0 [usbcore]
[ +0,000048] usb_disable_interface.cold+0x3f/0x4e [usbcore]
[ +0,000038] usb_unbind_interface+0x138/0x2f0 [usbcore]
[ +0,000048] device_release_driver_internal+0x194/0x200
> [373104.440790] r8152 2-1:1.0 enx88c9b3b53125: Stop submitting intr,
> status -108
So this message is harmless. I'm also seeing it with RTL8153 if the
interface is up at the time of rmmod.
> In the past I have also seen the following, but am not able to reproduce it:
> [371283.534041] r8152-cfgselector 2-1: USB disconnect, device number 25
> [371283.534470] r8152 2-1:1.0 enx00e04c680023: Stop submitting intr,
> status -108
Apparently the disconnect message is logged before calling
rtl8152_disconnect(), so that's probably harmless too.
I'm not sure how tweaking some HW registers prevents it. Maybe it
causes the HW to complete the URB (but why?) at the right moment so
that it isn't pending during usb_disable_endpoint(), IDK, weird.
Regards,
Michal
^ permalink raw reply
* [linus:master] [net] 0d8647bc74: kunit.mctp_test_bind_lookup.mctp-route.fail
From: kernel test robot @ 2026-04-30 6:09 UTC (permalink / raw)
To: Jeremy Kerr; +Cc: oe-lkp, lkp, linux-kernel, Paolo Abeni, netdev, oliver.sang
Hello,
kernel test robot noticed "kunit.mctp_test_bind_lookup.mctp-route.fail" on:
commit: 0d8647bc74cb50edf02e8c88977657596f20fb17 ("net: mctp: don't require a route for null-EID ingress")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
[test failed on linus/master 254f49634ee16a731174d2ae34bc50bd5f45e731]
[test failed on linux-next/master 7080e32d3f09d8688c4a87d81bdcc71f7f606b16]
in testcase: kunit
version:
with following parameters:
group: group-00
config: x86_64-rhel-9.4-kunit
compiler: gcc-14
test machine: 8 threads 1 sockets Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (Haswell) with 16G memory
(please refer to attached dmesg/kmsg for entire log/backtrace)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202604301303.9de94634-lkp@intel.com
[ 111.971253] [ T1] KTAP version 1
[ 111.975040] [ T1] # Subtest: mctp-route
[ 111.979434] [ T1] # module: mctp
[ 111.979441] [ T1] 1..23
[ 111.986231] [ T1] KTAP version 1
[ 111.990365] [ T1] # Subtest: mctp_test_fragment
[ 112.001306] [ T1] ok 1 mtu 63 len 68 -> 1 frags
[ 112.021312] [ T1] ok 2 mtu 64 len 68 -> 1 frags
[ 112.041319] [ T1] ok 3 mtu 65 len 68 -> 2 frags
[ 112.060310] [ T1] ok 4 mtu 66 len 68 -> 2 frags
[ 112.076305] [ T1] ok 5 mtu 127 len 68 -> 2 frags
[ 112.092311] [ T1] ok 6 mtu 128 len 68 -> 2 frags
[ 112.108317] [ T1] ok 7 mtu 129 len 68 -> 3 frags
[ 112.124313] [ T1] ok 8 mtu 130 len 68 -> 3 frags
[ 112.129866] [ T1] # mctp_test_fragment: pass:8 fail:0 skip:0 total:8
[ 112.135390] [ T1] ok 1 mctp_test_fragment
[ 112.142787] [ T1] KTAP version 1
[ 112.151486] [ T1] # Subtest: mctp_test_rx_input
[ 112.164341] [ T1] ok 1 {1,a,8,0}
[ 112.180323] [ T1] ok 2 {1,a,9,0}
[ 112.197294] [ T1] ok 3 {2,a,8,0}
[ 112.201460] [ T1] # mctp_test_rx_input: pass:3 fail:0 skip:0 total:3
[ 112.205605] [ T1] ok 2 mctp_test_rx_input
[ 112.212515] [ T1] KTAP version 1
[ 112.221218] [ T1] # Subtest: mctp_test_route_input_sk
[ 112.233266] [ T1] ok 1 {1,a,8,c8} type 0
[ 112.249295] [ T1] ok 2 {1,a,8,c8} type 1
[ 112.265296] [ T1] ok 3 {1,a,8,c0} type 0
[ 112.281324] [ T1] ok 4 {1,a,8,48} type 0
[ 112.298312] [ T1] ok 5 {1,a,8,8} type 0
[ 112.313294] [ T1] ok 6 {1,a,8,0} type 0
[ 112.318064] [ T1] # mctp_test_route_input_sk: pass:6 fail:0 skip:0 total:6
[ 112.322819] [ T1] ok 3 mctp_test_route_input_sk
[ 112.330262] [ T1] KTAP version 1
[ 112.339484] [ T1] # Subtest: mctp_test_route_input_sk_reasm
[ 112.350322] [ T1] ok 1 single packet
[ 112.370288] [ T1] ok 2 single packet, offset seq
[ 112.386294] [ T1] ok 3 start & end packets
[ 112.402301] [ T1] ok 4 start & end packets, offset seq
[ 112.422380] [ T1] ok 5 start & end packets, out of order
[ 112.438273] [ T1] ok 6 start, middle & end packets
[ 112.454354] [ T1] ok 7 missing seq
[ 112.470298] [ T1] ok 8 seq wrap
[ 112.474634] [ T1] # mctp_test_route_input_sk_reasm: pass:8 fail:0 skip:0 total:8
[ 112.478689] [ T1] ok 4 mctp_test_route_input_sk_reasm
[ 112.486650] [ T1] KTAP version 1
[ 112.496387] [ T1] # Subtest: mctp_test_route_input_sk_keys
[ 112.507335] [ T1] ok 1 direct match
[ 112.527297] [ T1] ok 2 flipped src/dest
[ 112.543285] [ T1] ok 3 peer addr mismatch
[ 112.559275] [ T1] ok 4 tag value mismatch
[ 112.575282] [ T1] ok 5 TO mismatch
[ 112.591293] [ T1] ok 6 broadcast response
[ 112.607239] [ T1] ok 7 any local match
[ 112.612212] [ T1] # mctp_test_route_input_sk_keys: pass:7 fail:0 skip:0 total:7
[ 112.616869] [ T1] ok 5 mctp_test_route_input_sk_keys
[ 112.636288] [ T1] ok 6 mctp_test_route_input_sk_fail_single
[ 112.655293] [ T1] ok 7 mctp_test_route_input_sk_fail_frag
[ 112.679282] [ T1] ok 8 mctp_test_route_input_multiple_nets_bind
[ 112.706162] [ T1] ok 9 mctp_test_route_input_multiple_nets_key
[ 112.713544] [ T3382] # mctp_test_route_input_null_eid: ASSERTION FAILED at net/mctp/test/route-test.c:941
Expected rc == 0, but
rc == -22 (0xffffffffffffffea)
[ 112.739887] [ T1] not ok 10 mctp_test_route_input_null_eid
[ 112.749280] [ T1] ok 11 mctp_test_packet_flow
[ 112.765293] [ T1] ok 12 mctp_test_fragment_flow
[ 112.781257] [ T1] ok 13 mctp_test_route_output_key_create
[ 112.787153] [ T3390] pkt1 skb len=7 data_len=0 headroom=0 headlen=7 tailroom=377
end-tail=377 mac=(-1,-1) mac_len=0 net=(0,-1) trans=-1
shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
csum(0x0 start=0 offset=0 ip_summed=0 complete_sw=0 valid=0 level=0)
hash(0x0 sw=0 l4=0) proto=0x0000 pkttype=0 iif=0
priority=0x0 mark=0x0 alloc_cpu=4 vlan_all=0x0
encapsulation=0 inner(proto=0x0000, mac=0, net=0, trans=0)
[ 112.841984] [ T3390] pkt1 dev name=mctptest1 feat=0x0000000000004000
[ 112.848291] [ T3390] pkt1 skb linear: 00000000: 01 08 0a 88 00 00 00
[ 112.854765] [ T3390] pkt2 skb len=7 data_len=0 headroom=7 headlen=7 tailroom=370
end-tail=370 mac=(-1,-1) mac_len=0 net=(7,-1) trans=-1
shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
csum(0x0 start=0 offset=0 ip_summed=0 complete_sw=0 valid=0 level=0)
hash(0x0 sw=0 l4=0) proto=0x0000 pkttype=0 iif=0
priority=0x0 mark=0x0 alloc_cpu=4 vlan_all=0x0
encapsulation=0 inner(proto=0x0000, mac=0, net=0, trans=0)
[ 112.903591] [ T3390] pkt2 dev name=mctptest1 feat=0x0000000000004000
[ 112.909890] [ T3390] pkt2 skb linear: 00000000: 01 08 0a 18 11 11 11
[ 112.916365] [ T3390] pkt3 skb len=7 data_len=0 headroom=14 headlen=7 tailroom=363
end-tail=363 mac=(-1,-1) mac_len=0 net=(14,-1) trans=-1
shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
csum(0x0 start=0 offset=0 ip_summed=0 complete_sw=0 valid=0 level=0)
hash(0x0 sw=0 l4=0) proto=0x0000 pkttype=0 iif=0
priority=0x0 mark=0x0 alloc_cpu=4 vlan_all=0x0
encapsulation=0 inner(proto=0x0000, mac=0, net=0, trans=0)
[ 112.965431] [ T3390] pkt3 dev name=mctptest1 feat=0x0000000000004000
[ 112.971758] [ T3390] pkt3 skb linear: 00000000: 01 08 0a 68 22 22 22
[ 112.978231] [ T3390] pkt4 skb len=7 data_len=0 headroom=21 headlen=7 tailroom=356
end-tail=356 mac=(-1,-1) mac_len=0 net=(21,-1) trans=-1
shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
csum(0x0 start=0 offset=0 ip_summed=0 complete_sw=0 valid=0 level=0)
hash(0x0 sw=0 l4=0) proto=0x0000 pkttype=0 iif=0
priority=0x0 mark=0x0 alloc_cpu=4 vlan_all=0x0
encapsulation=0 inner(proto=0x0000, mac=0, net=0, trans=0)
[ 113.027235] [ T3390] pkt4 dev name=mctptest1 feat=0x0000000000004000
[ 113.033537] [ T3390] pkt4 skb linear: 00000000: 01 08 0a 88 00 33 33
[ 113.040008] [ T3390] pkt5 skb len=7 data_len=0 headroom=28 headlen=7 tailroom=349
end-tail=349 mac=(-1,-1) mac_len=0 net=(28,-1) trans=-1
shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
csum(0x0 start=0 offset=0 ip_summed=0 complete_sw=0 valid=0 level=0)
hash(0x0 sw=0 l4=0) proto=0x0000 pkttype=0 iif=0
priority=0x0 mark=0x0 alloc_cpu=4 vlan_all=0x0
encapsulation=0 inner(proto=0x0000, mac=0, net=0, trans=0)
[ 113.089005] [ T3390] pkt5 dev name=mctptest1 feat=0x0000000000004000
[ 113.095305] [ T3390] pkt5 skb linear: 00000000: 01 08 0a 58 44 44 44
[ 113.108303] [ T1] ok 14 mctp_test_route_input_cloned_frag
[ 113.116271] [ T1] ok 15 mctp_test_route_extaddr_input
[ 113.134273] [ T1] ok 16 mctp_test_route_gw_lookup
[ 113.154284] [ T1] ok 17 mctp_test_route_gw_loop
[ 113.159574] [ T1] KTAP version 1
[ 113.168807] [ T1] # Subtest: mctp_test_route_gw_mtu
[ 113.178270] [ T1] ok 1 dev 68, neigh 0, gw 0, dst 0 -> 68
[ 113.197261] [ T1] ok 2 dev 100, neigh 0, gw 0, dst 0 -> 100
[ 113.214153] [ T1] ok 3 dev 100, neigh 68, gw 0, dst 0 -> 68
[ 113.230283] [ T1] ok 4 dev 100, neigh 0, gw 68, dst 0 -> 68
[ 113.250280] [ T1] ok 5 dev 100, neigh 0, gw 0, dst 68 -> 68
[ 113.270351] [ T1] ok 6 dev 100, neigh 99, gw 98, dst 68 -> 68
[ 113.291295] [ T1] ok 7 dev 99, neigh 100, gw 98, dst 68 -> 68
[ 113.311265] [ T1] ok 8 dev 98, neigh 99, gw 100, dst 68 -> 68
[ 113.330322] [ T1] ok 9 dev 68, neigh 98, gw 99, dst 100 -> 68
[ 113.336994] [ T1] # mctp_test_route_gw_mtu: pass:9 fail:0 skip:0 total:9
[ 113.343643] [ T1] ok 18 mctp_test_route_gw_mtu
[ 113.351941] [ T1] ok 19 mctp_test_route_gw_output
[ 113.356955] [ T1] KTAP version 1
[ 113.366346] [ T1] # Subtest: mctp_test_bind_lookup
[ 113.379141] [ T1] ok 1 {src 20 dst 10 ty 1 net 1 expect remote20}
[ 113.395361] [ T1] ok 2 {src 20 dst 255 ty 1 net 1 expect remote20}
[ 113.415345] [ T1] ok 3 {src 20 dst 0 ty 1 net 1 expect remote20}
[ 113.435368] [ T1] ok 4 {src 0 dst 255 ty 1 net 1 expect any}
[ 113.455357] [ T1] ok 5 {src 0 dst 11 ty 1 net 1 expect any}
[ 113.475358] [ T1] ok 6 {src 0 dst 0 ty 1 net 1 expect any}
[ 113.495354] [ T1] ok 7 {src 0 dst 10 ty 1 net 1 expect local10}
[ 113.515425] [ T1] ok 8 {src 21 dst 10 ty 1 net 1 expect local10}
[ 113.536355] [ T1] ok 9 {src 21 dst 11 ty 1 net 1 expect remote21local11}
[ 113.555361] [ T1] ok 10 {src 99 dst 99 ty 1 net 1 expect any}
[ 113.575453] [ T1] ok 11 {src 20 dst 10 ty 3 net 1 expect (null)}
[ 113.595375] [ T1] ok 12 {src 0 dst 0 ty 1 net 7 expect any}
[ 113.615359] [ T1] ok 13 {src 21 dst 10 ty 1 net 2 expect any}
[ 113.635457] [ T1] ok 14 {src 20 dst 10 ty 1 net 3 expect any}
[ 113.655356] [ T1] ok 15 {src 21 dst 10 ty 1 net 3 expect remote21net3}
[ 113.675376] [ T1] ok 16 {src 21 dst 10 ty 1 net 4 expect remote21net4}
[ 113.695360] [ T1] ok 17 {src 21 dst 10 ty 1 net 5 expect remote21net5}
[ 113.715368] [ T1] ok 18 {src 21 dst 10 ty 1 net 5 expect remote21net5}
[ 113.735359] [ T1] ok 19 {src 99 dst 10 ty 1 net 8 expect local10net8}
[ 113.755368] [ T1] ok 20 {src 99 dst 10 ty 1 net 9 expect anynet9}
[ 113.775338] [ T1] ok 21 {src 0 dst 0 ty 1 net 9 expect anynet9}
[ 113.795363] [ T1] ok 22 {src 99 dst 99 ty 1 net 9 expect anynet9}
[ 113.815392] [ T1] ok 23 {src 20 dst 10 ty 1 net 9 expect anynet9}
[ 113.822410] [ T1] # mctp_test_bind_lookup: pass:23 fail:0 skip:0 total:23
[ 113.829409] [ T1] ok 20 mctp_test_bind_lookup
[ 113.847289] [ T1] ok 21 mctp_test_route_output_direct_no_eids
[ 113.863359] [ T1] ok 22 mctp_test_route_output_gw_no_eids
[ 113.879334] [ T1] ok 23 mctp_test_route_output_extaddr_no_eids
[ 113.885312] [ T1] # mctp-route: pass:22 fail:1 skip:0 total:23
[ 113.891701] [ T1] # Totals: pass:79 fail:1 skip:0 total:80
[ 113.897752] [ T1] not ok 34 mctp-route
The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20260430/202604301303.9de94634-lkp@intel.com
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [PATCH net v1 3/3] tcp: use skb_get_hwtstamp() for hardware timestamps
From: Eric Dumazet @ 2026-04-30 6:09 UTC (permalink / raw)
To: Kohei Enju
Cc: Willem de Bruijn, netdev, David S. Miller, Jakub Kicinski,
Paolo Abeni, Simon Horman, Kuniyuki Iwashima, Willem de Bruijn,
David Ahern, Neal Cardwell, Gerhard Engleder, Jonathan Lemon,
Richard Cochran
In-Reply-To: <afLftTCDDzw4bE0P@x1>
On Wed, Apr 29, 2026 at 10:07 PM Kohei Enju <kohei@enjuk.jp> wrote:
>
> On 04/29 17:09, Willem de Bruijn wrote:
> > Kohei Enju wrote:
> > > Since commit 97dc7cd92ac6 ("ptp: Support late timestamp determination"),
> > > skb_shared_hwtstamps may contain netdev_data instead of hwtstamp. TCP
> > > receive timestamping can then interpret the stored value as a ktime_t
> > > and report bogus hardware timestamps to userspace.
> > >
> > > Use skb_get_hwtstamp() instead of reading hwtstamp directly, so TCP
> > > sockets follow the same hardware timestamp resolution path as the socket
> > > layer. When coalescing SKBs, resolve late timestamps before copying them
> > > to the merged skb.
> >
> > Why? Does this preclude supporting SOF_TIMESTAMPING_BIND_PHC for such
> > sockets at a later time?
>
> You're right. If we want to keep the door open for
> SOF_TIMESTAMPING_BIND_PHC on coalesced skbs, resolving the timestamp at
> coalescing time is the wrong approach.
>
> >
> > It is just as easy to coalesce the cookie as the htwtstamp.
> >
> > That also avoids the need to mask out SKBTX_HW_TSTAMP_NETDEV.
>
> Indeed. We should also carry the matching @napi_id, since
> skb_get_hwtstamp() uses it for late resolution.
>
> I'll update this in v2.
Do you plan adding a selftest ?
I am confused by your series, a test would really help clarify the
issue at hand.
^ permalink raw reply
* Re: [Security] NFC: digital: peer-controlled stack overflow in digital_in_recv_sensf_res() (sibling to CVE-2026-31622)
From: Krzysztof Kozlowski @ 2026-04-30 6:10 UTC (permalink / raw)
To: G; +Cc: Networking, Jakub Kicinski, David Heidelberg
In-Reply-To: <CAFqytU9LOz6Pz=ja6N6zBLRPejk2KnyNtaSV1wcNfeGS0guMgA@mail.gmail.com>
On 30/04/2026 02:04, G wrote:
> Thanks
So what is your plan?
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH v3 3/3] p54spi: convert to devicetree
From: Krzysztof Kozlowski @ 2026-04-30 6:10 UTC (permalink / raw)
To: Arnd Bergmann, Arnd Bergmann
Cc: Aaro Koskinen, Andreas Kemnade, Bartosz Golaszewski,
Benoît Cousson, David S . Miller, Dmitry Torokhov,
Eric Dumazet, Felipe Balbi, Jakub Kicinski, Johannes Berg,
Kevin Hilman, Krzysztof Kozlowski, Linus Walleij, Paolo Abeni,
Rob Herring, Roger Quadros, Tony Lindgren, linux-wireless, Netdev,
devicetree, linux-kernel, linux-arm-kernel,
open list:GPIO SUBSYSTEM, Linux-OMAP, Christian Lamparter
In-Reply-To: <556b64c4-febb-4dc6-8d51-1b1c2d2c6aa6@app.fastmail.com>
On 29/04/2026 23:35, Arnd Bergmann wrote:
>
> The driver doesn't know the difference, so I assume they are
> either all compatible, or the other ones don't actually work.
> I've dropped everything except "st,stlc4550" now, as that is the
> one I used in the dts file. I kept the other identifiers
> in the binding as:
>
> compatible:
> oneOf:
> - const: st,stlc4560
> - items:
> - enum:
> - cnxt,3110x
> - st,stlc4550
> - isil,p54spi
Yes, just keep this enum part sorted alphabetically.
> - const: st,stlc4560
>
> Not sure if that's the best way to express this.
>
> Arnd
Best regards,
Krzysztof
^ permalink raw reply
* [PATCH net 0/2] net/sched: sch_cake: annotate data-races in cake_dump_class_stats (series)
From: Eric Dumazet @ 2026-04-30 6:16 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Jamal Hadi Salim, Toke Høiland-Jørgensen,
Jiri Pirko, netdev, eric.dumazet, Eric Dumazet
cake_dump_class_stats() runs without qdisc spinlock being held.
In this series (of two), I add READ_ONCE()/WRITE_ONCE() annotations for:
- flow->head
- flow->dropped
- b->backlogs[]
- flow->deficit
- flow->cvars.dropping
- flow->cvars.count
- flow->cvars.p_drop
- flow->cvars.blue_timer
- flow->cvars.drop_next
Eric Dumazet (2):
net/sched: sch_cake: annotate data-races in cake_dump_class_stats (I)
net/sched: sch_cake: annotate data-races in cake_dump_class_stats (II)
net/sched/sch_cake.c | 155 +++++++++++++++++++++++--------------------
1 file changed, 83 insertions(+), 72 deletions(-)
--
2.54.0.545.g6539524ca2-goog
^ permalink raw reply
* [PATCH net 1/2] net/sched: sch_cake: annotate data-races in cake_dump_class_stats (I)
From: Eric Dumazet @ 2026-04-30 6:16 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Jamal Hadi Salim, Toke Høiland-Jørgensen,
Jiri Pirko, netdev, eric.dumazet, Eric Dumazet
In-Reply-To: <20260430061610.3503483-1-edumazet@google.com>
cake_dump_class_stats() runs without qdisc spinlock being held.
In this first patch, I add READ_ONCE()/WRITE_ONCE() annotations for:
- flow->head
- flow->dropped
- b->backlogs[]
Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/sched/sch_cake.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 13c6d1869a144738c52ffc462f06338bf8245fea..806eb73d6a05e1a7391e4bef55d6aca5052bb8ab 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -914,7 +914,7 @@ static struct sk_buff *dequeue_head(struct cake_flow *flow)
struct sk_buff *skb = flow->head;
if (skb) {
- flow->head = skb->next;
+ WRITE_ONCE(flow->head, skb->next);
skb_mark_not_on_list(skb);
}
@@ -926,7 +926,7 @@ static struct sk_buff *dequeue_head(struct cake_flow *flow)
static void flow_queue_add(struct cake_flow *flow, struct sk_buff *skb)
{
if (!flow->head)
- flow->head = skb;
+ WRITE_ONCE(flow->head, skb);
else
flow->tail->next = skb;
flow->tail = skb;
@@ -1357,7 +1357,7 @@ static struct sk_buff *cake_ack_filter(struct cake_sched_data *q,
if (elig_ack_prev)
elig_ack_prev->next = elig_ack->next;
else
- flow->head = elig_ack->next;
+ WRITE_ONCE(flow->head, elig_ack->next);
skb_mark_not_on_list(elig_ack);
@@ -1595,11 +1595,11 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
len = qdisc_pkt_len(skb);
q->buffer_used -= skb->truesize;
- b->backlogs[idx] -= len;
WRITE_ONCE(b->tin_backlog, b->tin_backlog - len);
+ WRITE_ONCE(b->backlogs[idx], b->backlogs[idx] - len);
sch->qstats.backlog -= len;
- flow->dropped++;
+ WRITE_ONCE(flow->dropped, flow->dropped + 1);
WRITE_ONCE(b->tin_dropped, b->tin_dropped + 1);
if (q->config->rate_flags & CAKE_FLAG_INGRESS)
@@ -1824,11 +1824,11 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
}
/* stats */
- b->backlogs[idx] += slen;
sch->qstats.backlog += slen;
q->avg_window_bytes += slen;
WRITE_ONCE(b->bytes, b->bytes + slen);
WRITE_ONCE(b->tin_backlog, b->tin_backlog + slen);
+ WRITE_ONCE(b->backlogs[idx], b->backlogs[idx] + slen);
qdisc_tree_reduce_backlog(sch, 1-numsegs, len-slen);
consume_skb(skb);
@@ -1861,11 +1861,11 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
/* stats */
WRITE_ONCE(b->packets, b->packets + 1);
- b->backlogs[idx] += len - ack_pkt_len;
sch->qstats.backlog += len - ack_pkt_len;
q->avg_window_bytes += len - ack_pkt_len;
WRITE_ONCE(b->bytes, b->bytes + len - ack_pkt_len);
WRITE_ONCE(b->tin_backlog, b->tin_backlog + len - ack_pkt_len);
+ WRITE_ONCE(b->backlogs[idx], b->backlogs[idx] + len - ack_pkt_len);
}
if (q->overflow_timeout)
@@ -1977,7 +1977,7 @@ static struct sk_buff *cake_dequeue_one(struct Qdisc *sch)
if (flow->head) {
skb = dequeue_head(flow);
len = qdisc_pkt_len(skb);
- b->backlogs[q->cur_flow] -= len;
+ WRITE_ONCE(b->backlogs[q->cur_flow], b->backlogs[q->cur_flow] - len);
WRITE_ONCE(b->tin_backlog, b->tin_backlog - len);
sch->qstats.backlog -= len;
q->buffer_used -= skb->truesize;
@@ -2235,7 +2235,7 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
flow->deficit -= len;
b->tin_deficit -= len;
}
- flow->dropped++;
+ WRITE_ONCE(flow->dropped, flow->dropped + 1);
WRITE_ONCE(b->tin_dropped, b->tin_dropped + 1);
qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
qdisc_qstats_drop(sch);
@@ -3137,7 +3137,7 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
flow = &b->flows[idx % CAKE_QUEUES];
- if (flow->head) {
+ if (READ_ONCE(flow->head)) {
sch_tree_lock(sch);
skb = flow->head;
while (skb) {
@@ -3146,8 +3146,8 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
}
sch_tree_unlock(sch);
}
- qs.backlog = b->backlogs[idx % CAKE_QUEUES];
- qs.drops = flow->dropped;
+ qs.backlog = READ_ONCE(b->backlogs[idx % CAKE_QUEUES]);
+ qs.drops = READ_ONCE(flow->dropped);
}
if (gnet_stats_copy_queue(d, NULL, &qs, qs.qlen) < 0)
return -1;
--
2.54.0.545.g6539524ca2-goog
^ permalink raw reply related
* [PATCH net 2/2] net/sched: sch_cake: annotate data-races in cake_dump_class_stats (II)
From: Eric Dumazet @ 2026-04-30 6:16 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Jamal Hadi Salim, Toke Høiland-Jørgensen,
Jiri Pirko, netdev, eric.dumazet, Eric Dumazet
In-Reply-To: <20260430061610.3503483-1-edumazet@google.com>
cake_dump_class_stats() runs without qdisc spinlock being held.
In this second patch, I add READ_ONCE()/WRITE_ONCE() annotations for:
- flow->deficit
- flow->cvars.dropping
- flow->cvars.count
- flow->cvars.p_drop
- flow->cvars.blue_timer
- flow->cvars.drop_next
Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/sched/sch_cake.c | 131 +++++++++++++++++++++++--------------------
1 file changed, 71 insertions(+), 60 deletions(-)
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 806eb73d6a05e1a7391e4bef55d6aca5052bb8ab..5862933be8d746bf222e6aa2ad5c9433757c9b07 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -399,14 +399,14 @@ static void cake_configure_rates(struct Qdisc *sch, u64 rate, bool rate_adjust);
* Here, invsqrt is a fixed point number (< 1.0), 32bit mantissa, aka Q0.32
*/
-static void cobalt_newton_step(struct cobalt_vars *vars)
+static void cobalt_newton_step(struct cobalt_vars *vars, u32 count)
{
u32 invsqrt, invsqrt2;
u64 val;
invsqrt = vars->rec_inv_sqrt;
invsqrt2 = ((u64)invsqrt * invsqrt) >> 32;
- val = (3LL << 32) - ((u64)vars->count * invsqrt2);
+ val = (3LL << 32) - ((u64)count * invsqrt2);
val >>= 2; /* avoid overflow in following multiply */
val = (val * invsqrt) >> (32 - 2 + 1);
@@ -414,12 +414,12 @@ static void cobalt_newton_step(struct cobalt_vars *vars)
vars->rec_inv_sqrt = val;
}
-static void cobalt_invsqrt(struct cobalt_vars *vars)
+static void cobalt_invsqrt(struct cobalt_vars *vars, u32 count)
{
- if (vars->count < REC_INV_SQRT_CACHE)
- vars->rec_inv_sqrt = inv_sqrt_cache[vars->count];
+ if (count < REC_INV_SQRT_CACHE)
+ vars->rec_inv_sqrt = inv_sqrt_cache[count];
else
- cobalt_newton_step(vars);
+ cobalt_newton_step(vars, count);
}
static void cobalt_vars_init(struct cobalt_vars *vars)
@@ -449,16 +449,19 @@ static bool cobalt_queue_full(struct cobalt_vars *vars,
bool up = false;
if (ktime_to_ns(ktime_sub(now, vars->blue_timer)) > p->target) {
- up = !vars->p_drop;
- vars->p_drop += p->p_inc;
- if (vars->p_drop < p->p_inc)
- vars->p_drop = ~0;
- vars->blue_timer = now;
- }
- vars->dropping = true;
- vars->drop_next = now;
+ u32 p_drop = vars->p_drop;
+
+ up = !p_drop;
+ p_drop += p->p_inc;
+ if (p_drop < p->p_inc)
+ p_drop = ~0;
+ WRITE_ONCE(vars->p_drop, p_drop);
+ WRITE_ONCE(vars->blue_timer, now);
+ }
+ WRITE_ONCE(vars->dropping, true);
+ WRITE_ONCE(vars->drop_next, now);
if (!vars->count)
- vars->count = 1;
+ WRITE_ONCE(vars->count, 1);
return up;
}
@@ -475,20 +478,20 @@ static bool cobalt_queue_empty(struct cobalt_vars *vars,
if (vars->p_drop &&
ktime_to_ns(ktime_sub(now, vars->blue_timer)) > p->target) {
if (vars->p_drop < p->p_dec)
- vars->p_drop = 0;
+ WRITE_ONCE(vars->p_drop, 0);
else
- vars->p_drop -= p->p_dec;
- vars->blue_timer = now;
+ WRITE_ONCE(vars->p_drop, vars->p_drop - p->p_dec);
+ WRITE_ONCE(vars->blue_timer, now);
down = !vars->p_drop;
}
- vars->dropping = false;
+ WRITE_ONCE(vars->dropping, false);
if (vars->count && ktime_to_ns(ktime_sub(now, vars->drop_next)) >= 0) {
- vars->count--;
- cobalt_invsqrt(vars);
- vars->drop_next = cobalt_control(vars->drop_next,
- p->interval,
- vars->rec_inv_sqrt);
+ WRITE_ONCE(vars->count, vars->count - 1);
+ cobalt_invsqrt(vars, vars->count);
+ WRITE_ONCE(vars->drop_next,
+ cobalt_control(vars->drop_next, p->interval,
+ vars->rec_inv_sqrt));
}
return down;
@@ -507,6 +510,7 @@ static enum qdisc_drop_reason cobalt_should_drop(struct cobalt_vars *vars,
bool next_due, over_target;
ktime_t schedule;
u64 sojourn;
+ u32 count;
/* The 'schedule' variable records, in its sign, whether 'now' is before or
* after 'drop_next'. This allows 'drop_next' to be updated before the next
@@ -528,21 +532,22 @@ static enum qdisc_drop_reason cobalt_should_drop(struct cobalt_vars *vars,
over_target = sojourn > p->target &&
sojourn > p->mtu_time * bulk_flows * 2 &&
sojourn > p->mtu_time * 4;
- next_due = vars->count && ktime_to_ns(schedule) >= 0;
+ count = vars->count;
+ next_due = count && ktime_to_ns(schedule) >= 0;
vars->ecn_marked = false;
if (over_target) {
if (!vars->dropping) {
- vars->dropping = true;
- vars->drop_next = cobalt_control(now,
- p->interval,
- vars->rec_inv_sqrt);
+ WRITE_ONCE(vars->dropping, true);
+ WRITE_ONCE(vars->drop_next,
+ cobalt_control(now, p->interval,
+ vars->rec_inv_sqrt));
}
- if (!vars->count)
- vars->count = 1;
+ if (!count)
+ count = 1;
} else if (vars->dropping) {
- vars->dropping = false;
+ WRITE_ONCE(vars->dropping, false);
}
if (next_due && vars->dropping) {
@@ -550,23 +555,23 @@ static enum qdisc_drop_reason cobalt_should_drop(struct cobalt_vars *vars,
if (!(vars->ecn_marked = INET_ECN_set_ce(skb)))
reason = QDISC_DROP_CONGESTED;
- vars->count++;
- if (!vars->count)
- vars->count--;
- cobalt_invsqrt(vars);
- vars->drop_next = cobalt_control(vars->drop_next,
- p->interval,
- vars->rec_inv_sqrt);
+ count++;
+ if (!count)
+ count--;
+ cobalt_invsqrt(vars, count);
+ WRITE_ONCE(vars->drop_next,
+ cobalt_control(vars->drop_next, p->interval,
+ vars->rec_inv_sqrt));
schedule = ktime_sub(now, vars->drop_next);
} else {
while (next_due) {
- vars->count--;
- cobalt_invsqrt(vars);
- vars->drop_next = cobalt_control(vars->drop_next,
- p->interval,
- vars->rec_inv_sqrt);
+ count--;
+ cobalt_invsqrt(vars, count);
+ WRITE_ONCE(vars->drop_next,
+ cobalt_control(vars->drop_next, p->interval,
+ vars->rec_inv_sqrt));
schedule = ktime_sub(now, vars->drop_next);
- next_due = vars->count && ktime_to_ns(schedule) >= 0;
+ next_due = count && ktime_to_ns(schedule) >= 0;
}
}
@@ -575,11 +580,12 @@ static enum qdisc_drop_reason cobalt_should_drop(struct cobalt_vars *vars,
get_random_u32() < vars->p_drop)
reason = QDISC_DROP_FLOOD_PROTECTION;
+ WRITE_ONCE(vars->count, count);
/* Overload the drop_next field as an activity timeout */
- if (!vars->count)
- vars->drop_next = ktime_add_ns(now, p->interval);
+ if (!count)
+ WRITE_ONCE(vars->drop_next, ktime_add_ns(now, p->interval));
else if (ktime_to_ns(schedule) > 0 && reason == QDISC_DROP_UNSPEC)
- vars->drop_next = now;
+ WRITE_ONCE(vars->drop_next, now);
return reason;
}
@@ -1924,7 +1930,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
flow->set = CAKE_SET_SPARSE;
WRITE_ONCE(b->sparse_flow_count, b->sparse_flow_count + 1);
- flow->deficit = cake_get_flow_quantum(b, flow, q->config->flow_mode);
+ WRITE_ONCE(flow->deficit, cake_get_flow_quantum(b, flow, q->config->flow_mode));
} else if (flow->set == CAKE_SET_SPARSE_WAIT) {
/* this flow was empty, accounted as a sparse flow, but actually
* in the bulk rotation.
@@ -2166,7 +2172,8 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
}
}
- flow->deficit += cake_get_flow_quantum(b, flow, q->config->flow_mode);
+ WRITE_ONCE(flow->deficit,
+ flow->deficit + cake_get_flow_quantum(b, flow, q->config->flow_mode));
list_move_tail(&flow->flowchain, &b->old_flows);
goto retry;
@@ -2232,7 +2239,7 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
if (q->config->rate_flags & CAKE_FLAG_INGRESS) {
len = cake_advance_shaper(q, b, skb,
now, true);
- flow->deficit -= len;
+ WRITE_ONCE(flow->deficit, flow->deficit - len);
b->tin_deficit -= len;
}
WRITE_ONCE(flow->dropped, flow->dropped + 1);
@@ -2259,7 +2266,7 @@ static struct sk_buff *cake_dequeue(struct Qdisc *sch)
delay < b->base_delay ? 2 : 8));
len = cake_advance_shaper(q, b, skb, now, false);
- flow->deficit -= len;
+ WRITE_ONCE(flow->deficit, flow->deficit - len);
b->tin_deficit -= len;
if (ktime_after(q->time_next_packet, now) && sch->q.qlen) {
@@ -3153,6 +3160,8 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
return -1;
if (flow) {
ktime_t now = ktime_get();
+ bool dropping;
+ u32 p_drop;
stats = nla_nest_start_noflag(d->skb, TCA_STATS_APP);
if (!stats)
@@ -3167,21 +3176,23 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
goto nla_put_failure; \
} while (0)
- PUT_STAT_S32(DEFICIT, flow->deficit);
- PUT_STAT_U32(DROPPING, flow->cvars.dropping);
- PUT_STAT_U32(COBALT_COUNT, flow->cvars.count);
- PUT_STAT_U32(P_DROP, flow->cvars.p_drop);
- if (flow->cvars.p_drop) {
+ PUT_STAT_S32(DEFICIT, READ_ONCE(flow->deficit));
+ dropping = READ_ONCE(flow->cvars.dropping);
+ PUT_STAT_U32(DROPPING, dropping);
+ PUT_STAT_U32(COBALT_COUNT, READ_ONCE(flow->cvars.count));
+ p_drop = READ_ONCE(flow->cvars.p_drop);
+ PUT_STAT_U32(P_DROP, p_drop);
+ if (p_drop) {
PUT_STAT_S32(BLUE_TIMER_US,
ktime_to_us(
ktime_sub(now,
- flow->cvars.blue_timer)));
+ READ_ONCE(flow->cvars.blue_timer))));
}
- if (flow->cvars.dropping) {
+ if (dropping) {
PUT_STAT_S32(DROP_NEXT_US,
ktime_to_us(
ktime_sub(now,
- flow->cvars.drop_next)));
+ READ_ONCE(flow->cvars.drop_next))));
}
if (nla_nest_end(d->skb, stats) < 0)
--
2.54.0.545.g6539524ca2-goog
^ permalink raw reply related
* [PATCH] psp: reject packets carrying unsupported PSP optional fields
From: David Carlier @ 2026-04-30 6:20 UTC (permalink / raw)
To: daniel.zahka, kuba
Cc: willemdebruijn.kernel, davem, edumazet, pabeni, horms, raeds,
kees, cratiu, netdev, linux-kernel, David Carlier, stable
psp_dev_rcv() documents that it does not support optional PSP fields
but never enforces it. The helper unconditionally strips a fixed
PSP_ENCAP_HLEN, so a frame whose PSP header carries options is
silently mis-decapsulated: option bytes spill into the inner packet
head and parsing fails downstream on a corrupted skb instead of being
rejected early.
Validate hdrlen, crypt_offset and PSPHDR_VERFL_VIRT, and hoist the
psph read above skb_ext_add() so rejected packets do not pick up an
SKB_EXT_PSP extension only to drop it. Both in-tree callers gate on
hardware-validated, opt-less PSP, so this is hardening rather than a
reachable corruption path.
Fixes: 0eddb8023cee ("psp: provide decapsulation and receive helper for drivers")
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
---
net/psp/psp_main.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c
index 524978dfb8fd..53d7e14c054a 100644
--- a/net/psp/psp_main.c
+++ b/net/psp/psp_main.c
@@ -321,12 +321,20 @@ int psp_dev_rcv(struct sk_buff *skb, u16 dev_id, u8 generation, bool strip_icv)
if (unlikely(uh->dest != htons(PSP_DEFAULT_UDP_PORT)))
return -EINVAL;
+ psph = (struct psphdr *)(skb->data + l2_hlen + l3_hlen +
+ sizeof(struct udphdr));
+
+ /* Fixed-length decap; reject optional fields rather than mis-decapsulate. */
+
+ if (unlikely(psph->hdrlen != PSP_HDRLEN_NOOPT ||
+ psph->crypt_offset ||
+ (psph->verfl & PSPHDR_VERFL_VIRT)))
+ return -EINVAL;
+
pse = skb_ext_add(skb, SKB_EXT_PSP);
if (!pse)
return -EINVAL;
- psph = (struct psphdr *)(skb->data + l2_hlen + l3_hlen +
- sizeof(struct udphdr));
pse->spi = psph->spi;
pse->dev_id = dev_id;
pse->generation = generation;
--
2.53.0
^ permalink raw reply related
* [PATCH net-next] net/mlx5: Add vhca_id_type support to IPsec alias creation
From: Tariq Toukan @ 2026-04-30 6:19 UTC (permalink / raw)
To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
David S. Miller
Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Patrisious Haddad, Jianbo Liu, Kees Cook, Dragos Tatulea, netdev,
linux-rdma, linux-kernel, Gal Pressman, Leon Romanovsky
From: Patrisious Haddad <phaddad@nvidia.com>
When creating an alias FT for MPV IPsec, if alias creation with
sw_vhca_id is supported use it instead of using the hw_vhca_id.
This in turn allows IPsec to work properly after live migration,
in case a VF was live migrated and his hw_vhca_id changed due to
migration which can happen if you migrate to a VF with a different index
than yours, IPsec would fail to start post migration, this patch
resolves the issue by using sw_vhca_id instead which doesn't change post
migration.
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 1 +
.../ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c | 10 ++++++++++
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | 1 +
3 files changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index c89417c1a1f9..b5c8fbfb0eed 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -2306,6 +2306,7 @@ int mlx5_cmd_alias_obj_create(struct mlx5_core_dev *dev,
attr = MLX5_ADDR_OF(create_alias_obj_in, in, alias_ctx);
MLX5_SET(alias_context, attr, vhca_id_to_be_accessed, alias_attr->vhca_id);
+ MLX5_SET(alias_context, attr, vhca_id_type, alias_attr->vhca_id_type);
MLX5_SET(alias_context, attr, object_id_to_be_accessed, alias_attr->obj_id);
key = MLX5_ADDR_OF(alias_context, attr, access_key);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c
index 28cb670ba33e..9aadb20b8b8e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c
@@ -116,6 +116,16 @@ static int ipsec_fs_create_aliased_ft(struct mlx5_core_dev *ibv_owner,
memcpy(alias_attr.access_key, alias_key, ACCESS_KEY_LEN);
alias_attr.obj_id = aliased_object_id;
alias_attr.obj_type = MLX5_GENERAL_OBJECT_TYPES_FLOW_TABLE_ALIAS;
+ if (MLX5_CAP_GEN_2(ibv_owner, sw_vhca_id_valid) &&
+ MLX5_CAP_GEN(ibv_allowed, ft_alias_sw_vhca_id)) {
+ vhca_id_to_be_accessed = MLX5_CAP_GEN_2(ibv_owner, sw_vhca_id);
+ alias_attr.vhca_id_type = VHCA_ID_TYPE_SW;
+ } else {
+ vhca_id_to_be_accessed = MLX5_CAP_GEN(ibv_owner, vhca_id);
+ alias_attr.vhca_id_type = VHCA_ID_TYPE_HW;
+ if (MLX5_CAP_GEN_2(ibv_owner, sw_vhca_id_valid))
+ mlx5_core_warn(ibv_owner, "IPsec with migration isn't supported, if migration is required update FW.\n");
+ }
alias_attr.vhca_id = vhca_id_to_be_accessed;
ret = mlx5_cmd_alias_obj_create(ibv_allowed, &alias_attr, obj_id);
if (ret) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
index 1507e881d962..8730cabbb5a8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
@@ -110,6 +110,7 @@ struct mlx5_cmd_allow_other_vhca_access_attr {
struct mlx5_cmd_alias_obj_create_attr {
u32 obj_id;
u16 vhca_id;
+ u8 vhca_id_type;
u16 obj_type;
u8 access_key[ACCESS_KEY_LEN];
};
base-commit: 09942ddedcb960f9e78fd817ec33f501d1040c5b
--
2.44.0
^ permalink raw reply related
* Re: Re: [PATCH net-next v7 2/4] net: stmmac: eic7700: enable clocks before syscon access and correct RX sampling timing
From: 李志 @ 2026-04-30 6:43 UTC (permalink / raw)
To: Jakub Kicinski, andrew+netdev
Cc: devicetree, davem, edumazet, robh, krzk+dt, conor+dt, netdev,
pabeni, mcoquelin.stm32, alexandre.torgue, rmk+kernel, pjw,
palmer, aou, alex, linux-riscv, linux-stm32, linux-arm-kernel,
linux-kernel, maxime.chevallier, ningyu, linmin, pinkesh.vaghela,
pritesh.patel, weishangjuan, horms
In-Reply-To: <20260428180625.738223cf@kernel.org>
> -----原始邮件-----
> 发件人: "Jakub Kicinski" <kuba@kernel.org>
> 发送时间:2026-04-29 09:06:25 (星期三)
> 收件人: lizhi2@eswincomputing.com
> 抄送: devicetree@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, rmk+kernel@armlinux.org.uk, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maxime.chevallier@bootlin.com, ningyu@eswincomputing.com, linmin@eswincomputing.com, pinkesh.vaghela@einfochips.com, pritesh.patel@einfochips.com, weishangjuan@eswincomputing.com, horms@kernel.org
> 主题: Re: [PATCH net-next v7 2/4] net: stmmac: eic7700: enable clocks before syscon access and correct RX sampling timing
>
>
> Why Fixes? If eth1 never worked this is not a fix but new functionality
> If you want to make this a fix to prevent incompatibility - cut it down
> just to the eth0 changes.
>
Thank you for the suggestion.
You're right that eth1 never worked at Gigabit speed, so this should
not be treated as a fix.
In v8, I will split the changes into two patches within the same series:
- Patch 1 will contain only the fixes affecting the existing eth0
functionality, and will keep the Fixes tag.
- Patch 2 will add the eth1 support (RX clock inversion workaround)
as new functionality, without a Fixes tag.
Please let me know if you would prefer a different split or ordering.
>
> AI says:
>
> The step unit is being silently changed from 0.1 ns (delay_ps / 100)
> to 0.02 ns (delay_ps / 20). The same DT value now programs 5x the number
> of delay steps into the hardware.
>
This change is intentional. The previous driver used an incorrect
conversion (100ps per step), while the actual hardware step is 20ps.
This patch corrects the delay calculation to match the hardware.
The DT binding is updated accordingly to reflect the correct
20ps granularity and enforce valid values.
This binding has not yet been used in any upstream DTS, so there
are no in-tree users relying on the previous behavior.
I will clarify this explicitly in the v8 commit message.
>
> AI says
>
> In the default case this logs "invalid speed %u" but then falls
> through and still executes the regmap_write() with the base dly_param. An
> unsupported speed reports an error and reprograms the hardware anyway.
>
> Should the default path return without writing, or should the write be
> moved into the valid cases only?
>
The default case should not reprogram any hardware registers.
I will change the implementation so that register writes are only
performed for valid speeds (SPEED_10/100/1000). For unsupported
speeds, the function will only log the error and return without
any side effects.
>
> AI says:
>
> First, rx-internal-delay-ps and tx-internal-delay-ps are silently
> demoted from required to optional. The previous driver returned
> -EINVAL with "missing required property ..." when either was absent;
> the else branches have been removed, so missing properties now leave
> eth_clk_dly_param at zero and fix_mac_speed() programs zero delay
> without diagnostic. Is this intentional, and if so should the commit
> message and the DT binding reflect it?
>
> Second, the previous code silently clamped out-of-range values via
> min() and only required non-zero step units by integer truncation.
> The new code rejects non-multiples of 20 and values greater than 2540
> ps with -EINVAL at probe time. DTBs that previously probed with
> clamped delays will now fail probe. Should this stricter validation
> also be called out in the commit message?
>
Yes, this change is intentional.
The previous implementation used incorrect delay semantics
(100ps step and implicit clamping), which does not match the
actual hardware behavior.
The new implementation corrects the hardware programming to use
the real 20ps step granularity and enforces valid ranges.
Regarding the DT binding change (required → optional) and the
stricter validation, this is also intentional. Zero delay is a
valid hardware configuration, and the stricter checks are added
to avoid silently masking invalid values.
Importantly, this binding has not been used by any upstream DTS
yet, so there are no in-tree users affected by this change.
I will explicitly document both the semantic change and the
compatibility notes in the v8 commit message and update the
binding description accordingly.
>
> AI says:
>
> The eswin,hsp-sp-csr phandle-args layout is expanded from 4 cells
> (phandle + 3 offsets) to 6 cells (phandle + 5 offsets), with new
> indices 3/4/5 now required. Any DTB produced against the original
> ea77dbbdbc4e binding will fail probe here with -EINVAL.
The previous phandle-args layout (4 cells) was based on an
incomplete initial design and did not fully describe all required
hardware register offsets.
The updated 6-cell format reflects the complete hardware CSR layout
and allows explicit configuration of additional control registers.
Importantly, this binding has not been used by any upstream DTS,
so there are no in-tree users affected by this change.
I agree that this is a DT ABI change, and I will explicitly document
the compatibility impact and updated binding description in the v8
series to make this clear.
^ permalink raw reply
* Re: [PATCH net v1 3/3] tcp: use skb_get_hwtstamp() for hardware timestamps
From: Kohei Enju @ 2026-04-30 6:52 UTC (permalink / raw)
To: Eric Dumazet
Cc: Willem de Bruijn, netdev, David S. Miller, Jakub Kicinski,
Paolo Abeni, Simon Horman, Kuniyuki Iwashima, Willem de Bruijn,
David Ahern, Neal Cardwell, Gerhard Engleder, Jonathan Lemon,
Richard Cochran
In-Reply-To: <CANn89i+0iK-Ci+Gokq5VW+SCvQLyA4vjairsf422P6hjZErquw@mail.gmail.com>
On 04/29 23:09, Eric Dumazet wrote:
> On Wed, Apr 29, 2026 at 10:07 PM Kohei Enju <kohei@enjuk.jp> wrote:
> >
> > On 04/29 17:09, Willem de Bruijn wrote:
> > > Kohei Enju wrote:
> > > > Since commit 97dc7cd92ac6 ("ptp: Support late timestamp determination"),
> > > > skb_shared_hwtstamps may contain netdev_data instead of hwtstamp. TCP
> > > > receive timestamping can then interpret the stored value as a ktime_t
> > > > and report bogus hardware timestamps to userspace.
> > > >
> > > > Use skb_get_hwtstamp() instead of reading hwtstamp directly, so TCP
> > > > sockets follow the same hardware timestamp resolution path as the socket
> > > > layer. When coalescing SKBs, resolve late timestamps before copying them
> > > > to the merged skb.
> > >
> > > Why? Does this preclude supporting SOF_TIMESTAMPING_BIND_PHC for such
> > > sockets at a later time?
> >
> > You're right. If we want to keep the door open for
> > SOF_TIMESTAMPING_BIND_PHC on coalesced skbs, resolving the timestamp at
> > coalescing time is the wrong approach.
> >
> > >
> > > It is just as easy to coalesce the cookie as the htwtstamp.
> > >
> > > That also avoids the need to mask out SKBTX_HW_TSTAMP_NETDEV.
> >
> > Indeed. We should also carry the matching @napi_id, since
> > skb_get_hwtstamp() uses it for late resolution.
> >
> > I'll update this in v2.
>
> Do you plan adding a selftest ?
>
> I am confused by your series, a test would really help clarify the
> issue at hand.
Yes, I agree a selftest would help.
Since this issue is only triggered with drivers that use late RX
timestamp determination (SKBTX_HW_TSTAMP_NETDEV / ndo_get_tstamp), it
would likely need to live under tools/testing/selftests/drivers/net/hw/
rather than as a generic net selftest. I'm looking into whether I can
add such a test.
Either way, I'll expand the cover letter to explain the issue in more
detail. Sorry for the confusion.
^ permalink raw reply
* Re: [PATCH net-next] net: Consistently define pci_device_ids using named initializers
From: Jijie Shao @ 2026-04-30 6:53 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub), Michael Grzeschik,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Marc Kleine-Budde, Vincent Mailhol, Krzysztof Halasa,
Johannes Berg
Cc: shaojijie, Markus Schneider-Pargmann, Steffen Klassert,
David Dillow, Ion Badulescu, Mark Einon, Rasesh Mody,
GR-Linux-NIC-Dev, Sudarsana Kalluru, Manish Chopra,
Potnuri Bharat Teja, Denis Kirjanov, Jian Shen, Cai Huoqing,
Fan Gong, Tony Nguyen, Przemek Kitszel, Tariq Toukan,
Saeed Mahameed, Leon Romanovsky, Mark Bloch, Ido Schimmel,
Petr Machata, Yibo Dong, Simon Horman, Heiner Kallweit, nic_swsd,
Jiri Pirko, Francois Romieu, Daniele Venzano, Samuel Chessman,
Jiawen Wu, Mengyuan Lou, Kevin Curtis, Arend van Spriel,
Stanislav Yakovlev, Richard Cochran, Kees Cook, Thomas Gleixner,
Thomas Fourier, Ingo Molnar, Kory Maincent, Zilin Guan,
Marco Crivellari, Vadim Fedorenko, Jacob Keller, Philipp Stanner,
Bjorn Helgaas, Yeounsu Moon, Denis Benato, Peiyang Wang,
Yonglong Liu, Andy Shevchenko, Yicong Hui, Randy Dunlap,
MD Danish Anwar, Nathan Chancellor, Sai Krishna,
Ethan Nelson-Moore, Larysa Zaremba, Joe Damato, Double Lo,
Chi-hsien Lin, Colin Ian King, netdev, linux-kernel, linux-can,
linux-parisc, intel-wired-lan, linux-rdma, oss-drivers,
linux-wireless, brcm80211, brcm80211-dev-list.pdl
In-Reply-To: <20260428171845.2288395-2-u.kleine-koenig@baylibre.com>
on 2026/4/29 1:18, Uwe Kleine-König (The Capable Hub) wrote:
> ... and PCI device helpers.
>
> The various struct pci_device_id arrays were initialized mostly by one
> the PCI_DEVICE macros and then list expressions. The latter isn't easily
> readable if you're not into PCI. Using named initializers is more
> explicit and thus easier to parse.
>
> Also use PCI_DEVICE* helper macros to assign .vendor, .device,
> .subvendor and .subdevice where appropriate and skip explicit
> assignments of 0 (which the compiler takes care of).
>
> The secret plan is to make struct pci_device_id::driver_data an
> anonymous union (similar to
> https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@baylibre.com/)
> and that requires named initializers. But it's also a nice cleanup on
> its own.
>
> This change doesn't introduce changes to the compiled pci_device_id
> arrays. Tested on x86 and arm64.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
...
>
> diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
> index 068da2fd1fea..b3e01b2f8319 100644
> --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
> +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c
> @@ -489,7 +489,7 @@ static void hbg_shutdown(struct pci_dev *pdev)
> }
>
> static const struct pci_device_id hbg_pci_tbl[] = {
> - {PCI_VDEVICE(HUAWEI, 0x3730), 0},
> + { PCI_VDEVICE(HUAWEI, 0x3730) },
> { }
> };
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
> MODULE_DEVICE_TABLE(pci, hbg_pci_tbl);
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> index a3206c97923e..4c34a144d21c 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
> @@ -86,25 +86,39 @@ module_param(page_pool_enabled, bool, 0400);
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id hns3_pci_tbl[] = {
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA_MACSEC),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA_MACSEC),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_100G_RDMA_MACSEC),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_200G_RDMA),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_VF), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_RDMA_DCB_PFC_VF),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> + {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE),
> + .driver_data = 0,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE),
> + .driver_data = 0,
Thanks for your work.
If .driver_data = 0, is it possible to delete it to be consistent with other parts, for example:
{ PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE) }
Jijie Shao
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA_MACSEC),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA_MACSEC),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_100G_RDMA_MACSEC),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_200G_RDMA),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_VF),
> + .driver_data = 0,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_RDMA_DCB_PFC_VF),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + },
> /* required last entry */
> - {0,}
> + { }
> };
> MODULE_DEVICE_TABLE(pci, hns3_pci_tbl);
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> index dd4045c773d4..e17b92a411a2 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> @@ -72,16 +72,16 @@ static struct hnae3_ae_algo ae_algo;
> static struct workqueue_struct *hclge_wq;
>
> static const struct pci_device_id ae_algo_pci_tbl[] = {
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA_MACSEC), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA_MACSEC), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_100G_RDMA_MACSEC), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_200G_RDMA), 0},
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE) },
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE) },
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA) },
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA_MACSEC) },
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA) },
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA_MACSEC) },
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_100G_RDMA_MACSEC) },
> + { PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_200G_RDMA) },
> /* required last entry */
> - {0, }
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, ae_algo_pci_tbl);
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> index 0cc911e6c732..063a692c2b41 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
> @@ -26,11 +26,15 @@ static struct hnae3_ae_algo ae_algovf;
> static struct workqueue_struct *hclgevf_wq;
>
> static const struct pci_device_id ae_algovf_pci_tbl[] = {
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_VF), 0},
> - {PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_RDMA_DCB_PFC_VF),
> - HNAE3_DEV_SUPPORT_ROCE_DCB_BITS},
> + {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_VF),
> + .driver_data = 0,
> + }, {
> + PCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_RDMA_DCB_PFC_VF),
> + .driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,
> + },
> /* required last entry */
> - {0, }
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, ae_algovf_pci_tbl);
> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
> index ae1f523d6841..42f4792d255b 100644
> --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
> +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
> @@ -1467,12 +1467,12 @@ static void hinic_shutdown(struct pci_dev *pdev)
> }
>
> static const struct pci_device_id hinic_pci_table[] = {
> - { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_QUAD_PORT_25GE), 0},
> - { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_DUAL_PORT_100GE), 0},
> - { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_DUAL_PORT_100GE_MEZZ), 0},
> - { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_QUAD_PORT_25GE_MEZZ), 0},
> - { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_VF), 0},
> - { 0, 0}
> + { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_QUAD_PORT_25GE) },
> + { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_DUAL_PORT_100GE) },
> + { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_DUAL_PORT_100GE_MEZZ) },
> + { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_QUAD_PORT_25GE_MEZZ) },
> + { PCI_VDEVICE(HUAWEI, HINIC_DEV_ID_VF) },
> + { }
> };
> MODULE_DEVICE_TABLE(pci, hinic_pci_table);
>
> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c
> index f83d5bd1041e..36df807cbe09 100644
> --- a/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c
> +++ b/drivers/net/ethernet/huawei/hinic3/hinic3_lld.c
> @@ -426,10 +426,9 @@ static void hinic3_remove(struct pci_dev *pdev)
> }
>
> static const struct pci_device_id hinic3_pci_table[] = {
> - {PCI_VDEVICE(HUAWEI, PCI_DEV_ID_HINIC3_PF), 0},
> - {PCI_VDEVICE(HUAWEI, PCI_DEV_ID_HINIC3_VF), 0},
> - {0, 0}
> -
> + { PCI_VDEVICE(HUAWEI, PCI_DEV_ID_HINIC3_PF) },
> + { PCI_VDEVICE(HUAWEI, PCI_DEV_ID_HINIC3_VF) },
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, hinic3_pci_table);
> diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
> index 9074b558de35..5ef82a4e6184 100644
> --- a/drivers/net/ethernet/intel/e100.c
> +++ b/drivers/net/ethernet/intel/e100.c
> @@ -177,8 +177,8 @@ MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad eeprom checksums");
> MODULE_PARM_DESC(use_io, "Force use of i/o access mode");
>
> #define INTEL_8255X_ETHERNET_DEVICE(device_id, ich) {\
> - PCI_VENDOR_ID_INTEL, device_id, PCI_ANY_ID, PCI_ANY_ID, \
> - PCI_CLASS_NETWORK_ETHERNET << 8, 0xFFFF00, ich }
> + PCI_VDEVICE(INTEL, device_id), \
> + .class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = 0xFFFF00, .driver_data = ich }
> static const struct pci_device_id e100_id_table[] = {
> INTEL_8255X_ETHERNET_DEVICE(0x1029, 0),
> INTEL_8255X_ETHERNET_DEVICE(0x1030, 0),
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 7ce0cc8ab8f4..5b7ba1594f0d 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -7799,137 +7799,370 @@ static const struct pci_error_handlers e1000_err_handler = {
> };
>
> static const struct pci_device_id e1000_pci_tbl[] = {
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER), board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER), board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER), board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER_LP),
> - board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_FIBER), board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES), board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES_DUAL), board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES_QUAD), board_82571 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82571PT_QUAD_COPPER), board_82571 },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_COPPER),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_FIBER),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_COPPER_LP),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_QUAD_FIBER),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES_DUAL),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571EB_SERDES_QUAD),
> + .driver_data = board_82571,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82571PT_QUAD_COPPER),
> + .driver_data = board_82571,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI), board_82572 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_COPPER), board_82572 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_FIBER), board_82572 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_SERDES), board_82572 },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI),
> + .driver_data = board_82572,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_COPPER),
> + .driver_data = board_82572,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_FIBER),
> + .driver_data = board_82572,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82572EI_SERDES),
> + .driver_data = board_82572,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82573E), board_82573 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82573E_IAMT), board_82573 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L), board_82573 },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82573E),
> + .driver_data = board_82573,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82573E_IAMT),
> + .driver_data = board_82573,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L),
> + .driver_data = board_82573,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82574L), board_82574 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82574LA), board_82574 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82583V), board_82583 },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82574L),
> + .driver_data = board_82574,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82574LA),
> + .driver_data = board_82574,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_82583V),
> + .driver_data = board_82583,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT),
> - board_80003es2lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_SPT),
> - board_80003es2lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_SERDES_DPT),
> - board_80003es2lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_SERDES_SPT),
> - board_80003es2lan },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT),
> + .driver_data = board_80003es2lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_SPT),
> + .driver_data = board_80003es2lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_SERDES_DPT),
> + .driver_data = board_80003es2lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_SERDES_SPT),
> + .driver_data = board_80003es2lan,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE), board_ich8lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE_G), board_ich8lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE_GT), board_ich8lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_AMT), board_ich8lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_C), board_ich8lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M), board_ich8lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M_AMT), board_ich8lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_82567V_3), board_ich8lan },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE),
> + .driver_data = board_ich8lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE_G),
> + .driver_data = board_ich8lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IFE_GT),
> + .driver_data = board_ich8lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_AMT),
> + .driver_data = board_ich8lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_C),
> + .driver_data = board_ich8lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M),
> + .driver_data = board_ich8lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_IGP_M_AMT),
> + .driver_data = board_ich8lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH8_82567V_3),
> + .driver_data = board_ich8lan,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_G), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_GT), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_AMT), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_C), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_BM), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_AMT), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_V), board_ich9lan },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_G),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IFE_GT),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_AMT),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_C),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_BM),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_AMT),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH9_IGP_M_V),
> + .driver_data = board_ich9lan
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_LM), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_LF), board_ich9lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_V), board_ich9lan },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_LM),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_LF),
> + .driver_data = board_ich9lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_R_BM_V),
> + .driver_data = board_ich9lan,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM), board_ich10lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF), board_ich10lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_V), board_ich10lan },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LM),
> + .driver_data = board_ich10lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_LF),
> + .driver_data = board_ich10lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_ICH10_D_BM_V),
> + .driver_data = board_ich10lan,
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM), board_pchlan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC), board_pchlan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DM), board_pchlan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DC), board_pchlan },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LM),
> + .driver_data = board_pchlan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_M_HV_LC),
> + .driver_data = board_pchlan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DM),
> + .driver_data = board_pchlan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_D_HV_DC),
> + .driver_data = board_pchlan
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_LM), board_pch2lan },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_V), board_pch2lan },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_LM),
> + .driver_data = board_pch2lan,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_V),
> + .driver_data = board_pch2lan
> + },
>
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_LM), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_V), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_LM), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_V), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_LM2), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_V2), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_LM3), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_V3), board_pch_lpt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM2), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V2), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LBG_I219_LM3), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM4), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V4), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM5), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V5), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_LM6), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_V6), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_LM7), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_V7), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_LM8), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V8), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_LM9), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V9), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM10), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V10), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM11), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V11), board_pch_cnp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM12), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V12), board_pch_spt },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM13), board_pch_tgp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V13), board_pch_tgp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM14), board_pch_tgp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V14), board_pch_tgp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM15), board_pch_tgp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V15), board_pch_tgp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM23), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V23), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM16), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM19), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V19), board_pch_adp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V21), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ARL_I219_LM24), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ARL_I219_V24), board_pch_mtp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM25), board_pch_ptp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V25), board_pch_ptp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM27), board_pch_ptp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V27), board_pch_ptp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_LM29), board_pch_ptp },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_V29), board_pch_ptp },
> + {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_LM),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_V),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_LM),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_V),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_LM2),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_V2),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_LM3),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_V3),
> + .driver_data = board_pch_lpt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM2),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V2),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LBG_I219_LM3),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM4),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V4),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM5),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V5),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_LM6),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_V6),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_LM7),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CNP_I219_V7),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_LM8),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V8),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_LM9),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V9),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM10),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V10),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM11),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V11),
> + .driver_data = board_pch_cnp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM12),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V12),
> + .driver_data = board_pch_spt,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM13),
> + .driver_data = board_pch_tgp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V13),
> + .driver_data = board_pch_tgp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM14),
> + .driver_data = board_pch_tgp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V14),
> + .driver_data = board_pch_tgp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM15),
> + .driver_data = board_pch_tgp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V15),
> + .driver_data = board_pch_tgp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM23),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V23),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM16),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V16),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM17),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V17),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_LM22),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_RPL_I219_V22),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_LM19),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ADP_I219_V19),
> + .driver_data = board_pch_adp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_LM18),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_MTP_I219_V18),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM20),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V20),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_LM21),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LNP_I219_V21),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ARL_I219_LM24),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ARL_I219_V24),
> + .driver_data = board_pch_mtp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM25),
> + .driver_data = board_pch_ptp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V25),
> + .driver_data = board_pch_ptp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_LM27),
> + .driver_data = board_pch_ptp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_PTP_I219_V27),
> + .driver_data = board_pch_ptp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_LM29),
> + .driver_data = board_pch_ptp,
> + }, {
> + PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_NVL_I219_V29),
> + .driver_data = board_pch_ptp
> + },
>
> - { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */
> + { } /* terminate list */
> };
> MODULE_DEVICE_TABLE(pci, e1000_pci_tbl);
>
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> index d75b8a50413d..f5b4d062709a 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> @@ -21,12 +21,12 @@ static const struct fm10k_info *fm10k_info_tbl[] = {
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id fm10k_pci_tbl[] = {
> - { PCI_VDEVICE(INTEL, FM10K_DEV_ID_PF), fm10k_device_pf },
> - { PCI_VDEVICE(INTEL, FM10K_DEV_ID_SDI_FM10420_QDA2), fm10k_device_pf },
> - { PCI_VDEVICE(INTEL, FM10K_DEV_ID_SDI_FM10420_DA2), fm10k_device_pf },
> - { PCI_VDEVICE(INTEL, FM10K_DEV_ID_VF), fm10k_device_vf },
> + { PCI_VDEVICE(INTEL, FM10K_DEV_ID_PF), .driver_data = fm10k_device_pf },
> + { PCI_VDEVICE(INTEL, FM10K_DEV_ID_SDI_FM10420_QDA2), .driver_data = fm10k_device_pf },
> + { PCI_VDEVICE(INTEL, FM10K_DEV_ID_SDI_FM10420_DA2), .driver_data = fm10k_device_pf },
> + { PCI_VDEVICE(INTEL, FM10K_DEV_ID_VF), .driver_data = fm10k_device_vf },
> /* required last entry */
> - { 0, }
> + { }
> };
> MODULE_DEVICE_TABLE(pci, fm10k_pci_tbl);
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 028bd500603a..93faada2d328 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -63,40 +63,43 @@ static bool i40e_is_total_port_shutdown_enabled(struct i40e_pf *pf);
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id i40e_pci_tbl[] = {
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_XL710), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_QEMU), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_B), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_C), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_A), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_B), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_C), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_1G_BASE_T_BC), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T4), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T_BC), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_SFP), 0},
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_XL710) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_QEMU) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_B) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_C) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_A) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_B) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_C) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_1G_BASE_T_BC) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T4) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T_BC) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_SFP) },
> /*
> * This ID conflicts with ipw2200, but the devices can be differentiated
> * because i40e devices use PCI_CLASS_NETWORK_ETHERNET and ipw2200
> * devices use PCI_CLASS_NETWORK_OTHER.
> */
> - {PCI_DEVICE(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_10G_B),
> - PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_X722), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_X722), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_1G_BASE_T_X722), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T_X722), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_I_X722), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722_A), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2_A), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_X710_N3000), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_XXV710_N3000), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_25G_B), 0},
> - {PCI_VDEVICE(INTEL, I40E_DEV_ID_25G_SFP28), 0},
> + {
> + PCI_DEVICE(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_10G_B),
> + .class = PCI_CLASS_NETWORK_ETHERNET << 8,
> + .class_mask = 0xffff00,
> + },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_X722) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_X722) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_1G_BASE_T_X722) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T_X722) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_I_X722) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722_A) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2_A) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_X710_N3000) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_XXV710_N3000) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_25G_B) },
> + { PCI_VDEVICE(INTEL, I40E_DEV_ID_25G_SFP28) },
> /* required last entry */
> - {0, }
> + { }
> };
> MODULE_DEVICE_TABLE(pci, i40e_pci_tbl);
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 3c1465cf0515..f00692f1e459 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -36,12 +36,12 @@ static const char iavf_copyright[] =
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id iavf_pci_tbl[] = {
> - {PCI_VDEVICE(INTEL, IAVF_DEV_ID_VF), 0},
> - {PCI_VDEVICE(INTEL, IAVF_DEV_ID_VF_HV), 0},
> - {PCI_VDEVICE(INTEL, IAVF_DEV_ID_X722_VF), 0},
> - {PCI_VDEVICE(INTEL, IAVF_DEV_ID_ADAPTIVE_VF), 0},
> + { PCI_VDEVICE(INTEL, IAVF_DEV_ID_VF) },
> + { PCI_VDEVICE(INTEL, IAVF_DEV_ID_VF_HV) },
> + { PCI_VDEVICE(INTEL, IAVF_DEV_ID_X722_VF) },
> + { PCI_VDEVICE(INTEL, IAVF_DEV_ID_ADAPTIVE_VF) },
> /* required last entry */
> - {0, }
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, iavf_pci_tbl);
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index ce91dda00ec0..49d46670695f 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -63,40 +63,40 @@ static const struct pci_device_id igb_pci_tbl[] = {
> { PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_BACKPLANE_1GBPS) },
> { PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_SGMII) },
> { PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_BACKPLANE_2_5GBPS) },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I211_COPPER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_FIBER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SGMII), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER_FLASHLESS), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES_FLASHLESS), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_COPPER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_FIBER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SERDES), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SGMII), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_QUAD_FIBER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SGMII), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER_DUAL), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SGMII), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SERDES), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_BACKPLANE), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SFP), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS_SERDES), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES_QUAD), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER_ET2), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575GB_QUAD_COPPER), board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I211_COPPER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_FIBER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SGMII), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER_FLASHLESS), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES_FLASHLESS), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_COPPER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_FIBER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SERDES), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SGMII), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_QUAD_FIBER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SGMII), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER_DUAL), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SGMII), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SERDES), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_BACKPLANE), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_DH89XXCC_SFP), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_NS_SERDES), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES_QUAD), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER_ET2), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), .driver_data = board_82575 },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575GB_QUAD_COPPER), .driver_data = board_82575 },
> /* required last entry */
> - {0, }
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, igb_pci_tbl);
> diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
> index 5d04541072b3..0a3d0a1cba43 100644
> --- a/drivers/net/ethernet/intel/igbvf/netdev.c
> +++ b/drivers/net/ethernet/intel/igbvf/netdev.c
> @@ -2937,8 +2937,8 @@ static const struct pci_error_handlers igbvf_err_handler = {
> };
>
> static const struct pci_device_id igbvf_pci_tbl[] = {
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_VF), board_vf },
> - { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_VF), board_i350_vf },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_VF), .driver_data = board_vf },
> + { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_VF), .driver_data = board_i350_vf },
> { } /* terminate list */
> };
> MODULE_DEVICE_TABLE(pci, igbvf_pci_tbl);
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 8ac16808023c..89b9e1d00fc7 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -47,24 +47,24 @@ static const struct igc_info *igc_info_tbl[] = {
> };
>
> static const struct pci_device_id igc_pci_tbl[] = {
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_LM), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_V), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_I), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I220_V), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_K), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_K2), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_K), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_LMVP), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_LMVP), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_IT), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_LM), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_V), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_IT), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I221_V), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_BLANK_NVM), board_base },
> - { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_BLANK_NVM), board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_LM), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_V), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_I), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I220_V), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_K), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_K2), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_K), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_LMVP), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_LMVP), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_IT), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_LM), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_V), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_IT), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I221_V), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I226_BLANK_NVM), .driver_data = board_base },
> + { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_BLANK_NVM), .driver_data = board_base },
> /* required last entry */
> - {0, }
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, igc_pci_tbl);
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 2646ee6f295f..730a35658c76 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -88,60 +88,60 @@ static const struct ixgbe_info *ixgbe_info_tbl[] = {
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id ixgbe_pci_tbl[] = {
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_DUAL_PORT), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT2), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_CX4_DUAL_PORT), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_DA_DUAL_PORT), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_XF_LR), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_SFP_LOM), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_BX), board_82598 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_XAUI_LOM), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KR), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_EM), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4_MEZZ), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_BACKPLANE_FCOE), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_FCOE), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_T3_LOM), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_COMBO_BACKPLANE), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T), board_X540 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF2), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_LS), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_QSFP_SF_QP), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599EN_SFP), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF_QP), board_82599 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T1), board_X540 },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550T), board_X550},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550T1), board_X550},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_KX4), board_X550EM_x},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_XFI), board_X550EM_x},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_KR), board_X550EM_x},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_10G_T), board_X550EM_x},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_SFP), board_X550EM_x},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_1G_T), board_x550em_x_fw},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_KR), board_x550em_a },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_KR_L), board_x550em_a },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SFP_N), board_x550em_a },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SGMII), board_x550em_a },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SGMII_L), board_x550em_a },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_10G_T), board_x550em_a},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SFP), board_x550em_a },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_1G_T), board_x550em_a_fw },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_1G_T_L), board_x550em_a_fw },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_BACKPLANE), board_e610},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_SFP), board_e610},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_10G_T), board_e610},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_2_5G_T), board_e610},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_SGMII), board_e610},
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_DUAL_PORT), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT2), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_CX4_DUAL_PORT), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_DA_DUAL_PORT), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_XF_LR), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_SFP_LOM), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_BX), .driver_data = board_82598 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_XAUI_LOM), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KR), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_EM), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4_MEZZ), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_BACKPLANE_FCOE), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_FCOE), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_T3_LOM), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_COMBO_BACKPLANE), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T), .driver_data = board_X540 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF2), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_LS), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_QSFP_SF_QP), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599EN_SFP), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF_QP), .driver_data = board_82599 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T1), .driver_data = board_X540 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550T), .driver_data = board_X550 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550T1), .driver_data = board_X550 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_KX4), .driver_data = board_X550EM_x },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_XFI), .driver_data = board_X550EM_x },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_KR), .driver_data = board_X550EM_x },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_10G_T), .driver_data = board_X550EM_x },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_SFP), .driver_data = board_X550EM_x },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_1G_T), .driver_data = board_x550em_x_fw },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_KR), .driver_data = board_x550em_a },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_KR_L), .driver_data = board_x550em_a },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SFP_N), .driver_data = board_x550em_a },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SGMII), .driver_data = board_x550em_a },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SGMII_L), .driver_data = board_x550em_a },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_10G_T), .driver_data = board_x550em_a },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SFP), .driver_data = board_x550em_a },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_1G_T), .driver_data = board_x550em_a_fw },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_1G_T_L), .driver_data = board_x550em_a_fw },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_BACKPLANE), .driver_data = board_e610 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_SFP), .driver_data = board_e610 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_10G_T), .driver_data = board_e610 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_2_5G_T), .driver_data = board_e610 },
> + { PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_SGMII), .driver_data = board_e610 },
> /* required last entry */
> - {0, }
> + { }
> };
> MODULE_DEVICE_TABLE(pci, ixgbe_pci_tbl);
>
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> index 42f89a179a3f..b5d15c1f0d4f 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> @@ -64,20 +64,43 @@ static const struct ixgbevf_info *ixgbevf_info_tbl[] = {
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id ixgbevf_pci_tbl[] = {
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_VF), board_82599_vf },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_VF_HV), board_82599_vf_hv },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540_VF), board_X540_vf },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540_VF_HV), board_X540_vf_hv },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550_VF), board_X550_vf },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550_VF_HV), board_X550_vf_hv },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_VF), board_X550EM_x_vf },
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_VF_HV), board_X550EM_x_vf_hv},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_VF), board_x550em_a_vf },
> - {PCI_VDEVICE_SUB(INTEL, IXGBE_DEV_ID_E610_VF, PCI_ANY_ID,
> - IXGBE_SUBDEV_ID_E610_VF_HV), board_e610_vf_hv},
> - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_VF), board_e610_vf},
> + {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_VF),
> + .driver_data = board_82599_vf,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_VF_HV),
> + .driver_data = board_82599_vf_hv,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540_VF),
> + .driver_data = board_X540_vf,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540_VF_HV),
> + .driver_data = board_X540_vf_hv,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550_VF),
> + .driver_data = board_X550_vf,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550_VF_HV),
> + .driver_data = board_X550_vf_hv,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_VF),
> + .driver_data = board_X550EM_x_vf,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_VF_HV),
> + .driver_data = board_X550EM_x_vf_hv
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_VF),
> + .driver_data = board_x550em_a_vf,
> + }, {
> + PCI_VDEVICE_SUB(INTEL, IXGBE_DEV_ID_E610_VF,
> + PCI_ANY_ID, IXGBE_SUBDEV_ID_E610_VF_HV),
> + .driver_data = board_e610_vf_hv,
> + }, {
> + PCI_VDEVICE(INTEL, IXGBE_DEV_ID_E610_VF),
> + .driver_data = board_e610_vf,
> + },
> /* required last entry */
> - {0, }
> + { }
> };
> MODULE_DEVICE_TABLE(pci, ixgbevf_pci_tbl);
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index e6b7e75894ff..4fe6dbf0942f 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -4274,9 +4274,9 @@ int mlx4_restart_one(struct pci_dev *pdev)
> return mlx4_restart_one_up(pdev, false, NULL);
> }
>
> -#define MLX_SP(id) { PCI_VDEVICE(MELLANOX, id), MLX4_PCI_DEV_FORCE_SENSE_PORT }
> -#define MLX_VF(id) { PCI_VDEVICE(MELLANOX, id), MLX4_PCI_DEV_IS_VF }
> -#define MLX_GN(id) { PCI_VDEVICE(MELLANOX, id), 0 }
> +#define MLX_SP(id) { PCI_VDEVICE(MELLANOX, id), .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT }
> +#define MLX_VF(id) { PCI_VDEVICE(MELLANOX, id), .driver_data = MLX4_PCI_DEV_IS_VF }
> +#define MLX_GN(id) { PCI_VDEVICE(MELLANOX, id), .driver_data = 0 }
>
> static const struct pci_device_id mlx4_pci_table[] = {
> #ifdef CONFIG_MLX4_CORE_GEN2
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> index 74827e8ca125..ff450269ce37 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> @@ -2203,19 +2203,26 @@ static int mlx5_resume(struct pci_dev *pdev)
>
> static const struct pci_device_id mlx5_core_pci_table[] = {
> { PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_CONNECTIB) },
> - { PCI_VDEVICE(MELLANOX, 0x1012), MLX5_PCI_DEV_IS_VF}, /* Connect-IB VF */
> + { PCI_VDEVICE(MELLANOX, 0x1012),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* Connect-IB VF */
> { PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_CONNECTX4) },
> - { PCI_VDEVICE(MELLANOX, 0x1014), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4 VF */
> + { PCI_VDEVICE(MELLANOX, 0x1014),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* ConnectX-4 VF */
> { PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_CONNECTX4_LX) },
> - { PCI_VDEVICE(MELLANOX, 0x1016), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4LX VF */
> + { PCI_VDEVICE(MELLANOX, 0x1016),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* ConnectX-4LX VF */
> { PCI_VDEVICE(MELLANOX, 0x1017) }, /* ConnectX-5, PCIe 3.0 */
> - { PCI_VDEVICE(MELLANOX, 0x1018), MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 VF */
> + { PCI_VDEVICE(MELLANOX, 0x1018),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* ConnectX-5 VF */
> { PCI_VDEVICE(MELLANOX, 0x1019) }, /* ConnectX-5 Ex */
> - { PCI_VDEVICE(MELLANOX, 0x101a), MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 Ex VF */
> + { PCI_VDEVICE(MELLANOX, 0x101a),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* ConnectX-5 Ex VF */
> { PCI_VDEVICE(MELLANOX, 0x101b) }, /* ConnectX-6 */
> - { PCI_VDEVICE(MELLANOX, 0x101c), MLX5_PCI_DEV_IS_VF}, /* ConnectX-6 VF */
> + { PCI_VDEVICE(MELLANOX, 0x101c),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* ConnectX-6 VF */
> { PCI_VDEVICE(MELLANOX, 0x101d) }, /* ConnectX-6 Dx */
> - { PCI_VDEVICE(MELLANOX, 0x101e), MLX5_PCI_DEV_IS_VF}, /* ConnectX Family mlx5Gen Virtual Function */
> + { PCI_VDEVICE(MELLANOX, 0x101e),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* ConnectX Family mlx5Gen Virtual Function */
> { PCI_VDEVICE(MELLANOX, 0x101f) }, /* ConnectX-6 LX */
> { PCI_VDEVICE(MELLANOX, 0x1021) }, /* ConnectX-7 */
> { PCI_VDEVICE(MELLANOX, 0x1023) }, /* ConnectX-8 */
> @@ -2223,11 +2230,12 @@ static const struct pci_device_id mlx5_core_pci_table[] = {
> { PCI_VDEVICE(MELLANOX, 0x1027) }, /* ConnectX-10 */
> { PCI_VDEVICE(MELLANOX, 0x2101) }, /* ConnectX-10 NVLink-C2C */
> { PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */
> - { PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF}, /* BlueField integrated ConnectX-5 network controller VF */
> + { PCI_VDEVICE(MELLANOX, 0xa2d3),
> + .driver_data = MLX5_PCI_DEV_IS_VF }, /* BlueField integrated ConnectX-5 network controller VF */
> { PCI_VDEVICE(MELLANOX, 0xa2d6) }, /* BlueField-2 integrated ConnectX-6 Dx network controller */
> { PCI_VDEVICE(MELLANOX, 0xa2dc) }, /* BlueField-3 integrated ConnectX-7 network controller */
> { PCI_VDEVICE(MELLANOX, 0xa2df) }, /* BlueField-4 integrated ConnectX-8 network controller */
> - { 0, }
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, mlx5_core_pci_table);
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> index 3a65420fa1ad..1aaa75b47fe3 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
> @@ -5277,8 +5277,8 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *nb,
> }
>
> static const struct pci_device_id mlxsw_sp1_pci_id_table[] = {
> - {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM), 0},
> - {0, },
> + {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM) },
> + { },
> };
>
> static struct pci_driver mlxsw_sp1_pci_driver = {
> @@ -5287,8 +5287,8 @@ static struct pci_driver mlxsw_sp1_pci_driver = {
> };
>
> static const struct pci_device_id mlxsw_sp2_pci_id_table[] = {
> - {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM2), 0},
> - {0, },
> + {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM2) },
> + { },
> };
>
> static struct pci_driver mlxsw_sp2_pci_driver = {
> @@ -5297,8 +5297,8 @@ static struct pci_driver mlxsw_sp2_pci_driver = {
> };
>
> static const struct pci_device_id mlxsw_sp3_pci_id_table[] = {
> - {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM3), 0},
> - {0, },
> + {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM3) },
> + { },
> };
>
> static struct pci_driver mlxsw_sp3_pci_driver = {
> @@ -5307,8 +5307,8 @@ static struct pci_driver mlxsw_sp3_pci_driver = {
> };
>
> static const struct pci_device_id mlxsw_sp4_pci_id_table[] = {
> - {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM4), 0},
> - {0, },
> + {PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_SPECTRUM4) },
> + { },
> };
>
> static struct pci_driver mlxsw_sp4_pci_driver = {
> diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
> index 26557cd32008..773fdd215a15 100644
> --- a/drivers/net/ethernet/micrel/ksz884x.c
> +++ b/drivers/net/ethernet/micrel/ksz884x.c
> @@ -6839,11 +6839,9 @@ static int __maybe_unused pcidev_suspend(struct device *dev_d)
> static char pcidev_name[] = "ksz884xp";
>
> static const struct pci_device_id pcidev_table[] = {
> - { PCI_VENDOR_ID_MICREL_KS, 0x8841,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
> - { PCI_VENDOR_ID_MICREL_KS, 0x8842,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
> - { 0 }
> + { PCI_VDEVICE(MICREL_KS, 0x8841) },
> + { PCI_VDEVICE(MICREL_KS, 0x8842) },
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, pcidev_table);
> diff --git a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> index 316f941629d4..70a2b0082ba8 100644
> --- a/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> +++ b/drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c
> @@ -17,12 +17,12 @@ static const char rnpgbe_driver_name[] = "rnpgbe";
> * private_data (used for different hw chip) }
> */
> static struct pci_device_id rnpgbe_pci_tbl[] = {
> - { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N210), board_n210 },
> - { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N210L), board_n210 },
> - { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N500_DUAL_PORT), board_n500 },
> - { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N500_QUAD_PORT), board_n500 },
> + { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N210), .driver_data = board_n210 },
> + { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N210L), .driver_data = board_n210 },
> + { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N500_DUAL_PORT), .driver_data = board_n500 },
> + { PCI_VDEVICE(MUCSE, RNPGBE_DEVICE_ID_N500_QUAD_PORT), .driver_data = board_n500 },
> /* required last entry */
> - {0, },
> + { },
> };
>
> /**
> diff --git a/drivers/net/ethernet/natsemi/natsemi.c b/drivers/net/ethernet/natsemi/natsemi.c
> index b253734dbc80..35a63b78880b 100644
> --- a/drivers/net/ethernet/natsemi/natsemi.c
> +++ b/drivers/net/ethernet/natsemi/natsemi.c
> @@ -248,8 +248,8 @@ static struct {
> };
>
> static const struct pci_device_id natsemi_pci_tbl[] = {
> - { PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 },
> - { PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
> + { PCI_VDEVICE_SUB(NS, 0x0020, 0x12d9, 0x000c), .driver_data = 0 },
> + { PCI_VDEVICE(NS, 0x0020), .driver_data = 1 },
> { } /* terminate list */
> };
> MODULE_DEVICE_TABLE(pci, natsemi_pci_tbl);
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c
> index 48390b2fd44d..e8e4b84d505a 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c
> @@ -33,39 +33,56 @@
> static const char nfp_driver_name[] = "nfp";
>
> static const struct pci_device_id nfp_pci_device_ids[] = {
> - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP3800,
> - PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP3800,
> + {
> + PCI_VDEVICE_SUB(NETRONOME, PCI_DEVICE_ID_NFP3800,
> + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP3800,
> + }, {
> + PCI_VDEVICE_SUB(NETRONOME, PCI_DEVICE_ID_NFP4000,
> + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000,
> + }, {
> + PCI_VDEVICE_SUB(NETRONOME, PCI_DEVICE_ID_NFP5000,
> + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000,
> + }, {
> + PCI_VDEVICE_SUB(NETRONOME, PCI_DEVICE_ID_NFP6000,
> + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000,
> + }, {
> + PCI_VDEVICE_SUB(CORIGINE, PCI_DEVICE_ID_NFP3800,
> + PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP3800,
> + }, {
> + PCI_VDEVICE_SUB(CORIGINE, PCI_DEVICE_ID_NFP4000,
> + PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000,
> + }, {
> + PCI_VDEVICE_SUB(CORIGINE, PCI_DEVICE_ID_NFP5000,
> + PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000,
> + }, {
> + PCI_VDEVICE_SUB(CORIGINE, PCI_DEVICE_ID_NFP6000,
> + PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000,
> },
> - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP4000,
> - PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000,
> - },
> - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP5000,
> - PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000,
> - },
> - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP6000,
> - PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000,
> - },
> - { PCI_VENDOR_ID_CORIGINE, PCI_DEVICE_ID_NFP3800,
> - PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP3800,
> - },
> - { PCI_VENDOR_ID_CORIGINE, PCI_DEVICE_ID_NFP4000,
> - PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000,
> - },
> - { PCI_VENDOR_ID_CORIGINE, PCI_DEVICE_ID_NFP5000,
> - PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000,
> - },
> - { PCI_VENDOR_ID_CORIGINE, PCI_DEVICE_ID_NFP6000,
> - PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000,
> - },
> - { 0, } /* Required last entry. */
> + { } /* Required last entry. */
> };
> MODULE_DEVICE_TABLE(pci, nfp_pci_device_ids);
>
> diff --git a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c
> index b5646c884371..cf557e0ce011 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c
> @@ -38,23 +38,32 @@ struct nfp_net_vf {
> static const char nfp_net_driver_name[] = "nfp_netvf";
>
> static const struct pci_device_id nfp_netvf_pci_device_ids[] = {
> - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP3800_VF,
> - PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP3800_VF,
> + {
> + PCI_VDEVICE_SUB(NETRONOME, PCI_DEVICE_ID_NFP3800_VF,
> + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP3800_VF,
> + }, {
> + PCI_VDEVICE_SUB(NETRONOME, PCI_DEVICE_ID_NFP6000_VF,
> + PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000_VF,
> + }, {
> + PCI_VDEVICE_SUB(CORIGINE, PCI_DEVICE_ID_NFP3800_VF,
> + PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP3800_VF,
> + }, {
> + PCI_VDEVICE_SUB(CORIGINE, PCI_DEVICE_ID_NFP6000_VF,
> + PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID),
> + .class = PCI_ANY_ID,
> + .class_mask = 0,
> + .driver_data = NFP_DEV_NFP6000_VF,
> },
> - { PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP6000_VF,
> - PCI_VENDOR_ID_NETRONOME, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000_VF,
> - },
> - { PCI_VENDOR_ID_CORIGINE, PCI_DEVICE_ID_NFP3800_VF,
> - PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP3800_VF,
> - },
> - { PCI_VENDOR_ID_CORIGINE, PCI_DEVICE_ID_NFP6000_VF,
> - PCI_VENDOR_ID_CORIGINE, PCI_ANY_ID,
> - PCI_ANY_ID, 0, NFP_DEV_NFP6000_VF,
> - },
> - { 0, } /* Required last entry. */
> + { } /* Required last entry. */
> };
> MODULE_DEVICE_TABLE(pci, nfp_netvf_pci_device_ids);
>
> diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
> index 39842eb73bc3..cb0ae0650905 100644
> --- a/drivers/net/ethernet/qlogic/qede/qede_main.c
> +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
> @@ -76,20 +76,20 @@ enum qede_pci_private {
> };
>
> static const struct pci_device_id qede_pci_tbl[] = {
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_40), QEDE_PRIVATE_PF},
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_10), QEDE_PRIVATE_PF},
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_MF), QEDE_PRIVATE_PF},
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_100), QEDE_PRIVATE_PF},
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_50), QEDE_PRIVATE_PF},
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_25), QEDE_PRIVATE_PF},
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_40), .driver_data = QEDE_PRIVATE_PF },
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_10), .driver_data = QEDE_PRIVATE_PF },
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_MF), .driver_data = QEDE_PRIVATE_PF },
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_100), .driver_data = QEDE_PRIVATE_PF },
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_50), .driver_data = QEDE_PRIVATE_PF },
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_25), .driver_data = QEDE_PRIVATE_PF },
> #ifdef CONFIG_QED_SRIOV
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_IOV), QEDE_PRIVATE_VF},
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_57980S_IOV), .driver_data = QEDE_PRIVATE_VF },
> #endif
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_AH), QEDE_PRIVATE_PF},
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_AH), .driver_data = QEDE_PRIVATE_PF },
> #ifdef CONFIG_QED_SRIOV
> - {PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_AH_IOV), QEDE_PRIVATE_VF},
> + { PCI_VDEVICE(QLOGIC, PCI_DEVICE_ID_AH_IOV), .driver_data = QEDE_PRIVATE_VF },
> #endif
> - { 0 }
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, qede_pci_tbl);
> diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
> index a8532ebd42ec..8241bcf76664 100644
> --- a/drivers/net/ethernet/realtek/8139too.c
> +++ b/drivers/net/ethernet/realtek/8139too.c
> @@ -235,44 +235,44 @@ static const struct {
>
>
> static const struct pci_device_id rtl8139_pci_tbl[] = {
> - {0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x13d1, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1259, 0xa117, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1259, 0xa11e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1432, 0x9130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x02ac, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x018a, 0x0106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x126c, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x1743, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x021b, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> - {0x16ec, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> + { PCI_DEVICE(0x10ec, 0x8139), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x10ec, 0x8138), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1113, 0x1211), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1500, 0x1360), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x4033, 0x1360), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1186, 0x1300), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1186, 0x1340), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x13d1, 0xab06), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1259, 0xa117), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1259, 0xa11e), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x14ea, 0xab06), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x14ea, 0xab07), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x11db, 0x1234), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1432, 0x9130), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x02ac, 0x1012), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x018a, 0x0106), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x126c, 0x1211), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x1743, 0x8139), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x021b, 0x8139), .driver_data = RTL8139 },
> + { PCI_DEVICE(0x16ec, 0xab06), .driver_data = RTL8139 },
>
> #ifdef CONFIG_SH_SECUREEDGE5410
> /* Bogus 8139 silicon reports 8129 without external PROM :-( */
> - {0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> + { PCI_DEVICE(0x10ec, 0x8129), .driver_data = RTL8139 },
> #endif
> #ifdef CONFIG_8139TOO_8129
> - {0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8129 },
> + { PCI_DEVICE(0x10ec, 0x8129), .driver_data = RTL8129 },
> #endif
>
> /* some crazy cards report invalid vendor ids like
> * 0x0001 here. The other ids are valid and constant,
> * so we simply don't match on the main vendor id.
> */
> - {PCI_ANY_ID, 0x8139, 0x10ec, 0x8139, 0, 0, RTL8139 },
> - {PCI_ANY_ID, 0x8139, 0x1186, 0x1300, 0, 0, RTL8139 },
> - {PCI_ANY_ID, 0x8139, 0x13d1, 0xab06, 0, 0, RTL8139 },
> + { PCI_DEVICE_SUB(PCI_ANY_ID, 0x8139, 0x10ec, 0x8139), .driver_data = RTL8139 },
> + { PCI_DEVICE_SUB(PCI_ANY_ID, 0x8139, 0x1186, 0x1300), .driver_data = RTL8139 },
> + { PCI_DEVICE_SUB(PCI_ANY_ID, 0x8139, 0x13d1, 0xab06), .driver_data = RTL8139 },
>
> - {0,}
> + { }
> };
> MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl);
>
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index 791277e750ba..ec4fc21fa21f 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -229,7 +229,7 @@ static const struct pci_device_id rtl8169_pci_tbl[] = {
> { PCI_VDEVICE(REALTEK, 0x2502) },
> { PCI_VDEVICE(REALTEK, 0x2600) },
> { PCI_VDEVICE(REALTEK, 0x8129) },
> - { PCI_VDEVICE(REALTEK, 0x8136), RTL_CFG_NO_GBIT },
> + { PCI_VDEVICE(REALTEK, 0x8136), .driver_data = RTL_CFG_NO_GBIT },
> { PCI_VDEVICE(REALTEK, 0x8161) },
> { PCI_VDEVICE(REALTEK, 0x8162) },
> { PCI_VDEVICE(REALTEK, 0x8167) },
> @@ -240,15 +240,15 @@ static const struct pci_device_id rtl8169_pci_tbl[] = {
> { PCI_VDEVICE(DLINK, 0x4302) },
> { PCI_VDEVICE(AT, 0xc107) },
> { PCI_VDEVICE(USR, 0x0116) },
> - { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0024 },
> - { 0x0001, 0x8168, PCI_ANY_ID, 0x2410 },
> + { PCI_VDEVICE_SUB(LINKSYS, 0x1032, PCI_ANY_ID, 0x0024) },
> + { PCI_DEVICE_SUB(0x0001, 0x8168, PCI_ANY_ID, 0x2410) },
> { PCI_VDEVICE(REALTEK, 0x8125) },
> { PCI_VDEVICE(REALTEK, 0x8126) },
> { PCI_VDEVICE(REALTEK, 0x8127) },
> { PCI_VDEVICE(REALTEK, 0x3000) },
> { PCI_VDEVICE(REALTEK, 0x5000) },
> { PCI_VDEVICE(REALTEK, 0x0e10) },
> - {}
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
> diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
> index ff6ca7b2cd4f..84a55f2b48ff 100644
> --- a/drivers/net/ethernet/rocker/rocker_main.c
> +++ b/drivers/net/ethernet/rocker/rocker_main.c
> @@ -40,8 +40,8 @@
> static const char rocker_driver_name[] = "rocker";
>
> static const struct pci_device_id rocker_pci_id_table[] = {
> - {PCI_VDEVICE(REDHAT, PCI_DEVICE_ID_REDHAT_ROCKER), 0},
> - {0, }
> + { PCI_VDEVICE(REDHAT, PCI_DEVICE_ID_REDHAT_ROCKER) },
> + { }
> };
>
> struct rocker_wait {
> diff --git a/drivers/net/ethernet/sis/sis190.c b/drivers/net/ethernet/sis/sis190.c
> index 12ddea514910..ed5276d492b9 100644
> --- a/drivers/net/ethernet/sis/sis190.c
> +++ b/drivers/net/ethernet/sis/sis190.c
> @@ -331,9 +331,9 @@ static const struct {
> };
>
> static const struct pci_device_id sis190_pci_tbl[] = {
> - { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
> - { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
> - { 0, },
> + { PCI_VDEVICE(SI, 0x0190), .driver_data = 0 },
> + { PCI_VDEVICE(SI, 0x0191), .driver_data = 1 },
> + { },
> };
>
> MODULE_DEVICE_TABLE(pci, sis190_pci_tbl);
> diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
> index 1349ef50cd26..6e9afd9042f7 100644
> --- a/drivers/net/ethernet/sis/sis900.c
> +++ b/drivers/net/ethernet/sis/sis900.c
> @@ -104,11 +104,11 @@ static const char * card_names[] = {
> };
>
> static const struct pci_device_id sis900_pci_tbl[] = {
> - {PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_900,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_900},
> - {PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7016,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, SIS_7016},
> - {0,}
> + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_900),
> + .driver_data = SIS_900 },
> + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_7016),
> + .driver_data = SIS_7016 },
> + { }
> };
> MODULE_DEVICE_TABLE (pci, sis900_pci_tbl);
>
> diff --git a/drivers/net/ethernet/smsc/epic100.c b/drivers/net/ethernet/smsc/epic100.c
> index 389659db06a8..60538b7fe684 100644
> --- a/drivers/net/ethernet/smsc/epic100.c
> +++ b/drivers/net/ethernet/smsc/epic100.c
> @@ -166,11 +166,19 @@ static const struct epic_chip_info pci_id_tbl[] = {
>
>
> static const struct pci_device_id epic_pci_tbl[] = {
> - { 0x10B8, 0x0005, 0x1092, 0x0AB4, 0, 0, SMSC_83C170_0 },
> - { 0x10B8, 0x0005, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMSC_83C170 },
> - { 0x10B8, 0x0006, PCI_ANY_ID, PCI_ANY_ID,
> - PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, SMSC_83C175 },
> - { 0,}
> + {
> + PCI_DEVICE_SUB(0x10B8, 0x0005, 0x1092, 0x0AB4),
> + .driver_data = SMSC_83C170_0,
> + }, {
> + PCI_DEVICE(0x10B8, 0x0005),
> + .driver_data = SMSC_83C170,
> + }, {
> + PCI_DEVICE(0x10B8, 0x0006),
> + .class = PCI_CLASS_NETWORK_ETHERNET << 8,
> + .class_mask = 0xffff00,
> + .driver_data = SMSC_83C175,
> + },
> + { }
> };
> MODULE_DEVICE_TABLE (pci, epic_pci_tbl);
>
> diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
> index fe00e7dd3fe4..823870c999bf 100644
> --- a/drivers/net/ethernet/sun/cassini.c
> +++ b/drivers/net/ethernet/sun/cassini.c
> @@ -218,11 +218,9 @@ static u16 link_modes[] = {
> };
>
> static const struct pci_device_id cas_pci_tbl[] = {
> - { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_CASSINI,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SATURN,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { 0, }
> + { PCI_VDEVICE(SUN, PCI_DEVICE_ID_SUN_CASSINI) },
> + { PCI_VDEVICE(NS, PCI_DEVICE_ID_NS_SATURN) },
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, cas_pci_tbl);
> diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
> index 8e69d917d827..234ffc3c6a61 100644
> --- a/drivers/net/ethernet/sun/sungem.c
> +++ b/drivers/net/ethernet/sun/sungem.c
> @@ -85,8 +85,7 @@ MODULE_LICENSE("GPL");
> #define GEM_MODULE_NAME "gem"
>
> static const struct pci_device_id gem_pci_tbl[] = {
> - { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_GEM,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> + { PCI_VDEVICE(SUN, PCI_DEVICE_ID_SUN_GEM) },
>
> /* These models only differ from the original GEM in
> * that their tx/rx fifos are of a different size and
> @@ -95,21 +94,14 @@ static const struct pci_device_id gem_pci_tbl[] = {
> * Apple's GMAC does support gigabit on machines with
> * the BCM54xx PHYs. -BenH
> */
> - { PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_RIO_GEM,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_GMAC,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_GMACP,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_GMAC2,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_GMAC,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_SUNGEM,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID2_GMAC,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
> - {0, }
> + { PCI_VDEVICE(SUN, PCI_DEVICE_ID_SUN_RIO_GEM) },
> + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_UNI_N_GMAC) },
> + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_UNI_N_GMACP) },
> + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_UNI_N_GMAC2) },
> + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_K2_GMAC) },
> + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_SH_SUNGEM) },
> + { PCI_VDEVICE(APPLE, PCI_DEVICE_ID_APPLE_IPID2_GMAC) },
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, gem_pci_tbl);
> diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
> index a55b0f951181..274a1837025c 100644
> --- a/drivers/net/ethernet/ti/tlan.c
> +++ b/drivers/net/ethernet/ti/tlan.c
> @@ -119,33 +119,20 @@ static struct board {
> };
>
> static const struct pci_device_id tlan_pci_tbl[] = {
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL10,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETFLEX3I,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_THUNDER,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETFLEX3B,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100PI,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100D,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100I,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7 },
> - { PCI_VENDOR_ID_OLICOM, PCI_DEVICE_ID_OLICOM_OC2183,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8 },
> - { PCI_VENDOR_ID_OLICOM, PCI_DEVICE_ID_OLICOM_OC2325,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9 },
> - { PCI_VENDOR_ID_OLICOM, PCI_DEVICE_ID_OLICOM_OC2326,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_NETELLIGENT_10_100_WS_5100,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11 },
> - { PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_NETELLIGENT_10_T2,
> - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12 },
> - { 0,}
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL10), .driver_data = 0 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100), .driver_data = 1 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_NETFLEX3I), .driver_data = 2 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_THUNDER), .driver_data = 3 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_NETFLEX3B), .driver_data = 4 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100PI), .driver_data = 5 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100D), .driver_data = 6 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_COMPAQ_NETEL100I), .driver_data = 7 },
> + { PCI_VDEVICE(OLICOM, PCI_DEVICE_ID_OLICOM_OC2183), .driver_data = 8 },
> + { PCI_VDEVICE(OLICOM, PCI_DEVICE_ID_OLICOM_OC2325), .driver_data = 9 },
> + { PCI_VDEVICE(OLICOM, PCI_DEVICE_ID_OLICOM_OC2326), .driver_data = 10 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_NETELLIGENT_10_100_WS_5100), .driver_data = 11 },
> + { PCI_VDEVICE(COMPAQ, PCI_DEVICE_ID_NETELLIGENT_10_T2), .driver_data = 12 },
> + { }
> };
> MODULE_DEVICE_TABLE(pci, tlan_pci_tbl);
>
> diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> index d8e3827a8b1f..d51d8db95a76 100644
> --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> @@ -30,20 +30,20 @@ char ngbe_driver_name[] = "ngbe";
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id ngbe_pci_tbl[] = {
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL_W), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A2), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A2S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A4), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A4S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL2), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL2S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL4), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL4S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860LC), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A1), 0},
> - { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A1L), 0},
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL_W) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A2) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A2S) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A4) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A4S) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL2) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL2S) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL4) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860AL4S) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860LC) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A1) },
> + { PCI_VDEVICE(WANGXUN, NGBE_DEV_ID_EM_WX1860A1L) },
> /* required last entry */
> - { .device = 0 }
> + { }
> };
>
> /**
> diff --git a/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c b/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c
> index 6ef43adcc425..d79cf8d8484f 100644
> --- a/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c
> +++ b/drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c
> @@ -26,20 +26,20 @@
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id ngbevf_pci_tbl[] = {
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL_W), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A2), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A2S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A4), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A4S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL2), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL2S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL4), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL4S), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860NCSI), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A1), 0},
> - { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL1), 0},
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL_W) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A2) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A2S) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A4) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A4S) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL2) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL2S) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL4) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL4S) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860NCSI) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860A1) },
> + { PCI_VDEVICE(WANGXUN, NGBEVF_DEV_ID_EM_WX1860AL1) },
> /* required last entry */
> - { .device = 0 }
> + { }
> };
>
> static const struct net_device_ops ngbevf_netdev_ops = {
> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> index 8b7c3753bb6a..4c549c2644ab 100644
> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c
> @@ -37,16 +37,16 @@ char txgbe_driver_name[] = "txgbe";
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id txgbe_pci_tbl[] = {
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_SP1000), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_WX1820), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5010), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5110), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5025), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5125), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5040), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5140), 0},
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_SP1000) },
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_WX1820) },
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5010) },
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5110) },
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5025) },
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5125) },
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5040) },
> + { PCI_VDEVICE(WANGXUN, TXGBE_DEV_ID_AML5140) },
> /* required last entry */
> - { .device = 0 }
> + { }
> };
>
> #define DEFAULT_DEBUG_LEVEL_SHIFT 3
> diff --git a/drivers/net/ethernet/wangxun/txgbevf/txgbevf_main.c b/drivers/net/ethernet/wangxun/txgbevf/txgbevf_main.c
> index 37e4ec487afd..8b16b900820a 100644
> --- a/drivers/net/ethernet/wangxun/txgbevf/txgbevf_main.c
> +++ b/drivers/net/ethernet/wangxun/txgbevf/txgbevf_main.c
> @@ -26,16 +26,16 @@
> * Class, Class Mask, private data (not used) }
> */
> static const struct pci_device_id txgbevf_pci_tbl[] = {
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_SP1000), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_WX1820), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML500F), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML510F), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML5024), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML5124), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML503F), 0},
> - { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML513F), 0},
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_SP1000) },
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_WX1820) },
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML500F) },
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML510F) },
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML5024) },
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML5124) },
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML503F) },
> + { PCI_VDEVICE(WANGXUN, TXGBEVF_DEV_ID_AML513F) },
> /* required last entry */
> - { .device = 0 }
> + { }
> };
>
> static const struct net_device_ops txgbevf_netdev_ops = {
> diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
> index 73f393900710..6508c53bdc24 100644
> --- a/drivers/net/wan/farsync.c
> +++ b/drivers/net/wan/farsync.c
> @@ -524,27 +524,21 @@ do { \
> /* PCI ID lookup table
> */
> static const struct pci_device_id fst_pci_dev_id[] = {
> - {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T2P, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, FST_TYPE_T2P},
> + { PCI_VDEVICE(FARSITE, PCI_DEVICE_ID_FARSITE_T2P), .driver_data = FST_TYPE_T2P },
>
> - {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T4P, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, FST_TYPE_T4P},
> + { PCI_VDEVICE(FARSITE, PCI_DEVICE_ID_FARSITE_T4P), .driver_data = FST_TYPE_T4P },
>
> - {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T1U, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, FST_TYPE_T1U},
> + { PCI_VDEVICE(FARSITE, PCI_DEVICE_ID_FARSITE_T1U), .driver_data = FST_TYPE_T1U },
>
> - {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T2U, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, FST_TYPE_T2U},
> + { PCI_VDEVICE(FARSITE, PCI_DEVICE_ID_FARSITE_T2U), .driver_data = FST_TYPE_T2U },
>
> - {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_T4U, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, FST_TYPE_T4U},
> + { PCI_VDEVICE(FARSITE, PCI_DEVICE_ID_FARSITE_T4U), .driver_data = FST_TYPE_T4U },
>
> - {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_TE1, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, FST_TYPE_TE1},
> + { PCI_VDEVICE(FARSITE, PCI_DEVICE_ID_FARSITE_TE1), .driver_data = FST_TYPE_TE1 },
>
> - {PCI_VENDOR_ID_FARSITE, PCI_DEVICE_ID_FARSITE_TE1C, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, FST_TYPE_TE1},
> - {0,} /* End */
> + { PCI_VDEVICE(FARSITE, PCI_DEVICE_ID_FARSITE_TE1C), .driver_data = FST_TYPE_TE1 },
> +
> + { } /* End */
> };
>
> MODULE_DEVICE_TABLE(pci, fst_pci_dev_id);
> diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c
> index 7e57d289b62c..a91564e53caa 100644
> --- a/drivers/net/wan/pc300too.c
> +++ b/drivers/net/wan/pc300too.c
> @@ -461,15 +461,11 @@ static int pc300_pci_init_one(struct pci_dev *pdev,
> }
>
> static const struct pci_device_id pc300_pci_tbl[] = {
> - { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_RX_1, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, 0 },
> - { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_RX_2, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, 0 },
> - { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_TE_1, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, 0 },
> - { PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_PC300_TE_2, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, 0 },
> - { 0, }
> + { PCI_VDEVICE(CYCLADES, PCI_DEVICE_ID_PC300_RX_1) },
> + { PCI_VDEVICE(CYCLADES, PCI_DEVICE_ID_PC300_RX_2) },
> + { PCI_VDEVICE(CYCLADES, PCI_DEVICE_ID_PC300_TE_1) },
> + { PCI_VDEVICE(CYCLADES, PCI_DEVICE_ID_PC300_TE_2) },
> + { }
> };
>
> static struct pci_driver pc300_pci_driver = {
> diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
> index 89f4b4584a33..9503130fd9a8 100644
> --- a/drivers/net/wan/pci200syn.c
> +++ b/drivers/net/wan/pci200syn.c
> @@ -397,9 +397,9 @@ static int pci200_pci_init_one(struct pci_dev *pdev,
> }
>
> static const struct pci_device_id pci200_pci_tbl[] = {
> - { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_PLX,
> - PCI_DEVICE_ID_PLX_PCI200SYN, 0, 0, 0 },
> - { 0, }
> + { PCI_VDEVICE_SUB(PLX, PCI_DEVICE_ID_PLX_9050,
> + PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_PCI200SYN) },
> + { }
> };
>
> static struct pci_driver pci200_pci_driver = {
> diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
> index 3f7707118450..d4da88c77112 100644
> --- a/drivers/net/wan/wanxl.c
> +++ b/drivers/net/wan/wanxl.c
> @@ -806,13 +806,10 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
> }
>
> static const struct pci_device_id wanxl_pci_tbl[] = {
> - { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL100, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, 0 },
> - { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL200, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, 0 },
> - { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL400, PCI_ANY_ID,
> - PCI_ANY_ID, 0, 0, 0 },
> - { 0, }
> + { PCI_VDEVICE(SBE, PCI_DEVICE_ID_SBE_WANXL100) },
> + { PCI_VDEVICE(SBE, PCI_DEVICE_ID_SBE_WANXL200) },
> + { PCI_VDEVICE(SBE, PCI_DEVICE_ID_SBE_WANXL400) },
> + { }
> };
>
> static struct pci_driver wanxl_pci_driver = {
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> index 45b342ea0637..13662aa4b4ea 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> @@ -2708,17 +2708,18 @@ static const struct dev_pm_ops brcmf_pciedrvr_pm = {
>
> #define BRCMF_PCIE_DEVICE(dev_id, fw_vend) \
> { \
> - BRCM_PCIE_VENDOR_ID_BROADCOM, (dev_id), \
> - PCI_ANY_ID, PCI_ANY_ID, \
> - PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, \
> - BRCMF_DRVDATA_ ## fw_vend \
> + PCI_DEVICE(BRCM_PCIE_VENDOR_ID_BROADCOM, (dev_id)), \
> + .class = PCI_CLASS_NETWORK_OTHER << 8, \
> + .class_mask = 0xffff00, \
> + .driver_data = BRCMF_DRVDATA_ ## fw_vend, \
> }
> #define BRCMF_PCIE_DEVICE_SUB(dev_id, subvend, subdev, fw_vend) \
> { \
> - BRCM_PCIE_VENDOR_ID_BROADCOM, (dev_id), \
> - (subvend), (subdev), \
> - PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, \
> - BRCMF_DRVDATA_ ## fw_vend \
> + PCI_DEVICE_SUB(BRCM_PCIE_VENDOR_ID_BROADCOM, (dev_id), \
> + (subvend), (subdev)), \
> + .class = PCI_CLASS_NETWORK_OTHER << 8, \
> + .class_mask = 0xffff00, \
> + .driver_data = BRCMF_DRVDATA_ ## fw_vend, \
> }
>
> static const struct pci_device_id brcmf_pcie_devid_table[] = {
> diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> index dd64d21174e3..4bc9bb406e8e 100644
> --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
> @@ -11366,37 +11366,41 @@ static int ipw_wdev_init(struct net_device *dev)
>
> /* PCI driver stuff */
> static const struct pci_device_id card_ids[] = {
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2701, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2702, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2711, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2712, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2721, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2722, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2731, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2732, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2741, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x103c, 0x2741, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2742, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2751, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2752, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2753, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2754, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2761, 0, 0, 0},
> - {PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2762, 0, 0, 0},
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2701) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2702) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2711) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2712) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2721) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2722) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2731) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2732) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2741) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x103c, 0x2741) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2742) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2751) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2752) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2753) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2754) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2761) },
> + { PCI_VDEVICE_SUB(INTEL, 0x1043, 0x8086, 0x2762) },
> +
> /*
> * This ID conflicts with i40e, but the devices can be differentiated
> * because i40e devices use PCI_CLASS_NETWORK_ETHERNET and ipw2200
> * devices use PCI_CLASS_NETWORK_OTHER.
> */
> - {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x104f),
> - PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, 0},
> - {PCI_VDEVICE(INTEL, 0x4220), 0}, /* BG */
> - {PCI_VDEVICE(INTEL, 0x4221), 0}, /* BG */
> - {PCI_VDEVICE(INTEL, 0x4223), 0}, /* ABG */
> - {PCI_VDEVICE(INTEL, 0x4224), 0}, /* ABG */
> + {
> + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x104f),
> + .class = PCI_CLASS_NETWORK_OTHER << 8,
> + .class_mask = 0xffff00,
> + },
> + { PCI_VDEVICE(INTEL, 0x4220) }, /* BG */
> + { PCI_VDEVICE(INTEL, 0x4221) }, /* BG */
> + { PCI_VDEVICE(INTEL, 0x4223) }, /* ABG */
> + { PCI_VDEVICE(INTEL, 0x4224) }, /* ABG */
>
> /* required last entry */
> - {0,}
> + { }
> };
>
> MODULE_DEVICE_TABLE(pci, card_ids);
>
> base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
^ permalink raw reply
* Re: Re: [PATCH net-next v7 4/4] riscv: dts: eswin: eic7700-hifive-premier-p550: enable Ethernet controller
From: 李志 @ 2026-04-30 7:05 UTC (permalink / raw)
To: Andrew Lunn
Cc: devicetree, andrew+netdev, davem, edumazet, kuba, robh, krzk+dt,
conor+dt, netdev, pabeni, mcoquelin.stm32, alexandre.torgue,
rmk+kernel, pjw, palmer, aou, alex, linux-riscv, linux-stm32,
linux-arm-kernel, linux-kernel, maxime.chevallier, ningyu, linmin,
pinkesh.vaghela, pritesh.patel, weishangjuan, horms
In-Reply-To: <d662fa07-cd0f-48c4-a6e4-03c5fd390e92@lunn.ch>
> -----原始邮件-----
> 发件人: "Andrew Lunn" <andrew@lunn.ch>
> 发送时间:2026-04-29 09:41:53 (星期三)
> 收件人: lizhi2@eswincomputing.com
> 抄送: devicetree@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, rmk+kernel@armlinux.org.uk, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maxime.chevallier@bootlin.com, ningyu@eswincomputing.com, linmin@eswincomputing.com, pinkesh.vaghela@einfochips.com, pritesh.patel@einfochips.com, weishangjuan@eswincomputing.com, horms@kernel.org
> 主题: Re: [PATCH net-next v7 4/4] riscv: dts: eswin: eic7700-hifive-premier-p550: enable Ethernet controller
>
> > +&gmac1 {
> > + phy-handle = <&gmac1_phy0>;
> > + /*
> > + * For the TX path of gmac1, there is a skew between the TX clock
> > + * and data on the MAC controller inside the silicon. This skew happens
> > + * to be approximately 2 ns. Therefore, it can be considered that the
> > + * 2 ns delay of TX is provided by the MAC.
> > + * No delay configuration for tx is needed in software via PHY driver.
> > + */
> > + phy-mode = "rgmii-rxid";
>
> This is wrong. Take a read of
>
> https://elixir.bootlin.com/linux/v6.15/source/Documentation/devicetree/bindings/net/ethernet-controller.yaml#L287
>
> phy-mode describes the board. If the board provides the 2ns delay, you
> use rgmii. If the MAC/PHY pair needs to provide the delay, you using
> rgmii-id.
>
> If rgmii-id is used, it is up to the MAC/PHY to decide which will add
> the delay. If the MAC adds the delay, it needs to mask the value of
> phy-mode it passes to the PHY so it does not also add the delay.
>
> Your broken hardware means you cannot support 'rgmii' or 'rgmii-rx',
> since you cannot turn off this 2ns delay, so you end up with double
> delays if anybody designs a board with 2ns TX delay on the board
> itself. So please validate the PHY modes and return -EINVAL if these
> modes are used.
>
Thanks for the detailed explanation.
You are right that phy-mode should describe the board-level
configuration and should not be modified in the DT to reflect
MAC-internal behavior.
For this hardware, the MAC unconditionally introduces an ~2 ns
TX delay which cannot be disabled. This means the configuration
effectively matches rgmii-id at the board level, where TX delay
is provided by the MAC and RX delay by the PHY.
I will therefore:
- Keep the DT using phy-mode = "rgmii-id" to correctly describe
the board-level timing.
- In the driver, mask the phy_interface passed to the PHY so that
it does not add TX delay, avoiding double delay.
- Explicitly reject unsupported modes such as "rgmii" and
"rgmii-rxid", since the MAC TX delay cannot be disabled and
these configurations would lead to incorrect timing.
Regarding the tx-internal-delay-ps property, it represents the
total effective TX delay on the line, including the inherent
~2 ns skew introduced by the MAC silicon. The driver subtracts
this inherent skew and programs only the remaining delay.
As a result, for the clk-inversion variant, the valid range is
[2000, 4540], which matches the updated binding constraints.
I will clarify in the binding description that this property
represents the total TX delay (MAC + programmable), to avoid
ambiguity.
Thanks for pointing this out.
^ permalink raw reply
* [PATCH net] ipmr: prevent info-leak in pmr_cache_report()
From: Eric Dumazet @ 2026-04-30 7:06 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Ido Schimmel, David Ahern, Simon Horman, netdev, eric.dumazet,
Eric Dumazet, Yiming Qian
Yiming Qian reported:
<quote>
ipmr_cache_report()` allocates a report skb with `alloc_skb(128,
GFP_ATOMIC)` and appends a `struct igmphdr` using `skb_put()`. In the
non-`IGMPMSG_WHOLEPKT` path it initializes only:
- `igmp->type`
- `igmp->code`
but does not initialize:
- `igmp->csum`
- `igmp->group`
Later, `igmpmsg_netlink_event()` copies the bytes after `sizeof(struct
igmpmsg)` into the `IPMRA_CREPORT_PKT` netlink attribute and emits
`RTM_NEWCACHEREPORT` on `RTNLGRP_IPV4_MROUTE_R`.
As a result, 6 bytes of stale heap data from the skb head are
disclosed to userspace.
</quote>
Let's use skb_put_zero() instead of skb_put() to fix this bug.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Yiming Qian <yimingqian591@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/ipv4/ipmr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 2058ca860294b01385063555d0354b7a9a736118..05fb6eefe0beb3c45c7ec485692460b84cb332c4 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1112,11 +1112,12 @@ static int ipmr_cache_report(const struct mr_table *mrt,
msg->im_vif_hi = vifi >> 8;
ipv4_pktinfo_prepare(mroute_sk, pkt, false);
memcpy(skb->cb, pkt->cb, sizeof(skb->cb));
- /* Add our header */
- igmp = skb_put(skb, sizeof(struct igmphdr));
+ /* Add our header.
+ * Note that code, csum and group fields are cleared.
+ */
+ igmp = skb_put_zero(skb, sizeof(struct igmphdr));
igmp->type = assert;
msg->im_msgtype = assert;
- igmp->code = 0;
ip_hdr(skb)->tot_len = htons(skb->len); /* Fix the length */
skb->transport_header = skb->network_header;
}
--
2.54.0.545.g6539524ca2-goog
^ permalink raw reply related
* [PATCH] vsock/virtio: fix vsockmon info leak in non-linear tap copy
From: Yiqi Sun @ 2026-04-30 7:11 UTC (permalink / raw)
To: kvm, virtualization
Cc: netdev, linux-kernel, stefanha, sgarzare, mst, jasowang, xuanzhuo,
eperezma, davem, edumazet, kuba, pabeni, horms, Yiqi Sun
vsockmon mirrors packets through virtio_transport_build_skb(), which
builds a new skb and copies the payload into it. For non-linear skbs,
this goes through virtio_transport_copy_nonlinear_skb().
Helper manually initializes a iov_iter, but leaves iov_iter.count unset.
As a result, skb_copy_datagram_iter() sees zero writable bytes
in the destination iterator and copies no payload data.
This becomes an info leak because virtio_transport_build_skb() has
already reserved payload_len bytes in the new skb with skb_put(). The
skb is then returned to the tap path with that payload area still
uninitialized, so userspace reading from a vsockmon device can observe
heap contents and potentially kernel address.
Fix it by initializing iov_iter.count to the number of bytes to copy.
Fixes: 4b0bf10eb077 ("vsock/virtio: non-linear skb handling for tap")
Signed-off-by: Yiqi Sun <sunyiqixm@gmail.com>
---
net/vmw_vsock/virtio_transport_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 416d533f493d..6b26ee57ccab 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -152,7 +152,7 @@ static void virtio_transport_copy_nonlinear_skb(const struct sk_buff *skb,
iov_iter.nr_segs = 1;
to_copy = min_t(size_t, len, skb->len);
-
+ iov_iter.count = to_copy;
skb_copy_datagram_iter(skb, VIRTIO_VSOCK_SKB_CB(skb)->offset,
&iov_iter, to_copy);
}
--
2.34.1
^ permalink raw reply related
* Re: [PATCH net v2 2/4] net: macb: drop in-flight Tx SKBs on close
From: Nicolai Buchwitz @ 2026-04-30 7:14 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Théo Lebrun, Nicolas Ferre, Claudiu Beznea, Andrew Lunn,
David S. Miller, Eric Dumazet, Paolo Abeni, Haavard Skinnemoen,
Jeff Garzik, Paolo Valerio, Conor Dooley, netdev, linux-kernel,
Vladimir Kondratiev, Gregory CLEMENT, Benoît Monin,
Tawfik Bayouk, Thomas Petazzoni, Maxime Chevallier, stable
In-Reply-To: <20260429193446.5985abea@kernel.org>
Hi Théo and Jacub
On 30.4.2026 04:34, Jakub Kicinski wrote:
> On Tue, 28 Apr 2026 18:32:58 +0200 Théo Lebrun wrote:
>> for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
>> - kfree(queue->tx_skb);
>> - queue->tx_skb = NULL;
>> + if (queue->tx_skb) {
>> + unsigned int dropped = 0, tail;
>> +
>> + for (tail = queue->tx_tail; tail != queue->tx_head;
>> + tail++) {
>> + if (macb_tx_skb(queue, tail)->skb)
>> + dropped++;
>> + macb_tx_unmap(bp, macb_tx_skb(queue, tail), 0,
>> + SKB_DROP_REASON_NOT_SPECIFIED);
>> + }
>> +
>> + queue->stats.tx_dropped += dropped;
>> + bp->dev->stats.tx_dropped += dropped;
>
> I'm slightly baffled by the stats in this driver.
>
> Incrementing of both device and queue stats is highly unusual.
> The driver seems to already have the values for the per-queue drops
> but currently never increments it (did I miss it?) It does for Rx
> stats but not for Tx stats.
>
> As sashiko correctly points out incrementing dev stats will lead
> to races and lass of increments for multi-queue devices.
>
> Since there are no increments for tx_dropped stat today - could you
> please delete it from ethtool -S, migrate the only existing
> dev->stats.tx_dropped++; to increment the per-queue stat and make
> macb_get_stats() collect the tx_dropped from all queues, instead
> of relying on the device-level stat?
Would make sense, yes. While we're already cleaning this up, two
more things possibly worth touching:
1. macb_start_xmit() drops the skb on macb_clear_csum() and
macb_pad_and_fcs() failures without counting it. Both could
use a tx_dropped++.
2. tx_packets / tx_bytes already increment per-queue but never
rach nstat (rx side too). Could just pick them up in the same
loop.
> [...]
Thanks,
Nicolai
^ permalink raw reply
* Re: [PATCH ipsec] esp: Force skb_cow_data() on RX when the skb is non-linear
From: Hyunwoo Kim @ 2026-04-30 7:16 UTC (permalink / raw)
To: Herbert Xu
Cc: steffen.klassert, davem, dsahern, edumazet, kuba, pabeni, horms,
ilant, sowmini.varadhan, netdev, imv4bel
In-Reply-To: <afLZ6Fl6b2ChTnus@gondor.apana.org.au>
On Thu, Apr 30, 2026 at 12:26:16PM +0800, Herbert Xu wrote:
> On Thu, Apr 30, 2026 at 11:49:13AM +0900, Hyunwoo Kim wrote:
> > esp_input() and esp6_input() skip skb_cow_data() on uncloned skbs
> > through two arms: one for fully linear skbs (nfrags = 1) and one for
> > skbs carrying paged fragments without a frag_list, which sets
> > nfrags = skb_shinfo(skb)->nr_frags + 1. In both arms the skb is mapped
> > into a scatterlist via skb_to_sgvec() and passed as both src and dst of
> > aead_request_set_crypt(), so the AEAD operates in place over the
> > existing frag pages.
> >
> > Drop the paged-fragment arm so any non-linear inbound skb falls through
> > to skb_cow_data(). The fully linear fast path is unchanged and the
> > existing skb_cow_data() error handling that follows the gate is reused.
> >
> > Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible")
> > Fixes: 03e2a30f6a27 ("esp6: Avoid skb_cow_data whenever possible")
> > Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
> > ---
> > net/ipv4/esp4.c | 13 +++----------
> > net/ipv6/esp6.c | 13 +++----------
> > 2 files changed, 6 insertions(+), 20 deletions(-)
>
> Good catch!
>
> When a packet comes from a device driver, it's usually safe to
> write to the fragments since they would have been allocated by
> the driver.
>
> But when a packet originates from our own stack, then it's not
> safe to write to the fragments.
>
> Unfortunately the two paths cross with the loopback driver (and
> probably other means of creating loopback).
>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thank you for the review.
If it's not too much trouble, I would be grateful if you could also
take a look at this rxrpc patch, which addresses a similar bug:
https://lore.kernel.org/all/afKV2zGR6rrelPC7@v4bel/
Best regards,
Hyunwoo Kim
>
> Thanks,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox