diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 447098005490..9a23d33a47ed 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -6201,7 +6201,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter, | |||
6201 | 6201 | ||
6202 | adapter->mac_table = kcalloc(hw->mac.num_rar_entries, | 6202 | adapter->mac_table = kcalloc(hw->mac.num_rar_entries, |
6203 | sizeof(struct ixgbe_mac_addr), | 6203 | sizeof(struct ixgbe_mac_addr), |
6204 | GFP_ATOMIC); | 6204 | GFP_KERNEL); |
6205 | if (!adapter->mac_table) | 6205 | if (!adapter->mac_table) |
6206 | return -ENOMEM; | 6206 | return -ENOMEM; |
6207 | 6207 | ||
@@ -6620,8 +6620,18 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu) | |||
6620 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 6620 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
6621 | 6621 | ||
6622 | if (adapter->xdp_prog) { | 6622 | if (adapter->xdp_prog) { |
6623 | e_warn(probe, "MTU cannot be changed while XDP program is loaded\n"); | 6623 | int new_frame_size = new_mtu + ETH_HLEN + ETH_FCS_LEN + |
6624 | return -EPERM; | 6624 | VLAN_HLEN; |
6625 | int i; | ||
6626 | |||
6627 | for (i = 0; i < adapter->num_rx_queues; i++) { | ||
6628 | struct ixgbe_ring *ring = adapter->rx_ring[i]; | ||
6629 | |||
6630 | if (new_frame_size > ixgbe_rx_bufsz(ring)) { | ||
6631 | e_warn(probe, "Requested MTU size is not supported with XDP\n"); | ||
6632 | return -EINVAL; | ||
6633 | } | ||
6634 | } | ||
6625 | } | 6635 | } |
6626 | 6636 | ||
6627 | /* | 6637 | /* |
@@ -8983,6 +8993,15 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc) | |||
8983 | 8993 | ||
8984 | #ifdef CONFIG_IXGBE_DCB | 8994 | #ifdef CONFIG_IXGBE_DCB |
8985 | if (tc) { | 8995 | if (tc) { |
8996 | if (adapter->xdp_prog) { | ||
8997 | e_warn(probe, "DCB is not supported with XDP\n"); | ||
8998 | |||
8999 | ixgbe_init_interrupt_scheme(adapter); | ||
9000 | if (netif_running(dev)) | ||
9001 | ixgbe_open(dev); | ||
9002 | return -EINVAL; | ||
9003 | } | ||
9004 | |||
8986 | netdev_set_num_tc(dev, tc); | 9005 | netdev_set_num_tc(dev, tc); |
8987 | ixgbe_set_prio_tc_map(adapter); | 9006 | ixgbe_set_prio_tc_map(adapter); |
8988 | 9007 | ||
@@ -9171,14 +9190,12 @@ static int parse_tc_actions(struct ixgbe_adapter *adapter, | |||
9171 | struct tcf_exts *exts, u64 *action, u8 *queue) | 9190 | struct tcf_exts *exts, u64 *action, u8 *queue) |
9172 | { | 9191 | { |
9173 | const struct tc_action *a; | 9192 | const struct tc_action *a; |
9174 | LIST_HEAD(actions); | 9193 | int i; |
9175 | 9194 | ||
9176 | if (!tcf_exts_has_actions(exts)) | 9195 | if (!tcf_exts_has_actions(exts)) |
9177 | return -EINVAL; | 9196 | return -EINVAL; |
9178 | 9197 | ||
9179 | tcf_exts_to_list(exts, &actions); | 9198 | tcf_exts_for_each_action(i, a, exts) { |
9180 | list_for_each_entry(a, &actions, list) { | ||
9181 | |||
9182 | /* Drop action */ | 9199 | /* Drop action */ |
9183 | if (is_tcf_gact_shot(a)) { | 9200 | if (is_tcf_gact_shot(a)) { |
9184 | *action = IXGBE_FDIR_DROP_QUEUE; | 9201 | *action = IXGBE_FDIR_DROP_QUEUE; |
@@ -9936,6 +9953,11 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev) | |||
9936 | int tcs = adapter->hw_tcs ? : 1; | 9953 | int tcs = adapter->hw_tcs ? : 1; |
9937 | int pool, err; | 9954 | int pool, err; |
9938 | 9955 | ||
9956 | if (adapter->xdp_prog) { | ||
9957 | e_warn(probe, "L2FW offload is not supported with XDP\n"); | ||
9958 | return ERR_PTR(-EINVAL); | ||
9959 | } | ||
9960 | |||
9939 | /* The hardware supported by ixgbe only filters on the destination MAC | 9961 | /* The hardware supported by ixgbe only filters on the destination MAC |
9940 | * address. In order to avoid issues we only support offloading modes | 9962 | * address. In order to avoid issues we only support offloading modes |
9941 | * where the hardware can actually provide the functionality. | 9963 | * where the hardware can actually provide the functionality. |