Skip to content

Commit 6e89da2

Browse files
committed
linux/ena update ENA linux driver to version 2.1.4
**New Features** * Add support for the RX offset feature - where the device writes data with an offset from the beginning of an RX buffer. Signed-off-by: Sameeh Jubran <[email protected]> Signed-off-by: Arthur Kiyanovski <[email protected]>
1 parent a67b46c commit 6e89da2

File tree

10 files changed

+39
-18
lines changed

10 files changed

+39
-18
lines changed

kernel/linux/common/ena_com/ena_admin_defs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,8 @@ struct ena_admin_host_info {
821821

822822
u16 reserved;
823823

824-
/* 1:0 : reserved
824+
/* 0 : reserved
825+
* 1 : rx_offset
825826
* 2 : interrupt_moderation
826827
* 31:3 : reserved
827828
*/
@@ -1137,6 +1138,8 @@ struct ena_admin_ena_mmio_req_read_less_resp {
11371138
#define ENA_ADMIN_HOST_INFO_DEVICE_MASK GENMASK(7, 3)
11381139
#define ENA_ADMIN_HOST_INFO_BUS_SHIFT 8
11391140
#define ENA_ADMIN_HOST_INFO_BUS_MASK GENMASK(15, 8)
1141+
#define ENA_ADMIN_HOST_INFO_RX_OFFSET_SHIFT 1
1142+
#define ENA_ADMIN_HOST_INFO_RX_OFFSET_MASK BIT(1)
11401143
#define ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_SHIFT 2
11411144
#define ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_MASK BIT(2)
11421145

kernel/linux/common/ena_com/ena_eth_com.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ int ena_com_rx_pkt(struct ena_com_io_cq *io_cq,
521521
struct ena_eth_io_rx_cdesc_base *cdesc = NULL;
522522
u16 cdesc_idx = 0;
523523
u16 nb_hw_desc;
524-
u16 i;
524+
u16 i = 0;
525525

526526
WARN(io_cq->direction != ENA_COM_IO_QUEUE_DIRECTION_RX, "wrong Q type");
527527

@@ -540,13 +540,14 @@ int ena_com_rx_pkt(struct ena_com_io_cq *io_cq,
540540
return -ENOSPC;
541541
}
542542

543-
for (i = 0; i < nb_hw_desc; i++) {
544-
cdesc = ena_com_rx_cdesc_idx_to_ptr(io_cq, cdesc_idx + i);
543+
cdesc = ena_com_rx_cdesc_idx_to_ptr(io_cq, cdesc_idx);
544+
ena_rx_ctx->pkt_offset = cdesc->offset;
545545

546+
do {
546547
ena_buf->len = cdesc->length;
547548
ena_buf->req_id = cdesc->req_id;
548549
ena_buf++;
549-
}
550+
} while ((++i < nb_hw_desc) && (cdesc = ena_com_rx_cdesc_idx_to_ptr(io_cq, cdesc_idx + i)));
550551

551552
/* Update SQ head ptr */
552553
io_sq->next_to_comp += nb_hw_desc;

kernel/linux/common/ena_com/ena_eth_com.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct ena_com_rx_ctx {
7373
u32 hash;
7474
u16 descs;
7575
int max_bufs;
76+
u8 pkt_offset;
7677
};
7778

7879
int ena_com_prepare_tx(struct ena_com_io_sq *io_sq,

kernel/linux/common/ena_com/ena_eth_io_defs.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ struct ena_eth_io_rx_cdesc_base {
264264

265265
u16 sub_qid;
266266

267-
u16 reserved;
267+
u8 offset;
268+
269+
u8 reserved;
268270
};
269271

270272
/* 8-word format */

kernel/linux/ena/RELEASENOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ The driver was verified on the following distributions:
3939
SUSE Linux Enterprise Server 12 SP2
4040
SUSE Linux Enterprise Server 12 SP3
4141

42+
## r2.1.4 release notes
43+
**New Features**
44+
* Add support for the RX offset feature - where the device writes data
45+
with an offset from the beginning of an RX buffer.
46+
4247
## r2.1.3 release notes
4348
**New Features**
4449
* Replace old adaptive interrupt moderation algorithm with the DIM

kernel/linux/ena/ena_netdev.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,8 @@ static struct sk_buff *ena_alloc_skb(struct ena_ring *rx_ring, bool frags)
891891
static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
892892
struct ena_com_rx_buf_info *ena_bufs,
893893
u32 descs,
894-
u16 *next_to_clean)
894+
u16 *next_to_clean,
895+
u8 offset)
895896
{
896897
struct sk_buff *skb;
897898
struct ena_rx_buffer *rx_info;
@@ -911,6 +912,7 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
911912
}
912913

913914
rx_info = &rx_ring->rx_buffer_info[req_id];
915+
rx_info->page_offset = offset;
914916

915917
if (unlikely(!rx_info->page)) {
916918
netif_err(rx_ring->adapter, rx_err, rx_ring->netdev,
@@ -974,6 +976,8 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
974976

975977
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, rx_info->page,
976978
rx_info->page_offset, len, ENA_PAGE_SIZE);
979+
/* The offset is non zero only for the first buffer */
980+
rx_info->page_offset = 0;
977981

978982
netif_dbg(rx_ring->adapter, rx_status, rx_ring->netdev,
979983
"rx skb updated. len %d. data_len %d\n",
@@ -1141,6 +1145,7 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
11411145
ena_rx_ctx.ena_bufs = rx_ring->ena_bufs;
11421146
ena_rx_ctx.max_bufs = rx_ring->sgl_size;
11431147
ena_rx_ctx.descs = 0;
1148+
ena_rx_ctx.pkt_offset = 0;
11441149
rc = ena_com_rx_pkt(rx_ring->ena_com_io_cq,
11451150
rx_ring->ena_com_io_sq,
11461151
&ena_rx_ctx);
@@ -1157,7 +1162,7 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
11571162

11581163
/* allocate skb and fill it */
11591164
skb = ena_rx_skb(rx_ring, rx_ring->ena_bufs, ena_rx_ctx.descs,
1160-
&next_to_clean);
1165+
&next_to_clean, ena_rx_ctx.pkt_offset);
11611166

11621167
/* exit if we failed to retrieve a buffer */
11631168
if (unlikely(!skb)) {
@@ -2664,6 +2669,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev, struct pci_dev *pd
26642669
host_info->num_cpus = num_online_cpus();
26652670

26662671
host_info->driver_supported_features =
2672+
ENA_ADMIN_HOST_INFO_RX_OFFSET_MASK |
26672673
ENA_ADMIN_HOST_INFO_INTERRUPT_MODERATION_MASK;
26682674

26692675
rc = ena_com_set_host_attributes(ena_dev);

kernel/linux/ena/ena_netdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
#define DRV_MODULE_VER_MAJOR 2
5454
#define DRV_MODULE_VER_MINOR 1
55-
#define DRV_MODULE_VER_SUBMINOR 3
55+
#define DRV_MODULE_VER_SUBMINOR 4
5656

5757
#define DRV_MODULE_NAME "ena"
5858
#ifndef DRV_MODULE_VERSION

kernel/linux/rpm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Author: Cristian Gafton <[email protected]>
44

55
NAME = ena
6-
VERSION = 2.1.3
6+
VERSION = 2.1.4
77

88
TOPDIR := $(shell git rev-parse --show-toplevel)
99

kernel/linux/rpm/README-rpm.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Once the pre-requisites have been installed, you can simply issue a
3232
"make" in this directory to build the kmod src.rpm package:
3333

3434
bash$ make
35-
cd .. && git archive --format=tar --prefix=ena-2.1.3/ -o rpm/ena-2.1.3.tar ena_linux_2.1.3
35+
cd .. && git archive --format=tar --prefix=ena-2.1.4/ -o rpm/ena-2.1.4.tar ena_linux_2.1.4
3636
rpmbuild -bs \
3737
--define '_topdir %(pwd)' --define '_ntopdir %(pwd)' \
3838
--define '_builddir %{_ntopdir}' \
@@ -41,7 +41,7 @@ rpmbuild -bs \
4141
--define '_rpmdir %{_ntopdir}' \
4242
--define '_srcrpmdir %{_ntopdir}' \
4343
ena.spec
44-
Wrote: /home/ec2-user/amzn-drivers/rpm/ena-2.1.3-1.el7.3.src.rpm
44+
Wrote: /home/ec2-user/amzn-drivers/rpm/ena-2.1.4-1.el7.3.src.rpm
4545
bash$ _
4646

4747

@@ -50,16 +50,16 @@ COMPILING AND INSTALLING
5050
Once the src.rpm has been created, you can build binary packages for
5151
the installed kernel-devel and kernel-headers environments:
5252

53-
bash$ rpmbuild --rebuild ena-2.1.3-1.el7.3.src.rpm
53+
bash$ rpmbuild --rebuild ena-2.1.4-1.el7.3.src.rpm
5454
[....]
55-
Wrote: /home/ec2-user/rpmbuild/RPMS/x86_64/kmod-ena-2.1.3-1.el7.3.x86_64.rpm
56-
Wrote: /home/ec2-user/rpmbuild/RPMS/x86_64/ena-debuginfo-2.1.3-1.el7.3.x86_64.rpm
55+
Wrote: /home/ec2-user/rpmbuild/RPMS/x86_64/kmod-ena-2.1.4-1.el7.3.x86_64.rpm
56+
Wrote: /home/ec2-user/rpmbuild/RPMS/x86_64/ena-debuginfo-2.1.4-1.el7.3.x86_64.rpm
5757
[...]
5858
bash$ _
5959

6060
Now you should be able to install/deploy the resulting binary rpm
6161
packages using your preferred rpm install too. For example, using yum:
6262

6363
bash$ sudo yum -y localinstall
64-
/home/ec2-user/rpmbuild/RPMS/x86_64/kmod-ena-2.1.3-1.el7.3.x86_64.rpm
64+
/home/ec2-user/rpmbuild/RPMS/x86_64/kmod-ena-2.1.4-1.el7.3.x86_64.rpm
6565

kernel/linux/rpm/ena.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%define kmod_name ena
2-
%define kmod_driver_version 2.1.3
2+
%define kmod_driver_version 2.1.4
33
%define kmod_rpm_release 1
44
%define kmod_git_hash 3ac3e0bf079b2c0468f759f2213541e214a6dd77
55
%define kmod_kbuild_dir kernel/linux/ena
@@ -22,7 +22,7 @@ Source7: preamble
2222

2323
Name: %{kmod_name}
2424
Version: %{kmod_driver_version}
25-
Release: %{kmod_rpm_release}%{?dist}.14
25+
Release: %{kmod_rpm_release}%{?dist}.15
2626
Summary: %{kmod_name} kernel module
2727

2828
Group: System/Kernel
@@ -99,6 +99,9 @@ install -m 644 -D source/%{kmod_kbuild_dir}/RELEASENOTES.md $RPM_BUILD_ROOT/usr/
9999
rm -rf $RPM_BUILD_ROOT
100100

101101
%changelog
102+
* Thu Dec 12 2019 Arthur Kiyanovski [email protected] - 2.1.4-1.15
103+
- Update ENA driver to version 2.1.4
104+
102105
* Wed Oct 23 2019 Arthur Kiyanovski [email protected] - 2.1.3-1.14
103106
- Update ENA driver to version 2.1.3
104107

0 commit comments

Comments
 (0)