Skip to content

Commit 004688c

Browse files
praczynsanguy11
authored andcommitted
ice: export ice ndo_ops functions
Make some of the netdevice_ops functions visible from outside for another VSI type created netdev. Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Piotr Raczynski <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 597b8af commit 004688c

File tree

4 files changed

+35
-29
lines changed

4 files changed

+35
-29
lines changed

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,14 @@ void ice_unload(struct ice_pf *pf);
10031003
void ice_adv_lnk_speed_maps_init(void);
10041004
int ice_init_dev(struct ice_pf *pf);
10051005
void ice_deinit_dev(struct ice_pf *pf);
1006+
int ice_change_mtu(struct net_device *netdev, int new_mtu);
1007+
void ice_tx_timeout(struct net_device *netdev, unsigned int txqueue);
1008+
int ice_xdp(struct net_device *dev, struct netdev_bpf *xdp);
1009+
void ice_set_netdev_features(struct net_device *netdev);
1010+
int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid);
1011+
int ice_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid);
1012+
void ice_get_stats64(struct net_device *netdev,
1013+
struct rtnl_link_stats64 *stats);
10061014

10071015
/**
10081016
* ice_set_rdma_cap - enable RDMA support

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,6 +2767,26 @@ void ice_vsi_clear_napi_queues(struct ice_vsi *vsi)
27672767
netif_queue_set_napi(netdev, q_idx, NETDEV_QUEUE_TYPE_RX, NULL);
27682768
}
27692769

2770+
/**
2771+
* ice_napi_add - register NAPI handler for the VSI
2772+
* @vsi: VSI for which NAPI handler is to be registered
2773+
*
2774+
* This function is only called in the driver's load path. Registering the NAPI
2775+
* handler is done in ice_vsi_alloc_q_vector() for all other cases (i.e. resume,
2776+
* reset/rebuild, etc.)
2777+
*/
2778+
void ice_napi_add(struct ice_vsi *vsi)
2779+
{
2780+
int v_idx;
2781+
2782+
if (!vsi->netdev)
2783+
return;
2784+
2785+
ice_for_each_q_vector(vsi, v_idx)
2786+
netif_napi_add(vsi->netdev, &vsi->q_vectors[v_idx]->napi,
2787+
ice_napi_poll);
2788+
}
2789+
27702790
/**
27712791
* ice_vsi_release - Delete a VSI and free its resources
27722792
* @vsi: the VSI being removed

drivers/net/ethernet/intel/ice/ice_lib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct ice_vsi *
4545
ice_vsi_setup(struct ice_pf *pf, struct ice_vsi_cfg_params *params);
4646

4747
void ice_vsi_set_napi_queues(struct ice_vsi *vsi);
48+
void ice_napi_add(struct ice_vsi *vsi);
4849

4950
void ice_vsi_clear_napi_queues(struct ice_vsi *vsi);
5051

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,7 +3092,7 @@ static int ice_xdp_safe_mode(struct net_device __always_unused *dev,
30923092
* @dev: netdevice
30933093
* @xdp: XDP command
30943094
*/
3095-
static int ice_xdp(struct net_device *dev, struct netdev_bpf *xdp)
3095+
int ice_xdp(struct net_device *dev, struct netdev_bpf *xdp)
30963096
{
30973097
struct ice_netdev_priv *np = netdev_priv(dev);
30983098
struct ice_vsi *vsi = np->vsi;
@@ -3558,26 +3558,6 @@ static int ice_req_irq_msix_misc(struct ice_pf *pf)
35583558
return 0;
35593559
}
35603560

3561-
/**
3562-
* ice_napi_add - register NAPI handler for the VSI
3563-
* @vsi: VSI for which NAPI handler is to be registered
3564-
*
3565-
* This function is only called in the driver's load path. Registering the NAPI
3566-
* handler is done in ice_vsi_alloc_q_vector() for all other cases (i.e. resume,
3567-
* reset/rebuild, etc.)
3568-
*/
3569-
static void ice_napi_add(struct ice_vsi *vsi)
3570-
{
3571-
int v_idx;
3572-
3573-
if (!vsi->netdev)
3574-
return;
3575-
3576-
ice_for_each_q_vector(vsi, v_idx)
3577-
netif_napi_add(vsi->netdev, &vsi->q_vectors[v_idx]->napi,
3578-
ice_napi_poll);
3579-
}
3580-
35813561
/**
35823562
* ice_set_ops - set netdev and ethtools ops for the given netdev
35833563
* @vsi: the VSI associated with the new netdev
@@ -3611,7 +3591,7 @@ static void ice_set_ops(struct ice_vsi *vsi)
36113591
* ice_set_netdev_features - set features for the given netdev
36123592
* @netdev: netdev instance
36133593
*/
3614-
static void ice_set_netdev_features(struct net_device *netdev)
3594+
void ice_set_netdev_features(struct net_device *netdev)
36153595
{
36163596
struct ice_pf *pf = ice_netdev_to_pf(netdev);
36173597
bool is_dvm_ena = ice_is_dvm_ena(&pf->hw);
@@ -3793,8 +3773,7 @@ ice_lb_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi)
37933773
*
37943774
* net_device_ops implementation for adding VLAN IDs
37953775
*/
3796-
static int
3797-
ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
3776+
int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
37983777
{
37993778
struct ice_netdev_priv *np = netdev_priv(netdev);
38003779
struct ice_vsi_vlan_ops *vlan_ops;
@@ -3856,8 +3835,7 @@ ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
38563835
*
38573836
* net_device_ops implementation for removing VLAN IDs
38583837
*/
3859-
static int
3860-
ice_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
3838+
int ice_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
38613839
{
38623840
struct ice_netdev_priv *np = netdev_priv(netdev);
38633841
struct ice_vsi_vlan_ops *vlan_ops;
@@ -7127,7 +7105,6 @@ void ice_update_pf_stats(struct ice_pf *pf)
71277105
* @netdev: network interface device structure
71287106
* @stats: main device statistics structure
71297107
*/
7130-
static
71317108
void ice_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
71327109
{
71337110
struct ice_netdev_priv *np = netdev_priv(netdev);
@@ -7804,7 +7781,7 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
78047781
*
78057782
* Returns 0 on success, negative on failure
78067783
*/
7807-
static int ice_change_mtu(struct net_device *netdev, int new_mtu)
7784+
int ice_change_mtu(struct net_device *netdev, int new_mtu)
78087785
{
78097786
struct ice_netdev_priv *np = netdev_priv(netdev);
78107787
struct ice_vsi *vsi = np->vsi;
@@ -8228,7 +8205,7 @@ ice_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
82288205
* @netdev: network interface device structure
82298206
* @txqueue: Tx queue
82308207
*/
8231-
static void ice_tx_timeout(struct net_device *netdev, unsigned int txqueue)
8208+
void ice_tx_timeout(struct net_device *netdev, unsigned int txqueue)
82328209
{
82338210
struct ice_netdev_priv *np = netdev_priv(netdev);
82348211
struct ice_tx_ring *tx_ring = NULL;

0 commit comments

Comments
 (0)