ena: Add XDP frame size to amazon NIC driver
Frame size ENA_PAGE_SIZE is limited to 16K on systems with larger PAGE_SIZE than 16K. Change ENA_XDP_MAX_MTU to also take into account the reserved tailroom. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Sameeh Jubran <sameehj@amazon.com> Cc: Arthur Kiyanovski <akiyano@amazon.com> Link: https://lore.kernel.org/bpf/158945341384.97035.907403694833419456.stgit@firesoul
This commit is contained in:

committed by
Alexei Starovoitov

parent
c88c35181d
commit
08fc1cfd2d
@@ -1606,6 +1606,7 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
|
|||||||
"%s qid %d\n", __func__, rx_ring->qid);
|
"%s qid %d\n", __func__, rx_ring->qid);
|
||||||
res_budget = budget;
|
res_budget = budget;
|
||||||
xdp.rxq = &rx_ring->xdp_rxq;
|
xdp.rxq = &rx_ring->xdp_rxq;
|
||||||
|
xdp.frame_sz = ENA_PAGE_SIZE;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
xdp_verdict = XDP_PASS;
|
xdp_verdict = XDP_PASS;
|
||||||
|
@@ -152,7 +152,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define ENA_XDP_MAX_MTU (ENA_PAGE_SIZE - ETH_HLEN - ETH_FCS_LEN - \
|
#define ENA_XDP_MAX_MTU (ENA_PAGE_SIZE - ETH_HLEN - ETH_FCS_LEN - \
|
||||||
VLAN_HLEN - XDP_PACKET_HEADROOM)
|
VLAN_HLEN - XDP_PACKET_HEADROOM - \
|
||||||
|
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
|
||||||
|
|
||||||
#define ENA_IS_XDP_INDEX(adapter, index) (((index) >= (adapter)->xdp_first_ring) && \
|
#define ENA_IS_XDP_INDEX(adapter, index) (((index) >= (adapter)->xdp_first_ring) && \
|
||||||
((index) < (adapter)->xdp_first_ring + (adapter)->xdp_num_queues))
|
((index) < (adapter)->xdp_first_ring + (adapter)->xdp_num_queues))
|
||||||
|
Reference in New Issue
Block a user