mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 23:51:37 +00:00
bnxt_en: Refactor bnxt_set_features()
Refactor bnxt_set_features() function to have a common function to re-init. We'll need this to reinitialize when ntuple configuration changes. Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com> Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
8c81ae6c54
commit
5d5b90fb4e
@ -12431,6 +12431,16 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
|
|||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int bnxt_reinit_features(struct bnxt *bp, bool irq_re_init,
|
||||||
|
bool link_re_init, u32 flags, bool update_tpa)
|
||||||
|
{
|
||||||
|
bnxt_close_nic(bp, irq_re_init, link_re_init);
|
||||||
|
bp->flags = flags;
|
||||||
|
if (update_tpa)
|
||||||
|
bnxt_set_ring_params(bp);
|
||||||
|
return bnxt_open_nic(bp, irq_re_init, link_re_init);
|
||||||
|
}
|
||||||
|
|
||||||
static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
|
static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
|
||||||
{
|
{
|
||||||
struct bnxt *bp = netdev_priv(dev);
|
struct bnxt *bp = netdev_priv(dev);
|
||||||
@ -12479,14 +12489,9 @@ static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (re_init) {
|
if (re_init)
|
||||||
bnxt_close_nic(bp, false, false);
|
return bnxt_reinit_features(bp, false, false, flags, update_tpa);
|
||||||
bp->flags = flags;
|
|
||||||
if (update_tpa)
|
|
||||||
bnxt_set_ring_params(bp);
|
|
||||||
|
|
||||||
return bnxt_open_nic(bp, false, false);
|
|
||||||
}
|
|
||||||
if (update_tpa) {
|
if (update_tpa) {
|
||||||
bp->flags = flags;
|
bp->flags = flags;
|
||||||
rc = bnxt_set_tpa(bp,
|
rc = bnxt_set_tpa(bp,
|
||||||
|
Loading…
Reference in New Issue
Block a user