Skip to content

Commit c5e3deb

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Re-factor bnxt_setup_tc().
Add a new function bnxt_setup_mq_tc() to handle MQPRIO. This new function will be called during ETS setup when we add DCBNL in the next patch. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c7a6131 commit c5e3deb

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6337,17 +6337,10 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)
63376337
return 0;
63386338
}
63396339

6340-
static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
6341-
struct tc_to_netdev *ntc)
6340+
int bnxt_setup_mq_tc(struct net_device *dev, u8 tc)
63426341
{
63436342
struct bnxt *bp = netdev_priv(dev);
63446343
bool sh = false;
6345-
u8 tc;
6346-
6347-
if (ntc->type != TC_SETUP_MQPRIO)
6348-
return -EINVAL;
6349-
6350-
tc = ntc->tc;
63516344

63526345
if (tc > bp->max_tc) {
63536346
netdev_err(dev, "too many traffic classes requested: %d Max supported is %d\n",
@@ -6390,6 +6383,15 @@ static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
63906383
return 0;
63916384
}
63926385

6386+
static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
6387+
struct tc_to_netdev *ntc)
6388+
{
6389+
if (ntc->type != TC_SETUP_MQPRIO)
6390+
return -EINVAL;
6391+
6392+
return bnxt_setup_mq_tc(dev, ntc->tc);
6393+
}
6394+
63936395
#ifdef CONFIG_RFS_ACCEL
63946396
static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1,
63956397
struct bnxt_ntuple_filter *f2)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,5 +1225,6 @@ int bnxt_hwrm_set_link_setting(struct bnxt *, bool, bool);
12251225
int bnxt_hwrm_fw_set_time(struct bnxt *);
12261226
int bnxt_open_nic(struct bnxt *, bool, bool);
12271227
int bnxt_close_nic(struct bnxt *, bool, bool);
1228+
int bnxt_setup_mq_tc(struct net_device *dev, u8 tc);
12281229
int bnxt_get_max_rings(struct bnxt *, int *, int *, bool);
12291230
#endif

0 commit comments

Comments
 (0)